xunge/DecIR huggingface dataset:
/* Variables and functions */
int ts72xx_model();
int board_is_ts7260(void) { return ts72xx_model() == 0x02; }


x86 assembly (clang, -O0):
<board_is_ts7260>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <ts72xx_model@plt>
cmp    $0x2,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<board_is_ts7260>:
push   %rax
xor    %eax,%eax
call   1030 <ts72xx_model@plt>
xor    %ecx,%ecx
cmp    $0x2,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @board_is_ts7260() {
%1 = call i32 (...) @ts72xx_model()
%2 = icmp eq i32 %1, 2
%3 = zext i1 %2 to i32
ret i32 %3
}

LLVM IR (-O2):
define i32 @board_is_ts7260() {
%1 = tail call i32 (...) @ts72xx_model()
%2 = icmp eq i32 %1, 2
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
scalar_t__ phys_to_virt(int);
int /*<<< orphan*/ printk(char *);
void store_NMI_vector(unsigned short *high, unsigned short *low) {
  printk("Storing NMI vector\n");
  *high = *((volatile unsigned short *)phys_to_virt(0xa));
  *low = *((volatile unsigned short *)phys_to_virt(0x8));
}


x86 assembly (clang, -O0):
<store_NMI_vector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec9(%rip),%rdi
call   1030 <printk@plt>
mov    $0xa,%edi
call   1040 <phys_to_virt@plt>
mov    (%rax),%cx
mov    -0x8(%rbp),%rax
mov    %cx,(%rax)
mov    $0x8,%edi
call   1040 <phys_to_virt@plt>
mov    (%rax),%cx
mov    -0x10(%rbp),%rax
mov    %cx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<store_NMI_vector>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xecf(%rip),%rdi
call   1030 <printk@plt>
mov    $0xa,%edi
call   1040 <phys_to_virt@plt>
movzwl (%rax),%eax
mov    %ax,(%rbx)
mov    $0x8,%edi
call   1040 <phys_to_virt@plt>
movzwl (%rax),%eax
mov    %ax,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [20 x i8] c"Storing NMI vector\0A\00"
define void @store_NMI_vector(i16* %0, i16* %1) {
%3 = alloca i16*
%4 = alloca i16*
store i16* %0, i16** %3
store i16* %1, i16** %4
%5 = call i32 @printk(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%6 = call i64 @phys_to_virt(i32 10)
%7 = inttoptr i64 %6 to i16*
%8 = load volatile i16, i16* %7
%9 = load i16*, i16** %3
store i16 %8, i16* %9
%10 = call i64 @phys_to_virt(i32 8)
%11 = inttoptr i64 %10 to i16*
%12 = load volatile i16, i16* %11
%13 = load i16*, i16** %4
store i16 %12, i16* %13
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"Storing NMI vector\0A\00"
define void @store_NMI_vector(i16* nocapture writeonly %0, i16* nocapture writeonly %1) {
%3 = tail call i32 @printk(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%4 = tail call i64 @phys_to_virt(i32 10)
%5 = inttoptr i64 %4 to i16*
%6 = load volatile i16, i16* %5
store i16 %6, i16* %0
%7 = tail call i64 @phys_to_virt(i32 8)
%8 = inttoptr i64 %7 to i16*
%9 = load volatile i16, i16* %8
store i16 %9, i16* %1
ret void
}
unsigned long atomic_cmpxchg8(unsigned long *addr, unsigned long oldval,
                              unsigned long newval) {
  asm volatile("lock; cmpxchgq %2, %1\n"
               : "=a"(oldval), "+m"(*addr)
               : "r"(newval), "0"(oldval)
               : "memory");
  return oldval;
}


x86 assembly (clang, -O0):
<atomic_cmpxchg8>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rcx
mov    -0x18(%rbp),%rdx
mov    -0x10(%rbp),%rax
lock cmpxchg %rdx,(%rcx)
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<atomic_cmpxchg8>:
mov    %rsi,%rax
lock cmpxchg %rdx,(%rdi)
ret

LLVM IR (-O0):
define i64 @atomic_cmpxchg8(i64* %0, i64 %1, i64 %2) {
%4 = alloca i64*
%5 = alloca i64
%6 = alloca i64
store i64* %0, i64** %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%7 = load i64*, i64** %4
%8 = load i64, i64* %6
%9 = load i64, i64* %5
%10 = call i64 asm sideeffect "lock; cmpxchgq $2, $1\0A", "={ax},=*m,r,0,*m,~{memory},~{dirflag},~{fpsr},~{flags}"(i64* elementtype(i64) %7, i64 %8, i64 %9, i64* elementtype(i64) %7)
store i64 %10, i64* %5
%11 = load i64, i64* %5
ret i64 %11
}

LLVM IR (-O2):
define i64 @atomic_cmpxchg8(i64* %0, i64 %1, i64 %2) {
%4 = tail call i64 asm sideeffect "lock; cmpxchgq $2, $1\0A", "={ax},=*m,r,0,*m,~{memory},~{dirflag},~{fpsr},~{flags}"(i64* elementtype(i64) %0, i64 %2, i64 %1, i64* elementtype(i64) %0)
ret i64 %4
}
/* Variables and functions */
int findMissing(int *, int);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  int a[6] = {0, 1, 2, 3, 5, 6};
  printf("%d\n", findMissing(a, 6));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xec3(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xec0(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xebd(%rip),%rax
mov    %rax,-0x20(%rbp)
lea    -0x30(%rbp),%rdi
mov    $0x6,%esi
call   1040 <findMissing@plt>
mov    %eax,%esi
lea    0xeaa(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
mov    0xee5(%rip),%rax
mov    %rax,0x10(%rsp)
movaps 0xec9(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x6,%esi
call   1040 <findMissing@plt>
lea    0xec9(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.a = [6 x i32] [i32 0, i32 1, i32 2, i32 3, i32 5, i32 6]
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [6 x i32]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = bitcast [6 x i32]* %6 to i8*
%8 = getelementptr inbounds [6 x i32], [6 x i32]* %6, i64 0, i64 0
%9 = call i32 @findMissing(i32* %8, i32 6)
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
ret i32 0
}

LLVM IR (-O2):
@__const.main.a = [6 x i32] [i32 0, i32 1, i32 2, i32 3, i32 5, i32 6]
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [6 x i32]
%4 = bitcast [6 x i32]* %3 to i8*
%5 = getelementptr inbounds [6 x i32], [6 x i32]* %3, i64 0, i64 0
%6 = call i32 @findMissing(i32* %5, i32 6)
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %6)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
int isqrt(int);
void t_sqrt_190() {
  Assert_real((isqrt(190) == 13),
              "/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/stdlib/isqrt.c",
              955, ("Integer square root of 190 should be 13"));
}


x86 assembly (clang, -O0):
<t_sqrt_190>:
push   %rbp
mov    %rsp,%rbp
mov    $0xbe,%edi
call   1030 <isqrt@plt>
cmp    $0xd,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xec0(%rip),%rsi
mov    $0x3bb,%edx
lea    0xf56(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_sqrt_190>:
push   %rax
mov    $0xbe,%edi
call   1030 <isqrt@plt>
xor    %edi,%edi
cmp    $0xd,%eax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf60(%rip),%rcx
mov    $0x3bb,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [162 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/stdlib/isqrt.c\00"
@.str.1 = [40 x i8] c"Integer square root of 190 should be 13\00"
define void @t_sqrt_190() {
%1 = call i32 @isqrt(i32 190)
%2 = icmp eq i32 %1, 13
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 955, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [162 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/stdlib/isqrt.c\00"
@.str.1 = [40 x i8] c"Integer square root of 190 should be 13\00"
define void @t_sqrt_190() {
%1 = tail call i32 @isqrt(i32 190)
%2 = icmp eq i32 %1, 13
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 955, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void inc_zcache_evicted_eph_zpages(unsigned zpages) {}


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

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

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

LLVM IR (-O2):
define void @inc_zcache_evicted_eph_zpages(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ test();
int main() {
  test();
  getchar();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <test@plt>
mov    $0x0,%al
call   1030 <getchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <test@plt>
xor    %eax,%eax
call   1030 <getchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @test()
%3 = call i32 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test()
%2 = tail call i32 (...) @getchar()
ret i32 0
}
char *Bot_BestPlayerName(void) { return ((void *)0); }


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

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

LLVM IR (-O0):
define i8* @Bot_BestPlayerName() {
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @Bot_BestPlayerName() {
ret i8* null
}
long long r1(void *x) { return *(long long *)(x + 32767); }


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

x86 assembly (clang, -O2):
<r1>:
mov    0x7fff(%rdi),%rax
ret

LLVM IR (-O0):
define i64 @r1(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr i8, i8* %3, i64 32767
%5 = bitcast i8* %4 to i64*
%6 = load i64, i64* %5
ret i64 %6
}

LLVM IR (-O2):
define i64 @r1(i8* nocapture %0) {
%2 = getelementptr i8, i8* %0, i64 32767
%3 = bitcast i8* %2 to i64*
%4 = load i64, i64* %3
ret i64 %4
}
/* Type definitions */
struct timeval {
  double tv_sec;
  double tv_usec;
};

/* Variables and functions */
double floor(double);
void num_to_timeval(double d, struct timeval *tv) {
  double sec = floor(d);
  tv->tv_sec = sec;
  tv->tv_usec = (d - sec) * 1000000;
}


x86 assembly (clang, -O0):
<num_to_timeval>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <floor@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x8(%rbp),%xmm0
subsd  -0x18(%rbp),%xmm0
movsd  0xeb1(%rip),%xmm1
mulsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,0x8(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<num_to_timeval>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
movsd  %xmm0,0x8(%rsp)
call   1030 <floor@plt>
movsd  %xmm0,(%rbx)
movsd  0x8(%rsp),%xmm1
subsd  %xmm0,%xmm1
mulsd  0xec7(%rip),%xmm1
movsd  %xmm1,0x8(%rbx)
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.timeval = type { double, double }
define void @num_to_timeval(double %0, %struct.timeval* %1) {
%3 = alloca double
%4 = alloca %struct.timeval*
%5 = alloca double
store double %0, double* %3
store %struct.timeval* %1, %struct.timeval** %4
%6 = load double, double* %3
%7 = call double @llvm.floor.f64(double %6)
store double %7, double* %5
%8 = load double, double* %5
%9 = load %struct.timeval*, %struct.timeval** %4
%10 = getelementptr inbounds %struct.timeval, %struct.timeval* %9, i32 0, i32 0
store double %8, double* %10
%11 = load double, double* %3
%12 = load double, double* %5
%13 = fsub double %11, %12
%14 = fmul double %13, 1.000000e+06
%15 = load %struct.timeval*, %struct.timeval** %4
%16 = getelementptr inbounds %struct.timeval, %struct.timeval* %15, i32 0, i32 1
store double %14, double* %16
ret void
}

LLVM IR (-O2):
%struct.timeval = type { double, double }
define void @num_to_timeval(double %0, %struct.timeval* nocapture writeonly %1) {
%3 = tail call double @llvm.floor.f64(double %0)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
store double %3, double* %4
%5 = fsub double %0, %3
%6 = fmul double %5, 1.000000e+06
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
store double %6, double* %7
ret void
}
/* Variables and functions */
int App_Init();
int App_Run();
int main(int argc, char *argv[]) {
  int ret;
  if ((ret = App_Init()))
    return ret;
  ret = App_Run();
  return ret;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <App_Init@plt>
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
je     1154 <main+0x34>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1164 <main+0x44>
mov    $0x0,%al
call   1030 <App_Run@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <App_Init@plt>
test   %eax,%eax
je     112e <main+0xe>
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
jmp    1030 <App_Run@plt>

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32 (...) @App_Init()
store i32 %7, i32* %6
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load i32, i32* %6
store i32 %10, i32* %3
br label %14
11: ; preds = %2
%12 = call i32 (...) @App_Run()
store i32 %12, i32* %6
%13 = load i32, i32* %6
store i32 %13, i32* %3
br label %14
14: ; preds = %11, %9
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @App_Init()
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 (...) @App_Run()
br label %7
7: ; preds = %2, %5
%8 = phi i32 [ %6, %5 ], [ %3, %2 ]
ret i32 %8
}
void dockstar_dt_init(void) {}


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

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

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

LLVM IR (-O2):
define void @dockstar_dt_init() {
ret void
}
setascii(argc, argv) char *argv[];
{ setmode("netascii"); }


x86 assembly (clang, -O0):
<setascii>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeda(%rip),%rdi
mov    $0x0,%al
call   1030 <setmode@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setascii>:
lea    0xee9(%rip),%rdi
xor    %eax,%eax
jmp    1030 <setmode@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"netascii\00"
define i32 @setascii(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (i8*, ...) bitcast (i32 (...)* @setmode to i32 (i8*, ...)*)(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* %3
ret i32 %7
}

LLVM IR (-O2):
@.str = [9 x i8] c"netascii\00"
define i32 @setascii(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (i8*, ...) bitcast (i32 (...)* @setmode to i32 (i8*, ...)*)(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int find_first_bit1(int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int a = 0x80000000;
  printf("first bit one: %d\n", find_first_bit1(a));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x80000000,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <find_first_bit1@plt>
mov    %eax,%esi
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x80000000,%edi
call   1040 <find_first_bit1@plt>
lea    0xece(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"first bit one: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 -2147483648, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @find_first_bit1(i32 %3)
%5 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [19 x i8] c"first bit one: %d\0A\00"
define i32 @main() {
%1 = tail call i32 @find_first_bit1(i32 -2147483648)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef void const *b;
typedef void *a;

/* Variables and functions */
int /*<<< orphan*/ cpy2(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int cpy4(void *, void const *);
void cpy6(void *a, const void *b) {
  cpy4(a, b), cpy2((uint8_t *)a + 4, (uint8_t *)b + 4);
}


x86 assembly (clang, -O0):
<cpy6>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <cpy4@plt>
mov    -0x8(%rbp),%rdi
add    $0x10,%rdi
mov    -0x10(%rbp),%rsi
add    $0x10,%rsi
call   1030 <cpy2@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpy6>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <cpy4@plt>
add    $0x10,%rbx
add    $0x10,%r14
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <cpy2@plt>

LLVM IR (-O0):
define void @cpy6(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i32 @cpy4(i8* %5, i8* %6)
%8 = load i8*, i8** %3
%9 = bitcast i8* %8 to i32*
%10 = getelementptr inbounds i32, i32* %9, i64 4
%11 = load i8*, i8** %4
%12 = bitcast i8* %11 to i32*
%13 = getelementptr inbounds i32, i32* %12, i64 4
%14 = call i32 @cpy2(i32* %10, i32* %13)
ret void
}

LLVM IR (-O2):
define void @cpy6(i8* %0, i8* %1) {
%3 = tail call i32 @cpy4(i8* %0, i8* %1)
%4 = getelementptr inbounds i8, i8* %0, i64 16
%5 = bitcast i8* %4 to i32*
%6 = getelementptr inbounds i8, i8* %1, i64 16
%7 = bitcast i8* %6 to i32*
%8 = tail call i32 @cpy2(i32* %5, i32* %7)
ret void
}
void ble_rsp_attributes_write(
    const struct ble_msg_attributes_write_rsp_t *msg) {}


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

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

LLVM IR (-O0):
%struct.ble_msg_attributes_write_rsp_t = type opaque
define void @ble_rsp_attributes_write(%struct.ble_msg_attributes_write_rsp_t* %0) {
%2 = alloca %struct.ble_msg_attributes_write_rsp_t*
store %struct.ble_msg_attributes_write_rsp_t* %0, %struct.ble_msg_attributes_write_rsp_t** %2
ret void
}

LLVM IR (-O2):
%struct.ble_msg_attributes_write_rsp_t = type opaque
define void @ble_rsp_attributes_write(%struct.ble_msg_attributes_write_rsp_t* nocapture %0) {
ret void
}
/* Type definitions */
struct pagevec {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ __pagevec_free(struct pagevec *);
scalar_t__ pagevec_count(struct pagevec *);
void pagevec_free(struct pagevec *pvec) {
  if (pagevec_count(pvec))
    __pagevec_free(pvec);
}


x86 assembly (clang, -O0):
<pagevec_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <pagevec_count@plt>
cmp    $0x0,%rax
je     1148 <pagevec_free+0x28>
mov    -0x8(%rbp),%rdi
call   1040 <__pagevec_free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pagevec_free>:
push   %rbx
mov    %rdi,%rbx
call   1030 <pagevec_count@plt>
test   %rax,%rax
je     1137 <pagevec_free+0x17>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <__pagevec_free@plt>
pop    %rbx
ret

LLVM IR (-O0):
%struct.pagevec = type { i32 }
define void @pagevec_free(%struct.pagevec* %0) {
%2 = alloca %struct.pagevec*
store %struct.pagevec* %0, %struct.pagevec** %2
%3 = load %struct.pagevec*, %struct.pagevec** %2
%4 = call i64 @pagevec_count(%struct.pagevec* %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load %struct.pagevec*, %struct.pagevec** %2
%8 = call i32 @__pagevec_free(%struct.pagevec* %7)
br label %9
9: ; preds = %6, %1
ret void
}

LLVM IR (-O2):
%struct.pagevec = type { i32 }
define void @pagevec_free(%struct.pagevec* %0) {
%2 = tail call i64 @pagevec_count(%struct.pagevec* %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @__pagevec_free(%struct.pagevec* %0)
br label %6
6: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ writefile(char const *, int *, int const *, char const *,
                             int *, int *);
void zwritefile(const char *filename, const int *m, const int *n,
                const double *A, const int *ldA, int *info) {
  int cm = *m * (int)(2 * sizeof(double) / sizeof(char));
  int cldA = *ldA * (int)(2 * sizeof(double) / sizeof(char));
  writefile(filename, &cm, n, (const char *)A, &cldA, info);
}


x86 assembly (clang, -O0):
<zwritefile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
shl    $0x4,%eax
mov    %eax,-0x34(%rbp)
mov    -0x28(%rbp),%rax
mov    (%rax),%eax
shl    $0x4,%eax
mov    %eax,-0x38(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x30(%rbp),%r9
lea    -0x34(%rbp),%rsi
lea    -0x38(%rbp),%r8
call   1030 <writefile@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zwritefile>:
push   %rax
mov    (%rsi),%eax
shl    $0x4,%eax
mov    %eax,0x4(%rsp)
mov    (%r8),%eax
shl    $0x4,%eax
mov    %eax,(%rsp)
lea    0x4(%rsp),%rsi
mov    %rsp,%r8
call   1030 <writefile@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @zwritefile(i8* %0, i32* %1, i32* %2, double* %3, i32* %4, i32* %5) {
%7 = alloca i8*
%8 = alloca i32*
%9 = alloca i32*
%10 = alloca double*
%11 = alloca i32*
%12 = alloca i32*
%13 = alloca i32
%14 = alloca i32
store i8* %0, i8** %7
store i32* %1, i32** %8
store i32* %2, i32** %9
store double* %3, double** %10
store i32* %4, i32** %11
store i32* %5, i32** %12
%15 = load i32*, i32** %8
%16 = load i32, i32* %15
%17 = mul nsw i32 %16, 16
store i32 %17, i32* %13
%18 = load i32*, i32** %11
%19 = load i32, i32* %18
%20 = mul nsw i32 %19, 16
store i32 %20, i32* %14
%21 = load i8*, i8** %7
%22 = load i32*, i32** %9
%23 = load double*, double** %10
%24 = bitcast double* %23 to i8*
%25 = load i32*, i32** %12
%26 = call i32 @writefile(i8* %21, i32* %13, i32* %22, i8* %24, i32* %14, i32* %25)
ret void
}

LLVM IR (-O2):
define void @zwritefile(i8* %0, i32* nocapture %1, i32* %2, double* %3, i32* nocapture %4, i32* %5) {
%7 = alloca i32
%8 = alloca i32
%9 = bitcast i32* %7 to i8*
%10 = load i32, i32* %1
%11 = shl nsw i32 %10, 4
store i32 %11, i32* %7
%12 = bitcast i32* %8 to i8*
%13 = load i32, i32* %4
%14 = shl nsw i32 %13, 4
store i32 %14, i32* %8
%15 = bitcast double* %3 to i8*
%16 = call i32 @writefile(i8* %0, i32* %7, i32* %2, i8* %15, i32* %8, i32* %5)
ret void
}
void RTFileAioReqPrepareFlush(void) {}


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

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

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

LLVM IR (-O2):
define void @RTFileAioReqPrepareFlush() {
ret void
}
/* Variables and functions */
short read_ZIGBEE_short(int);
int /*<<< orphan*/ write_ZIGBEE_short(int, short);
void set_encrypt() {
  short int temp = 0;
  temp = read_ZIGBEE_short(0x1B);
  temp = temp | 0x02;
  write_ZIGBEE_short(0x1B, temp);
}


x86 assembly (clang, -O0):
<set_encrypt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movw   $0x0,-0x2(%rbp)
mov    $0x1b,%edi
call   1030 <read_ZIGBEE_short@plt>
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%eax
or     $0x2,%eax
mov    %ax,-0x2(%rbp)
mov    $0x1b,%edi
movswl -0x2(%rbp),%esi
call   1040 <write_ZIGBEE_short@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_encrypt>:
push   %rax
mov    $0x1b,%edi
call   1030 <read_ZIGBEE_short@plt>
or     $0x2,%eax
movswl %ax,%esi
mov    $0x1b,%edi
pop    %rax
jmp    1040 <write_ZIGBEE_short@plt>

LLVM IR (-O0):
define void @set_encrypt() {
%1 = alloca i16
store i16 0, i16* %1
%2 = call signext i16 @read_ZIGBEE_short(i32 27)
store i16 %2, i16* %1
%3 = load i16, i16* %1
%4 = sext i16 %3 to i32
%5 = or i32 %4, 2
%6 = trunc i32 %5 to i16
store i16 %6, i16* %1
%7 = load i16, i16* %1
%8 = call i32 @write_ZIGBEE_short(i32 27, i16 signext %7)
ret void
}

LLVM IR (-O2):
define void @set_encrypt() {
%1 = tail call signext i16 @read_ZIGBEE_short(i32 27)
%2 = or i16 %1, 2
%3 = tail call i32 @write_ZIGBEE_short(i32 27, i16 signext %2)
ret void
}
void sig_sigpipe(int signo) {}


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

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

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

LLVM IR (-O2):
define void @sig_sigpipe(i32 %0) {
ret void
}
/* Variables and functions */
unsigned char strncmp(char const *, char const *, unsigned char);
unsigned char strncasecmp(const char *s1, const char *s2, unsigned char n) {
  unsigned char len;
  return strncmp(s1, s2, n);
}


x86 assembly (clang, -O0):
<strncasecmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dl,%al
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
movzbl -0x11(%rbp),%edx
call   1030 <strncmp@plt>
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strncasecmp>:
jmp    1030 <strncmp@plt>

LLVM IR (-O0):
define zeroext i8 @strncasecmp(i8* %0, i8* %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8
%7 = alloca i8
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8 %2, i8* %6
%8 = load i8*, i8** %4
%9 = load i8*, i8** %5
%10 = load i8, i8* %6
%11 = call zeroext i8 @strncmp(i8* %8, i8* %9, i8 zeroext %10)
ret i8 %11
}

LLVM IR (-O2):
define zeroext i8 @strncasecmp(i8* %0, i8* %1, i8 zeroext %2) {
%4 = tail call zeroext i8 @strncmp(i8* %0, i8* %1, i8 zeroext %2)
ret i8 %4
}
short C_Utils_max_short(const short item1, const short item2) {
  return item1 > item2 ? item1 : item2;
}


x86 assembly (clang, -O0):
<C_Utils_max_short>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
movswl -0x2(%rbp),%eax
movswl -0x4(%rbp),%ecx
cmp    %ecx,%eax
jle    112e <C_Utils_max_short+0x2e>
movswl -0x2(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1135 <C_Utils_max_short+0x35>
movswl -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cwtl
pop    %rbp
ret

x86 assembly (clang, -O2):
<C_Utils_max_short>:
mov    %esi,%eax
cmp    %ax,%di
cmovg  %edi,%eax
ret

LLVM IR (-O0):
define signext i16 @C_Utils_max_short(i16 signext %0, i16 signext %1) {
%3 = alloca i16
%4 = alloca i16
store i16 %0, i16* %3
store i16 %1, i16* %4
%5 = load i16, i16* %3
%6 = sext i16 %5 to i32
%7 = load i16, i16* %4
%8 = sext i16 %7 to i32
%9 = icmp sgt i32 %6, %8
br i1 %9, label %10, label %13
10: ; preds = %2
%11 = load i16, i16* %3
%12 = sext i16 %11 to i32
br label %16
13: ; preds = %2
%14 = load i16, i16* %4
%15 = sext i16 %14 to i32
br label %16
16: ; preds = %13, %10
%17 = phi i32 [ %12, %10 ], [ %15, %13 ]
%18 = trunc i32 %17 to i16
ret i16 %18
}

LLVM IR (-O2):
define signext i16 @C_Utils_max_short(i16 signext %0, i16 signext %1) {
%3 = icmp sgt i16 %0, %1
%4 = select i1 %3, i16 %0, i16 %1
ret i16 %4
}
int Media_Play() { return 1; }


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

x86 assembly (clang, -O2):
<Media_Play>:
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @Media_Play() {
ret i32 1
}

LLVM IR (-O2):
define i32 @Media_Play() {
ret i32 1
}
/* Variables and functions */
void *malloc(size_t);
void *rpl_malloc(size_t size) { return malloc(size ? size : 1); }


x86 assembly (clang, -O0):
<rpl_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1134 <rpl_malloc+0x24>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    1142 <rpl_malloc+0x32>
mov    $0x1,%eax
mov    %rax,-0x10(%rbp)
jmp    1142 <rpl_malloc+0x32>
mov    -0x10(%rbp),%rdi
call   1030 <malloc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rpl_malloc>:
test   %rdi,%rdi
mov    $0x1,%eax
cmove  %rax,%rdi
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define i8* @rpl_malloc(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp ne i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = load i64, i64* %2
br label %8
7: ; preds = %1
br label %8
8: ; preds = %7, %5
%9 = phi i64 [ %6, %5 ], [ 1, %7 ]
%10 = call i8* @malloc(i64 %9)
ret i8* %10
}

LLVM IR (-O2):
define noalias i8* @rpl_malloc(i64 %0) {
%2 = icmp eq i64 %0, 0
%3 = select i1 %2, i64 1, i64 %0
%4 = tail call i8* @malloc(i64 %3)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isxdigit(int);
void t_isxdigit_0x42() {
  Assert_real((isxdigit(66)),
              "/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_isxdigit.c",
              335, ("isxdigit should be 1 for B"));
}


x86 assembly (clang, -O0):
<t_isxdigit_0x42>:
push   %rbp
mov    %rsp,%rbp
mov    $0x42,%edi
call   1030 <isxdigit@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0x14f,%edx
lea    0xf66(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isxdigit_0x42>:
push   %rax
mov    $0x42,%edi
call   1030 <isxdigit@plt>
lea    0xece(%rip),%rsi
lea    0xf70(%rip),%rcx
mov    %eax,%edi
mov    $0x14f,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 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_isxdigit.c\00"
@.str.1 = [27 x i8] c"isxdigit should be 1 for B\00"
define void @t_isxdigit_0x42() {
%1 = call i32 @isxdigit(i32 66)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 335, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 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_isxdigit.c\00"
@.str.1 = [27 x i8] c"isxdigit should be 1 for B\00"
define void @t_isxdigit_0x42() {
%1 = tail call i32 @isxdigit(i32 66)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 335, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *, int);
int /*<<< orphan*/ stderr;
void sysstat_panic(const char *function, int error_code) {
  fprintf(stderr, "sysstat: %s[%d]: Last chance handler...\n", function,
          error_code);
  exit(1);
}


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

x86 assembly (clang, -O2):
<sysstat_panic>:
push   %rax
mov    %esi,%ecx
mov    %rdi,%rdx
mov    0x2eb3(%rip),%rax
mov    (%rax),%edi
lea    0xeca(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [41 x i8] c"sysstat: %s[%d]: Last chance handler...\0A\00"
define void @sysstat_panic(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* @stderr
%6 = load i8*, i8** %3
%7 = load i32, i32* %4
%8 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i8* %6, i32 %7)
%9 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [41 x i8] c"sysstat: %s[%d]: Last chance handler...\0A\00"
define void @sysstat_panic(i8* %0, i32 %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1)
%5 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ VIM_SIF_I2cReadByte(unsigned char, unsigned char *);
void SensorGetReg_S5K83A(unsigned char uAddr, unsigned short *uVal) {
  VIM_SIF_I2cReadByte((unsigned char)uAddr, (unsigned char *)uVal);
}


x86 assembly (clang, -O0):
<SensorGetReg_S5K83A>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x1(%rbp),%al
mov    -0x10(%rbp),%rsi
movzbl %al,%edi
call   1030 <VIM_SIF_I2cReadByte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SensorGetReg_S5K83A>:
jmp    1030 <VIM_SIF_I2cReadByte@plt>

LLVM IR (-O0):
define void @SensorGetReg_S5K83A(i8 zeroext %0, i16* %1) {
%3 = alloca i8
%4 = alloca i16*
store i8 %0, i8* %3
store i16* %1, i16** %4
%5 = load i8, i8* %3
%6 = load i16*, i16** %4
%7 = bitcast i16* %6 to i8*
%8 = call i32 @VIM_SIF_I2cReadByte(i8 zeroext %5, i8* %7)
ret void
}

LLVM IR (-O2):
define void @SensorGetReg_S5K83A(i8 zeroext %0, i16* %1) {
%3 = bitcast i16* %1 to i8*
%4 = tail call i32 @VIM_SIF_I2cReadByte(i8 zeroext %0, i8* %3)
ret void
}
/* Variables and functions */
int testLib6cxx();
int testLib6(void) { return testLib6cxx(); }


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

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

LLVM IR (-O0):
define i32 @testLib6() {
%1 = call i32 (...) @testLib6cxx()
ret i32 %1
}

LLVM IR (-O2):
define i32 @testLib6() {
%1 = tail call i32 (...) @testLib6cxx()
ret i32 %1
}
int monte_solution(double *ifld, double *ofld) {
  long i;
  for (i = 0; i < 1; i++) {
    ofld[0] = ifld[2] - ifld[1];
    if (ifld[1] < 200) {
      ofld[1] = 1;
    } else {
      ofld[1] = 0;
    }
  }
  return (0);
}


x86 assembly (clang, -O0):
<monte_solution>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
cmpq   $0x1,-0x18(%rbp)
jge    1188 <monte_solution+0x88>
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm0
mov    -0x8(%rbp),%rax
subsd  0x8(%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
movsd  0xebb(%rip),%xmm0
ucomisd 0x8(%rax),%xmm0
jbe    1166 <monte_solution+0x66>
mov    -0x10(%rbp),%rax
movsd  0xeac(%rip),%xmm0
movsd  %xmm0,0x8(%rax)
jmp    1172 <monte_solution+0x72>
mov    -0x10(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,0x8(%rax)
jmp    1177 <monte_solution+0x77>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1114 <monte_solution+0x14>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<monte_solution>:
movsd  0x10(%rdi),%xmm0
subsd  0x8(%rdi),%xmm0
movsd  %xmm0,(%rsi)
movsd  0x8(%rdi),%xmm0
cmpltsd 0xee4(%rip),%xmm0
movsd  0xee4(%rip),%xmm1
andpd  %xmm0,%xmm1
movlpd %xmm1,0x8(%rsi)
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @monte_solution(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
%5 = alloca i64
store double* %0, double** %3
store double* %1, double** %4
store i64 0, i64* %5
br label %6
6: ; preds = %30, %2
%7 = load i64, i64* %5
%8 = icmp slt i64 %7, 1
br i1 %8, label %9, label %33
9: ; preds = %6
%10 = load double*, double** %3
%11 = getelementptr inbounds double, double* %10, i64 2
%12 = load double, double* %11
%13 = load double*, double** %3
%14 = getelementptr inbounds double, double* %13, i64 1
%15 = load double, double* %14
%16 = fsub double %12, %15
%17 = load double*, double** %4
%18 = getelementptr inbounds double, double* %17, i64 0
store double %16, double* %18
%19 = load double*, double** %3
%20 = getelementptr inbounds double, double* %19, i64 1
%21 = load double, double* %20
%22 = fcmp olt double %21, 2.000000e+02
br i1 %22, label %23, label %26
23: ; preds = %9
%24 = load double*, double** %4
%25 = getelementptr inbounds double, double* %24, i64 1
store double 1.000000e+00, double* %25
br label %29
26: ; preds = %9
%27 = load double*, double** %4
%28 = getelementptr inbounds double, double* %27, i64 1
store double 0.000000e+00, double* %28
br label %29
29: ; preds = %26, %23
br label %30
30: ; preds = %29
%31 = load i64, i64* %5
%32 = add nsw i64 %31, 1
store i64 %32, i64* %5
br label %6
33: ; preds = %6
ret i32 0
}

LLVM IR (-O2):
define i32 @monte_solution(double* nocapture %0, double* nocapture writeonly %1) {
%3 = getelementptr inbounds double, double* %0, i64 2
%4 = load double, double* %3
%5 = getelementptr inbounds double, double* %0, i64 1
%6 = load double, double* %5
%7 = fsub double %4, %6
store double %7, double* %1
%8 = load double, double* %5
%9 = fcmp olt double %8, 2.000000e+02
%10 = select i1 %9, double 1.000000e+00, double 0.000000e+00
%11 = getelementptr inbounds double, double* %1, i64 1
store double %10, double* %11
ret i32 0
}
void audio_init() {}


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

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

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

LLVM IR (-O2):
define void @audio_init() {
ret void
}
int _braille_console_setup(char **str, char **brl_options) { return 0; }


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

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

LLVM IR (-O0):
define i32 @_braille_console_setup(i8** %0, i8** %1) {
%3 = alloca i8**
%4 = alloca i8**
store i8** %0, i8*** %3
store i8** %1, i8*** %4
ret i32 0
}

LLVM IR (-O2):
define i32 @_braille_console_setup(i8** nocapture readnone %0, i8** nocapture readnone %1) {
ret i32 0
}
double fmax(double a, double b) { return (a < b) ? b : a; }


x86 assembly (clang, -O0):
<fmax>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1131 <fmax+0x31>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    113b <fmax+0x3b>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fmax>:
maxsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @fmax(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fcmp olt double %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load double, double* %4
br label %12
10: ; preds = %2
%11 = load double, double* %3
br label %12
12: ; preds = %10, %8
%13 = phi double [ %9, %8 ], [ %11, %10 ]
ret double %13
}

LLVM IR (-O2):
define double @fmax(double %0, double %1) {
%3 = fcmp olt double %0, %1
%4 = select i1 %3, double %1, double %0
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, int);
void say_anonymous_hello(void) {
  printf("Anonymous hello from %s:%d\n",
         "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
         "2022-01-22/02-19-57/repos/bstarynk/bismon/refs/heads/master/"
         "TestHelloWorld/testhw-sayhello.c",
         7);
}


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

x86 assembly (clang, -O2):
<say_anonymous_hello>:
lea    0xee9(%rip),%rdi
lea    0xefe(%rip),%rsi
mov    $0x7,%edx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [28 x i8] c"Anonymous hello from %s:%d\0A\00"
@.str.1 = [157 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bstarynk/bismon/refs/heads/master/TestHelloWorld/testhw-sayhello.c\00"
define void @say_anonymous_hello() {
%1 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([157 x i8], [157 x i8]* @.str.1, i64 0, i64 0), i32 7)
ret void
}

LLVM IR (-O2):
@.str = [28 x i8] c"Anonymous hello from %s:%d\0A\00"
@.str.1 = [157 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bstarynk/bismon/refs/heads/master/TestHelloWorld/testhw-sayhello.c\00"
define void @say_anonymous_hello() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([157 x i8], [157 x i8]* @.str.1, i64 0, i64 0), i32 7)
ret void
}
/* Variables and functions */
char *strcpy(char *, char *);
char *foo() {
  char buffer[10];
  char *str = strcpy(buffer, "Hello");
  return str;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0xa(%rbp),%rdi
lea    0xedd(%rip),%rsi
call   1030 <strcpy@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
lea    -0xa(%rsp),%rax
ret

LLVM IR (-O0):
@.str = [6 x i8] c"Hello\00"
define i8* @foo() {
%1 = alloca [10 x i8]
%2 = alloca i8*
%3 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%4 = call i8* @strcpy(i8* %3, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
store i8* %4, i8** %2
%5 = load i8*, i8** %2
ret i8* %5
}

LLVM IR (-O2):
define noalias i8* @foo() {
%1 = alloca [10 x i8]
%2 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
ret i8* %2
}
/* Variables and functions */
char shift_letter(char, int);
char caesar_encrypt_char(char plainchar, int key) {
  return shift_letter(plainchar, key);
}


x86 assembly (clang, -O0):
<caesar_encrypt_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x1(%rbp),%al
mov    -0x8(%rbp),%esi
movsbl %al,%edi
call   1030 <shift_letter@plt>
movsbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<caesar_encrypt_char>:
jmp    1030 <shift_letter@plt>

LLVM IR (-O0):
define signext i8 @caesar_encrypt_char(i8 signext %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 signext i8 @shift_letter(i8 signext %5, i32 %6)
ret i8 %7
}

LLVM IR (-O2):
define signext i8 @caesar_encrypt_char(i8 signext %0, i32 %1) {
%3 = tail call signext i8 @shift_letter(i8 signext %0, i32 %1)
ret i8 %3
}
/* Variables and functions */
unsigned int clock();
unsigned int usleep(unsigned int _useconds) {
  unsigned int cl_time;
  unsigned int start_time = clock();
  _useconds >>= 10;
  cl_time = _useconds * 91 / 977;
  while (1) {
    unsigned int elapsed = clock() - start_time;
    if (elapsed >= cl_time)
      break;
  }
  return 0;
}


x86 assembly (clang, -O0):
<usleep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <clock@plt>
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
shr    $0xa,%eax
mov    %eax,-0x4(%rbp)
imul   $0x5b,-0x4(%rbp),%eax
mov    $0x3d1,%ecx
xor    %edx,%edx
div    %ecx
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <clock@plt>
sub    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jb     115c <usleep+0x4c>
jmp    1161 <usleep+0x51>
jmp    113e <usleep+0x2e>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usleep>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <clock@plt>
mov    %eax,%ebx
shr    $0xa,%ebp
imul   $0x5b,%ebp,%ebp
imul   $0xc50b447,%rbp,%rax
shr    $0x20,%rax
sub    %eax,%ebp
shr    %ebp
add    %eax,%ebp
shr    $0x9,%ebp
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <clock@plt>
sub    %ebx,%eax
cmp    %ebp,%eax
jb     1140 <usleep+0x30>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @usleep(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %2
%6 = call i32 (...) @clock()
store i32 %6, i32* %4
%7 = load i32, i32* %2
%8 = lshr i32 %7, 10
store i32 %8, i32* %2
%9 = load i32, i32* %2
%10 = mul i32 %9, 91
%11 = udiv i32 %10, 977
store i32 %11, i32* %3
br label %12
12: ; preds = %1, %20
%13 = call i32 (...) @clock()
%14 = load i32, i32* %4
%15 = sub i32 %13, %14
store i32 %15, i32* %5
%16 = load i32, i32* %5
%17 = load i32, i32* %3
%18 = icmp uge i32 %16, %17
br i1 %18, label %19, label %20
19: ; preds = %12
br label %21
20: ; preds = %12
br label %12
21: ; preds = %19
ret i32 0
}

LLVM IR (-O2):
define i32 @usleep(i32 %0) {
%2 = tail call i32 (...) @clock()
%3 = lshr i32 %0, 10
%4 = mul nuw nsw i32 %3, 91
%5 = udiv i32 %4, 977
br label %6
6: ; preds = %6, %1
%7 = tail call i32 (...) @clock()
%8 = sub i32 %7, %2
%9 = icmp ult i32 %8, %5
br i1 %9, label %6, label %10
10: ; preds = %6
ret i32 0
}
int max(int x, int y) {
  if (x > y) {
    return x;
  } else {
    return y;
  }
}


x86 assembly (clang, -O0):
<max>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1121 <max+0x21>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1127 <max+0x27>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<max>:
mov    %esi,%eax
cmp    %esi,%edi
cmovg  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @max(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}