xunge/DecIR huggingface dataset:
/* Type definitions */
struct plugin {
  int dummy;
};
struct command {
  int dummy;
};

/* Variables and functions */
int nvme_attach_ns(int, char **, int, char const *, struct command *);
int attach_ns(int argc, char **argv, struct command *cmd,
              struct plugin *plugin) {
  const char *desc =
      "Attach the given namespace to the "
      "given controller or comma-sep list of controllers. ID of the "
      "given namespace becomes active upon attachment to a "
      "controller. A namespace must be attached to a controller "
      "before IO commands may be directed to that namespace.";
  return nvme_attach_ns(argc, argv, 1, desc, cmd);
}


x86 assembly (clang, -O0):
<attach_ns>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
lea    0xed2(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x28(%rbp),%rcx
mov    -0x18(%rbp),%r8
mov    $0x1,%edx
call   1030 <nvme_attach_ns@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<attach_ns>:
mov    %rdx,%r8
lea    0xee6(%rip),%rcx
mov    $0x1,%edx
jmp    1030 <nvme_attach_ns@plt>

LLVM IR (-O0):
%struct.command = type { i32 }
%struct.plugin = type { i32 }
@.str = [258 x i8] c"Attach the given namespace to the given controller or comma-sep list of controllers. ID of the given namespace becomes active upon attachment to a controller. A namespace must be attached to a controller before IO commands may be directed to that namespace.\00"
define i32 @attach_ns(i32 %0, i8** %1, %struct.command* %2, %struct.plugin* %3) {
%5 = alloca i32
%6 = alloca i8**
%7 = alloca %struct.command*
%8 = alloca %struct.plugin*
%9 = alloca i8*
store i32 %0, i32* %5
store i8** %1, i8*** %6
store %struct.command* %2, %struct.command** %7
store %struct.plugin* %3, %struct.plugin** %8
store i8* getelementptr inbounds ([258 x i8], [258 x i8]* @.str, i64 0, i64 0), i8** %9
%10 = load i32, i32* %5
%11 = load i8**, i8*** %6
%12 = load i8*, i8** %9
%13 = load %struct.command*, %struct.command** %7
%14 = call i32 @nvme_attach_ns(i32 %10, i8** %11, i32 1, i8* %12, %struct.command* %13)
ret i32 %14
}

LLVM IR (-O2):
%struct.command = type { i32 }
%struct.plugin = type { i32 }
@.str = [258 x i8] c"Attach the given namespace to the given controller or comma-sep list of controllers. ID of the given namespace becomes active upon attachment to a controller. A namespace must be attached to a controller before IO commands may be directed to that namespace.\00"
define i32 @attach_ns(i32 %0, i8** %1, %struct.command* %2, %struct.plugin* nocapture readnone %3) {
%5 = tail call i32 @nvme_attach_ns(i32 %0, i8** %1, i32 1, i8* getelementptr inbounds ([258 x i8], [258 x i8]* @.str, i64 0, i64 0), %struct.command* %2)
ret i32 %5
}
/* Type definitions */
struct imgImage {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct imgImage *);
void imgFreeImage(struct imgImage *img) { free(img); }


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

x86 assembly (clang, -O2):
<imgFreeImage>:
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.imgImage = type { i32 }
define void @imgFreeImage(%struct.imgImage* %0) {
%2 = alloca %struct.imgImage*
store %struct.imgImage* %0, %struct.imgImage** %2
%3 = load %struct.imgImage*, %struct.imgImage** %2
%4 = call i32 @free(%struct.imgImage* %3)
ret void
}

LLVM IR (-O2):
%struct.imgImage = type { i32 }
define void @imgFreeImage(%struct.imgImage* nocapture %0) {
%2 = tail call i32 @free(%struct.imgImage* %0)
ret void
}
int test() {
  int a = 10;
  return a;
}


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

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

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

LLVM IR (-O2):
define i32 @test() {
ret i32 10
}
/* Variables and functions */
int /*<<< orphan*/ gen(char *);
int /*<<< orphan*/ ngen(char *, char *, int);
void cgscaleby(int v) {
  ngen("%s\t$%d,%%ecx", "movl", v);
  gen("mull\t%ecx");
}


x86 assembly (clang, -O0):
<cgscaleby>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
lea    0xecb(%rip),%rdi
lea    0xed1(%rip),%rsi
call   1030 <ngen@plt>
lea    0xeca(%rip),%rdi
call   1040 <gen@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cgscaleby>:
push   %rax
mov    %edi,%edx
lea    0xed6(%rip),%rdi
lea    0xedc(%rip),%rsi
call   1030 <ngen@plt>
lea    0xed5(%rip),%rdi
pop    %rax
jmp    1040 <gen@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"%s\09$%d,%%ecx\00"
@.str.1 = [5 x i8] c"movl\00"
@.str.2 = [10 x i8] c"mull\09%ecx\00"
define void @cgscaleby(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @ngen(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %3)
%5 = call i32 @gen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"%s\09$%d,%%ecx\00"
@.str.1 = [5 x i8] c"movl\00"
@.str.2 = [10 x i8] c"mull\09%ecx\00"
define void @cgscaleby(i32 %0) {
%2 = tail call i32 @ngen(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %0)
%3 = tail call i32 @gen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
ret void
}
/* Type definitions */
struct timeval {
  double tv_sec;
  scalar_t__ tv_usec;
};

/* Variables and functions */
double delta(struct timeval *t1, struct timeval *t2) {
  return (t2->tv_sec - t1->tv_sec) +
         (double)(t2->tv_usec - t1->tv_usec) / 1000000;
}


x86 assembly (clang, -O0):
<delta>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
subsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    -0x8(%rbp),%rcx
sub    0x8(%rcx),%rax
cvtsi2sd %rax,%xmm1
movsd  0xec7(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<delta>:
movsd  (%rsi),%xmm1
subsd  (%rdi),%xmm1
mov    0x8(%rsi),%rax
sub    0x8(%rdi),%rax
cvtsi2sd %rax,%xmm0
divsd  0xee3(%rip),%xmm0
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
%struct.timeval = type { double, i64 }
define double @delta(%struct.timeval* %0, %struct.timeval* %1) {
%3 = alloca %struct.timeval*
%4 = alloca %struct.timeval*
store %struct.timeval* %0, %struct.timeval** %3
store %struct.timeval* %1, %struct.timeval** %4
%5 = load %struct.timeval*, %struct.timeval** %4
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %5, i32 0, i32 0
%7 = load double, double* %6
%8 = load %struct.timeval*, %struct.timeval** %3
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %8, i32 0, i32 0
%10 = load double, double* %9
%11 = fsub double %7, %10
%12 = load %struct.timeval*, %struct.timeval** %4
%13 = getelementptr inbounds %struct.timeval, %struct.timeval* %12, i32 0, i32 1
%14 = load i64, i64* %13
%15 = load %struct.timeval*, %struct.timeval** %3
%16 = getelementptr inbounds %struct.timeval, %struct.timeval* %15, i32 0, i32 1
%17 = load i64, i64* %16
%18 = sub nsw i64 %14, %17
%19 = sitofp i64 %18 to double
%20 = fdiv double %19, 1.000000e+06
%21 = fadd double %11, %20
ret double %21
}

LLVM IR (-O2):
%struct.timeval = type { double, i64 }
define double @delta(%struct.timeval* nocapture %0, %struct.timeval* nocapture %1) {
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%4 = load double, double* %3
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %0, i64 0, i32 0
%6 = load double, double* %5
%7 = fsub double %4, %6
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%9 = load i64, i64* %8
%10 = getelementptr inbounds %struct.timeval, %struct.timeval* %0, i64 0, i32 1
%11 = load i64, i64* %10
%12 = sub nsw i64 %9, %11
%13 = sitofp i64 %12 to double
%14 = fdiv double %13, 1.000000e+06
%15 = fadd double %7, %14
ret double %15
}
void w_refcnt_add(volatile long *refcnt) {
  (void)__sync_fetch_and_add(refcnt, 1);
}


x86 assembly (clang, -O0):
<w_refcnt_add>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
lock addq $0x1,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<w_refcnt_add>:
lock addq $0x1,(%rdi)
ret

LLVM IR (-O0):
define void @w_refcnt_add(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = atomicrmw add i64* %3, i64 1 seq_cst
ret void
}

LLVM IR (-O2):
define void @w_refcnt_add(i64* nocapture %0) {
%2 = atomicrmw add i64* %0, i64 1 seq_cst
ret void
}
/* Variables and functions */
int __VERIFIER_nondet_int();
int main() {
  int x = __VERIFIER_nondet_int();
  int y = __VERIFIER_nondet_int();
  while (x < 10) {
    x = -y;
    y++;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    1153 <main+0x43>
xor    %eax,%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1133 <main+0x23>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
%2 = tail call i32 (...) @__VERIFIER_nondet_int()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
void childExit(int sig) {
  printf("\nNumeric value of signal SIGCHLD is %d\n", sig);
  printf("Parent received the signal\n");
  exit(0);
}


x86 assembly (clang, -O0):
<childExit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xecb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xee5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<childExit>:
push   %rax
mov    %edi,%esi
lea    0xec6(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xee0(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [40 x i8] c"\0ANumeric value of signal SIGCHLD is %d\0A\00"
@.str.1 = [28 x i8] c"Parent received the signal\0A\00"
define void @childExit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [40 x i8] c"\0ANumeric value of signal SIGCHLD is %d\0A\00"
@str = [27 x i8] c"Parent received the signal\00"
define void @childExit(i32 %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i32 %0)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
double dendroid_noise(float, float);
float unsalt_2d_noise(float, float);
float dendroid_distorted_simplex_noise(float x, float y) {
  float d = 0.3 * dendroid_noise(x * 0.8, y * 0.8);
  return unsalt_2d_noise(x + d, y + d);
}


x86 assembly (clang, -O0):
<dendroid_distorted_simplex_noise>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xec5(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  -0x8(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
movsd  0xeac(%rip),%xmm2
mulsd  %xmm2,%xmm1
cvtsd2ss %xmm1,%xmm1
call   1030 <dendroid_noise@plt>
movaps %xmm0,%xmm1
movsd  0xe8c(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
addss  -0xc(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
addss  -0xc(%rbp),%xmm1
call   1040 <unsalt_2d_noise@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dendroid_distorted_simplex_noise>:
push   %rax
movss  %xmm1,(%rsp)
movss  %xmm0,0x4(%rsp)
cvtss2sd %xmm0,%xmm2
movsd  0xec8(%rip),%xmm3
mulsd  %xmm3,%xmm2
xorps  %xmm0,%xmm0
cvtsd2ss %xmm2,%xmm0
xorps  %xmm2,%xmm2
cvtss2sd %xmm1,%xmm2
mulsd  %xmm3,%xmm2
xorps  %xmm1,%xmm1
cvtsd2ss %xmm2,%xmm1
call   1030 <dendroid_noise@plt>
mulsd  0xea6(%rip),%xmm0
xorps  %xmm1,%xmm1
cvtsd2ss %xmm0,%xmm1
movss  0x4(%rsp),%xmm0
addss  %xmm1,%xmm0
addss  (%rsp),%xmm1
pop    %rax
jmp    1040 <unsalt_2d_noise@plt>

LLVM IR (-O0):
define float @dendroid_distorted_simplex_noise(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
store float %0, float* %3
store float %1, float* %4
%6 = load float, float* %3
%7 = fpext float %6 to double
%8 = fmul double %7, 8.000000e-01
%9 = fptrunc double %8 to float
%10 = load float, float* %4
%11 = fpext float %10 to double
%12 = fmul double %11, 8.000000e-01
%13 = fptrunc double %12 to float
%14 = call double @dendroid_noise(float %9, float %13)
%15 = fmul double 3.000000e-01, %14
%16 = fptrunc double %15 to float
store float %16, float* %5
%17 = load float, float* %3
%18 = load float, float* %5
%19 = fadd float %17, %18
%20 = load float, float* %4
%21 = load float, float* %5
%22 = fadd float %20, %21
%23 = call float @unsalt_2d_noise(float %19, float %22)
ret float %23
}

LLVM IR (-O2):
define float @dendroid_distorted_simplex_noise(float %0, float %1) {
%3 = fpext float %0 to double
%4 = fmul double %3, 8.000000e-01
%5 = fptrunc double %4 to float
%6 = fpext float %1 to double
%7 = fmul double %6, 8.000000e-01
%8 = fptrunc double %7 to float
%9 = tail call double @dendroid_noise(float %5, float %8)
%10 = fmul double %9, 3.000000e-01
%11 = fptrunc double %10 to float
%12 = fadd float %11, %0
%13 = fadd float %11, %1
%14 = tail call float @unsalt_2d_noise(float %12, float %13)
ret float %14
}
/* Variables and functions */
int /*<<< orphan*/ MADV_DONTNEED;
int madvise(void *, size_t, int /*<<< orphan*/);
size_t pageAlignLen(void *, size_t);
void *pageAlignStart(void *);
int sasMsyncRelease(void *startAddr, size_t size) {
  void *alignAddr = pageAlignStart(startAddr);
  size_t alignSize = pageAlignLen(startAddr, size);
  return madvise(alignAddr, alignSize, MADV_DONTNEED);
}


x86 assembly (clang, -O0):
<sasMsyncRelease>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <pageAlignStart@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <pageAlignLen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    0x2e73(%rip),%rax
mov    (%rax),%edx
call   1050 <madvise@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sasMsyncRelease>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <pageAlignStart@plt>
mov    %rax,%r15
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <pageAlignLen@plt>
mov    0x2e8b(%rip),%rcx
mov    (%rcx),%edx
mov    %r15,%rdi
mov    %rax,%rsi
pop    %rbx
pop    %r14
pop    %r15
jmp    1050 <madvise@plt>

LLVM IR (-O0):
@MADV_DONTNEED = global i32 0
define i32 @sasMsyncRelease(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%7 = load i8*, i8** %3
%8 = call i8* @pageAlignStart(i8* %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %3
%10 = load i64, i64* %4
%11 = call i64 @pageAlignLen(i8* %9, i64 %10)
store i64 %11, i64* %6
%12 = load i8*, i8** %5
%13 = load i64, i64* %6
%14 = load i32, i32* @MADV_DONTNEED
%15 = call i32 @madvise(i8* %12, i64 %13, i32 %14)
ret i32 %15
}

LLVM IR (-O2):
@MADV_DONTNEED = global i32 0
define i32 @sasMsyncRelease(i8* %0, i64 %1) {
%3 = tail call i8* @pageAlignStart(i8* %0)
%4 = tail call i64 @pageAlignLen(i8* %0, i64 %1)
%5 = load i32, i32* @MADV_DONTNEED
%6 = tail call i32 @madvise(i8* %3, i64 %4, i32 %5)
ret i32 %6
}
void _M2_popWorld_init(__attribute__((unused)) int argc,
                       __attribute__((unused)) char *argv[]) {}


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

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

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

LLVM IR (-O2):
define void @_M2_popWorld_init(i32 %0, i8** nocapture %1) {
ret void
}
/* Variables and functions */
int round(int);
int knots2mph(int knots) {
  if (knots < 0)
    return knots;
  return round(knots * 57875 / 50292.0);
}


x86 assembly (clang, -O0):
<knots2mph>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    1130 <knots2mph+0x20>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1153 <knots2mph+0x43>
imul   $0xe213,-0x8(%rbp),%eax
cvtsi2sd %eax,%xmm0
movsd  0xebd(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1030 <round@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<knots2mph>:
test   %edi,%edi
js     112f <knots2mph+0x1f>
imul   $0xe213,%edi,%eax
cvtsi2sd %eax,%xmm0
divsd  0xeda(%rip),%xmm0
cvttsd2si %xmm0,%edi
jmp    1030 <round@plt>
mov    %edi,%eax
ret

LLVM IR (-O0):
define i32 @knots2mph(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = load i32, i32* %3
store i32 %7, i32* %2
br label %15
8: ; preds = %1
%9 = load i32, i32* %3
%10 = mul nsw i32 %9, 57875
%11 = sitofp i32 %10 to double
%12 = fdiv double %11, 5.029200e+04
%13 = fptosi double %12 to i32
%14 = call i32 @round(i32 %13)
store i32 %14, i32* %2
br label %15
15: ; preds = %8, %6
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
define i32 @knots2mph(i32 %0) {
%2 = icmp slt i32 %0, 0
br i1 %2, label %9, label %3
3: ; preds = %1
%4 = mul nsw i32 %0, 57875
%5 = sitofp i32 %4 to double
%6 = fdiv double %5, 5.029200e+04
%7 = fptosi double %6 to i32
%8 = tail call i32 @round(i32 %7)
br label %9
9: ; preds = %1, %3
%10 = phi i32 [ %8, %3 ], [ %0, %1 ]
ret i32 %10
}
int stdcall_fun(int a, int b, int c) { return a + b + c; }


x86 assembly (clang, -O0):
<stdcall_fun>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<stdcall_fun>:
lea    (%rdi,%rsi,1),%eax
add    %edx,%eax
ret

LLVM IR (-O0):
define i32 @stdcall_fun(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = add nsw i32 %7, %8
%10 = load i32, i32* %6
%11 = add nsw i32 %9, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @stdcall_fun(i32 %0, i32 %1, i32 %2) {
%4 = add nsw i32 %1, %0
%5 = add nsw i32 %4, %2
ret i32 %5
}
/* Variables and functions */
int numberOf1InBinary(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main(int argc, const char *argv[]) {
  int number;
  printf("Input a number:");
  scanf("%d", &number);
  printf("It's %d of 1\n", numberOf1InBinary(number));
  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)
lea    0xeb3(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xeb5(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x14(%rbp),%edi
call   1030 <numberOf1InBinary@plt>
mov    %eax,%esi
lea    0xe9e(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xeca(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%edi
call   1030 <numberOf1InBinary@plt>
lea    0xeb3(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"Input a number:\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [14 x i8] c"It's %d of 1\0A\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 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %6)
%9 = load i32, i32* %6
%10 = call i32 @numberOf1InBinary(i32 %9)
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i32 %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"Input a number:\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [14 x i8] c"It's %d of 1\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%7 = load i32, i32* %3
%8 = call i32 @numberOf1InBinary(i32 %7)
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i32 %8)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void finish_a4(void) { printf("finish_a4\n"); }


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

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

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

LLVM IR (-O2):
@str = [10 x i8] c"finish_a4\00"
define void @finish_a4() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
ret void
}
int divpwr2(int x, int n) {
  int bias = ((1 << n) + (~0)) & (x >> 31);
  return (x + bias) >> n;
}


x86 assembly (clang, -O0):
<divpwr2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
add    $0xffffffff,%eax
mov    -0x4(%rbp),%ecx
sar    $0x1f,%ecx
and    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
add    -0xc(%rbp),%eax
mov    -0x8(%rbp),%ecx
sar    %cl,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<divpwr2>:
mov    %esi,%ecx
mov    $0xffffffff,%edx
shl    %cl,%edx
not    %edx
mov    %edi,%eax
sar    $0x1f,%eax
and    %edx,%eax
add    %edi,%eax
sar    %cl,%eax
ret

LLVM IR (-O0):
define i32 @divpwr2(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = shl i32 1, %6
%8 = add nsw i32 %7, -1
%9 = load i32, i32* %3
%10 = ashr i32 %9, 31
%11 = and i32 %8, %10
store i32 %11, i32* %5
%12 = load i32, i32* %3
%13 = load i32, i32* %5
%14 = add nsw i32 %12, %13
%15 = load i32, i32* %4
%16 = ashr i32 %14, %15
ret i32 %16
}

LLVM IR (-O2):
define i32 @divpwr2(i32 %0, i32 %1) {
%3 = shl nsw i32 -1, %1
%4 = xor i32 %3, -1
%5 = icmp slt i32 %0, 0
%6 = select i1 %5, i32 %4, i32 0
%7 = add nsw i32 %6, %0
%8 = ashr i32 %7, %1
ret i32 %8
}
int test_imm_B8int16_mem(short *val) {
  return ((*val) & (0xB8 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_B8int16_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movswl (%rax),%edx
and    $0xb8,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_B8int16_mem>:
testb  $0xb8,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_B8int16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = sext i16 %4 to i32
%6 = and i32 %5, 184
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 -20, i32 -40
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_imm_B8int16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 184
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
unsigned int exynos_5410_gpio_read(unsigned int);
unsigned int odroid_xu_gpio_read_21() {
  unsigned int bank_offset = 0x0C40;
  unsigned int bit_index = 5;
  return (exynos_5410_gpio_read(bank_offset) >> bit_index) & 0x1;
}


x86 assembly (clang, -O0):
<odroid_xu_gpio_read_21>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0xc40,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <exynos_5410_gpio_read@plt>
mov    -0x8(%rbp),%ecx
shr    %cl,%eax
and    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<odroid_xu_gpio_read_21>:
push   %rax
mov    $0xc40,%edi
call   1030 <exynos_5410_gpio_read@plt>
shr    $0x5,%eax
and    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @odroid_xu_gpio_read_21() {
%1 = alloca i32
%2 = alloca i32
store i32 3136, i32* %1
store i32 5, i32* %2
%3 = load i32, i32* %1
%4 = call i32 @exynos_5410_gpio_read(i32 %3)
%5 = load i32, i32* %2
%6 = lshr i32 %4, %5
%7 = and i32 %6, 1
ret i32 %7
}

LLVM IR (-O2):
define i32 @odroid_xu_gpio_read_21() {
%1 = tail call i32 @exynos_5410_gpio_read(i32 3136)
%2 = lshr i32 %1, 5
%3 = and i32 %2, 1
ret i32 %3
}
/* Variables and functions */
int rand();
unsigned char mk_rnd_u6() { return (rand() & 0x3f); }


x86 assembly (clang, -O0):
<mk_rnd_u6>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <rand@plt>
and    $0x3f,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mk_rnd_u6>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
and    $0x3f,%al
pop    %rcx
ret

LLVM IR (-O0):
define zeroext i8 @mk_rnd_u6() {
%1 = call i32 (...) @rand()
%2 = and i32 %1, 63
%3 = trunc i32 %2 to i8
ret i8 %3
}

LLVM IR (-O2):
define zeroext i8 @mk_rnd_u6() {
%1 = tail call i32 (...) @rand()
%2 = trunc i32 %1 to i8
%3 = and i8 %2, 63
ret i8 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void call1() { printf("Hello Everybody\n"); }


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

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

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

LLVM IR (-O2):
@str = [16 x i8] c"Hello Everybody\00"
define void @call1() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int /*<<< orphan*/ Serial_write_byte(char);
char nibble_to_hex_char(int);
void print_uint8(uint8_t val) {
  char c = nibble_to_hex_char(val >> 4);
  Serial_write_byte(c);
  c = nibble_to_hex_char(val);
  Serial_write_byte(c);
}


x86 assembly (clang, -O0):
<print_uint8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
sar    $0x4,%edi
call   1040 <nibble_to_hex_char@plt>
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%edi
call   1030 <Serial_write_byte@plt>
mov    -0x4(%rbp),%edi
call   1040 <nibble_to_hex_char@plt>
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%edi
call   1030 <Serial_write_byte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_uint8>:
push   %rbx
mov    %edi,%ebx
sar    $0x4,%edi
call   1040 <nibble_to_hex_char@plt>
movsbl %al,%edi
call   1030 <Serial_write_byte@plt>
mov    %ebx,%edi
call   1040 <nibble_to_hex_char@plt>
movsbl %al,%edi
pop    %rbx
jmp    1030 <Serial_write_byte@plt>

LLVM IR (-O0):
define void @print_uint8(i32 %0) {
%2 = alloca i32
%3 = alloca i8
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = ashr i32 %4, 4
%6 = call signext i8 @nibble_to_hex_char(i32 %5)
store i8 %6, i8* %3
%7 = load i8, i8* %3
%8 = call i32 @Serial_write_byte(i8 signext %7)
%9 = load i32, i32* %2
%10 = call signext i8 @nibble_to_hex_char(i32 %9)
store i8 %10, i8* %3
%11 = load i8, i8* %3
%12 = call i32 @Serial_write_byte(i8 signext %11)
ret void
}

LLVM IR (-O2):
define void @print_uint8(i32 %0) {
%2 = ashr i32 %0, 4
%3 = tail call signext i8 @nibble_to_hex_char(i32 %2)
%4 = tail call i32 @Serial_write_byte(i8 signext %3)
%5 = tail call signext i8 @nibble_to_hex_char(i32 %0)
%6 = tail call i32 @Serial_write_byte(i8 signext %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ ispunct(int);
void t_ispunct_0x8f() {
  Assert_real((ispunct(143) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_ispunct.c",
              720, ("ispunct should be 0 for 0x8f"));
}


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

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

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

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_ispunct.c\00"
@.str.1 = [29 x i8] c"ispunct should be 0 for 0x8f\00"
define void @t_ispunct_0x8f() {
%1 = tail call i64 @ispunct(i32 143)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 720, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ aesc_decrypt(unsigned char const *, unsigned char *,
                                unsigned char *);
int /*<<< orphan*/ aesc_keyexp(unsigned char const *, unsigned char *);
int /*<<< orphan*/ copy_block(unsigned char *, unsigned char *);
void AES_DECRYPT(unsigned char *out, const unsigned char *in,
                 const unsigned char *key) {
  unsigned char buf[16];
  unsigned char expkey[11 * 16];
  aesc_keyexp(key, expkey);
  aesc_decrypt(in, buf, expkey);
  copy_block(out, buf);
}


x86 assembly (clang, -O0):
<AES_DECRYPT>:
push   %rbp
mov    %rsp,%rbp
sub    $0xe0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
lea    -0xe0(%rbp),%rsi
call   1040 <aesc_keyexp@plt>
mov    -0x10(%rbp),%rdi
lea    -0x30(%rbp),%rsi
lea    -0xe0(%rbp),%rdx
call   1030 <aesc_decrypt@plt>
mov    -0x8(%rbp),%rdi
lea    -0x30(%rbp),%rsi
call   1050 <copy_block@plt>
add    $0xe0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<AES_DECRYPT>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0xc8,%rsp
mov    %rsi,%rbx
mov    %rdi,%r14
lea    0x10(%rsp),%r15
mov    %rdx,%rdi
mov    %r15,%rsi
call   1040 <aesc_keyexp@plt>
mov    %rsp,%r12
mov    %rbx,%rdi
mov    %r12,%rsi
mov    %r15,%rdx
call   1030 <aesc_decrypt@plt>
mov    %r14,%rdi
mov    %r12,%rsi
call   1050 <copy_block@plt>
add    $0xc8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @AES_DECRYPT(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca [16 x i8]
%8 = alloca [176 x i8]
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%9 = load i8*, i8** %6
%10 = getelementptr inbounds [176 x i8], [176 x i8]* %8, i64 0, i64 0
%11 = call i32 @aesc_keyexp(i8* %9, i8* %10)
%12 = load i8*, i8** %5
%13 = getelementptr inbounds [16 x i8], [16 x i8]* %7, i64 0, i64 0
%14 = getelementptr inbounds [176 x i8], [176 x i8]* %8, i64 0, i64 0
%15 = call i32 @aesc_decrypt(i8* %12, i8* %13, i8* %14)
%16 = load i8*, i8** %4
%17 = getelementptr inbounds [16 x i8], [16 x i8]* %7, i64 0, i64 0
%18 = call i32 @copy_block(i8* %16, i8* %17)
ret void
}

LLVM IR (-O2):
define void @AES_DECRYPT(i8* %0, i8* %1, i8* %2) {
%4 = alloca [16 x i8]
%5 = alloca [176 x i8]
%6 = getelementptr inbounds [16 x i8], [16 x i8]* %4, i64 0, i64 0
%7 = getelementptr inbounds [176 x i8], [176 x i8]* %5, i64 0, i64 0
%8 = call i32 @aesc_keyexp(i8* %2, i8* %7)
%9 = call i32 @aesc_decrypt(i8* %1, i8* %6, i8* %7)
%10 = call i32 @copy_block(i8* %0, i8* %6)
ret void
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int uint32_t;

/* Variables and functions */
uint32_t htonl(uint32_t v) {
  uint8_t *p = (uint8_t *)&v;
  return ((uint32_t)p[0] << 24) | ((uint32_t)p[1] << 16) |
         ((uint32_t)p[2] << 8) | (uint32_t)p[3];
}


x86 assembly (clang, -O0):
<htonl>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
shl    $0x18,%eax
mov    -0x10(%rbp),%rcx
mov    0x8(%rcx),%rcx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x10(%rbp),%rcx
mov    0x10(%rcx),%rcx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x10(%rbp),%rcx
mov    0x18(%rcx),%rcx
or     %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @htonl(i32 %0) {
%2 = alloca i32
%3 = alloca i64*
store i32 %0, i32* %2
%4 = bitcast i32* %2 to i64*
store i64* %4, i64** %3
%5 = load i64*, i64** %3
%6 = getelementptr inbounds i64, i64* %5, i64 0
%7 = load i64, i64* %6
%8 = trunc i64 %7 to i32
%9 = shl i32 %8, 24
%10 = load i64*, i64** %3
%11 = getelementptr inbounds i64, i64* %10, i64 1
%12 = load i64, i64* %11
%13 = trunc i64 %12 to i32
%14 = shl i32 %13, 16
%15 = or i32 %9, %14
%16 = load i64*, i64** %3
%17 = getelementptr inbounds i64, i64* %16, i64 2
%18 = load i64, i64* %17
%19 = trunc i64 %18 to i32
%20 = shl i32 %19, 8
%21 = or i32 %15, %20
%22 = load i64*, i64** %3
%23 = getelementptr inbounds i64, i64* %22, i64 3
%24 = load i64, i64* %23
%25 = trunc i64 %24 to i32
%26 = or i32 %21, %25
ret i32 %26
}

LLVM IR (-O2):
define i32 @htonl(i32 %0) {
ret i32 poison
}
/* Variables and functions */
int /*<<< orphan*/ errno;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printErr(char *);
int /*<<< orphan*/ sendPADT();
int /*<<< orphan*/ sprintf(char *, char *, char const *, char *);
char *strerror(int /*<<< orphan*/);
void fatalSys(char const *str) {
  char buf[1024];
  sprintf(buf, "%.256s: %.256s", str, strerror(errno));
  printErr(buf);
  sendPADT();
  exit(1);
}


x86 assembly (clang, -O0):
<fatalSys>:
push   %rbp
mov    %rsp,%rbp
sub    $0x420,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x410(%rbp),%rax
mov    %rax,-0x420(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x418(%rbp)
mov    0x2e61(%rip),%rax
mov    (%rax),%edi
call   1070 <strerror@plt>
mov    -0x420(%rbp),%rdi
mov    -0x418(%rbp),%rdx
mov    %rax,%rcx
lea    0xe62(%rip),%rsi
call   1050 <sprintf@plt>
lea    -0x410(%rbp),%rdi
call   1030 <printErr@plt>
mov    $0x0,%al
call   1040 <sendPADT@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<fatalSys>:
push   %r14
push   %rbx
sub    $0x408,%rsp
mov    %rdi,%rbx
mov    0x2e7c(%rip),%rax
mov    (%rax),%edi
call   1070 <strerror@plt>
lea    0xe8e(%rip),%rsi
mov    %rsp,%r14
mov    %r14,%rdi
mov    %rbx,%rdx
mov    %rax,%rcx
call   1050 <sprintf@plt>
mov    %r14,%rdi
call   1030 <printErr@plt>
xor    %eax,%eax
call   1040 <sendPADT@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"%.256s: %.256s\00"
@errno = global i32 0
define void @fatalSys(i8* %0) {
%2 = alloca i8*
%3 = alloca [1024 x i8]
store i8* %0, i8** %2
%4 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%5 = load i8*, i8** %2
%6 = load i32, i32* @errno
%7 = call i8* @strerror(i32 %6)
%8 = call i32 @sprintf(i8* %4, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %5, i8* %7)
%9 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%10 = call i32 @printErr(i8* %9)
%11 = call i32 (...) @sendPADT()
%12 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [15 x i8] c"%.256s: %.256s\00"
@errno = global i32 0
define void @fatalSys(i8* %0) {
%2 = alloca [1024 x i8]
%3 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%4 = load i32, i32* @errno
%5 = tail call i8* @strerror(i32 %4)
%6 = call i32 @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %5)
%7 = call i32 @printErr(i8* %3)
%8 = call i32 (...) @sendPADT()
%9 = call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
int stat(char const *, struct stat *);
int file_exist(const char *path) {
  struct stat finfo;
  if (stat(path, &finfo) == -1) {
    return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<file_exist>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <stat@plt>
cmp    $0xffffffff,%eax
jne    113e <file_exist+0x2e>
movl   $0x0,-0x4(%rbp)
jmp    1145 <file_exist+0x35>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_exist>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
xor    %ecx,%ecx
cmp    $0xffffffff,%eax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @file_exist(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca %struct.stat
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i32 @stat(i8* %5, %struct.stat* %4)
%7 = icmp eq i32 %6, -1
br i1 %7, label %8, label %9
8: ; preds = %1
store i32 0, i32* %2
br label %10
9: ; preds = %1
store i32 1, i32* %2
br label %10
10: ; preds = %9, %8
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @file_exist(i8* nocapture %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i32 @stat(i8* %0, %struct.stat* %2)
%5 = icmp ne i32 %4, -1
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_labels() {
  printf("  Rekord | Nr linii |     Typ | Nr boczny | Nazwisko i imie "
         "motorniczego\n");
}


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

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

LLVM IR (-O0):
@.str = [74 x i8] c" Rekord | Nr linii | Typ | Nr boczny | Nazwisko i imie motorniczego\0A\00"
define void @print_labels() {
%1 = call i32 @printf(i8* getelementptr inbounds ([74 x i8], [74 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [73 x i8] c" Rekord | Nr linii | Typ | Nr boczny | Nazwisko i imie motorniczego\00"
define void @print_labels() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([73 x i8], [73 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ s;

/* Variables and functions */
int /*<<< orphan*/ strncpy(char *, char *, int);
void clear(char *s) { strncpy(s, "", sizeof(s)); }


x86 assembly (clang, -O0):
<clear>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
mov    $0x8,%edx
call   1030 <strncpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear>:
lea    0xee9(%rip),%rsi
mov    $0x8,%edx
jmp    1030 <strncpy@plt>

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define void @clear(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @strncpy(i8* %3, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i32 8)
ret void
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define void @clear(i8* %0) {
%2 = tail call i32 @strncpy(i8* %0, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i32 8)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memmove(char *, char *, int);
int recurse(int num, char *buff) {
  char local[512];
  if (buff)
    memmove(local, buff, 512);
  if (num == 0)
    return 0;
  else
    return recurse(num - 1, local);
}


x86 assembly (clang, -O0):
<recurse>:
push   %rbp
mov    %rsp,%rbp
sub    $0x210,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1152 <recurse+0x32>
lea    -0x210(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x200,%edx
call   1040 <memmove@plt>
cmpl   $0x0,-0x8(%rbp)
jne    1168 <recurse+0x48>
movl   $0x0,-0x4(%rbp)
jmp    117d <recurse+0x5d>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
lea    -0x210(%rbp),%rsi
call   1030 <recurse@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x210,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<recurse>:
push   %rbx
sub    $0x200,%rsp
mov    %edi,%ebx
test   %rsi,%rsi
je     113c <recurse+0x1c>
mov    %rsp,%rdi
mov    $0x200,%edx
call   1040 <memmove@plt>
test   %ebx,%ebx
je     114d <recurse+0x2d>
add    $0xffffffff,%ebx
mov    %rsp,%rsi
mov    %ebx,%edi
call   1030 <recurse@plt>
xor    %eax,%eax
add    $0x200,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @recurse(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8*
%6 = alloca [512 x i8]
store i32 %0, i32* %4
store i8* %1, i8** %5
%7 = load i8*, i8** %5
%8 = icmp ne i8* %7, null
br i1 %8, label %9, label %13
9: ; preds = %2
%10 = getelementptr inbounds [512 x i8], [512 x i8]* %6, i64 0, i64 0
%11 = load i8*, i8** %5
%12 = call i32 @memmove(i8* %10, i8* %11, i32 512)
br label %13
13: ; preds = %9, %2
%14 = load i32, i32* %4
%15 = icmp eq i32 %14, 0
br i1 %15, label %16, label %17
16: ; preds = %13
store i32 0, i32* %3
br label %22
17: ; preds = %13
%18 = load i32, i32* %4
%19 = sub nsw i32 %18, 1
%20 = getelementptr inbounds [512 x i8], [512 x i8]* %6, i64 0, i64 0
%21 = call i32 @recurse(i32 %19, i8* %20)
store i32 %21, i32* %3
br label %22
22: ; preds = %17, %16
%23 = load i32, i32* %3
ret i32 %23
}

LLVM IR (-O2):
define i32 @recurse(i32 %0, i8* %1) {
%3 = alloca [512 x i8]
%4 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 0
%5 = icmp eq i8* %1, null
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = call i32 @memmove(i8* %4, i8* %1, i32 512)
br label %8
8: ; preds = %6, %2
%9 = icmp eq i32 %0, 0
br i1 %9, label %13, label %10
10: ; preds = %8
%11 = add nsw i32 %0, -1
%12 = call i32 @recurse(i32 %11, i8* %4)
br label %13
13: ; preds = %8, %10
ret i32 0
}
int do_889() { return 889; }


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

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

LLVM IR (-O0):
define i32 @do_889() {
ret i32 889
}

LLVM IR (-O2):
define i32 @do_889() {
ret i32 889
}
/* Variables and functions */
int /*<<< orphan*/ japi_add(int, int);
void j_add(int arg0, int arg1) { japi_add(arg0, arg1); }


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

x86 assembly (clang, -O2):
<j_add>:
jmp    1030 <japi_add@plt>

LLVM IR (-O0):
define void @j_add(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 @japi_add(i32 %5, i32 %6)
ret void
}

LLVM IR (-O2):
define void @j_add(i32 %0, i32 %1) {
%3 = tail call i32 @japi_add(i32 %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
void *malloc(size_t);
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, size_t);
void *zalloc(size_t size) {
  void *ret;
  size_t oddball;
  oddball = (size % sizeof(void *));
  if (oddball) {
    size -= oddball;
    size += sizeof(void *);
  }
  ret = malloc(size);
  if (!ret)
    assert(0);
  memset(ret, 0, size);
  return ret;
}


x86 assembly (clang, -O0):
<zalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
and    $0x7,%rax
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     116e <zalloc+0x3e>
mov    -0x18(%rbp),%rcx
mov    -0x8(%rbp),%rax
sub    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    118d <zalloc+0x5d>
xor    %edi,%edi
call   1040 <assert@plt>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zalloc>:
push   %r14
push   %rbx
push   %rax
lea    0x8(%rdi),%rbx
and    $0xfffffffffffffff8,%rbx
test   $0x7,%dil
cmove  %rdi,%rbx
mov    %rbx,%rdi
call   1050 <malloc@plt>
mov    %rax,%r14
test   %rax,%rax
jne    115b <zalloc+0x2b>
xor    %edi,%edi
call   1040 <assert@plt>
mov    %r14,%rdi
xor    %esi,%esi
mov    %rbx,%rdx
call   1030 <memset@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @zalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
%4 = alloca i64
store i64 %0, i64* %2
%5 = load i64, i64* %2
%6 = urem i64 %5, 8
store i64 %6, i64* %4
%7 = load i64, i64* %4
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %15
9: ; preds = %1
%10 = load i64, i64* %4
%11 = load i64, i64* %2
%12 = sub i64 %11, %10
store i64 %12, i64* %2
%13 = load i64, i64* %2
%14 = add i64 %13, 8
store i64 %14, i64* %2
br label %15
15: ; preds = %9, %1
%16 = load i64, i64* %2
%17 = call i8* @malloc(i64 %16)
store i8* %17, i8** %3
%18 = load i8*, i8** %3
%19 = icmp ne i8* %18, null
br i1 %19, label %22, label %20
20: ; preds = %15
%21 = call i32 @assert(i32 0)
br label %22
22: ; preds = %20, %15
%23 = load i8*, i8** %3
%24 = load i64, i64* %2
%25 = call i32 @memset(i8* %23, i32 0, i64 %24)
%26 = load i8*, i8** %3
ret i8* %26
}

LLVM IR (-O2):
define i8* @zalloc(i64 %0) {
%2 = and i64 %0, 7
%3 = icmp eq i64 %2, 0
%4 = add i64 %0, 8
%5 = and i64 %4, -8
%6 = select i1 %3, i64 %0, i64 %5
%7 = tail call i8* @malloc(i64 %6)
%8 = icmp eq i8* %7, null
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = tail call i32 @assert(i32 0)
br label %11
11: ; preds = %9, %1
%12 = tail call i32 @memset(i8* %7, i32 0, i64 %6)
ret i8* %7
}