xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ do_parsepacket();
int parsepacket_timer(int tid, unsigned int tick, int id, int data) {
  do_parsepacket();
  return 0;
}


x86 assembly (clang, -O0):
<parsepacket_timer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    $0x0,%al
call   1030 <do_parsepacket@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parsepacket_timer>:
push   %rax
xor    %eax,%eax
call   1030 <do_parsepacket@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @parsepacket_timer(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = call i32 (...) @do_parsepacket()
ret i32 0
}

LLVM IR (-O2):
define i32 @parsepacket_timer(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 (...) @do_parsepacket()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void error(char *msg) {
  fprintf(stderr, "%s\n", msg);
  exit(1);
}


x86 assembly (clang, -O0):
<error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<error>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @error(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
void ff_hevc_put_hevc_bi_epel_v32_8_sse4() {}


x86 assembly (clang, -O0):
<ff_hevc_put_hevc_bi_epel_v32_8_sse4>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ff_hevc_put_hevc_bi_epel_v32_8_sse4>:
ret

LLVM IR (-O0):
define void @ff_hevc_put_hevc_bi_epel_v32_8_sse4() {
ret void
}

LLVM IR (-O2):
define void @ff_hevc_put_hevc_bi_epel_v32_8_sse4() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ CG_LoadingString(char *);
char *va(char *, char *);
void CG_CachingClient(char *model, char *skin) {
  char *s;
  s = va("PPM [%s]", model);
  CG_LoadingString(s);
}


x86 assembly (clang, -O0):
<CG_CachingClient>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec5(%rip),%rdi
call   1040 <va@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <CG_LoadingString@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CG_CachingClient>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1040 <va@plt>
mov    %rax,%rdi
pop    %rax
jmp    1030 <CG_LoadingString@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"PPM [%s]\00"
define void @CG_CachingClient(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = call i8* @va(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %6)
store i8* %7, i8** %5
%8 = load i8*, i8** %5
%9 = call i32 @CG_LoadingString(i8* %8)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"PPM [%s]\00"
define void @CG_CachingClient(i8* %0, i8* nocapture readnone %1) {
%3 = tail call i8* @va(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @CG_LoadingString(i8* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage() {
  fprintf(stderr, "echofs: [-d] [-w nthreads] [-p port] id domain password\n");
  exit(-1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [57 x i8] c"echofs: [-d] [-w nthreads] [-p port] id domain password\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [57 x i8] c"echofs: [-d] [-w nthreads] [-p port] id domain password\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 -1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
int dx_scheduler_destroyer(void *data) {
  (free(data));
  return 0;
}


x86 assembly (clang, -O0):
<dx_scheduler_destroyer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dx_scheduler_destroyer>:
push   %rax
call   1030 <free@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @dx_scheduler_destroyer(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @free(i8* %3)
ret i32 0
}

LLVM IR (-O2):
define i32 @dx_scheduler_destroyer(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ navigate_main_set_outline(int /*<<< orphan*/ *,
                                             int /*<<< orphan*/, int);
void on_show_route_highlight_dlg_closed(int exit_code, void *context) {
  navigate_main_set_outline(NULL, 0, -1);
}


x86 assembly (clang, -O0):
<on_show_route_highlight_dlg_closed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
mov    %eax,%edi
xor    %esi,%esi
mov    $0xffffffff,%edx
call   1030 <navigate_main_set_outline@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<on_show_route_highlight_dlg_closed>:
xor    %edi,%edi
xor    %esi,%esi
mov    $0xffffffff,%edx
jmp    1030 <navigate_main_set_outline@plt>

LLVM IR (-O0):
define void @on_show_route_highlight_dlg_closed(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = call i32 @navigate_main_set_outline(i32* null, i32 0, i32 -1)
ret void
}

LLVM IR (-O2):
define void @on_show_route_highlight_dlg_closed(i32 %0, i8* nocapture readnone %1) {
%3 = tail call i32 @navigate_main_set_outline(i32* null, i32 0, i32 -1)
ret void
}
__attribute__((always_)) void vmk_CPUMemFenceReadWrite(void) {
  asm volatile("mfence" ::: "memory");
}


x86 assembly (clang, -O0):
<vmk_CPUMemFenceReadWrite>:
push   %rbp
mov    %rsp,%rbp
mfence
pop    %rbp
ret

x86 assembly (clang, -O2):
<vmk_CPUMemFenceReadWrite>:
mfence
ret

LLVM IR (-O0):
define void @vmk_CPUMemFenceReadWrite() {
ret void
}

LLVM IR (-O2):
define void @vmk_CPUMemFenceReadWrite() {
tail call void asm sideeffect "mfence", "~{memory},~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
long double log2(double);
long double log2l(long double x) { return log2((double)x); }


x86 assembly (clang, -O0):
<log2l>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
fstpl  -0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1030 <log2@plt>
fld    %st(0)
fstp   %st(0)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log2l>:
fldt   0x8(%rsp)
fstpl  -0x8(%rsp)
movsd  -0x8(%rsp),%xmm0
jmp    1030 <log2@plt>

LLVM IR (-O0):
define x86_fp80 @log2l(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = fptrunc x86_fp80 %3 to double
%5 = call x86_fp80 @log2(double %4)
ret x86_fp80 %5
}

LLVM IR (-O2):
define x86_fp80 @log2l(x86_fp80 %0) {
%2 = fptrunc x86_fp80 %0 to double
%3 = tail call x86_fp80 @log2(double %2)
ret x86_fp80 %3
}
void u8g_i2c_stop(void) {}


x86 assembly (clang, -O0):
<u8g_i2c_stop>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<u8g_i2c_stop>:
ret

LLVM IR (-O0):
define void @u8g_i2c_stop() {
ret void
}

LLVM IR (-O2):
define void @u8g_i2c_stop() {
ret void
}
__attribute__((weak)) void os_tick_irqack(void) {}


x86 assembly (clang, -O0):
<os_tick_irqack>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<os_tick_irqack>:
ret

LLVM IR (-O0):
define weak void @os_tick_irqack() {
ret void
}

LLVM IR (-O2):
define weak void @os_tick_irqack() {
ret void
}
int startwin_puts(const char *s) {
  s = s;
  return 0;
}


x86 assembly (clang, -O0):
<startwin_puts>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<startwin_puts>:
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @startwin_puts(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
store i8* %3, i8** %2
ret i32 0
}

LLVM IR (-O2):
define i32 @startwin_puts(i8* nocapture readnone %0) {
ret i32 0
}
int helpFindSign(float x) {
  if (x > 0.0) {
    return 1;
  } else if (x < 0.0) {
    return -1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<helpFindSign>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    112b <helpFindSign+0x2b>
movl   $0x1,-0x4(%rbp)
jmp    1154 <helpFindSign+0x54>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
xorps  %xmm0,%xmm0
ucomisd %xmm1,%xmm0
jbe    114d <helpFindSign+0x4d>
movl   $0xffffffff,-0x4(%rbp)
jmp    1154 <helpFindSign+0x54>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<helpFindSign>:
xorps  %xmm1,%xmm1
xor    %ecx,%ecx
ucomiss %xmm0,%xmm1
seta   %cl
neg    %ecx
ucomiss %xmm1,%xmm0
mov    $0x1,%eax
cmovbe %ecx,%eax
ret

LLVM IR (-O0):
define i32 @helpFindSign(float %0) {
%2 = alloca i32
%3 = alloca float
store float %0, float* %3
%4 = load float, float* %3
%5 = fpext float %4 to double
%6 = fcmp ogt double %5, 0.000000e+00
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 1, i32* %2
br label %14
8: ; preds = %1
%9 = load float, float* %3
%10 = fpext float %9 to double
%11 = fcmp olt double %10, 0.000000e+00
br i1 %11, label %12, label %13
12: ; preds = %8
store i32 -1, i32* %2
br label %14
13: ; preds = %8
store i32 0, i32* %2
br label %14
14: ; preds = %13, %12, %7
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
define i32 @helpFindSign(float %0) {
%2 = fcmp ogt float %0, 0.000000e+00
%3 = fcmp olt float %0, 0.000000e+00
%4 = sext i1 %3 to i32
%5 = select i1 %2, i32 1, i32 %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ fail_test(int);
scalar_t__ run(char *);
void test_select() {
  do {
    if (run("test/progs/"
            "select_basic.b"))
      fail_test(122);
    ;
  } while (0);
  do {
    if (!run("test/progs/"
             "select_unknown_attr_err.b"))
      fail_test(123);
    ;
  } while (0);
}


x86 assembly (clang, -O0):
<test_select>:
push   %rbp
mov    %rsp,%rbp
jmp    1129 <test_select+0x9>
lea    0xed0(%rip),%rdi
call   1040 <run@plt>
cmp    $0x0,%rax
je     1149 <test_select+0x29>
mov    $0x7a,%edi
call   1030 <fail_test@plt>
jmp    114e <test_select+0x2e>
jmp    1153 <test_select+0x33>
lea    0xec0(%rip),%rdi
call   1040 <run@plt>
cmp    $0x0,%rax
jne    1173 <test_select+0x53>
mov    $0x7b,%edi
call   1030 <fail_test@plt>
jmp    1178 <test_select+0x58>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_select>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <run@plt>
test   %rax,%rax
je     113c <test_select+0x1c>
mov    $0x7a,%edi
call   1030 <fail_test@plt>
lea    0xed7(%rip),%rdi
call   1040 <run@plt>
test   %rax,%rax
je     114f <test_select+0x2f>
pop    %rax
ret
mov    $0x7b,%edi
pop    %rax
jmp    1030 <fail_test@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"test/progs/select_basic.b\00"
@.str.1 = [37 x i8] c"test/progs/select_unknown_attr_err.b\00"
define void @test_select() {
br label %1
1: ; preds = %0
%2 = call i64 @run(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = call i32 @fail_test(i32 122)
br label %6
6: ; preds = %4, %1
br label %7
7: ; preds = %6
br label %8
8: ; preds = %7
%9 = call i64 @run(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0))
%10 = icmp ne i64 %9, 0
br i1 %10, label %13, label %11
11: ; preds = %8
%12 = call i32 @fail_test(i32 123)
br label %13
13: ; preds = %11, %8
br label %14
14: ; preds = %13
ret void
}

LLVM IR (-O2):
@.str = [26 x i8] c"test/progs/select_basic.b\00"
@.str.1 = [37 x i8] c"test/progs/select_unknown_attr_err.b\00"
define void @test_select() {
%1 = tail call i64 @run(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i64 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 @fail_test(i32 122)
br label %5
5: ; preds = %3, %0
%6 = tail call i64 @run(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0))
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %5
%9 = tail call i32 @fail_test(i32 123)
br label %10
10: ; preds = %5, %8
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ec_i_add(double, double, double, double, double *, double *);
extern void ec_i_sub(double xl, double xu, double yl, double yu, double *lwb,
                     double *upb) {
  ec_i_add(xl, xu, -yu, -yl, lwb, upb);
}


x86 assembly (clang, -O0):
<ec_i_sub>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
mov    %rdi,-0x28(%rbp)
mov    %rsi,-0x30(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm2
movq   %xmm2,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm2
movsd  -0x18(%rbp),%xmm3
movq   %xmm3,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm3
mov    -0x28(%rbp),%rdi
mov    -0x30(%rbp),%rsi
call   1030 <ec_i_add@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ec_i_sub>:
movaps %xmm3,%xmm4
movaps 0xee6(%rip),%xmm3
xorps  %xmm3,%xmm4
xorps  %xmm2,%xmm3
movaps %xmm4,%xmm2
jmp    1030 <ec_i_add@plt>

LLVM IR (-O0):
define void @ec_i_sub(double %0, double %1, double %2, double %3, double* %4, double* %5) {
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double*
%12 = alloca double*
store double %0, double* %7
store double %1, double* %8
store double %2, double* %9
store double %3, double* %10
store double* %4, double** %11
store double* %5, double** %12
%13 = load double, double* %7
%14 = load double, double* %8
%15 = load double, double* %10
%16 = fneg double %15
%17 = load double, double* %9
%18 = fneg double %17
%19 = load double*, double** %11
%20 = load double*, double** %12
%21 = call i32 @ec_i_add(double %13, double %14, double %16, double %18, double* %19, double* %20)
ret void
}

LLVM IR (-O2):
define void @ec_i_sub(double %0, double %1, double %2, double %3, double* %4, double* %5) {
%7 = fneg double %3
%8 = fneg double %2
%9 = tail call i32 @ec_i_add(double %0, double %1, double %7, double %8, double* %4, double* %5)
ret void
}
/* Variables and functions */
unsigned char unhex(unsigned char);
unsigned char mjson_unhex_nimble(const char *s) {
  return (unsigned char)(unhex(((unsigned char *)s)[0]) << 4) |
         unhex(((unsigned char *)s)[1]);
}


x86 assembly (clang, -O0):
<mjson_unhex_nimble>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%edi
call   1030 <unhex@plt>
movzbl %al,%eax
shl    $0x4,%eax
movzbl %al,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x1(%rax),%edi
call   1030 <unhex@plt>
mov    %al,%cl
mov    -0xc(%rbp),%eax
movzbl %cl,%ecx
or     %ecx,%eax
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mjson_unhex_nimble>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
movzbl (%rdi),%edi
call   1030 <unhex@plt>
mov    %eax,%ebx
shl    $0x4,%bl
movzbl 0x1(%r14),%edi
call   1030 <unhex@plt>
or     %bl,%al
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define zeroext i8 @mjson_unhex_nimble(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = call zeroext i8 @unhex(i8 zeroext %5)
%7 = zext i8 %6 to i32
%8 = shl i32 %7, 4
%9 = trunc i32 %8 to i8
%10 = zext i8 %9 to i32
%11 = load i8*, i8** %2
%12 = getelementptr inbounds i8, i8* %11, i64 1
%13 = load i8, i8* %12
%14 = call zeroext i8 @unhex(i8 zeroext %13)
%15 = zext i8 %14 to i32
%16 = or i32 %10, %15
%17 = trunc i32 %16 to i8
ret i8 %17
}

LLVM IR (-O2):
define zeroext i8 @mjson_unhex_nimble(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = tail call zeroext i8 @unhex(i8 zeroext %2)
%4 = shl i8 %3, 4
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = tail call zeroext i8 @unhex(i8 zeroext %6)
%8 = or i8 %7, %4
ret i8 %8
}
main(void) {
  char *cp = "\"8\"";
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
lea    0xeee(%rip),%rax
mov    %rax,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
xor    %eax,%eax
ret

LLVM IR (-O0):
@.str = [6 x i8] c"\22\C2\918\22\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8** %2
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
size_t EVP_CIPHER_block_size(int /*<<< orphan*/);
int /*<<< orphan*/ EVP_aes_256_cbc();
size_t crypto_sym_enc_size(size_t size) {
  size_t block_size, offset;
  block_size = EVP_CIPHER_block_size(EVP_aes_256_cbc());
  offset = size % block_size;
  if (offset != 0)
    offset = block_size - offset;
  size += offset + 64 + 32;
  return size;
}


x86 assembly (clang, -O0):
<crypto_sym_enc_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <EVP_aes_256_cbc@plt>
mov    %eax,%edi
call   1040 <EVP_CIPHER_block_size@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1165 <crypto_sym_enc_size+0x45>
mov    -0x10(%rbp),%rax
sub    -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x40,%rax
add    $0x20,%rax
add    -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<crypto_sym_enc_size>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <EVP_aes_256_cbc@plt>
mov    %eax,%edi
call   1040 <EVP_CIPHER_block_size@plt>
mov    %rax,%rcx
mov    %rbx,%rax
or     %rcx,%rax
shr    $0x20,%rax
je     114b <crypto_sym_enc_size+0x2b>
mov    %rbx,%rax
xor    %edx,%edx
div    %rcx
jmp    1151 <crypto_sym_enc_size+0x31>
mov    %ebx,%eax
xor    %edx,%edx
div    %ecx
sub    %rdx,%rcx
add    $0x60,%rcx
test   %rdx,%rdx
mov    $0x60,%eax
cmovne %rcx,%rax
add    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @crypto_sym_enc_size(i64 %0) {
%2 = alloca i64
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %2
%5 = call i32 (...) @EVP_aes_256_cbc()
%6 = call i64 @EVP_CIPHER_block_size(i32 %5)
store i64 %6, i64* %3
%7 = load i64, i64* %2
%8 = load i64, i64* %3
%9 = urem i64 %7, %8
store i64 %9, i64* %4
%10 = load i64, i64* %4
%11 = icmp ne i64 %10, 0
br i1 %11, label %12, label %16
12: ; preds = %1
%13 = load i64, i64* %3
%14 = load i64, i64* %4
%15 = sub i64 %13, %14
store i64 %15, i64* %4
br label %16
16: ; preds = %12, %1
%17 = load i64, i64* %4
%18 = add i64 %17, 64
%19 = add i64 %18, 32
%20 = load i64, i64* %2
%21 = add i64 %20, %19
store i64 %21, i64* %2
%22 = load i64, i64* %2
ret i64 %22
}

LLVM IR (-O2):
define i64 @crypto_sym_enc_size(i64 %0) {
%2 = tail call i32 (...) @EVP_aes_256_cbc()
%3 = tail call i64 @EVP_CIPHER_block_size(i32 %2)
%4 = urem i64 %0, %3
%5 = icmp eq i64 %4, 0
%6 = add i64 %3, 96
%7 = sub i64 %6, %4
%8 = select i1 %5, i64 96, i64 %7
%9 = add i64 %8, %0
ret i64 %9
}
/* Variables and functions */
char const *tparm(char *, int, int /*<<< orphan*/, int /*<<< orphan*/,
                  int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/,
                  int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
const char *tty_parm1(char *cap, int a) {
  return tparm(cap, a, 0, 0, 0, 0, 0, 0, 0, 0);
}


x86 assembly (clang, -O0):
<tty_parm1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
xor    %r9d,%r9d
mov    %r9d,%edx
mov    %r9d,%ecx
mov    %r9d,%r8d
movl   $0x0,(%rsp)
movl   $0x0,0x8(%rsp)
movl   $0x0,0x10(%rsp)
movl   $0x0,0x18(%rsp)
call   1030 <tparm@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tty_parm1>:
push   %rax
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
push   $0x0
push   $0x0
push   $0x0
push   $0x0
call   1030 <tparm@plt>
add    $0x20,%rsp
pop    %rcx
ret

LLVM IR (-O0):
define i8* @tty_parm1(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = call i8* @tparm(i8* %5, i32 %6, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0)
ret i8* %7
}

LLVM IR (-O2):
define i8* @tty_parm1(i8* %0, i32 %1) {
%3 = tail call i8* @tparm(i8* %0, i32 %1, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0)
ret i8* %3
}
unsigned int random_between(unsigned int p, unsigned int r) {
  static unsigned int rand_seed = 10;
  rand_seed = p + (rand_seed * 65536) % (r - p);
  return rand_seed;
}


x86 assembly (clang, -O0):
<random_between>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    0x2f0a(%rip),%eax
shl    $0x10,%eax
mov    -0x8(%rbp),%ecx
sub    -0x4(%rbp),%ecx
xor    %edx,%edx
div    %ecx
mov    -0xc(%rbp),%eax
add    %edx,%eax
mov    %eax,0x2ef2(%rip)
mov    0x2eec(%rip),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<random_between>:
mov    0x2f1a(%rip),%eax
shl    $0x10,%eax
sub    %edi,%esi
xor    %edx,%edx
div    %esi
lea    (%rdx,%rdi,1),%eax
mov    %eax,0x2f08(%rip)
ret

LLVM IR (-O0):
@random_between.rand_seed = internal global i32 10
define i32 @random_between(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* @random_between.rand_seed
%7 = mul i32 %6, 65536
%8 = load i32, i32* %4
%9 = load i32, i32* %3
%10 = sub i32 %8, %9
%11 = urem i32 %7, %10
%12 = add i32 %5, %11
store i32 %12, i32* @random_between.rand_seed
%13 = load i32, i32* @random_between.rand_seed
ret i32 %13
}

LLVM IR (-O2):
@random_between.rand_seed = internal unnamed_addr global i32 10
define i32 @random_between(i32 %0, i32 %1) {
%3 = load i32, i32* @random_between.rand_seed
%4 = shl i32 %3, 16
%5 = sub i32 %1, %0
%6 = urem i32 %4, %5
%7 = add i32 %6, %0
store i32 %7, i32* @random_between.rand_seed
ret i32 %7
}
/* Variables and functions */
scalar_t__ some_function();
void t10() { (void *)some_function(); }


x86 assembly (clang, -O0):
<t10>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <some_function@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t10>:
xor    %eax,%eax
jmp    1030 <some_function@plt>

LLVM IR (-O0):
define void @t10() {
%1 = call i64 (...) @some_function()
%2 = inttoptr i64 %1 to i8*
ret void
}

LLVM IR (-O2):
define void @t10() {
%1 = tail call i64 (...) @some_function()
ret void
}
unsigned long curr_pageframes_count(void) { return 0; }


x86 assembly (clang, -O0):
<curr_pageframes_count>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<curr_pageframes_count>:
xor    %eax,%eax
ret

LLVM IR (-O0):
define i64 @curr_pageframes_count() {
ret i64 0
}

LLVM IR (-O2):
define i64 @curr_pageframes_count() {
ret i64 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void sub(int a, int b) { printf("%d\n", a - b); }


x86 assembly (clang, -O0):
<sub>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%esi
sub    -0x8(%rbp),%esi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sub>:
mov    %edi,%eax
sub    %esi,%eax
lea    0xee5(%rip),%rdi
mov    %eax,%esi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define void @sub(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = sub nsw i32 %5, %6
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %7)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @sub(i32 %0, i32 %1) {
%3 = sub nsw i32 %0, %1
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void swag() { printf("SWAG!\n"); }


x86 assembly (clang, -O0):
<swag>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<swag>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"SWAG!\0A\00"
define void @swag() {
%1 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [6 x i8] c"SWAG!\00"
define void @swag() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
scalar_t__ strverscmp(char const *, char *);
const char *gsasl_check_version(const char *req_version) {
  if (!req_version || strverscmp(req_version, "1.0") <= 0)
    return "1.0";
  return NULL;
}


x86 assembly (clang, -O0):
<gsasl_check_version>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1141 <gsasl_check_version+0x31>
mov    -0x10(%rbp),%rdi
lea    0xece(%rip),%rsi
call   1030 <strverscmp@plt>
cmp    $0x0,%rax
jg     1151 <gsasl_check_version+0x41>
lea    0xeb8(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1159 <gsasl_check_version+0x49>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gsasl_check_version>:
test   %rdi,%rdi
je     1133 <gsasl_check_version+0x23>
push   %rbx
lea    0xee3(%rip),%rbx
mov    %rbx,%rsi
call   1030 <strverscmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
cmovle %rbx,%rax
pop    %rbx
ret
lea    0xec6(%rip),%rax
ret

LLVM IR (-O0):
@.str = [4 x i8] c"1.0\00"
define i8* @gsasl_check_version(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = icmp ne i8* %4, null
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8*, i8** %3
%8 = call i64 @strverscmp(i8* %7, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%9 = icmp sle i64 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %6, %1
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8** %2
br label %12
11: ; preds = %6
store i8* null, i8** %2
br label %12
12: ; preds = %11, %10
%13 = load i8*, i8** %2
ret i8* %13
}

LLVM IR (-O2):
@.str = [4 x i8] c"1.0\00"
define i8* @gsasl_check_version(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = tail call i64 @strverscmp(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%5 = icmp slt i64 %4, 1
%6 = select i1 %5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* null
br label %7
7: ; preds = %3, %1
%8 = phi i8* [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), %1 ], [ %6, %3 ]
ret i8* %8
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isspace(int);
void t_isspace_0xea() {
  Assert_real((isspace(234) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isspace.c",
              1175, ("isspace should be 0 for 0xea"));
}


x86 assembly (clang, -O0):
<t_isspace_0xea>:
push   %rbp
mov    %rsp,%rbp
mov    $0xea,%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x497,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isspace_0xea>:
push   %rax
mov    $0xea,%edi
call   1030 <isspace@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x497,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isspace.c\00"
@.str.1 = [29 x i8] c"isspace should be 0 for 0xea\00"
define void @t_isspace_0xea() {
%1 = call i64 @isspace(i32 234)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1175, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isspace.c\00"
@.str.1 = [29 x i8] c"isspace should be 0 for 0xea\00"
define void @t_isspace_0xea() {
%1 = tail call i64 @isspace(i32 234)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1175, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int rcu_gen_int32_hash_jenkins_impl(int key) {
  key += (key << 12);
  key ^= (key >> 22);
  key += (key << 4);
  key ^= (key >> 9);
  key += (key << 10);
  key ^= (key >> 2);
  key += (key << 7);
  key ^= (key >> 12);
  return (key);
}


x86 assembly (clang, -O0):
<rcu_gen_int32_hash_jenkins_impl>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0xc,%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x16,%eax
xor    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x4,%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x9,%eax
xor    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0xa,%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x2,%eax
xor    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x7,%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0xc,%eax
xor    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rcu_gen_int32_hash_jenkins_impl>:
mov    %edi,%eax
shl    $0xc,%eax
add    %edi,%eax
mov    %eax,%ecx
sar    $0x16,%ecx
xor    %eax,%ecx
mov    %ecx,%eax
shl    $0x4,%eax
add    %ecx,%eax
mov    %eax,%ecx
sar    $0x9,%ecx
xor    %eax,%ecx
mov    %ecx,%eax
shl    $0xa,%eax
add    %ecx,%eax
mov    %eax,%ecx
sar    $0x2,%ecx
xor    %eax,%ecx
mov    %ecx,%edx
shl    $0x7,%edx
add    %ecx,%edx
mov    %edx,%eax
sar    $0xc,%eax
xor    %edx,%eax
ret

LLVM IR (-O0):
define i32 @rcu_gen_int32_hash_jenkins_impl(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = shl i32 %3, 12
%5 = load i32, i32* %2
%6 = add nsw i32 %5, %4
store i32 %6, i32* %2
%7 = load i32, i32* %2
%8 = ashr i32 %7, 22
%9 = load i32, i32* %2
%10 = xor i32 %9, %8
store i32 %10, i32* %2
%11 = load i32, i32* %2
%12 = shl i32 %11, 4
%13 = load i32, i32* %2
%14 = add nsw i32 %13, %12
store i32 %14, i32* %2
%15 = load i32, i32* %2
%16 = ashr i32 %15, 9
%17 = load i32, i32* %2
%18 = xor i32 %17, %16
store i32 %18, i32* %2
%19 = load i32, i32* %2
%20 = shl i32 %19, 10
%21 = load i32, i32* %2
%22 = add nsw i32 %21, %20
store i32 %22, i32* %2
%23 = load i32, i32* %2
%24 = ashr i32 %23, 2
%25 = load i32, i32* %2
%26 = xor i32 %25, %24
store i32 %26, i32* %2
%27 = load i32, i32* %2
%28 = shl i32 %27, 7
%29 = load i32, i32* %2
%30 = add nsw i32 %29, %28
store i32 %30, i32* %2
%31 = load i32, i32* %2
%32 = ashr i32 %31, 12
%33 = load i32, i32* %2
%34 = xor i32 %33, %32
store i32 %34, i32* %2
%35 = load i32, i32* %2
ret i32 %35
}

LLVM IR (-O2):
define i32 @rcu_gen_int32_hash_jenkins_impl(i32 %0) {
%2 = mul i32 %0, 4097
%3 = ashr i32 %2, 22
%4 = xor i32 %3, %2
%5 = mul i32 %4, 17
%6 = ashr i32 %5, 9
%7 = xor i32 %6, %5
%8 = mul i32 %7, 1025
%9 = ashr i32 %8, 2
%10 = xor i32 %9, %8
%11 = mul i32 %10, 129
%12 = ashr i32 %11, 12
%13 = xor i32 %12, %11
ret i32 %13
}
/* Variables and functions */
void *malloc(size_t);
int /*<<< orphan*/ memcheck(void *);
void *malloc_chk(size_t memsize) {
  void *tmp = malloc(memsize);
  memcheck(tmp);
  return tmp;
}


x86 assembly (clang, -O0):
<malloc_chk>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <memcheck@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<malloc_chk>:
push   %rbx
call   1030 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <memcheck@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @malloc_chk(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = call i32 @memcheck(i8* %6)
%8 = load i8*, i8** %3
ret i8* %8
}

LLVM IR (-O2):
define i8* @malloc_chk(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = tail call i32 @memcheck(i8* %2)
ret i8* %2
}
/* Type definitions */
struct hashids_t {
  int dummy;
};

/* Variables and functions */
unsigned int hashids_encode(struct hashids_t *, char *, int,
                            unsigned long long *);
unsigned int hashids_encode_one(struct hashids_t *hashids, char *buffer,
                                unsigned long long number) {
  return hashids_encode(hashids, buffer, 1, &number);
}


x86 assembly (clang, -O0):
<hashids_encode_one>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x1,%edx
lea    -0x18(%rbp),%rcx
call   1030 <hashids_encode@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hashids_encode_one>:
push   %rax
mov    %rdx,(%rsp)
mov    %rsp,%rcx
mov    $0x1,%edx
call   1030 <hashids_encode@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.hashids_t = type { i32 }
define i32 @hashids_encode_one(%struct.hashids_t* %0, i8* %1, i64 %2) {
%4 = alloca %struct.hashids_t*
%5 = alloca i8*
%6 = alloca i64
store %struct.hashids_t* %0, %struct.hashids_t** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load %struct.hashids_t*, %struct.hashids_t** %4
%8 = load i8*, i8** %5
%9 = call i32 @hashids_encode(%struct.hashids_t* %7, i8* %8, i32 1, i64* %6)
ret i32 %9
}

LLVM IR (-O2):
%struct.hashids_t = type { i32 }
define i32 @hashids_encode_one(%struct.hashids_t* %0, i8* %1, i64 %2) {
%4 = alloca i64
store i64 %2, i64* %4
%5 = call i32 @hashids_encode(%struct.hashids_t* %0, i8* %1, i32 1, i64* %4)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void *malloc(unsigned int);
void f2(int size) {
  void *ptr = malloc((unsigned)size);
  free(ptr);
}


x86 assembly (clang, -O0):
<f2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f2>:
push   %rax
call   1040 <malloc@plt>
mov    %rax,%rdi
pop    %rax
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @f2(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i8* @malloc(i32 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = call i32 @free(i8* %6)
ret void
}

LLVM IR (-O2):
define void @f2(i32 %0) {
%2 = tail call i8* @malloc(i32 %0)
%3 = tail call i32 @free(i8* %2)
ret void
}
void set_slang_delay(int v) {}


x86 assembly (clang, -O0):
<set_slang_delay>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_slang_delay>:
ret

LLVM IR (-O0):
define void @set_slang_delay(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
ret void
}

LLVM IR (-O2):
define void @set_slang_delay(i32 %0) {
ret void
}
int GetBinIdForEntropy(double min, double max, double val) {
  const double range = max - min + 1e-6;
  const double delta = val - min;
  return (int)(4 * delta / range);
}


x86 assembly (clang, -O0):
<GetBinIdForEntropy>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
subsd  -0x8(%rbp),%xmm0
movsd  0xee3(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
subsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  0xebb(%rip),%xmm0
mulsd  -0x28(%rbp),%xmm0
divsd  -0x20(%rbp),%xmm0
cvttsd2si %xmm0,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetBinIdForEntropy>:
subsd  %xmm0,%xmm1
addsd  0xef4(%rip),%xmm1
subsd  %xmm0,%xmm2
mulsd  0xef0(%rip),%xmm2
divsd  %xmm1,%xmm2
cvttsd2si %xmm2,%eax
ret

LLVM IR (-O0):
define i32 @GetBinIdForEntropy(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%9 = load double, double* %5
%10 = load double, double* %4
%11 = fsub double %9, %10
%12 = fadd double %11, 0x3EB0C6F7A0B5ED8D
store double %12, double* %7
%13 = load double, double* %6
%14 = load double, double* %4
%15 = fsub double %13, %14
store double %15, double* %8
%16 = load double, double* %8
%17 = fmul double 4.000000e+00, %16
%18 = load double, double* %7
%19 = fdiv double %17, %18
%20 = fptosi double %19 to i32
ret i32 %20
}

LLVM IR (-O2):
define i32 @GetBinIdForEntropy(double %0, double %1, double %2) {
%4 = fsub double %1, %0
%5 = fadd double %4, 0x3EB0C6F7A0B5ED8D
%6 = fsub double %2, %0
%7 = fmul double %6, 4.000000e+00
%8 = fdiv double %7, %5
%9 = fptosi double %8 to i32
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ GlobalMiniProjZW();
float WorldSpaceDepthToNDC_Perspective(float, int /*<<< orphan*/);
float WorldSpaceDepthToNDC(float worldSpaceDepth) {
  return WorldSpaceDepthToNDC_Perspective(worldSpaceDepth, GlobalMiniProjZW());
}


x86 assembly (clang, -O0):
<WorldSpaceDepthToNDC>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
mov    $0x0,%al
call   1040 <GlobalMiniProjZW@plt>
movss  -0x8(%rbp),%xmm0
mov    %eax,%edi
call   1030 <WorldSpaceDepthToNDC_Perspective@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<WorldSpaceDepthToNDC>:
push   %rax
movss  %xmm0,0x4(%rsp)
xor    %eax,%eax
call   1040 <GlobalMiniProjZW@plt>
movss  0x4(%rsp),%xmm0
mov    %eax,%edi
pop    %rax
jmp    1030 <WorldSpaceDepthToNDC_Perspective@plt>

LLVM IR (-O0):
define float @WorldSpaceDepthToNDC(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call i32 (...) @GlobalMiniProjZW()
%5 = call float @WorldSpaceDepthToNDC_Perspective(float %3, i32 %4)
ret float %5
}

LLVM IR (-O2):
define float @WorldSpaceDepthToNDC(float %0) {
%2 = tail call i32 (...) @GlobalMiniProjZW()
%3 = tail call float @WorldSpaceDepthToNDC_Perspective(float %0, i32 %2)
ret float %3
}
void fa73(void) {
P0A:
  goto P0A;
  ({
    P01A:
      goto P01A;
      ({
        P012A:
          goto P012A;
          0;
      });
    a:
      ({
        P013A:
          goto P013A;
          0;
      });
    p01C:
      goto p01C;
      goto a;
    P01C:
      goto P01C;
      0;
  });
P0B:
  goto P0B;
  ({
    P02A:
      goto P02A;
      ({
        P024A:
          goto P024A;
          0;
      });
    P02B:
      goto P02B;
      ({
        P025A:
          goto P025A;
          0;
      });
    P02C:
      goto P02C;
      0;
  });
P0C:
  goto P0C;
  0;
P0D:
  goto P0D;
}


x86 assembly (clang, -O0):
<fa73>:
push   %rbp
mov    %rsp,%rbp
jmp    1104 <fa73+0x4>

x86 assembly (clang, -O2):
<fa73>:
jmp    1100 <fa73>

LLVM IR (-O0):
define void @fa73() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
br label %7
7: ; preds = %7, %0
br label %7
8: ; No predecessors!
br label %9
9: ; preds = %9, %8
br label %9
10: ; No predecessors!
br label %11
11: ; preds = %11, %10
br label %11
12: ; No predecessors!
br label %13
13: ; preds = %13, %12
br label %13
14: ; preds = %14
br label %14
15: ; preds = %15
br label %15
16: ; preds = %16
br label %16
17: ; No predecessors!
br label %18
18: ; preds = %18, %17
br label %18
19: ; No predecessors!
br label %20
20: ; preds = %20, %19
br label %20
21: ; preds = %21
br label %21
22: ; No predecessors!
br label %23
23: ; preds = %23, %22
br label %23
24: ; preds = %24
br label %24
25: ; preds = %25
br label %25
26: ; preds = %26
br label %26
}

LLVM IR (-O2):
define void @fa73() {
br label %1
1: ; preds = %1, %0
br label %1
}
int clamp(int i, int n) { return (i < n) ? i : n - 1; }


x86 assembly (clang, -O0):
<clamp>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1121 <clamp+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    112a <clamp+0x2a>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<clamp>:
lea    -0x1(%rsi),%eax
cmp    %esi,%edi
cmovl  %edi,%eax
ret

LLVM IR (-O0):
define i32 @clamp(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = icmp slt i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %3
br label %13
10: ; preds = %2
%11 = load i32, i32* %4
%12 = sub nsw i32 %11, 1
br label %13
13: ; preds = %10, %8
%14 = phi i32 [ %9, %8 ], [ %12, %10 ]
ret i32 %14
}

LLVM IR (-O2):
define i32 @clamp(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = add nsw i32 %1, -1
%5 = select i1 %3, i32 %0, i32 %4
ret i32 %5
}
void math_asin(void) {
  double d = lua_check_number(1, "asin");
  lua_pushnumber(((asin(d)) * 180.0 / 3.14159265358979323846));
}


x86 assembly (clang, -O0):
<math_asin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x1,%edi
lea    0xecc(%rip),%rsi
mov    $0x0,%al
call   1030 <lua_check_number@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1050 <asin@plt>
movsd  0xea2(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe8e(%rip),%xmm1
divsd  %xmm1,%xmm0
mov    $0x1,%al
call   1040 <lua_pushnumber@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<math_asin>:
push   %rax
lea    0xed8(%rip),%rsi
mov    $0x1,%edi
xor    %eax,%eax
call   1030 <lua_check_number@plt>
cvtsi2sd %eax,%xmm0
call   1050 <asin@plt>
mulsd  0xeab(%rip),%xmm0
divsd  0xeab(%rip),%xmm0
mov    $0x1,%al
pop    %rcx
jmp    1040 <lua_pushnumber@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"asin\00"
define void @math_asin() {
%1 = alloca double
%2 = call i32 (i32, i8*, ...) bitcast (i32 (...)* @lua_check_number to i32 (i32, i8*, ...)*)(i32 1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%3 = sitofp i32 %2 to double
store double %3, double* %1
%4 = load double, double* %1
%5 = call double @asin(double %4)
%6 = fmul double %5, 1.800000e+02
%7 = fdiv double %6, 0x400921FB54442D18
%8 = call i32 (double, ...) bitcast (i32 (...)* @lua_pushnumber to i32 (double, ...)*)(double %7)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"asin\00"
define void @math_asin() {
%1 = tail call i32 (i32, i8*, ...) bitcast (i32 (...)* @lua_check_number to i32 (i32, i8*, ...)*)(i32 1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%2 = sitofp i32 %1 to double
%3 = tail call double @asin(double %2)
%4 = fmul double %3, 1.800000e+02
%5 = fdiv double %4, 0x400921FB54442D18
%6 = tail call i32 (double, ...) bitcast (i32 (...)* @lua_pushnumber to i32 (double, ...)*)(double %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
void test_print(void *in) {
  char *c;
  c = (char *)in;
  printf(" %c \n", *c);
}


x86 assembly (clang, -O0):
<test_print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
lea    0xed1(%rip),%rdi
movsbl (%rax),%esi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_print>:
movsbl (%rdi),%esi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [6 x i8] c" %c \0A\00"
define void @test_print(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
store i8* %4, i8** %3
%5 = load i8*, i8** %3
%6 = load i8, i8* %5
%7 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8 signext %6)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c" %c \0A\00"
define void @test_print(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8 signext %2)
ret void
}
int twritep() {}


x86 assembly (clang, -O0):
<twritep>:
push   %rbp
mov    %rsp,%rbp
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<twritep>:
ret

LLVM IR (-O0):
define i32 @twritep() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @twritep() {
ret i32 undef
}