xunge/DecIR huggingface dataset:
long gcd(long a, long b) {
  if (b == 0) {
    return a;
  }
  return gcd(b, a % b);
}


x86 assembly (clang, -O0):
<gcd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1138 <gcd+0x28>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1152 <gcd+0x42>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rax
cqto
idivq  -0x18(%rbp)
mov    %rdx,%rsi
call   1030 <gcd@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcd>:
mov    %rdi,%rax
test   %rsi,%rsi
je     1135 <gcd+0x35>
mov    %rsi,%rdx
jmp    111d <gcd+0x1d>
nopl   (%rax)
cqto
idiv   %rcx
mov    %rcx,%rax
test   %rdx,%rdx
je     1132 <gcd+0x32>
mov    %rdx,%rcx
mov    %rax,%rdx
or     %rcx,%rdx
shr    $0x20,%rdx
jne    1110 <gcd+0x10>
xor    %edx,%edx
div    %ecx
jmp    1115 <gcd+0x15>
mov    %rcx,%rax
ret

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

LLVM IR (-O2):
define i64 @gcd(i64 %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %9, label %4
4: ; preds = %2, %4
%5 = phi i64 [ %7, %4 ], [ %1, %2 ]
%6 = phi i64 [ %5, %4 ], [ %0, %2 ]
%7 = srem i64 %6, %5
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %4
9: ; preds = %4, %2
%10 = phi i64 [ %0, %2 ], [ %5, %4 ]
ret i64 %10
}
unsigned xrop3_60_1_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  stk1 = T ^ S;
  return (stk1 & (~S)) | (D & S);
}


x86 assembly (clang, -O0):
<xrop3_60_1_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
xor    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_60_1_0>:
mov    %edi,%eax
shl    $0x8,%eax
or     %edi,%eax
mov    %esi,%ecx
shl    $0x8,%ecx
or     %esi,%ecx
not    %eax
and    %ecx,%eax
or     %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @xrop3_60_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = mul nuw nsw i32 %5, 257
%7 = xor i32 %4, -1
%8 = and i32 %6, %7
%9 = or i32 %8, %3
ret i32 %9
}
void handle_SOUND(int sig) {}


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

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

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

