xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
int /*<<< orphan*/ _mm_cmpgt_epi8(int /*<<< orphan*/, int /*<<< orphan*/);
__m128i __attribute__((__always___, __nodebug__))
_mm_cmplt_epi8(__m128i a, __m128i b) {
  return _mm_cmpgt_epi8(b, a);
}


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

x86 assembly (clang, -O2):
<_mm_cmplt_epi8>:
mov    %edi,%eax
mov    %esi,%edi
mov    %eax,%esi
jmp    1030 <_mm_cmpgt_epi8@plt>

LLVM IR (-O0):
define i32 @_mm_cmplt_epi8(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 = load i32, i32* %3
%7 = call i32 @_mm_cmpgt_epi8(i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @_mm_cmplt_epi8(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_cmpgt_epi8(i32 %1, i32 %0)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char const *, char *);
int testConfigPath(const char *path) {
  FILE *file;
  if ((file = fopen(path, "rb")) == NULL)
    return (0);
  fclose(file);
  return ((!0));
}


x86 assembly (clang, -O0):
<testConfigPath>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xec9(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    1156 <testConfigPath+0x36>
movl   $0x0,-0x4(%rbp)
jmp    1166 <testConfigPath+0x46>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testConfigPath>:
push   %rax
lea    0xed8(%rip),%rsi
call   1040 <fopen@plt>
test   %rax,%rax
je     1141 <testConfigPath+0x21>
mov    %rax,%rdi
call   1030 <fclose@plt>
mov    $0x1,%eax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"rb\00"
define i32 @testConfigPath(i8* nocapture %0) {
%2 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @fclose(i32* %2)
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ 1, %4 ], [ 0, %1 ]
ret i32 %7
}
int test_imm_BAint8_mem(signed char *val) {
  return ((*val) & (0xBA << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_BAint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -70
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ stdout;
int write(int /*<<< orphan*/, char *, int);
int term_clear_screen() { return write(stdout, "\x1b[2J", 4) != 4; }


x86 assembly (clang, -O0):
<term_clear_screen>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
mov    $0x4,%edx
call   1030 <write@plt>
cmp    $0x4,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<term_clear_screen>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
lea    0xedf(%rip),%rsi
mov    $0x4,%edx
call   1030 <write@plt>
xor    %ecx,%ecx
cmp    $0x4,%eax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stdout = global i32 0
@.str = [5 x i8] c"\1B[2J\00"
define i32 @term_clear_screen() {
%1 = load i32, i32* @stdout
%2 = call i32 @write(i32 %1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 4)
%3 = icmp ne i32 %2, 4
%4 = zext i1 %3 to i32
ret i32 %4
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [5 x i8] c"\1B[2J\00"
define i32 @term_clear_screen() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @write(i32 %1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 4)
%3 = icmp ne i32 %2, 4
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
char *flon_exid_path(char *);
int /*<<< orphan*/ flu_system(char *, char *);
int /*<<< orphan*/ free(char *);
void hlp_cat_tsk_log(char *exid) {
  char *fep = flon_exid_path(exid);
  flu_system("find var/log/%s -name \"*.log\" | xargs tail -n +1", fep);
  free(fep);
}


x86 assembly (clang, -O0):
<hlp_cat_tsk_log>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <flon_exid_path@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xeac(%rip),%rdi
call   1050 <flu_system@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hlp_cat_tsk_log>:
push   %rbx
call   1040 <flon_exid_path@plt>
mov    %rax,%rbx
lea    0xec0(%rip),%rdi
mov    %rax,%rsi
call   1050 <flu_system@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
@.str = [49 x i8] c"find var/log/%s -name \22*.log\22 | xargs tail -n +1\00"
define void @hlp_cat_tsk_log(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @flon_exid_path(i8* %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = call i32 @flu_system(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = load i8*, i8** %3
%9 = call i32 @free(i8* %8)
ret void
}

LLVM IR (-O2):
@.str = [49 x i8] c"find var/log/%s -name \22*.log\22 | xargs tail -n +1\00"
define void @hlp_cat_tsk_log(i8* %0) {
%2 = tail call i8* @flon_exid_path(i8* %0)
%3 = tail call i32 @flu_system(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = tail call i32 @free(i8* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Atm128GpioCaptureC__0__Capture__disable();
void CC2420TransmitP__CaptureSFD__disable(void) {
  Atm128GpioCaptureC__0__Capture__disable();
}


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

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

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

LLVM IR (-O2):
define void @CC2420TransmitP__CaptureSFD__disable() {
%1 = tail call i32 (...) @Atm128GpioCaptureC__0__Capture__disable()
ret void
}
/* Variables and functions */
char *strrchr(char const *, char);
char *strRSeparator(const char *s) { return strrchr(s, '/'); }


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

x86 assembly (clang, -O2):
<strRSeparator>:
mov    $0x2f,%esi
jmp    1030 <strrchr@plt>

LLVM IR (-O0):
define i8* @strRSeparator(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* @strrchr(i8* %3, i8 signext 47)
ret i8* %4
}

LLVM IR (-O2):
define i8* @strRSeparator(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 47)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "Usage: tracepath [-n] <destination>[/<port>]\n");
  exit(-1);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [46 x i8] c"Usage: tracepath [-n] <destination>[/<port>]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [46 x i8] c"Usage: tracepath [-n] <destination>[/<port>]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 -1)
unreachable
}
int simulated_nested_loop(int p) {
  int k = 0;
  int t = 5;
  int j = 0;
  for (int i = 0; i < 5; i++) {
  B:
    t = 3;
    j++;
    if (j < 100)
      goto B;
  }
  return k;
}


x86 assembly (clang, -O0):
<simulated_nested_loop>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x5,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x5,-0x14(%rbp)
jge    1164 <simulated_nested_loop+0x64>
jmp    1132 <simulated_nested_loop+0x32>
movl   $0x3,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x64,-0x10(%rbp)
jge    1151 <simulated_nested_loop+0x51>
jmp    1132 <simulated_nested_loop+0x32>
jmp    1156 <simulated_nested_loop+0x56>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1123 <simulated_nested_loop+0x23>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @simulated_nested_loop(i32 %0) {
ret i32 0
}
int ioctl_ReportRPC(int i_fd, int *p_type, int *p_mask, int *p_scheme) {
  int i_ret;
  i_ret = -1;
  return i_ret;
}


x86 assembly (clang, -O0):
<ioctl_ReportRPC>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
movl   $0xffffffff,-0x24(%rbp)
mov    -0x24(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @ioctl_ReportRPC(i32 %0, i32* nocapture readnone %1, i32* nocapture readnone %2, i32* nocapture readnone %3) {
ret i32 -1
}
int ld_blg_rr2(long double a1, long double a2) {
  return !(__builtin_islessgreater(a1, a2));
}


x86 assembly (clang, -O0):
<ld_blg_rr2>:
push   %rbp
mov    %rsp,%rbp
fldt   0x20(%rbp)
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fstpt  -0x20(%rbp)
fldt   -0x10(%rbp)
fldt   -0x20(%rbp)
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ld_blg_rr2>:
fldt   0x18(%rsp)
fldt   0x8(%rsp)
xor    %eax,%eax
fucomip %st(1),%st
fstp   %st(0)
sete   %al
ret

LLVM IR (-O0):
define i32 @ld_blg_rr2(x86_fp80 %0, x86_fp80 %1) {
%3 = alloca x86_fp80
%4 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %3
store x86_fp80 %1, x86_fp80* %4
%5 = load x86_fp80, x86_fp80* %3
%6 = load x86_fp80, x86_fp80* %4
%7 = fcmp one x86_fp80 %5, %6
%8 = xor i1 %7, true
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @ld_blg_rr2(x86_fp80 %0, x86_fp80 %1) {
%3 = fcmp ueq x86_fp80 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
unsigned int fibonacci(unsigned int n) {
  if (n == 0) {
    return 0;
  } else if (n == 1) {
    return 1;
  }
  return fibonacci(n - 1) + fibonacci(n - 2);
}


x86 assembly (clang, -O0):
<fibonacci>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1131 <fibonacci+0x21>
movl   $0x0,-0x4(%rbp)
jmp    116f <fibonacci+0x5f>
cmpl   $0x1,-0x8(%rbp)
jne    1147 <fibonacci+0x37>
movl   $0x1,-0x4(%rbp)
jmp    116f <fibonacci+0x5f>
jmp    114c <fibonacci+0x3c>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <fibonacci@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x2,%edi
call   1030 <fibonacci@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fibonacci>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
xor    %ebp,%ebp
cmp    $0x2,%ebx
jb     1132 <fibonacci+0x22>
nopl   0x0(%rax)
lea    -0x1(%rbx),%edi
call   1030 <fibonacci@plt>
add    %eax,%ebp
add    $0xfffffffe,%ebx
cmp    $0x2,%ebx
jae    1120 <fibonacci+0x10>
add    %ebp,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @fibonacci(i32 %0) {
br label %2
2: ; preds = %6, %1
%3 = phi i32 [ 0, %1 ], [ %10, %6 ]
%4 = phi i32 [ %0, %1 ], [ %9, %6 ]
%5 = icmp ult i32 %4, 2
br i1 %5, label %11, label %6
6: ; preds = %2
%7 = add i32 %4, -1
%8 = tail call i32 @fibonacci(i32 %7)
%9 = add i32 %4, -2
%10 = add i32 %8, %3
br label %2
11: ; preds = %2
%12 = add i32 %4, %3
ret i32 %12
}
void fn00401000() { return; }


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

x86 assembly (clang, -O2):
ret

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

LLVM IR (-O2):
define void @fn00401000() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ dhcp_packet(int, char *, char *, char *, char *, char *,
                               char *);
void dhcp_request(char *ipaddr, char *gwaddr, char *hardware, char *opt82,
                  char *opt60) {
  dhcp_packet(3, ipaddr, ipaddr, opt60, opt82, gwaddr, hardware);
}


x86 assembly (clang, -O0):
<dhcp_request>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x8(%rbp),%rdx
mov    -0x28(%rbp),%rcx
mov    -0x20(%rbp),%r8
mov    -0x10(%rbp),%r9
mov    -0x18(%rbp),%rax
mov    $0x3,%edi
mov    %rax,(%rsp)
call   1030 <dhcp_packet@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dhcp_request>:
push   %rax
mov    %rcx,%rax
mov    %rsi,%r9
mov    %rdi,%rsi
mov    %rdx,(%rsp)
mov    $0x3,%edi
mov    %rsi,%rdx
mov    %r8,%rcx
mov    %rax,%r8
call   1030 <dhcp_packet@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @dhcp_request(i8* %0, i8* %1, i8* %2, i8* %3, i8* %4) {
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8*
store i8* %0, i8** %6
store i8* %1, i8** %7
store i8* %2, i8** %8
store i8* %3, i8** %9
store i8* %4, i8** %10
%11 = load i8*, i8** %6
%12 = load i8*, i8** %6
%13 = load i8*, i8** %10
%14 = load i8*, i8** %9
%15 = load i8*, i8** %7
%16 = load i8*, i8** %8
%17 = call i32 @dhcp_packet(i32 3, i8* %11, i8* %12, i8* %13, i8* %14, i8* %15, i8* %16)
ret void
}

LLVM IR (-O2):
define void @dhcp_request(i8* %0, i8* %1, i8* %2, i8* %3, i8* %4) {
%6 = tail call i32 @dhcp_packet(i32 3, i8* %0, i8* %0, i8* %4, i8* %3, i8* %1, i8* %2)
ret void
}
/* Variables and functions */
char *g_DUMMY_popup_getdirname(int win_id, char *title) {
  win_id = win_id;
  title = title;
  return NULL;
}


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

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

LLVM IR (-O0):
define i8* @g_DUMMY_popup_getdirname(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
store i32 %5, i32* %3
%6 = load i8*, i8** %4
store i8* %6, i8** %4
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @g_DUMMY_popup_getdirname(i32 %0, i8* nocapture readnone %1) {
ret i8* null
}
void _Jv_AllocBytes() {}


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

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

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

LLVM IR (-O2):
define void @_Jv_AllocBytes() {
ret void
}
/* Variables and functions */
int M_PI;
double radian(double degree) { return degree * (M_PI / 180.); }


x86 assembly (clang, -O0):
<radian>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    0x2ed3(%rip),%rax
cvtsi2sdl (%rax),%xmm1
movsd  0xedf(%rip),%xmm2
divsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<radian>:
mov    0x2ee1(%rip),%rax
cvtsi2sdl (%rax),%xmm1
divsd  0xeed(%rip),%xmm1
mulsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
@M_PI = global i32 0
define double @radian(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load i32, i32* @M_PI
%5 = sitofp i32 %4 to double
%6 = fdiv double %5, 1.800000e+02
%7 = fmul double %3, %6
ret double %7
}

LLVM IR (-O2):
@M_PI = global i32 0
define double @radian(double %0) {
%2 = load i32, i32* @M_PI
%3 = sitofp i32 %2 to double
%4 = fdiv double %3, 1.800000e+02
%5 = fmul double %4, %0
ret double %5
}
unsigned int l32(unsigned int x, unsigned int n) {
  return (x << n) | (x >> (-n & 31));
}


x86 assembly (clang, -O0):
<l32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    %cl,%eax
mov    -0x4(%rbp),%edx
xor    %ecx,%ecx
sub    -0x8(%rbp),%ecx
and    $0x1f,%ecx
shr    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<l32>:
mov    %esi,%ecx
mov    %edi,%eax
rol    %cl,%eax
ret

LLVM IR (-O0):
define i32 @l32(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = shl i32 %5, %6
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = sub i32 0, %9
%11 = and i32 %10, 31
%12 = lshr i32 %8, %11
%13 = or i32 %7, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @l32(i32 %0, i32 %1) {
%3 = shl i32 %0, %1
%4 = sub i32 0, %1
%5 = and i32 %4, 31
%6 = lshr i32 %0, %5
%7 = or i32 %6, %3
ret i32 %7
}
/* Variables and functions */
float *smalloc(int);
float *mkvec_float(int nl, int nh) {
  float *v;
  v = smalloc((nh - nl + 1) * sizeof(float));
  return (v - nl);
}


x86 assembly (clang, -O0):
<mkvec_float>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sub    -0x4(%rbp),%eax
add    $0x1,%eax
cltq
shl    $0x2,%rax
mov    %eax,%edi
call   1030 <smalloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rdx
xor    %ecx,%ecx
sub    %rdx,%rcx
shl    $0x2,%rcx
add    %rcx,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mkvec_float>:
push   %rbx
mov    %edi,%ebx
sub    %edi,%esi
lea    0x4(,%rsi,4),%edi
call   1030 <smalloc@plt>
movslq %ebx,%rcx
shl    $0x2,%rcx
sub    %rcx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define float* @mkvec_float(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca float*
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = load i32, i32* %3
%8 = sub nsw i32 %6, %7
%9 = add nsw i32 %8, 1
%10 = sext i32 %9 to i64
%11 = mul i64 %10, 4
%12 = trunc i64 %11 to i32
%13 = call float* @smalloc(i32 %12)
store float* %13, float** %5
%14 = load float*, float** %5
%15 = load i32, i32* %3
%16 = sext i32 %15 to i64
%17 = sub i64 0, %16
%18 = getelementptr inbounds float, float* %14, i64 %17
ret float* %18
}

LLVM IR (-O2):
define float* @mkvec_float(i32 %0, i32 %1) {
%3 = sub nsw i32 %1, %0
%4 = shl i32 %3, 2
%5 = add i32 %4, 4
%6 = tail call float* @smalloc(i32 %5)
%7 = sext i32 %0 to i64
%8 = sub nsw i64 0, %7
%9 = getelementptr inbounds float, float* %6, i64 %8
ret float* %9
}
/* Variables and functions */
int /*<<< orphan*/ memset(void *, int, size_t);
void xempty(void *ptr, size_t sz) {
  if (((void *)ptr != (void *)NULL) && (sz > (size_t)0)) {
    memset(ptr, (int)NULL, sz);
  }
}


x86 assembly (clang, -O0):
<xempty>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1145 <xempty+0x35>
cmpq   $0x0,-0x10(%rbp)
jbe    1145 <xempty+0x35>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xempty>:
test   %rdi,%rdi
je     1124 <xempty+0x14>
mov    %rsi,%rdx
test   %rsi,%rsi
je     1124 <xempty+0x14>
xor    %esi,%esi
jmp    1030 <memset@plt>
ret

LLVM IR (-O0):
define void @xempty(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 = icmp ne i8* %5, null
br i1 %6, label %7, label %14
7: ; preds = %2
%8 = load i64, i64* %4
%9 = icmp ugt i64 %8, 0
br i1 %9, label %10, label %14
10: ; preds = %7
%11 = load i8*, i8** %3
%12 = load i64, i64* %4
%13 = call i32 @memset(i8* %11, i32 0, i64 %12)
br label %14
14: ; preds = %10, %7, %2
ret void
}

LLVM IR (-O2):
define void @xempty(i8* %0, i64 %1) {
%3 = icmp ne i8* %0, null
%4 = icmp ne i64 %1, 0
%5 = and i1 %3, %4
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 @memset(i8* %0, i32 0, i64 %1)
br label %8
8: ; preds = %6, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _putchar(char);
void print_most_numbers(void) {
  int i = '0';
  for (i = '0'; i <= '9'; i++) {
    if ((i != '2') && (i != '4'))
      _putchar(i);
  }
  _putchar('\n');
}


x86 assembly (clang, -O0):
<print_most_numbers>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x30,-0x4(%rbp)
movl   $0x30,-0x4(%rbp)
cmpl   $0x39,-0x4(%rbp)
jg     1162 <print_most_numbers+0x52>
cmpl   $0x32,-0x4(%rbp)
je     114f <print_most_numbers+0x3f>
cmpl   $0x34,-0x4(%rbp)
je     114f <print_most_numbers+0x3f>
mov    -0x4(%rbp),%eax
movsbl %al,%edi
call   1030 <_putchar@plt>
jmp    1154 <print_most_numbers+0x44>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1126 <print_most_numbers+0x16>
mov    $0xa,%edi
call   1030 <_putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_most_numbers>:
push   %rax
mov    $0x30,%edi
call   1030 <_putchar@plt>
mov    $0x31,%edi
call   1030 <_putchar@plt>
mov    $0x33,%edi
call   1030 <_putchar@plt>
mov    $0x35,%edi
call   1030 <_putchar@plt>
mov    $0x36,%edi
call   1030 <_putchar@plt>
mov    $0x37,%edi
call   1030 <_putchar@plt>
mov    $0x38,%edi
call   1030 <_putchar@plt>
mov    $0x39,%edi
call   1030 <_putchar@plt>
mov    $0xa,%edi
pop    %rax
jmp    1030 <_putchar@plt>

LLVM IR (-O0):
define void @print_most_numbers() {
%1 = alloca i32
store i32 48, i32* %1
store i32 48, i32* %1
br label %2
2: ; preds = %16, %0
%3 = load i32, i32* %1
%4 = icmp sle i32 %3, 57
br i1 %4, label %5, label %19
5: ; preds = %2
%6 = load i32, i32* %1
%7 = icmp ne i32 %6, 50
br i1 %7, label %8, label %15
8: ; preds = %5
%9 = load i32, i32* %1
%10 = icmp ne i32 %9, 52
br i1 %10, label %11, label %15
11: ; preds = %8
%12 = load i32, i32* %1
%13 = trunc i32 %12 to i8
%14 = call i32 @_putchar(i8 signext %13)
br label %15
15: ; preds = %11, %8, %5
br label %16
16: ; preds = %15
%17 = load i32, i32* %1
%18 = add nsw i32 %17, 1
store i32 %18, i32* %1
br label %2
19: ; preds = %2
%20 = call i32 @_putchar(i8 signext 10)
ret void
}

LLVM IR (-O2):
define void @print_most_numbers() {
%1 = tail call i32 @_putchar(i8 signext 48)
%2 = tail call i32 @_putchar(i8 signext 49)
%3 = tail call i32 @_putchar(i8 signext 51)
%4 = tail call i32 @_putchar(i8 signext 53)
%5 = tail call i32 @_putchar(i8 signext 54)
%6 = tail call i32 @_putchar(i8 signext 55)
%7 = tail call i32 @_putchar(i8 signext 56)
%8 = tail call i32 @_putchar(i8 signext 57)
%9 = tail call i32 @_putchar(i8 signext 10)
ret void
}
/* Variables and functions */
int board_ti_is(char *);
int board_is_bone_lt(void) { return board_ti_is("A335BNLT"); }


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

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

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

LLVM IR (-O2):
@.str = [9 x i8] c"A335BNLT\00"
define i32 @board_is_bone_lt() {
%1 = tail call i32 @board_ti_is(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
int dns_cache_check(struct dns_cache *cache) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.dns_cache = type opaque
define i32 @dns_cache_check(%struct.dns_cache* nocapture readnone %0) {
ret i32 0
}
int foo(int *p) { return *p; }


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

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

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

LLVM IR (-O2):
define i32 @foo(i32* nocapture %0) {
%2 = load i32, i32* %0
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ OCSP_REQUEST;
typedef int /*<<< orphan*/ ASN1_VALUE;

/* Variables and functions */
int /*<<< orphan*/ ASN1_item_free(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int /*<<< orphan*/ OCSP_REQUEST_it;
void OCSP_REQUEST_free(OCSP_REQUEST *a) {
  ASN1_item_free((ASN1_VALUE *)a, &OCSP_REQUEST_it);
}


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

x86 assembly (clang, -O2):
<OCSP_REQUEST_free>:
mov    0x2ec9(%rip),%rsi
jmp    1030 <ASN1_item_free@plt>

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

LLVM IR (-O2):
@OCSP_REQUEST_it = global i32 0
define void @OCSP_REQUEST_free(i32* %0) {
%2 = tail call i32 @ASN1_item_free(i32* %0, i32* @OCSP_REQUEST_it)
ret void
}
/* Variables and functions */
long long gcd_hash(long long, long long);
long long lcm(long long a, long long b) {
  long long tmp = gcd_hash(a, b);
  if (tmp)
    return (a * b) / tmp;
  return 0;
}


x86 assembly (clang, -O0):
<lcm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <gcd_hash@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     1154 <lcm+0x44>
mov    -0x10(%rbp),%rax
imul   -0x18(%rbp),%rax
cqto
idivq  -0x20(%rbp)
mov    %rax,-0x8(%rbp)
jmp    115c <lcm+0x4c>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lcm>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
call   1030 <gcd_hash@plt>
test   %rax,%rax
je     113e <lcm+0x2e>
mov    %rax,%rcx
imul   %r14,%rbx
or     %rbx,%rax
shr    $0x20,%rax
je     1142 <lcm+0x32>
mov    %rbx,%rax
cqto
idiv   %rcx
jmp    1148 <lcm+0x38>
xor    %eax,%eax
jmp    1148 <lcm+0x38>
mov    %ebx,%eax
xor    %edx,%edx
div    %ecx
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i64 @lcm(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* %4
%8 = load i64, i64* %5
%9 = call i64 @gcd_hash(i64 %7, i64 %8)
store i64 %9, i64* %6
%10 = load i64, i64* %6
%11 = icmp ne i64 %10, 0
br i1 %11, label %12, label %18
12: ; preds = %2
%13 = load i64, i64* %4
%14 = load i64, i64* %5
%15 = mul nsw i64 %13, %14
%16 = load i64, i64* %6
%17 = sdiv i64 %15, %16
store i64 %17, i64* %3
br label %19
18: ; preds = %2
store i64 0, i64* %3
br label %19
19: ; preds = %18, %12
%20 = load i64, i64* %3
ret i64 %20
}

LLVM IR (-O2):
define i64 @lcm(i64 %0, i64 %1) {
%3 = tail call i64 @gcd_hash(i64 %0, i64 %1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = mul nsw i64 %1, %0
%7 = sdiv i64 %6, %3
br label %8
8: ; preds = %2, %5
%9 = phi i64 [ %7, %5 ], [ 0, %2 ]
ret i64 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ off_t;

/* Variables and functions */
int readahead(int, int /*<<< orphan*/ *, size_t);
int prefetch(int fd, off_t start, size_t len) {
  return readahead(fd, &start, len);
}


x86 assembly (clang, -O0):
<prefetch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rdx
lea    -0x8(%rbp),%rsi
call   1030 <readahead@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<prefetch>:
push   %rax
mov    %esi,0x4(%rsp)
lea    0x4(%rsp),%rsi
call   1030 <readahead@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @prefetch(i32 %0, i32 %1, i64 %2) {
%4 = alloca i32
store i32 %1, i32* %4
%5 = call i32 @readahead(i32 %0, i32* %4, i64 %2)
ret i32 %5
}
/* Variables and functions */
unsigned char USART1_receive();
int /*<<< orphan*/ USART1_send(unsigned char);
int /*<<< orphan*/ setup();
void main() {
  unsigned char S = 0;
  setup();
  while (1) {
    S = USART1_receive();
    USART1_send(S);
  };
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x0,-0x1(%rbp)
mov    $0x0,%al
call   1050 <setup@plt>
mov    $0x0,%al
call   1030 <USART1_receive@plt>
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edi
call   1040 <USART1_send@plt>
jmp    1143 <main+0x13>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <setup@plt>
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <USART1_receive@plt>
movzbl %al,%edi
call   1040 <USART1_send@plt>
jmp    1140 <main+0x10>

LLVM IR (-O0):
define void @main() {
%1 = alloca i8
store i8 0, i8* %1
%2 = call i32 (...) @setup()
br label %3
3: ; preds = %0, %3
%4 = call zeroext i8 (...) @USART1_receive()
store i8 %4, i8* %1
%5 = load i8, i8* %1
%6 = call i32 @USART1_send(i8 zeroext %5)
br label %3
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 (...) @setup()
br label %2
2: ; preds = %2, %0
%3 = tail call zeroext i8 (...) @USART1_receive()
%4 = tail call i32 @USART1_send(i8 zeroext %3)
br label %2
}
/* Variables and functions */
char *strrchr(char const *, int);
char *cst_strrchr(const char *str, int c) { return strrchr(str, c); }


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

x86 assembly (clang, -O2):
<cst_strrchr>:
jmp    1030 <strrchr@plt>

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

LLVM IR (-O2):
define i8* @cst_strrchr(i8* %0, i32 %1) {
%3 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i32 %1)
ret i8* %3
}
int checkInput(int b) { return b < 0 || b > 1; }


x86 assembly (clang, -O0):
<checkInput>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1120 <checkInput+0x20>
cmpl   $0x1,-0x4(%rbp)
setg   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkInput>:
xor    %eax,%eax
cmp    $0x2,%edi
setae  %al
ret

LLVM IR (-O0):
define i32 @checkInput(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 %3, 0
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sgt i32 %6, 1
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ true, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @checkInput(i32 %0) {
%2 = icmp ugt i32 %0, 1
%3 = zext i1 %2 to i32
ret i32 %3
}
int fun888() { return 888; }


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

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

LLVM IR (-O0):
define i32 @fun888() {
ret i32 888
}

LLVM IR (-O2):
define i32 @fun888() {
ret i32 888
}
/* Variables and functions */
double atan(double);
double atof(char *);
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("\n\nHello World!\n");
  char expression[] = "123.0";
  double res = atof(expression);
  res = atan(res) * 180.0 / 3.141592;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1040 <printf@plt>
mov    0xecf(%rip),%eax
mov    %eax,-0xa(%rbp)
mov    0xec9(%rip),%ax
mov    %ax,-0x6(%rbp)
lea    -0xa(%rbp),%rdi
call   1030 <atof@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1050 <atan@plt>
movsd  0xe89(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe75(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [16 x i8] c"\0A\0AHello World!\0A\00"
@__const.main.expression = [6 x i8] c"123.0\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [6 x i8]
%3 = alloca double
store i32 0, i32* %1
%4 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%5 = bitcast [6 x i8]* %2 to i8*
%6 = getelementptr inbounds [6 x i8], [6 x i8]* %2, i64 0, i64 0
%7 = call double @atof(i8* %6)
store double %7, double* %3
%8 = load double, double* %3
%9 = call double @atan(double %8)
%10 = fmul double %9, 1.800000e+02
%11 = fdiv double %10, 0x400921FAFC8B007A
store double %11, double* %3
ret i32 0
}

LLVM IR (-O2):
@__const.main.expression = [6 x i8] c"123.0\00"
@str = [15 x i8] c"\0A\0AHello World!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
%2 = tail call double @atof(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @__const.main.expression, i64 0, i64 0))
%3 = tail call double @atan(double %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ getppid();
int main(void) {
  for (long long i = 0; i < 100000000; ++i) {
    getppid();
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
cmpq   $0x5f5e100,-0x10(%rbp)
05
jge    114d <main+0x3d>
mov    $0x0,%al
call   1030 <getppid@plt>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1127 <main+0x17>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x5f5e100,%ebx
cs nopw 0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <getppid@plt>
add    $0xffffffffffffffff,%rbx
jne    1120 <main+0x10>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
store i32 0, i32* %1
store i64 0, i64* %2
br label %3
3: ; preds = %8, %0
%4 = load i64, i64* %2
%5 = icmp slt i64 %4, 100000000
br i1 %5, label %6, label %11
6: ; preds = %3
%7 = call i32 (...) @getppid()
br label %8
8: ; preds = %6
%9 = load i64, i64* %2
%10 = add nsw i64 %9, 1
store i64 %10, i64* %2
br label %3
11: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
br label %2
1: ; preds = %2
ret i32 0
2: ; preds = %0, %2
%3 = phi i64 [ 0, %0 ], [ %5, %2 ]
%4 = tail call i32 (...) @getppid()
%5 = add nuw nsw i64 %3, 1
%6 = icmp eq i64 %5, 100000000
br i1 %6, label %1, label %2
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int sancus_drll(long long v, long long a, long long b) {
  assert((v >= a) && (v <= b));
  return (int)v;
}


x86 assembly (clang, -O0):
<sancus_drll>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rcx
xor    %eax,%eax
cmp    -0x10(%rbp),%rcx
mov    %al,-0x19(%rbp)
jl     1145 <sancus_drll+0x35>
mov    -0x8(%rbp),%rax
cmp    -0x18(%rbp),%rax
setle  %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sancus_drll>:
push   %rbx
mov    %rdi,%rbx
cmp    %rsi,%rdi
setge  %al
cmp    %rdx,%rdi
setle  %cl
and    %al,%cl
movzbl %cl,%edi
call   1030 <assert@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @sancus_drll(i64 %0, i64 %1, i64 %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%7 = load i64, i64* %4
%8 = load i64, i64* %5
%9 = icmp sge i64 %7, %8
br i1 %9, label %10, label %14
10: ; preds = %3
%11 = load i64, i64* %4
%12 = load i64, i64* %6
%13 = icmp sle i64 %11, %12
br label %14
14: ; preds = %10, %3
%15 = phi i1 [ false, %3 ], [ %13, %10 ]
%16 = zext i1 %15 to i32
%17 = call i32 @assert(i32 %16)
%18 = load i64, i64* %4
%19 = trunc i64 %18 to i32
ret i32 %19
}

LLVM IR (-O2):
define i32 @sancus_drll(i64 %0, i64 %1, i64 %2) {
%4 = icmp sge i64 %0, %1
%5 = icmp sle i64 %0, %2
%6 = and i1 %4, %5
%7 = zext i1 %6 to i32
%8 = tail call i32 @assert(i32 %7)
%9 = trunc i64 %0 to i32
ret i32 %9
}
/* Type definitions */
typedef char *uint32_t;

/* Variables and functions */
uint32_t get_cr0() {
  uint32_t v;
  asm volatile("mov %%"
               "cr0"
               ", %0"
               : "=r"(v));
  return v;
}


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

x86 assembly (clang, -O2):
<get_cr0>:
mov    %cr0,%rax
ret

LLVM IR (-O0):
define i8* @get_cr0() {
%1 = alloca i8*
%2 = call i8* asm sideeffect "mov %cr0, $0", "=r,~{dirflag},~{fpsr},~{flags}"()
store i8* %2, i8** %1
%3 = load i8*, i8** %1
ret i8* %3
}

LLVM IR (-O2):
define i8* @get_cr0() {
%1 = tail call i8* asm sideeffect "mov %cr0, $0", "=r,~{dirflag},~{fpsr},~{flags}"()
ret i8* %1
}
/* Type definitions */
struct Buffer {
  int dummy;
};

/* Variables and functions */
size_t buffer_move_logic(struct Buffer *, void *, size_t, int /*<<< orphan*/);
size_t buffer_move(void *buf, void *data, size_t length) {
  struct Buffer *buffer = buf;
  return buffer_move_logic(buffer, data, length, 0);
}


x86 assembly (clang, -O0):
<buffer_move>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
xor    %ecx,%ecx
call   1030 <buffer_move_logic@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<buffer_move>:
xor    %ecx,%ecx
jmp    1030 <buffer_move_logic@plt>

LLVM IR (-O0):
%struct.Buffer = type { i32 }
define i64 @buffer_move(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
%7 = alloca %struct.Buffer*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to %struct.Buffer*
store %struct.Buffer* %9, %struct.Buffer** %7
%10 = load %struct.Buffer*, %struct.Buffer** %7
%11 = load i8*, i8** %5
%12 = load i64, i64* %6
%13 = call i64 @buffer_move_logic(%struct.Buffer* %10, i8* %11, i64 %12, i32 0)
ret i64 %13
}

LLVM IR (-O2):
%struct.Buffer = type { i32 }
define i64 @buffer_move(i8* %0, i8* %1, i64 %2) {
%4 = bitcast i8* %0 to %struct.Buffer*
%5 = tail call i64 @buffer_move_logic(%struct.Buffer* %4, i8* %1, i64 %2, i32 0)
ret i64 %5
}
int blk_rq_unmap_user(struct bio *bio, unsigned int ulen) {
  int a;
  return a;
}


x86 assembly (clang, -O0):
<blk_rq_unmap_user>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.bio = type opaque
define i32 @blk_rq_unmap_user(%struct.bio* %0, i32 %1) {
%3 = alloca %struct.bio*
%4 = alloca i32
%5 = alloca i32
store %struct.bio* %0, %struct.bio** %3
store i32 %1, i32* %4
%6 = load i32, i32* %5
ret i32 %6
}

LLVM IR (-O2):
%struct.bio = type opaque
define i32 @blk_rq_unmap_user(%struct.bio* nocapture readnone %0, i32 %1) {
ret i32 undef
}
extern char *strcpy(char *dest, const char *src) {
  __asm__("cld\n"
          "1:\tlodsb\n\t"
          "stosb\n\t"
          "testb %%al,%%al\n\t"
          "jne 1b" ::"S"(src),
          "D"(dest));
  return dest;
}


x86 assembly (clang, -O0):
<strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x8(%rbp),%rdi
cld
lods   %ds:(%rsi),%al
stos   %al,%es:(%rdi)
test   %al,%al
jne    1115 <strcpy+0x15>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy>:
cld
lods   %ds:(%rsi),%al
stos   %al,%es:(%rdi)
test   %al,%al
jne    1101 <strcpy+0x1>
mov    %rdi,%rax
ret

LLVM IR (-O0):
define i8* @strcpy(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 = load i8*, i8** %3
ret i8* %7
}

LLVM IR (-O2):
define i8* @strcpy(i8* returned %0, i8* %1) {
tail call void asm sideeffect "cld\0A1:\09lodsb\0A\09stosb\0A\09testb %al,%al\0A\09jne 1b", "{si},{di},~{dirflag},~{fpsr},~{flags}"(i8* %1, i8* %0)
ret i8* %0
}
void *dummy_createmutex(void) { return (void *)1; }


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

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

LLVM IR (-O0):
define i8* @dummy_createmutex() {
ret i8* inttoptr (i64 1 to i8*)
}

LLVM IR (-O2):
define i8* @dummy_createmutex() {
ret i8* inttoptr (i64 1 to i8*)
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void safe_free(void **ptr) {
  if (!ptr || !*ptr)
    return;
  free(*ptr);
  *ptr = NULL;
}


x86 assembly (clang, -O0):
<safe_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1135 <safe_free+0x25>
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
jne    113a <safe_free+0x2a>
jmp    1151 <safe_free+0x41>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rax
movq   $0x0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<safe_free>:
push   %rbx
test   %rdi,%rdi
je     112d <safe_free+0x1d>
mov    %rdi,%rbx
mov    (%rdi),%rdi
test   %rdi,%rdi
je     112d <safe_free+0x1d>
call   1030 <free@plt>
movq   $0x0,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @safe_free(i8** %0) {
%2 = icmp eq i8** %0, null
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = load i8*, i8** %0
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i32 @free(i8* %4)
store i8* null, i8** %0
br label %8
8: ; preds = %1, %3, %6
ret void
}