xunge/DecIR huggingface dataset:
/* Variables and functions */
unsigned int htonl(unsigned int);
int /*<<< orphan*/ write(int, unsigned int *, int);
void iwrite(int f, unsigned int i) {
  i = htonl(i);
  write(f, &i, 4);
}


x86 assembly (clang, -O0):
<iwrite>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <htonl@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x8(%rbp),%rsi
mov    $0x4,%edx
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iwrite>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
mov    %esi,%edi
call   1040 <htonl@plt>
mov    %eax,0xc(%rsp)
lea    0xc(%rsp),%rsi
mov    %ebx,%edi
mov    $0x4,%edx
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @iwrite(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = call i32 @htonl(i32 %5)
store i32 %6, i32* %4
%7 = load i32, i32* %3
%8 = call i32 @write(i32 %7, i32* %4, i32 4)
ret void
}

LLVM IR (-O2):
define void @iwrite(i32 %0, i32 %1) {
%3 = alloca i32
%4 = tail call i32 @htonl(i32 %1)
store i32 %4, i32* %3
%5 = call i32 @write(i32 %0, i32* %3, i32 4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int age = 10;
  int height = 123;
  printf("I am %d years old.\n", age);
  printf("I am %d inches high.\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   $0x7b,-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    $0x7b,%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 high.\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 123, 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 high.\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 123)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ UAVObjRequestUpdate(int /*<<< orphan*/);
int /*<<< orphan*/ VibrationAnalysisSettingsHandle();
void VibrationAnalysisSettingsRequestUpdate() {
  UAVObjRequestUpdate(VibrationAnalysisSettingsHandle());
}


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

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

LLVM IR (-O0):
define void @VibrationAnalysisSettingsRequestUpdate() {
%1 = call i32 (...) @VibrationAnalysisSettingsHandle()
%2 = call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}

LLVM IR (-O2):
define void @VibrationAnalysisSettingsRequestUpdate() {
%1 = tail call i32 (...) @VibrationAnalysisSettingsHandle()
%2 = tail call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ syscall1(int);
void resign() { syscall1(66); }


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

x86 assembly (clang, -O2):
<resign>:
mov    $0x42,%edi
jmp    1030 <syscall1@plt>

LLVM IR (-O0):
define void @resign() {
%1 = call i32 @syscall1(i32 66)
ret void
}

LLVM IR (-O2):
define void @resign() {
%1 = tail call i32 @syscall1(i32 66)
ret void
}
/* Variables and functions */
float cosf(float);
float EaseSineInOut(float t, float b, float c, float d) {
  return (-c / 2.0f * (cosf(3.14159265358979323846f * t / d) - 1.0f) + b);
}


x86 assembly (clang, -O0):
<EaseSineInOut>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  %xmm3,-0x10(%rbp)
movss  -0xc(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  0xec2(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x14(%rbp)
movss  0xead(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
divss  -0x10(%rbp),%xmm0
call   1030 <cosf@plt>
movaps %xmm0,%xmm2
movss  -0x14(%rbp),%xmm0
movss  0xe8a(%rip),%xmm1
subss  %xmm1,%xmm2
movss  -0x8(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<EaseSineInOut>:
push   %rax
mulss  0xee7(%rip),%xmm2
movss  %xmm2,(%rsp)
movss  %xmm1,0x4(%rsp)
mulss  0xed8(%rip),%xmm0
divss  %xmm3,%xmm0
call   1030 <cosf@plt>
addss  0xecb(%rip),%xmm0
mulss  (%rsp),%xmm0
addss  0x4(%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @EaseSineInOut(float %0, float %1, float %2, float %3) {
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca float
store float %0, float* %5
store float %1, float* %6
store float %2, float* %7
store float %3, float* %8
%9 = load float, float* %7
%10 = fneg float %9
%11 = fdiv float %10, 2.000000e+00
%12 = load float, float* %5
%13 = fmul float 0x400921FB60000000, %12
%14 = load float, float* %8
%15 = fdiv float %13, %14
%16 = call float @cosf(float %15)
%17 = fsub float %16, 1.000000e+00
%18 = load float, float* %6
%19 = call float @llvm.fmuladd.f32(float %11, float %17, float %18)
ret float %19
}

LLVM IR (-O2):
define float @EaseSineInOut(float %0, float %1, float %2, float %3) {
%5 = fmul float %2, -5.000000e-01
%6 = fmul float %0, 0x400921FB60000000
%7 = fdiv float %6, %3
%8 = tail call float @cosf(float %7)
%9 = fadd float %8, -1.000000e+00
%10 = tail call float @llvm.fmuladd.f32(float %5, float %9, float %1)
ret float %10
}
/* Variables and functions */
int /*<<< orphan*/ conf_init();
int /*<<< orphan*/ garray_init();
int /*<<< orphan*/ glob_init();
int /*<<< orphan*/ mess_init();
int /*<<< orphan*/ obj_init();
int /*<<< orphan*/ sys_lock();
int /*<<< orphan*/ sys_unlock();
extern void pd_init_systems(void) {
  mess_init();
  sys_lock();
  obj_init();
  conf_init();
  glob_init();
  garray_init();
  sys_unlock();
}


x86 assembly (clang, -O0):
<pd_init_systems>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <mess_init@plt>
mov    $0x0,%al
call   1030 <sys_lock@plt>
mov    $0x0,%al
call   1070 <obj_init@plt>
mov    $0x0,%al
call   1080 <conf_init@plt>
mov    $0x0,%al
call   1040 <glob_init@plt>
mov    $0x0,%al
call   1060 <garray_init@plt>
mov    $0x0,%al
call   1090 <sys_unlock@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<pd_init_systems>:
push   %rax
xor    %eax,%eax
call   1050 <mess_init@plt>
xor    %eax,%eax
call   1030 <sys_lock@plt>
xor    %eax,%eax
call   1070 <obj_init@plt>
xor    %eax,%eax
call   1080 <conf_init@plt>
xor    %eax,%eax
call   1040 <glob_init@plt>
xor    %eax,%eax
call   1060 <garray_init@plt>
xor    %eax,%eax
pop    %rcx
jmp    1090 <sys_unlock@plt>

LLVM IR (-O0):
define void @pd_init_systems() {
%1 = call i32 (...) @mess_init()
%2 = call i32 (...) @sys_lock()
%3 = call i32 (...) @obj_init()
%4 = call i32 (...) @conf_init()
%5 = call i32 (...) @glob_init()
%6 = call i32 (...) @garray_init()
%7 = call i32 (...) @sys_unlock()
ret void
}

LLVM IR (-O2):
define void @pd_init_systems() {
%1 = tail call i32 (...) @mess_init()
%2 = tail call i32 (...) @sys_lock()
%3 = tail call i32 (...) @obj_init()
%4 = tail call i32 (...) @conf_init()
%5 = tail call i32 (...) @glob_init()
%6 = tail call i32 (...) @garray_init()
%7 = tail call i32 (...) @sys_unlock()
ret void
}
void autonomous4() {}


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

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

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

LLVM IR (-O2):
define void @autonomous4() {
ret void
}
/* Variables and functions */
char *strchr(char const *, char);
char *strndup(char const *, int);
char *get_net_from_prefix(const char *prefix) {
  char *loc = strchr(prefix, '/');
  char *network = strndup(prefix, loc - prefix);
  return network;
}


x86 assembly (clang, -O0):
<get_net_from_prefix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2f,%esi
call   1030 <strchr@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
mov    %eax,%esi
call   1040 <strndup@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_net_from_prefix>:
push   %rbx
mov    %rdi,%rbx
mov    $0x2f,%esi
call   1030 <strchr@plt>
sub    %ebx,%eax
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1040 <strndup@plt>

LLVM IR (-O0):
define i8* @get_net_from_prefix(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i8* @strchr(i8* %5, i8 signext 47)
store i8* %6, i8** %3
%7 = load i8*, i8** %2
%8 = load i8*, i8** %3
%9 = load i8*, i8** %2
%10 = ptrtoint i8* %8 to i64
%11 = ptrtoint i8* %9 to i64
%12 = sub i64 %10, %11
%13 = trunc i64 %12 to i32
%14 = call i8* @strndup(i8* %7, i32 %13)
store i8* %14, i8** %4
%15 = load i8*, i8** %4
ret i8* %15
}

LLVM IR (-O2):
define noalias i8* @get_net_from_prefix(i8* %0) {
%2 = tail call i8* @strchr(i8* dereferenceable(1) %0, i8 signext 47)
%3 = ptrtoint i8* %2 to i64
%4 = ptrtoint i8* %0 to i64
%5 = sub i64 %3, %4
%6 = trunc i64 %5 to i32
%7 = tail call i8* @strndup(i8* %0, i32 %6)
ret i8* %7
}
/* Variables and functions */
int /*<<< orphan*/ _fwalk(int /*<<< orphan*/);
int /*<<< orphan*/ fclose;
void __fcloseall(void) { (void)_fwalk(fclose); }


x86 assembly (clang, -O0):
<__fcloseall>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
call   1030 <_fwalk@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<__fcloseall>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
jmp    1030 <_fwalk@plt>

LLVM IR (-O0):
@fclose = global i32 0
define void @__fcloseall() {
%1 = load i32, i32* @fclose
%2 = call i32 @_fwalk(i32 %1)
ret void
}

LLVM IR (-O2):
@fclose = global i32 0
define void @__fcloseall() {
%1 = load i32, i32* @fclose
%2 = tail call i32 @_fwalk(i32 %1)
ret void
}
/* Variables and functions */
char *alloca(int);
int /*<<< orphan*/ use_buffer(char *, int);
void down2(int i) {
  char *buf = alloca(10 * i);
  if (i > 0) {
    use_buffer(buf, 10 * i);
    down2(i - 1);
  }
}


x86 assembly (clang, -O0):
<down2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
imul   $0xa,-0x4(%rbp),%edi
call   1030 <alloca@plt>
mov    %rax,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    116a <down2+0x3a>
mov    -0x10(%rbp),%rdi
imul   $0xa,-0x4(%rbp),%esi
call   1050 <use_buffer@plt>
mov    -0x4(%rbp),%edi
sub    $0x1,%edi
call   1040 <down2@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<down2>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
lea    (%rbx,%rbx,1),%eax
lea    (%rax,%rax,4),%ebp
mov    %ebp,%edi
call   1030 <alloca@plt>
test   %ebx,%ebx
jle    115c <down2+0x3c>
add    $0x1,%ebx
nopl   0x0(%rax)
mov    %rax,%rdi
mov    %ebp,%esi
call   1040 <use_buffer@plt>
add    $0xfffffff6,%ebp
mov    %ebp,%edi
call   1030 <alloca@plt>
add    $0xffffffff,%ebx
cmp    $0x1,%ebx
ja     1140 <down2+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @down2(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = mul nsw i32 10, %4
%6 = call i8* @alloca(i32 %5)
store i8* %6, i8** %3
%7 = load i32, i32* %2
%8 = icmp sgt i32 %7, 0
br i1 %8, label %9, label %16
9: ; preds = %1
%10 = load i8*, i8** %3
%11 = load i32, i32* %2
%12 = mul nsw i32 10, %11
%13 = call i32 @use_buffer(i8* %10, i32 %12)
%14 = load i32, i32* %2
%15 = sub nsw i32 %14, 1
br label %16
16: ; preds = %9, %1
ret void
}

LLVM IR (-O2):
define void @down2(i32 %0) {
%2 = mul nsw i32 %0, 10
%3 = tail call i8* @alloca(i32 %2)
%4 = icmp sgt i32 %0, 0
br i1 %4, label %5, label %14
5: ; preds = %1, %5
%6 = phi i8* [ %12, %5 ], [ %3, %1 ]
%7 = phi i32 [ %11, %5 ], [ %2, %1 ]
%8 = phi i32 [ %10, %5 ], [ %0, %1 ]
%9 = tail call i32 @use_buffer(i8* %6, i32 %7)
%10 = add nsw i32 %8, -1
%11 = mul nsw i32 %10, 10
%12 = tail call i8* @alloca(i32 %11)
%13 = icmp ugt i32 %8, 1
br i1 %13, label %5, label %14
14: ; preds = %5, %1
ret void
}
/* Variables and functions */
int NI_USUAL_RTSI_SELECT(unsigned int);
unsigned NI_GPCT_RTSI_GATE_SELECT(unsigned n) {
  return NI_USUAL_RTSI_SELECT(n);
}


x86 assembly (clang, -O0):
<NI_GPCT_RTSI_GATE_SELECT>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <NI_USUAL_RTSI_SELECT@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<NI_GPCT_RTSI_GATE_SELECT>:
jmp    1030 <NI_USUAL_RTSI_SELECT@plt>

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

LLVM IR (-O2):
define i32 @NI_GPCT_RTSI_GATE_SELECT(i32 %0) {
%2 = tail call i32 @NI_USUAL_RTSI_SELECT(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, unsigned int,
                           char const *);
int /*<<< orphan*/ stderr;
void element_check_range(unsigned int n, unsigned int min, unsigned int max,
                         const char *lc) {
  if (n < min || n > max) {
    fprintf(stderr, "Number %u out of range in location code %s\n", n, lc);
    exit(1);
  }
}


x86 assembly (clang, -O0):
<element_check_range>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jb     114d <element_check_range+0x2d>
mov    -0x4(%rbp),%eax
cmp    -0xc(%rbp),%eax
jbe    1173 <element_check_range+0x53>
mov    0x2e8c(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
mov    -0x18(%rbp),%rcx
lea    0xe9c(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<element_check_range>:
mov    %edi,%eax
cmp    %esi,%edi
jb     112b <element_check_range+0xb>
cmp    %edx,%eax
ja     112b <element_check_range+0xb>
ret
push   %rax
mov    0x2ead(%rip),%rdx
mov    (%rdx),%edi
lea    0xec4(%rip),%rsi
mov    %eax,%edx
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [44 x i8] c"Number %u out of range in location code %s\0A\00"
define void @element_check_range(i32 %0, i32 %1, i32 %2, i8* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8*
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i8* %3, i8** %8
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = icmp ult i32 %9, %10
br i1 %11, label %16, label %12
12: ; preds = %4
%13 = load i32, i32* %5
%14 = load i32, i32* %7
%15 = icmp ugt i32 %13, %14
br i1 %15, label %16, label %22
16: ; preds = %12, %4
%17 = load i32, i32* @stderr
%18 = load i32, i32* %5
%19 = load i8*, i8** %8
%20 = call i32 @fprintf(i32 %17, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i32 %18, i8* %19)
%21 = call i32 @exit(i32 1)
unreachable
22: ; preds = %12
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [44 x i8] c"Number %u out of range in location code %s\0A\00"
define void @element_check_range(i32 %0, i32 %1, i32 %2, i8* %3) {
%5 = icmp ult i32 %0, %1
%6 = icmp ugt i32 %0, %2
%7 = or i1 %5, %6
br i1 %7, label %8, label %12
8: ; preds = %4
%9 = load i32, i32* @stderr
%10 = tail call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i32 %0, i8* %3)
%11 = tail call i32 @exit(i32 1)
unreachable
12: ; preds = %4
ret void
}
/* Variables and functions */
int climbStairs(int);
int /*<<< orphan*/ printf(char *, int);
int main() { printf("%d\n", climbStairs(5)); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x5,%edi
call   1040 <climbStairs@plt>
mov    %eax,%esi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x5,%edi
call   1040 <climbStairs@plt>
lea    0xece(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @climbStairs(i32 5)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ ASSERT(int);
int _SSIBaseValid(int);
void SSIClockSourceSet(uint32_t ui32Base, uint32_t ui32Source) {
  ASSERT(_SSIBaseValid(ui32Base));
  ASSERT((ui32Source == 0x00000000) || (ui32Source == 0x00000005));
  (*((volatile uint32_t *)(ui32Base + 0x00000FC8))) = ui32Source;
}


x86 assembly (clang, -O0):
<SSIClockSourceSet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <_SSIBaseValid@plt>
mov    %eax,%edi
call   1040 <ASSERT@plt>
mov    $0x1,%al
cmpl   $0x0,-0x8(%rbp)
mov    %al,-0x9(%rbp)
je     1156 <SSIClockSourceSet+0x36>
cmpl   $0x5,-0x8(%rbp)
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1040 <ASSERT@plt>
mov    -0x8(%rbp),%ecx
mov    -0x4(%rbp),%eax
add    $0xfc8,%eax
cltq
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SSIClockSourceSet>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
call   1030 <_SSIBaseValid@plt>
mov    %eax,%edi
call   1040 <ASSERT@plt>
test   %ebx,%ebx
sete   %al
cmp    $0x5,%ebx
sete   %cl
or     %al,%cl
movzbl %cl,%edi
call   1040 <ASSERT@plt>
movslq %ebp,%rax
mov    %ebx,0xfc8(%rax)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @SSIClockSourceSet(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = call i32 @_SSIBaseValid(i32 %5)
%7 = call i32 @ASSERT(i32 %6)
%8 = load i32, i32* %4
%9 = icmp eq i32 %8, 0
br i1 %9, label %13, label %10
10: ; preds = %2
%11 = load i32, i32* %4
%12 = icmp eq i32 %11, 5
br label %13
13: ; preds = %10, %2
%14 = phi i1 [ true, %2 ], [ %12, %10 ]
%15 = zext i1 %14 to i32
%16 = call i32 @ASSERT(i32 %15)
%17 = load i32, i32* %4
%18 = load i32, i32* %3
%19 = add nsw i32 %18, 4040
%20 = sext i32 %19 to i64
%21 = inttoptr i64 %20 to i32*
store volatile i32 %17, i32* %21
ret void
}

LLVM IR (-O2):
define void @SSIClockSourceSet(i32 %0, i32 %1) {
%3 = tail call i32 @_SSIBaseValid(i32 %0)
%4 = tail call i32 @ASSERT(i32 %3)
%5 = icmp eq i32 %1, 0
%6 = icmp eq i32 %1, 5
%7 = or i1 %5, %6
%8 = zext i1 %7 to i32
%9 = tail call i32 @ASSERT(i32 %8)
%10 = add nsw i32 %0, 4040
%11 = sext i32 %10 to i64
%12 = inttoptr i64 %11 to i32*
store volatile i32 %1, i32* %12
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void netpgp_deallocate(void *ptr, size_t size) {
  (void)&(size);
  free(ptr);
}


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

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

LLVM IR (-O0):
define void @netpgp_deallocate(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = call i32 @free(i8* %5)
ret void
}

LLVM IR (-O2):
define void @netpgp_deallocate(i8* nocapture %0, i64 %1) {
%3 = tail call i32 @free(i8* %0)
ret void
}
/* Type definitions */
typedef scalar_t__ wchar_t;

/* Variables and functions */
scalar_t__ utolower(scalar_t__);
wchar_t *ustrlow(wchar_t *s) {
  wchar_t *p = s;
  while (*p) {
    *p = utolower(*p);
    p++;
  }
  return s;
}


x86 assembly (clang, -O0):
<ustrlow>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
je     1159 <ustrlow+0x49>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1030 <utolower@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x10(%rbp)
jmp    1124 <ustrlow+0x14>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ustrlow>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rdi),%rdi
test   %rdi,%rdi
je     1145 <ustrlow+0x35>
lea    0x8(%r14),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
call   1030 <utolower@plt>
mov    %rax,-0x8(%rbx)
mov    (%rbx),%rdi
add    $0x8,%rbx
test   %rdi,%rdi
jne    1130 <ustrlow+0x20>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i64* @ustrlow(i64* returned %0) {
%2 = load i64, i64* %0
%3 = icmp eq i64 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %9, %4 ], [ %2, %1 ]
%6 = phi i64* [ %8, %4 ], [ %0, %1 ]
%7 = tail call i64 @utolower(i64 %5)
store i64 %7, i64* %6
%8 = getelementptr inbounds i64, i64* %6, i64 1
%9 = load i64, i64* %8
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret i64* %0
}
int DigitBase32(int v) {
  if ((v >= 0) && (v <= 9))
    return ('0' + v);
  return ('a' + (v - 10));
}


x86 assembly (clang, -O0):
<DigitBase32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     1129 <DigitBase32+0x29>
cmpl   $0x9,-0x8(%rbp)
jg     1129 <DigitBase32+0x29>
mov    -0x8(%rbp),%eax
add    $0x30,%eax
mov    %eax,-0x4(%rbp)
jmp    1135 <DigitBase32+0x35>
mov    -0x8(%rbp),%eax
sub    $0xa,%eax
add    $0x61,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<DigitBase32>:
lea    0x57(%rdi),%ecx
lea    0x30(%rdi),%eax
cmp    $0xa,%edi
cmovae %ecx,%eax
ret

LLVM IR (-O0):
define i32 @DigitBase32(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sge i32 %4, 0
br i1 %5, label %6, label %12
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp sle i32 %7, 9
br i1 %8, label %9, label %12
9: ; preds = %6
%10 = load i32, i32* %3
%11 = add nsw i32 48, %10
store i32 %11, i32* %2
br label %16
12: ; preds = %6, %1
%13 = load i32, i32* %3
%14 = sub nsw i32 %13, 10
%15 = add nsw i32 97, %14
store i32 %15, i32* %2
br label %16
16: ; preds = %12, %9
%17 = load i32, i32* %2
ret i32 %17
}

LLVM IR (-O2):
define i32 @DigitBase32(i32 %0) {
%2 = icmp ult i32 %0, 10
%3 = select i1 %2, i32 48, i32 87
%4 = add nsw i32 %3, %0
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ lua_error(char *);
void concatFB(void) { lua_error("unexpected type at conversion to string"); }


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

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

LLVM IR (-O0):
@.str = [40 x i8] c"unexpected type at conversion to string\00"
define void @concatFB() {
%1 = call i32 @lua_error(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [40 x i8] c"unexpected type at conversion to string\00"
define void @concatFB() {
%1 = tail call i32 @lua_error(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct rtattr {
  int dummy;
};
struct qdisc_util {
  int dummy;
};
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int sfq_print_xstats(struct qdisc_util *qu, FILE *f, struct rtattr *xstats) {
  return 0;
}


x86 assembly (clang, -O0):
<sfq_print_xstats>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.qdisc_util = type { i32 }
%struct.rtattr = type { i32 }
define i32 @sfq_print_xstats(%struct.qdisc_util* %0, i32* %1, %struct.rtattr* %2) {
%4 = alloca %struct.qdisc_util*
%5 = alloca i32*
%6 = alloca %struct.rtattr*
store %struct.qdisc_util* %0, %struct.qdisc_util** %4
store i32* %1, i32** %5
store %struct.rtattr* %2, %struct.rtattr** %6
ret i32 0
}

LLVM IR (-O2):
%struct.qdisc_util = type { i32 }
%struct.rtattr = type { i32 }
define i32 @sfq_print_xstats(%struct.qdisc_util* nocapture readnone %0, i32* nocapture readnone %1, %struct.rtattr* nocapture readnone %2) {
ret i32 0
}
void thermal_remove_hwmon_sysfs(struct thermal_zone_device *tz) {}


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

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

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

LLVM IR (-O2):
%struct.thermal_zone_device = type opaque
define void @thermal_remove_hwmon_sysfs(%struct.thermal_zone_device* nocapture %0) {
ret void
}
double steering_trunc(double value, double min, double max) {
  if (value > max)
    return max;
  else if (value < min)
    return min;
  else
    return value;
}


x86 assembly (clang, -O0):
<steering_trunc>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
ucomisd -0x20(%rbp),%xmm0
jbe    1132 <steering_trunc+0x32>
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    115f <steering_trunc+0x5f>
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1155 <steering_trunc+0x55>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    115f <steering_trunc+0x5f>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<steering_trunc>:
maxsd  %xmm0,%xmm1
movapd %xmm2,%xmm3
cmpltsd %xmm0,%xmm3
movapd %xmm3,%xmm0
andnpd %xmm1,%xmm0
andpd  %xmm2,%xmm3
orpd   %xmm0,%xmm3
movapd %xmm3,%xmm0
ret

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

LLVM IR (-O2):
define double @steering_trunc(double %0, double %1, double %2) {
%4 = fcmp ogt double %0, %2
%5 = fcmp olt double %0, %1
%6 = select i1 %5, double %1, double %0
%7 = select i1 %4, double %2, double %6
ret double %7
}
int freezing(struct task_struct *p) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.task_struct = type opaque
define i32 @freezing(%struct.task_struct* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *);
void donald(void) {
  printf("DONALD !\n");
  getchar();
}


x86 assembly (clang, -O0):
<donald>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<donald>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <getchar@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"DONALD !\0A\00"
define void @donald() {
%1 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @getchar()
ret void
}

LLVM IR (-O2):
@str = [9 x i8] c"DONALD !\00"
define void @donald() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @getchar()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ malloc(int);
int /*<<< orphan*/ sleep(int);
void *fn(void *args) {
  malloc(100);
  sleep(300);
  return (void *)0;
}


x86 assembly (clang, -O0):
<fn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x64,%edi
call   1030 <malloc@plt>
mov    $0x12c,%edi
call   1040 <sleep@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn>:
push   %rax
mov    $0x64,%edi
call   1030 <malloc@plt>
mov    $0x12c,%edi
call   1040 <sleep@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i8* @fn(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @malloc(i32 100)
%4 = call i32 @sleep(i32 300)
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @fn(i8* nocapture readnone %0) {
%2 = tail call i32 @malloc(i32 100)
%3 = tail call i32 @sleep(i32 300)
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ error(int, int /*<<< orphan*/, char *, char const *,
                         unsigned int, char const *);
void ST_abort(const char *file, unsigned int line, const char *msg) {
  error(1, 0, "file: %s:%d - %s", file, line, msg);
  abort();
}


x86 assembly (clang, -O0):
<ST_abort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rcx
mov    -0xc(%rbp),%r8d
mov    -0x18(%rbp),%r9
mov    $0x1,%edi
xor    %esi,%esi
lea    0xeb3(%rip),%rdx
call   1040 <error@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<ST_abort>:
push   %rax
mov    %rdx,%r9
mov    %esi,%r8d
mov    %rdi,%rcx
lea    0xecf(%rip),%rdx
mov    $0x1,%edi
xor    %esi,%esi
call   1040 <error@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"file: %s:%d - %s\00"
define void @ST_abort(i8* %0, i32 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = load i32, i32* %5
%9 = load i8*, i8** %6
%10 = call i32 @error(i32 1, i32 0, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %7, i32 %8, i8* %9)
%11 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@.str = [17 x i8] c"file: %s:%d - %s\00"
define void @ST_abort(i8* %0, i32 %1, i8* %2) {
%4 = tail call i32 @error(i32 1, i32 0, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1, i8* %2)
%5 = tail call i32 (...) @abort()
unreachable
}
int fun1(int n) {
  int i;
  for (i = 2; i < n; i++)
    if (n % i == 0)
      return 0;
  return 1;
}


x86 assembly (clang, -O0):
<fun1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1149 <fun1+0x49>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    1136 <fun1+0x36>
movl   $0x0,-0x4(%rbp)
jmp    1150 <fun1+0x50>
jmp    113b <fun1+0x3b>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110e <fun1+0xe>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fun1>:
mov    $0x1,%ecx
cmp    $0x3,%edi
jl     1120 <fun1+0x20>
mov    $0x2,%esi
nop
mov    %edi,%eax
cltd
idiv   %esi
test   %edx,%edx
je     1123 <fun1+0x23>
add    $0x1,%esi
cmp    %esi,%edi
jne    1110 <fun1+0x10>
mov    %ecx,%eax
ret
xor    %ecx,%ecx
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @fun1(i32 %0) {
%2 = icmp sgt i32 %0, 2
br i1 %2, label %5, label %10
3: ; preds = %5
%4 = icmp eq i32 %9, %0
br i1 %4, label %10, label %5
5: ; preds = %1, %3
%6 = phi i32 [ %9, %3 ], [ 2, %1 ]
%7 = srem i32 %0, %6
%8 = icmp eq i32 %7, 0
%9 = add nuw nsw i32 %6, 1
br i1 %8, label %10, label %3
10: ; preds = %5, %3, %1
%11 = phi i32 [ 1, %1 ], [ 1, %3 ], [ 0, %5 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
char *malloc(int);
int /*<<< orphan*/ stderr;
char *xmalloc(int n) {
  char *p;
  p = malloc(n);
  if (p == NULL) {
    fprintf(stderr, "Out of memory (alloc %d bytes)\n", n);
    abort();
  }
  return p;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1171 <xmalloc+0x41>
mov    0x2e87(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
lea    0xe9b(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %rbx
mov    %edi,%ebx
call   1050 <malloc@plt>
test   %rax,%rax
je     113f <xmalloc+0xf>
pop    %rbx
ret
mov    0x2e9a(%rip),%rax
mov    (%rax),%edi
lea    0xeb1(%rip),%rsi
mov    %ebx,%edx
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [32 x i8] c"Out of memory (alloc %d bytes)\0A\00"
define i8* @xmalloc(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i8* @malloc(i32 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %13
8: ; preds = %1
%9 = load i32, i32* @stderr
%10 = load i32, i32* %2
%11 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = call i32 (...) @abort()
unreachable
13: ; preds = %1
%14 = load i8*, i8** %3
ret i8* %14
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [32 x i8] c"Out of memory (alloc %d bytes)\0A\00"
define noalias i8* @xmalloc(i32 %0) {
%2 = tail call i8* @malloc(i32 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 %0)
%7 = tail call i32 (...) @abort()
unreachable
8: ; preds = %1
ret i8* %2
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ createIndex(int /*<<< orphan*/ *);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/ *);
void closeHtml(FILE *out) {
  createIndex(out);
  fputs("\n</body>\n</html>\n", out);
  fclose(out);
}


x86 assembly (clang, -O0):
<closeHtml>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <createIndex@plt>
mov    -0x8(%rbp),%rsi
lea    0xeb0(%rip),%rdi
call   1050 <fputs@plt>
mov    -0x8(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<closeHtml>:
push   %rbx
mov    %rdi,%rbx
call   1040 <createIndex@plt>
lea    0xec0(%rip),%rdi
mov    $0x11,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1050 <fwrite@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <fclose@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"\0A</body>\0A</html>\0A\00"
define void @closeHtml(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @createIndex(i32* %3)
%5 = load i32*, i32** %2
%6 = call i32 @fputs(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32* %5)
%7 = load i32*, i32** %2
%8 = call i32 @fclose(i32* %7)
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"\0A</body>\0A</html>\0A\00"
define void @closeHtml(i32* %0) {
%2 = tail call i32 @createIndex(i32* %0)
%3 = tail call i64 @fwrite(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i64 17, i64 1, i32* %0)
%4 = tail call i32 @fclose(i32* %0)
ret void
}
void XkbSetCompatMap() {}


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

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

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

LLVM IR (-O2):
define void @XkbSetCompatMap() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ LedsP__Leds__led2Toggle();
void TelosbSensorReadingC__Leds__led2Toggle(void) { LedsP__Leds__led2Toggle(); }


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

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

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

LLVM IR (-O2):
define void @TelosbSensorReadingC__Leds__led2Toggle() {
%1 = tail call i32 (...) @LedsP__Leds__led2Toggle()
ret void
}
/* Variables and functions */
long raster_inversion(long);
long edf_raster_inversion(long x) { return (raster_inversion(x)); }


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

x86 assembly (clang, -O2):
<edf_raster_inversion>:
jmp    1030 <raster_inversion@plt>

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

LLVM IR (-O2):
define i64 @edf_raster_inversion(i64 %0) {
%2 = tail call i64 @raster_inversion(i64 %0)
ret i64 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
struct ring {
  int dummy;
};
typedef int int32_t;

/* Variables and functions */
int ring_write_ch(struct ring *, int /*<<< orphan*/);
int32_t ring_safe_write_ch(struct ring *ring, uint8_t ch) {
  int ret;
  int retry_count = 100;
  do {
    ret = ring_write_ch(ring, ch);
  } while ((ret < 0) && ((retry_count--) > 0));
  return ret;
}


x86 assembly (clang, -O0):
<ring_safe_write_ch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x64,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <ring_write_ch@plt>
mov    %eax,-0x10(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x10(%rbp)
mov    %al,-0x15(%rbp)
jge    1158 <ring_safe_write_ch+0x48>
mov    -0x14(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x14(%rbp)
cmp    $0x0,%eax
setg   %al
mov    %al,-0x15(%rbp)
mov    -0x15(%rbp),%al
test   $0x1,%al
jne    1126 <ring_safe_write_ch+0x16>
mov    -0x10(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ring_safe_write_ch>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%r14d
mov    %rdi,%rbx
mov    $0xffffff9c,%ebp
nop
mov    %rbx,%rdi
mov    %r14d,%esi
call   1030 <ring_write_ch@plt>
test   %eax,%eax
jns    1138 <ring_safe_write_ch+0x28>
lea    0x1(%rbp),%ecx
test   %ebp,%ebp
mov    %ecx,%ebp
jne    1120 <ring_safe_write_ch+0x10>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
%struct.ring = type { i32 }
define i32 @ring_safe_write_ch(%struct.ring* %0, i32 %1) {
%3 = alloca %struct.ring*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store %struct.ring* %0, %struct.ring** %3
store i32 %1, i32* %4
store i32 100, i32* %6
br label %7
7: ; preds = %18, %2
%8 = load %struct.ring*, %struct.ring** %3
%9 = load i32, i32* %4
%10 = call i32 @ring_write_ch(%struct.ring* %8, i32 %9)
store i32 %10, i32* %5
br label %11
11: ; preds = %7
%12 = load i32, i32* %5
%13 = icmp slt i32 %12, 0
br i1 %13, label %14, label %18
14: ; preds = %11
%15 = load i32, i32* %6
%16 = add nsw i32 %15, -1
store i32 %16, i32* %6
%17 = icmp sgt i32 %15, 0
br label %18
18: ; preds = %14, %11
%19 = phi i1 [ false, %11 ], [ %17, %14 ]
br i1 %19, label %7, label %20
20: ; preds = %18
%21 = load i32, i32* %5
ret i32 %21
}

LLVM IR (-O2):
%struct.ring = type { i32 }
define i32 @ring_safe_write_ch(%struct.ring* %0, i32 %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i32 [ 100, %2 ], [ %7, %3 ]
%5 = tail call i32 @ring_write_ch(%struct.ring* %0, i32 %1)
%6 = icmp slt i32 %5, 0
%7 = add nsw i32 %4, -1
%8 = icmp ne i32 %4, 0
%9 = select i1 %6, i1 %8, i1 false
br i1 %9, label %3, label %10
10: ; preds = %3
ret i32 %5
}
int omg_dns_version_minor(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @omg_dns_version_minor() {
ret i32 0
}
/* Variables and functions */
int RTFBraceLevel(int);
int RTFGetBraceLevel(void) { return RTFBraceLevel(-99); }


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

x86 assembly (clang, -O2):
<RTFGetBraceLevel>:
mov    $0xffffff9d,%edi
jmp    1030 <RTFBraceLevel@plt>

LLVM IR (-O0):
define i32 @RTFGetBraceLevel() {
%1 = call i32 @RTFBraceLevel(i32 -99)
ret i32 %1
}

LLVM IR (-O2):
define i32 @RTFGetBraceLevel() {
%1 = tail call i32 @RTFBraceLevel(i32 -99)
ret i32 %1
}
void bar() {
  unsigned char foo[1024];
  for (unsigned i = 0; i < sizeof foo; i++) {
    foo[i] = 0;
  }
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x390,%rsp
movl   $0x0,-0x404(%rbp)
mov    -0x404(%rbp),%eax
cmp    $0x400,%rax
jae    1149 <bar+0x49>
mov    -0x404(%rbp),%eax
movb   $0x0,-0x400(%rbp,%rax,1)
mov    -0x404(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x404(%rbp)
jmp    1115 <bar+0x15>
add    $0x390,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @bar() {
%1 = alloca [1024 x i8]
%2 = alloca i32
store i32 0, i32* %2
br label %3
3: ; preds = %11, %0
%4 = load i32, i32* %2
%5 = zext i32 %4 to i64
%6 = icmp ult i64 %5, 1024
br i1 %6, label %7, label %14
7: ; preds = %3
%8 = load i32, i32* %2
%9 = zext i32 %8 to i64
%10 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 %9
store i8 0, i8* %10
br label %11
11: ; preds = %7
%12 = load i32, i32* %2
%13 = add i32 %12, 1
store i32 %13, i32* %2
br label %3
14: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @bar() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ close(unsigned int);
void SocketClose(unsigned int TheSocket) { close(TheSocket); }


x86 assembly (clang, -O0):
<SocketClose>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <close@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SocketClose>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define void @SocketClose(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ series(int, int, int);
int main() {
  int n;
  printf("Enter the length of Fibonacci Series: ");
  scanf("%d", &n);
  series(n, 1, 1);
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [39 x i8] c"Enter the length of Fibonacci Series: \00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 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* %2)
%5 = load i32, i32* %2
%6 = call i32 @series(i32 %5, i32 1, i32 1)
ret i32 0
}

LLVM IR (-O2):
@.str = [39 x i8] c"Enter the length of Fibonacci Series: \00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 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 i32 @series(i32 %5, i32 1, i32 1)
ret i32 0
}