xunge/DecIR huggingface dataset:
float getAvg(float prev_avg, int x, int n) {
  return (((prev_avg * n) + x) / (n + 1));
}


x86 assembly (clang, -O0):
<getAvg>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
cvtsi2ssl -0xc(%rbp),%xmm2
cvtsi2ssl -0x8(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
mov    -0xc(%rbp),%eax
add    $0x1,%eax
cvtsi2ss %eax,%xmm1
divss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<getAvg>:
cvtsi2ss %esi,%xmm1
cvtsi2ss %edi,%xmm2
mulss  %xmm1,%xmm0
addss  %xmm2,%xmm0
add    $0x1,%esi
xorps  %xmm1,%xmm1
cvtsi2ss %esi,%xmm1
divss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @getAvg(float %0, i32 %1, i32 %2) {
%4 = alloca float
%5 = alloca i32
%6 = alloca i32
store float %0, float* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load float, float* %4
%8 = load i32, i32* %6
%9 = sitofp i32 %8 to float
%10 = load i32, i32* %5
%11 = sitofp i32 %10 to float
%12 = call float @llvm.fmuladd.f32(float %7, float %9, float %11)
%13 = load i32, i32* %6
%14 = add nsw i32 %13, 1
%15 = sitofp i32 %14 to float
%16 = fdiv float %12, %15
ret float %16
}

LLVM IR (-O2):
define float @getAvg(float %0, i32 %1, i32 %2) {
%4 = sitofp i32 %2 to float
%5 = sitofp i32 %1 to float
%6 = tail call float @llvm.fmuladd.f32(float %0, float %4, float %5)
%7 = add nsw i32 %2, 1
%8 = sitofp i32 %7 to float
%9 = fdiv float %6, %8
ret float %9
}
int ipc_log_context_destroy(void *ctxt) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @ipc_log_context_destroy(i8* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ memset(double *, int /*<<< orphan*/, int);
void nil_dcub(int nx, int ny, int nz, double ***p) {
  memset(**p, 0, sizeof(double) * nx * ny * nz);
}


x86 assembly (clang, -O0):
<nil_dcub>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%rdi
movslq -0x4(%rbp),%rax
shl    $0x3,%rax
movslq -0x8(%rbp),%rcx
imul   %rcx,%rax
movslq -0xc(%rbp),%rcx
imul   %rcx,%rax
mov    %eax,%edx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nil_dcub>:
mov    (%rcx),%rax
mov    (%rax),%rax
imul   %esi,%edi
imul   %edi,%edx
shl    $0x3,%edx
mov    %rax,%rdi
xor    %esi,%esi
jmp    1030 <memset@plt>

LLVM IR (-O0):
define void @nil_dcub(i32 %0, i32 %1, i32 %2, double*** %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca double***
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store double*** %3, double**** %8
%9 = load double***, double**** %8
%10 = load double**, double*** %9
%11 = load double*, double** %10
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = mul i64 8, %13
%15 = load i32, i32* %6
%16 = sext i32 %15 to i64
%17 = mul i64 %14, %16
%18 = load i32, i32* %7
%19 = sext i32 %18 to i64
%20 = mul i64 %17, %19
%21 = trunc i64 %20 to i32
%22 = call i32 @memset(double* %11, i32 0, i32 %21)
ret void
}

LLVM IR (-O2):
define void @nil_dcub(i32 %0, i32 %1, i32 %2, double*** nocapture %3) {
%5 = load double**, double*** %3
%6 = load double*, double** %5
%7 = shl i32 %0, 3
%8 = mul i32 %7, %1
%9 = mul i32 %8, %2
%10 = tail call i32 @memset(double* %6, i32 0, i32 %9)
ret void
}
/* Type definitions */
typedef int ssize_t;

/* Variables and functions */
int /*<<< orphan*/ a_strncpy(char *, int, char const *, int);
scalar_t__ xmalloc(int);
char *a_strndup(const char *src, ssize_t l) {
  char *_tmpStr = ((char *)xmalloc(sizeof(char) * (l + 1)));
  if (_tmpStr) {
    a_strncpy(_tmpStr, l + 1, src, l);
    _tmpStr[l] = 0;
  }
  return _tmpStr;
}


x86 assembly (clang, -O0):
<a_strndup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
cltq
shl    $0x0,%rax
mov    %eax,%edi
call   1040 <xmalloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1173 <a_strndup+0x53>
mov    -0x18(%rbp),%rdi
mov    -0xc(%rbp),%esi
add    $0x1,%esi
mov    -0x8(%rbp),%rdx
mov    -0xc(%rbp),%ecx
call   1030 <a_strncpy@plt>
mov    -0x18(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<a_strndup>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %esi,%r14d
mov    %rdi,%r15
lea    0x1(%r14),%ebp
mov    %ebp,%edi
call   1040 <xmalloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1157 <a_strndup+0x37>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %r15,%rdx
mov    %r14d,%ecx
call   1030 <a_strncpy@plt>
movslq %r14d,%rax
movb   $0x0,(%rbx,%rax,1)
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i8* @a_strndup(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = add nsw i32 %6, 1
%8 = sext i32 %7 to i64
%9 = mul i64 1, %8
%10 = trunc i64 %9 to i32
%11 = call i64 @xmalloc(i32 %10)
%12 = inttoptr i64 %11 to i8*
store i8* %12, i8** %5
%13 = load i8*, i8** %5
%14 = icmp ne i8* %13, null
br i1 %14, label %15, label %26
15: ; preds = %2
%16 = load i8*, i8** %5
%17 = load i32, i32* %4
%18 = add nsw i32 %17, 1
%19 = load i8*, i8** %3
%20 = load i32, i32* %4
%21 = call i32 @a_strncpy(i8* %16, i32 %18, i8* %19, i32 %20)
%22 = load i8*, i8** %5
%23 = load i32, i32* %4
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds i8, i8* %22, i64 %24
store i8 0, i8* %25
br label %26
26: ; preds = %15, %2
%27 = load i8*, i8** %5
ret i8* %27
}

LLVM IR (-O2):
define i8* @a_strndup(i8* %0, i32 %1) {
%3 = add nsw i32 %1, 1
%4 = tail call i64 @xmalloc(i32 %3)
%5 = inttoptr i64 %4 to i8*
%6 = icmp eq i64 %4, 0
br i1 %6, label %11, label %7
7: ; preds = %2
%8 = tail call i32 @a_strncpy(i8* %5, i32 %3, i8* %0, i32 %1)
%9 = sext i32 %1 to i64
%10 = getelementptr inbounds i8, i8* %5, i64 %9
store i8 0, i8* %10
br label %11
11: ; preds = %7, %2
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ EA_AY_DI_8();
int /*<<< orphan*/ m68ki_write_8(int /*<<< orphan*/, int /*<<< orphan*/);
void m68k_op_sf_8_di(void) { m68ki_write_8(EA_AY_DI_8(), 0); }


x86 assembly (clang, -O0):
<m68k_op_sf_8_di>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <EA_AY_DI_8@plt>
mov    %eax,%edi
xor    %esi,%esi
call   1040 <m68ki_write_8@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<m68k_op_sf_8_di>:
push   %rax
xor    %eax,%eax
call   1030 <EA_AY_DI_8@plt>
mov    %eax,%edi
xor    %esi,%esi
pop    %rax
jmp    1040 <m68ki_write_8@plt>

LLVM IR (-O0):
define void @m68k_op_sf_8_di() {
%1 = call i32 (...) @EA_AY_DI_8()
%2 = call i32 @m68ki_write_8(i32 %1, i32 0)
ret void
}

LLVM IR (-O2):
define void @m68k_op_sf_8_di() {
%1 = tail call i32 (...) @EA_AY_DI_8()
%2 = tail call i32 @m68ki_write_8(i32 %1, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isupper(int);
void t_isupper_0x33() {
  Assert_real((isupper(51) == 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_isupper.c",
              260, ("isupper should be 0 for 3"));
}


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

x86 assembly (clang, -O2):
<t_isupper_0x33>:
push   %rax
mov    $0x33,%edi
call   1030 <isupper@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x104,%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_isupper.c\00"
@.str.1 = [26 x i8] c"isupper should be 0 for 3\00"
define void @t_isupper_0x33() {
%1 = call i64 @isupper(i32 51)
%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 260, i8* getelementptr inbounds ([26 x i8], [26 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_isupper.c\00"
@.str.1 = [26 x i8] c"isupper should be 0 for 3\00"
define void @t_isupper_0x33() {
%1 = tail call i64 @isupper(i32 51)
%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 260, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalpha(int);
void t_isalpha_0xc8() {
  Assert_real((isalpha(200) == 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_isalpha.c",
              1005, ("isalpha should be 0 for 0xc8"));
}


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

x86 assembly (clang, -O2):
<t_isalpha_0xc8>:
push   %rax
mov    $0xc8,%edi
call   1030 <isalpha@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x3ed,%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_isalpha.c\00"
@.str.1 = [29 x i8] c"isalpha should be 0 for 0xc8\00"
define void @t_isalpha_0xc8() {
%1 = call i64 @isalpha(i32 200)
%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 1005, 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_isalpha.c\00"
@.str.1 = [29 x i8] c"isalpha should be 0 for 0xc8\00"
define void @t_isalpha_0xc8() {
%1 = tail call i64 @isalpha(i32 200)
%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 1005, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int main(int argv, char **argc) { return -1; }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 -1
}
/* Variables and functions */
int exp(double);
double sigmoid_wrapper(double *arg_list) {
  return (65534 /
          (1 + exp(-(((double)(arg_list[0])) * arg_list[1]) / 32767) - 32767));
}


x86 assembly (clang, -O0):
<sigmoid_wrapper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
mulsd  0x8(%rax),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  0xeb4(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1030 <exp@plt>
mov    %eax,%ecx
add    $0x1,%ecx
sub    $0x7fff,%ecx
mov    $0xfffe,%eax
cltd
idiv   %ecx
cvtsi2sd %eax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sigmoid_wrapper>:
push   %rax
movsd  0x8(%rdi),%xmm0
mulsd  (%rdi),%xmm0
divsd  0xede(%rip),%xmm0
call   1030 <exp@plt>
mov    %eax,%ecx
add    $0xffff8002,%ecx
mov    $0xfffe,%eax
xor    %edx,%edx
idiv   %ecx
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @sigmoid_wrapper(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load double*, double** %2
%4 = getelementptr inbounds double, double* %3, i64 0
%5 = load double, double* %4
%6 = load double*, double** %2
%7 = getelementptr inbounds double, double* %6, i64 1
%8 = load double, double* %7
%9 = fmul double %5, %8
%10 = fneg double %9
%11 = fdiv double %10, 3.276700e+04
%12 = call i32 @exp(double %11)
%13 = add nsw i32 1, %12
%14 = sub nsw i32 %13, 32767
%15 = sdiv i32 65534, %14
%16 = sitofp i32 %15 to double
ret double %16
}

LLVM IR (-O2):
define double @sigmoid_wrapper(double* nocapture %0) {
%2 = load double, double* %0
%3 = getelementptr inbounds double, double* %0, i64 1
%4 = load double, double* %3
%5 = fneg double %2
%6 = fmul double %4, %5
%7 = fdiv double %6, 3.276700e+04
%8 = tail call i32 @exp(double %7)
%9 = add nsw i32 %8, -32766
%10 = sdiv i32 65534, %9
%11 = sitofp i32 %10 to double
ret double %11
}
/* Type definitions */
struct mdoc_node {
  int dummy;
};
struct mdoc_meta {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ font_push(char);
int pre_em(const struct mdoc_meta *meta, const struct mdoc_node *n) {
  font_push('I');
  return (1);
}


x86 assembly (clang, -O0):
<pre_em>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x49,%edi
call   1030 <font_push@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pre_em>:
push   %rax
mov    $0x49,%edi
call   1030 <font_push@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.mdoc_meta = type { i32 }
%struct.mdoc_node = type { i32 }
define i32 @pre_em(%struct.mdoc_meta* %0, %struct.mdoc_node* %1) {
%3 = alloca %struct.mdoc_meta*
%4 = alloca %struct.mdoc_node*
store %struct.mdoc_meta* %0, %struct.mdoc_meta** %3
store %struct.mdoc_node* %1, %struct.mdoc_node** %4
%5 = call i32 @font_push(i8 signext 73)
ret i32 1
}

LLVM IR (-O2):
%struct.mdoc_meta = type { i32 }
%struct.mdoc_node = type { i32 }
define i32 @pre_em(%struct.mdoc_meta* nocapture readnone %0, %struct.mdoc_node* nocapture readnone %1) {
%3 = tail call i32 @font_push(i8 signext 73)
ret i32 1
}
void jump_label_lock(void) {}


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

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

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

LLVM IR (-O2):
define void @jump_label_lock() {
ret void
}
void foo_2_2_2_2_1_1_1_1_2() {}


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

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

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

LLVM IR (-O2):
define void @foo_2_2_2_2_1_1_1_1_2() {
ret void
}
/* Variables and functions */
int clip_f15(int /*<<< orphan*/);
int /*<<< orphan*/ lrint(double);
int /*<<< orphan*/ printf(char *, double);
void printval(double val, int fixed) {
  if (fixed)
    printf(" "
           "%6d"
           ",",
           clip_f15(lrint(val * (double)(1 << 15))));
  else
    printf(" "
           "%.18e"
           ",",
           val);
}


x86 assembly (clang, -O0):
<printval>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1178 <printval+0x48>
movsd  0xeae(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
call   1050 <lrint@plt>
mov    %eax,%edi
call   1040 <clip_f15@plt>
cvtsi2sd %eax,%xmm0
lea    0xe9a(%rip),%rdi
call   1030 <printf@plt>
jmp    1189 <printval+0x59>
movsd  -0x8(%rbp),%xmm0
lea    0xe8a(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printval>:
test   %edi,%edi
je     115d <printval+0x2d>
push   %rax
mulsd  0xec3(%rip),%xmm0
call   1050 <lrint@plt>
mov    %eax,%edi
call   1040 <clip_f15@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
lea    0xeb1(%rip),%rdi
pop    %rax
jmp    1030 <printf@plt>
lea    0xeaa(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [6 x i8] c" %6d,\00"
@.str.1 = [8 x i8] c" %.18e,\00"
define void @printval(double %0, i32 %1) {
%3 = alloca double
%4 = alloca i32
store double %0, double* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %14
7: ; preds = %2
%8 = load double, double* %3
%9 = fmul double %8, 3.276800e+04
%10 = call i32 @lrint(double %9)
%11 = call i32 @clip_f15(i32 %10)
%12 = sitofp i32 %11 to double
%13 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), double %12)
br label %17
14: ; preds = %2
%15 = load double, double* %3
%16 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), double %15)
br label %17
17: ; preds = %14, %7
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c" %6d,\00"
@.str.1 = [8 x i8] c" %.18e,\00"
define void @printval(double %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %10, label %4
4: ; preds = %2
%5 = fmul double %0, 3.276800e+04
%6 = tail call i32 @lrint(double %5)
%7 = tail call i32 @clip_f15(i32 %6)
%8 = sitofp i32 %7 to double
%9 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), double %8)
br label %12
10: ; preds = %2
%11 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), double %0)
br label %12
12: ; preds = %10, %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printMessage();
int main(void) {
  int i;
  for (i = 1; i <= 5; ++i)
    printMessage();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x5,-0x8(%rbp)
jg     1145 <main+0x35>
mov    $0x0,%al
call   1030 <printMessage@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <printMessage@plt>
xor    %eax,%eax
call   1030 <printMessage@plt>
xor    %eax,%eax
call   1030 <printMessage@plt>
xor    %eax,%eax
call   1030 <printMessage@plt>
xor    %eax,%eax
call   1030 <printMessage@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 1, i32* %2
br label %3
3: ; preds = %8, %0
%4 = load i32, i32* %2
%5 = icmp sle i32 %4, 5
br i1 %5, label %6, label %11
6: ; preds = %3
%7 = call i32 (...) @printMessage()
br label %8
8: ; preds = %6
%9 = load i32, i32* %2
%10 = add nsw i32 %9, 1
store i32 %10, i32* %2
br label %3
11: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @printMessage()
%2 = tail call i32 (...) @printMessage()
%3 = tail call i32 (...) @printMessage()
%4 = tail call i32 (...) @printMessage()
%5 = tail call i32 (...) @printMessage()
ret i32 0
}
char plugin_format() { return 'B'; }


x86 assembly (clang, -O0):
<plugin_format>:
push   %rbp
mov    %rsp,%rbp
mov    $0x42,%al
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<plugin_format>:
mov    $0x42,%al
ret

LLVM IR (-O0):
define signext i8 @plugin_format() {
ret i8 66
}

LLVM IR (-O2):
define signext i8 @plugin_format() {
ret i8 66
}
double max(double first, double second) {
  if (first > second) {
    return first;
  } else {
    return second;
  }
}


x86 assembly (clang, -O0):
<max>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
ucomisd -0x18(%rbp),%xmm0
jbe    112d <max+0x2d>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1137 <max+0x37>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

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

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

LLVM IR (-O2):
define double @max(double %0, double %1) {
%3 = fcmp ogt double %0, %1
%4 = select i1 %3, double %0, double %1
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ basic_uart_tx_byte(char const);
void basic_uart_tx_str(const char *s) {
  for (int i = 0; s[i] != 0; ++i)
    basic_uart_tx_byte(s[i]);
}


x86 assembly (clang, -O0):
<basic_uart_tx_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1157 <basic_uart_tx_str+0x47>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <basic_uart_tx_byte@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <basic_uart_tx_str+0x13>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @basic_uart_tx_str(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %5, %1
ret void
5: ; preds = %1, %5
%6 = phi i64 [ %9, %5 ], [ 0, %1 ]
%7 = phi i8 [ %11, %5 ], [ %2, %1 ]
%8 = tail call i32 @basic_uart_tx_byte(i8 signext %7)
%9 = add nuw i64 %6, 1
%10 = getelementptr inbounds i8, i8* %0, i64 %9
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %4, label %5
}
int is_allhigh_qual(int *qual, int s, int e) {
  int i;
  for (i = s; i <= e; i++) {
    if (qual[i] == 0)
      return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<is_allhigh_qual>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x18(%rbp),%eax
jg     1151 <is_allhigh_qual+0x51>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
jne    113e <is_allhigh_qual+0x3e>
movl   $0x0,-0x4(%rbp)
jmp    1158 <is_allhigh_qual+0x58>
jmp    1143 <is_allhigh_qual+0x43>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1114 <is_allhigh_qual+0x14>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_allhigh_qual>:
mov    $0x1,%eax
cmp    %edx,%esi
jg     112e <is_allhigh_qual+0x2e>
movslq %esi,%rcx
lea    (%rdi,%rcx,4),%rcx
sub    %esi,%edx
add    $0x1,%edx
xor    %esi,%esi
nopw   0x0(%rax,%rax,1)
cmpl   $0x0,(%rcx,%rsi,4)
je     112f <is_allhigh_qual+0x2f>
add    $0x1,%rsi
cmp    %esi,%edx
jne    1120 <is_allhigh_qual+0x20>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @is_allhigh_qual(i32* nocapture %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %1, %2
br i1 %4, label %17, label %5
5: ; preds = %3
%6 = sext i32 %1 to i64
%7 = add i32 %2, 1
br label %12
8: ; preds = %12
%9 = add nsw i64 %13, 1
%10 = trunc i64 %9 to i32
%11 = icmp eq i32 %7, %10
br i1 %11, label %17, label %12
12: ; preds = %5, %8
%13 = phi i64 [ %6, %5 ], [ %9, %8 ]
%14 = getelementptr inbounds i32, i32* %0, i64 %13
%15 = load i32, i32* %14
%16 = icmp eq i32 %15, 0
br i1 %16, label %17, label %8
17: ; preds = %12, %8, %3
%18 = phi i32 [ 1, %3 ], [ 1, %8 ], [ 0, %12 ]
ret i32 %18
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
double calculate(char **, int);
int main(int argc, char *argv[]) {
  double rt = calculate(++argv, --argc);
  assert(rt == 14);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
add    $0x8,%rdi
mov    %rdi,-0x10(%rbp)
mov    -0x4(%rbp),%esi
add    $0xffffffff,%esi
mov    %esi,-0x4(%rbp)
call   1030 <calculate@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  0xea5(%rip),%xmm1
ucomisd %xmm1,%xmm0
sete   %al
setnp  %cl
and    %cl,%al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0x8(%rsi),%rax
lea    -0x1(%rdi),%esi
mov    %rax,%rdi
call   1030 <calculate@plt>
cmpeqsd 0xec7(%rip),%xmm0
movq   %xmm0,%rdi
and    $0x1,%edi
call   1040 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca double
store i32 %0, i32* %3
store i8** %1, i8*** %4
%6 = load i8**, i8*** %4
%7 = getelementptr inbounds i8*, i8** %6, i32 1
store i8** %7, i8*** %4
%8 = load i32, i32* %3
%9 = add nsw i32 %8, -1
store i32 %9, i32* %3
%10 = call double @calculate(i8** %7, i32 %9)
store double %10, double* %5
%11 = load double, double* %5
%12 = fcmp oeq double %11, 1.400000e+01
%13 = zext i1 %12 to i32
%14 = call i32 @assert(i32 %13)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = add nsw i32 %0, -1
%5 = tail call double @calculate(i8** %3, i32 %4)
%6 = fcmp oeq double %5, 1.400000e+01
%7 = zext i1 %6 to i32
%8 = tail call i32 @assert(i32 %7)
ret i32 0
}
void HashDjb2() {}


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

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

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

LLVM IR (-O2):
define void @HashDjb2() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ bool_t;

/* Variables and functions */
int /*<<< orphan*/ TRUE;
bool_t xdr_void(void) { return TRUE; }


x86 assembly (clang, -O0):
<xdr_void>:
push   %rbp
mov    %rsp,%rbp
mov    0x2edd(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xdr_void>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
@TRUE = global i32 0
define i32 @xdr_void() {
%1 = load i32, i32* @TRUE
ret i32 %1
}

LLVM IR (-O2):
@TRUE = global i32 0
define i32 @xdr_void() {
%1 = load i32, i32* @TRUE
ret i32 %1
}
/* Type definitions */
typedef scalar_t__ uint8_t;

/* Variables and functions */
long __VERIFIER_nondet_long() {
  long initialValue;
  int byteOffset = 0;
  uint8_t *initialValueAsByte = (uint8_t *)&initialValue;
  for (; byteOffset < sizeof(long); ++byteOffset) {
    initialValueAsByte[byteOffset] = 0;
  }
  return initialValue;
}


x86 assembly (clang, -O0):
<__VERIFIER_nondet_long>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0xc(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
movslq -0xc(%rbp),%rax
cmp    $0x8,%rax
jae    113f <__VERIFIER_nondet_long+0x3f>
mov    -0x18(%rbp),%rax
movslq -0xc(%rbp),%rcx
movq   $0x0,(%rax,%rcx,8)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1113 <__VERIFIER_nondet_long+0x13>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i64 @__VERIFIER_nondet_long() {
ret i64 0
}
void ali_cleanup() {}


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

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

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

LLVM IR (-O2):
define void @ali_cleanup() {
ret void
}
int GetNumberOfProcessors() {
  int num = 1;
  return num;
}


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

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

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

LLVM IR (-O2):
define i32 @GetNumberOfProcessors() {
ret i32 1
}
void _pending_dma_irq_sem(void) { return; }


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

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

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

LLVM IR (-O2):
define void @_pending_dma_irq_sem() {
ret void
}
void memsetup() {
  int i = 0;
  unsigned long *p = (unsigned long *)0x48000000;
  unsigned long const mem_cfg_val[] = {
      0x22011110, 0x00000700, 0x00000700, 0x00000700, 0x00000700,
      0x00000700, 0x00000700, 0x00018005, 0x00018005, 0x008C07A3,
      0x000000B1, 0x00000030, 0x00000030,
  };
  for (; i < 13; i++)
    p[i] = mem_cfg_val[i];
}


x86 assembly (clang, -O0):
<memsetup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x48000000,%eax
mov    %rax,-0x10(%rbp)
lea    -0x80(%rbp),%rdi
lea    0xeca(%rip),%rsi
mov    $0x68,%edx
call   1030 <memcpy@plt>
cmpl   $0xd,-0x4(%rbp)
jge    116d <memsetup+0x5d>
movslq -0x4(%rbp),%rax
mov    -0x80(%rbp,%rax,8),%rdx
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1140 <memsetup+0x30>
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<memsetup>:
movq   $0x22011110,0x48000000
48 10 11 01 22
movq   $0x700,0x48000008
movq   $0x700,0x48000010
movq   $0x700,0x48000018
movq   $0x700,0x48000020
movq   $0x700,0x48000028
movq   $0x700,0x48000030
movq   $0x18005,0x48000038
movq   $0x18005,0x48000040
movq   $0x8c07a3,0x48000048
movq   $0xb1,0x48000050
movq   $0x30,0x48000058
movq   $0x30,0x48000060
ret

LLVM IR (-O0):
@__const.memsetup.mem_cfg_val = [13 x i64] [i64 570495248, i64 1792, i64 1792, i64 1792, i64 1792, i64 1792, i64 1792, i64 98309, i64 98309, i64 9176995, i64 177, i64 48, i64 48]
define void @memsetup() {
%1 = alloca i32
%2 = alloca i64*
%3 = alloca [13 x i64]
store i32 0, i32* %1
store i64* inttoptr (i64 1207959552 to i64*), i64** %2
%4 = bitcast [13 x i64]* %3 to i8*
br label %5
5: ; preds = %17, %0
%6 = load i32, i32* %1
%7 = icmp slt i32 %6, 13
br i1 %7, label %8, label %20
8: ; preds = %5
%9 = load i32, i32* %1
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds [13 x i64], [13 x i64]* %3, i64 0, i64 %10
%12 = load i64, i64* %11
%13 = load i64*, i64** %2
%14 = load i32, i32* %1
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i64, i64* %13, i64 %15
store i64 %12, i64* %16
br label %17
17: ; preds = %8
%18 = load i32, i32* %1
%19 = add nsw i32 %18, 1
store i32 %19, i32* %1
br label %5
20: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @memsetup() {
store i64 570495248, i64* inttoptr (i64 1207959552 to i64*)
store i64 1792, i64* inttoptr (i64 1207959560 to i64*)
store i64 1792, i64* inttoptr (i64 1207959568 to i64*)
store i64 1792, i64* inttoptr (i64 1207959576 to i64*)
store i64 1792, i64* inttoptr (i64 1207959584 to i64*)
store i64 1792, i64* inttoptr (i64 1207959592 to i64*)
store i64 1792, i64* inttoptr (i64 1207959600 to i64*)
store i64 98309, i64* inttoptr (i64 1207959608 to i64*)
store i64 98309, i64* inttoptr (i64 1207959616 to i64*)
store i64 9176995, i64* inttoptr (i64 1207959624 to i64*)
store i64 177, i64* inttoptr (i64 1207959632 to i64*)
store i64 48, i64* inttoptr (i64 1207959640 to i64*)
store i64 48, i64* inttoptr (i64 1207959648 to i64*)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
int /*<<< orphan*/ gmtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ strftime(char *, int, char *, int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
char *mytime(char *fstr, int strsz) {
  time_t tm = time(NULL);
  strftime(fstr, strsz, "%b %d %H:%M:%S", gmtime(&tm));
  return fstr;
}


x86 assembly (clang, -O0):
<mytime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1030 <time@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
lea    -0x10(%rbp),%rdi
call   1050 <gmtime@plt>
mov    -0x20(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    %eax,%ecx
lea    0xe8e(%rip),%rdx
call   1040 <strftime@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mytime>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
xor    %edi,%edi
call   1030 <time@plt>
mov    %eax,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1050 <gmtime@plt>
lea    0xeac(%rip),%rdx
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %eax,%ecx
call   1040 <strftime@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [15 x i8] c"%b %d %H:%M:%S\00"
define i8* @mytime(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = call i32 @time(i32* null)
store i32 %6, i32* %5
%7 = load i8*, i8** %3
%8 = load i32, i32* %4
%9 = call i32 @gmtime(i32* %5)
%10 = call i32 @strftime(i8* %7, i32 %8, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
@.str = [15 x i8] c"%b %d %H:%M:%S\00"
define i8* @mytime(i8* returned %0, i32 %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = tail call i32 @time(i32* null)
store i32 %5, i32* %3
%6 = call i32 @gmtime(i32* %3)
%7 = call i32 @strftime(i8* %0, i32 %1, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %6)
ret i8* %0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int fgetc(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char const *, char *);
int check_flag(const char *path) {
  FILE *fp = fopen(path, "r");
  if (!fp)
    return 0;
  const int value = fgetc(fp);
  fclose(fp);
  return (value == '1');
}


x86 assembly (clang, -O0):
<check_flag>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xeb9(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1167 <check_flag+0x37>
movl   $0x0,-0x4(%rbp)
jmp    118b <check_flag+0x5b>
mov    -0x18(%rbp),%rdi
call   1040 <fgetc@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
cmpl   $0x31,-0x1c(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_flag>:
push   %rbp
push   %rbx
push   %rax
lea    0xec6(%rip),%rsi
call   1050 <fopen@plt>
test   %rax,%rax
je     1163 <check_flag+0x33>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <fgetc@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
cmp    $0x31,%ebp
sete   %al
jmp    1165 <check_flag+0x35>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [2 x i8] c"r\00"
define i32 @check_flag(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32*
%5 = alloca i32
store i8* %0, i8** %3
%6 = load i8*, i8** %3
%7 = call i32* @fopen(i8* %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %7, i32** %4
%8 = load i32*, i32** %4
%9 = icmp ne i32* %8, null
br i1 %9, label %11, label %10
10: ; preds = %1
store i32 0, i32* %2
br label %19
11: ; preds = %1
%12 = load i32*, i32** %4
%13 = call i32 @fgetc(i32* %12)
store i32 %13, i32* %5
%14 = load i32*, i32** %4
%15 = call i32 @fclose(i32* %14)
%16 = load i32, i32* %5
%17 = icmp eq i32 %16, 49
%18 = zext i1 %17 to i32
store i32 %18, i32* %2
br label %19
19: ; preds = %11, %10
%20 = load i32, i32* %2
ret i32 %20
}

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
define i32 @check_flag(i8* nocapture %0) {
%2 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32* %2, null
br i1 %3, label %9, label %4
4: ; preds = %1
%5 = tail call i32 @fgetc(i32* %2)
%6 = tail call i32 @fclose(i32* %2)
%7 = icmp eq i32 %5, 49
%8 = zext i1 %7 to i32
br label %9
9: ; preds = %1, %4
%10 = phi i32 [ %8, %4 ], [ 0, %1 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ fatalError(char *, int);
void *realloc(void *, int);
void *safe_realloc(void *pOld, int szNew) {
  void *pNew = realloc(pOld, szNew <= 0 ? 1 : szNew);
  if (pNew == 0)
    fatalError("unable to realloc for %d bytes", szNew);
  return pNew;
}


x86 assembly (clang, -O0):
<safe_realloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
cmpl   $0x0,-0xc(%rbp)
jg     114e <safe_realloc+0x2e>
mov    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1154 <safe_realloc+0x34>
mov    -0xc(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x24(%rbp),%esi
call   1030 <realloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    117e <safe_realloc+0x5e>
mov    -0xc(%rbp),%esi
lea    0xe87(%rip),%rdi
call   1040 <fatalError@plt>
mov    -0x18(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<safe_realloc>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
test   %esi,%esi
mov    $0x1,%esi
cmovg  %ebp,%esi
call   1030 <realloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    114a <safe_realloc+0x2a>
lea    0xebd(%rip),%rdi
mov    %ebp,%esi
call   1040 <fatalError@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [31 x i8] c"unable to realloc for %d bytes\00"
define i8* @safe_realloc(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = load i32, i32* %4
%8 = icmp sle i32 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %2
br label %12
10: ; preds = %2
%11 = load i32, i32* %4
br label %12
12: ; preds = %10, %9
%13 = phi i32 [ 1, %9 ], [ %11, %10 ]
%14 = call i8* @realloc(i8* %6, i32 %13)
store i8* %14, i8** %5
%15 = load i8*, i8** %5
%16 = icmp eq i8* %15, null
br i1 %16, label %17, label %20
17: ; preds = %12
%18 = load i32, i32* %4
%19 = call i32 @fatalError(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 %18)
br label %20
20: ; preds = %17, %12
%21 = load i8*, i8** %5
ret i8* %21
}

LLVM IR (-O2):
@.str = [31 x i8] c"unable to realloc for %d bytes\00"
define i8* @safe_realloc(i8* %0, i32 %1) {
%3 = icmp sgt i32 %1, 1
%4 = select i1 %3, i32 %1, i32 1
%5 = tail call i8* @realloc(i8* %0, i32 %4)
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = tail call i32 @fatalError(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 %1)
br label %9
9: ; preds = %7, %2
ret i8* %5
}
int clone_func(void *arg) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @clone_func(i8* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int mfspr(int);
int /*<<< orphan*/ mtspr(int, int);
void immu_disable(void) {
  mtspr(((0 << (11)) + 17), mfspr(((0 << (11)) + 17)) & ~0x00000040);
}


x86 assembly (clang, -O0):
<immu_disable>:
push   %rbp
mov    %rsp,%rbp
mov    $0x11,%edi
call   1030 <mfspr@plt>
mov    %eax,%esi
and    $0xffffffbf,%esi
mov    $0x11,%edi
call   1040 <mtspr@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<immu_disable>:
push   %rax
mov    $0x11,%edi
call   1030 <mfspr@plt>
and    $0xffffffbf,%eax
mov    $0x11,%edi
mov    %eax,%esi
pop    %rax
jmp    1040 <mtspr@plt>

LLVM IR (-O0):
define void @immu_disable() {
%1 = call i32 @mfspr(i32 17)
%2 = and i32 %1, -65
%3 = call i32 @mtspr(i32 17, i32 %2)
ret void
}

LLVM IR (-O2):
define void @immu_disable() {
%1 = tail call i32 @mfspr(i32 17)
%2 = and i32 %1, -65
%3 = tail call i32 @mtspr(i32 17, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gen_Xgraph(int /*<<< orphan*/, int /*<<< orphan*/);
void IF_yXgraph(void) { gen_Xgraph(0, 0); }


x86 assembly (clang, -O0):
<IF_yXgraph>:
push   %rbp
mov    %rsp,%rbp
xor    %esi,%esi
mov    %esi,%edi
call   1030 <gen_Xgraph@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<IF_yXgraph>:
xor    %edi,%edi
xor    %esi,%esi
jmp    1030 <gen_Xgraph@plt>

LLVM IR (-O0):
define void @IF_yXgraph() {
%1 = call i32 @gen_Xgraph(i32 0, i32 0)
ret void
}

LLVM IR (-O2):
define void @IF_yXgraph() {
%1 = tail call i32 @gen_Xgraph(i32 0, i32 0)
ret void
}
void rop3_211_1_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk3 = *D | S;
  stk2 = T & stk3;
  stk1 = S ^ stk2;
  stk1 = ~stk1;
  *D = (stk1 & (~S)) | (*D & S);
}


x86 assembly (clang, -O0):
<rop3_211_1_0>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0x9(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xd(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0xd(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xc(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0x9(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_211_1_0>:
mov    (%rdi),%al
mov    %eax,%ecx
or     %sil,%cl
and    %dl,%cl
or     %sil,%cl
not    %cl
and    %sil,%al
or     %cl,%al
mov    %al,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_211_1_0(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%10 = load i8*, i8** %4
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = load i8, i8* %5
%14 = zext i8 %13 to i32
%15 = or i32 %12, %14
%16 = trunc i32 %15 to i8
store i8 %16, i8* %9
%17 = load i8, i8* %6
%18 = zext i8 %17 to i32
%19 = load i8, i8* %9
%20 = zext i8 %19 to i32
%21 = and i32 %18, %20
%22 = trunc i32 %21 to i8
store i8 %22, i8* %8
%23 = load i8, i8* %5
%24 = zext i8 %23 to i32
%25 = load i8, i8* %8
%26 = zext i8 %25 to i32
%27 = xor i32 %24, %26
%28 = trunc i32 %27 to i8
store i8 %28, i8* %7
%29 = load i8, i8* %7
%30 = zext i8 %29 to i32
%31 = xor i32 %30, -1
%32 = trunc i32 %31 to i8
store i8 %32, i8* %7
%33 = load i8, i8* %7
%34 = zext i8 %33 to i32
%35 = load i8, i8* %5
%36 = zext i8 %35 to i32
%37 = xor i32 %36, -1
%38 = and i32 %34, %37
%39 = load i8*, i8** %4
%40 = load i8, i8* %39
%41 = zext i8 %40 to i32
%42 = load i8, i8* %5
%43 = zext i8 %42 to i32
%44 = and i32 %41, %43
%45 = or i32 %38, %44
%46 = trunc i32 %45 to i8
%47 = load i8*, i8** %4
store i8 %46, i8* %47
ret void
}

LLVM IR (-O2):
define void @rop3_211_1_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = or i8 %4, %1
%6 = and i8 %5, %2
%7 = or i8 %6, %1
%8 = xor i8 %7, -1
%9 = and i8 %4, %1
%10 = or i8 %9, %8
store i8 %10, i8* %0
ret void
}