Fixture 182
cold and part splits
C · 4 functions · 4 lanes · 8 of 16 function-lanes behave identically
4 of 4 lanes have a function that returns a different result after decompilation: clang-O2 (1/4), gcc-O2 (1/4), clang-O0 (3/4), gcc-O0 (3/4).
Functions the optimiser SPLITS into more than one address range.
COVERAGE TARGET: .text.unlikely / foo.cold and .text.part / foo.part. At -O2 with the right shape, GCC moves an unlikely path into a separate section and Clang does the same for an outlined slow path, so one source function becomes two or more disjoint ranges with only one entry symbol. The corpus has never contained a function that reliably splits, so nothing checks that:
* function discovery attributes the cold chunk to its hot parent instead of inventing a second function at foo.cold; * the DWARF range list's FIRST chunk is treated as the entry — sorting the chunks by address would make foo.cold the entry whenever the compiler placed it lower; * a jmp into the cold range is an intra-function edge, not a tail call.
The split is PROVOKED, not assumed: every cold path is marked with __builtin_expect and ends in a call the optimiser knows is expensive. Whether a given compiler actually splits is checked by the harness's structural lane, and the functions are correct and executable either way.
#include <stdint.h>
/* Functions the optimiser SPLITS into more than one address range.
*
* COVERAGE TARGET: `.text.unlikely` / `foo.cold` and `.text.part` / `foo.part`.
* At -O2 with the right shape, GCC moves an unlikely path into a separate
* section and Clang does the same for an outlined slow path, so one source
* function becomes two or more disjoint ranges with only one entry symbol. The
* corpus has never contained a function that reliably splits, so nothing checks
* that:
*
* * function discovery attributes the cold chunk to its hot parent instead of
* inventing a second function at `foo.cold`;
* * the DWARF range list's FIRST chunk is treated as the entry — sorting the
* chunks by address would make `foo.cold` the entry whenever the compiler
* placed it lower;
* * a `jmp` into the cold range is an intra-function edge, not a tail call.
*
* The split is PROVOKED, not assumed: every cold path is marked with
* `__builtin_expect` and ends in a call the optimiser knows is expensive.
* Whether a given compiler actually splits is checked by the harness's
* structural lane, and the functions are correct and executable either way. */
#define SPLIT182_LIMIT 64
/* Deliberately not inlinable and deliberately unlikely to be called: this is
* the body GCC hoists into `.text.unlikely`. */
__attribute__((noinline, cold)) static int32_t split182_report(int32_t code,
int32_t detail) {
int32_t folded = code;
int32_t step;
/* Enough work that the optimiser does not simply inline it back. */
for (step = 0; step < 4; ++step) {
folded = folded * 31 + detail + step;
}
return folded;
}
/* The classic hot/cold split: one early-out guard whose body is cold. */
__attribute__((noinline)) int32_t validate_with_cold_path(int32_t value,
int32_t bound) {
if (__builtin_expect(bound <= 0 || bound > SPLIT182_LIMIT, 0)) {
return split182_report(-1, bound);
}
if (__builtin_expect(value < 0, 0)) {
return split182_report(-2, value);
}
return value % bound;
}
/* Two cold exits from inside a loop, so the cold chunk has more than one
* predecessor and cannot be modelled as a single trailing block. */
__attribute__((noinline)) int32_t scan_with_two_cold_exits(const int32_t *items,
int32_t count) {
int32_t index;
int32_t total = 0;
if (items == 0) {
return split182_report(-3, 0);
}
if (__builtin_expect(count < 0 || count > SPLIT182_LIMIT, 0)) {
return split182_report(-4, count);
}
for (index = 0; index < count; ++index) {
int32_t item = items[index];
if (__builtin_expect(item == INT32_MIN, 0)) {
return split182_report(-5, index);
}
if (__builtin_expect(item < 0 && total < 0, 0)) {
return split182_report(-6, index);
}
total += item / 2;
}
return total;
}
/* The `.part` shape: a large function with one branch the optimiser can outline
* because it is used from a single site and never falls through. Kept
* arithmetic-only so the result is exactly comparable. */
__attribute__((noinline)) int32_t mix_with_outlinable_tail(int32_t seed,
int32_t rounds) {
int32_t state = seed;
int32_t round;
if (rounds < 0 || rounds > SPLIT182_LIMIT) {
rounds = SPLIT182_LIMIT;
}
for (round = 0; round < rounds; ++round) {
state ^= state << 3;
state ^= (int32_t)((uint32_t)state >> 5);
state += round;
}
if (__builtin_expect(state == 0, 0)) {
/* The outlinable tail: reached rarely, does a lot, returns directly. */
int32_t recovery = seed;
int32_t step;
for (step = 0; step < 8; ++step) {
recovery = recovery * 1103515245 + 12345;
recovery ^= (int32_t)((uint32_t)recovery >> 7);
}
return recovery;
}
return state;
}
/* A cold path that is TAKEN on ordinary inputs, so the execution differential
* exercises the split range rather than only the hot one. */
__attribute__((noinline)) int32_t always_reaches_the_cold_chunk(int32_t value) {
if (__builtin_expect(value >= 0, 0)) {
return split182_report(1, value);
}
return split182_report(2, value);
} 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 -O2
1/4always_reaches_the_cold_chunk fail 11 lines
// glaurung: always_reaches_the_cold_chunk @ 0x1360
int32_t always_reaches_the_cold_chunk(int32_t arg0) {
extern int split182_report(int, ...);
int ret;
if ((0 <= (long)(arg0))) {
ret = split182_report(1);
return ret;
}
ret = split182_report(2, (unsigned long)((unsigned int)(arg0)));
return ret;
} mix_with_outlinable_tail pass 103 lines
// glaurung: mix_with_outlinable_tail @ 0x11d0
int32_t mix_with_outlinable_tail(int32_t arg0, int32_t arg1) {
int round;
int recovery;
int state;
int step;
long ret;
int var1;
long var10;
int var107;
int var116;
int var125;
long var13;
int var134;
int var143;
int var152;
int var20;
long var24;
long var30;
long var32;
long var39;
long var45;
long var5;
long var52;
long var58;
int var59;
int var65;
long var66;
long var7;
long var71;
long var72;
long var75;
long var81;
long var82;
int var85;
int var89;
int var98;
var1 = (((unsigned long)((unsigned long)((unsigned int)(arg1))) < (unsigned long)(64)) ? arg1 : 64);
ret = (unsigned long)((unsigned int)(arg0));
if (((unsigned long)((unsigned int)(var1)) != 0)) {
var5 = (unsigned long)((unsigned int)(((unsigned long)((unsigned int)(var1)) & 3)));
if (((unsigned long)(3) <= (unsigned long)((unsigned long)((unsigned int)((var1 - 1)))))) {
var7 = (unsigned long)((unsigned int)((var1 & 124)));
round = 0;
var10 = (unsigned long)((unsigned int)(arg0));
do {
var13 = (unsigned long)((unsigned int)(((unsigned long)((unsigned int)((var10 * 8))) ^ var10)));
var20 = ((unsigned int)(((unsigned long)((unsigned int)(((unsigned long)((unsigned int)(var13)) >> 5))) ^ var13)) + round);
var24 = (unsigned long)((unsigned int)(((unsigned long)((unsigned int)(((unsigned long)((unsigned int)(var20)) * 8))) ^ (unsigned long)((unsigned int)(var20)))));
var30 = (unsigned long)((unsigned int)(((unsigned long)((unsigned int)(((unsigned long)((unsigned int)(var24)) >> 5))) ^ var24)));
var32 = (unsigned long)((unsigned int)(round));
var39 = (unsigned long)((unsigned int)(((unsigned long)((unsigned int)((((unsigned long)((unsigned int)((round + var30))) * 8) + 8))) ^ (unsigned long)((unsigned int)(((unsigned long)((unsigned int)((var30 + (unsigned long)((unsigned int)(round))))) + 1))))));
var45 = (unsigned long)((unsigned int)(((unsigned long)((unsigned int)(((unsigned long)((unsigned int)(var39)) >> 5))) ^ var39)));
var52 = (unsigned long)((unsigned int)(((unsigned long)((unsigned int)((((unsigned long)((unsigned int)((round + var45))) * 8) + 16))) ^ (unsigned long)((unsigned int)(((unsigned long)((unsigned int)(((unsigned long)((unsigned int)(round)) + var45))) + 2))))));
var58 = (unsigned long)((unsigned int)(((unsigned long)((unsigned int)(((unsigned long)((unsigned int)(var52)) >> 5))) ^ var52)));
var59 = (round + 4);
round = (unsigned long)((unsigned int)(var59));
var10 = (unsigned long)((unsigned int)(((unsigned long)((unsigned int)((var32 + var58))) + 3)));
} while (((unsigned int)(var7) != (unsigned int)(var59)));
var65 = ((unsigned int)((var58 + round)) - 1);
ret = (unsigned long)((unsigned int)(var65));
var66 = (unsigned long)((unsigned int)(var65));
if (((unsigned long)((unsigned int)(var5)) == 0)) {
goto L_12c5;
}
goto L_1290;
} else {
ret = (unsigned long)((unsigned int)(arg0));
var66 = (unsigned long)((unsigned int)(arg0));
round = 0;
if (((unsigned long)((unsigned int)(var5)) != 0)) {
L_1290: ;
var71 = (unsigned long)((unsigned int)((1 - round)));
var72 = (unsigned long)((unsigned int)(round));
do {
var75 = (unsigned long)((unsigned int)(((unsigned long)((unsigned int)((var66 * 8))) ^ var66)));
var81 = (unsigned long)((unsigned int)(((unsigned long)((unsigned int)(((unsigned long)((unsigned int)(var75)) >> 5))) ^ var75)));
var82 = (unsigned long)((unsigned int)((var72 + var81)));
var72 = (unsigned long)((unsigned int)((var72 + 1)));
var71 = (unsigned long)((unsigned int)((var71 - 1)));
var85 = (var5 - 1);
var5 = (unsigned long)((unsigned int)(var85));
var66 = var82;
} while (((unsigned long)((unsigned int)(var85)) != 0));
ret = (unsigned long)((unsigned int)((var81 - var71)));
} else {
}
}
}
L_12c5: ;
if (((unsigned long)((unsigned int)(ret)) == 0)) {
var89 = ((arg0 * 0x41c64e6d) + 0x3039);
var98 = (((unsigned int)(((unsigned long)((unsigned int)(((unsigned long)((unsigned int)(var89)) >> 7))) ^ (unsigned long)((unsigned int)(var89)))) * 0x41c64e6d) + 0x3039);
var107 = (((unsigned int)(((unsigned long)((unsigned int)(((unsigned long)((unsigned int)(var98)) >> 7))) ^ (unsigned long)((unsigned int)(var98)))) * 0x41c64e6d) + 0x3039);
var116 = (((unsigned int)(((unsigned long)((unsigned int)(((unsigned long)((unsigned int)(var107)) >> 7))) ^ (unsigned long)((unsigned int)(var107)))) * 0x41c64e6d) + 0x3039);
var125 = (((unsigned int)(((unsigned long)((unsigned int)(((unsigned long)((unsigned int)(var116)) >> 7))) ^ (unsigned long)((unsigned int)(var116)))) * 0x41c64e6d) + 0x3039);
var134 = (((unsigned int)(((unsigned long)((unsigned int)(((unsigned long)((unsigned int)(var125)) >> 7))) ^ (unsigned long)((unsigned int)(var125)))) * 0x41c64e6d) + 0x3039);
var143 = (((unsigned int)(((unsigned long)((unsigned int)(((unsigned long)((unsigned int)(var134)) >> 7))) ^ (unsigned long)((unsigned int)(var134)))) * 0x41c64e6d) + 0x3039);
var152 = (((unsigned int)(((unsigned long)((unsigned int)(((unsigned long)((unsigned int)(var143)) >> 7))) ^ (unsigned long)((unsigned int)(var143)))) * 0x41c64e6d) + 0x3039);
return (unsigned int)(((unsigned long)((unsigned int)(((unsigned long)((unsigned int)(var152)) >> 7))) ^ (unsigned long)((unsigned int)(var152))));
}
return ret;
} scan_with_two_cold_exits fail 59 lines
// glaurung: scan_with_two_cold_exits @ 0x1150
int32_t scan_with_two_cold_exits(const int32_t * arg0, int32_t arg1) {
extern int split182_report(long, ...);
int total;
int item;
int index;
int ret;
long var0;
long var5;
long var6;
if ((arg0 == 0)) {
goto L_11a5;
}
if (((unsigned long)(64) < (unsigned long)((unsigned long)((unsigned int)(arg1))))) {
goto L_11bb;
}
if (((unsigned long)((unsigned int)(arg1)) == 0)) {
goto L_11a2;
}
var0 = (unsigned long)((unsigned int)(arg1));
var5 = 0;
var6 = 0;
goto L_1184;
L_1170: ;
total = (var5 + (unsigned int)(((int)(((unsigned long)((unsigned int)(((unsigned long)((unsigned int)(item)) >> 31))) + item)) >> 1)));
ret = (unsigned long)((unsigned int)(total));
index = (var6 + 1);
var5 = (unsigned long)((unsigned int)(total));
var6 = (unsigned long)((unsigned int)(index));
if ((var0 == index)) {
goto L_11a1;
}
L_1184: ;
item = (unsigned long)((unsigned int)(*(int *)(((long)arg0 + var6 * 4))));
if (((unsigned long)((unsigned int)(item)) == 0x80000000)) {
goto L_11b1;
}
if ((0 <= (long)(item))) {
goto L_1170;
}
if ((0 <= (long)((int)(var5)))) {
goto L_1170;
}
ret = split182_report(0xfffffffa);
return ret;
L_11a1: ;
return ret;
L_11a2: ;
return 0;
L_11a5: ;
ret = split182_report(0xfffffffd, 0);
return ret;
L_11b1: ;
ret = split182_report(0xfffffffb);
return ret;
L_11bb: ;
ret = split182_report(0xfffffffc);
return ret;
} validate_with_cold_path fail 16 lines
// glaurung: validate_with_cold_path @ 0x1120
int32_t validate_with_cold_path(int32_t arg0, int32_t arg1) {
extern int split182_report(long, ...);
int ret;
long var1;
if (((unsigned long)((unsigned long)((unsigned int)((arg1 - 65)))) <= (unsigned long)(0xffffffbf))) {
ret = split182_report(0xffffffff);
return ret;
}
var1 = (unsigned long)((unsigned int)(arg0));
if (((long)(arg0) < 0)) {
ret = split182_report(0xfffffffe, (unsigned long)((unsigned int)(var1)));
return ret;
}
return (unsigned int)(((unsigned int)(((((unsigned long long)(unsigned int)((unsigned long)((unsigned int)(0))) << 32) | (unsigned int)(var1)) % (unsigned int)(arg1)))));
} gcc -O2
1/4always_reaches_the_cold_chunk fail 11 lines
// glaurung: always_reaches_the_cold_chunk @ 0x1083
int32_t always_reaches_the_cold_chunk(int32_t arg0) {
extern int split182_report(int, ...);
int ret;
if (((long)(arg0) < 0)) {
ret = split182_report(2);
return ret;
}
ret = split182_report(1, (unsigned long)((unsigned int)(arg0)));
return ret;
} mix_with_outlinable_tail pass 47 lines
// glaurung: mix_with_outlinable_tail @ 0x11f0
int32_t mix_with_outlinable_tail(int32_t arg0, int32_t arg1) {
int state;
int recovery;
int round;
int var0;
int var17;
long var21;
long var23;
int var29;
long var4;
long var5;
long var8;
if (((unsigned long)(64) < (unsigned long)((unsigned long)((unsigned int)(arg1))))) {
var0 = 64;
L_11ff: ;
var4 = (unsigned long)((unsigned int)(arg0));
var5 = 0;
do {
var8 = (unsigned long)((unsigned int)(((unsigned long)((unsigned int)((var4 * 8))) ^ var4)));
state = ((unsigned int)(((unsigned long)((unsigned int)(((unsigned long)((unsigned int)(var8)) >> 5))) ^ var8)) + var5);
var17 = (var5 + 1);
var4 = (unsigned long)((unsigned int)(state));
var5 = (unsigned long)((unsigned int)(var17));
recovery = (unsigned long)((unsigned int)(state));
} while (((((unsigned int)(var0) == (unsigned int)(var17)) | (var0 < var17)) == 0));
} else {
var0 = arg1;
recovery = (unsigned long)((unsigned int)(arg0));
if (((unsigned long)((unsigned int)(arg1)) == 0)) {
goto L_1221;
}
goto L_11ff;
}
L_1221: ;
if (((unsigned long)((unsigned int)(recovery)) == 0)) {
var21 = 8;
recovery = (unsigned long)((unsigned int)(arg0));
do {
var23 = (unsigned long)((unsigned int)(((recovery * 0x41c64e6d) + 0x3039)));
recovery = (unsigned long)((unsigned int)(((unsigned long)((unsigned int)(((unsigned long)((unsigned int)(var23)) >> 7))) ^ var23)));
var29 = (var21 - 1);
var21 = (unsigned long)((unsigned int)(var29));
} while (((unsigned long)((unsigned int)(var29)) != 0));
}
return recovery;
} scan_with_two_cold_exits fail 45 lines
// glaurung: scan_with_two_cold_exits @ 0x1180
int32_t scan_with_two_cold_exits(const int32_t * arg0, int32_t arg1) {
extern int split182_report(long, ...);
int index;
int item;
int total;
int ret;
long var10;
long var3;
long var5;
if ((arg0 == 0)) {
ret = split182_report(0xfffffffd, 0);
return ret;
}
if (((unsigned long)(64) < (unsigned long)((unsigned long)((unsigned int)(arg1))))) {
ret = split182_report(0xfffffffc);
return ret;
}
var3 = 0;
if (((unsigned long)((unsigned int)(arg1)) == 0)) {
return (unsigned int)(var3);
}
var5 = (unsigned long)((unsigned int)((arg1 - 1)));
var10 = 0;
index = 0;
while (1) {
item = (unsigned long)((unsigned int)(*(int *)(((long)arg0 + index * 4))));
if (((unsigned long)((unsigned int)(item)) == 0x80000000)) {
break;
}
if (((long)((int)((var10 & item))) < 0)) {
ret = split182_report(0xfffffffa, (unsigned long)((unsigned int)(index)));
return ret;
}
total = (var10 + (unsigned int)(((int)(((unsigned long)((unsigned int)(((unsigned long)((unsigned int)(item)) >> 31))) + item)) >> 1)));
var3 = (unsigned long)((unsigned int)(total));
if ((index == var5)) {
return (unsigned int)(var3);
}
var10 = (unsigned long)((unsigned int)(total));
index = (index + 1);
}
ret = split182_report(0xfffffffb, (unsigned long)((unsigned int)(index)));
return ret;
} validate_with_cold_path fail 16 lines
// glaurung: validate_with_cold_path @ 0x1160
int32_t validate_with_cold_path(int32_t arg0, int32_t arg1) {
extern int split182_report(long, ...);
int ret;
long var1;
var1 = (unsigned long)((unsigned int)(arg0));
if (((unsigned long)(63) < (unsigned long)((unsigned long)((unsigned int)((arg1 - 1)))))) {
ret = split182_report((unsigned long)((unsigned int)(-1)));
return ret;
}
if (((long)(arg0) < 0)) {
ret = split182_report(0xfffffffe, (unsigned long)((unsigned int)(arg0)));
return ret;
}
return (unsigned int)(((int)((((long long)(int)((((unsigned long)((long)((int)(var1))) >> 32) & 0xffffffff)) * (((long long)1) << 32)) + (unsigned int)(var1)) % (int)(arg1))));
} clang -O0
3/4always_reaches_the_cold_chunk pass 14 lines
// glaurung: always_reaches_the_cold_chunk @ 0x1400
int32_t always_reaches_the_cold_chunk(int32_t arg0) {
extern int split182_report(int, int);
int var6;
int var8;
// x86-64 prologue: save rbp, frame 16 bytes
if (((long)(arg0) < 0)) {
var6 = split182_report(2, (unsigned long)((unsigned int)(arg0)));
return (unsigned int)(var6);
} else {
var8 = split182_report(1, (unsigned long)((unsigned int)(arg0)));
return (unsigned int)(var8);
}
} mix_with_outlinable_tail pass 36 lines
// glaurung: mix_with_outlinable_tail @ 0x1320
int32_t mix_with_outlinable_tail(int32_t arg0, int32_t arg1) {
int state;
int round;
int recovery;
int step;
int local_c;
// x86-64 prologue: save rbp
local_c = arg1;
state = arg0;
if (((long)(local_c) < 0)) {
L_1344: ;
local_c = 64;
} else {
if ((((unsigned long)((unsigned int)(local_c)) == 64) | ((long)(local_c) < 64))) {
goto L_134b;
}
goto L_1344;
}
L_134b: ;
for (round = 0; (round < local_c); round++) {
state = ((unsigned int)(((unsigned long)((unsigned int)(state)) << 3)) ^ state);
state = ((unsigned int)(((unsigned long)((unsigned int)(state)) >> 5)) ^ state);
state = ((unsigned int)(round) + state);
}
if (((unsigned long)((unsigned int)(state)) != 0)) {
return (unsigned int)(state);
} else {
recovery = arg0;
for (step = 0; ((long)(step) < 8); step++) {
recovery = ((recovery * 0x41c64e6d) + 0x3039);
recovery = ((unsigned int)(((unsigned long)((unsigned int)(recovery)) >> 7)) ^ recovery);
}
return (unsigned int)(recovery);
}
} scan_with_two_cold_exits fail 58 lines
// glaurung: scan_with_two_cold_exits @ 0x11e0
int32_t scan_with_two_cold_exits(const int32_t * arg0, int32_t arg1) {
extern int split182_report(int, int);
int total;
int index;
int item;
signed char local_21;
signed char local_22;
int local_4;
int var1;
int var13;
int var27;
int var39;
total = 0;
if ((arg0 == 0)) {
var1 = split182_report(0xfffffffd, 0);
local_4 = var1;
// x86-64 epilogue: restore rbp
return (unsigned int)(local_4);
}
local_21 = 1;
if ((0 <= (long)(arg1))) {
local_21 = ((((unsigned long)((unsigned int)(arg1)) == 64) | ((long)(arg1) < 64)) == 0);
}
if (((long)((int)((unsigned char)((local_21 & 1)))) != 0)) {
var13 = split182_report(0xfffffffc, (unsigned long)((unsigned int)(arg1)));
local_4 = var13;
// x86-64 epilogue: restore rbp
return (unsigned int)(local_4);
}
index = 0;
L_125e: ;
if ((index < arg1)) {
item = arg0[(long)(index)];
if (((unsigned long)((unsigned int)(item)) == 0x80000000)) {
var27 = split182_report(0xfffffffb, (unsigned long)((unsigned int)(index)));
local_4 = var27;
// x86-64 epilogue: restore rbp
return (unsigned int)(local_4);
}
local_22 = 0;
if (((long)(item) < 0)) {
local_22 = ((long)(total) < 0);
}
if (((long)((int)((unsigned char)((local_22 & 1)))) != 0)) {
var39 = split182_report(0xfffffffa, (unsigned long)((unsigned int)(index)));
local_4 = var39;
// x86-64 epilogue: restore rbp
return (unsigned int)(local_4);
}
total = (((int)((((long long)(int)((((unsigned long)((long)((int)((unsigned long)((unsigned int)(item))))) >> 32) & 0xffffffff)) * (((long long)1) << 32)) + (unsigned int)((unsigned long)((unsigned int)(item)))) / (int)(2))) + total);
index = ((unsigned int)(index) + 1);
goto L_125e;
}
local_4 = total;
// x86-64 epilogue: restore rbp
return (unsigned int)(local_4);
} validate_with_cold_path pass 23 lines
// glaurung: validate_with_cold_path @ 0x1100
int32_t validate_with_cold_path(int32_t arg0, int32_t arg1) {
extern int split182_report(int, int);
signed char local_d;
int var20;
int var22;
// x86-64 prologue: save rbp, frame 16 bytes
local_d = 1;
if (((((unsigned long)((unsigned int)(arg1)) == 0) | ((long)(arg1) < 0)) == 0)) {
local_d = ((((unsigned long)((unsigned int)(arg1)) == 64) | ((long)(arg1) < 64)) == 0);
}
if (((long)((int)((unsigned char)((local_d & 1)))) == 0)) {
if ((0 <= (long)(arg0))) {
return (unsigned int)(((int)((((long long)(int)((((unsigned long)((long)((int)((unsigned long)((unsigned int)(arg0))))) >> 32) & 0xffffffff)) * (((long long)1) << 32)) + (unsigned int)((unsigned long)((unsigned int)(arg0)))) % (int)(arg1))));
} else {
var20 = split182_report(0xfffffffe, (unsigned long)((unsigned int)(arg0)));
return (unsigned int)(var20);
}
} else {
var22 = split182_report(0xffffffff, (unsigned long)((unsigned int)(arg1)));
return (unsigned int)(var22);
}
} gcc -O0
3/4always_reaches_the_cold_chunk pass 14 lines
// glaurung: always_reaches_the_cold_chunk @ 0x1346
int32_t always_reaches_the_cold_chunk(int32_t arg0) {
extern int split182_report(int, int);
int var7;
int var9;
// x86-64 prologue: save rbp, frame 8 bytes
if (((unsigned int)((unsigned char)(((unsigned long)((unsigned int)(((unsigned long)((unsigned int)((~(unsigned long)((unsigned int)(arg0))))) >> 31))) & 255))) == 0)) {
var7 = split182_report(2, (unsigned long)((unsigned int)(arg0)));
return var7;
} else {
var9 = split182_report(1, (unsigned long)((unsigned int)(arg0)));
return var9;
}
} mix_with_outlinable_tail pass 36 lines
// glaurung: mix_with_outlinable_tail @ 0x12a6
int32_t mix_with_outlinable_tail(int32_t arg0, int32_t arg1) {
int state;
int round;
int recovery;
int step;
int local_18;
// x86-64 prologue: save rbp
local_18 = arg1;
state = arg0;
if (((long)(local_18) < 0)) {
L_12c6: ;
local_18 = 64;
} else {
if ((((unsigned long)((unsigned int)(local_18)) == 64) | ((long)(local_18) < 64))) {
goto L_12cd;
}
goto L_12c6;
}
L_12cd: ;
for (round = 0; (round < local_18); round++) {
state = (state ^ (unsigned int)(((unsigned long)((unsigned int)(state)) << 3)));
state = (state ^ (unsigned int)(((unsigned long)((unsigned int)(state)) >> 5)));
state = (state + (unsigned int)(round));
}
if (((unsigned long)((unsigned int)(state)) != 0)) {
return (unsigned int)(state);
} else {
recovery = arg0;
for (step = 0; ((((unsigned long)((unsigned int)(step)) == 7) | ((long)(step) < 7)) != 0); step++) {
recovery = (((unsigned int)(recovery) * 0x41c64e6d) + 0x3039);
recovery = (recovery ^ (unsigned int)(((unsigned long)((unsigned int)(recovery)) >> 7)));
}
return (unsigned int)(recovery);
}
} scan_with_two_cold_exits fail 50 lines
// glaurung: scan_with_two_cold_exits @ 0x11aa
int32_t scan_with_two_cold_exits(const int32_t * arg0, int32_t arg1) {
extern int split182_report(int, int);
int total;
int index;
int item;
int var0;
int var10;
int var21;
int var33;
total = 0;
if ((arg0 == 0)) {
var0 = split182_report(0xfffffffd, 0);
// x86-64 epilogue: restore rbp
return var0;
}
if (((unsigned int)((unsigned char)(((unsigned long)((unsigned int)(((unsigned long)((unsigned int)(arg1)) >> 31))) & 255))) == 0)) {
if (((((unsigned long)((unsigned int)(arg1)) == 64) | ((long)(arg1) < 64)) != 0)) {
goto L_1210;
}
}
var10 = split182_report(0xfffffffc, (unsigned long)((unsigned int)(arg1)));
// x86-64 epilogue: restore rbp
return var10;
L_1210: ;
index = 0;
goto L_1295;
L_1219: ;
item = arg0[(long)(index)];
if (((unsigned long)((unsigned int)(item)) == 0x80000000)) {
var21 = split182_report(0xfffffffb, (unsigned long)((unsigned int)(index)));
// x86-64 epilogue: restore rbp
return var21;
}
if (((unsigned int)((unsigned char)(((unsigned long)((unsigned int)(((unsigned long)((unsigned int)(item)) >> 31))) & 255))) != 0)) {
if (((unsigned int)((unsigned char)(((unsigned long)((unsigned int)(((unsigned long)((unsigned int)(total)) >> 31))) & 255))) != 0)) {
var33 = split182_report(0xfffffffa, (unsigned long)((unsigned int)(index)));
// x86-64 epilogue: restore rbp
return var33;
}
}
total = (total + (unsigned int)(((int)(((unsigned long)((unsigned int)(item)) + (unsigned long)((unsigned int)(((unsigned long)((unsigned int)(item)) >> 31))))) >> 1)));
index = (index + 1);
L_1295: ;
if ((index < arg1)) {
goto L_1219;
}
// x86-64 epilogue: restore rbp
return (unsigned int)(total);
} validate_with_cold_path pass 23 lines
// glaurung: validate_with_cold_path @ 0x113f
int32_t validate_with_cold_path(int32_t arg0, int32_t arg1) {
extern int split182_report(int, int);
int ret;
int var17;
// x86-64 prologue: save rbp, frame 8 bytes
if ((((unsigned long)((unsigned int)(arg1)) == 0) || ((long)(arg1) < 0))) {
ret = split182_report(0xffffffff, (unsigned long)((unsigned int)(arg1)));
// x86-64 epilogue: restore rbp
return ret;
}
if (((((unsigned long)((unsigned int)(arg1)) == 64) | ((long)(arg1) < 64)) == 0)) {
ret = split182_report(0xffffffff, (unsigned long)((unsigned int)(arg1)));
// x86-64 epilogue: restore rbp
return ret;
}
if (((unsigned int)((unsigned char)(((unsigned long)((unsigned int)(((unsigned long)((unsigned int)(arg0)) >> 31))) & 255))) == 0)) {
return (unsigned int)(((int)((((long long)(int)((((unsigned long)((long)((int)((unsigned long)((unsigned int)(arg0))))) >> 32) & 0xffffffff)) * (((long long)1) << 32)) + (unsigned int)((unsigned long)((unsigned int)(arg0)))) % (int)(arg1))));
} else {
var17 = split182_report(0xfffffffe, (unsigned long)((unsigned int)(arg0)));
return var17;
}
}