xunge/DecIR huggingface dataset:
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  unsigned long time;
};
typedef TYPE_1__ XButtonReleasedEvent;

/* Variables and functions */
void set_XButtonReleasedEvent_time(void *_p, unsigned long _v) {
  ((XButtonReleasedEvent *)_p)->time = (unsigned long)_v;
}


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

x86 assembly (clang, -O2):
<set_XButtonReleasedEvent_time>:
mov    %rsi,(%rdi)
ret

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

LLVM IR (-O2):
define void @set_XButtonReleasedEvent_time(i8* nocapture writeonly %0, i64 %1) {
%3 = bitcast i8* %0 to i64*
store i64 %1, i64* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ thr_print(char const *);
void thr_cleanup(void *arg) { thr_print((const char *)arg); }


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

x86 assembly (clang, -O2):
<thr_cleanup>:
jmp    1030 <thr_print@plt>

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

LLVM IR (-O2):
define void @thr_cleanup(i8* %0) {
%2 = tail call i32 @thr_print(i8* %0)
ret void
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int main(void) {
  int32_t u;
  int32_t i;
  u = (unsigned)0x7FFFFFFF;
  i = (int32_t)u;
  printf("signed:  0x%08X  %i\n", i, i);
  printf("unsigned 0x%08X  %u\n", u, u);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x7fffffff,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xec7(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [21 x i8] c"signed: 0x%08X %i\0A\00"
@.str.1 = [21 x i8] c"unsigned 0x%08X %u\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 2147483647, i32* %2
%4 = load i32, i32* %2
store i32 %4, i32* %3
%5 = load i32, i32* %3
%6 = load i32, i32* %3
%7 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6)
%8 = load i32, i32* %2
%9 = load i32, i32* %2
%10 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i32 %8, i32 %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [21 x i8] c"signed: 0x%08X %i\0A\00"
@.str.1 = [21 x i8] c"unsigned 0x%08X %u\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 2147483647, i32 2147483647)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i32 2147483647, i32 2147483647)
ret i32 0
}
void gdk_x11_window_set_user_time() {}


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

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

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

LLVM IR (-O2):
define void @gdk_x11_window_set_user_time() {
ret void
}
/* Type definitions */
struct t_gui_buffer {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ hook_signal_send(char *, char *, struct t_gui_buffer *);
void gui_hotlist_changed_signal(struct t_gui_buffer *buffer) {
  (void)hook_signal_send("hotlist_changed", "pointer", buffer);
}


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

x86 assembly (clang, -O2):
<gui_hotlist_changed_signal>:
mov    %rdi,%rdx
lea    0xee6(%rip),%rdi
lea    0xeef(%rip),%rsi
jmp    1030 <hook_signal_send@plt>

LLVM IR (-O0):
%struct.t_gui_buffer = type { i32 }
@.str = [16 x i8] c"hotlist_changed\00"
@.str.1 = [8 x i8] c"pointer\00"
define void @gui_hotlist_changed_signal(%struct.t_gui_buffer* %0) {
%2 = alloca %struct.t_gui_buffer*
store %struct.t_gui_buffer* %0, %struct.t_gui_buffer** %2
%3 = load %struct.t_gui_buffer*, %struct.t_gui_buffer** %2
%4 = call i32 @hook_signal_send(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), %struct.t_gui_buffer* %3)
ret void
}

LLVM IR (-O2):
%struct.t_gui_buffer = type { i32 }
@.str = [16 x i8] c"hotlist_changed\00"
@.str.1 = [8 x i8] c"pointer\00"
define void @gui_hotlist_changed_signal(%struct.t_gui_buffer* %0) {
%2 = tail call i32 @hook_signal_send(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), %struct.t_gui_buffer* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int bint1();
int lib1p1();
int lib1t2();
int /*<<< orphan*/ lib1test();
int /*<<< orphan*/ lib2test();
int main(void) {
  lib1test();
  lib2test();
  if (bint1() != 1)
    abort();
  if (lib1t2() != 1)
    abort();
  if (lib1p1() != 1 + 10)
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <lib1test@plt>
mov    $0x0,%al
call   1080 <lib2test@plt>
mov    $0x0,%al
call   1040 <bint1@plt>
cmp    $0x1,%eax
je     1194 <main+0x34>
mov    $0x0,%al
call   1030 <abort@plt>
mov    $0x0,%al
call   1070 <lib1t2@plt>
cmp    $0x1,%eax
je     11ab <main+0x4b>
mov    $0x0,%al
call   1030 <abort@plt>
mov    $0x0,%al
call   1060 <lib1p1@plt>
cmp    $0xb,%eax
je     11c2 <main+0x62>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <lib1test@plt>
xor    %eax,%eax
call   1080 <lib2test@plt>
xor    %eax,%eax
call   1040 <bint1@plt>
cmp    $0x1,%eax
jne    1197 <main+0x37>
xor    %eax,%eax
call   1070 <lib1t2@plt>
cmp    $0x1,%eax
jne    1197 <main+0x37>
xor    %eax,%eax
call   1060 <lib1p1@plt>
cmp    $0xb,%eax
jne    1197 <main+0x37>
xor    %eax,%eax
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @lib1test()
%3 = call i32 (...) @lib2test()
%4 = call i32 (...) @bint1()
%5 = icmp ne i32 %4, 1
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 (...) @abort()
unreachable
8: ; preds = %0
%9 = call i32 (...) @lib1t2()
%10 = icmp ne i32 %9, 1
br i1 %10, label %11, label %13
11: ; preds = %8
%12 = call i32 (...) @abort()
unreachable
13: ; preds = %8
%14 = call i32 (...) @lib1p1()
%15 = icmp ne i32 %14, 11
br i1 %15, label %16, label %18
16: ; preds = %13
%17 = call i32 (...) @abort()
unreachable
18: ; preds = %13
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @lib1test()
%2 = tail call i32 (...) @lib2test()
%3 = tail call i32 (...) @bint1()
%4 = icmp eq i32 %3, 1
br i1 %4, label %7, label %5
5: ; preds = %0
%6 = tail call i32 (...) @abort()
unreachable
7: ; preds = %0
%8 = tail call i32 (...) @lib1t2()
%9 = icmp eq i32 %8, 1
br i1 %9, label %12, label %10
10: ; preds = %7
%11 = tail call i32 (...) @abort()
unreachable
12: ; preds = %7
%13 = tail call i32 (...) @lib1p1()
%14 = icmp eq i32 %13, 11
br i1 %14, label %17, label %15
15: ; preds = %12
%16 = tail call i32 (...) @abort()
unreachable
17: ; preds = %12
ret i32 0
}
t(int a, int b) { return (a <= b ? 5 : -5); }


x86 assembly (clang, -O0):
<t>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%esi
mov    $0xfffffffb,%eax
mov    $0x5,%ecx
cmp    %esi,%edx
cmovle %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<t>:
cmp    %esi,%edi
mov    $0xfffffffb,%ecx
mov    $0x5,%eax
cmovg  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @t(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 = icmp sle i32 %5, %6
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 5, i32 -5
ret i32 %9
}

LLVM IR (-O2):
define i32 @t(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 -5, i32 5
ret i32 %4
}
void __attribute__((weak)) exti9_5_isr() { debug_handler(__FUNCTION__); }


x86 assembly (clang, -O0):
<exti9_5_isr>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x0,%al
call   1030 <debug_handler@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<exti9_5_isr>:
lea    0xee9(%rip),%rdi
xor    %eax,%eax
jmp    1030 <debug_handler@plt>

LLVM IR (-O0):
@__FUNCTION__.exti9_5_isr = [12 x i8] c"exti9_5_isr\00"
define weak void @exti9_5_isr() {
%1 = call i32 (i8*, ...) bitcast (i32 (...)* @debug_handler to i32 (i8*, ...)*)(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @__FUNCTION__.exti9_5_isr, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__FUNCTION__.exti9_5_isr = [12 x i8] c"exti9_5_isr\00"
define weak void @exti9_5_isr() {
%1 = tail call i32 (i8*, ...) bitcast (i32 (...)* @debug_handler to i32 (i8*, ...)*)(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @__FUNCTION__.exti9_5_isr, i64 0, i64 0))
ret void
}
void ff_hevc_put_hevc_uni_w_qpel_hv8_10_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_uni_w_qpel_hv8_10_sse4() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fn3(int, int);
int main() {
  fn3(6, 25);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x6,%edi
mov    $0x19,%esi
call   1030 <fn3@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @fn3(i32 6, i32 25)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @fn3(i32 6, i32 25)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ encrypt(char *);
int main() {
  char *msg = "CONVERT THIS MORSE CODE";
  encrypt(msg);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <encrypt@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [24 x i8] c"CONVERT THIS MORSE CODE\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
store i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @encrypt(i8* %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [24 x i8] c"CONVERT THIS MORSE CODE\00"
define i32 @main() {
%1 = tail call i32 @encrypt(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
struct ambapp_dev_hdr {
  int dummy;
};
struct ambapp_ahb_info {
  int dummy;
};

/* Variables and functions */
int ambapp_find_ahbslvs_next(struct ambapp_dev_hdr *, int, int,
                             struct ambapp_ahb_info *, int, int);
int ambapp_find_ahbslv_next(struct ambapp_dev_hdr *root, int vendor, int device,
                            struct ambapp_ahb_info *dev, int index) {
  return ambapp_find_ahbslvs_next(root, vendor, device, dev, index, 1);
}


x86 assembly (clang, -O0):
<ambapp_find_ahbslv_next>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x18(%rbp),%rcx
mov    -0x1c(%rbp),%r8d
mov    $0x1,%r9d
call   1030 <ambapp_find_ahbslvs_next@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ambapp_find_ahbslv_next>:
mov    $0x1,%r9d
jmp    1030 <ambapp_find_ahbslvs_next@plt>

LLVM IR (-O0):
%struct.ambapp_dev_hdr = type { i32 }
%struct.ambapp_ahb_info = type { i32 }
define i32 @ambapp_find_ahbslv_next(%struct.ambapp_dev_hdr* %0, i32 %1, i32 %2, %struct.ambapp_ahb_info* %3, i32 %4) {
%6 = alloca %struct.ambapp_dev_hdr*
%7 = alloca i32
%8 = alloca i32
%9 = alloca %struct.ambapp_ahb_info*
%10 = alloca i32
store %struct.ambapp_dev_hdr* %0, %struct.ambapp_dev_hdr** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store %struct.ambapp_ahb_info* %3, %struct.ambapp_ahb_info** %9
store i32 %4, i32* %10
%11 = load %struct.ambapp_dev_hdr*, %struct.ambapp_dev_hdr** %6
%12 = load i32, i32* %7
%13 = load i32, i32* %8
%14 = load %struct.ambapp_ahb_info*, %struct.ambapp_ahb_info** %9
%15 = load i32, i32* %10
%16 = call i32 @ambapp_find_ahbslvs_next(%struct.ambapp_dev_hdr* %11, i32 %12, i32 %13, %struct.ambapp_ahb_info* %14, i32 %15, i32 1)
ret i32 %16
}

LLVM IR (-O2):
%struct.ambapp_dev_hdr = type { i32 }
%struct.ambapp_ahb_info = type { i32 }
define i32 @ambapp_find_ahbslv_next(%struct.ambapp_dev_hdr* %0, i32 %1, i32 %2, %struct.ambapp_ahb_info* %3, i32 %4) {
%6 = tail call i32 @ambapp_find_ahbslvs_next(%struct.ambapp_dev_hdr* %0, i32 %1, i32 %2, %struct.ambapp_ahb_info* %3, i32 %4, i32 1)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void fooA(int *iptr) {
  printf("iptr value: %d\n", *iptr);
  printf("iptr value address: %p\n", iptr);
  printf("iptr address: %p\n", &iptr);
}


x86 assembly (clang, -O0):
<fooA>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%esi
lea    0xed7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xed5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xedf(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fooA>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
mov    %rdi,0x8(%rsp)
mov    (%rdi),%esi
lea    0xeda(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xedc(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xee3(%rip),%rdi
lea    0x8(%rsp),%rsi
xor    %eax,%eax
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"iptr value: %d\0A\00"
@.str.1 = [24 x i8] c"iptr value address: %p\0A\00"
@.str.2 = [18 x i8] c"iptr address: %p\0A\00"
define void @fooA(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = load i32*, i32** %2
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i32* %6)
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i32** %2)
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"iptr value: %d\0A\00"
@.str.1 = [24 x i8] c"iptr value address: %p\0A\00"
@.str.2 = [18 x i8] c"iptr address: %p\0A\00"
define void @fooA(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32, i32* %0
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i32* %0)
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i32** %2)
ret void
}
/* Variables and functions */
double M_PI;
double cos(double);
double cosd(double theta) { return cos(theta * M_PI / 180.0); }


x86 assembly (clang, -O0):
<cosd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    0x2ebf(%rip),%rax
mulsd  (%rax),%xmm0
movsd  0xecb(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1030 <cos@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cosd>:
mov    0x2ed1(%rip),%rax
mulsd  (%rax),%xmm0
divsd  0xedd(%rip),%xmm0
jmp    1030 <cos@plt>

LLVM IR (-O0):
@M_PI = global double 0.000000e+00
define double @cosd(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* @M_PI
%5 = fmul double %3, %4
%6 = fdiv double %5, 1.800000e+02
%7 = call double @cos(double %6)
ret double %7
}

LLVM IR (-O2):
@M_PI = global double 0.000000e+00
define double @cosd(double %0) {
%2 = load double, double* @M_PI
%3 = fmul double %2, %0
%4 = fdiv double %3, 1.800000e+02
%5 = tail call double @cos(double %4)
ret double %5
}
/* Type definitions */
struct timeval {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ _exit(int);
int utimes(const char *filename, const struct timeval times[2]) {
  _exit(-1);
  return -1;
}


x86 assembly (clang, -O0):
<utimes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0xffffffff,%edi
call   1030 <_exit@plt>

x86 assembly (clang, -O2):
<utimes>:
push   %rax
mov    $0xffffffff,%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
%struct.timeval = type { i32 }
define i32 @utimes(i8* %0, %struct.timeval* %1) {
%3 = alloca i8*
%4 = alloca %struct.timeval*
store i8* %0, i8** %3
store %struct.timeval* %1, %struct.timeval** %4
%5 = call i32 @_exit(i32 -1)
unreachable
}

LLVM IR (-O2):
%struct.timeval = type { i32 }
define i32 @utimes(i8* nocapture readnone %0, %struct.timeval* nocapture readnone %1) {
%3 = tail call i32 @_exit(i32 -1)
unreachable
}
OP(dd, ab) {
  illegal_1();
  op_ab();
}


x86 assembly (clang, -O0):
<OP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x0,%al
call   1030 <illegal_1@plt>
mov    $0x0,%al
call   1040 <op_ab@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OP>:
push   %rax
xor    %eax,%eax
call   1030 <illegal_1@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <op_ab@plt>

LLVM IR (-O0):
define i32 @OP(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = call i32 (...) @illegal_1()
%7 = call i32 (...) @op_ab()
%8 = load i32, i32* %3
ret i32 %8
}

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @illegal_1()
%4 = tail call i32 (...) @op_ab()
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ croak();
int /*<<< orphan*/ die();
void terminate(int frog) {
  if (frog)
    croak();
  else
    die();
}


x86 assembly (clang, -O0):
<terminate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1141 <terminate+0x21>
mov    $0x0,%al
call   1030 <croak@plt>
jmp    1148 <terminate+0x28>
mov    $0x0,%al
call   1040 <die@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<terminate>:
xor    %eax,%eax
test   %edi,%edi
je     112b <terminate+0xb>
jmp    1030 <croak@plt>
jmp    1040 <die@plt>

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

LLVM IR (-O2):
define void @terminate(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 (...) @croak()
br label %7
5: ; preds = %1
%6 = tail call i32 (...) @die()
br label %7
7: ; preds = %5, %3
ret void
}
void machine_term() {}


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

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

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

LLVM IR (-O2):
define void @machine_term() {
ret void
}
int ft_len(int n) {
  if (n < 0) {
    n = -n;
    return (1 + ft_len(n));
  }
  if (n < 10)
    return (1);
  n = n / 10;
  return (1 + ft_len(n));
}


x86 assembly (clang, -O0):
<ft_len>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    1140 <ft_len+0x30>
xor    %eax,%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <ft_len@plt>
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1172 <ft_len+0x62>
cmpl   $0xa,-0x8(%rbp)
jge    1156 <ft_len+0x46>
movl   $0x1,-0x4(%rbp)
jmp    1172 <ft_len+0x62>
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <ft_len@plt>
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_len>:
push   %rbx
xor    %ebx,%ebx
test   %edi,%edi
js     111b <ft_len+0xb>
mov    %edi,%eax
jmp    112b <ft_len+0x1b>
xor    %ebx,%ebx
mov    %edi,%eax
nop
neg    %eax
add    $0x1,%ebx
test   %edi,%edi
mov    %eax,%edi
jg     1120 <ft_len+0x10>
cmp    $0xa,%eax
jae    1135 <ft_len+0x25>
add    $0x1,%ebx
jmp    114e <ft_len+0x3e>
mov    %eax,%eax
mov    $0xcccccccd,%edi
imul   %rax,%rdi
shr    $0x23,%rdi
call   1030 <ft_len@plt>
add    %eax,%ebx
add    $0x1,%ebx
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @ft_len(i32 %0) {
%2 = icmp slt i32 %0, 0
br i1 %2, label %3, label %9
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ %0, %1 ]
%5 = phi i32 [ %7, %3 ], [ 0, %1 ]
%6 = sub nsw i32 0, %4
%7 = add nuw nsw i32 %5, 1
%8 = icmp sgt i32 %4, 0
br i1 %8, label %3, label %9
9: ; preds = %3, %1
%10 = phi i32 [ 0, %1 ], [ %7, %3 ]
%11 = phi i32 [ %0, %1 ], [ %6, %3 ]
%12 = icmp ult i32 %11, 10
br i1 %12, label %20, label %15
13: ; preds = %20, %15
%14 = phi i32 [ %19, %15 ], [ %21, %20 ]
ret i32 %14
15: ; preds = %9
%16 = udiv i32 %11, 10
%17 = tail call i32 @ft_len(i32 %16)
%18 = add i32 %10, 1
%19 = add i32 %18, %17
br label %13
20: ; preds = %9
%21 = add nsw i32 %10, 1
br label %13
}
/* Type definitions */
struct dirent {
  int /*<<< orphan*/ d_name;
};

/* Variables and functions */
int strcoll(int /*<<< orphan*/, int /*<<< orphan*/);
int reverse_alpha(const struct dirent **a, const struct dirent **b) {
  return strcoll((*b)->d_name, (*a)->d_name);
}


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

x86 assembly (clang, -O2):
<reverse_alpha>:
mov    (%rsi),%rax
mov    (%rax),%eax
mov    (%rdi),%rcx
mov    (%rcx),%esi
mov    %eax,%edi
jmp    1030 <strcoll@plt>

LLVM IR (-O0):
%struct.dirent = type { i32 }
define i32 @reverse_alpha(%struct.dirent** %0, %struct.dirent** %1) {
%3 = alloca %struct.dirent**
%4 = alloca %struct.dirent**
store %struct.dirent** %0, %struct.dirent*** %3
store %struct.dirent** %1, %struct.dirent*** %4
%5 = load %struct.dirent**, %struct.dirent*** %4
%6 = load %struct.dirent*, %struct.dirent** %5
%7 = getelementptr inbounds %struct.dirent, %struct.dirent* %6, i32 0, i32 0
%8 = load i32, i32* %7
%9 = load %struct.dirent**, %struct.dirent*** %3
%10 = load %struct.dirent*, %struct.dirent** %9
%11 = getelementptr inbounds %struct.dirent, %struct.dirent* %10, i32 0, i32 0
%12 = load i32, i32* %11
%13 = call i32 @strcoll(i32 %8, i32 %12)
ret i32 %13
}

LLVM IR (-O2):
%struct.dirent = type { i32 }
define i32 @reverse_alpha(%struct.dirent** nocapture %0, %struct.dirent** nocapture %1) {
%3 = load %struct.dirent*, %struct.dirent** %1
%4 = getelementptr inbounds %struct.dirent, %struct.dirent* %3, i64 0, i32 0
%5 = load i32, i32* %4
%6 = load %struct.dirent*, %struct.dirent** %0
%7 = getelementptr inbounds %struct.dirent, %struct.dirent* %6, i64 0, i32 0
%8 = load i32, i32* %7
%9 = tail call i32 @strcoll(i32 %5, i32 %8)
ret i32 %9
}
int main() { return -1 > (unsigned long)-2; }


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 1
}
void lfclk_deinit(void) {}


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

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

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

LLVM IR (-O2):
define void @lfclk_deinit() {
ret void
}
/* Variables and functions */
char *malloc(size_t);
int /*<<< orphan*/ memcpy(char *, char const *, size_t);
size_t strlen(char const *);
char *my_strdup(const char *s) {
  size_t l;
  char *d;
  l = strlen(s);
  d = malloc(l + 1);
  if (d == NULL)
    return NULL;
  memcpy(d, s, l + 1);
  return d;
}


x86 assembly (clang, -O0):
<my_strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1172 <my_strdup+0x42>
movq   $0x0,-0x8(%rbp)
jmp    118f <my_strdup+0x5f>
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
add    $0x1,%rdx
call   1040 <memcpy@plt>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_strdup>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
call   1030 <strlen@plt>
mov    %rax,%rbx
add    $0x1,%rbx
mov    %rbx,%rdi
call   1050 <malloc@plt>
mov    %rax,%r15
test   %rax,%rax
je     1162 <my_strdup+0x32>
mov    %r15,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1040 <memcpy@plt>
mov    %r15,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8* @my_strdup(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add i64 %2, 1
%4 = tail call i8* @malloc(i64 %3)
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = tail call i32 @memcpy(i8* %4, i8* %0, i64 %3)
br label %8
8: ; preds = %1, %6
ret i8* %4
}
/* Type definitions */
struct katcp_dispatch {
  int dummy;
};

/* Variables and functions */
int log_level_generic_katcp(struct katcp_dispatch *, int, int /*<<< orphan*/);
int log_level_cmd_katcp(struct katcp_dispatch *d, int argc) {
  return log_level_generic_katcp(d, argc, 0);
}


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

x86 assembly (clang, -O2):
<log_level_cmd_katcp>:
xor    %edx,%edx
jmp    1030 <log_level_generic_katcp@plt>

LLVM IR (-O0):
%struct.katcp_dispatch = type { i32 }
define i32 @log_level_cmd_katcp(%struct.katcp_dispatch* %0, i32 %1) {
%3 = alloca %struct.katcp_dispatch*
%4 = alloca i32
store %struct.katcp_dispatch* %0, %struct.katcp_dispatch** %3
store i32 %1, i32* %4
%5 = load %struct.katcp_dispatch*, %struct.katcp_dispatch** %3
%6 = load i32, i32* %4
%7 = call i32 @log_level_generic_katcp(%struct.katcp_dispatch* %5, i32 %6, i32 0)
ret i32 %7
}

LLVM IR (-O2):
%struct.katcp_dispatch = type { i32 }
define i32 @log_level_cmd_katcp(%struct.katcp_dispatch* %0, i32 %1) {
%3 = tail call i32 @log_level_generic_katcp(%struct.katcp_dispatch* %0, i32 %1, i32 0)
ret i32 %3
}
int test_imm_BBuint16_reg(unsigned short val) {
  return ((val) & (0xBB << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_BBuint16_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, 187
%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_BBuint16_reg(i16 zeroext %0) {
%2 = and i16 %0, 187
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void panic(const char *msg) {
  fprintf(stderr, "%s\n", msg);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<panic>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e8c(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<panic>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e98(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
@EXIT_FAILURE = global i32 0
define void @panic(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @EXIT_FAILURE
%5 = tail call i32 @exit(i32 %4)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void playerInBedroomGotNote() { puts("\nYou pick up the note."); }


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

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

LLVM IR (-O0):
@.str = [23 x i8] c"\0AYou pick up the note.\00"
define void @playerInBedroomGotNote() {
%1 = call i32 @puts(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"\0AYou pick up the note.\00"
define void @playerInBedroomGotNote() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t biop_align32(uint32_t size) {
  return (size % 4) != 0 ? (4 - (size % 4)) : 0;
}


x86 assembly (clang, -O0):
<biop_align32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     1135 <biop_align32+0x35>
mov    -0x4(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
mov    $0x4,%eax
sub    %edx,%eax
mov    %eax,-0x8(%rbp)
jmp    113f <biop_align32+0x3f>
xor    %eax,%eax
mov    %eax,-0x8(%rbp)
jmp    113f <biop_align32+0x3f>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<biop_align32>:
lea    0x3(%rdi),%eax
test   %edi,%edi
cmovns %edi,%eax
and    $0xfffffffc,%eax
sub    %eax,%edi
mov    $0x4,%eax
sub    %edi,%eax
test   %edi,%edi
cmove  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @biop_align32(i32 %0) {
%2 = srem i32 %0, 4
%3 = icmp eq i32 %2, 0
%4 = sub nsw i32 4, %2
%5 = select i1 %3, i32 0, i32 %4
ret i32 %5
}
/* Variables and functions */
int EINVAL;
__attribute__((visibility("default"))) int
sd_bus_path_encode(const char *prefix, const char *external_id,
                   char **ret_path) {
  return -EINVAL;
}


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

x86 assembly (clang, -O2):
<sd_bus_path_encode>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@EINVAL = global i32 0
define i32 @sd_bus_path_encode(i8* %0, i8* %1, i8** %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8**
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8** %2, i8*** %6
%7 = load i32, i32* @EINVAL
%8 = sub nsw i32 0, %7
ret i32 %8
}

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @sd_bus_path_encode(i8* nocapture readnone %0, i8* nocapture readnone %1, i8** nocapture readnone %2) {
%4 = load i32, i32* @EINVAL
%5 = sub nsw i32 0, %4
ret i32 %5
}
void computeOnlineMean(float *mean, int *n, float newValue) {
  float oldMean = *mean;
  float newMean = oldMean + (newValue - oldMean) / (*n + 1);
  *mean = newMean;
  *n = *n + 1;
}


x86 assembly (clang, -O0):
<computeOnlineMean>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movss  %xmm0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x18(%rbp),%xmm0
movss  -0x14(%rbp),%xmm1
subss  -0x18(%rbp),%xmm1
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
add    $0x1,%eax
cvtsi2ss %eax,%xmm2
divss  %xmm2,%xmm1
addss  %xmm1,%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0x1c(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<computeOnlineMean>:
movss  (%rdi),%xmm1
subss  %xmm1,%xmm0
mov    (%rsi),%eax
add    $0x1,%eax
cvtsi2ss %eax,%xmm2
divss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,(%rdi)
mov    %eax,(%rsi)
ret

LLVM IR (-O0):
define void @computeOnlineMean(float* %0, i32* %1, float %2) {
%4 = alloca float*
%5 = alloca i32*
%6 = alloca float
%7 = alloca float
%8 = alloca float
store float* %0, float** %4
store i32* %1, i32** %5
store float %2, float* %6
%9 = load float*, float** %4
%10 = load float, float* %9
store float %10, float* %7
%11 = load float, float* %7
%12 = load float, float* %6
%13 = load float, float* %7
%14 = fsub float %12, %13
%15 = load i32*, i32** %5
%16 = load i32, i32* %15
%17 = add nsw i32 %16, 1
%18 = sitofp i32 %17 to float
%19 = fdiv float %14, %18
%20 = fadd float %11, %19
store float %20, float* %8
%21 = load float, float* %8
%22 = load float*, float** %4
store float %21, float* %22
%23 = load i32*, i32** %5
%24 = load i32, i32* %23
%25 = add nsw i32 %24, 1
%26 = load i32*, i32** %5
store i32 %25, i32* %26
ret void
}

LLVM IR (-O2):
define void @computeOnlineMean(float* nocapture %0, i32* nocapture %1, float %2) {
%4 = load float, float* %0
%5 = fsub float %2, %4
%6 = load i32, i32* %1
%7 = add nsw i32 %6, 1
%8 = sitofp i32 %7 to float
%9 = fdiv float %5, %8
%10 = fadd float %4, %9
store float %10, float* %0
store i32 %7, i32* %1
ret void
}
/* Variables and functions */
int three_d_array_len(char ***three_d_array) {
  int i = 0;
  for (; three_d_array[i] != NULL; i++)
    ;
  return i;
}


x86 assembly (clang, -O0):
<three_d_array_len>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     1135 <three_d_array_len+0x35>
jmp    1127 <three_d_array_len+0x27>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <three_d_array_len+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<three_d_array_len>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpq   $0x0,(%rdi)
lea    0x8(%rdi),%rdi
jne    1110 <three_d_array_len+0x10>
ret

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

LLVM IR (-O2):
define i32 @three_d_array_len(i8*** nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8**, i8*** %0, i64 %3
%5 = load i8**, i8*** %4
%6 = icmp eq i8** %5, null
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
int create_script(int message, int len1, char *script_file, int len2,
                  char *compiled_script) {
  return 6;
}


x86 assembly (clang, -O0):
<create_script>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    $0x6,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @create_script(i32 %0, i32 %1, i8* nocapture readnone %2, i32 %3, i8* nocapture readnone %4) {
ret i32 6
}
/* Variables and functions */
int /*<<< orphan*/ pop_root();
void pop_root_g() { pop_root(); }


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

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

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

LLVM IR (-O2):
define void @pop_root_g() {
%1 = tail call i32 (...) @pop_root()
ret void
}
/* Variables and functions */
int foo(int, int, int);
int main(int x, char **argv) {
  return foo(x, 2, 3) + foo(x, 4, 3) + foo(x + 6, x, 3) + x;
}


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)
mov    -0x8(%rbp),%edi
mov    $0x2,%esi
mov    $0x3,%edx
call   1030 <foo@plt>
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%edi
mov    $0x4,%esi
mov    $0x3,%edx
call   1030 <foo@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%edi
add    $0x6,%edi
mov    -0x8(%rbp),%esi
mov    $0x3,%edx
call   1030 <foo@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
add    %ecx,%eax
add    -0x8(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
mov    %edi,%ebx
mov    $0x2,%esi
mov    $0x3,%edx
call   1030 <foo@plt>
mov    %eax,%ebp
mov    %ebx,%edi
mov    $0x4,%esi
mov    $0x3,%edx
call   1030 <foo@plt>
mov    %eax,%r14d
lea    0x6(%rbx),%edi
mov    %ebx,%esi
mov    $0x3,%edx
call   1030 <foo@plt>
add    %ebx,%ebp
add    %r14d,%ebp
add    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @foo(i32 %0, i32 2, i32 3)
%4 = tail call i32 @foo(i32 %0, i32 4, i32 3)
%5 = add nsw i32 %0, 6
%6 = tail call i32 @foo(i32 %5, i32 %0, i32 3)
%7 = add i32 %3, %0
%8 = add i32 %7, %4
%9 = add i32 %8, %6
ret i32 %9
}
int digittoint(char ch) {
  int d;
  d = ch - '0';
  if ((unsigned)d < 10) {
    return d;
  }
  d = ch - 'a';
  if ((unsigned)d < 6) {
    return d + 10;
  }
  d = ch - 'A';
  if ((unsigned)d < 6) {
    return d + 10;
  }
  return -1;
}


x86 assembly (clang, -O0):
<digittoint>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0xa,-0xc(%rbp)
jae    1129 <digittoint+0x29>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1174 <digittoint+0x74>
movsbl -0x5(%rbp),%eax
sub    $0x61,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x6,-0xc(%rbp)
jae    114b <digittoint+0x4b>
mov    -0xc(%rbp),%eax
add    $0xa,%eax
mov    %eax,-0x4(%rbp)
jmp    1174 <digittoint+0x74>
movsbl -0x5(%rbp),%eax
sub    $0x41,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x6,-0xc(%rbp)
jae    116d <digittoint+0x6d>
mov    -0xc(%rbp),%eax
add    $0xa,%eax
mov    %eax,-0x4(%rbp)
jmp    1174 <digittoint+0x74>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<digittoint>:
lea    -0x30(%rdi),%eax
cmp    $0xa,%eax
jb     1127 <digittoint+0x27>
lea    -0x61(%rdi),%eax
cmp    $0x5,%eax
ja     1116 <digittoint+0x16>
add    $0xffffffa9,%edi
mov    %edi,%eax
ret
lea    -0x41(%rdi),%eax
add    $0xffffffc9,%edi
cmp    $0x6,%eax
mov    $0xffffffff,%eax
cmovb  %edi,%eax
ret

LLVM IR (-O0):
define i32 @digittoint(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
%4 = alloca i32
store i8 %0, i8* %3
%5 = load i8, i8* %3
%6 = sext i8 %5 to i32
%7 = sub nsw i32 %6, 48
store i32 %7, i32* %4
%8 = load i32, i32* %4
%9 = icmp ult i32 %8, 10
br i1 %9, label %10, label %12
10: ; preds = %1
%11 = load i32, i32* %4
store i32 %11, i32* %2
br label %31
12: ; preds = %1
%13 = load i8, i8* %3
%14 = sext i8 %13 to i32
%15 = sub nsw i32 %14, 97
store i32 %15, i32* %4
%16 = load i32, i32* %4
%17 = icmp ult i32 %16, 6
br i1 %17, label %18, label %21
18: ; preds = %12
%19 = load i32, i32* %4
%20 = add nsw i32 %19, 10
store i32 %20, i32* %2
br label %31
21: ; preds = %12
%22 = load i8, i8* %3
%23 = sext i8 %22 to i32
%24 = sub nsw i32 %23, 65
store i32 %24, i32* %4
%25 = load i32, i32* %4
%26 = icmp ult i32 %25, 6
br i1 %26, label %27, label %30
27: ; preds = %21
%28 = load i32, i32* %4
%29 = add nsw i32 %28, 10
store i32 %29, i32* %2
br label %31
30: ; preds = %21
store i32 -1, i32* %2
br label %31
31: ; preds = %30, %27, %18, %10
%32 = load i32, i32* %2
ret i32 %32
}

LLVM IR (-O2):
define i32 @digittoint(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = add nsw i32 %2, -48
%4 = icmp ult i32 %3, 10
br i1 %4, label %15, label %5
5: ; preds = %1
%6 = add nsw i32 %2, -97
%7 = icmp ult i32 %6, 6
br i1 %7, label %8, label %10
8: ; preds = %5
%9 = add nsw i32 %2, -87
br label %15
10: ; preds = %5
%11 = add nsw i32 %2, -65
%12 = icmp ult i32 %11, 6
%13 = add nsw i32 %2, -55
%14 = select i1 %12, i32 %13, i32 -1
br label %15
15: ; preds = %10, %1, %8
%16 = phi i32 [ %9, %8 ], [ %3, %1 ], [ %14, %10 ]
ret i32 %16
}
/* Variables and functions */
int /*<<< orphan*/ outb(int, unsigned int);
int smbus_wait(unsigned int);
int smbus_stop_condition(unsigned smbus_io_base) {
  outb((0x01 << 1), smbus_io_base + 0x03);
  return smbus_wait(smbus_io_base);
}


x86 assembly (clang, -O0):
<smbus_stop_condition>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
add    $0x3,%esi
mov    $0x2,%edi
call   1030 <outb@plt>
mov    -0x4(%rbp),%edi
call   1040 <smbus_wait@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<smbus_stop_condition>:
push   %rbx
mov    %edi,%ebx
lea    0x3(%rbx),%esi
mov    $0x2,%edi
call   1030 <outb@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <smbus_wait@plt>

LLVM IR (-O0):
define i32 @smbus_stop_condition(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add i32 %3, 3
%5 = call i32 @outb(i32 2, i32 %4)
%6 = load i32, i32* %2
%7 = call i32 @smbus_wait(i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @smbus_stop_condition(i32 %0) {
%2 = add i32 %0, 3
%3 = tail call i32 @outb(i32 2, i32 %2)
%4 = tail call i32 @smbus_wait(i32 %0)
ret i32 %4
}
int test2(unsigned int x) { return -((int)(x >> ((sizeof(int) * 8) - 1))); }


x86 assembly (clang, -O0):
<test2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
shr    $0x1f,%ecx
xor    %eax,%eax
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test2>:
mov    %edi,%eax
sar    $0x1f,%eax
ret

LLVM IR (-O0):
define i32 @test2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = lshr i32 %3, 31
%5 = sub nsw i32 0, %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @test2(i32 %0) {
%2 = ashr i32 %0, 31
ret i32 %2
}