xunge/DecIR huggingface dataset:
double ta_mixr2tvirtual(double tk, double wmix) {
  double tkv;
  double mwratio;
  mwratio = 18.016 / 28.966;
  tkv = tk * (mwratio + wmix) / (mwratio * (1.0 + wmix));
  return (tkv);
}


x86 assembly (clang, -O0):
<ta_mixr2tvirtual>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  0xef2(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
addsd  -0x10(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  -0x20(%rbp),%xmm1
movsd  0xec5(%rip),%xmm2
addsd  -0x10(%rbp),%xmm2
mulsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<ta_mixr2tvirtual>:
unpcklpd %xmm1,%xmm1
addpd  0xef4(%rip),%xmm1
shufpd $0x2,0xefb(%rip),%xmm0
mulpd  %xmm1,%xmm0
movapd %xmm0,%xmm1
unpckhpd %xmm0,%xmm1
divsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @ta_mixr2tvirtual(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %3
store double %1, double* %4
store double 0x3FE3E72EDBDA50A2, double* %6
%7 = load double, double* %3
%8 = load double, double* %6
%9 = load double, double* %4
%10 = fadd double %8, %9
%11 = fmul double %7, %10
%12 = load double, double* %6
%13 = load double, double* %4
%14 = fadd double 1.000000e+00, %13
%15 = fmul double %12, %14
%16 = fdiv double %11, %15
store double %16, double* %5
%17 = load double, double* %5
ret double %17
}

LLVM IR (-O2):
define double @ta_mixr2tvirtual(double %0, double %1) {
%3 = insertelement <2 x double> poison, double %1, i64 0
%4 = shufflevector <2 x double> %3, <2 x double> poison, <2 x i32> zeroinitializer
%5 = fadd <2 x double> %4, <double 0x3FE3E72EDBDA50A2, double 1.000000e+00>
%6 = insertelement <2 x double> <double poison, double 0x3FE3E72EDBDA50A2>, double %0, i64 0
%7 = fmul <2 x double> %5, %6
%8 = extractelement <2 x double> %7, i64 0
%9 = extractelement <2 x double> %7, i64 1
%10 = fdiv double %8, %9
ret double %10
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void *malloc(unsigned long);
void *reallocarray(void *, unsigned int, unsigned long);
void f() {
  int i;
  unsigned long j;
  i = j = 10;
  void *ptr = malloc(j);
  ptr = reallocarray(ptr, (unsigned)i, j);
  free(ptr);
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movq   $0xa,-0x10(%rbp)
movl   $0xa,-0x4(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
call   1040 <reallocarray@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
push   %rax
mov    $0xa,%edi
call   1050 <malloc@plt>
mov    $0xa,%edx
mov    %rax,%rdi
mov    $0xa,%esi
call   1040 <reallocarray@plt>
mov    %rax,%rdi
pop    %rax
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @f() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i8*
store i64 10, i64* %2
store i32 10, i32* %1
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = load i32, i32* %1
%8 = load i64, i64* %2
%9 = call i8* @reallocarray(i8* %6, i32 %7, i64 %8)
store i8* %9, i8** %3
%10 = load i8*, i8** %3
%11 = call i32 @free(i8* %10)
ret void
}

LLVM IR (-O2):
define void @f() {
%1 = tail call dereferenceable_or_null(10) i8* @malloc(i64 10)
%2 = tail call i8* @reallocarray(i8* %1, i32 10, i64 10)
%3 = tail call i32 @free(i8* %2)
ret void
}
void adc_start_sampling() {
  (*((volatile unsigned int *)(0x44e0d000 + 0x54))) = 0xfe;
}


x86 assembly (clang, -O0):
<adc_start_sampling>:
push   %rbp
mov    %rsp,%rbp
mov    $0x44e0d054,%eax
movl   $0xfe,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<adc_start_sampling>:
movl   $0xfe,0x44e0d054
ret

LLVM IR (-O0):
define void @adc_start_sampling() {
store volatile i32 254, i32* inttoptr (i64 1155584084 to i32*)
ret void
}

LLVM IR (-O2):
define void @adc_start_sampling() {
store volatile i32 254, i32* inttoptr (i64 1155584084 to i32*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ do_syscall(char *);
void GPU_UnLock(void) { do_syscall("GPU_UnLock"); }


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

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

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

LLVM IR (-O2):
@.str = [11 x i8] c"GPU_UnLock\00"
define void @GPU_UnLock() {
%1 = tail call i32 @do_syscall(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ put_unaligned_be16(int, int /*<<< orphan*/ *);
int /*<<< orphan*/ put_unaligned_be32(int, int /*<<< orphan*/ *);
int fill_element_status_data_hdr(uint8_t *p, int start, int count,
                                 uint32_t byte_count) {
  ;
  ;
  put_unaligned_be16(start, &p[0]);
  put_unaligned_be16(count, &p[2]);
  put_unaligned_be32(byte_count & 0xffffff, &p[4]);
  ;
  ;
  ;
  ;
  ;
  return 8;
}


x86 assembly (clang, -O0):
<fill_element_status_data_hdr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%rsi
call   1040 <put_unaligned_be16@plt>
mov    -0x10(%rbp),%edi
mov    -0x8(%rbp),%rsi
add    $0x8,%rsi
call   1040 <put_unaligned_be16@plt>
mov    -0x14(%rbp),%edi
and    $0xffffff,%edi
mov    -0x8(%rbp),%rsi
add    $0x10,%rsi
call   1030 <put_unaligned_be32@plt>
mov    $0x8,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fill_element_status_data_hdr>:
push   %rbp
push   %r14
push   %rbx
mov    %ecx,%ebx
mov    %edx,%r14d
mov    %rdi,%rbp
mov    %esi,%edi
mov    %rbp,%rsi
call   1040 <put_unaligned_be16@plt>
lea    0x8(%rbp),%rsi
mov    %r14d,%edi
call   1040 <put_unaligned_be16@plt>
and    $0xffffff,%ebx
add    $0x10,%rbp
mov    %ebx,%edi
mov    %rbp,%rsi
call   1030 <put_unaligned_be32@plt>
mov    $0x8,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @fill_element_status_data_hdr(i32* %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32* %0, i32** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %6
%10 = load i32*, i32** %5
%11 = getelementptr inbounds i32, i32* %10, i64 0
%12 = call i32 @put_unaligned_be16(i32 %9, i32* %11)
%13 = load i32, i32* %7
%14 = load i32*, i32** %5
%15 = getelementptr inbounds i32, i32* %14, i64 2
%16 = call i32 @put_unaligned_be16(i32 %13, i32* %15)
%17 = load i32, i32* %8
%18 = and i32 %17, 16777215
%19 = load i32*, i32** %5
%20 = getelementptr inbounds i32, i32* %19, i64 4
%21 = call i32 @put_unaligned_be32(i32 %18, i32* %20)
ret i32 8
}

LLVM IR (-O2):
define i32 @fill_element_status_data_hdr(i32* %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 @put_unaligned_be16(i32 %1, i32* %0)
%6 = getelementptr inbounds i32, i32* %0, i64 2
%7 = tail call i32 @put_unaligned_be16(i32 %2, i32* %6)
%8 = and i32 %3, 16777215
%9 = getelementptr inbounds i32, i32* %0, i64 4
%10 = tail call i32 @put_unaligned_be32(i32 %8, i32* %9)
ret i32 8
}
int f(a)
int a;
{ return a; }


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

x86 assembly (clang, -O2):
<f>:
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @f(i32 returned %0) {
ret i32 %0
}
void MI2_log_sys_error1(char *p1) { MI2_log_sys_error1(p1); }


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

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

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

LLVM IR (-O2):
define void @MI2_log_sys_error1(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
br label %2
}
/* Variables and functions */
int /*<<< orphan*/ callrts(char *);
zxor() { callrts("ccxor"); }


x86 assembly (clang, -O0):
<zxor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <callrts@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [6 x i8] c"ccxor\00"
define i32 @zxor() {
%1 = tail call i32 @callrts(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
_Bool sorted(int a[], int len, int s) {
  int i;
  for (i = s; i < len - 1; i++) {
    if (a[i] > a[i + 1])
      return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<sorted>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    1162 <sorted+0x62>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    -0x10(%rbp),%rcx
mov    -0x1c(%rbp),%edx
add    $0x1,%edx
movslq %edx,%rdx
cmp    (%rcx,%rdx,4),%eax
jle    114f <sorted+0x4f>
movb   $0x0,-0x1(%rbp)
jmp    1166 <sorted+0x66>
jmp    1154 <sorted+0x54>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1114 <sorted+0x14>
movb   $0x1,-0x1(%rbp)
mov    -0x1(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sorted>:
add    $0xffffffff,%esi
movslq %edx,%rdx
cmp    %esi,%edx
mov    %esi,%eax
cmovg  %edx,%eax
movslq %eax,%r8
mov    %rdx,%rcx
cmp    %rdx,%r8
je     1125 <sorted+0x25>
mov    (%rdi,%rcx,4),%eax
lea    0x1(%rcx),%rdx
cmp    0x4(%rdi,%rcx,4),%eax
jle    1110 <sorted+0x10>
movslq %esi,%rax
cmp    %rax,%rcx
setge  %al
ret

LLVM IR (-O0):
define zeroext i1 @sorted(i32* %0, i32 %1, i32 %2) {
%4 = alloca i1
%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* %7
store i32 %9, i32* %8
br label %10
10: ; preds = %30, %3
%11 = load i32, i32* %8
%12 = load i32, i32* %6
%13 = sub nsw i32 %12, 1
%14 = icmp slt i32 %11, %13
br i1 %14, label %15, label %33
15: ; preds = %10
%16 = load i32*, i32** %5
%17 = load i32, i32* %8
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i32, i32* %16, i64 %18
%20 = load i32, i32* %19
%21 = load i32*, i32** %5
%22 = load i32, i32* %8
%23 = add nsw i32 %22, 1
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds i32, i32* %21, i64 %24
%26 = load i32, i32* %25
%27 = icmp sgt i32 %20, %26
br i1 %27, label %28, label %29
28: ; preds = %15
store i1 false, i1* %4
br label %34
29: ; preds = %15
br label %30
30: ; preds = %29
%31 = load i32, i32* %8
%32 = add nsw i32 %31, 1
store i32 %32, i32* %8
br label %10
33: ; preds = %10
store i1 true, i1* %4
br label %34
34: ; preds = %33, %28
%35 = load i1, i1* %4
ret i1 %35
}

LLVM IR (-O2):
define zeroext i1 @sorted(i32* nocapture %0, i32 %1, i32 %2) {
%4 = add i32 %1, -1
%5 = sext i32 %2 to i64
%6 = call i32 @llvm.smax.i32(i32 %2, i32 %4)
%7 = sext i32 %6 to i64
br label %8
8: ; preds = %11, %3
%9 = phi i64 [ %14, %11 ], [ %5, %3 ]
%10 = icmp eq i64 %9, %7
br i1 %10, label %18, label %11
11: ; preds = %8
%12 = getelementptr inbounds i32, i32* %0, i64 %9
%13 = load i32, i32* %12
%14 = add nsw i64 %9, 1
%15 = getelementptr inbounds i32, i32* %0, i64 %14
%16 = load i32, i32* %15
%17 = icmp sgt i32 %13, %16
br i1 %17, label %18, label %8
18: ; preds = %8, %11
%19 = sext i32 %4 to i64
%20 = icmp sge i64 %9, %19
ret i1 %20
}
void f32(a33, a34) int a33;
enum file *a34;
{}


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

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

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

LLVM IR (-O2):
define void @f32(i32 %0, i32* nocapture %1) {
ret void
}
/* Variables and functions */
void *__coverity_alloc__(int);
int /*<<< orphan*/ __coverity_mark_as_afm_allocated__(void *, char *);
void *H5Acreate2(void *loc_id, const char *attr_name, void *type_id,
                 void *space_id, void *acpl_id, void *aapl_id) {
  void *id = __coverity_alloc__(10);
  __coverity_mark_as_afm_allocated__(id, "H5Aclose");
  return id;
}


x86 assembly (clang, -O0):
<H5Acreate2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    $0xa,%edi
call   1040 <__coverity_alloc__@plt>
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rdi
lea    0xea7(%rip),%rsi
call   1030 <__coverity_mark_as_afm_allocated__@plt>
mov    -0x38(%rbp),%rax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<H5Acreate2>:
push   %rbx
mov    $0xa,%edi
call   1040 <__coverity_alloc__@plt>
mov    %rax,%rbx
lea    0xecb(%rip),%rsi
mov    %rax,%rdi
call   1030 <__coverity_mark_as_afm_allocated__@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"H5Aclose\00"
define i8* @H5Acreate2(i8* %0, i8* %1, i8* %2, i8* %3, i8* %4, i8* %5) {
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca i8*
%13 = alloca i8*
store i8* %0, i8** %7
store i8* %1, i8** %8
store i8* %2, i8** %9
store i8* %3, i8** %10
store i8* %4, i8** %11
store i8* %5, i8** %12
%14 = call i8* @__coverity_alloc__(i32 10)
store i8* %14, i8** %13
%15 = load i8*, i8** %13
%16 = call i32 @__coverity_mark_as_afm_allocated__(i8* %15, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%17 = load i8*, i8** %13
ret i8* %17
}

LLVM IR (-O2):
@.str = [9 x i8] c"H5Aclose\00"
define i8* @H5Acreate2(i8* nocapture readnone %0, i8* nocapture readnone %1, i8* nocapture readnone %2, i8* nocapture readnone %3, i8* nocapture readnone %4, i8* nocapture readnone %5) {
%7 = tail call i8* @__coverity_alloc__(i32 10)
%8 = tail call i32 @__coverity_mark_as_afm_allocated__(i8* %7, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret i8* %7
}
int C_Utils_compare_short_ptr(const short *item1, const short *item2) {
  short i1 = *item1;
  short i2 = *item2;
  if (i1 == i2)
    return 0;
  return i1 < i2 ? -1 : 1;
}


x86 assembly (clang, -O0):
<C_Utils_compare_short_ptr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%ax
mov    %ax,-0x1a(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%ax
mov    %ax,-0x1c(%rbp)
movswl -0x1a(%rbp),%eax
movswl -0x1c(%rbp),%ecx
cmp    %ecx,%eax
jne    113e <C_Utils_compare_short_ptr+0x3e>
movl   $0x0,-0x4(%rbp)
jmp    1158 <C_Utils_compare_short_ptr+0x58>
movswl -0x1a(%rbp),%edx
movswl -0x1c(%rbp),%esi
mov    $0x1,%eax
mov    $0xffffffff,%ecx
cmp    %esi,%edx
cmovl  %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<C_Utils_compare_short_ptr>:
movzwl (%rdi),%eax
xor    %ecx,%ecx
xor    %edx,%edx
cmp    (%rsi),%ax
setge  %dl
lea    -0x1(%rdx,%rdx,1),%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @C_Utils_compare_short_ptr(i16* nocapture %0, i16* nocapture %1) {
%3 = load i16, i16* %0
%4 = load i16, i16* %1
%5 = icmp eq i16 %3, %4
%6 = icmp slt i16 %3, %4
%7 = select i1 %6, i32 -1, i32 1
%8 = select i1 %5, i32 0, i32 %7
ret i32 %8
}
float celsius(int f) { return (f - 32) * (5.0 / 9.0); }


x86 assembly (clang, -O0):
<celsius>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x20,%eax
cvtsi2sd %eax,%xmm0
movsd  0xee7(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<celsius>:
add    $0xffffffe0,%edi
cvtsi2sd %edi,%xmm0
mulsd  0xef1(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @celsius(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sub nsw i32 %3, 32
%5 = sitofp i32 %4 to double
%6 = fmul double %5, 0x3FE1C71C71C71C72
%7 = fptrunc double %6 to float
ret float %7
}

LLVM IR (-O2):
define float @celsius(i32 %0) {
%2 = add nsw i32 %0, -32
%3 = sitofp i32 %2 to double
%4 = fmul double %3, 0x3FE1C71C71C71C72
%5 = fptrunc double %4 to float
ret float %5
}
void dup() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ fromRep16(int);
uint16_t makeQNaN16(void) { return fromRep16(0x7e00U); }


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

x86 assembly (clang, -O2):
<makeQNaN16>:
mov    $0x7e00,%edi
jmp    1030 <fromRep16@plt>

LLVM IR (-O0):
define i32 @makeQNaN16() {
%1 = call i32 @fromRep16(i32 32256)
ret i32 %1
}

LLVM IR (-O2):
define i32 @makeQNaN16() {
%1 = tail call i32 @fromRep16(i32 32256)
ret i32 %1
}
void real_prod(double a[3], double num) {
  do {
    for (int __i = 0; __i < 3; ++__i) {
      a[__i] *= num;
    }
  } while (0);
}


x86 assembly (clang, -O0):
<real_prod>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x3,-0x14(%rbp)
jge    1143 <real_prod+0x43>
movsd  -0x10(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1114 <real_prod+0x14>
jmp    1148 <real_prod+0x48>
pop    %rbp
ret

x86 assembly (clang, -O2):
<real_prod>:
movupd (%rdi),%xmm1
movapd %xmm0,%xmm2
unpcklpd %xmm0,%xmm2
mulpd  %xmm1,%xmm2
movupd %xmm2,(%rdi)
mulsd  0x10(%rdi),%xmm0
movsd  %xmm0,0x10(%rdi)
ret

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

LLVM IR (-O2):
define void @real_prod(double* nocapture %0, double %1) {
%3 = bitcast double* %0 to <2 x double>*
%4 = load <2 x double>, <2 x double>* %3
%5 = insertelement <2 x double> poison, double %1, i64 0
%6 = shufflevector <2 x double> %5, <2 x double> poison, <2 x i32> zeroinitializer
%7 = fmul <2 x double> %4, %6
%8 = bitcast double* %0 to <2 x double>*
store <2 x double> %7, <2 x double>* %8
%9 = getelementptr inbounds double, double* %0, i64 2
%10 = load double, double* %9
%11 = fmul double %10, %1
store double %11, double* %9
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
void NativeI32ToVoid(int32_t p) {}


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

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

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

LLVM IR (-O2):
define void @NativeI32ToVoid(i32 %0) {
ret void
}
void gtk_shadow_type_get_type() {}


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

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

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

LLVM IR (-O2):
define void @gtk_shadow_type_get_type() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, long, long);
extern void *Bar4(long one, long two) {
  printf(" Hello from Bar4: one = %d, two = %d!\n ", one, two);
  return (void *)0xc0decafe00;
}


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

x86 assembly (clang, -O2):
<Bar4>:
push   %rax
mov    %rsi,%rdx
mov    %rdi,%rsi
lea    0xee2(%rip),%rdi
call   1030 <printf@plt>
movabs $0xc0decafe00,%rax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [40 x i8] c" Hello from Bar4: one = %d, two = %d!\0A \00"
define i8* @Bar4(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i64 %5, i64 %6)
ret i8* inttoptr (i64 828371566080 to i8*)
}

LLVM IR (-O2):
@.str = [40 x i8] c" Hello from Bar4: one = %d, two = %d!\0A \00"
define i8* @Bar4(i64 %0, i64 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i64 %0, i64 %1)
ret i8* inttoptr (i64 828371566080 to i8*)
}
/* Variables and functions */
int vect_mus_audio_read(int, char *, int);
int mus_audio_read(int id, char *buf, int bytes) {
  return (vect_mus_audio_read(id, buf, bytes));
}


x86 assembly (clang, -O0):
<mus_audio_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <vect_mus_audio_read@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mus_audio_read>:
jmp    1030 <vect_mus_audio_read@plt>

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

LLVM IR (-O2):
define i32 @mus_audio_read(i32 %0, i8* %1, i32 %2) {
%4 = tail call i32 @vect_mus_audio_read(i32 %0, i8* %1, i32 %2)
ret i32 %4
}
void toto() {}


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

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

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

LLVM IR (-O2):
define void @toto() {
ret void
}
void nullname2(char **name) { ; }


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

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

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

LLVM IR (-O2):
define void @nullname2(i8** nocapture %0) {
ret void
}
int compare_ints(const void *a, const void *b) {
  return (*(int *)a) - (*(int *)b);
}


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

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

LLVM IR (-O0):
define i32 @compare_ints(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %9
%11 = sub nsw i32 %7, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @compare_ints(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = sub nsw i32 %4, %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ SIGPIPE;
int /*<<< orphan*/ SIG_IGN;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ signal(int /*<<< orphan*/, int /*<<< orphan*/);
void badsig(void) {
  signal(SIGPIPE, SIG_IGN);
  exit(0);
}


x86 assembly (clang, -O0):
<badsig>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    0x2eb4(%rip),%rax
mov    (%rax),%esi
call   1030 <signal@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<badsig>:
push   %rax
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
mov    0x2eb7(%rip),%rax
mov    (%rax),%esi
call   1030 <signal@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@SIGPIPE = global i32 0
@SIG_IGN = global i32 0
define void @badsig() {
%1 = load i32, i32* @SIGPIPE
%2 = load i32, i32* @SIG_IGN
%3 = call i32 @signal(i32 %1, i32 %2)
%4 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@SIGPIPE = global i32 0
@SIG_IGN = global i32 0
define void @badsig() {
%1 = load i32, i32* @SIGPIPE
%2 = load i32, i32* @SIG_IGN
%3 = tail call i32 @signal(i32 %1, i32 %2)
%4 = tail call i32 @exit(i32 0)
unreachable
}
void XGetIMValues() {}


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

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

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

LLVM IR (-O2):
define void @XGetIMValues() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ajTaxinExit();
int /*<<< orphan*/ ajTaxoutExit();
void ajTaxExit(void) {
  ajTaxinExit();
  ajTaxoutExit();
  return;
}


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

x86 assembly (clang, -O2):
<ajTaxExit>:
push   %rax
xor    %eax,%eax
call   1030 <ajTaxinExit@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <ajTaxoutExit@plt>

LLVM IR (-O0):
define void @ajTaxExit() {
%1 = call i32 (...) @ajTaxinExit()
%2 = call i32 (...) @ajTaxoutExit()
ret void
}

LLVM IR (-O2):
define void @ajTaxExit() {
%1 = tail call i32 (...) @ajTaxinExit()
%2 = tail call i32 (...) @ajTaxoutExit()
ret void
}
void function() { return; }


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

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

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

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

/* Variables and functions */
int GetChar();
int fgetc(FILE *stream) { return (GetChar()); }


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

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

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

LLVM IR (-O2):
define i32 @fgetc(i32* nocapture readnone %0) {
%2 = tail call i32 (...) @GetChar()
ret i32 %2
}
/* Variables and functions */
bool nrf52_errata_162(void) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @nrf52_errata_162() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ steer(int);
void steer_center() { steer(1200 + 200); }


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

x86 assembly (clang, -O2):
<steer_center>:
mov    $0x578,%edi
jmp    1030 <steer@plt>

LLVM IR (-O0):
define void @steer_center() {
%1 = call i32 @steer(i32 1400)
ret void
}

LLVM IR (-O2):
define void @steer_center() {
%1 = tail call i32 @steer(i32 1400)
ret void
}
int is_power_of_2(int x) { return ((x & (x - 1)) == 0); }


x86 assembly (clang, -O0):
<is_power_of_2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_power_of_2>:
lea    -0x1(%rdi),%ecx
xor    %eax,%eax
test   %ecx,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @is_power_of_2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = sub nsw i32 %4, 1
%6 = and i32 %3, %5
%7 = icmp eq i32 %6, 0
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @is_power_of_2(i32 %0) {
%2 = tail call i32 @llvm.ctpop.i32(i32 %0)
%3 = icmp ult i32 %2, 2
%4 = zext i1 %3 to i32
ret i32 %4
}
int dzzIntMod(int number, int modby) { return number % modby; }


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

x86 assembly (clang, -O2):
<dzzIntMod>:
mov    %edi,%eax
cltd
idiv   %esi
mov    %edx,%eax
ret

LLVM IR (-O0):
define i32 @dzzIntMod(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 = srem i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @dzzIntMod(i32 %0, i32 %1) {
%3 = srem i32 %0, %1
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ __assert_int_equals(char *, int, int, int /*<<< orphan*/);
int /*<<< orphan*/ parse_long(char *);
void test_parse_gigabytes(void) {
  __assert_int_equals("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                      "outputs/2022-01-22/02-19-57/repos/headius/jato/refs/"
                      "heads/master/test/unit/vm/parse-test.c",
                      28, (1 * 1024 * 1024 * 1024), (parse_long("1g")));
}


x86 assembly (clang, -O0):
<test_parse_gigabytes>:
push   %rbp
mov    %rsp,%rbp
lea    0xf68(%rip),%rdi
call   1030 <parse_long@plt>
mov    %eax,%ecx
lea    0xec7(%rip),%rdi
mov    $0x1c,%esi
mov    $0x40000000,%edx
call   1040 <__assert_int_equals@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_parse_gigabytes>:
push   %rax
lea    0xf6b(%rip),%rdi
call   1030 <parse_long@plt>
lea    0xecc(%rip),%rdi
mov    $0x1c,%esi
mov    $0x40000000,%edx
mov    %eax,%ecx
pop    %rax
jmp    1040 <__assert_int_equals@plt>

LLVM IR (-O0):
@.str = [147 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/headius/jato/refs/heads/master/test/unit/vm/parse-test.c\00"
@.str.1 = [3 x i8] c"1g\00"
define void @test_parse_gigabytes() {
%1 = call i32 @parse_long(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 @__assert_int_equals(i8* getelementptr inbounds ([147 x i8], [147 x i8]* @.str, i64 0, i64 0), i32 28, i32 1073741824, i32 %1)
ret void
}

LLVM IR (-O2):
@.str = [147 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/headius/jato/refs/heads/master/test/unit/vm/parse-test.c\00"
@.str.1 = [3 x i8] c"1g\00"
define void @test_parse_gigabytes() {
%1 = tail call i32 @parse_long(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @__assert_int_equals(i8* getelementptr inbounds ([147 x i8], [147 x i8]* @.str, i64 0, i64 0), i32 28, i32 1073741824, i32 %1)
ret void
}
char *strsave(s)
char *s;
{
  char *p;
  p = ckalloc(strlen(s) + 1);
  return (strcpy(p, s));
}


x86 assembly (clang, -O0):
<strsave>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
mov    $0x0,%al
call   1030 <ckalloc@plt>
cltq
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1040 <strcpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strsave>:
push   %rbx
mov    %rdi,%rbx
call   1050 <strlen@plt>
lea    0x1(%rax),%rdi
xor    %eax,%eax
call   1030 <ckalloc@plt>
movslq %eax,%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1040 <strcpy@plt>

LLVM IR (-O0):
define i8* @strsave(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = add i64 %5, 1
%7 = call i32 (i64, ...) bitcast (i32 (...)* @ckalloc to i32 (i64, ...)*)(i64 %6)
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to i8*
store i8* %9, i8** %3
%10 = load i8*, i8** %3
%11 = load i8*, i8** %2
%12 = call i8* @strcpy(i8* %10, i8* %11)
ret i8* %12
}

LLVM IR (-O2):
define i8* @strsave(i8* nocapture %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add i64 %2, 1
%4 = tail call i32 (i64, ...) bitcast (i32 (...)* @ckalloc to i32 (i64, ...)*)(i64 %3)
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i8*
%7 = tail call i8* @strcpy(i8* dereferenceable(1) %6, i8* dereferenceable(1) %0)
ret i8* %6
}
int test_imm_E7uint64_lowword_mem(unsigned long long *val) {
  return ((*val) & (0xE7 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_E7uint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 231
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void foo694() {}


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

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

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

LLVM IR (-O2):
define void @foo694() {
ret void
}
void perror_1(string) char *string;
{
  char *copy = "hello";
  perror(copy);
}


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

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

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

LLVM IR (-O2):
@.str = [6 x i8] c"hello\00"
define void @perror_1(i8* nocapture readnone %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @perror to i32 (i8*, ...)*)(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int _usage(void) {
  fputs("Usage: "
        "configctl"
        " -f filename -a\n"
        "       "
        "configctl"
        " -f filename [-qv] [section.]key...\n"
        "       "
        "configctl"
        " -w -f filename [-qv] [section.]key[=value]...\n"
        "  -a\tList every key of every section available\n"
        "  -f\tFilename to parse or update\n"
        "  -q\tQuiet mode\n"
        "  -v\tVerbose mode\n"
        "  -w\tSet and save values\n",
        stderr);
  return 1;
}


x86 assembly (clang, -O0):
<_usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%esi
lea    0xedc(%rip),%rdi
call   1030 <fputs@plt>
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_usage>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%esi
lea    0xedf(%rip),%rdi
call   1030 <fputs@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [287 x i8] c"Usage: configctl -f filename -a\0A configctl -f filename [-qv] [section.]key...\0A configctl -w -f filename [-qv] [section.]key[=value]...\0A -a\09List every key of every section available\0A -f\09Filename to parse or update\0A -q\09Quiet mode\0A -v\09Verbose mode\0A -w\09Set and save values\0A\00"
@stderr = global i32 0
define i32 @_usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fputs(i8* getelementptr inbounds ([287 x i8], [287 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 1
}

LLVM IR (-O2):
@.str = [287 x i8] c"Usage: configctl -f filename -a\0A configctl -f filename [-qv] [section.]key...\0A configctl -w -f filename [-qv] [section.]key[=value]...\0A -a\09List every key of every section available\0A -f\09Filename to parse or update\0A -q\09Quiet mode\0A -v\09Verbose mode\0A -w\09Set and save values\0A\00"
@stderr = global i32 0
define i32 @_usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fputs(i8* getelementptr inbounds ([287 x i8], [287 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 1
}
/* Variables and functions */
char *strstr(char *, char *);
int detect_buggy_yacc(char *text) {
  char *x;
  x = strstr(text, " #line ");
  if (!x)
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<detect_buggy_yacc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <strstr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1147 <detect_buggy_yacc+0x37>
movl   $0x0,-0x4(%rbp)
jmp    114e <detect_buggy_yacc+0x3e>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<detect_buggy_yacc>:
push   %rax
lea    0xee8(%rip),%rsi
call   1030 <strstr@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [8 x i8] c" #line \00"
define i32 @detect_buggy_yacc(i8* %0) {
%2 = tail call i8* @strstr(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%3 = icmp ne i8* %2, null
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int arc4random();
uint32_t arc4random_uniform(uint32_t upper_bound) {
  uint32_t r, min;
  if (upper_bound < 2)
    return 0;
  min = -upper_bound % upper_bound;
  for (;;) {
    r = arc4random();
    if (r >= min)
      break;
  }
  return r % upper_bound;
}


x86 assembly (clang, -O0):
<arc4random_uniform>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    1131 <arc4random_uniform+0x21>
movl   $0x0,-0x4(%rbp)
jmp    1167 <arc4random_uniform+0x57>
xor    %eax,%eax
sub    -0x8(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,-0x10(%rbp)
mov    $0x0,%al
call   1030 <arc4random@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jl     1158 <arc4random_uniform+0x48>
jmp    115d <arc4random_uniform+0x4d>
jmp    113d <arc4random_uniform+0x2d>
mov    -0xc(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<arc4random_uniform>:
xor    %eax,%eax
cmp    $0x2,%edi
jl     1131 <arc4random_uniform+0x21>
push   %rbx
mov    %edi,%ebx
nopw   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <arc4random@plt>
test   %eax,%eax
js     1120 <arc4random_uniform+0x10>
cltd
idiv   %ebx
mov    %edx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @arc4random_uniform(i32 %0) {
%2 = icmp slt i32 %0, 2
br i1 %2, label %8, label %3
3: ; preds = %1, %3
%4 = tail call i32 (...) @arc4random()
%5 = icmp sgt i32 %4, -1
br i1 %5, label %6, label %3
6: ; preds = %3
%7 = srem i32 %4, %0
br label %8
8: ; preds = %1, %6
%9 = phi i32 [ %7, %6 ], [ 0, %1 ]
ret i32 %9
}
/* Variables and functions */
double floor(double);
double bbob2009_round(double x) { return floor(x + 0.5); }


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xedb(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
call   1030 <floor@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
addsd  0xee8(%rip),%xmm0
jmp    1030 <floor@plt>

LLVM IR (-O0):
define double @bbob2009_round(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fadd double %3, 5.000000e-01
%5 = call double @llvm.floor.f64(double %4)
ret double %5
}

LLVM IR (-O2):
define double @bbob2009_round(double %0) {
%2 = fadd double %0, 5.000000e-01
%3 = tail call double @llvm.floor.f64(double %2)
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ update_queen(size_t, unsigned int **, size_t, size_t, int);
void place_queen(size_t x, unsigned board[x][x], size_t px, size_t py) {
  update_queen(x, board, px, py, 1);
}


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

x86 assembly (clang, -O2):
<place_queen>:
mov    $0x1,%r8d
jmp    1030 <update_queen@plt>

LLVM IR (-O0):
define void @place_queen(i64 %0, i32* %1, i64 %2, i64 %3) {
%5 = alloca i64
%6 = alloca i32*
%7 = alloca i64
%8 = alloca i64
store i64 %0, i64* %5
store i32* %1, i32** %6
store i64 %2, i64* %7
store i64 %3, i64* %8
%9 = load i64, i64* %5
%10 = load i64, i64* %5
%11 = load i64, i64* %5
%12 = load i32*, i32** %6
%13 = bitcast i32* %12 to i32**
%14 = load i64, i64* %7
%15 = load i64, i64* %8
%16 = call i32 @update_queen(i64 %11, i32** %13, i64 %14, i64 %15, i32 1)
ret void
}

LLVM IR (-O2):
define void @place_queen(i64 %0, i32* %1, i64 %2, i64 %3) {
%5 = bitcast i32* %1 to i32**
%6 = tail call i32 @update_queen(i64 %0, i32** %5, i64 %2, i64 %3, i32 1)
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int x_root;
};
typedef TYPE_1__ XButtonEvent;

/* Variables and functions */
void set_XButtonEvent_x_root(void *_p, int _v) {
  ((XButtonEvent *)_p)->x_root = (int)_v;
}


x86 assembly (clang, -O0):
<set_XButtonEvent_x_root>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_XButtonEvent_x_root>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32 }
define void @set_XButtonEvent_x_root(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_2__*
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 0
store i32 %5, i32* %8
ret void
}

LLVM IR (-O2):
define void @set_XButtonEvent_x_root(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ echo(int);
main() { echo(0b111111111111111111111111111111111); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0xffffffff,%edi
call   1030 <echo@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xffffffff,%edi
call   1030 <echo@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 @echo(i32 -1)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @echo(i32 -1)
ret i32 0
}
int int_compare(void *num1, void *num2) {
  if (*(int *)num1 > *(int *)num2) {
    return 1;
  } else if (*(int *)num1 < *(int *)num2) {
    return -1;
  } else {
    return 0;
  }
  return 0;
}


x86 assembly (clang, -O0):
<int_compare>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%eax
jle    112a <int_compare+0x2a>
movl   $0x1,-0x4(%rbp)
jmp    114f <int_compare+0x4f>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%eax
jge    1148 <int_compare+0x48>
movl   $0xffffffff,-0x4(%rbp)
jmp    114f <int_compare+0x4f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<int_compare>:
mov    (%rdi),%eax
mov    (%rsi),%ecx
xor    %edx,%edx
cmp    %ecx,%eax
setl   %dl
neg    %edx
cmp    %ecx,%eax
mov    $0x1,%eax
cmovle %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @int_compare(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = icmp sgt i32 %4, %6
%8 = icmp slt i32 %4, %6
%9 = sext i1 %8 to i32
%10 = select i1 %7, i32 1, i32 %9
ret i32 %10
}