xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ ol(char *);
void savede(void) { ol("ld\t(saved_de),de"); }


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

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

LLVM IR (-O0):
@.str = [17 x i8] c"ld\09(saved_de),de\00"
define void @savede() {
%1 = call i32 @ol(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"ld\09(saved_de),de\00"
define void @savede() {
%1 = tail call i32 @ol(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ system(char *);
int main(void) {
  system("PAUSE");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"PAUSE\00"
define i32 @main() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
unsigned int time_schedule(int cps, void *func) { return 0; }


x86 assembly (clang, -O0):
<time_schedule>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @time_schedule(i32 %0, i8* nocapture readnone %1) {
ret i32 0
}
void INT_Excep_RIIC1_ICTXI1(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_RIIC1_ICTXI1() {
ret void
}
/* Variables and functions */
int Fibonacci(int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("Fib(10)=%i\n", Fibonacci(10));
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [12 x i8] c"Fib(10)=%i\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @Fibonacci(i32 10)
%3 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"Fib(10)=%i\0A\00"
define i32 @main() {
%1 = tail call i32 @Fibonacci(i32 10)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ not_prune_multiple2(int *);
void call_not_prune_multiple2_Bad() {
  int m[2] = {0, 10};
  not_prune_multiple2(m);
}


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

x86 assembly (clang, -O2):
<call_not_prune_multiple2_Bad>:
push   %rax
movabs $0xa00000000,%rax
mov    %rax,(%rsp)
mov    %rsp,%rdi
call   1030 <not_prune_multiple2@plt>
pop    %rax
ret

LLVM IR (-O0):
@__const.call_not_prune_multiple2_Bad.m = [2 x i32] [i32 0, i32 10]
define void @call_not_prune_multiple2_Bad() {
%1 = alloca [2 x i32]
%2 = bitcast [2 x i32]* %1 to i8*
%3 = getelementptr inbounds [2 x i32], [2 x i32]* %1, i64 0, i64 0
%4 = call i32 @not_prune_multiple2(i32* %3)
ret void
}

LLVM IR (-O2):
define void @call_not_prune_multiple2_Bad() {
%1 = alloca i64
%2 = bitcast i64* %1 to i8*
store i64 42949672960, i64* %1
%3 = bitcast i64* %1 to i32*
%4 = call i32 @not_prune_multiple2(i32* %3)
ret void
}
int ri_atomic_read(int *ptr) { return (*ptr); }


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

x86 assembly (clang, -O2):
<ri_atomic_read>:
mov    (%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @ri_atomic_read(i32* nocapture %0) {
%2 = load i32, i32* %0
ret i32 %2
}
float similarity_length_norm(struct _similarity *_sml, char *fiend_name,
                             float num_terms) {
  return (float)1.0 / (num_terms * num_terms);
}


x86 assembly (clang, -O0):
<similarity_length_norm>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm1
mulss  -0x14(%rbp),%xmm1
movss  0xedd(%rip),%xmm0
divss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<similarity_length_norm>:
mulss  %xmm0,%xmm0
movss  0xef4(%rip),%xmm1
divss  %xmm0,%xmm1
movaps %xmm1,%xmm0
ret

LLVM IR (-O0):
%struct._similarity = type opaque
define float @similarity_length_norm(%struct._similarity* %0, i8* %1, float %2) {
%4 = alloca %struct._similarity*
%5 = alloca i8*
%6 = alloca float
store %struct._similarity* %0, %struct._similarity** %4
store i8* %1, i8** %5
store float %2, float* %6
%7 = load float, float* %6
%8 = load float, float* %6
%9 = fmul float %7, %8
%10 = fdiv float 1.000000e+00, %9
ret float %10
}

LLVM IR (-O2):
%struct._similarity = type opaque
define float @similarity_length_norm(%struct._similarity* nocapture readnone %0, i8* nocapture readnone %1, float %2) {
%4 = fmul float %2, %2
%5 = fdiv float 1.000000e+00, %4
ret float %5
}
long int sas_fetch_and_or(unsigned int *pointer, int delta) {
  return __atomic_fetch_or(pointer, delta, 4);
}


x86 assembly (clang, -O0):
<sas_fetch_and_or>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0xc(%rbp),%ecx
mov    %ecx,-0x10(%rbp)
mov    -0x10(%rbp),%ecx
mov    %ecx,-0x1c(%rbp)
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    -0x28(%rbp),%rcx
mov    -0x1c(%rbp),%esi
mov    %eax,%edx
or     %esi,%edx
lock cmpxchg %edx,(%rcx)
sete   %cl
mov    %eax,-0x2c(%rbp)
test   $0x1,%cl
mov    %eax,-0x18(%rbp)
jne    114d <sas_fetch_and_or+0x4d>
jmp    1124 <sas_fetch_and_or+0x24>
mov    -0x2c(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sas_fetch_and_or>:
mov    (%rdi),%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %eax,%ecx
or     %esi,%ecx
lock cmpxchg %ecx,(%rdi)
jne    1110 <sas_fetch_and_or+0x10>
mov    %eax,%eax
ret

LLVM IR (-O0):
define i64 @sas_fetch_and_or(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%7 = load i32*, i32** %3
%8 = load i32, i32* %4
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = atomicrmw or i32* %7, i32 %9 acq_rel
store i32 %10, i32* %6
%11 = load i32, i32* %6
%12 = zext i32 %11 to i64
ret i64 %12
}

LLVM IR (-O2):
define i64 @sas_fetch_and_or(i32* nocapture %0, i32 %1) {
%3 = atomicrmw or i32* %0, i32 %1 acq_rel
%4 = zext i32 %3 to i64
ret i64 %4
}
int HelpItem24(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @HelpItem24() {
ret i32 0
}

LLVM IR (-O2):
define i32 @HelpItem24() {
ret i32 0
}
/* Type definitions */
typedef scalar_t__ int8_t;

/* Variables and functions */
void int8Clear(int8_t *data) { *data = 0; }


x86 assembly (clang, -O0):
<int8Clear>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movq   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<int8Clear>:
movq   $0x0,(%rdi)
ret

LLVM IR (-O0):
define void @int8Clear(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
store i64 0, i64* %3
ret void
}

LLVM IR (-O2):
define void @int8Clear(i64* nocapture writeonly %0) {
store i64 0, i64* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void cp_type_quals() { abort(); }


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

x86 assembly (clang, -O2):
<cp_type_quals>:
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define void @cp_type_quals() {
%1 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
define void @cp_type_quals() {
%1 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
scalar_t__ log(int /*<<< orphan*/);
int /*<<< orphan*/ random_float_unit_uniform();
float random_float_exponential(void) {
  return (float)-log(random_float_unit_uniform());
}


x86 assembly (clang, -O0):
<random_float_exponential>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <random_float_unit_uniform@plt>
mov    %eax,%edi
call   1040 <log@plt>
mov    %rax,%rcx
xor    %eax,%eax
sub    %rcx,%rax
cvtsi2ss %rax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<random_float_exponential>:
push   %rax
xor    %eax,%eax
call   1030 <random_float_unit_uniform@plt>
mov    %eax,%edi
call   1040 <log@plt>
neg    %rax
cvtsi2ss %rax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @random_float_exponential() {
%1 = call i32 (...) @random_float_unit_uniform()
%2 = call i64 @log(i32 %1)
%3 = sub nsw i64 0, %2
%4 = sitofp i64 %3 to float
ret float %4
}

LLVM IR (-O2):
define float @random_float_exponential() {
%1 = tail call i32 (...) @random_float_unit_uniform()
%2 = tail call i64 @log(i32 %1)
%3 = sub nsw i64 0, %2
%4 = sitofp i64 %3 to float
ret float %4
}
int isprint(int c) {
  if (c < 0x20 || 0x7e < c) {
    return 0;
  } else {
    return 1;
  }
}


x86 assembly (clang, -O0):
<isprint>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x20,-0x8(%rbp)
jl     111f <isprint+0x1f>
mov    $0x7e,%eax
cmp    -0x8(%rbp),%eax
jge    112b <isprint+0x2b>
movl   $0x0,-0x4(%rbp)
jmp    1132 <isprint+0x32>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isprint>:
add    $0xffffffe0,%edi
xor    %eax,%eax
cmp    $0x5f,%edi
setb   %al
ret

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

LLVM IR (-O2):
define i32 @isprint(i32 %0) {
%2 = add i32 %0, -32
%3 = icmp ult i32 %2, 95
%4 = zext i1 %3 to i32
ret i32 %4
}
void foo(int x, int y) { return; }


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

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

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

LLVM IR (-O2):
define void @foo(i32 %0, i32 %1) {
ret void
}
/* Variables and functions */
int strcpy(char *s, char *c) {
  while (*s != '\0') {
    *c = *s;
    s++;
    c++;
  }
  *c = '\0';
}


x86 assembly (clang, -O0):
<strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1145 <strcpy+0x45>
mov    -0x10(%rbp),%rax
mov    (%rax),%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    110c <strcpy+0xc>
mov    -0x18(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy>:
mov    (%rdi),%al
test   %al,%al
je     1121 <strcpy+0x21>
add    $0x1,%rdi
nopw   0x0(%rax,%rax,1)
mov    %al,(%rsi)
add    $0x1,%rsi
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
jne    1110 <strcpy+0x10>
movb   $0x0,(%rsi)
ret

LLVM IR (-O0):
define i32 @strcpy(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
br label %6
6: ; preds = %11, %2
%7 = load i8*, i8** %4
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %19
11: ; preds = %6
%12 = load i8*, i8** %4
%13 = load i8, i8* %12
%14 = load i8*, i8** %5
store i8 %13, i8* %14
%15 = load i8*, i8** %4
%16 = getelementptr inbounds i8, i8* %15, i32 1
store i8* %16, i8** %4
%17 = load i8*, i8** %5
%18 = getelementptr inbounds i8, i8* %17, i32 1
store i8* %18, i8** %5
br label %6
19: ; preds = %6
%20 = load i8*, i8** %5
store i8 0, i8* %20
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
define i32 @strcpy(i8* nocapture %0, i8* nocapture writeonly %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %11, %5 ], [ %3, %2 ]
%7 = phi i8* [ %10, %5 ], [ %1, %2 ]
%8 = phi i8* [ %9, %5 ], [ %0, %2 ]
store i8 %6, i8* %7
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = getelementptr inbounds i8, i8* %7, i64 1
%11 = load i8, i8* %9
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %2
%14 = phi i8* [ %1, %2 ], [ %10, %5 ]
store i8 0, i8* %14
ret i32 undef
}
int func2(void) {
  auto signed IDENT;
  return IDENT;
}


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

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

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

LLVM IR (-O2):
define i32 @func2() {
ret i32 undef
}
cbuf36(f, n) { return (cbuf(f, n, 36)); }


x86 assembly (clang, -O0):
<cbuf36>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    $0x24,%edx
mov    $0x0,%al
call   1030 <cbuf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cbuf36>:
mov    $0x24,%edx
xor    %eax,%eax
jmp    1030 <cbuf@plt>

LLVM IR (-O0):
define i32 @cbuf36(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 = call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @cbuf to i32 (i32, i32, i32, ...)*)(i32 %5, i32 %6, i32 36)
ret i32 %7
}

LLVM IR (-O2):
define i32 @cbuf36(i32 %0, i32 %1) {
%3 = tail call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @cbuf to i32 (i32, i32, i32, ...)*)(i32 %0, i32 %1, i32 36)
ret i32 %3
}
void ff_hevc_put_hevc_uni_w_qpel_v64_12_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_uni_w_qpel_v64_12_sse4() {
ret void
}
/* Variables and functions */
int acpi_table_parse(char *, int (*)(struct acpi_table_header *));
int acpi_sfi_table_parse(char *signature,
                         int (*handler)(struct acpi_table_header *)) {
  return acpi_table_parse(signature, handler);
}


x86 assembly (clang, -O0):
<acpi_sfi_table_parse>:
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   1030 <acpi_table_parse@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<acpi_sfi_table_parse>:
jmp    1030 <acpi_table_parse@plt>

LLVM IR (-O0):
%struct.acpi_table_header = type opaque
%struct.acpi_table_header.0 = type opaque
define i32 @acpi_sfi_table_parse(i8* %0, i32 (%struct.acpi_table_header*)* %1) {
%3 = alloca i8*
%4 = alloca i32 (%struct.acpi_table_header*)*
store i8* %0, i8** %3
store i32 (%struct.acpi_table_header*)* %1, i32 (%struct.acpi_table_header*)** %4
%5 = load i8*, i8** %3
%6 = load i32 (%struct.acpi_table_header*)*, i32 (%struct.acpi_table_header*)** %4
%7 = bitcast i32 (%struct.acpi_table_header*)* %6 to i32 (%struct.acpi_table_header.0*)*
%8 = call i32 @acpi_table_parse(i8* %5, i32 (%struct.acpi_table_header.0*)* %7)
ret i32 %8
}

LLVM IR (-O2):
%struct.acpi_table_header = type opaque
%struct.acpi_table_header.0 = type opaque
define i32 @acpi_sfi_table_parse(i8* %0, i32 (%struct.acpi_table_header*)* %1) {
%3 = bitcast i32 (%struct.acpi_table_header*)* %1 to i32 (%struct.acpi_table_header.0*)*
%4 = tail call i32 @acpi_table_parse(i8* %0, i32 (%struct.acpi_table_header.0*)* %3)
ret i32 %4
}
/* Type definitions */
struct dbuf {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ assert(struct dbuf *);
int /*<<< orphan*/ bresize(struct dbuf *, size_t);
void dbuf_resize(struct dbuf *b, size_t size) {
  assert(b);
  bresize(b, size);
}


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

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

LLVM IR (-O0):
%struct.dbuf = type { i32 }
define void @dbuf_resize(%struct.dbuf* %0, i64 %1) {
%3 = alloca %struct.dbuf*
%4 = alloca i64
store %struct.dbuf* %0, %struct.dbuf** %3
store i64 %1, i64* %4
%5 = load %struct.dbuf*, %struct.dbuf** %3
%6 = call i32 @assert(%struct.dbuf* %5)
%7 = load %struct.dbuf*, %struct.dbuf** %3
%8 = load i64, i64* %4
%9 = call i32 @bresize(%struct.dbuf* %7, i64 %8)
ret void
}

LLVM IR (-O2):
%struct.dbuf = type { i32 }
define void @dbuf_resize(%struct.dbuf* %0, i64 %1) {
%3 = tail call i32 @assert(%struct.dbuf* %0)
%4 = tail call i32 @bresize(%struct.dbuf* %0, i64 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, void const *, size_t);
void __attribute__((weak))
__aeabi_memcpy8_impl2(void *dest, const void *src, size_t n) {
  memcpy(dest, src, n);
}


x86 assembly (clang, -O0):
<__aeabi_memcpy8_impl2>:
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    -0x18(%rbp),%rdx
call   1030 <memcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__aeabi_memcpy8_impl2>:
jmp    1030 <memcpy@plt>

LLVM IR (-O0):
define weak void @__aeabi_memcpy8_impl2(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
%10 = call i32 @memcpy(i8* %7, i8* %8, i64 %9)
ret void
}

LLVM IR (-O2):
define weak void @__aeabi_memcpy8_impl2(i8* %0, i8* %1, i64 %2) {
%4 = tail call i32 @memcpy(i8* %0, i8* %1, i64 %2)
ret void
}
void VMR3ReqCallU(void) {}


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

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

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

LLVM IR (-O2):
define void @VMR3ReqCallU() {
ret void
}
/* Variables and functions */
char *malloc(int);
char *my_strcpy(char *, char *);
int my_strlen(char *);
char *my_strdup(char *str) {
  int strlen;
  char *res;
  strlen = my_strlen(str);
  res = malloc(strlen * sizeof(*str));
  res = my_strcpy(res, str);
  return (res);
}


x86 assembly (clang, -O0):
<my_strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <my_strlen@plt>
mov    %eax,-0xc(%rbp)
movslq -0xc(%rbp),%rax
shl    $0x0,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1040 <my_strcpy@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_strdup>:
push   %rbx
mov    %rdi,%rbx
call   1030 <my_strlen@plt>
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1040 <my_strcpy@plt>

LLVM IR (-O0):
define i8* @my_strdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @my_strlen(i8* %5)
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = sext i32 %7 to i64
%9 = mul i64 %8, 1
%10 = trunc i64 %9 to i32
%11 = call i8* @malloc(i32 %10)
store i8* %11, i8** %4
%12 = load i8*, i8** %4
%13 = load i8*, i8** %2
%14 = call i8* @my_strcpy(i8* %12, i8* %13)
store i8* %14, i8** %4
%15 = load i8*, i8** %4
ret i8* %15
}

LLVM IR (-O2):
define i8* @my_strdup(i8* %0) {
%2 = tail call i32 @my_strlen(i8* %0)
%3 = tail call i8* @malloc(i32 %2)
%4 = tail call i8* @my_strcpy(i8* %3, i8* %0)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ lcd_putc(char);
void lcd_puts(const char *s) {
  char c;
  while ((c = *s++)) {
    lcd_putc(c);
  }
}


x86 assembly (clang, -O0):
<lcd_puts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%al
mov    %al,-0x9(%rbp)
cmp    $0x0,%al
je     1146 <lcd_puts+0x36>
movsbl -0x9(%rbp),%edi
call   1030 <lcd_putc@plt>
jmp    111c <lcd_puts+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lcd_puts>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <lcd_puts+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <lcd_putc@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <lcd_puts+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @lcd_puts(i8* %0) {
%2 = alloca i8*
%3 = alloca i8
store i8* %0, i8** %2
br label %4
4: ; preds = %9, %1
%5 = load i8*, i8** %2
%6 = getelementptr inbounds i8, i8* %5, i32 1
store i8* %6, i8** %2
%7 = load i8, i8* %5
store i8 %7, i8* %3
%8 = icmp ne i8 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %4
%10 = load i8, i8* %3
%11 = call i32 @lcd_putc(i8 signext %10)
br label %4
12: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @lcd_puts(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = tail call i32 @lcd_putc(i8 signext %5)
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret void
}
void mouse_setup() {}


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

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

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

LLVM IR (-O2):
define void @mouse_setup() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
int isqrt(int);
void t_sqrt_148() {
  Assert_real((isqrt(148) == 12),
              "/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",
              745, ("Integer square root of 148 should be 12"));
}


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

x86 assembly (clang, -O2):
<t_sqrt_148>:
push   %rax
mov    $0x94,%edi
call   1030 <isqrt@plt>
xor    %edi,%edi
cmp    $0xc,%eax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf60(%rip),%rcx
mov    $0x2e9,%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 148 should be 12\00"
define void @t_sqrt_148() {
%1 = call i32 @isqrt(i32 148)
%2 = icmp eq i32 %1, 12
%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 745, 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 148 should be 12\00"
define void @t_sqrt_148() {
%1 = tail call i32 @isqrt(i32 148)
%2 = icmp eq i32 %1, 12
%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 745, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int half10(int *);
int /*<<< orphan*/ iszero(int *);
void binary(int *x, int *y) {
  int j = 0;
  while (!iszero(x))
    y[++j] = half10(x);
  y[0] = j;
}


x86 assembly (clang, -O0):
<binary>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <iszero@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1155 <binary+0x35>
jmp    1178 <binary+0x58>
mov    -0x8(%rbp),%rdi
call   1040 <half10@plt>
mov    %eax,%edx
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
add    $0x1,%ecx
mov    %ecx,-0x14(%rbp)
movslq %ecx,%rcx
mov    %edx,(%rax,%rcx,4)
jmp    1137 <binary+0x17>
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<binary>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
call   1030 <iszero@plt>
xor    %ebx,%ebx
test   %eax,%eax
jne    115d <binary+0x3d>
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    %r15,%rdi
call   1040 <half10@plt>
mov    %eax,0x4(%r14,%rbx,4)
add    $0x1,%rbx
mov    %r15,%rdi
call   1030 <iszero@plt>
test   %eax,%eax
je     1140 <binary+0x20>
mov    %ebx,(%r14)
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @binary(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32
store i32* %0, i32** %3
store i32* %1, i32** %4
store i32 0, i32* %5
br label %6
6: ; preds = %11, %2
%7 = load i32*, i32** %3
%8 = call i32 @iszero(i32* %7)
%9 = icmp ne i32 %8, 0
%10 = xor i1 %9, true
br i1 %10, label %11, label %19
11: ; preds = %6
%12 = load i32*, i32** %3
%13 = call i32 @half10(i32* %12)
%14 = load i32*, i32** %4
%15 = load i32, i32* %5
%16 = add nsw i32 %15, 1
store i32 %16, i32* %5
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i32, i32* %14, i64 %17
store i32 %13, i32* %18
br label %6
19: ; preds = %6
%20 = load i32, i32* %5
%21 = load i32*, i32** %4
%22 = getelementptr inbounds i32, i32* %21, i64 0
store i32 %20, i32* %22
ret void
}

LLVM IR (-O2):
define void @binary(i32* %0, i32* nocapture writeonly %1) {
%3 = tail call i32 @iszero(i32* %0)
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %14
5: ; preds = %2, %5
%6 = phi i64 [ %8, %5 ], [ 0, %2 ]
%7 = tail call i32 @half10(i32* %0)
%8 = add nuw i64 %6, 1
%9 = getelementptr inbounds i32, i32* %1, i64 %8
store i32 %7, i32* %9
%10 = tail call i32 @iszero(i32* %0)
%11 = icmp eq i32 %10, 0
br i1 %11, label %5, label %12
12: ; preds = %5
%13 = trunc i64 %8 to i32
br label %14
14: ; preds = %12, %2
%15 = phi i32 [ 0, %2 ], [ %13, %12 ]
store i32 %15, i32* %1
ret void
}
/* Variables and functions */
int abs(int);
int /*<<< orphan*/ foo(int);
__attribute__((no, noclone)) int bar(int j) {
  foo(~j);
  foo(abs(j));
  foo(j);
  return 0;
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
xor    $0xffffffff,%edi
call   1040 <foo@plt>
mov    -0x4(%rbp),%edi
call   1030 <abs@plt>
mov    %eax,%edi
call   1040 <foo@plt>
mov    -0x4(%rbp),%edi
call   1040 <foo@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
push   %rbx
mov    %edi,%ebx
not    %edi
call   1030 <foo@plt>
mov    %ebx,%edi
neg    %edi
cmovs  %ebx,%edi
call   1030 <foo@plt>
mov    %ebx,%edi
call   1030 <foo@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @bar(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = xor i32 %3, -1
%5 = call i32 @foo(i32 %4)
%6 = load i32, i32* %2
%7 = call i32 @abs(i32 %6)
%8 = call i32 @foo(i32 %7)
%9 = load i32, i32* %2
%10 = call i32 @foo(i32 %9)
ret i32 0
}

LLVM IR (-O2):
define i32 @bar(i32 %0) {
%2 = xor i32 %0, -1
%3 = tail call i32 @foo(i32 %2)
%4 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
%5 = tail call i32 @foo(i32 %4)
%6 = tail call i32 @foo(i32 %0)
ret i32 0
}
void __attribute__((visibility("protected"))) lib1_protected(void) {}


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

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

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

LLVM IR (-O2):
define protected void @lib1_protected() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ prune_sub2(int);
void call_prune_sub2_1_Good() { prune_sub2(5); }


x86 assembly (clang, -O0):
<call_prune_sub2_1_Good>:
push   %rbp
mov    %rsp,%rbp
mov    $0x5,%edi
call   1030 <prune_sub2@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<call_prune_sub2_1_Good>:
mov    $0x5,%edi
jmp    1030 <prune_sub2@plt>

LLVM IR (-O0):
define void @call_prune_sub2_1_Good() {
%1 = call i32 @prune_sub2(i32 5)
ret void
}

LLVM IR (-O2):
define void @call_prune_sub2_1_Good() {
%1 = tail call i32 @prune_sub2(i32 5)
ret void
}
void halt(void) {
  asm volatile("cli\n" ::);
  asm volatile("hlt\n" ::);
}


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

x86 assembly (clang, -O2):
<halt>:
cli
hlt
ret

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

LLVM IR (-O2):
define void @halt() {
tail call void asm sideeffect "cli\0A", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect "hlt\0A", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ un_init(unsigned long);
int main(int argc, char **argv) {
  un_init(1UL << 20UL);
  for (int i = 1; i < argc; ++i) {
    printf("example %s -> TODO", argv[i]);
  }
  return 0;
}


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    $0x100000,%edi
call   1040 <un_init@plt>
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1179 <main+0x59>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xe9a(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1147 <main+0x27>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r15
mov    %edi,%ebp
mov    $0x100000,%edi
call   1040 <un_init@plt>
cmp    $0x2,%ebp
jl     1165 <main+0x45>
mov    %ebp,%ebp
mov    $0x1,%ebx
lea    0xeb7(%rip),%r14
nopl   0x0(%rax)
mov    (%r15,%rbx,8),%rsi
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%rbp
jne    1150 <main+0x30>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [19 x i8] c"example %s -> TODO\00"
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 @un_init(i64 1048576)
store i32 1, i32* %6
br label %8
8: ; preds = %19, %2
%9 = load i32, i32* %6
%10 = load i32, i32* %4
%11 = icmp slt i32 %9, %10
br i1 %11, label %12, label %22
12: ; preds = %8
%13 = load i8**, i8*** %5
%14 = load i32, i32* %6
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8*, i8** %13, i64 %15
%17 = load i8*, i8** %16
%18 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %17)
br label %19
19: ; preds = %12
%20 = load i32, i32* %6
%21 = add nsw i32 %20, 1
store i32 %21, i32* %6
br label %8
22: ; preds = %8
ret i32 0
}

LLVM IR (-O2):
@.str = [19 x i8] c"example %s -> TODO\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = tail call i32 @un_init(i64 1048576)
%4 = icmp sgt i32 %0, 1
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = zext i32 %0 to i64
br label %8
7: ; preds = %8, %2
ret i32 0
8: ; preds = %5, %8
%9 = phi i64 [ 1, %5 ], [ %13, %8 ]
%10 = getelementptr inbounds i8*, i8** %1, i64 %9
%11 = load i8*, i8** %10
%12 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %11)
%13 = add nuw nsw i64 %9, 1
%14 = icmp eq i64 %13, %6
br i1 %14, label %7, label %8
}
/* Variables and functions */
scalar_t__ szl_isspace(char);
void szl_ltrim(char *s, char **start) {
  for (*start = s; szl_isspace(*start[0]); ++*start)
    ;
}


x86 assembly (clang, -O0):
<szl_ltrim>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%edi
call   1030 <szl_isspace@plt>
cmp    $0x0,%rax
je     115c <szl_ltrim+0x4c>
jmp    1149 <szl_ltrim+0x39>
mov    -0x10(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
jmp    112b <szl_ltrim+0x1b>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<szl_ltrim>:
push   %rbx
mov    %rsi,%rbx
mov    %rdi,(%rsi)
movsbl (%rdi),%edi
nopw   0x0(%rax,%rax,1)
call   1030 <szl_isspace@plt>
test   %rax,%rax
je     113a <szl_ltrim+0x2a>
mov    (%rbx),%rax
lea    0x1(%rax),%rcx
mov    %rcx,(%rbx)
movsbl 0x1(%rax),%edi
jmp    1120 <szl_ltrim+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @szl_ltrim(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
store i8* %5, i8** %6
br label %7
7: ; preds = %15, %2
%8 = load i8**, i8*** %4
%9 = getelementptr inbounds i8*, i8** %8, i64 0
%10 = load i8*, i8** %9
%11 = load i8, i8* %10
%12 = call i64 @szl_isspace(i8 signext %11)
%13 = icmp ne i64 %12, 0
br i1 %13, label %14, label %19
14: ; preds = %7
br label %15
15: ; preds = %14
%16 = load i8**, i8*** %4
%17 = load i8*, i8** %16
%18 = getelementptr inbounds i8, i8* %17, i32 1
store i8* %18, i8** %16
br label %7
19: ; preds = %7
ret void
}

LLVM IR (-O2):
define void @szl_ltrim(i8* %0, i8** nocapture %1) {
store i8* %0, i8** %1
%3 = load i8, i8* %0
%4 = tail call i64 @szl_isspace(i8 signext %3)
%5 = icmp eq i64 %4, 0
br i1 %5, label %12, label %6
6: ; preds = %2, %6
%7 = load i8*, i8** %1
%8 = getelementptr inbounds i8, i8* %7, i64 1
store i8* %8, i8** %1
%9 = load i8, i8* %8
%10 = tail call i64 @szl_isspace(i8 signext %9)
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %6
12: ; preds = %6, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ApplyDeltaChanges();
int /*<<< orphan*/ CalculateCellToCellChanges();
int /*<<< orphan*/ ClearWeatherDeltas();
int /*<<< orphan*/ EnforceClimateConditions();
int /*<<< orphan*/ save_weathermap();
void UpdateWeather(void) {
  ClearWeatherDeltas();
  CalculateCellToCellChanges();
  EnforceClimateConditions();
  ApplyDeltaChanges();
  save_weathermap();
}


x86 assembly (clang, -O0):
<UpdateWeather>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1060 <ClearWeatherDeltas@plt>
mov    $0x0,%al
call   1040 <CalculateCellToCellChanges@plt>
mov    $0x0,%al
call   1050 <EnforceClimateConditions@plt>
mov    $0x0,%al
call   1030 <ApplyDeltaChanges@plt>
mov    $0x0,%al
call   1070 <save_weathermap@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<UpdateWeather>:
push   %rax
xor    %eax,%eax
call   1060 <ClearWeatherDeltas@plt>
xor    %eax,%eax
call   1040 <CalculateCellToCellChanges@plt>
xor    %eax,%eax
call   1050 <EnforceClimateConditions@plt>
xor    %eax,%eax
call   1030 <ApplyDeltaChanges@plt>
xor    %eax,%eax
pop    %rcx
jmp    1070 <save_weathermap@plt>

LLVM IR (-O0):
define void @UpdateWeather() {
%1 = call i32 (...) @ClearWeatherDeltas()
%2 = call i32 (...) @CalculateCellToCellChanges()
%3 = call i32 (...) @EnforceClimateConditions()
%4 = call i32 (...) @ApplyDeltaChanges()
%5 = call i32 (...) @save_weathermap()
ret void
}

LLVM IR (-O2):
define void @UpdateWeather() {
%1 = tail call i32 (...) @ClearWeatherDeltas()
%2 = tail call i32 (...) @CalculateCellToCellChanges()
%3 = tail call i32 (...) @EnforceClimateConditions()
%4 = tail call i32 (...) @ApplyDeltaChanges()
%5 = tail call i32 (...) @save_weathermap()
ret void
}
/* Variables and functions */
int prime(int);
int /*<<< orphan*/ printf(char *, long long);
int main() {
  long long sum = 2;
  int i;
  for (i = 3; i < 2000000; i += 2) {
    if (prime(i) == 1) {
      sum += i;
    }
  }
  printf("Sum = %lld\n", sum);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x2,-0x10(%rbp)
movl   $0x3,-0x14(%rbp)
cmpl   $0x1e8480,-0x14(%rbp)
jge    117b <main+0x5b>
mov    -0x14(%rbp),%edi
call   1040 <prime@plt>
cmp    $0x1,%eax
jne    1168 <main+0x48>
movslq -0x14(%rbp),%rax
add    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    116d <main+0x4d>
mov    -0x14(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x14(%rbp)
jmp    113e <main+0x1e>
mov    -0x10(%rbp),%rsi
lea    0xe7a(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    $0x2,%ebx
mov    $0x1,%ebp
nopl   (%rax)
add    $0x2,%ebp
mov    %ebp,%edi
call   1040 <prime@plt>
cmp    $0x1,%eax
mov    $0x0,%eax
cmove  %ebp,%eax
add    %rax,%rbx
cmp    $0x1e847e,%ebp
jb     1130 <main+0x10>
lea    0xea9(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [12 x i8] c"Sum = %lld\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i32
store i32 0, i32* %1
store i64 2, i64* %2
store i32 3, i32* %3
br label %4
4: ; preds = %17, %0
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 2000000
br i1 %6, label %7, label %20
7: ; preds = %4
%8 = load i32, i32* %3
%9 = call i32 @prime(i32 %8)
%10 = icmp eq i32 %9, 1
br i1 %10, label %11, label %16
11: ; preds = %7
%12 = load i32, i32* %3
%13 = sext i32 %12 to i64
%14 = load i64, i64* %2
%15 = add nsw i64 %14, %13
store i64 %15, i64* %2
br label %16
16: ; preds = %11, %7
br label %17
17: ; preds = %16
%18 = load i32, i32* %3
%19 = add nsw i32 %18, 2
store i32 %19, i32* %3
br label %4
20: ; preds = %4
%21 = load i64, i64* %2
%22 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i64 %21)
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"Sum = %lld\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 3, %0 ], [ %9, %1 ]
%3 = phi i64 [ 2, %0 ], [ %8, %1 ]
%4 = tail call i32 @prime(i32 %2)
%5 = icmp eq i32 %4, 1
%6 = select i1 %5, i32 %2, i32 0
%7 = zext i32 %6 to i64
%8 = add nuw nsw i64 %3, %7
%9 = add nuw nsw i32 %2, 2
%10 = icmp ult i32 %2, 1999998
br i1 %10, label %1, label %11
11: ; preds = %1
%12 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i64 %8)
ret i32 0
}
void GI2C1_Init(void) {}


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

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

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

LLVM IR (-O2):
define void @GI2C1_Init() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __remove(char const *);
int remove(const char *filename) {
  int ret;
  __remove(filename);
  ret = 0;
  return (ret);
}


x86 assembly (clang, -O0):
<remove>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <__remove@plt>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @remove(i8* %0) {
%2 = tail call i32 @__remove(i8* %0)
ret i32 0
}
long fibonacci(long limit) {
  long first = 0, second = 1, next = 0, total = 0;
  while (next < limit) {
    first = second;
    second = next;
    next = first + second;
    if (next % 2 == 0) {
      total += next;
    }
  }
  return total;
}


x86 assembly (clang, -O0):
<fibonacci>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
movq   $0x1,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
movq   $0x0,-0x28(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x8(%rbp),%rax
jge    117b <fibonacci+0x7b>
mov    -0x18(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
add    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
cmp    $0x0,%rdx
jne    1176 <fibonacci+0x76>
mov    -0x20(%rbp),%rax
add    -0x28(%rbp),%rax
mov    %rax,-0x28(%rbp)
jmp    1128 <fibonacci+0x28>
mov    -0x28(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fibonacci>:
test   %rdi,%rdi
jle    1131 <fibonacci+0x31>
mov    $0x1,%ecx
xor    %eax,%eax
xor    %edx,%edx
xchg   %ax,%ax
mov    %rdx,%rsi
add    %rdx,%rcx
test   $0x1,%cl
mov    $0x0,%edx
cmove  %rcx,%rdx
add    %rdx,%rax
mov    %rcx,%rdx
cmp    %rdi,%rcx
mov    %rsi,%rcx
jl     1110 <fibonacci+0x10>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i64 @fibonacci(i64 %0) {
%2 = alloca i64
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store i64 %0, i64* %2
store i64 0, i64* %3
store i64 1, i64* %4
store i64 0, i64* %5
store i64 0, i64* %6
br label %7
7: ; preds = %24, %1
%8 = load i64, i64* %5
%9 = load i64, i64* %2
%10 = icmp slt i64 %8, %9
br i1 %10, label %11, label %25
11: ; preds = %7
%12 = load i64, i64* %4
store i64 %12, i64* %3
%13 = load i64, i64* %5
store i64 %13, i64* %4
%14 = load i64, i64* %3
%15 = load i64, i64* %4
%16 = add nsw i64 %14, %15
store i64 %16, i64* %5
%17 = load i64, i64* %5
%18 = srem i64 %17, 2
%19 = icmp eq i64 %18, 0
br i1 %19, label %20, label %24
20: ; preds = %11
%21 = load i64, i64* %5
%22 = load i64, i64* %6
%23 = add nsw i64 %22, %21
store i64 %23, i64* %6
br label %24
24: ; preds = %20, %11
br label %7
25: ; preds = %7
%26 = load i64, i64* %6
ret i64 %26
}

LLVM IR (-O2):
define i64 @fibonacci(i64 %0) {
%2 = icmp sgt i64 %0, 0
br i1 %2, label %3, label %13
3: ; preds = %1, %3
%4 = phi i64 [ %11, %3 ], [ 0, %1 ]
%5 = phi i64 [ %7, %3 ], [ 0, %1 ]
%6 = phi i64 [ %5, %3 ], [ 1, %1 ]
%7 = add nsw i64 %5, %6
%8 = and i64 %7, 1
%9 = icmp eq i64 %8, 0
%10 = select i1 %9, i64 %7, i64 0
%11 = add nsw i64 %10, %4
%12 = icmp slt i64 %7, %0
br i1 %12, label %3, label %13
13: ; preds = %3, %1
%14 = phi i64 [ 0, %1 ], [ %11, %3 ]
ret i64 %14
}
/* Variables and functions */
int /*<<< orphan*/ leds_OFF_all();
int /*<<< orphan*/ leds_ON_all();
int /*<<< orphan*/ leds_init();
int main() {
  int number = 0;
  leds_init();
  leds_OFF_all();
  leds_ON_all();
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
%3 = call i32 (...) @leds_init()
%4 = call i32 (...) @leds_OFF_all()
%5 = call i32 (...) @leds_ON_all()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @leds_init()
%2 = tail call i32 (...) @leds_OFF_all()
%3 = tail call i32 (...) @leds_ON_all()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
int isqrt(int);
void t_sqrt_194() {
  Assert_real((isqrt(194) == 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",
              975, ("Integer square root of 194 should be 13"));
}


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

x86 assembly (clang, -O2):
<t_sqrt_194>:
push   %rax
mov    $0xc2,%edi
call   1030 <isqrt@plt>
xor    %edi,%edi
cmp    $0xd,%eax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf60(%rip),%rcx
mov    $0x3cf,%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 194 should be 13\00"
define void @t_sqrt_194() {
%1 = call i32 @isqrt(i32 194)
%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 975, 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 194 should be 13\00"
define void @t_sqrt_194() {
%1 = tail call i32 @isqrt(i32 194)
%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 975, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ usleep(int);
void wait() { usleep(550); }


x86 assembly (clang, -O0):
<wait>:
push   %rbp
mov    %rsp,%rbp
mov    $0x226,%edi
call   1030 <usleep@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<wait>:
mov    $0x226,%edi
jmp    1030 <usleep@plt>

LLVM IR (-O0):
define void @wait() {
%1 = call i32 @usleep(i32 550)
ret void
}

LLVM IR (-O2):
define void @wait() {
%1 = tail call i32 @usleep(i32 550)
ret void
}