xunge/DecIR huggingface dataset:
void LIS302DL_DeInit(void) {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
void sc_cleanup_file(FILE **ptr) {
  if (ptr != NULL && *ptr != NULL) {
    fclose(*ptr);
  }
}


x86 assembly (clang, -O0):
<sc_cleanup_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1141 <sc_cleanup_file+0x31>
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
je     1141 <sc_cleanup_file+0x31>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <fclose@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sc_cleanup_file>:
test   %rdi,%rdi
je     1122 <sc_cleanup_file+0x12>
mov    (%rdi),%rdi
test   %rdi,%rdi
je     1122 <sc_cleanup_file+0x12>
jmp    1030 <fclose@plt>
ret

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

LLVM IR (-O2):
define void @sc_cleanup_file(i32** %0) {
%2 = icmp eq i32** %0, null
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = load i32*, i32** %0
%5 = icmp eq i32* %4, null
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i32 @fclose(i32* %4)
br label %8
8: ; preds = %6, %3, %1
ret void
}
long long int longlongint_ignoring_longint(long long int x, long int y) {
  return x;
}


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

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

LLVM IR (-O0):
define i64 @longlongint_ignoring_longint(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
ret i64 %5
}

LLVM IR (-O2):
define i64 @longlongint_ignoring_longint(i64 returned %0, i64 %1) {
ret i64 %0
}
/* Variables and functions */
double atof(char *);
int cmpnumber(char *str1, char *str2) {
  double a, b;
  a = atof(str1);
  b = atof(str2);
  if (a > b)
    return 1;
  else if (a == b)
    return 0;
  else
    return -1;
}


x86 assembly (clang, -O0):
<cmpnumber>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <atof@plt>
movsd  %xmm0,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <atof@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  -0x20(%rbp),%xmm0
ucomisd -0x28(%rbp),%xmm0
jbe    1158 <cmpnumber+0x48>
movl   $0x1,-0x4(%rbp)
jmp    1181 <cmpnumber+0x71>
movsd  -0x20(%rbp),%xmm0
ucomisd -0x28(%rbp),%xmm0
jne    117a <cmpnumber+0x6a>
jp     117a <cmpnumber+0x6a>
movl   $0x0,-0x4(%rbp)
jmp    1181 <cmpnumber+0x71>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmpnumber>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
call   1030 <atof@plt>
movsd  %xmm0,0x8(%rsp)
mov    %rbx,%rdi
call   1030 <atof@plt>
movsd  0x8(%rsp),%xmm1
ucomisd %xmm0,%xmm1
cmpneqsd %xmm0,%xmm1
movq   %xmm1,%rcx
mov    $0x1,%eax
cmovbe %ecx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @cmpnumber(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca double
%7 = alloca double
store i8* %0, i8** %4
store i8* %1, i8** %5
%8 = load i8*, i8** %4
%9 = call double @atof(i8* %8)
store double %9, double* %6
%10 = load i8*, i8** %5
%11 = call double @atof(i8* %10)
store double %11, double* %7
%12 = load double, double* %6
%13 = load double, double* %7
%14 = fcmp ogt double %12, %13
br i1 %14, label %15, label %16
15: ; preds = %2
store i32 1, i32* %3
br label %22
16: ; preds = %2
%17 = load double, double* %6
%18 = load double, double* %7
%19 = fcmp oeq double %17, %18
br i1 %19, label %20, label %21
20: ; preds = %16
store i32 0, i32* %3
br label %22
21: ; preds = %16
store i32 -1, i32* %3
br label %22
22: ; preds = %21, %20, %15
%23 = load i32, i32* %3
ret i32 %23
}

LLVM IR (-O2):
define i32 @cmpnumber(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call double @atof(i8* %0)
%4 = tail call double @atof(i8* %1)
%5 = fcmp ogt double %3, %4
%6 = fcmp une double %3, %4
%7 = sext i1 %6 to i32
%8 = select i1 %5, i32 1, i32 %7
ret i32 %8
}
/* Variables and functions */
int mypow(int, int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main() {
  int n, m;
  printf("Please input two integers:");
  scanf("%d%d", &n, &m);
  printf("The result is %d.\n", mypow(n, m));
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [27 x i8] c"Please input two integers:\00"
@.str.1 = [5 x i8] c"%d%d\00"
@.str.2 = [19 x i8] c"The result is %d.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32* %2, i32* %3)
%6 = load i32, i32* %2
%7 = load i32, i32* %3
%8 = call i32 @mypow(i32 %6, i32 %7)
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i32 %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [27 x i8] c"Please input two integers:\00"
@.str.1 = [5 x i8] c"%d%d\00"
@.str.2 = [19 x i8] c"The result is %d.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32* %1, i32* %2)
%7 = load i32, i32* %1
%8 = load i32, i32* %2
%9 = call i32 @mypow(i32 %7, i32 %8)
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i32 %9)
ret i32 0
}
/* Variables and functions */
scalar_t__ _beginthread(void (*)(void *), int /*<<< orphan*/, void *);
int lw_thread_start(void (*func)(void *), void *args) {
  int result = 0;
  if (_beginthread(func, 0, args) != 0) {
    result = 1;
  }
  return result;
}


x86 assembly (clang, -O0):
<lw_thread_start>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
xor    %esi,%esi
call   1030 <_beginthread@plt>
cmp    $0x0,%rax
je     1147 <lw_thread_start+0x37>
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @lw_thread_start(void (i8*)* %0, i8* %1) {
%3 = tail call i64 @_beginthread(void (i8*)* %0, i32 0, i8* %1)
%4 = icmp ne i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
void Data_Stop(char *initializer_fct) {
  if (initializer_fct == NULL)
    return;
}


x86 assembly (clang, -O0):
<Data_Stop>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1118 <Data_Stop+0x18>
jmp    1118 <Data_Stop+0x18>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @Data_Stop(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %6
5: ; preds = %1
br label %6
6: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @Data_Stop(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ debug(char *, ...);
int M241_f(char *s) {
  debug("M241_f(const char *s) is not yet implemented!\n");
  debug("%s\n", s);
  return 1;
}


x86 assembly (clang, -O0):
<M241_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    -0x8(%rbp),%rsi
lea    0xefa(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<M241_f>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <debug@plt>
lea    0xf06(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <debug@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [47 x i8] c"M241_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M241_f(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 1
}

LLVM IR (-O2):
@.str = [47 x i8] c"M241_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M241_f(i8* %0) {
%2 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret i32 1
}
int main() {
  4;
  4;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
long locate(int xx, int yy, int zz) {
  long xyz;
  xyz = (xx * yy * zz + xx * 17 + yy * 19 + zz * 23);
  return (xyz);
}


x86 assembly (clang, -O0):
<locate>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x8(%rbp),%eax
imul   -0xc(%rbp),%eax
imul   $0x11,-0x4(%rbp),%ecx
add    %ecx,%eax
imul   $0x13,-0x8(%rbp),%ecx
add    %ecx,%eax
imul   $0x17,-0xc(%rbp),%ecx
add    %ecx,%eax
cltq
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<locate>:
lea    (%rsi,%rsi,8),%eax
lea    (%rsi,%rax,2),%eax
mov    %esi,%ecx
imul   %edi,%ecx
mov    %edi,%esi
shl    $0x4,%esi
add    %edi,%esi
add    %esi,%eax
add    $0x17,%ecx
imul   %edx,%ecx
add    %eax,%ecx
movslq %ecx,%rax
ret

LLVM IR (-O0):
define i64 @locate(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i64
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %4
%9 = load i32, i32* %5
%10 = mul nsw i32 %8, %9
%11 = load i32, i32* %6
%12 = mul nsw i32 %10, %11
%13 = load i32, i32* %4
%14 = mul nsw i32 %13, 17
%15 = add nsw i32 %12, %14
%16 = load i32, i32* %5
%17 = mul nsw i32 %16, 19
%18 = add nsw i32 %15, %17
%19 = load i32, i32* %6
%20 = mul nsw i32 %19, 23
%21 = add nsw i32 %18, %20
%22 = sext i32 %21 to i64
store i64 %22, i64* %7
%23 = load i64, i64* %7
ret i64 %23
}

LLVM IR (-O2):
define i64 @locate(i32 %0, i32 %1, i32 %2) {
%4 = mul i32 %1, %0
%5 = mul nsw i32 %0, 17
%6 = mul nsw i32 %1, 19
%7 = add i32 %4, 23
%8 = mul i32 %7, %2
%9 = add i32 %6, %5
%10 = add i32 %9, %8
%11 = sext i32 %10 to i64
ret i64 %11
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_size;
};
typedef int /*<<< orphan*/ off_t;

/* Variables and functions */
int stat(char *, struct stat *);
off_t get_file_size(char *file) {
  struct stat st;
  if (stat(file, &st) == -1)
    return 0;
  return (off_t)st.st_size;
}


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

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

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

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @get_file_size(i8* nocapture %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i32 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i32 %4, -1
%6 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%7 = load i32, i32* %6
%8 = select i1 %5, i32 0, i32 %7
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ DisposePtr(char *);
void gDisposePtr(unsigned char *thisPtr) {
  if (thisPtr)
    DisposePtr((char *)thisPtr);
}


x86 assembly (clang, -O0):
<gDisposePtr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <gDisposePtr+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <DisposePtr@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gDisposePtr>:
test   %rdi,%rdi
je     111a <gDisposePtr+0xa>
jmp    1030 <DisposePtr@plt>
ret

LLVM IR (-O0):
define void @gDisposePtr(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 %8
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = call i32 @DisposePtr(i8* %6)
br label %8
8: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @gDisposePtr(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @DisposePtr(i8* %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Type definitions */
typedef int ssize_t;

/* Variables and functions */
int /*<<< orphan*/ basic_test(int);
int /*<<< orphan*/ cleanup_test();
int /*<<< orphan*/ init_test();
int log_write_start(int);
void write_one_meg_start(void) {
  ssize_t n;
  init_test();
  n = log_write_start(1048576);
  basic_test(n == 1048576);
  cleanup_test();
}


x86 assembly (clang, -O0):
<write_one_meg_start>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1060 <init_test@plt>
mov    $0x100000,%edi
call   1050 <log_write_start@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x100000,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <basic_test@plt>
mov    $0x0,%al
call   1040 <cleanup_test@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_one_meg_start>:
push   %rax
xor    %eax,%eax
call   1060 <init_test@plt>
mov    $0x100000,%edi
call   1050 <log_write_start@plt>
xor    %edi,%edi
cmp    $0x100000,%eax
sete   %dil
call   1030 <basic_test@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <cleanup_test@plt>

LLVM IR (-O0):
define void @write_one_meg_start() {
%1 = alloca i32
%2 = call i32 (...) @init_test()
%3 = call i32 @log_write_start(i32 1048576)
store i32 %3, i32* %1
%4 = load i32, i32* %1
%5 = icmp eq i32 %4, 1048576
%6 = zext i1 %5 to i32
%7 = call i32 @basic_test(i32 %6)
%8 = call i32 (...) @cleanup_test()
ret void
}

LLVM IR (-O2):
define void @write_one_meg_start() {
%1 = tail call i32 (...) @init_test()
%2 = tail call i32 @log_write_start(i32 1048576)
%3 = icmp eq i32 %2, 1048576
%4 = zext i1 %3 to i32
%5 = tail call i32 @basic_test(i32 %4)
%6 = tail call i32 (...) @cleanup_test()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "Try `rmdir --help' for more information\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [41 x i8] c"Try `rmdir --help' for more information\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [41 x i8] c"Try `rmdir --help' for more information\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
struct radix_tree_node {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct radix_tree_node *);
void radix_tree_node_free(struct radix_tree_node *node) { free(node); }


x86 assembly (clang, -O0):
<radix_tree_node_free>:
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):
<radix_tree_node_free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
%struct.radix_tree_node = type { i32 }
define void @radix_tree_node_free(%struct.radix_tree_node* nocapture %0) {
%2 = tail call i32 @free(%struct.radix_tree_node* %0)
ret void
}
void menu_state_recv_msg(void *msg) {}


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

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

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

LLVM IR (-O2):
define void @menu_state_recv_msg(i8* nocapture %0) {
ret void
}
void copyVec3f(float *out, float *in) {
  out[0] = in[0];
  out[1] = in[1];
  out[2] = in[2];
}


x86 assembly (clang, -O0):
<copyVec3f>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movss  0x4(%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x4(%rax)
mov    -0x10(%rbp),%rax
movss  0x8(%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<copyVec3f>:
movss  (%rsi),%xmm0
movss  %xmm0,(%rdi)
movss  0x4(%rsi),%xmm0
movss  %xmm0,0x4(%rdi)
movss  0x8(%rsi),%xmm0
movss  %xmm0,0x8(%rdi)
ret

LLVM IR (-O0):
define void @copyVec3f(float* %0, float* %1) {
%3 = alloca float*
%4 = alloca float*
store float* %0, float** %3
store float* %1, float** %4
%5 = load float*, float** %4
%6 = getelementptr inbounds float, float* %5, i64 0
%7 = load float, float* %6
%8 = load float*, float** %3
%9 = getelementptr inbounds float, float* %8, i64 0
store float %7, float* %9
%10 = load float*, float** %4
%11 = getelementptr inbounds float, float* %10, i64 1
%12 = load float, float* %11
%13 = load float*, float** %3
%14 = getelementptr inbounds float, float* %13, i64 1
store float %12, float* %14
%15 = load float*, float** %4
%16 = getelementptr inbounds float, float* %15, i64 2
%17 = load float, float* %16
%18 = load float*, float** %3
%19 = getelementptr inbounds float, float* %18, i64 2
store float %17, float* %19
ret void
}

LLVM IR (-O2):
define void @copyVec3f(float* nocapture writeonly %0, float* nocapture %1) {
%3 = load float, float* %1
store float %3, float* %0
%4 = getelementptr inbounds float, float* %1, i64 1
%5 = load float, float* %4
%6 = getelementptr inbounds float, float* %0, i64 1
store float %5, float* %6
%7 = getelementptr inbounds float, float* %1, i64 2
%8 = load float, float* %7
%9 = getelementptr inbounds float, float* %0, i64 2
store float %8, float* %9
ret void
}
/* Variables and functions */
char const *out_get_errormsg();
const char *pmemblk_errormsg(void) { return out_get_errormsg(); }


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

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

LLVM IR (-O0):
define i8* @pmemblk_errormsg() {
%1 = call i8* (...) @out_get_errormsg()
ret i8* %1
}

LLVM IR (-O2):
define i8* @pmemblk_errormsg() {
%1 = tail call i8* (...) @out_get_errormsg()
ret i8* %1
}
void sws_alloc_context() {}


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

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

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

LLVM IR (-O2):
define void @sws_alloc_context() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ UART0_PutChar(unsigned char);
void putc(unsigned char c) { UART0_PutChar(c); }


x86 assembly (clang, -O0):
<putc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edi
call   1030 <UART0_PutChar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putc>:
jmp    1030 <UART0_PutChar@plt>

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

LLVM IR (-O2):
define void @putc(i8 zeroext %0) {
%2 = tail call i32 @UART0_PutChar(i8 zeroext %0)
ret void
}
/* Variables and functions */
uintptr_t LOG2_DOWN(uintptr_t value) {
  uintptr_t l = 0;
  while ((value >> l) > 1)
    ++l;
  return l;
}


x86 assembly (clang, -O0):
<LOG2_DOWN>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
shr    %cl,%rax
cmp    $0x1,%rax
jbe    1136 <LOG2_DOWN+0x36>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <LOG2_DOWN+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<LOG2_DOWN>:
mov    $0xffffffffffffffff,%rcx
nopw   0x0(%rax,%rax,1)
add    $0x1,%rcx
mov    %rdi,%rax
shr    %cl,%rax
cmp    $0x1,%rax
ja     1110 <LOG2_DOWN+0x10>
mov    %rcx,%rax
ret

LLVM IR (-O0):
define i64 @LOG2_DOWN(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
store i64 0, i64* %3
br label %4
4: ; preds = %9, %1
%5 = load i64, i64* %2
%6 = load i64, i64* %3
%7 = lshr i64 %5, %6
%8 = icmp ugt i64 %7, 1
br i1 %8, label %9, label %12
9: ; preds = %4
%10 = load i64, i64* %3
%11 = add i64 %10, 1
store i64 %11, i64* %3
br label %4
12: ; preds = %4
%13 = load i64, i64* %3
ret i64 %13
}

LLVM IR (-O2):
define i64 @LOG2_DOWN(i64 %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ 0, %1 ], [ %6, %2 ]
%4 = lshr i64 %0, %3
%5 = icmp ugt i64 %4, 1
%6 = add i64 %3, 1
br i1 %5, label %2, label %7
7: ; preds = %2
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
long syscall(int, int);
int main() {
  int guess;
  printf("Guess the kernels favorite number: ");
  scanf("%d", &guess);
  long int rtn = syscall(351, guess);
  printf("System call sys_guessNum return %ld\nCheck dmesg\n", rtn);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed0(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%esi
mov    $0x15f,%edi
call   1040 <syscall@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xeae(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [36 x i8] c"Guess the kernels favorite number: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [49 x i8] c"System call sys_guessNum return %ld\0ACheck dmesg\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i64
store i32 0, i32* %1
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%6 = load i32, i32* %2
%7 = call i64 @syscall(i32 351, i32 %6)
store i64 %7, i64* %3
%8 = load i64, i64* %3
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.2, i64 0, i64 0), i64 %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [36 x i8] c"Guess the kernels favorite number: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [49 x i8] c"System call sys_guessNum return %ld\0ACheck dmesg\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i64 @syscall(i32 351, i32 %5)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @.str.2, i64 0, i64 0), i64 %6)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ uart_putc(char);
void uart_puts(const char *s) {
  while (*s) {
    if (*s == '\n') {
      uart_putc('\r');
    }
    uart_putc(*s++);
  }
}


x86 assembly (clang, -O0):
<uart_puts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     115f <uart_puts+0x4f>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
jne    1143 <uart_puts+0x33>
mov    $0xd,%edi
call   1030 <uart_putc@plt>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
call   1030 <uart_putc@plt>
jmp    111c <uart_puts+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uart_puts>:
push   %rbx
mov    %rdi,%rbx
jmp    1139 <uart_puts+0x29>
cs nopw 0x0(%rax,%rax,1)
mov    $0xd,%edi
call   1030 <uart_putc@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
movsbl %al,%edi
call   1030 <uart_putc@plt>
movzbl (%rbx),%eax
cmp    $0xa,%al
je     1120 <uart_puts+0x10>
test   %al,%al
jne    112d <uart_puts+0x1d>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @uart_puts(i8* nocapture %0) {
br label %2
2: ; preds = %8, %1
%3 = phi i8* [ %0, %1 ], [ %10, %8 ]
%4 = load i8, i8* %3
switch i8 %4, label %8 [
i8 0, label %12
i8 10, label %5
]
5: ; preds = %2
%6 = tail call i32 @uart_putc(i8 signext 13)
%7 = load i8, i8* %3
br label %8
8: ; preds = %2, %5
%9 = phi i8 [ %4, %2 ], [ %7, %5 ]
%10 = getelementptr inbounds i8, i8* %3, i64 1
%11 = tail call i32 @uart_putc(i8 signext %9)
br label %2
12: ; preds = %2
ret void
}
/* Variables and functions */
scalar_t__ memcmp(int /*<<< orphan*/, char *, int);
int token_follows(char *p, char *q, int size) {
  while (*p) {
    if (memcmp(p++, q, size) == 0)
      return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<token_follows>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1168 <token_follows+0x58>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    %eax,%edi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1030 <memcmp@plt>
cmp    $0x0,%rax
jne    1163 <token_follows+0x53>
movl   $0x1,-0x4(%rbp)
jmp    116f <token_follows+0x5f>
jmp    1123 <token_follows+0x13>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<token_follows>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edx,%r14d
mov    %rsi,%r15
mov    %rdi,%rbx
mov    %rdi,%rbp
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
cmpb   $0x0,0x0(%rbp)
je     1156 <token_follows+0x46>
add    $0x1,%rbp
mov    %ebx,%edi
mov    %r15,%rsi
mov    %r14d,%edx
call   1030 <memcmp@plt>
add    $0x1,%ebx
test   %rax,%rax
jne    1130 <token_follows+0x20>
mov    $0x1,%eax
jmp    1158 <token_follows+0x48>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @token_follows(i8* %0, i8* %1, i32 %2) {
br label %4
4: ; preds = %8, %3
%5 = phi i8* [ %0, %3 ], [ %9, %8 ]
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
br i1 %7, label %14, label %8
8: ; preds = %4
%9 = getelementptr inbounds i8, i8* %5, i64 1
%10 = ptrtoint i8* %5 to i64
%11 = trunc i64 %10 to i32
%12 = tail call i64 @memcmp(i32 %11, i8* %1, i32 %2)
%13 = icmp eq i64 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %8
%15 = phi i32 [ 1, %8 ], [ 0, %4 ]
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *malloc(int);
void mixed_ne_eq(int a) {
  char *b = ((void *)0);
  if (a != 1)
    b = malloc(1);
  if (a + 1U == 2)
    return;
  if (a - 1U == 0)
    return;
  free(b);
}


x86 assembly (clang, -O0):
<mixed_ne_eq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
cmpl   $0x1,-0x4(%rbp)
je     114b <mixed_ne_eq+0x2b>
mov    $0x1,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
cmp    $0x2,%eax
jne    115f <mixed_ne_eq+0x3f>
jmp    117c <mixed_ne_eq+0x5c>
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
cmp    $0x0,%eax
jne    1173 <mixed_ne_eq+0x53>
jmp    117c <mixed_ne_eq+0x5c>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mixed_ne_eq>:
cmp    $0x1,%edi
jne    1126 <mixed_ne_eq+0x6>
ret
push   %rax
mov    $0x1,%edi
call   1040 <malloc@plt>
mov    %rax,%rdi
pop    %rax
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @mixed_ne_eq(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
store i8* null, i8** %3
%4 = load i32, i32* %2
%5 = icmp ne i32 %4, 1
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i8* @malloc(i32 1)
store i8* %7, i8** %3
br label %8
8: ; preds = %6, %1
%9 = load i32, i32* %2
%10 = add i32 %9, 1
%11 = icmp eq i32 %10, 2
br i1 %11, label %12, label %13
12: ; preds = %8
br label %21
13: ; preds = %8
%14 = load i32, i32* %2
%15 = sub i32 %14, 1
%16 = icmp eq i32 %15, 0
br i1 %16, label %17, label %18
17: ; preds = %13
br label %21
18: ; preds = %13
%19 = load i8*, i8** %3
%20 = call i32 @free(i8* %19)
br label %21
21: ; preds = %18, %17, %12
ret void
}

LLVM IR (-O2):
define void @mixed_ne_eq(i32 %0) {
%2 = icmp eq i32 %0, 1
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = tail call dereferenceable_or_null(1) i8* @malloc(i32 1)
%5 = tail call i32 @free(i8* %4)
br label %6
6: ; preds = %1, %3
ret void
}
int mkclos(state)
int state;
{ return (mkopt(mkposcl(state))); }


x86 assembly (clang, -O0):
<mkclos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x0,%al
call   1030 <mkposcl@plt>
mov    %eax,%edi
mov    $0x0,%al
call   1040 <mkopt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mkclos>:
push   %rax
xor    %eax,%eax
call   1030 <mkposcl@plt>
mov    %eax,%edi
xor    %eax,%eax
pop    %rcx
jmp    1040 <mkopt@plt>

LLVM IR (-O0):
define i32 @mkclos(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 (i32, ...) bitcast (i32 (...)* @mkposcl to i32 (i32, ...)*)(i32 %3)
%5 = call i32 (i32, ...) bitcast (i32 (...)* @mkopt to i32 (i32, ...)*)(i32 %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @mkclos(i32 %0) {
%2 = tail call i32 (i32, ...) bitcast (i32 (...)* @mkposcl to i32 (i32, ...)*)(i32 %0)
%3 = tail call i32 (i32, ...) bitcast (i32 (...)* @mkopt to i32 (i32, ...)*)(i32 %2)
ret i32 %3
}
void setspent() {}


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

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

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

LLVM IR (-O2):
define void @setspent() {
ret void
}
void v2set(float *a, float x, float y) {
  a[0] = x;
  a[1] = y;
}


x86 assembly (clang, -O0):
<v2set>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
movss  %xmm1,-0x10(%rbp)
movss  -0xc(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
movss  -0x10(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x4(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<v2set>:
movss  %xmm0,(%rdi)
movss  %xmm1,0x4(%rdi)
ret

LLVM IR (-O0):
define void @v2set(float* %0, float %1, float %2) {
%4 = alloca float*
%5 = alloca float
%6 = alloca float
store float* %0, float** %4
store float %1, float* %5
store float %2, float* %6
%7 = load float, float* %5
%8 = load float*, float** %4
%9 = getelementptr inbounds float, float* %8, i64 0
store float %7, float* %9
%10 = load float, float* %6
%11 = load float*, float** %4
%12 = getelementptr inbounds float, float* %11, i64 1
store float %10, float* %12
ret void
}

LLVM IR (-O2):
define void @v2set(float* nocapture writeonly %0, float %1, float %2) {
store float %1, float* %0
%4 = getelementptr inbounds float, float* %0, i64 1
store float %2, float* %4
ret void
}
char is_primitive_type(unsigned int tag) {
  return (tag & 0xc0) == 0 && (tag & 0x1f) != ((0x10 | 0x20) & 0x1f) &&
         (tag & 0x1f) != ((0x11 | 0x20) & 0x1f);
}


x86 assembly (clang, -O0):
<is_primitive_type>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
and    $0xc0,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x5(%rbp)
jne    1141 <is_primitive_type+0x41>
mov    -0x4(%rbp),%ecx
and    $0x1f,%ecx
xor    %eax,%eax
cmp    $0x10,%ecx
mov    %al,-0x5(%rbp)
je     1141 <is_primitive_type+0x41>
mov    -0x4(%rbp),%eax
and    $0x1f,%eax
cmp    $0x11,%eax
setne  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_primitive_type>:
test   $0xc0,%dil
jne    110e <is_primitive_type+0xe>
and    $0x1f,%edi
cmp    $0x10,%edi
jne    1111 <is_primitive_type+0x11>
xor    %eax,%eax
ret
cmp    $0x11,%edi
setne  %al
ret

LLVM IR (-O0):
define signext i8 @is_primitive_type(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 192
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %14
6: ; preds = %1
%7 = load i32, i32* %2
%8 = and i32 %7, 31
%9 = icmp ne i32 %8, 16
br i1 %9, label %10, label %14
10: ; preds = %6
%11 = load i32, i32* %2
%12 = and i32 %11, 31
%13 = icmp ne i32 %12, 17
br label %14
14: ; preds = %10, %6, %1
%15 = phi i1 [ false, %6 ], [ false, %1 ], [ %13, %10 ]
%16 = zext i1 %15 to i32
%17 = trunc i32 %16 to i8
ret i8 %17
}

LLVM IR (-O2):
define signext i8 @is_primitive_type(i32 %0) {
%2 = and i32 %0, 192
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %10
4: ; preds = %1
%5 = and i32 %0, 31
%6 = icmp eq i32 %5, 16
br i1 %6, label %10, label %7
7: ; preds = %4
%8 = icmp ne i32 %5, 17
%9 = zext i1 %8 to i8
br label %10
10: ; preds = %7, %4, %1
%11 = phi i8 [ 0, %4 ], [ 0, %1 ], [ %9, %7 ]
ret i8 %11
}
AX0AR1(r0, r1, x0, x1, p0, p1) unsigned char r0, r1;
unsigned char *p0, *p1;
{
  if ((((unsigned char *)10000000)[x0]) <= (p1[1111111 / 4]))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<AX0AR1>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%eax
mov    %dil,%sil
mov    %sil,-0x5(%rbp)
mov    %al,-0x6(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
movslq -0xc(%rbp),%rcx
mov    $0x989680,%eax
movzbl (%rax,%rcx,1),%eax
mov    -0x20(%rbp),%rcx
movzbl 0x43d11(%rcx),%ecx
cmp    %ecx,%eax
jg     114a <AX0AR1+0x4a>
movl   $0x1,-0x4(%rbp)
jmp    1151 <AX0AR1+0x51>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<AX0AR1>:
movslq %edx,%rax
mov    0x989680(%rax),%cl
xor    %eax,%eax
cmp    0x43d11(%r9),%cl
setbe  %al
ret

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

LLVM IR (-O2):
define i32 @AX0AR1(i32 %0, i32 %1, i32 %2, i32 %3, i8* nocapture readnone %4, i8* nocapture %5) {
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i8, i8* inttoptr (i64 10000000 to i8*), i64 %7
%9 = load i8, i8* %8
%10 = getelementptr inbounds i8, i8* %5, i64 277777
%11 = load i8, i8* %10
%12 = icmp ule i8 %9, %11
%13 = zext i1 %12 to i32
ret i32 %13
}
double AICc(const double lk, const int k, const int n) {
  return -2 * lk + (2 * k * n) / (n - k - 1);
}


x86 assembly (clang, -O0):
<AICc>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
mov    %esi,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm1
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
imul   -0x10(%rbp),%eax
mov    -0x10(%rbp),%ecx
sub    -0xc(%rbp),%ecx
sub    $0x1,%ecx
cltd
idiv   %ecx
cvtsi2sd %eax,%xmm0
addsd  %xmm1,%xmm1
subsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<AICc>:
mov    %edi,%eax
imul   %esi,%eax
add    %eax,%eax
not    %edi
add    %esi,%edi
cltd
idiv   %edi
cvtsi2sd %eax,%xmm1
addsd  %xmm0,%xmm0
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @AICc(double %0, i32 %1, i32 %2) {
%4 = alloca double
%5 = alloca i32
%6 = alloca i32
store double %0, double* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load double, double* %4
%8 = load i32, i32* %5
%9 = mul nsw i32 2, %8
%10 = load i32, i32* %6
%11 = mul nsw i32 %9, %10
%12 = load i32, i32* %6
%13 = load i32, i32* %5
%14 = sub nsw i32 %12, %13
%15 = sub nsw i32 %14, 1
%16 = sdiv i32 %11, %15
%17 = sitofp i32 %16 to double
%18 = call double @llvm.fmuladd.f64(double -2.000000e+00, double %7, double %17)
ret double %18
}

LLVM IR (-O2):
define double @AICc(double %0, i32 %1, i32 %2) {
%4 = shl nsw i32 %1, 1
%5 = mul nsw i32 %4, %2
%6 = xor i32 %1, -1
%7 = add i32 %6, %2
%8 = sdiv i32 %5, %7
%9 = sitofp i32 %8 to double
%10 = tail call double @llvm.fmuladd.f64(double %0, double -2.000000e+00, double %9)
ret double %10
}
double a52(double a) { return (a + 5) * 2; }


x86 assembly (clang, -O0):
<a52>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xef7(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
movsd  0xee2(%rip),%xmm1
mulsd  %xmm1,%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define double @a52(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fadd double %3, 5.000000e+00
%5 = fmul double %4, 2.000000e+00
ret double %5
}

LLVM IR (-O2):
define double @a52(double %0) {
%2 = fadd double %0, 5.000000e+00
%3 = fmul double %2, 2.000000e+00
ret double %3
}
/* Variables and functions */
int popNumber();
int /*<<< orphan*/ pushNumber(int /*<<< orphan*/);
int /*<<< orphan*/ ysprite(int);
void basYSprite() {
  int n;
  n = popNumber();
  pushNumber(ysprite(n));
}


x86 assembly (clang, -O0):
<basYSprite>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <popNumber@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <ysprite@plt>
mov    %eax,%edi
call   1030 <pushNumber@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<basYSprite>:
push   %rax
xor    %eax,%eax
call   1050 <popNumber@plt>
mov    %eax,%edi
call   1040 <ysprite@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <pushNumber@plt>

LLVM IR (-O0):
define void @basYSprite() {
%1 = alloca i32
%2 = call i32 (...) @popNumber()
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = call i32 @ysprite(i32 %3)
%5 = call i32 @pushNumber(i32 %4)
ret void
}

LLVM IR (-O2):
define void @basYSprite() {
%1 = tail call i32 (...) @popNumber()
%2 = tail call i32 @ysprite(i32 %1)
%3 = tail call i32 @pushNumber(i32 %2)
ret void
}
printn(n) {
  if (n > 9) {
    printn(n / 10);
    n = n % 10;
  }
  xwrite(n + '0');
}


x86 assembly (clang, -O0):
<printn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x9,-0x8(%rbp)
jle    1155 <printn+0x35>
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
call   1030 <printn@plt>
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0x8(%rbp)
mov    -0x8(%rbp),%edi
add    $0x30,%edi
mov    $0x0,%al
call   1040 <xwrite@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printn>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
cmp    $0xa,%edi
jl     1147 <printn+0x27>
mov    %ebp,%eax
mov    $0xcccccccd,%ebx
imul   %rax,%rbx
shr    $0x23,%rbx
mov    %ebx,%edi
call   1030 <printn@plt>
add    %ebx,%ebx
lea    (%rbx,%rbx,4),%eax
sub    %eax,%ebp
add    $0x30,%ebp
mov    %ebp,%edi
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <xwrite@plt>

LLVM IR (-O0):
define i32 @printn(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sgt i32 %4, 9
br i1 %5, label %6, label %12
6: ; preds = %1
%7 = load i32, i32* %3
%8 = sdiv i32 %7, 10
%9 = call i32 @printn(i32 %8)
%10 = load i32, i32* %3
%11 = srem i32 %10, 10
store i32 %11, i32* %3
br label %12
12: ; preds = %6, %1
%13 = load i32, i32* %3
%14 = add nsw i32 %13, 48
%15 = call i32 (i32, ...) bitcast (i32 (...)* @xwrite to i32 (i32, ...)*)(i32 %14)
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
define i32 @printn(i32 %0) {
%2 = icmp sgt i32 %0, 9
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = udiv i32 %0, 10
%5 = tail call i32 @printn(i32 %4)
%6 = urem i32 %0, 10
br label %7
7: ; preds = %3, %1
%8 = phi i32 [ %6, %3 ], [ %0, %1 ]
%9 = add nsw i32 %8, 48
%10 = tail call i32 (i32, ...) bitcast (i32 (...)* @xwrite to i32 (i32, ...)*)(i32 %9)
ret i32 undef
}
/* Variables and functions */
long double rintl(long double);
long double nearbyintl(long double x) {
  x = rintl(x);
  return x;
}


x86 assembly (clang, -O0):
<nearbyintl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <rintl@plt>
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nearbyintl>:
sub    $0x18,%rsp
fldt   0x20(%rsp)
fstpt  (%rsp)
call   1030 <rintl@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define x86_fp80 @nearbyintl(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = call x86_fp80 @llvm.rint.f80(x86_fp80 %3)
store x86_fp80 %4, x86_fp80* %2
%5 = load x86_fp80, x86_fp80* %2
ret x86_fp80 %5
}

LLVM IR (-O2):
define x86_fp80 @nearbyintl(x86_fp80 %0) {
%2 = tail call x86_fp80 @llvm.rint.f80(x86_fp80 %0)
ret x86_fp80 %2
}
/* Variables and functions */
void *test_raise(void *arg) {
  intptr_t ret = 0;
  for (int i = 0; i < 10000; i++) {
  }
  return (void *)ret;
}


x86 assembly (clang, -O0):
<test_raise>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x2710,-0x14(%rbp)
jge    1137 <test_raise+0x37>
jmp    1129 <test_raise+0x29>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1117 <test_raise+0x17>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define noalias i8* @test_raise(i8* nocapture readnone %0) {
ret i8* null
}