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

/* Variables and functions */
struct Foo *return_pointer_20() {
  return NULL;
}


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

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

LLVM IR (-O0):
%struct.Foo = type { i32 }
define %struct.Foo* @return_pointer_20() {
ret %struct.Foo* null
}

LLVM IR (-O2):
%struct.Foo = type { i32 }
define noalias %struct.Foo* @return_pointer_20() {
ret %struct.Foo* null
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, char *);
void genAgpsFilePathName(char *filename, char *pathname) {
  sprintf(pathname, "./agps_data/%s_agps.dat", filename);
}


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

x86 assembly (clang, -O2):
<genAgpsFilePathName>:
mov    %rsi,%rax
mov    %rdi,%rdx
lea    0xee3(%rip),%rsi
mov    %rax,%rdi
jmp    1030 <sprintf@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"./agps_data/%s_agps.dat\00"
define void @genAgpsFilePathName(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = load i8*, i8** %3
%7 = call i32 @sprintf(i8* %5, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [24 x i8] c"./agps_data/%s_agps.dat\00"
define void @genAgpsFilePathName(i8* %0, i8* nocapture writeonly %1) {
%3 = tail call i32 @sprintf(i8* dereferenceable(1) %1, i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void wakeup(int sig) { printf("Alarm received\n"); }


x86 assembly (clang, -O0):
<wakeup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xede(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [16 x i8] c"Alarm received\0A\00"
define void @wakeup(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [15 x i8] c"Alarm received\00"
define void @wakeup(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
ret void
}
void f40(void) {
  ({
    ({
      goto a;
      0;
    });
    ({ 0; });
    0;
  });
  ({
    ({ 0; });
    ({ 0; });
    0;
  });
a:
  0;
}


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

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

LLVM IR (-O0):
define void @f40() {
%1 = alloca i32
%2 = alloca i32
br label %3
3: ; preds = %0
ret void
}

LLVM IR (-O2):
define void @f40() {
ret void
}
void hack_alloc_term(void) {}


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

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

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

LLVM IR (-O2):
define void @hack_alloc_term() {
ret void
}
int fs_free(void *node) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @fs_free(i8* nocapture readnone %0) {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void minitiff_default_warning_handler(const char *msg) {
  fprintf(stderr, "** Warning: %s\n", msg);
}


x86 assembly (clang, -O0):
<minitiff_default_warning_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<minitiff_default_warning_handler>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [16 x i8] c"** Warning: %s\0A\00"
define void @minitiff_default_warning_handler(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [16 x i8] c"** Warning: %s\0A\00"
define void @minitiff_default_warning_handler(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
float triangle(float width, float height) {
  float area;
  area = width * height / 2.0;
  return (area);
}


x86 assembly (clang, -O0):
<triangle>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xedc(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<triangle>:
mulss  %xmm1,%xmm0
mulss  0xef4(%rip),%xmm0
ret

LLVM IR (-O0):
define float @triangle(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
store float %0, float* %3
store float %1, float* %4
%6 = load float, float* %3
%7 = load float, float* %4
%8 = fmul float %6, %7
%9 = fpext float %8 to double
%10 = fdiv double %9, 2.000000e+00
%11 = fptrunc double %10 to float
store float %11, float* %5
%12 = load float, float* %5
ret float %12
}

LLVM IR (-O2):
define float @triangle(float %0, float %1) {
%3 = fmul float %0, %1
%4 = fmul float %3, 5.000000e-01
ret float %4
}
float vec3_dot(const float a[3], const float b[3]) {
  return a[0] * b[0] + a[1] * b[1] + a[2] * b[2];
}


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

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

LLVM IR (-O0):
define float @vec3_dot(float* %0, float* %1) {
%3 = alloca float*
%4 = alloca float*
store float* %0, float** %3
store float* %1, float** %4
%5 = load float*, float** %3
%6 = getelementptr inbounds float, float* %5, i64 0
%7 = load float, float* %6
%8 = load float*, float** %4
%9 = getelementptr inbounds float, float* %8, i64 0
%10 = load float, float* %9
%11 = load float*, float** %3
%12 = getelementptr inbounds float, float* %11, i64 1
%13 = load float, float* %12
%14 = load float*, float** %4
%15 = getelementptr inbounds float, float* %14, i64 1
%16 = load float, float* %15
%17 = fmul float %13, %16
%18 = call float @llvm.fmuladd.f32(float %7, float %10, float %17)
%19 = load float*, float** %3
%20 = getelementptr inbounds float, float* %19, i64 2
%21 = load float, float* %20
%22 = load float*, float** %4
%23 = getelementptr inbounds float, float* %22, i64 2
%24 = load float, float* %23
%25 = call float @llvm.fmuladd.f32(float %21, float %24, float %18)
ret float %25
}

LLVM IR (-O2):
define float @vec3_dot(float* nocapture %0, float* nocapture %1) {
%3 = load float, float* %0
%4 = load float, float* %1
%5 = getelementptr inbounds float, float* %0, i64 1
%6 = load float, float* %5
%7 = getelementptr inbounds float, float* %1, i64 1
%8 = load float, float* %7
%9 = fmul float %6, %8
%10 = tail call float @llvm.fmuladd.f32(float %3, float %4, float %9)
%11 = getelementptr inbounds float, float* %0, i64 2
%12 = load float, float* %11
%13 = getelementptr inbounds float, float* %1, i64 2
%14 = load float, float* %13
%15 = tail call float @llvm.fmuladd.f32(float %12, float %14, float %10)
ret float %15
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int _usage(void) {
  fputs("Usage: "
        "rm"
        " [-fiRr] file...\n  -f    Do not prompt for confirmation or output "
        "error messages\n  -i    Prompt for confirmation\n  -R    Remove file "
        "hierarchies\n  -r    Equivalent to -R\n",
        stderr);
  return 1;
}


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

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

LLVM IR (-O0):
@.str = [180 x i8] c"Usage: rm [-fiRr] file...\0A -f Do not prompt for confirmation or output error messages\0A -i Prompt for confirmation\0A -R Remove file hierarchies\0A -r Equivalent to -R\0A\00"
@stderr = global i32 0
define i32 @_usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fputs(i8* getelementptr inbounds ([180 x i8], [180 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 1
}

LLVM IR (-O2):
@.str = [180 x i8] c"Usage: rm [-fiRr] file...\0A -f Do not prompt for confirmation or output error messages\0A -i Prompt for confirmation\0A -R Remove file hierarchies\0A -r Equivalent to -R\0A\00"
@stderr = global i32 0
define i32 @_usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fputs(i8* getelementptr inbounds ([180 x i8], [180 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 1
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ get_time();
struct tm *localtime(int /*<<< orphan*/ const *);
int /*<<< orphan*/ strftime(char *, int, char *, struct tm *);
void get_time_format(char *buf, int bufsize) {
  struct tm *timeinfo;
  time_t t = get_time();
  timeinfo = localtime((const time_t *)&t);
  strftime(buf, bufsize, "%H:%M:%S", timeinfo);
}


x86 assembly (clang, -O0):
<get_time_format>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x0,%al
call   1040 <get_time@plt>
mov    %eax,-0x1c(%rbp)
lea    -0x1c(%rbp),%rdi
call   1030 <localtime@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rcx
lea    0xe98(%rip),%rdx
call   1050 <strftime@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.tm = type { i32 }
@.str = [9 x i8] c"%H:%M:%S\00"
define void @get_time_format(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca %struct.tm*
%6 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%7 = call i32 (...) @get_time()
store i32 %7, i32* %6
%8 = call %struct.tm* @localtime(i32* %6)
store %struct.tm* %8, %struct.tm** %5
%9 = load i8*, i8** %3
%10 = load i32, i32* %4
%11 = load %struct.tm*, %struct.tm** %5
%12 = call i32 @strftime(i8* %9, i32 %10, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), %struct.tm* %11)
ret void
}

LLVM IR (-O2):
%struct.tm = type { i32 }
@.str = [9 x i8] c"%H:%M:%S\00"
define void @get_time_format(i8* %0, i32 %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = tail call i32 (...) @get_time()
store i32 %5, i32* %3
%6 = call %struct.tm* @localtime(i32* %3)
%7 = call i32 @strftime(i8* %0, i32 %1, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), %struct.tm* %6)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ volatile uint32_t;

/* Variables and functions */
uint32_t SysCtlLDOSleepGet(void) {
  return ((*((volatile uint32_t *)(0x400FE1B4))));
}


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

x86 assembly (clang, -O2):
<SysCtlLDOSleepGet>:
mov    0x400fe1b4,%eax
ret

LLVM IR (-O0):
define i32 @SysCtlLDOSleepGet() {
%1 = load volatile i32, i32* inttoptr (i64 1074782644 to i32*)
ret i32 %1
}

LLVM IR (-O2):
define i32 @SysCtlLDOSleepGet() {
%1 = load volatile i32, i32* inttoptr (i64 1074782644 to i32*)
ret i32 %1
}
/* Variables and functions */
scalar_t__ pow(long, long);
long int MultOrd(long int a, long int n) {
  long int k;
  if (n == 1)
    return 1;
  for (k = 1; ((long int)pow(a, k) % n) != 1; k++)
    ;
  return k;
}


x86 assembly (clang, -O0):
<MultOrd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x1,-0x18(%rbp)
jne    1138 <MultOrd+0x28>
movq   $0x1,-0x8(%rbp)
jmp    117b <MultOrd+0x6b>
movq   $0x1,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1030 <pow@plt>
cqto
idivq  -0x18(%rbp)
cmp    $0x1,%rdx
je     1173 <MultOrd+0x63>
jmp    1162 <MultOrd+0x52>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    1140 <MultOrd+0x30>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MultOrd>:
push   %r15
push   %r14
push   %rbx
mov    $0x1,%ebx
cmp    $0x1,%rsi
je     1161 <MultOrd+0x51>
mov    %rsi,%r15
mov    %rdi,%r14
xor    %ebx,%ebx
jmp    113b <MultOrd+0x2b>
nopw   0x0(%rax,%rax,1)
cqto
idiv   %r15
cmp    $0x1,%rdx
je     1161 <MultOrd+0x51>
add    $0x1,%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <pow@plt>
mov    %rax,%rcx
or     %r15,%rcx
shr    $0x20,%rcx
jne    1130 <MultOrd+0x20>
xor    %edx,%edx
div    %r15d
cmp    $0x1,%rdx
jne    113b <MultOrd+0x2b>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i64 @MultOrd(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
%7 = load i64, i64* %5
%8 = icmp eq i64 %7, 1
br i1 %8, label %9, label %10
9: ; preds = %2
store i64 1, i64* %3
br label %24
10: ; preds = %2
store i64 1, i64* %6
br label %11
11: ; preds = %19, %10
%12 = load i64, i64* %4
%13 = load i64, i64* %6
%14 = call i64 @pow(i64 %12, i64 %13)
%15 = load i64, i64* %5
%16 = srem i64 %14, %15
%17 = icmp ne i64 %16, 1
br i1 %17, label %18, label %22
18: ; preds = %11
br label %19
19: ; preds = %18
%20 = load i64, i64* %6
%21 = add nsw i64 %20, 1
store i64 %21, i64* %6
br label %11
22: ; preds = %11
%23 = load i64, i64* %6
store i64 %23, i64* %3
br label %24
24: ; preds = %22, %9
%25 = load i64, i64* %3
ret i64 %25
}

LLVM IR (-O2):
define i64 @MultOrd(i64 %0, i64 %1) {
%3 = icmp eq i64 %1, 1
br i1 %3, label %10, label %4
4: ; preds = %2, %4
%5 = phi i64 [ %9, %4 ], [ 1, %2 ]
%6 = tail call i64 @pow(i64 %0, i64 %5)
%7 = srem i64 %6, %1
%8 = icmp eq i64 %7, 1
%9 = add nuw nsw i64 %5, 1
br i1 %8, label %10, label %4
10: ; preds = %4, %2
%11 = phi i64 [ 1, %2 ], [ %5, %4 ]
ret i64 %11
}
void go_sleep(int n) {
  n = n * 1000000;
  while (n--)
    ;
}


x86 assembly (clang, -O0):
<go_sleep>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
imul   $0xf4240,-0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x4(%rbp)
cmp    $0x0,%eax
je     112a <go_sleep+0x2a>
jmp    1111 <go_sleep+0x11>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @go_sleep(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 %3, 1000000
store i32 %4, i32* %2
br label %5
5: ; preds = %9, %1
%6 = load i32, i32* %2
%7 = add nsw i32 %6, -1
store i32 %7, i32* %2
%8 = icmp ne i32 %6, 0
br i1 %8, label %9, label %10
9: ; preds = %5
br label %5
10: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @go_sleep(i32 %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
unsigned int vfprintf(int /*<<< orphan*/ *, char const *, int /*<<< orphan*/);
int vsprintf(char *ebuf, const char *fmt, va_list ap) {
  unsigned int i;
  i = vfprintf((FILE *)ebuf, fmt, ap);
  ebuf[i] = '\0';
  return i;
}


x86 assembly (clang, -O0):
<vsprintf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <vfprintf@plt>
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%ecx
movb   $0x0,(%rax,%rcx,1)
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vsprintf>:
push   %rbx
mov    %rdi,%rbx
call   1030 <vfprintf@plt>
mov    %eax,%ecx
movb   $0x0,(%rbx,%rcx,1)
pop    %rbx
ret

LLVM IR (-O0):
define i32 @vsprintf(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i32*
%10 = load i8*, i8** %5
%11 = load i32, i32* %6
%12 = call i32 @vfprintf(i32* %9, i8* %10, i32 %11)
store i32 %12, i32* %7
%13 = load i8*, i8** %4
%14 = load i32, i32* %7
%15 = zext i32 %14 to i64
%16 = getelementptr inbounds i8, i8* %13, i64 %15
store i8 0, i8* %16
%17 = load i32, i32* %7
ret i32 %17
}

LLVM IR (-O2):
define i32 @vsprintf(i8* nocapture %0, i8* nocapture %1, i32 %2) {
%4 = bitcast i8* %0 to i32*
%5 = tail call i32 @vfprintf(i32* %4, i8* %1, i32 %2)
%6 = zext i32 %5 to i64
%7 = getelementptr inbounds i8, i8* %0, i64 %6
store i8 0, i8* %7
ret i32 %5
}
int never(int i, struct ks10_uinsn *insn) { return 0; }


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

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

LLVM IR (-O0):
%struct.ks10_uinsn = type opaque
define i32 @never(i32 %0, %struct.ks10_uinsn* %1) {
%3 = alloca i32
%4 = alloca %struct.ks10_uinsn*
store i32 %0, i32* %3
store %struct.ks10_uinsn* %1, %struct.ks10_uinsn** %4
ret i32 0
}

LLVM IR (-O2):
%struct.ks10_uinsn = type opaque
define i32 @never(i32 %0, %struct.ks10_uinsn* nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
scalar_t__ *_sys_siglist;
int /*<<< orphan*/ exit(int);
main() {
  char *msg = (char *)_sys_siglist[2];
  exit(msg == 0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2ec2(%rip),%rax
mov    (%rax),%rax
mov    0x10(%rax),%rax
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%rax
xor    %edi,%edi
cmpq   $0x0,0x10(%rax)
sete   %dil
call   1030 <exit@plt>

LLVM IR (-O0):
@_sys_siglist = global i64* null
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
%3 = load i64*, i64** @_sys_siglist
%4 = getelementptr inbounds i64, i64* %3, i64 2
%5 = load i64, i64* %4
%6 = inttoptr i64 %5 to i8*
store i8* %6, i8** %2
%7 = load i8*, i8** %2
%8 = icmp eq i8* %7, null
%9 = zext i1 %8 to i32
%10 = call i32 @exit(i32 %9)
unreachable
}

LLVM IR (-O2):
@_sys_siglist = global i64* null
define i32 @main() {
%1 = load i64*, i64** @_sys_siglist
%2 = getelementptr inbounds i64, i64* %1, i64 2
%3 = load i64, i64* %2
%4 = icmp eq i64 %3, 0
%5 = zext i1 %4 to i32
%6 = tail call i32 @exit(i32 %5)
unreachable
}
void outbyte(c_int) int c_int;
{
  char c = c_int;
  write(1, &c, 1);
}


x86 assembly (clang, -O0):
<outbyte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %al,-0x5(%rbp)
mov    $0x1,%edx
lea    -0x5(%rbp),%rsi
mov    %edx,%edi
mov    $0x0,%al
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<outbyte>:
push   %rax
mov    %dil,0x7(%rsp)
lea    0x7(%rsp),%rsi
mov    $0x1,%edi
mov    $0x1,%edx
xor    %eax,%eax
call   1030 <write@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @outbyte(i32 %0) {
%2 = alloca i32
%3 = alloca i8
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = trunc i32 %4 to i8
store i8 %5, i8* %3
%6 = call i32 (i32, i8*, i32, ...) bitcast (i32 (...)* @write to i32 (i32, i8*, i32, ...)*)(i32 1, i8* %3, i32 1)
ret void
}

LLVM IR (-O2):
define void @outbyte(i32 %0) {
%2 = alloca i8
%3 = trunc i32 %0 to i8
store i8 %3, i8* %2
%4 = call i32 (i32, i8*, i32, ...) bitcast (i32 (...)* @write to i32 (i32, i8*, i32, ...)*)(i32 1, i8* %2, i32 1)
ret void
}
int fun396() { return 396; }


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

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

LLVM IR (-O0):
define i32 @fun396() {
ret i32 396
}

LLVM IR (-O2):
define i32 @fun396() {
ret i32 396
}
/* Variables and functions */
int /*<<< orphan*/ add_boid_pos_test();
int /*<<< orphan*/ boid_can_see_test();
int /*<<< orphan*/ distance_boid_2d_test();
int /*<<< orphan*/ distance_boid_test();
int /*<<< orphan*/ equals_boid_test();
int /*<<< orphan*/ get_boid_pos_test();
int /*<<< orphan*/ new_boid_test();
int /*<<< orphan*/ set_boid_pos_test();
int main(int argc, char **argv) {
  new_boid_test();
  equals_boid_test();
  set_boid_pos_test();
  get_boid_pos_test();
  add_boid_pos_test();
  distance_boid_test();
  distance_boid_2d_test();
  boid_can_see_test();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   10a0 <new_boid_test@plt>
mov    $0x0,%al
call   1040 <equals_boid_test@plt>
mov    $0x0,%al
call   1090 <set_boid_pos_test@plt>
mov    $0x0,%al
call   1070 <get_boid_pos_test@plt>
mov    $0x0,%al
call   1030 <add_boid_pos_test@plt>
mov    $0x0,%al
call   1050 <distance_boid_test@plt>
mov    $0x0,%al
call   1080 <distance_boid_2d_test@plt>
mov    $0x0,%al
call   1060 <boid_can_see_test@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   10a0 <new_boid_test@plt>
xor    %eax,%eax
call   1040 <equals_boid_test@plt>
xor    %eax,%eax
call   1090 <set_boid_pos_test@plt>
xor    %eax,%eax
call   1070 <get_boid_pos_test@plt>
xor    %eax,%eax
call   1030 <add_boid_pos_test@plt>
xor    %eax,%eax
call   1050 <distance_boid_test@plt>
xor    %eax,%eax
call   1080 <distance_boid_2d_test@plt>
xor    %eax,%eax
call   1060 <boid_can_see_test@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 (...) @new_boid_test()
%6 = call i32 (...) @equals_boid_test()
%7 = call i32 (...) @set_boid_pos_test()
%8 = call i32 (...) @get_boid_pos_test()
%9 = call i32 (...) @add_boid_pos_test()
%10 = call i32 (...) @distance_boid_test()
%11 = call i32 (...) @distance_boid_2d_test()
%12 = call i32 (...) @boid_can_see_test()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @new_boid_test()
%4 = tail call i32 (...) @equals_boid_test()
%5 = tail call i32 (...) @set_boid_pos_test()
%6 = tail call i32 (...) @get_boid_pos_test()
%7 = tail call i32 (...) @add_boid_pos_test()
%8 = tail call i32 (...) @distance_boid_test()
%9 = tail call i32 (...) @distance_boid_2d_test()
%10 = tail call i32 (...) @boid_can_see_test()
ret i32 0
}
/* Type definitions */
struct stat {
  int st_size;
};
typedef int __off_t;

/* Variables and functions */
scalar_t__ stat(char const *, struct stat *);
__off_t fSize(const char *fileName) {
  struct stat st;
  return stat(fileName, &st) == 0 ? st.st_size : -1;
}


x86 assembly (clang, -O0):
<fSize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1030 <stat@plt>
cmp    $0x0,%rax
jne    113e <fSize+0x2e>
mov    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    114b <fSize+0x3b>
mov    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
jmp    114b <fSize+0x3b>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fSize>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
neg    %rax
sbb    %eax,%eax
or     (%rsp),%eax
pop    %rcx
ret

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

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


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

x86 assembly (clang, -O2):
<foo>:
mov    $0x64,%esi
jmp    1030 <bad_access@plt>

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

LLVM IR (-O2):
define void @foo(i32* %0) {
%2 = tail call i32 @bad_access(i32* %0, i32 100)
ret void
}
long long ussz() { return 0x7fffffffffff0000LL; }


x86 assembly (clang, -O0):
<ussz>:
push   %rbp
mov    %rsp,%rbp
movabs $0x7fffffffffff0000,%rax
ff ff 7f
pop    %rbp
ret

x86 assembly (clang, -O2):
<ussz>:
movabs $0x7fffffffffff0000,%rax
ff ff 7f
ret

LLVM IR (-O0):
define i64 @ussz() {
ret i64 9223372036854710272
}

LLVM IR (-O2):
define i64 @ussz() {
ret i64 9223372036854710272
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void usage(void) {
  printf("Usage: sdfile -s SIZE FILE\n\n");
  printf("SIZE - block device capacity (in megabytes)\n");
  printf("FILE - storage device filename\n");
  exit(2);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
lea    0xee6(%rip),%rdi
call   1030 <printf@plt>
lea    0xf07(%rip),%rdi
call   1030 <printf@plt>
mov    $0x2,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xf08(%rip),%rdi
call   1030 <puts@plt>
mov    $0x2,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [29 x i8] c"Usage: sdfile -s SIZE FILE\0A\0A\00"
@.str.1 = [45 x i8] c"SIZE - block device capacity (in megabytes)\0A\00"
@.str.2 = [32 x i8] c"FILE - storage device filename\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @exit(i32 2)
unreachable
}

LLVM IR (-O2):
@str = [28 x i8] c"Usage: sdfile -s SIZE FILE\0A\00"
@str.3 = [44 x i8] c"SIZE - block device capacity (in megabytes)\00"
@str.4 = [31 x i8] c"FILE - storage device filename\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @str.3, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str.4, i64 0, i64 0))
%4 = tail call i32 @exit(i32 2)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void comment(char *p) { free(p); }


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

LLVM IR (-O0):
define void @comment(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 @comment(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int test() {
  int lArray[4];
  int i = 0;
  for (i = 0;; 1) {
    lArray[i] = i / 2;
    printf("%d, %d\n", i, lArray[i++]);
  }
  return 0;
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
movslq -0x14(%rbp),%rax
mov    %ecx,-0x10(%rbp,%rax,4)
mov    -0x14(%rbp),%esi
mov    -0x14(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x14(%rbp)
cltq
mov    -0x10(%rbp,%rax,4),%edx
lea    0xeaa(%rip),%rdi
call   1030 <printf@plt>
jmp    1126 <test+0x16>

x86 assembly (clang, -O2):
<test>:
push   %rbp
push   %rbx
push   %rax
xor    %esi,%esi
lea    0xee4(%rip),%rbx
nopl   0x0(%rax)
mov    %esi,%edx
shr    %edx
lea    0x1(%rsi),%ebp
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    %ebp,%esi
jmp    1120 <test+0x10>

LLVM IR (-O0):
@.str = [8 x i8] c"%d, %d\0A\00"
define i32 @test() {
%1 = alloca [4 x i32]
%2 = alloca i32
store i32 0, i32* %2
store i32 0, i32* %2
br label %3
3: ; preds = %16, %0
%4 = load i32, i32* %2
%5 = sdiv i32 %4, 2
%6 = load i32, i32* %2
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds [4 x i32], [4 x i32]* %1, i64 0, i64 %7
store i32 %5, i32* %8
%9 = load i32, i32* %2
%10 = load i32, i32* %2
%11 = add nsw i32 %10, 1
store i32 %11, i32* %2
%12 = sext i32 %10 to i64
%13 = getelementptr inbounds [4 x i32], [4 x i32]* %1, i64 0, i64 %12
%14 = load i32, i32* %13
%15 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %9, i32 %14)
br label %16
16: ; preds = %3
br label %3
}

LLVM IR (-O2):
@.str = [8 x i8] c"%d, %d\0A\00"
define i32 @test() {
br label %1
1: ; preds = %1, %0
%2 = phi i32 [ 0, %0 ], [ %4, %1 ]
%3 = lshr i32 %2, 1
%4 = add nuw nsw i32 %2, 1
%5 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %3)
br label %1
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
scalar_t__ kill(int /*<<< orphan*/, int /*<<< orphan*/);
int check_pid(pid_t pid) { return (kill(pid, 0) == 0); }


x86 assembly (clang, -O0):
<check_pid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
xor    %esi,%esi
call   1030 <kill@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_pid>:
push   %rax
xor    %esi,%esi
call   1030 <kill@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @check_pid(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @kill(i32 %3, i32 0)
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @check_pid(i32 %0) {
%2 = tail call i64 @kill(i32 %0, i32 0)
%3 = icmp eq i64 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
__attribute__((visibility("default"))) void FBWrite(unsigned int addr,
                                                    unsigned int size) {}


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

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

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

LLVM IR (-O2):
define void @FBWrite(i32 %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ B(unsigned int, unsigned int, unsigned int);
void A() {
  unsigned int a = 1;
  unsigned int b = 2;
  unsigned int c = 3;
  B(a, b, c);
}


x86 assembly (clang, -O0):
<A>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
movl   $0x3,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1030 <B@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<A>:
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x3,%edx
jmp    1030 <B@plt>

LLVM IR (-O0):
define void @A() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 1, i32* %1
store i32 2, i32* %2
store i32 3, i32* %3
%4 = load i32, i32* %1
%5 = load i32, i32* %2
%6 = load i32, i32* %3
%7 = call i32 @B(i32 %4, i32 %5, i32 %6)
ret void
}

LLVM IR (-O2):
define void @A() {
%1 = tail call i32 @B(i32 1, i32 2, i32 3)
ret void
}
I0R1(r0, r1, x0, x1, p0, p1) unsigned int r0, r1;
unsigned int *p0, *p1;
{
  if (22 <= r1)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<I0R1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
mov    $0x16,%eax
cmp    -0xc(%rbp),%eax
ja     1132 <I0R1+0x32>
movl   $0x1,-0x4(%rbp)
jmp    1139 <I0R1+0x39>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<I0R1>:
xor    %eax,%eax
cmp    $0x16,%esi
setae  %al
ret

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

LLVM IR (-O2):
define i32 @I0R1(i32 %0, i32 %1, i32 %2, i32 %3, i32* nocapture readnone %4, i32* nocapture readnone %5) {
%7 = icmp ugt i32 %1, 21
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ HplMsp430GeneralIOP__46__IO__selectModuleFunc();
void Msp430Adc12ImplP__Port66__selectModuleFunc(void) {
  HplMsp430GeneralIOP__46__IO__selectModuleFunc();
}


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

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

LLVM IR (-O0):
define void @Msp430Adc12ImplP__Port66__selectModuleFunc() {
%1 = call i32 (...) @HplMsp430GeneralIOP__46__IO__selectModuleFunc()
ret void
}

LLVM IR (-O2):
define void @Msp430Adc12ImplP__Port66__selectModuleFunc() {
%1 = tail call i32 (...) @HplMsp430GeneralIOP__46__IO__selectModuleFunc()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ bio_info_cb;
typedef int /*<<< orphan*/ BIO;

/* Variables and functions */
long BIO_callback_ctrl(int /*<<< orphan*/ *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ *BIO_next(int /*<<< orphan*/ *);
long md_callback_ctrl(BIO *b, int cmd, bio_info_cb *fp) {
  long ret = 1;
  BIO *next;
  next = BIO_next(b);
  if (next == NULL)
    return 0;
  switch (cmd) {
  default:
    ret = BIO_callback_ctrl(next, cmd, fp);
    break;
  }
  return (ret);
}


x86 assembly (clang, -O0):
<md_callback_ctrl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
movq   $0x1,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <BIO_next@plt>
mov    %rax,-0x30(%rbp)
cmpq   $0x0,-0x30(%rbp)
jne    1160 <md_callback_ctrl+0x40>
movq   $0x0,-0x8(%rbp)
jmp    117c <md_callback_ctrl+0x5c>
mov    -0x30(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x20(%rbp),%rdx
call   1030 <BIO_callback_ctrl@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<md_callback_ctrl>:
push   %rbp
push   %rbx
push   %rax
mov    %rdx,%rbx
mov    %esi,%ebp
call   1040 <BIO_next@plt>
test   %rax,%rax
je     1145 <md_callback_ctrl+0x25>
mov    %rax,%rdi
mov    %ebp,%esi
mov    %rbx,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <BIO_callback_ctrl@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i64 @md_callback_ctrl(i32* %0, i32 %1, i32* %2) {
%4 = alloca i64
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i64
%9 = alloca i32*
store i32* %0, i32** %5
store i32 %1, i32* %6
store i32* %2, i32** %7
store i64 1, i64* %8
%10 = load i32*, i32** %5
%11 = call i32* @BIO_next(i32* %10)
store i32* %11, i32** %9
%12 = load i32*, i32** %9
%13 = icmp eq i32* %12, null
br i1 %13, label %14, label %15
14: ; preds = %3
store i64 0, i64* %4
br label %24
15: ; preds = %3
%16 = load i32, i32* %6
switch i32 %16, label %17 [
]
17: ; preds = %15
%18 = load i32*, i32** %9
%19 = load i32, i32* %6
%20 = load i32*, i32** %7
%21 = call i64 @BIO_callback_ctrl(i32* %18, i32 %19, i32* %20)
store i64 %21, i64* %8
br label %22
22: ; preds = %17
%23 = load i64, i64* %8
store i64 %23, i64* %4
br label %24
24: ; preds = %22, %14
%25 = load i64, i64* %4
ret i64 %25
}

LLVM IR (-O2):
define i64 @md_callback_ctrl(i32* %0, i32 %1, i32* %2) {
%4 = tail call i32* @BIO_next(i32* %0)
%5 = icmp eq i32* %4, null
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i64 @BIO_callback_ctrl(i32* %4, i32 %1, i32* %2)
br label %8
8: ; preds = %3, %6
%9 = phi i64 [ %7, %6 ], [ 0, %3 ]
ret i64 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int age = 10;
  int height = 175;
  printf("I am %d years old.\n", age);
  printf("I am %d inches tall.\n", height);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
movl   $0xaf,-0xc(%rbp)
mov    -0x8(%rbp),%esi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%esi
lea    0xece(%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
mov    $0xa,%esi
call   1030 <printf@plt>
lea    0xeeb(%rip),%rdi
mov    $0xaf,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"I am %d years old.\0A\00"
@.str.1 = [22 x i8] c"I am %d inches tall.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 10, i32* %2
store i32 175, i32* %3
%4 = load i32, i32* %2
%5 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = load i32, i32* %3
%7 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [20 x i8] c"I am %d years old.\0A\00"
@.str.1 = [22 x i8] c"I am %d inches tall.\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 10)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 175)
ret i32 0
}
/* Variables and functions */
int random();
int random_compare(const void *p1, const void *p2) {
  int result = random();
  int median = 1073741823;
  if (result < median) {
    return -1;
  } else if (result == median) {
    return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<random_compare>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    $0x0,%al
call   1030 <random@plt>
mov    %eax,-0x1c(%rbp)
movl   $0x3fffffff,-0x20(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x20(%rbp),%eax
jge    1149 <random_compare+0x39>
movl   $0xffffffff,-0x4(%rbp)
jmp    116d <random_compare+0x5d>
mov    -0x1c(%rbp),%eax
cmp    -0x20(%rbp),%eax
jne    1161 <random_compare+0x51>
movl   $0x0,-0x4(%rbp)
jmp    116d <random_compare+0x5d>
jmp    1166 <random_compare+0x56>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<random_compare>:
push   %rax
xor    %eax,%eax
call   1030 <random@plt>
xor    %ecx,%ecx
cmp    $0x3fffffff,%eax
setne  %cl
mov    $0xffffffff,%eax
cmovge %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @random_compare(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
%8 = call i32 (...) @random()
store i32 %8, i32* %6
store i32 1073741823, i32* %7
%9 = load i32, i32* %6
%10 = load i32, i32* %7
%11 = icmp slt i32 %9, %10
br i1 %11, label %12, label %13
12: ; preds = %2
store i32 -1, i32* %3
br label %20
13: ; preds = %2
%14 = load i32, i32* %6
%15 = load i32, i32* %7
%16 = icmp eq i32 %14, %15
br i1 %16, label %17, label %18
17: ; preds = %13
store i32 0, i32* %3
br label %20
18: ; preds = %13
br label %19
19: ; preds = %18
store i32 1, i32* %3
br label %20
20: ; preds = %19, %17, %12
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
define i32 @random_compare(i8* nocapture readnone %0, i8* nocapture readnone %1) {
%3 = tail call i32 (...) @random()
%4 = icmp slt i32 %3, 1073741823
%5 = icmp ne i32 %3, 1073741823
%6 = zext i1 %5 to i32
%7 = select i1 %4, i32 -1, i32 %6
ret i32 %7
}
/* Variables and functions */
double sin(double);
double sinc(double x) { return sin(x) / x; }


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

x86 assembly (clang, -O2):
<sinc>:
push   %rax
movsd  %xmm0,(%rsp)
call   1030 <sin@plt>
divsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @sinc(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @sin(double %3)
%5 = load double, double* %2
%6 = fdiv double %4, %5
ret double %6
}

LLVM IR (-O2):
define double @sinc(double %0) {
%2 = tail call double @sin(double %0)
%3 = fdiv double %2, %0
ret double %3
}
void Userdef_FIQ_HandlerExe(void) {}


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

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

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

LLVM IR (-O2):
define void @Userdef_FIQ_HandlerExe() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ print_error(char *, int const, int const, int const);
int integer_in_range_display_error(const int value, const int range_min,
                                   const int range_max) {
  if (value >= range_min && value <= range_max) {
    return 1;
  }
  print_error("%d is not within the range %d-%d\n", value, range_min,
              range_max);
  return 0;
}


x86 assembly (clang, -O0):
<integer_in_range_display_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jl     1145 <integer_in_range_display_error+0x35>
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jg     1145 <integer_in_range_display_error+0x35>
movl   $0x1,-0x4(%rbp)
jmp    1161 <integer_in_range_display_error+0x51>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
lea    0xeab(%rip),%rdi
call   1030 <print_error@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<integer_in_range_display_error>:
mov    %edx,%ecx
mov    %esi,%edx
mov    %edi,%esi
cmp    %edx,%edi
jl     1124 <integer_in_range_display_error+0x14>
mov    $0x1,%eax
cmp    %ecx,%esi
jg     1124 <integer_in_range_display_error+0x14>
ret
push   %rax
lea    0xed4(%rip),%rdi
call   1030 <print_error@plt>
xor    %eax,%eax
add    $0x8,%rsp
ret

LLVM IR (-O0):
@.str = [34 x i8] c"%d is not within the range %d-%d\0A\00"
define i32 @integer_in_range_display_error(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = icmp sge i32 %8, %9
br i1 %10, label %11, label %16
11: ; preds = %3
%12 = load i32, i32* %5
%13 = load i32, i32* %7
%14 = icmp sle i32 %12, %13
br i1 %14, label %15, label %16
15: ; preds = %11
store i32 1, i32* %4
br label %21
16: ; preds = %11, %3
%17 = load i32, i32* %5
%18 = load i32, i32* %6
%19 = load i32, i32* %7
%20 = call i32 @print_error(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i32 %17, i32 %18, i32 %19)
store i32 0, i32* %4
br label %21
21: ; preds = %16, %15
%22 = load i32, i32* %4
ret i32 %22
}

LLVM IR (-O2):
@.str = [34 x i8] c"%d is not within the range %d-%d\0A\00"
define i32 @integer_in_range_display_error(i32 %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %0, %1
%5 = icmp sgt i32 %0, %2
%6 = or i1 %4, %5
br i1 %6, label %7, label %9
7: ; preds = %3
%8 = tail call i32 @print_error(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1, i32 %2)
br label %9
9: ; preds = %3, %7
%10 = phi i32 [ 0, %7 ], [ 1, %3 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void printMsg(int num) { printf("%s", "Hello World!!\n"); }


x86 assembly (clang, -O0):
<printMsg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xede(%rip),%rdi
lea    0xeda(%rip),%rsi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printMsg>:
lea    0xee9(%rip),%rdi
lea    0xee5(%rip),%rsi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [15 x i8] c"Hello World!!\0A\00"
define void @printMsg(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [15 x i8] c"Hello World!!\0A\00"
define void @printMsg(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
ret void
}