LLVM IR (-O2):
define void @handle_SOUND(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ clear();
void io_clearscreen() { clear(); }


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

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

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

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

/* Variables and functions */
int syscall(int, int /*<<< orphan*/ *, int /*<<< orphan*/ *,
            int /*<<< orphan*/ *);
int getresuid(uid_t *ruid, uid_t *euid, uid_t *suid) {
  return syscall(165, ruid, euid, suid);
}


x86 assembly (clang, -O0):
<getresuid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    $0xa5,%edi
call   1030 <syscall@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getresuid>:
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    $0xa5,%edi
jmp    1030 <syscall@plt>

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

LLVM IR (-O2):
define i32 @getresuid(i32* %0, i32* %1, i32* %2) {
%4 = tail call i32 @syscall(i32 165, i32* %0, i32* %1, i32* %2)
ret i32 %4
}
/* Type definitions */
struct t_gui_window {
  int dummy;
};

/* Variables and functions */
const char *gui_window_get_string(struct t_gui_window *window,
                                  const char *property) {
  if (!window || !property)
    return NULL;
  return NULL;
}


x86 assembly (clang, -O0):
<gui_window_get_string>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1122 <gui_window_get_string+0x22>
cmpq   $0x0,-0x18(%rbp)
jne    112f <gui_window_get_string+0x2f>
movq   $0x0,-0x8(%rbp)
jmp    1137 <gui_window_get_string+0x37>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

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

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

LLVM IR (-O2):
%struct.t_gui_window = type { i32 }
define noalias i8* @gui_window_get_string(%struct.t_gui_window* nocapture readnone %0, i8* nocapture readnone %1) {
ret i8* null
}
/* Variables and functions */
scalar_t__ __syscall(int, void *);
void *ucc_brk(void *p) { return (void *)__syscall(12, p); }


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

x86 assembly (clang, -O2):
<ucc_brk>:
mov    %rdi,%rsi
mov    $0xc,%edi
jmp    1030 <__syscall@plt>

LLVM IR (-O0):
define i8* @ucc_brk(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @__syscall(i32 12, i8* %3)
%5 = inttoptr i64 %4 to i8*
ret i8* %5
}

LLVM IR (-O2):
define i8* @ucc_brk(i8* %0) {
%2 = tail call i64 @__syscall(i32 12, i8* %0)
%3 = inttoptr i64 %2 to i8*
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ __bound_new_region(void *, int);
void __bound_main_arg(void **p) {
  void *start = p;
  while (*p++)
    ;

  ;
  __bound_new_region(start, (void *)p - start);
}


x86 assembly (clang, -O0):
<__bound_main_arg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x8(%rbp)
cmpq   $0x0,(%rax)
je     1142 <__bound_main_arg+0x32>
jmp    1124 <__bound_main_arg+0x14>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    %rcx,%rax
mov    %eax,%esi
call   1030 <__bound_new_region@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__bound_main_arg>:
xor    %esi,%esi
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
cmpq   $0x0,(%rdi,%rsi,1)
lea    0x8(%rsi),%rsi
jne    1120 <__bound_main_arg+0x10>
jmp    1030 <__bound_new_region@plt>

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

LLVM IR (-O2):
define void @__bound_main_arg(i8** %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8** [ %0, %1 ], [ %4, %2 ]
%4 = getelementptr inbounds i8*, i8** %3, i64 1
%5 = load i8*, i8** %3
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %2
7: ; preds = %2
%8 = bitcast i8** %0 to i8*
%9 = ptrtoint i8** %4 to i64
%10 = ptrtoint i8** %0 to i64
%11 = sub i64 %9, %10
%12 = trunc i64 %11 to i32
%13 = tail call i32 @__bound_new_region(i8* %8, i32 %12)
ret void
}
/* Variables and functions */
int snprintf(char *, int, char *, int);
int /*<<< orphan*/ write(int, char *, int);
int outn(int i) {
  char buffer[16];
  int l = snprintf(buffer, 16, "%ld", i);
  write(1, buffer, l);
}


x86 assembly (clang, -O0):
<outn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x8(%rbp)
lea    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%ecx
mov    $0x10,%esi
lea    0xec2(%rip),%rdx
call   1040 <snprintf@plt>
mov    %eax,-0x24(%rbp)
lea    -0x20(%rbp),%rsi
mov    -0x24(%rbp),%edx
mov    $0x1,%edi
call   1030 <write@plt>
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<outn>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ecx
lea    0xed2(%rip),%rdx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x10,%esi
call   1040 <snprintf@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%ld\00"
define i32 @outn(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca [16 x i8]
%5 = alloca i32
store i32 %0, i32* %3
%6 = getelementptr inbounds [16 x i8], [16 x i8]* %4, i64 0, i64 0
%7 = load i32, i32* %3
%8 = call i32 @snprintf(i8* %6, i32 16, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %7)
store i32 %8, i32* %5
%9 = getelementptr inbounds [16 x i8], [16 x i8]* %4, i64 0, i64 0
%10 = load i32, i32* %5
%11 = call i32 @write(i32 1, i8* %9, i32 %10)
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
@.str = [4 x i8] c"%ld\00"
define i32 @outn(i32 %0) {
%2 = alloca [16 x i8]
%3 = getelementptr inbounds [16 x i8], [16 x i8]* %2, i64 0, i64 0
%4 = call i32 @snprintf(i8* %3, i32 16, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %0)
%5 = call i32 @write(i32 1, i8* %3, i32 %4)
ret i32 undef
}
int get_flash_lamp(struct flash_lamp_s *lamp) { return -1; }


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

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

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

LLVM IR (-O2):
%struct.flash_lamp_s = type opaque
define i32 @get_flash_lamp(%struct.flash_lamp_s* nocapture readnone %0) {
ret i32 -1
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ boo(int const *);
int /*<<< orphan*/ foo(int const *);
int main(int argc, char **argv) {
  const int a = 10;
  int const b = 10;
  foo(&a);
  boo(&b);
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0xa,-0x14(%rbp)
movl   $0xa,-0x18(%rbp)
lea    -0x14(%rbp),%rdi
call   1030 <foo@plt>
lea    -0x18(%rbp),%rdi
call   1040 <boo@plt>
mov    0x2e83(%rip),%rax
mov    (%rax),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0xa,0x4(%rsp)
movl   $0xa,(%rsp)
lea    0x4(%rsp),%rdi
call   1030 <foo@plt>
mov    %rsp,%rdi
call   1040 <boo@plt>
mov    0x2e97(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 10, i32* %6
store i32 10, i32* %7
%8 = call i32 @foo(i32* %6)
%9 = call i32 @boo(i32* %7)
%10 = load i32, i32* @EXIT_SUCCESS
ret i32 %10
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %3 to i8*
store i32 10, i32* %3
%6 = bitcast i32* %4 to i8*
store i32 10, i32* %4
%7 = call i32 @foo(i32* %3)
%8 = call i32 @boo(i32* %4)
%9 = load i32, i32* @EXIT_SUCCESS
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ q();
f(int a) {
  if (a > 2)
    q();
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x2,-0x8(%rbp)
jle    112c <f+0x1c>
mov    $0x0,%al
call   1030 <q@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
cmp    $0x3,%edi
jl     1121 <f+0x11>
push   %rax
xor    %eax,%eax
call   1030 <q@plt>
add    $0x8,%rsp
ret

LLVM IR (-O0):
define i32 @f(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sgt i32 %4, 2
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 (...) @q()
br label %8
8: ; preds = %6, %1
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
define i32 @f(i32 %0) {
%2 = icmp sgt i32 %0, 2
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 (...) @q()
br label %5
5: ; preds = %3, %1
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ halTimerStart(int, int);
void irqTimerStart(void) { halTimerStart(0x49032000, 0xFF); }


x86 assembly (clang, -O0):
<irqTimerStart>:
push   %rbp
mov    %rsp,%rbp
mov    $0x49032000,%edi
mov    $0xff,%esi
call   1030 <halTimerStart@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<irqTimerStart>:
mov    $0x49032000,%edi
mov    $0xff,%esi
jmp    1030 <halTimerStart@plt>

LLVM IR (-O0):
define void @irqTimerStart() {
%1 = call i32 @halTimerStart(i32 1224941568, i32 255)
ret void
}

LLVM IR (-O2):
define void @irqTimerStart() {
%1 = tail call i32 @halTimerStart(i32 1224941568, i32 255)
ret void
}
/* Variables and functions */
void *_c_alloc(size_t, char const *, int);
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, size_t);
void *_c_zalloc(size_t size, const char *name, int line) {
  void *p = NULL;
  p = _c_alloc(size, name, line);
  if (p != NULL) {
    memset(p, 0, size);
  }
  return p;
}


x86 assembly (clang, -O0):
<_c_zalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <_c_alloc@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     1169 <_c_zalloc+0x49>
mov    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%rdx
xor    %esi,%esi
call   1040 <memset@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_c_zalloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1030 <_c_alloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1141 <_c_zalloc+0x21>
mov    %rbx,%rdi
xor    %esi,%esi
mov    %r14,%rdx
call   1040 <memset@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @_c_zalloc(i64 %0, i8* %1, i32 %2) {
%4 = tail call i8* @_c_alloc(i64 %0, i8* %1, i32 %2)
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i32 @memset(i8* %4, i32 0, i64 %0)
br label %8
8: ; preds = %6, %3
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ addVariable(char *);
void appendArgument(char *argName) { addVariable(argName); }


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

x86 assembly (clang, -O2):
<appendArgument>:
jmp    1030 <addVariable@plt>

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

LLVM IR (-O2):
define void @appendArgument(i8* %0) {
%2 = tail call i32 @addVariable(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ vx86_NBSB_Write16(int /*<<< orphan*/, unsigned char,
                                     unsigned short);
void nb_Write16(unsigned char offset, unsigned short val) {
  vx86_NBSB_Write16(0, offset, val);
}


x86 assembly (clang, -O0):
<nb_Write16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %ax,-0x4(%rbp)
mov    -0x1(%rbp),%al
xor    %edi,%edi
movzbl %al,%esi
movzwl -0x4(%rbp),%edx
call   1030 <vx86_NBSB_Write16@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nb_Write16>:
mov    %esi,%edx
mov    %edi,%esi
xor    %edi,%edi
jmp    1030 <vx86_NBSB_Write16@plt>

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

LLVM IR (-O2):
define void @nb_Write16(i8 zeroext %0, i16 zeroext %1) {
%3 = tail call i32 @vx86_NBSB_Write16(i32 0, i8 zeroext %0, i16 zeroext %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ a;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  char a[10] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
  int size;
  size = sizeof(a);
  printf("size is %d\n", size);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0xe(%rbp)
mov    0xed7(%rip),%ax
mov    %ax,-0x6(%rbp)
movl   $0xa,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@__const.main.a = [10 x i8] c"\01\02\03\04\05\06\07\08\09\0A"
@.str = [12 x i8] c"size is %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i8]
%3 = alloca i32
store i32 0, i32* %1
%4 = bitcast [10 x i8]* %2 to i8*
store i32 10, i32* %3
%5 = load i32, i32* %3
%6 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"size is %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 10)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ __print_int(int);
int main() {
  int a;
  a = 5;
  a = ~a;
  __print_int(a);
  a = 5 | 2;
  __print_int(a);
  a = 6 & 5;
  __print_int(a);
  a = 5 ^ 6;
  __print_int(a);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xfffffffa,%edi
call   1030 <__print_int@plt>
mov    $0x7,%edi
call   1030 <__print_int@plt>
mov    $0x4,%edi
call   1030 <__print_int@plt>
mov    $0x3,%edi
call   1030 <__print_int@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @__print_int(i32 -6)
%2 = tail call i32 @__print_int(i32 7)
%3 = tail call i32 @__print_int(i32 4)
%4 = tail call i32 @__print_int(i32 3)
ret i32 0
}
int d_in_range(double x, double min, double max) {
  return !(x < min || x > max);
}


x86 assembly (clang, -O0):
<d_in_range>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
mov    $0x1,%al
ucomisd %xmm1,%xmm0
mov    %al,-0x19(%rbp)
ja     113c <d_in_range+0x3c>
movsd  -0x8(%rbp),%xmm0
ucomisd -0x18(%rbp),%xmm0
seta   %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<d_in_range>:
ucomisd %xmm0,%xmm1
setbe  %al
ucomisd %xmm2,%xmm0
setbe  %cl
and    %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @d_in_range(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %4
%8 = load double, double* %5
%9 = fcmp olt double %7, %8
br i1 %9, label %14, label %10
10: ; preds = %3
%11 = load double, double* %4
%12 = load double, double* %6
%13 = fcmp ogt double %11, %12
br label %14
14: ; preds = %10, %3
%15 = phi i1 [ true, %3 ], [ %13, %10 ]
%16 = xor i1 %15, true
%17 = zext i1 %16 to i32
ret i32 %17
}

LLVM IR (-O2):
define i32 @d_in_range(double %0, double %1, double %2) {
%4 = fcmp uge double %0, %1
%5 = fcmp ule double %0, %2
%6 = and i1 %4, %5
%7 = zext i1 %6 to i32
ret i32 %7
}
void set_page_directory(void *addr) {
  asm volatile("mov %0, %%cr3" : : "r"(addr) :);
}


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

x86 assembly (clang, -O2):
<set_page_directory>:
mov    %rdi,%cr3
ret

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

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

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void animal_builder_ops_build_leg(struct animal_builder *animal_builder) {
  printf("animal_builder::build_leg()\n");
}


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

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

LLVM IR (-O0):
%struct.animal_builder = type { i32 }
@.str = [29 x i8] c"animal_builder::build_leg()\0A\00"
define void @animal_builder_ops_build_leg(%struct.animal_builder* %0) {
%2 = alloca %struct.animal_builder*
store %struct.animal_builder* %0, %struct.animal_builder** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
%struct.animal_builder = type { i32 }
@str = [28 x i8] c"animal_builder::build_leg()\00"
define void @animal_builder_ops_build_leg(%struct.animal_builder* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str, i64 0, i64 0))
ret void
}
const char *Doc_Description(void) {
  return "The `Doc` class can be used to give documentation to a certain class "
         "or "
         "type. This documentation can then be accessed using the `help` "
         "function "
         "or by other tools used to generate documentation such as for the "
         "Cello "
         "website. Documentation can be written in Markdown."
         "\n\n"
         "The `examples` and `methods` entries should be provided as `NULL` "
         "terminated arrays allocated statically.";
}


x86 assembly (clang, -O0):
<Doc_Description>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Doc_Description>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [373 x i8] c"The `Doc` class can be used to give documentation to a certain class or type. This documentation can then be accessed using the `help` function or by other tools used to generate documentation such as for the Cello website. Documentation can be written in Markdown.\0A\0AThe `examples` and `methods` entries should be provided as `NULL` terminated arrays allocated statically.\00"
define i8* @Doc_Description() {
ret i8* getelementptr inbounds ([373 x i8], [373 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [373 x i8] c"The `Doc` class can be used to give documentation to a certain class or type. This documentation can then be accessed using the `help` function or by other tools used to generate documentation such as for the Cello website. Documentation can be written in Markdown.\0A\0AThe `examples` and `methods` entries should be provided as `NULL` terminated arrays allocated statically.\00"
define i8* @Doc_Description() {
ret i8* getelementptr inbounds ([373 x i8], [373 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ dpop();
int /*<<< orphan*/ sleep_micros(int /*<<< orphan*/);
int /*<<< orphan*/ to_cell(int /*<<< orphan*/);
void primitive_sleep(void) { sleep_micros(to_cell(dpop())); }


x86 assembly (clang, -O0):
<primitive_sleep>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <dpop@plt>
mov    %eax,%edi
call   1050 <to_cell@plt>
mov    %eax,%edi
call   1040 <sleep_micros@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<primitive_sleep>:
push   %rax
xor    %eax,%eax
call   1030 <dpop@plt>
mov    %eax,%edi
call   1050 <to_cell@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <sleep_micros@plt>

LLVM IR (-O0):
define void @primitive_sleep() {
%1 = call i32 (...) @dpop()
%2 = call i32 @to_cell(i32 %1)
%3 = call i32 @sleep_micros(i32 %2)
ret void
}

LLVM IR (-O2):
define void @primitive_sleep() {
%1 = tail call i32 (...) @dpop()
%2 = tail call i32 @to_cell(i32 %1)
%3 = tail call i32 @sleep_micros(i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
void recursion(int i) {
  int j;
  if (i < 4) {
    for (j = 0; j <= i; j++) {
      printf("i,j: %d, %d\n", i, j);
      recursion(i + 1);
    }
  }
}


x86 assembly (clang, -O0):
<recursion>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x4,-0x4(%rbp)
jge    1178 <recursion+0x58>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jg     1173 <recursion+0x53>
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xeab(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%edi
add    $0x1,%edi
call   1040 <recursion@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    113c <recursion+0x1c>
jmp    1178 <recursion+0x58>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<recursion>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
cmp    $0x3,%edi
ja     115b <recursion+0x3b>
mov    %edi,%r14d
lea    0x1(%r14),%ebp
xor    %ebx,%ebx
lea    0xec4(%rip),%r15
nopl   0x0(%rax)
mov    %r15,%rdi
mov    %r14d,%esi
mov    %ebx,%edx
call   1030 <printf@plt>
mov    %ebp,%edi
call   1040 <recursion@plt>
add    $0x1,%ebx
cmp    %ebx,%ebp
jne    1140 <recursion+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [13 x i8] c"i,j: %d, %d\0A\00"
define void @recursion(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 4
br i1 %5, label %6, label %21
6: ; preds = %1
store i32 0, i32* %3
br label %7
7: ; preds = %17, %6
%8 = load i32, i32* %3
%9 = load i32, i32* %2
%10 = icmp sle i32 %8, %9
br i1 %10, label %11, label %20
11: ; preds = %7
%12 = load i32, i32* %2
%13 = load i32, i32* %3
%14 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %12, i32 %13)
%15 = load i32, i32* %2
%16 = add nsw i32 %15, 1
br label %17
17: ; preds = %11
%18 = load i32, i32* %3
%19 = add nsw i32 %18, 1
store i32 %19, i32* %3
br label %7
20: ; preds = %7
br label %21
21: ; preds = %20, %1
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"i,j: %d, %d\0A\00"
define void @recursion(i32 %0) {
%2 = icmp ugt i32 %0, 3
br i1 %2, label %10, label %3
3: ; preds = %1
%4 = add nuw nsw i32 %0, 1
br label %5
5: ; preds = %3, %5
%6 = phi i32 [ 0, %3 ], [ %8, %5 ]
%7 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %6)
tail call void @recursion(i32 %4)
%8 = add nuw i32 %6, 1
%9 = icmp eq i32 %6, %0
br i1 %9, label %10, label %5
10: ; preds = %5, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
long strtol(char const *, char **, int);
long read_number(const char *src) {
  long n;
  char *end;
  n = strtol(src, &end, 10);
  if (src == end) {
    fprintf(stderr, "%s is not a valid number\n", src);
    exit(1);
  }
  return n;
}


x86 assembly (clang, -O0):
<read_number>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x18(%rbp),%rsi
mov    $0xa,%edx
call   1040 <strtol@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x18(%rbp),%rax
jne    1183 <read_number+0x53>
mov    0x2e79(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xe8c(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_number>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
lea    0x8(%rsp),%rsi
mov    $0xa,%edx
call   1040 <strtol@plt>
cmp    %rbx,0x8(%rsp)
je     1154 <read_number+0x24>
add    $0x10,%rsp
pop    %rbx
ret
mov    0x2e85(%rip),%rax
mov    (%rax),%edi
lea    0xe9c(%rip),%rsi
mov    %rbx,%rdx
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [26 x i8] c"%s is not a valid number\0A\00"
define i64 @read_number(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i64 @strtol(i8* %5, i8** %4, i32 10)
store i64 %6, i64* %3
%7 = load i8*, i8** %2
%8 = load i8*, i8** %4
%9 = icmp eq i8* %7, %8
br i1 %9, label %10, label %15
10: ; preds = %1
%11 = load i32, i32* @stderr
%12 = load i8*, i8** %2
%13 = call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %12)
%14 = call i32 @exit(i32 1)
unreachable
15: ; preds = %1
%16 = load i64, i64* %3
ret i64 %16
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [26 x i8] c"%s is not a valid number\0A\00"
define i64 @read_number(i8* %0) {
%2 = alloca i8*
%3 = bitcast i8** %2 to i8*
%4 = call i64 @strtol(i8* %0, i8** %2, i32 10)
%5 = load i8*, i8** %2
%6 = icmp eq i8* %5, %0
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = load i32, i32* @stderr
%9 = tail call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %0)
%10 = tail call i32 @exit(i32 1)
unreachable
11: ; preds = %1
ret i64 %4
}
double bayes(double probBA, double probA, double probBnotA) {
  double probNotA, probB, probAB;
  probNotA = 1.0 - probA;
  probB = (probBA * probA) + (probBnotA * probNotA);
  probAB = (probBA * probA) / probB;
  return probAB;
}


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

x86 assembly (clang, -O2):
<bayes>:
movsd  0xef8(%rip),%xmm3
subsd  %xmm1,%xmm3
mulsd  %xmm2,%xmm3
mulsd  %xmm1,%xmm0
addsd  %xmm0,%xmm3
divsd  %xmm3,%xmm0
ret

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

LLVM IR (-O2):
define double @bayes(double %0, double %1, double %2) {
%4 = fsub double 1.000000e+00, %1
%5 = fmul double %4, %2
%6 = tail call double @llvm.fmuladd.f64(double %0, double %1, double %5)
%7 = fmul double %0, %1
%8 = fdiv double %7, %6
ret double %8
}
int soru_8(int *ilk_eleman, int *son_eleman) { return -1; }


x86 assembly (clang, -O0):
<soru_8>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @soru_8(i32* nocapture readnone %0, i32* nocapture readnone %1) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void caml_gr_current_x() { exit(1); }


x86 assembly (clang, -O0):
<caml_gr_current_x>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<caml_gr_current_x>:
push   %rax
mov    $0x1,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @caml_gr_current_x() {
%1 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @caml_gr_current_x() {
%1 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
void *malloc(int);
void ez_def_mutex_create(void **_mutex) {
  *_mutex = malloc(sizeof(int));
  *(int *)*_mutex = 0;
}


x86 assembly (clang, -O0):
<ez_def_mutex_create>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x4,%edi
call   1030 <malloc@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movl   $0x0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ez_def_mutex_create>:
push   %rbx
mov    %rdi,%rbx
mov    $0x4,%edi
call   1030 <malloc@plt>
mov    %rax,(%rbx)
movl   $0x0,(%rax)
pop    %rbx
ret

LLVM IR (-O0):
define void @ez_def_mutex_create(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = call i8* @malloc(i32 4)
%4 = load i8**, i8*** %2
store i8* %3, i8** %4
%5 = load i8**, i8*** %2
%6 = load i8*, i8** %5
%7 = bitcast i8* %6 to i32*
store i32 0, i32* %7
ret void
}

LLVM IR (-O2):
define void @ez_def_mutex_create(i8** nocapture writeonly %0) {
%2 = tail call dereferenceable_or_null(4) i8* @malloc(i32 4)
store i8* %2, i8** %0
%3 = bitcast i8* %2 to i32*
store i32 0, i32* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SystemCoreClockUpdate();
void mbed_sdk_init() { SystemCoreClockUpdate(); }


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

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

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

LLVM IR (-O2):
define void @mbed_sdk_init() {
%1 = tail call i32 (...) @SystemCoreClockUpdate()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage() { (void)fprintf(stderr, "usage: printf format [arg ...]\n"); }


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [32 x i8] c"usage: printf format [arg ...]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [32 x i8] c"usage: printf format [arg ...]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ recv(int, void *, size_t, int);
ssize_t safe_recv(int socket, void *buffer, size_t length, int flags) {
  ssize_t len;
  len = recv(socket, buffer, length, flags);
  return len;
}


x86 assembly (clang, -O0):
<safe_recv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
call   1030 <recv@plt>
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<safe_recv>:
jmp    1030 <recv@plt>

LLVM IR (-O0):
define i32 @safe_recv(i32 %0, i8* %1, i64 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i32
%9 = alloca i32
store i32 %0, i32* %5
store i8* %1, i8** %6
store i64 %2, i64* %7
store i32 %3, i32* %8
%10 = load i32, i32* %5
%11 = load i8*, i8** %6
%12 = load i64, i64* %7
%13 = load i32, i32* %8
%14 = call i32 @recv(i32 %10, i8* %11, i64 %12, i32 %13)
store i32 %14, i32* %9
%15 = load i32, i32* %9
ret i32 %15
}

LLVM IR (-O2):
define i32 @safe_recv(i32 %0, i8* %1, i64 %2, i32 %3) {
%5 = tail call i32 @recv(i32 %0, i8* %1, i64 %2, i32 %3)
ret i32 %5
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t md5_H(uint32_t x, uint32_t y, uint32_t z) { return x ^ y ^ z; }


x86 assembly (clang, -O0):
<md5_H>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
xor    -0x8(%rbp),%eax
xor    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<md5_H>:
mov    %edi,%eax
xor    %esi,%eax
xor    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @md5_H(i32 %0, i32 %1, i32 %2) {
%4 = xor i32 %1, %0
%5 = xor i32 %4, %2
ret i32 %5
}
/* Variables and functions */
size_t s_size_t_sub(size_t a, size_t b) { return a > b ? a - b : 0; }


x86 assembly (clang, -O0):
<s_size_t_sub>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jbe    112b <s_size_t_sub+0x2b>
mov    -0x8(%rbp),%rax
sub    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    1136 <s_size_t_sub+0x36>
xor    %eax,%eax
mov    %rax,-0x18(%rbp)
jmp    1136 <s_size_t_sub+0x36>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<s_size_t_sub>:
xor    %eax,%eax
sub    %rsi,%rdi
cmovae %rdi,%rax
ret

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

LLVM IR (-O2):
define i64 @s_size_t_sub(i64 %0, i64 %1) {
%3 = tail call i64 @llvm.usub.sat.i64(i64 %0, i64 %1)
ret i64 %3
}
int test_imm_D6uint16_reg(unsigned short val) {
  return ((val) & (0xD6 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_D6uint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edx
and    $0xd6,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_D6uint16_reg>:
test   $0xd6,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_D6uint16_reg(i16 zeroext %0) {
%2 = and i16 %0, 214
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  scalar_t__ display;
};
struct TYPE_4__ {
  TYPE_1__ xselectionrequest;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
void *get_XEvent_xselectionrequest_display(void *_p) {
  return (void *)((XEvent *)_p)->xselectionrequest.display;
}


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

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

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i64 }
define i8* @get_XEvent_xselectionrequest_display(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_4__*
%5 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %4, i32 0, i32 0
%6 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %5, i32 0, i32 0
%7 = load i64, i64* %6
%8 = inttoptr i64 %7 to i8*
ret i8* %8
}

LLVM IR (-O2):
define i8* @get_XEvent_xselectionrequest_display(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = inttoptr i64 %3 to i8*
ret i8* %4
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
char *ctime(int /*<<< orphan*/ *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
void print_date_message(FILE *logfile) {
  time_t now;
  time(&now);
  fprintf(logfile, "%s", ctime(&now));
}


x86 assembly (clang, -O0):
<print_date_message>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0xc(%rbp),%rdi
call   1050 <time@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
lea    -0xc(%rbp),%rdi
call   1030 <ctime@plt>
mov    -0x18(%rbp),%rdi
mov    %rax,%rdx
lea    0xe9c(%rip),%rsi
call   1040 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_date_message>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0x4(%rsp),%r14
mov    %r14,%rdi
call   1050 <time@plt>
mov    %r14,%rdi
call   1030 <ctime@plt>
mov    %rax,%rdi
mov    %rbx,%rsi
call   1040 <fputs@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define void @print_date_message(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = call i32 @time(i32* %3)
%5 = load i32*, i32** %2
%6 = call i8* @ctime(i32* %3)
%7 = call i32 @fprintf(i32* %5, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %6)
ret void
}

LLVM IR (-O2):
define void @print_date_message(i32* nocapture %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @time(i32* %2)
%5 = call i8* @ctime(i32* %2)
%6 = call i32 @fputs(i8* %5, i32* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int main() {
  int a = 0;
  do {
    a++;
  } while (a < 2);
  assert(a == 2);
  int b = 0;
  do {
    b++;
  } while (0);
  assert(b == 1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x2,-0x8(%rbp)
jl     1126 <main+0x16>
cmpl   $0x2,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1030 <assert@plt>
mov    $0x1,%edi
call   1030 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @assert(i32 1)
%2 = tail call i32 @assert(i32 1)
ret i32 0
}