Fixture 35
matrix chain
C · 1 functions · 4 lanes · 4 of 4 function-lanes behave identically
All 4 lanes recompile and return the same results as the original.
Matrix-chain multiplication cost by interval dynamic programming. The triangular iteration order (length, then start, then split) yields three nested loops whose bounds all depend on the enclosing induction variable.
#include <stdint.h>
/* Matrix-chain multiplication cost by interval dynamic programming. The
* triangular iteration order (length, then start, then split) yields three
* nested loops whose bounds all depend on the enclosing induction variable. */
#define CHAIN_MAX 7
#define CHAIN_STRIDE (CHAIN_MAX + 1)
#define CHAIN_INFINITE 2000000000
__attribute__((noinline)) int32_t
matrix_chain_cost(const int32_t *dimensions, int32_t matrices) {
int32_t cost[CHAIN_STRIDE * CHAIN_STRIDE];
int32_t length;
int32_t start;
int32_t split;
int32_t i;
int32_t j;
if (dimensions == 0 || matrices < 1 || matrices > CHAIN_MAX) {
return -1;
}
for (i = 0; i < CHAIN_STRIDE; ++i) {
for (j = 0; j < CHAIN_STRIDE; ++j) {
cost[i * CHAIN_STRIDE + j] = 0;
}
}
for (i = 0; i <= matrices; ++i) {
if (dimensions[i] <= 0 || dimensions[i] > 64) {
return -2;
}
}
for (length = 2; length <= matrices; ++length) {
for (start = 0; start + length - 1 < matrices; ++start) {
int32_t end = start + length - 1;
int32_t best = CHAIN_INFINITE;
for (split = start; split < end; ++split) {
int32_t left = cost[start * CHAIN_STRIDE + split];
int32_t right = cost[(split + 1) * CHAIN_STRIDE + end];
int32_t merge = dimensions[start] * dimensions[split + 1] *
dimensions[end + 1];
int32_t candidate = left + right + merge;
if (candidate < best) {
best = candidate;
}
}
cost[start * CHAIN_STRIDE + end] = best;
}
}
return cost[matrices - 1];
} Recovered C
Generated by glaurung decompile --style decbench at b47f6b43.
baseline.json records the result after recompiling the C and calling it beside the
original with seeded inputs.
clang -O0
1/1matrix_chain_cost pass 108 lines
// glaurung: matrix_chain_cost @ 0x1100
__attribute__((no_stack_protector)) int32_t matrix_chain_cost(const int32_t * arg0, int32_t arg1) {
int i;
int j;
int length;
int start;
int end;
int best;
int split;
int left;
int right;
int merge;
int candidate;
unsigned char local_120[256];
int local_4;
long t179;
long t180;
if ((arg0 != 0)) {
if ((1 <= (long)(arg1))) {
if ((((unsigned long)((unsigned int)(arg1)) == 7) | ((long)(arg1) < 7))) {
goto L_113d;
}
}
}
local_4 = -1;
// x86-64 epilogue: restore rbp
return (unsigned int)(local_4);
L_113d: ;
i = 0;
L_1147: ;
if ((8 <= (long)(i))) {
goto L_11b4;
}
j = 0;
L_115e: ;
if (((long)(j) < 8)) {
*(int *)((&local_120[0] + ((long)((int)(((unsigned long)((unsigned int)(((unsigned long)((unsigned int)(i)) << 3))) + j))) * 4))) = 0;
j = ((unsigned int)(j) + 1);
goto L_115e;
}
goto L_11a0;
L_11a0: ;
i = ((unsigned int)(i) + 1);
goto L_1147;
L_11b4: ;
i = 0;
L_11be: ;
if (((((unsigned int)(i) == (unsigned int)(arg1)) | (i < arg1)) == 0)) {
goto L_121c;
}
t179 = arg0[(long)(i)];
if (((((unsigned long)((unsigned int)(t179)) == 0) | ((long)((int)(t179)) < 0)) == 0)) {
t180 = arg0[(long)(i)];
if ((((unsigned long)((unsigned int)(t180)) == 64) | ((long)((int)(t180)) < 64))) {
goto L_1203;
}
}
local_4 = -2;
// x86-64 epilogue: restore rbp
return (unsigned int)(local_4);
L_1203: ;
goto L_1208;
L_1208: ;
i = ((unsigned int)(i) + 1);
goto L_11be;
L_121c: ;
length = 2;
L_1226: ;
if (((((unsigned int)(length) == (unsigned int)(arg1)) | (length < arg1)) == 0)) {
goto L_13a9;
}
start = 0;
L_123f: ;
if (((long)(arg1) <= (long)((int)(((unsigned long)((unsigned int)(((unsigned long)((unsigned int)(start)) + length))) - 1))))) {
goto L_1390;
}
end = ((unsigned int)(((unsigned long)((unsigned int)(start)) + length)) - 1);
best = 0x77359400;
split = start;
L_1282: ;
if ((end <= split)) {
goto L_135e;
}
left = *(int *)((&local_120[0] + ((long)((int)(((unsigned long)((unsigned int)(((unsigned long)((unsigned int)(start)) << 3))) + split))) * 4)));
right = *(int *)((&local_120[0] + ((long)((int)(((unsigned long)((unsigned int)(((unsigned long)((unsigned int)(((unsigned long)((unsigned int)(split)) + 1))) << 3))) + end))) * 4)));
merge = ((unsigned int)(((unsigned long)((unsigned int)(arg0[(long)(start)])) * arg0[(long)((int)(((unsigned long)((unsigned int)(split)) + 1)))])) * arg0[(long)((int)(((unsigned long)((unsigned int)(end)) + 1)))]);
candidate = ((unsigned int)(((unsigned long)((unsigned int)(left)) + right)) + merge);
if ((candidate < best)) {
best = candidate;
}
goto L_134a;
L_134a: ;
split = ((unsigned int)(split) + 1);
goto L_1282;
L_135e: ;
*(int *)((&local_120[0] + ((long)((int)(((unsigned long)((unsigned int)(((unsigned long)((unsigned int)(start)) << 3))) + end))) * 4))) = best;
start = ((unsigned int)(start) + 1);
goto L_123f;
L_1390: ;
goto L_1395;
L_1395: ;
length = ((unsigned int)(length) + 1);
goto L_1226;
L_13a9: ;
local_4 = *(int *)((&local_120[0] + ((long)((int)(((unsigned long)((unsigned int)(arg1)) - 1))) * 4)));
// x86-64 epilogue: restore rbp
return (unsigned int)(local_4);
} clang -O2
1/1matrix_chain_cost pass 229 lines
// glaurung: matrix_chain_cost @ 0x1100
__attribute__((no_stack_protector)) int32_t matrix_chain_cost(const int32_t * arg0, int32_t arg1) {
int split;
int best;
int length;
int candidate;
int i;
int merge;
int right;
unsigned char local_138[312];
long local_140;
long local_148;
long local_150;
long local_158;
int local_164;
int local_168;
int local_16c;
int local_170;
long local_178;
long rbp;
long ret;
long var14;
long var16;
long var19;
long var20;
long var21;
long var22;
long var23;
long var29;
long var31;
long var35;
long var37;
long var39;
long var41;
long var44;
int var57;
long var63;
// x86-64 prologue: save callee registers, frame 48 bytes
ret = 0xffffffff;
if ((arg0 == 0)) {
// x86-64 epilogue: restore callee registers
return ret;
}
if (((unsigned long)((unsigned long)((unsigned int)((arg1 - 8)))) < (unsigned long)(0xfffffff9))) {
// x86-64 epilogue: restore callee registers
return ret;
}
*(int *)((&local_138[0] + 240)) = 0;
*(int *)((&local_138[0] + 244)) = 0;
*(int *)((&local_138[0] + 248)) = 0;
*(int *)((&local_138[0] + 252)) = 0;
*(int *)((&local_138[0] + 224)) = 0;
*(int *)((&local_138[0] + 228)) = 0;
*(int *)((&local_138[0] + 232)) = 0;
*(int *)((&local_138[0] + 236)) = 0;
*(int *)((&local_138[0] + 208)) = 0;
*(int *)((&local_138[0] + 212)) = 0;
*(int *)((&local_138[0] + 216)) = 0;
*(int *)((&local_138[0] + 220)) = 0;
*(int *)((&local_138[0] + 192)) = 0;
*(int *)((&local_138[0] + 196)) = 0;
*(int *)((&local_138[0] + 200)) = 0;
*(int *)((&local_138[0] + 204)) = 0;
*(int *)((&local_138[0] + 176)) = 0;
*(int *)((&local_138[0] + 180)) = 0;
*(int *)((&local_138[0] + 184)) = 0;
*(int *)((&local_138[0] + 188)) = 0;
*(int *)((&local_138[0] + 160)) = 0;
*(int *)((&local_138[0] + 164)) = 0;
*(int *)((&local_138[0] + 168)) = 0;
*(int *)((&local_138[0] + 172)) = 0;
*(int *)((&local_138[0] + 144)) = 0;
*(int *)((&local_138[0] + 148)) = 0;
*(int *)((&local_138[0] + 152)) = 0;
*(int *)((&local_138[0] + 156)) = 0;
*(int *)((&local_138[0] + 128)) = 0;
*(int *)((&local_138[0] + 132)) = 0;
*(int *)((&local_138[0] + 136)) = 0;
*(int *)((&local_138[0] + 140)) = 0;
*(int *)((&local_138[0] + 112)) = 0;
*(int *)((&local_138[0] + 116)) = 0;
*(int *)((&local_138[0] + 120)) = 0;
*(int *)((&local_138[0] + 124)) = 0;
*(int *)((&local_138[0] + 96)) = 0;
*(int *)((&local_138[0] + 100)) = 0;
*(int *)((&local_138[0] + 104)) = 0;
*(int *)((&local_138[0] + 108)) = 0;
*(int *)((&local_138[0] + 80)) = 0;
*(int *)((&local_138[0] + 84)) = 0;
*(int *)((&local_138[0] + 88)) = 0;
*(int *)((&local_138[0] + 92)) = 0;
*(int *)((&local_138[0] + 64)) = 0;
*(int *)((&local_138[0] + 68)) = 0;
*(int *)((&local_138[0] + 72)) = 0;
*(int *)((&local_138[0] + 76)) = 0;
*(int *)((&local_138[0] + 48)) = 0;
*(int *)((&local_138[0] + 52)) = 0;
*(int *)((&local_138[0] + 56)) = 0;
*(int *)((&local_138[0] + 60)) = 0;
*(int *)((&local_138[0] + 32)) = 0;
*(int *)((&local_138[0] + 36)) = 0;
*(int *)((&local_138[0] + 40)) = 0;
*(int *)((&local_138[0] + 44)) = 0;
*(int *)((&local_138[0] + 16)) = 0;
*(int *)((&local_138[0] + 20)) = 0;
*(int *)((&local_138[0] + 24)) = 0;
*(int *)((&local_138[0] + 28)) = 0;
*(int *)(&local_138[0]) = 0;
*(int *)((&local_138[0] + 4)) = 0;
*(int *)((&local_138[0] + 8)) = 0;
*(int *)((&local_138[0] + 12)) = 0;
ret = 0xfffffffe;
if (((unsigned long)((unsigned long)((unsigned int)(((unsigned long)((unsigned int)(*(int *)((long)arg0))) - 65)))) < (unsigned long)(0xffffffc0))) {
// x86-64 epilogue: restore callee registers
return ret;
}
local_178 = (unsigned int)((arg1 + 1));
if (((unsigned long)((unsigned int)(arg1)) == 0)) {
L_11cc: ;
if ((2 <= (long)(arg1))) {
local_148 = (unsigned int)(arg1);
local_150 = (long)((arg0 + 1));
var14 = 1;
var16 = 9;
var19 = 2;
var20 = rbp;
var21 = var22;
do {
var23 = local_150;
local_16c = var16;
local_170 = var16;
local_158 = 0;
var21 = 0;
local_168 = var14;
var29 = var19;
local_140 = var19;
split = 0;
do {
var31 = (unsigned long)((unsigned int)((var29 - 1)));
local_164 = (split * 8);
var35 = 0x77359400;
if ((split < (long)((int)(var31)))) {
var37 = ((unsigned long)((unsigned int)(var14)) + local_158);
var39 = (unsigned long)((unsigned int)(*(int *)(((long)arg0 + split * 4))));
var41 = (unsigned long)((unsigned int)(arg0[(unsigned long)((unsigned int)(var29))]));
var44 = (unsigned long)((unsigned int)(local_170));
var20 = 0;
best = 0x77359400;
do {
var57 = ((unsigned int)(((unsigned long)((unsigned int)(*(int *)((&local_138[0] + ((long)((int)(var44)) * 4))))) + *(int *)((&local_138[0] + ((unsigned long)((unsigned int)((var21 + var20))) * 4))))) + (unsigned int)(((unsigned long)((unsigned int)(((unsigned long)((unsigned int)(*(int *)((var23 + var20 * 4)))) * var39))) * var41)));
best = ((var57 < best) ? (unsigned long)((unsigned int)(var57)) : best);
var20 = (var20 + 1);
var44 = (unsigned long)((unsigned int)(((long)((int)(var44)) + 8)));
} while ((var37 != var20));
var35 = (unsigned long)((unsigned int)(best));
}
*(int *)((&local_138[0] + ((long)((int)((var31 + local_164))) * 4))) = var35;
var63 = local_140;
var29 = (((unsigned long)((unsigned int)(split)) + local_140) + 1);
var14 = (unsigned long)((unsigned int)((var14 + 1)));
var21 = (var21 + 9);
local_158 = (local_158 - 1);
local_170 = (local_170 + 9);
var23 = (var23 + 4);
split = (split + 1);
} while (((unsigned long)(var29) <= (unsigned long)(local_148)));
length = (var63 + 1);
var14 = (unsigned long)((unsigned int)(((unsigned long)((unsigned int)(local_168)) + 1)));
var16 = (unsigned long)((unsigned int)(((unsigned long)((unsigned int)(local_16c)) + 1)));
var19 = (unsigned long)((unsigned int)(length));
} while ((length != local_178));
}
return (unsigned int)(*(int *)((&local_138[0] + ((unsigned long)((unsigned int)((arg1 - 1))) * 4))));
}
if (((unsigned long)((unsigned long)((unsigned int)(((unsigned long)((unsigned int)(*(int *)(((long)arg0 + 0x4)))) - 65)))) < (unsigned long)(0xffffffc0))) {
// x86-64 epilogue: restore callee registers
return ret;
}
if (((unsigned long)((unsigned int)(local_178)) != 2)) {
if (((unsigned long)((unsigned long)((unsigned int)(((unsigned long)((unsigned int)(*(int *)(((long)arg0 + 0x8)))) - 65)))) < (unsigned long)(0xffffffc0))) {
// x86-64 epilogue: restore callee registers
return ret;
}
if (((unsigned long)((unsigned int)(local_178)) == 3)) {
goto L_11cc;
} else {
if (((unsigned long)((unsigned long)((unsigned int)(((unsigned long)((unsigned int)(*(int *)(((long)arg0 + 0xc)))) - 65)))) < (unsigned long)(0xffffffc0))) {
// x86-64 epilogue: restore callee registers
return ret;
}
if (((unsigned long)((unsigned int)(local_178)) == 4)) {
goto L_11cc;
} else {
if (((unsigned long)((unsigned long)((unsigned int)(((unsigned long)((unsigned int)(*(int *)(((long)arg0 + 0x10)))) - 65)))) < (unsigned long)(0xffffffc0))) {
// x86-64 epilogue: restore callee registers
return ret;
}
if (((unsigned long)((unsigned int)(local_178)) == 5)) {
goto L_11cc;
} else {
if (((unsigned long)((unsigned long)((unsigned int)(((unsigned long)((unsigned int)(*(int *)(((long)arg0 + 0x14)))) - 65)))) < (unsigned long)(0xffffffc0))) {
// x86-64 epilogue: restore callee registers
return ret;
}
if (((unsigned long)((unsigned int)(local_178)) == 6)) {
goto L_11cc;
} else {
if (((unsigned long)((unsigned long)((unsigned int)(((unsigned long)((unsigned int)(*(int *)(((long)arg0 + 0x18)))) - 65)))) < (unsigned long)(0xffffffc0))) {
// x86-64 epilogue: restore callee registers
return ret;
}
if (((unsigned long)((unsigned int)(local_178)) == 7)) {
goto L_11cc;
} else {
if (((unsigned long)(0xffffffc0) <= (unsigned long)((unsigned long)((unsigned int)(((unsigned long)((unsigned int)(*(int *)(((long)arg0 + 0x1c)))) - 65)))))) {
goto L_11cc;
} else {
}
}
}
}
}
}
} else {
goto L_11cc;
}
// x86-64 epilogue: restore callee registers
return ret;
} gcc -O0
1/1matrix_chain_cost pass 109 lines
// glaurung: matrix_chain_cost @ 0x1119
int32_t matrix_chain_cost(const int32_t * arg0, int32_t arg1) {
extern __attribute__((noreturn)) void __stack_chk_fail(void);
int i;
int j;
int length;
int start;
int end;
int best;
int split;
int left;
int right;
int merge;
int candidate;
unsigned char local_110[256];
long local_8;
long ret;
long t148;
long var20;
local_8 = (long)(0x28);
if ((arg0 != 0)) {
if (((((unsigned long)((unsigned int)(arg1)) == 0) | ((long)(arg1) < 0)) == 0)) {
if ((((unsigned long)((unsigned int)(arg1)) == 7) | ((long)(arg1) < 7))) {
goto L_116a;
}
}
}
ret = 0xffffffff;
goto L_13f2;
L_116a: ;
i = 0;
goto L_11bb;
L_1176: ;
j = 0;
goto L_11ab;
L_1182: ;
*(int *)((&local_110[0] + ((long)((int)(((unsigned long)((unsigned int)(j)) + (unsigned long)((unsigned int)(((unsigned long)((unsigned int)(i)) * 8)))))) * 4))) = 0;
j = (j + 1);
L_11ab: ;
if ((((unsigned long)((unsigned int)(j)) == 7) | ((long)(j) < 7))) {
goto L_1182;
}
i = (i + 1);
L_11bb: ;
if ((((unsigned long)((unsigned int)(i)) == 7) | ((long)(i) < 7))) {
goto L_1176;
}
i = 0;
goto L_1222;
L_11d0: ;
t148 = (unsigned long)((unsigned int)(arg0[(long)(i)]));
if (((((unsigned long)((unsigned int)(t148)) == 0) | ((long)((int)(t148)) < 0)) == 0)) {
var20 = (unsigned long)((unsigned int)(arg0[(long)(i)]));
if ((((unsigned long)((unsigned int)(var20)) == 64) | ((long)((int)(var20)) < 64))) {
goto L_121b;
}
}
ret = 0xfffffffe;
goto L_13f2;
L_121b: ;
i = (i + 1);
L_1222: ;
if ((((unsigned int)(i) == (unsigned int)(arg1)) | (i < arg1))) {
goto L_11d0;
}
length = 2;
goto L_13ce;
L_123f: ;
start = 0;
goto L_13ad;
L_124e: ;
end = ((unsigned int)(((unsigned long)((unsigned int)(length)) + (unsigned long)((unsigned int)(start)))) - 1);
best = 0x77359400;
split = start;
goto L_1370;
L_1280: ;
left = *(int *)((&local_110[0] + ((long)((int)(((unsigned long)((unsigned int)(split)) + (unsigned long)((unsigned int)(((unsigned long)((unsigned int)(start)) * 8)))))) * 4)));
right = *(int *)((&local_110[0] + ((long)((int)(((unsigned long)((unsigned int)(end)) + (unsigned long)((unsigned int)(((unsigned long)((unsigned int)(((unsigned long)((unsigned int)(split)) + 1))) * 8)))))) * 4)));
merge = ((unsigned int)(arg0[((long)(end) + 1)]) * (unsigned int)(((unsigned long)((unsigned int)(arg0[(long)(start)])) * (unsigned long)((unsigned int)(arg0[((long)(split) + 1)])))));
candidate = ((unsigned int)(merge) + (unsigned int)(((unsigned long)((unsigned int)(left)) + (unsigned long)((unsigned int)(right)))));
if ((candidate < best)) {
best = candidate;
}
split = (split + 1);
L_1370: ;
if ((split < end)) {
goto L_1280;
}
*(int *)((&local_110[0] + ((long)((int)(((unsigned long)((unsigned int)(end)) + (unsigned long)((unsigned int)(((unsigned long)((unsigned int)(start)) * 8)))))) * 4))) = best;
start = (start + 1);
L_13ad: ;
if (((long)((int)(((unsigned long)((unsigned int)(length)) + (unsigned long)((unsigned int)(start))))) <= (long)(arg1))) {
goto L_124e;
}
length = (length + 1);
L_13ce: ;
if ((((unsigned int)(length) == (unsigned int)(arg1)) | (length < arg1))) {
goto L_123f;
}
ret = (unsigned long)((unsigned int)(*(int *)((&local_110[0] + ((long)((int)(((unsigned long)((unsigned int)(arg1)) - 1))) * 4)))));
L_13f2: ;
if ((local_8 == 0x28)) {
// x86-64 epilogue: restore rbp
return ret;
}
__stack_chk_fail();
// x86-64 epilogue: restore rbp
return ret;
} gcc -O2
1/1matrix_chain_cost pass 136 lines
// glaurung: matrix_chain_cost @ 0x1120
int32_t matrix_chain_cost(const int32_t * arg0, int32_t arg1) {
extern __attribute__((noreturn)) void __stack_chk_fail(void);
int i;
int length;
int end;
int split;
int best;
long df_1;
unsigned char local_148[256];
int local_14c;
long local_158;
void * local_160;
long local_40;
long ret;
long t1;
long t140;
long var11;
long var18;
long var21;
long var25;
long var27;
long var28;
long var3;
long var32;
long var35;
long var36;
long var37;
long var39;
long var4;
int var50;
long var52;
int var53;
long var8;
long var9;
df_1 = 0;
local_40 = (long)(0x28);
var3 = (unsigned long)((unsigned int)((arg1 - 1)));
local_14c = var3;
if (((unsigned long)(6) < (unsigned long)((unsigned long)((unsigned int)(var3))))) {
goto L_1296;
}
var4 = (long)arg0;
if ((arg0 == 0)) {
goto L_1296;
}
var8 = 0;
var9 = (unsigned long)((unsigned int)(arg1));
local_160 = &local_148[0];
var11 = 0;
t140 = (long)(&local_148[0]);
t1 = 32;
while ((t1 != 0)) {
*(long *)(t140) = var8;
t140 = (t140 + ((df_1 != 0) ? -8 : 8));
t1 = (t1 - 1);
}
i = var11;
do {
if (((unsigned long)(63) < (unsigned long)((unsigned long)((unsigned int)(((unsigned long)((unsigned int)(*(int *)((var4 + i * 4)))) - 1)))))) {
goto L_128f;
}
var18 = ((unsigned long)((unsigned int)(i)) + 1);
i = var18;
} while (((long)((int)(var18)) <= (long)((int)(var9))));
length = 2;
var21 = 4;
local_158 = (long)((&local_148[0] + 32));
if (((unsigned long)((unsigned int)(var9)) == 1)) {
goto L_1254;
}
if (((long)((int)(var9)) < (long)(length))) {
goto L_1243;
}
var25 = (unsigned long)((unsigned int)(length));
L_11c8: ;
var27 = (long)local_160;
var28 = var4;
var32 = (local_158 + var21);
end = (unsigned long)((unsigned int)((var25 - 1)));
split = 0;
var35 = var18;
L_11e0: ;
if ((end <= split)) {
goto L_1288;
}
var36 = (unsigned long)((unsigned int)(*(int *)((var28))));
var37 = (unsigned long)((unsigned int)(*(int *)((var28 + var25 * 4))));
var39 = 0;
best = 0x77359400;
do {
var50 = ((unsigned int)(((unsigned long)((unsigned int)(*(int *)((var32 + var39 * 8)))) + *(int *)((var27 + var39)))) + (unsigned int)(((unsigned long)((unsigned int)(((unsigned long)((unsigned int)(*(int *)((var28 + var39 + 0x4)))) * var36))) * var37)));
best = (((((unsigned int)(best) == (unsigned int)(var50)) | (best < var50)) == 0) ? (unsigned long)((unsigned int)(var50)) : best);
var39 = (var39 + 4);
var52 = (unsigned long)((unsigned int)(best));
var35 = var39;
} while ((var39 != var21));
L_1226: ;
var53 = (end + 1);
*(int *)((var32 - 0x20)) = var52;
var27 = (var27 + 36);
var32 = (var32 + 36);
var28 = (var28 + 4);
end = (unsigned long)((unsigned int)(var53));
split = (unsigned long)((unsigned int)((split + 1)));
length = var25;
var18 = var35;
if (((unsigned int)(var9) != (unsigned int)(var53))) {
goto L_11e0;
}
L_1243: ;
var25 = ((unsigned long)((unsigned int)(length)) + 1);
var21 = (var21 + 4);
if (((long)((int)(var25)) <= (long)((int)(var9)))) {
goto L_11c8;
}
L_1254: ;
ret = (unsigned long)((unsigned int)(*(int *)((&local_148[0] + ((long)(local_14c) * 4)))));
L_125d: ;
if ((local_40 != 0x28)) {
goto L_129d;
}
// x86-64 epilogue: tear down frame
return ret;
L_1288: ;
var52 = 0x77359400;
goto L_1226;
L_128f: ;
ret = 0xfffffffe;
goto L_125d;
L_1296: ;
ret = 0xffffffff;
goto L_125d;
L_129d: ;
__stack_chk_fail();
}