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

/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int);
scalar_t__ stat(char *, struct stat *);
int check_pid(int pid) {
  struct stat pid_st;
  char procfile[1024];
  sprintf(procfile, "/proc/%d/stat", pid);
  if (stat(procfile, &pid_st) == 0) {
    return (!0);
  }
  return 0;
}


x86 assembly (clang, -O0):
<check_pid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x410,%rsp
mov    %edi,-0x8(%rbp)
lea    -0x410(%rbp),%rdi
mov    -0x8(%rbp),%edx
lea    0xec1(%rip),%rsi
call   1040 <sprintf@plt>
lea    -0x410(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1030 <stat@plt>
cmp    $0x0,%rax
jne    116a <check_pid+0x4a>
movl   $0x1,-0x4(%rbp)
jmp    1171 <check_pid+0x51>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x410,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_pid>:
push   %rbx
sub    $0x410,%rsp
mov    %edi,%edx
lea    0xecf(%rip),%rsi
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <sprintf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1030 <stat@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
add    $0x410,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
@.str = [14 x i8] c"/proc/%d/stat\00"
define i32 @check_pid(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca %struct.stat
%5 = alloca [1024 x i8]
store i32 %0, i32* %3
%6 = getelementptr inbounds [1024 x i8], [1024 x i8]* %5, i64 0, i64 0
%7 = load i32, i32* %3
%8 = call i32 @sprintf(i8* %6, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = getelementptr inbounds [1024 x i8], [1024 x i8]* %5, i64 0, i64 0
%10 = call i64 @stat(i8* %9, %struct.stat* %4)
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %1
store i32 1, i32* %2
br label %14
13: ; preds = %1
store i32 0, i32* %2
br label %14
14: ; preds = %13, %12
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@.str = [14 x i8] c"/proc/%d/stat\00"
define i32 @check_pid(i32 %0) {
%2 = alloca %struct.stat
%3 = alloca [1024 x i8]
%4 = bitcast %struct.stat* %2 to i8*
%5 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%6 = call i32 @sprintf(i8* %5, i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %0)
%7 = call i64 @stat(i8* %5, %struct.stat* %2)
%8 = icmp eq i64 %7, 0
%9 = zext i1 %8 to i32
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ putchar(int);
int main() {
  int i;
  for (i = 0; i < 16384; i++)
    if (i < 16)
      putchar(i);
    else
      putchar(0xbe);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x4000,-0x8(%rbp)
jge    1167 <main+0x57>
cmpl   $0x10,-0x8(%rbp)
jge    114a <main+0x3a>
mov    -0x8(%rbp),%edi
call   1030 <putchar@plt>
jmp    1154 <main+0x44>
mov    $0xbe,%edi
call   1030 <putchar@plt>
jmp    1159 <main+0x49>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
cmp    $0x10,%ebx
mov    $0xbe,%edi
cmovb  %ebx,%edi
call   1030 <putchar@plt>
add    $0x1,%ebx
cmp    $0x4000,%ebx
jne    1120 <main+0x10>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %6, %1 ]
%3 = icmp ult i32 %2, 16
%4 = select i1 %3, i32 %2, i32 190
%5 = tail call i32 @putchar(i32 %4)
%6 = add nuw nsw i32 %2, 1
%7 = icmp eq i32 %6, 16384
br i1 %7, label %8, label %1
8: ; preds = %1
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ OsdSettingsHandle();
int /*<<< orphan*/ UAVObjUpdated(int /*<<< orphan*/);
void OsdSettingsUpdated() { UAVObjUpdated(OsdSettingsHandle()); }


x86 assembly (clang, -O0):
<OsdSettingsUpdated>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <OsdSettingsHandle@plt>
mov    %eax,%edi
call   1030 <UAVObjUpdated@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<OsdSettingsUpdated>:
push   %rax
xor    %eax,%eax
call   1040 <OsdSettingsHandle@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <UAVObjUpdated@plt>

LLVM IR (-O0):
define void @OsdSettingsUpdated() {
%1 = call i32 (...) @OsdSettingsHandle()
%2 = call i32 @UAVObjUpdated(i32 %1)
ret void
}

LLVM IR (-O2):
define void @OsdSettingsUpdated() {
%1 = tail call i32 (...) @OsdSettingsHandle()
%2 = tail call i32 @UAVObjUpdated(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isspace(int);
void t_isspace_0x3b() {
  Assert_real((isspace(59) == 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_isspace.c",
              300, ("isspace should be 0 for ;"));
}


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

x86 assembly (clang, -O2):
<t_isspace_0x3b>:
push   %rax
mov    $0x3b,%edi
call   1030 <isspace@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x12c,%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_isspace.c\00"
@.str.1 = [26 x i8] c"isspace should be 0 for ;\00"
define void @t_isspace_0x3b() {
%1 = call i64 @isspace(i32 59)
%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 300, 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_isspace.c\00"
@.str.1 = [26 x i8] c"isspace should be 0 for ;\00"
define void @t_isspace_0x3b() {
%1 = tail call i64 @isspace(i32 59)
%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 300, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
double pathconN_nm9_sign(double x) { return x < 0 ? -1 : x > 0 ? 1 : x; }


x86 assembly (clang, -O0):
<pathconN_nm9_sign>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    1129 <pathconN_nm9_sign+0x29>
movsd  0xee9(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    1161 <pathconN_nm9_sign+0x61>
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    114d <pathconN_nm9_sign+0x4d>
movsd  0xebd(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    1157 <pathconN_nm9_sign+0x57>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<pathconN_nm9_sign>:
xorpd  %xmm1,%xmm1
xorpd  %xmm2,%xmm2
cmpltsd %xmm0,%xmm2
movsd  0xeeb(%rip),%xmm3
andpd  %xmm2,%xmm3
andnpd %xmm0,%xmm2
orpd   %xmm3,%xmm2
cmpltsd %xmm1,%xmm0
movapd %xmm0,%xmm1
andnpd %xmm2,%xmm1
movsd  0xed2(%rip),%xmm2
andpd  %xmm2,%xmm0
orpd   %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define double @pathconN_nm9_sign(double %0) {
%2 = fcmp olt double %0, 0.000000e+00
%3 = fcmp ogt double %0, 0.000000e+00
%4 = select i1 %3, double 1.000000e+00, double %0
%5 = select i1 %2, double -1.000000e+00, double %4
ret double %5
}
/* Variables and functions */
scalar_t__ get_thread_heap_raw();
int rpmalloc_is_thread_initialized(void) {
  return (get_thread_heap_raw() != 0) ? 1 : 0;
}


x86 assembly (clang, -O0):
<rpmalloc_is_thread_initialized>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <get_thread_heap_raw@plt>
mov    %rax,%rdx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rpmalloc_is_thread_initialized>:
push   %rax
xor    %eax,%eax
call   1030 <get_thread_heap_raw@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @rpmalloc_is_thread_initialized() {
%1 = call i64 (...) @get_thread_heap_raw()
%2 = icmp ne i64 %1, 0
%3 = zext i1 %2 to i64
%4 = select i1 %2, i32 1, i32 0
ret i32 %4
}

LLVM IR (-O2):
define i32 @rpmalloc_is_thread_initialized() {
%1 = tail call i64 (...) @get_thread_heap_raw()
%2 = icmp ne i64 %1, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
long double hypot(double, double);
long double hypotl(long double x, long double y) {
  return hypot((double)x, (double)y);
}


x86 assembly (clang, -O0):
<hypotl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
fldt   0x20(%rbp)
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fstpt  -0x20(%rbp)
fldt   -0x10(%rbp)
fstpl  -0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
fldt   -0x20(%rbp)
fstpl  -0x28(%rbp)
movsd  -0x28(%rbp),%xmm1
call   1030 <hypot@plt>
fld    %st(0)
fstp   %st(0)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hypotl>:
fldt   0x18(%rsp)
fldt   0x8(%rsp)
fstpl  -0x8(%rsp)
movsd  -0x8(%rsp),%xmm0
fstpl  -0x10(%rsp)
movsd  -0x10(%rsp),%xmm1
jmp    1030 <hypot@plt>

LLVM IR (-O0):
define x86_fp80 @hypotl(x86_fp80 %0, x86_fp80 %1) {
%3 = alloca x86_fp80
%4 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %3
store x86_fp80 %1, x86_fp80* %4
%5 = load x86_fp80, x86_fp80* %3
%6 = fptrunc x86_fp80 %5 to double
%7 = load x86_fp80, x86_fp80* %4
%8 = fptrunc x86_fp80 %7 to double
%9 = call x86_fp80 @hypot(double %6, double %8)
ret x86_fp80 %9
}

LLVM IR (-O2):
define x86_fp80 @hypotl(x86_fp80 %0, x86_fp80 %1) {
%3 = fptrunc x86_fp80 %0 to double
%4 = fptrunc x86_fp80 %1 to double
%5 = tail call x86_fp80 @hypot(double %3, double %4)
ret x86_fp80 %5
}
int f(int b) { return b; }


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
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void globus_l_error_free_errno(void *data) { free(data); }


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

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

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

LLVM IR (-O2):
define void @globus_l_error_free_errno(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
unsigned long long or64(unsigned long long input) {
  return input | 0x200000004ULL;
}


x86 assembly (clang, -O0):
<or64>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movabs $0x200000004,%rax
or     -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<or64>:
movabs $0x200000004,%rax
or     %rdi,%rax
ret

LLVM IR (-O0):
define i64 @or64(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = or i64 %3, 8589934596
ret i64 %4
}

LLVM IR (-O2):
define i64 @or64(i64 %0) {
%2 = or i64 %0, 8589934596
ret i64 %2
}
/* Variables and functions */
char *strcpy(char *, char const *);
scalar_t__ strlen(char const *);
scalar_t__ xmalloc(scalar_t__);
char *xstrdup(const char *string) {
  return string ? strcpy((char *)xmalloc(strlen(string) + 1), string) : NULL;
}


x86 assembly (clang, -O0):
<xstrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1171 <xstrdup+0x41>
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1050 <xmalloc@plt>
mov    %rax,%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    %rax,-0x10(%rbp)
jmp    117c <xstrdup+0x4c>
xor    %eax,%eax
mov    %rax,-0x10(%rbp)
jmp    117c <xstrdup+0x4c>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xstrdup>:
push   %r14
push   %rbx
push   %rax
test   %rdi,%rdi
je     115a <xstrdup+0x2a>
mov    %rdi,%rbx
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <xmalloc@plt>
mov    %rax,%r14
mov    %rax,%rdi
mov    %rbx,%rsi
call   1030 <strcpy@plt>
jmp    115d <xstrdup+0x2d>
xor    %r14d,%r14d
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @xstrdup(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %13
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = call i64 @strlen(i8* %6)
%8 = add nsw i64 %7, 1
%9 = call i64 @xmalloc(i64 %8)
%10 = inttoptr i64 %9 to i8*
%11 = load i8*, i8** %2
%12 = call i8* @strcpy(i8* %10, i8* %11)
br label %14
13: ; preds = %1
br label %14
14: ; preds = %13, %5
%15 = phi i8* [ %12, %5 ], [ null, %13 ]
ret i8* %15
}

LLVM IR (-O2):
define i8* @xstrdup(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %9, label %3
3: ; preds = %1
%4 = tail call i64 @strlen(i8* %0)
%5 = add nsw i64 %4, 1
%6 = tail call i64 @xmalloc(i64 %5)
%7 = inttoptr i64 %6 to i8*
%8 = tail call i8* @strcpy(i8* dereferenceable(1) %7, i8* %0)
br label %9
9: ; preds = %1, %3
%10 = phi i8* [ %7, %3 ], [ null, %1 ]
ret i8* %10
}
/* Variables and functions */
int /*<<< orphan*/ __print_int(int /*<<< orphan*/);
int /*<<< orphan*/ factorial_loop(int);
int /*<<< orphan*/ factorial_recursive(int);
int main() {
  __print_int(factorial_recursive(5));
  __print_int(factorial_recursive(7));
  __print_int(factorial_loop(5));
  __print_int(factorial_loop(7));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x5,%edi
call   1050 <factorial_recursive@plt>
mov    %eax,%edi
call   1040 <__print_int@plt>
mov    $0x7,%edi
call   1050 <factorial_recursive@plt>
mov    %eax,%edi
call   1040 <__print_int@plt>
mov    $0x5,%edi
call   1030 <factorial_loop@plt>
mov    %eax,%edi
call   1040 <__print_int@plt>
mov    $0x7,%edi
call   1030 <factorial_loop@plt>
mov    %eax,%edi
call   1040 <__print_int@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x5,%edi
call   1050 <factorial_recursive@plt>
mov    %eax,%edi
call   1040 <__print_int@plt>
mov    $0x7,%edi
call   1050 <factorial_recursive@plt>
mov    %eax,%edi
call   1040 <__print_int@plt>
mov    $0x5,%edi
call   1030 <factorial_loop@plt>
mov    %eax,%edi
call   1040 <__print_int@plt>
mov    $0x7,%edi
call   1030 <factorial_loop@plt>
mov    %eax,%edi
call   1040 <__print_int@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @factorial_recursive(i32 5)
%3 = call i32 @__print_int(i32 %2)
%4 = call i32 @factorial_recursive(i32 7)
%5 = call i32 @__print_int(i32 %4)
%6 = call i32 @factorial_loop(i32 5)
%7 = call i32 @__print_int(i32 %6)
%8 = call i32 @factorial_loop(i32 7)
%9 = call i32 @__print_int(i32 %8)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @factorial_recursive(i32 5)
%2 = tail call i32 @__print_int(i32 %1)
%3 = tail call i32 @factorial_recursive(i32 7)
%4 = tail call i32 @__print_int(i32 %3)
%5 = tail call i32 @factorial_loop(i32 5)
%6 = tail call i32 @__print_int(i32 %5)
%7 = tail call i32 @factorial_loop(i32 7)
%8 = tail call i32 @__print_int(i32 %7)
ret i32 0
}
int main() {
  signed short a = L'a';
  signed short b = L'b';
  return b - a;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movw   $0x61,-0x6(%rbp)
movw   $0x62,-0x8(%rbp)
movswl -0x8(%rbp),%eax
movswl -0x6(%rbp),%ecx
sub    %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i16
%3 = alloca i16
store i32 0, i32* %1
store i16 97, i16* %2
store i16 98, i16* %3
%4 = load i16, i16* %3
%5 = sext i16 %4 to i32
%6 = load i16, i16* %2
%7 = sext i16 %6 to i32
%8 = sub nsw i32 %5, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @main() {
ret i32 1
}
double _gfx_platform_get_time_resolution(void) { return 1e-9; }


x86 assembly (clang, -O0):
<_gfx_platform_get_time_resolution>:
push   %rbp
mov    %rsp,%rbp
movsd  0xef4(%rip),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<_gfx_platform_get_time_resolution>:
movsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @_gfx_platform_get_time_resolution() {
ret double 1.000000e-09
}

LLVM IR (-O2):
define double @_gfx_platform_get_time_resolution() {
ret double 1.000000e-09
}
unsigned char ddr_window(struct ddr_set *ddr_setting, int lane,
                         unsigned char *chk, unsigned char *tra,
                         unsigned char *dll_phase, unsigned *dq_dly,
                         unsigned char *dqs, unsigned char *dqsn,
                         int pattern_mask, int test_count, int tra_mask) {
  return 0;
}


x86 assembly (clang, -O0):
<ddr_window>:
push   %rbp
mov    %rsp,%rbp
mov    0x30(%rbp),%eax
mov    0x28(%rbp),%eax
mov    0x20(%rbp),%eax
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
xor    %eax,%eax
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.ddr_set = type opaque
define zeroext i8 @ddr_window(%struct.ddr_set* %0, i32 %1, i8* %2, i8* %3, i8* %4, i32* %5, i8* %6, i8* %7, i32 %8, i32 %9, i32 %10) {
%12 = alloca %struct.ddr_set*
%13 = alloca i32
%14 = alloca i8*
%15 = alloca i8*
%16 = alloca i8*
%17 = alloca i32*
%18 = alloca i8*
%19 = alloca i8*
%20 = alloca i32
%21 = alloca i32
%22 = alloca i32
store %struct.ddr_set* %0, %struct.ddr_set** %12
store i32 %1, i32* %13
store i8* %2, i8** %14
store i8* %3, i8** %15
store i8* %4, i8** %16
store i32* %5, i32** %17
store i8* %6, i8** %18
store i8* %7, i8** %19
store i32 %8, i32* %20
store i32 %9, i32* %21
store i32 %10, i32* %22
ret i8 0
}

LLVM IR (-O2):
%struct.ddr_set = type opaque
define zeroext i8 @ddr_window(%struct.ddr_set* nocapture readnone %0, i32 %1, i8* nocapture readnone %2, i8* nocapture readnone %3, i8* nocapture readnone %4, i32* nocapture readnone %5, i8* nocapture readnone %6, i8* nocapture readnone %7, i32 %8, i32 %9, i32 %10) {
ret i8 0
}
/* Variables and functions */
void *calloc(size_t, size_t);
void *KSI_calloc(size_t num, size_t size) { return calloc(num, size); }


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

x86 assembly (clang, -O2):
<KSI_calloc>:
jmp    1030 <calloc@plt>

LLVM IR (-O0):
define i8* @KSI_calloc(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 i8* @calloc(i64 %5, i64 %6)
ret i8* %7
}

LLVM IR (-O2):
define noalias i8* @KSI_calloc(i64 %0, i64 %1) {
%3 = tail call i8* @calloc(i64 %0, i64 %1)
ret i8* %3
}
int comparator(const void *a, const void *b) {
  const int arg1 = *(const int *)a;
  const int arg2 = *(const int *)b;
  return arg1 - arg2;
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @comparator(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
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int uint32_t;
typedef int uint16_t;

/* Variables and functions */
uint32_t _bytecode_write(uint8_t code, uint32_t value, uint16_t addr,
                         uint8_t r0, uint8_t r1, uint8_t r2) {
  return (uint32_t)code << 24 | (value & 0x00FFFFFF) | (uint32_t)r0 << 16 |
         (uint32_t)r1 << 8 | (uint32_t)r2 | addr;
}


x86 assembly (clang, -O0):
<_bytecode_write>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
mov    -0x8(%rbp),%rax
shl    $0x18,%eax
mov    -0xc(%rbp),%ecx
and    $0xffffff,%ecx
or     %ecx,%eax
mov    -0x18(%rbp),%rcx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x20(%rbp),%rcx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x28(%rbp),%rcx
or     %ecx,%eax
or     -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_bytecode_write>:
shl    $0x18,%edi
and    $0xffffff,%esi
lea    (%rsi,%rdi,1),%eax
shl    $0x10,%ecx
shl    $0x8,%r8d
or     %edx,%ecx
or     %ecx,%eax
or     %r8d,%r9d
or     %r9d,%eax
ret

LLVM IR (-O0):
define i32 @_bytecode_write(i64 %0, i32 %1, i32 %2, i64 %3, i64 %4, i64 %5) {
%7 = alloca i64
%8 = alloca i32
%9 = alloca i32
%10 = alloca i64
%11 = alloca i64
%12 = alloca i64
store i64 %0, i64* %7
store i32 %1, i32* %8
store i32 %2, i32* %9
store i64 %3, i64* %10
store i64 %4, i64* %11
store i64 %5, i64* %12
%13 = load i64, i64* %7
%14 = trunc i64 %13 to i32
%15 = shl i32 %14, 24
%16 = load i32, i32* %8
%17 = and i32 %16, 16777215
%18 = or i32 %15, %17
%19 = load i64, i64* %10
%20 = trunc i64 %19 to i32
%21 = shl i32 %20, 16
%22 = or i32 %18, %21
%23 = load i64, i64* %11
%24 = trunc i64 %23 to i32
%25 = shl i32 %24, 8
%26 = or i32 %22, %25
%27 = load i64, i64* %12
%28 = trunc i64 %27 to i32
%29 = or i32 %26, %28
%30 = load i32, i32* %9
%31 = or i32 %29, %30
ret i32 %31
}

LLVM IR (-O2):
define i32 @_bytecode_write(i64 %0, i32 %1, i32 %2, i64 %3, i64 %4, i64 %5) {
%7 = trunc i64 %0 to i32
%8 = shl i32 %7, 24
%9 = and i32 %1, 16777215
%10 = or i32 %8, %9
%11 = trunc i64 %3 to i32
%12 = shl i32 %11, 16
%13 = trunc i64 %4 to i32
%14 = shl i32 %13, 8
%15 = trunc i64 %5 to i32
%16 = or i32 %10, %2
%17 = or i32 %16, %12
%18 = or i32 %17, %14
%19 = or i32 %18, %15
ret i32 %19
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
int uint32_cmp(const void *a, const void *b) {
  return (((*(uint32_t *)a) > (*(uint32_t *)b)) -
          ((*(uint32_t *)a) < (*(uint32_t *)b)));
}


x86 assembly (clang, -O0):
<uint32_cmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    -0x10(%rbp),%rcx
cmp    (%rcx),%rax
setg   %al
and    $0x1,%al
movzbl %al,%eax
mov    -0x8(%rbp),%rcx
mov    (%rcx),%rcx
mov    -0x10(%rbp),%rdx
cmp    (%rdx),%rcx
setl   %cl
and    $0x1,%cl
movzbl %cl,%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<uint32_cmp>:
mov    (%rdi),%rcx
xor    %eax,%eax
xor    %edx,%edx
cmp    (%rsi),%rcx
setg   %al
setl   %dl
sub    %edx,%eax
ret

LLVM IR (-O0):
define i32 @uint32_cmp(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 i64*
%7 = load i64, i64* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i64*
%10 = load i64, i64* %9
%11 = icmp sgt i64 %7, %10
%12 = zext i1 %11 to i32
%13 = load i8*, i8** %3
%14 = bitcast i8* %13 to i64*
%15 = load i64, i64* %14
%16 = load i8*, i8** %4
%17 = bitcast i8* %16 to i64*
%18 = load i64, i64* %17
%19 = icmp slt i64 %15, %18
%20 = zext i1 %19 to i32
%21 = sub nsw i32 %12, %20
ret i32 %21
}

LLVM IR (-O2):
define i32 @uint32_cmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i64*
%4 = load i64, i64* %3
%5 = bitcast i8* %1 to i64*
%6 = load i64, i64* %5
%7 = icmp sgt i64 %4, %6
%8 = zext i1 %7 to i32
%9 = icmp slt i64 %4, %6
%10 = sext i1 %9 to i32
%11 = add nsw i32 %10, %8
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ is_le();
short short_swap(short);
short short_to_be(short s) {
  if (!is_le())
    return s;
  else
    return short_swap(s);
}


x86 assembly (clang, -O0):
<short_to_be>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <is_le@plt>
cmp    $0x0,%eax
jne    114c <short_to_be+0x2c>
mov    -0x4(%rbp),%ax
mov    %ax,-0x2(%rbp)
jmp    1159 <short_to_be+0x39>
movswl -0x4(%rbp),%edi
call   1040 <short_swap@plt>
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<short_to_be>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <is_le@plt>
test   %eax,%eax
je     1137 <short_to_be+0x17>
movswl %bx,%edi
pop    %rbx
jmp    1040 <short_swap@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define signext i16 @short_to_be(i16 signext %0) {
%2 = alloca i16
%3 = alloca i16
store i16 %0, i16* %3
%4 = call i32 (...) @is_le()
%5 = icmp ne i32 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = load i16, i16* %3
store i16 %7, i16* %2
br label %11
8: ; preds = %1
%9 = load i16, i16* %3
%10 = call signext i16 @short_swap(i16 signext %9)
store i16 %10, i16* %2
br label %11
11: ; preds = %8, %6
%12 = load i16, i16* %2
ret i16 %12
}

LLVM IR (-O2):
define signext i16 @short_to_be(i16 signext %0) {
%2 = tail call i32 (...) @is_le()
%3 = icmp eq i32 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call signext i16 @short_swap(i16 signext %0)
br label %6
6: ; preds = %1, %4
%7 = phi i16 [ %5, %4 ], [ %0, %1 ]
ret i16 %7
}
int do_284() { return 284; }


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

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

LLVM IR (-O0):
define i32 @do_284() {
ret i32 284
}

LLVM IR (-O2):
define i32 @do_284() {
ret i32 284
}
/* Variables and functions */
int VP8ClipUV(int const);
int VP8RGBToV(int r, int g, int b) {
  const int v = +28800 * r - 24116 * g - 4684 * b;
  return VP8ClipUV(v);
}


x86 assembly (clang, -O0):
<VP8RGBToV>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
imul   $0x7080,-0x4(%rbp),%eax
imul   $0x5e34,-0x8(%rbp),%ecx
sub    %ecx,%eax
imul   $0x124c,-0xc(%rbp),%ecx
sub    %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%edi
call   1030 <VP8ClipUV@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<VP8RGBToV>:
imul   $0x7080,%edi,%eax
imul   $0xffffa1cc,%esi,%ecx
add    %eax,%ecx
imul   $0xffffedb4,%edx,%edi
add    %ecx,%edi
jmp    1030 <VP8ClipUV@plt>

LLVM IR (-O0):
define i32 @VP8RGBToV(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %4
%9 = mul nsw i32 28800, %8
%10 = load i32, i32* %5
%11 = mul nsw i32 24116, %10
%12 = sub nsw i32 %9, %11
%13 = load i32, i32* %6
%14 = mul nsw i32 4684, %13
%15 = sub nsw i32 %12, %14
store i32 %15, i32* %7
%16 = load i32, i32* %7
%17 = call i32 @VP8ClipUV(i32 %16)
ret i32 %17
}

LLVM IR (-O2):
define i32 @VP8RGBToV(i32 %0, i32 %1, i32 %2) {
%4 = mul nsw i32 %0, 28800
%5 = mul i32 %1, -24116
%6 = add i32 %5, %4
%7 = mul i32 %2, -4684
%8 = add i32 %6, %7
%9 = tail call i32 @VP8ClipUV(i32 %8)
ret i32 %9
}
long long r12(void *x) { return *(long long *)(x + 32756); }


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

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

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

LLVM IR (-O2):
define i64 @r12(i8* nocapture %0) {
%2 = getelementptr i8, i8* %0, i64 32756
%3 = bitcast i8* %2 to i64*
%4 = load i64, i64* %3
ret i64 %4
}
double norm2(double x1, double y1, double x2, double y2) {
  double xd = x2 - x1;
  double yd = y2 - y1;
  return xd * xd + yd * yd;
}


x86 assembly (clang, -O0):
<norm2>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
subsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x20(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm2
movsd  -0x30(%rbp),%xmm1
mulsd  -0x30(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<norm2>:
subsd  %xmm0,%xmm2
subsd  %xmm1,%xmm3
mulsd  %xmm3,%xmm3
mulsd  %xmm2,%xmm2
addsd  %xmm3,%xmm2
movapd %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @norm2(double %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%11 = load double, double* %7
%12 = load double, double* %5
%13 = fsub double %11, %12
store double %13, double* %9
%14 = load double, double* %8
%15 = load double, double* %6
%16 = fsub double %14, %15
store double %16, double* %10
%17 = load double, double* %9
%18 = load double, double* %9
%19 = load double, double* %10
%20 = load double, double* %10
%21 = fmul double %19, %20
%22 = call double @llvm.fmuladd.f64(double %17, double %18, double %21)
ret double %22
}

LLVM IR (-O2):
define double @norm2(double %0, double %1, double %2, double %3) {
%5 = fsub double %2, %0
%6 = fsub double %3, %1
%7 = fmul double %6, %6
%8 = tail call double @llvm.fmuladd.f64(double %5, double %5, double %7)
ret double %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main() {
  int a, b;
  scanf("%i %i", &a, &b);
  printf("X = %i\n", a + b);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1040 <scanf@plt>
mov    (%rsp),%esi
add    0x4(%rsp),%esi
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%i %i\00"
@.str.1 = [8 x i8] c"X = %i\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %3)
%5 = load i32, i32* %2
%6 = load i32, i32* %3
%7 = add nsw i32 %5, %6
%8 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"%i %i\00"
@.str.1 = [8 x i8] c"X = %i\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = add nsw i32 %7, %6
%9 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 %8)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
main() {
  printf("Hello world.\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [13 x i8] c"Hello world.\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret i32 0
}
__attribute__((always_)) void mpol_put(struct mempolicy *p) {}


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

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

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

LLVM IR (-O2):
%struct.mempolicy = type opaque
define void @mpol_put(%struct.mempolicy* nocapture %0) {
ret void
}
/* Variables and functions */
int func(int, int);
int func2(int);
int square(int);
int main(void) {
  int temp;
  temp = 4;
  temp = func(temp, 16);
  temp = temp + square(8);
  temp = func2(16);
  return temp;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x4,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    $0x10,%esi
call   1050 <func@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    $0x8,%edi
call   1030 <square@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    $0x10,%edi
call   1040 <func2@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x4,%edi
mov    $0x10,%esi
call   1050 <func@plt>
mov    $0x8,%edi
call   1030 <square@plt>
mov    $0x10,%edi
pop    %rax
jmp    1040 <func2@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 4, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @func(i32 %3, i32 16)
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = call i32 @square(i32 8)
%7 = add nsw i32 %5, %6
store i32 %7, i32* %2
%8 = call i32 @func2(i32 16)
store i32 %8, i32* %2
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @func(i32 4, i32 16)
%2 = tail call i32 @square(i32 8)
%3 = tail call i32 @func2(i32 16)
ret i32 %3
}
int main() {
  int *i;
  int test = 0;
  i = &test;
  printf("Wert von test = %i\n", test);
  printf("Adresse von test = %i\n", &test);
  printf("Adresse auf die i zeigt = %i\n", i);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x14(%rbp)
lea    -0x14(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x14(%rbp),%esi
lea    0xec8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xece(%rip),%rdi
lea    -0x14(%rbp),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rsi
lea    0xecf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movl   $0x0,0xc(%rsp)
lea    0xedc(%rip),%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xee0(%rip),%rdi
lea    0xc(%rsp),%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xee1(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"Wert von test = %i\0A\00"
@.str.1 = [23 x i8] c"Adresse von test = %i\0A\00"
@.str.2 = [30 x i8] c"Adresse auf die i zeigt = %i\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %3
store i32* %3, i32** %2
%4 = load i32, i32* %3
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%7 = load i32*, i32** %2
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0), i32* %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [20 x i8] c"Wert von test = %i\0A\00"
@.str.1 = [23 x i8] c"Adresse von test = %i\0A\00"
@.str.2 = [30 x i8] c"Adresse auf die i zeigt = %i\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 0)
%4 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0), i32* %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ plcvm_get_bool(scalar_t__);
scalar_t__ plcvm_lpm_u8();
int plcvm_pop();
int /*<<< orphan*/ plcvm_push(int /*<<< orphan*/);
void cb_ldm_b1_cs8(void) {
  plcvm_push(plcvm_get_bool(plcvm_pop() * 32 + plcvm_lpm_u8()));
}


x86 assembly (clang, -O0):
<cb_ldm_b1_cs8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <plcvm_pop@plt>
shl    $0x5,%eax
cltq
mov    %rax,-0x8(%rbp)
mov    $0x0,%al
call   1060 <plcvm_lpm_u8@plt>
mov    -0x8(%rbp),%rdi
add    %rax,%rdi
call   1050 <plcvm_get_bool@plt>
mov    %eax,%edi
call   1040 <plcvm_push@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cb_ldm_b1_cs8>:
push   %rbx
xor    %eax,%eax
call   1030 <plcvm_pop@plt>
shl    $0x5,%eax
movslq %eax,%rbx
xor    %eax,%eax
call   1060 <plcvm_lpm_u8@plt>
add    %rax,%rbx
mov    %rbx,%rdi
call   1050 <plcvm_get_bool@plt>
mov    %eax,%edi
pop    %rbx
jmp    1040 <plcvm_push@plt>

LLVM IR (-O0):
define void @cb_ldm_b1_cs8() {
%1 = call i32 (...) @plcvm_pop()
%2 = mul nsw i32 %1, 32
%3 = sext i32 %2 to i64
%4 = call i64 (...) @plcvm_lpm_u8()
%5 = add nsw i64 %3, %4
%6 = call i32 @plcvm_get_bool(i64 %5)
%7 = call i32 @plcvm_push(i32 %6)
ret void
}

LLVM IR (-O2):
define void @cb_ldm_b1_cs8() {
%1 = tail call i32 (...) @plcvm_pop()
%2 = shl nsw i32 %1, 5
%3 = sext i32 %2 to i64
%4 = tail call i64 (...) @plcvm_lpm_u8()
%5 = add nsw i64 %4, %3
%6 = tail call i32 @plcvm_get_bool(i64 %5)
%7 = tail call i32 @plcvm_push(i32 %6)
ret void
}
/* Variables and functions */
float asin(float);
float Q_asin(float c) {
  float angle;
  angle = asin(c);
  if (angle > 1.57079632679489661923f) {
    return 1.57079632679489661923f;
  }
  if (angle < -1.57079632679489661923f) {
    return -1.57079632679489661923f;
  }
  return angle;
}


x86 assembly (clang, -O0):
<Q_asin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
call   1030 <asin@plt>
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
movss  0xec7(%rip),%xmm1
ucomiss %xmm1,%xmm0
jbe    1154 <Q_asin+0x44>
movss  0xeb6(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1182 <Q_asin+0x72>
movss  0xea8(%rip),%xmm0
ucomiss -0xc(%rbp),%xmm0
jbe    1178 <Q_asin+0x68>
movss  0xe96(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1182 <Q_asin+0x72>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Q_asin>:
push   %rax
call   1030 <asin@plt>
movss  0xee2(%rip),%xmm2
maxss  %xmm0,%xmm2
movss  0xeda(%rip),%xmm3
movaps %xmm3,%xmm1
cmpltss %xmm0,%xmm1
movaps %xmm1,%xmm0
andnps %xmm2,%xmm0
andps  %xmm3,%xmm1
orps   %xmm0,%xmm1
movaps %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @Q_asin(float %0) {
%2 = alloca float
%3 = alloca float
%4 = alloca float
store float %0, float* %3
%5 = load float, float* %3
%6 = call float @asin(float %5)
store float %6, float* %4
%7 = load float, float* %4
%8 = fcmp ogt float %7, 0x3FF921FB60000000
br i1 %8, label %9, label %10
9: ; preds = %1
store float 0x3FF921FB60000000, float* %2
br label %16
10: ; preds = %1
%11 = load float, float* %4
%12 = fcmp olt float %11, 0xBFF921FB60000000
br i1 %12, label %13, label %14
13: ; preds = %10
store float 0xBFF921FB60000000, float* %2
br label %16
14: ; preds = %10
%15 = load float, float* %4
store float %15, float* %2
br label %16
16: ; preds = %14, %13, %9
%17 = load float, float* %2
ret float %17
}

LLVM IR (-O2):
define float @Q_asin(float %0) {
%2 = tail call float @asin(float %0)
%3 = fcmp ogt float %2, 0x3FF921FB60000000
%4 = fcmp olt float %2, 0xBFF921FB60000000
%5 = select i1 %4, float 0xBFF921FB60000000, float %2
%6 = select i1 %3, float 0x3FF921FB60000000, float %5
ret float %6
}
/* Variables and functions */
scalar_t__ strlen(char *);
int ParamsLen(int argc, char **argv) {
  int i;
  int len = 0;
  for (i = 0; i < argc; i++)
    len += strlen(argv[i]) + 1;
  return len;
}


x86 assembly (clang, -O0):
<ParamsLen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1169 <ParamsLen+0x59>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <strlen@plt>
mov    %rax,%rcx
add    $0x1,%rcx
movslq -0x18(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112d <ParamsLen+0x1d>
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ParamsLen>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %edi,%edi
jle    114b <ParamsLen+0x3b>
mov    %rsi,%r14
mov    %edi,%r15d
xor    %ebx,%ebx
xor    %r12d,%r12d
nopw   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdi
call   1030 <strlen@plt>
add    %eax,%r12d
add    $0x1,%r12d
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <ParamsLen+0x20>
jmp    114e <ParamsLen+0x3e>
xor    %r12d,%r12d
mov    %r12d,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i32 @ParamsLen(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %17
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %15, %6 ]
%8 = phi i32 [ 0, %4 ], [ %14, %6 ]
%9 = getelementptr inbounds i8*, i8** %1, i64 %7
%10 = load i8*, i8** %9
%11 = tail call i64 @strlen(i8* dereferenceable(1) %10)
%12 = trunc i64 %11 to i32
%13 = add i32 %8, 1
%14 = add i32 %13, %12
%15 = add nuw nsw i64 %7, 1
%16 = icmp eq i64 %15, %5
br i1 %16, label %17, label %6
17: ; preds = %6, %2
%18 = phi i32 [ 0, %2 ], [ %14, %6 ]
ret i32 %18
}
int CCutil_sbits(x)
unsigned int x;
{
  int i;
  int ux = x;
  unsigned int b;
  i = 32;
  b = ((unsigned int)1) << 31;
  while ((ux & b) == 0 && i > 1) {
    b >>= 1;
    i--;
  }
  return i;
}


x86 assembly (clang, -O0):
<CCutil_sbits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
movl   $0x20,-0x8(%rbp)
movl   $0x80000000,-0x10(%rbp)
mov    -0xc(%rbp),%ecx
and    -0x10(%rbp),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x11(%rbp)
jne    1139 <CCutil_sbits+0x39>
cmpl   $0x1,-0x8(%rbp)
setg   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1149 <CCutil_sbits+0x49>
jmp    1160 <CCutil_sbits+0x60>
mov    -0x10(%rbp),%eax
shr    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    111b <CCutil_sbits+0x1b>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<CCutil_sbits>:
test   %edi,%edi
js     1121 <CCutil_sbits+0x21>
mov    $0x20,%edx
mov    $0x80000000,%ecx
xchg   %ax,%ax
shr    %ecx
lea    -0x1(%rdx),%eax
test   %edi,%ecx
jne    1120 <CCutil_sbits+0x20>
cmp    $0x2,%edx
mov    %eax,%edx
ja     1110 <CCutil_sbits+0x10>
ret
mov    $0x20,%eax
ret

LLVM IR (-O0):
define i32 @CCutil_sbits(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %2
%6 = load i32, i32* %2
store i32 %6, i32* %4
store i32 32, i32* %3
store i32 -2147483648, i32* %5
br label %7
7: ; preds = %17, %1
%8 = load i32, i32* %4
%9 = load i32, i32* %5
%10 = and i32 %8, %9
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %15
12: ; preds = %7
%13 = load i32, i32* %3
%14 = icmp sgt i32 %13, 1
br label %15
15: ; preds = %12, %7
%16 = phi i1 [ false, %7 ], [ %14, %12 ]
br i1 %16, label %17, label %22
17: ; preds = %15
%18 = load i32, i32* %5
%19 = lshr i32 %18, 1
store i32 %19, i32* %5
%20 = load i32, i32* %3
%21 = add nsw i32 %20, -1
store i32 %21, i32* %3
br label %7
22: ; preds = %15
%23 = load i32, i32* %3
ret i32 %23
}

LLVM IR (-O2):
define i32 @CCutil_sbits(i32 %0) {
%2 = icmp sgt i32 %0, -1
br i1 %2, label %3, label %12
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ -2147483648, %1 ]
%5 = phi i32 [ %7, %3 ], [ 32, %1 ]
%6 = lshr i32 %4, 1
%7 = add nsw i32 %5, -1
%8 = and i32 %6, %0
%9 = icmp eq i32 %8, 0
%10 = icmp ugt i32 %5, 2
%11 = select i1 %9, i1 %10, i1 false
br i1 %11, label %3, label %12
12: ; preds = %3, %1
%13 = phi i32 [ 32, %1 ], [ %7, %3 ]
ret i32 %13
}