xunge/DecIR huggingface dataset:
int test_imm_C3uint64_lowword_reg(unsigned long long val) {
  return ((val) & (0xC3 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_C3uint64_lowword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
and    $0xc3,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_C3uint64_lowword_reg(i64 %0) {
%2 = and i64 %0, 195
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ drone_connect();
int /*<<< orphan*/ drone_remote_control(double, double, double);
int /*<<< orphan*/ init_receive_blobs();
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Connecting to Drone...\n");
  drone_connect();
  printf("Connected!\n");
  printf("Starting blob receive...\n");
  init_receive_blobs();
  drone_remote_control(0.1, 0.1, 0.1);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xebd(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1050 <drone_connect@plt>
lea    0xec2(%rip),%rdi
call   1040 <printf@plt>
lea    0xec2(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1060 <init_receive_blobs@plt>
movsd  0xe82(%rip),%xmm2
movaps %xmm2,%xmm0
movaps %xmm2,%xmm1
call   1030 <drone_remote_control@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec0(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1050 <drone_connect@plt>
lea    0xec4(%rip),%rdi
call   1030 <puts@plt>
lea    0xec3(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1060 <init_receive_blobs@plt>
movsd  0xe85(%rip),%xmm0
movaps %xmm0,%xmm1
movaps %xmm0,%xmm2
call   1040 <drone_remote_control@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [24 x i8] c"Connecting to Drone...\0A\00"
@.str.1 = [12 x i8] c"Connected!\0A\00"
@.str.2 = [26 x i8] c"Starting blob receive...\0A\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @drone_connect()
%3 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0))
%5 = call i32 (...) @init_receive_blobs()
%6 = call i32 @drone_remote_control(double 1.000000e-01, double 1.000000e-01, double 1.000000e-01)
ret i32 0
}

LLVM IR (-O2):
@str = [23 x i8] c"Connecting to Drone...\00"
@str.3 = [11 x i8] c"Connected!\00"
@str.4 = [25 x i8] c"Starting blob receive...\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @drone_connect()
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str.3, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str.4, i64 0, i64 0))
%5 = tail call i32 (...) @init_receive_blobs()
%6 = tail call i32 @drone_remote_control(double 1.000000e-01, double 1.000000e-01, double 1.000000e-01)
ret i32 0
}
void halt_cpu() { __asm__ __volatile__("hlt" : : :); }


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

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

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

LLVM IR (-O2):
define void @halt_cpu() {
tail call void asm sideeffect "hlt", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Type definitions */
struct list_node {
  int dummy;
};
struct list_head {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ __list_del_entry(struct list_node *);
int /*<<< orphan*/ list_add(struct list_node *, struct list_head *);
void list_move(struct list_node *list, struct list_head *head) {
  __list_del_entry(list);
  list_add(list, head);
}


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

x86 assembly (clang, -O2):
<list_move>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <__list_del_entry@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <list_add@plt>

LLVM IR (-O0):
%struct.list_node = type { i32 }
%struct.list_head = type { i32 }
define void @list_move(%struct.list_node* %0, %struct.list_head* %1) {
%3 = alloca %struct.list_node*
%4 = alloca %struct.list_head*
store %struct.list_node* %0, %struct.list_node** %3
store %struct.list_head* %1, %struct.list_head** %4
%5 = load %struct.list_node*, %struct.list_node** %3
%6 = call i32 @__list_del_entry(%struct.list_node* %5)
%7 = load %struct.list_node*, %struct.list_node** %3
%8 = load %struct.list_head*, %struct.list_head** %4
%9 = call i32 @list_add(%struct.list_node* %7, %struct.list_head* %8)
ret void
}

LLVM IR (-O2):
%struct.list_node = type { i32 }
%struct.list_head = type { i32 }
define void @list_move(%struct.list_node* %0, %struct.list_head* %1) {
%3 = tail call i32 @__list_del_entry(%struct.list_node* %0)
%4 = tail call i32 @list_add(%struct.list_node* %0, %struct.list_head* %1)
ret void
}
/* Variables and functions */
bool SHAREMIND_MAP_KEY_LESS_unsigned_long(unsigned long const k1,
                                          unsigned long const k2) {
  return k1 < k2;
}


x86 assembly (clang, -O0):
<SHAREMIND_MAP_KEY_LESS_unsigned_long>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
setb   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SHAREMIND_MAP_KEY_LESS_unsigned_long>:
xor    %eax,%eax
cmp    %rsi,%rdi
setb   %al
ret

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

LLVM IR (-O2):
define i32 @SHAREMIND_MAP_KEY_LESS_unsigned_long(i64 %0, i64 %1) {
%3 = icmp ult i64 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int y;
};
typedef TYPE_1__ XKeyPressedEvent;

/* Variables and functions */
void set_XKeyPressedEvent_y(void *_p, int _v) {
  ((XKeyPressedEvent *)_p)->y = (int)_v;
}


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

x86 assembly (clang, -O2):
<set_XKeyPressedEvent_y>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32 }
define void @set_XKeyPressedEvent_y(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %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 i32 %5, i32* %8
ret void
}

LLVM IR (-O2):
define void @set_XKeyPressedEvent_y(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
void cleanup_qrcu_struct(struct qrcu_struct *qp) {}


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

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

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

LLVM IR (-O2):
%struct.qrcu_struct = type opaque
define void @cleanup_qrcu_struct(%struct.qrcu_struct* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __coverity_free__(void *);
void xfree(void *va) { __coverity_free__(va); }


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

x86 assembly (clang, -O2):
<xfree>:
jmp    1030 <__coverity_free__@plt>

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

LLVM IR (-O2):
define void @xfree(i8* %0) {
%2 = tail call i32 @__coverity_free__(i8* %0)
ret void
}
void server_template(const char *update_dir, const char *repository) {}


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

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

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

LLVM IR (-O2):
define void @server_template(i8* nocapture %0, i8* nocapture %1) {
ret void
}
/* Variables and functions */
int strcmp(char const *, char const *);
int _ht_strcmp(const char *node_key, const char *look_key) {
  return strcmp(node_key, look_key);
}


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

x86 assembly (clang, -O2):
<_ht_strcmp>:
jmp    1030 <strcmp@plt>

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

LLVM IR (-O2):
define i32 @_ht_strcmp(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i32 %3
}
int get_accesspt_assns(void *data) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @get_accesspt_assns(i8* nocapture readnone %0) {
ret i32 0
}
/* Type definitions */
struct subprocess_s {
  int dummy;
};

/* Variables and functions */
int subprocess_create_ex(char const *const *, int, int /*<<< orphan*/,
                         struct subprocess_s *const);
int subprocess_create(const char *const commandLine[], int options,
                      struct subprocess_s *const out_process) {
  return subprocess_create_ex(commandLine, options, 0, out_process);
}


x86 assembly (clang, -O0):
<subprocess_create>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rcx
xor    %edx,%edx
call   1030 <subprocess_create_ex@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<subprocess_create>:
mov    %rdx,%rcx
xor    %edx,%edx
jmp    1030 <subprocess_create_ex@plt>

LLVM IR (-O0):
%struct.subprocess_s = type { i32 }
define i32 @subprocess_create(i8** %0, i32 %1, %struct.subprocess_s* %2) {
%4 = alloca i8**
%5 = alloca i32
%6 = alloca %struct.subprocess_s*
store i8** %0, i8*** %4
store i32 %1, i32* %5
store %struct.subprocess_s* %2, %struct.subprocess_s** %6
%7 = load i8**, i8*** %4
%8 = load i32, i32* %5
%9 = load %struct.subprocess_s*, %struct.subprocess_s** %6
%10 = call i32 @subprocess_create_ex(i8** %7, i32 %8, i32 0, %struct.subprocess_s* %9)
ret i32 %10
}

LLVM IR (-O2):
%struct.subprocess_s = type { i32 }
define i32 @subprocess_create(i8** %0, i32 %1, %struct.subprocess_s* %2) {
%4 = tail call i32 @subprocess_create_ex(i8** %0, i32 %1, i32 0, %struct.subprocess_s* %2)
ret i32 %4
}
/* Variables and functions */
int chdir(char *);
int /*<<< orphan*/ platform_log(char *, char *);
void platform_set_working_directory(char *directory) {
  int chdir_result = chdir(directory);
  if (chdir_result != 0) {
    platform_log("couldn't set working directory to '%s'.", directory);
  }
}


x86 assembly (clang, -O0):
<platform_set_working_directory>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <chdir@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1152 <platform_set_working_directory+0x32>
mov    -0x8(%rbp),%rsi
lea    0xeb3(%rip),%rdi
call   1040 <platform_log@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<platform_set_working_directory>:
push   %rbx
mov    %rdi,%rbx
call   1030 <chdir@plt>
test   %eax,%eax
je     113d <platform_set_working_directory+0x1d>
lea    0xecc(%rip),%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1040 <platform_log@plt>
pop    %rbx
ret

LLVM IR (-O0):
@.str = [40 x i8] c"couldn't set working directory to '%s'.\00"
define void @platform_set_working_directory(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @chdir(i8* %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load i8*, i8** %2
%10 = call i32 @platform_log(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i8* %9)
br label %11
11: ; preds = %8, %1
ret void
}

LLVM IR (-O2):
@.str = [40 x i8] c"couldn't set working directory to '%s'.\00"
define void @platform_set_working_directory(i8* %0) {
%2 = tail call i32 @chdir(i8* %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @platform_log(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %6
6: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ unsigned_int_to_two_bytes(int, unsigned char *);
void stuff_length_type(int length, int ptype, unsigned char *byte_ptr) {
  byte_ptr++;
  unsigned_int_to_two_bytes(length, byte_ptr);
  byte_ptr++;
  byte_ptr++;
  *byte_ptr = ptype;
}


x86 assembly (clang, -O0):
<stuff_length_type>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <unsigned_int_to_two_bytes@plt>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stuff_length_type>:
push   %rbp
push   %rbx
push   %rax
mov    %rdx,%rbx
mov    %esi,%ebp
lea    0x1(%rdx),%rsi
call   1030 <unsigned_int_to_two_bytes@plt>
mov    %bpl,0x3(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define void @stuff_length_type(i32 %0, i32 %1, i8* %2) {
%4 = getelementptr inbounds i8, i8* %2, i64 1
%5 = tail call i32 @unsigned_int_to_two_bytes(i32 %0, i8* %4)
%6 = getelementptr inbounds i8, i8* %2, i64 3
%7 = trunc i32 %1 to i8
store i8 %7, i8* %6
ret void
}
/* Variables and functions */
unsigned long do_csum(unsigned char const *, int);
unsigned int csum_partial(const unsigned char *buff, int len,
                          unsigned int sum) {
  unsigned long result = do_csum(buff, len);
  result += sum;
  result = (result & 0xffffffff) + (result >> 32);
  return result;
}


x86 assembly (clang, -O0):
<csum_partial>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <do_csum@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
add    -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
movabs $0xffffffff,%rax
and    -0x18(%rbp),%rax
mov    -0x18(%rbp),%rcx
shr    $0x20,%rcx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<csum_partial>:
push   %rbx
mov    %edx,%ebx
call   1030 <do_csum@plt>
mov    %ebx,%ecx
add    %rcx,%rax
mov    %rax,%rcx
shr    $0x20,%rcx
add    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @csum_partial(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i64
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i8*, i8** %4
%9 = load i32, i32* %5
%10 = call i64 @do_csum(i8* %8, i32 %9)
store i64 %10, i64* %7
%11 = load i32, i32* %6
%12 = zext i32 %11 to i64
%13 = load i64, i64* %7
%14 = add i64 %13, %12
store i64 %14, i64* %7
%15 = load i64, i64* %7
%16 = and i64 %15, 4294967295
%17 = load i64, i64* %7
%18 = lshr i64 %17, 32
%19 = add i64 %16, %18
store i64 %19, i64* %7
%20 = load i64, i64* %7
%21 = trunc i64 %20 to i32
ret i32 %21
}

LLVM IR (-O2):
define i32 @csum_partial(i8* %0, i32 %1, i32 %2) {
%4 = tail call i64 @do_csum(i8* %0, i32 %1)
%5 = zext i32 %2 to i64
%6 = add i64 %4, %5
%7 = lshr i64 %6, 32
%8 = add i64 %7, %6
%9 = trunc i64 %8 to i32
ret i32 %9
}
/* Variables and functions */
float sqrt(double);
float sacone(float a, float b) {
  return (3.141592 * a * (a + sqrt((double)((a * a) + (b * b)))));
}


x86 assembly (clang, -O0):
<sacone>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xecd(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x4(%rbp),%xmm2
movss  -0x8(%rbp),%xmm1
mulss  -0x8(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
call   1030 <sqrt@plt>
movss  -0x14(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x10(%rbp),%xmm0
addss  %xmm2,%xmm1
cvtss2sd %xmm1,%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sacone>:
sub    $0x18,%rsp
movss  %xmm0,0xc(%rsp)
cvtss2sd %xmm0,%xmm2
mulsd  0xeda(%rip),%xmm2
movsd  %xmm2,0x10(%rsp)
mulss  %xmm1,%xmm1
movaps %xmm0,%xmm2
mulss  %xmm0,%xmm2
addss  %xmm1,%xmm2
xorps  %xmm0,%xmm0
cvtss2sd %xmm2,%xmm0
call   1030 <sqrt@plt>
addss  0xc(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
mulsd  0x10(%rsp),%xmm0
cvtsd2ss %xmm0,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define float @sacone(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = fpext float %5 to double
%7 = fmul double 0x400921FAFC8B007A, %6
%8 = load float, float* %3
%9 = load float, float* %3
%10 = load float, float* %3
%11 = load float, float* %4
%12 = load float, float* %4
%13 = fmul float %11, %12
%14 = call float @llvm.fmuladd.f32(float %9, float %10, float %13)
%15 = fpext float %14 to double
%16 = call float @sqrt(double %15)
%17 = fadd float %8, %16
%18 = fpext float %17 to double
%19 = fmul double %7, %18
%20 = fptrunc double %19 to float
ret float %20
}

LLVM IR (-O2):
define float @sacone(float %0, float %1) {
%3 = fpext float %0 to double
%4 = fmul double %3, 0x400921FAFC8B007A
%5 = fmul float %1, %1
%6 = tail call float @llvm.fmuladd.f32(float %0, float %0, float %5)
%7 = fpext float %6 to double
%8 = tail call float @sqrt(double %7)
%9 = fadd float %8, %0
%10 = fpext float %9 to double
%11 = fmul double %4, %10
%12 = fptrunc double %11 to float
ret float %12
}
/* Variables and functions */
int /*<<< orphan*/ test_parser_sourcefile(char *, char *);
int /*<<< orphan*/ test_parser_verify_parse(int /*<<< orphan*/, char *, char *,
                                            char *, int /*<<< orphan*/);
void test_lisp_char_string() {
  test_parser_verify_parse(test_parser_sourcefile("lisp", " \"a\""), "lisp",
                           "\"a\"", "", 0);
}


x86 assembly (clang, -O0):
<test_lisp_char_string>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
lea    0xed3(%rip),%rsi
call   1030 <test_parser_sourcefile@plt>
mov    %eax,%edi
lea    0xec0(%rip),%rsi
lea    0xebf(%rip),%rdx
lea    0xebb(%rip),%rcx
xor    %r8d,%r8d
call   1040 <test_parser_verify_parse@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_lisp_char_string>:
push   %rbx
lea    0xed8(%rip),%rbx
lea    0xed6(%rip),%rsi
mov    %rbx,%rdi
call   1030 <test_parser_sourcefile@plt>
lea    0xec8(%rip),%rdx
lea    0xec4(%rip),%rcx
mov    %eax,%edi
mov    %rbx,%rsi
xor    %r8d,%r8d
pop    %rbx
jmp    1040 <test_parser_verify_parse@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"lisp\00"
@.str.1 = [5 x i8] c" \22a\22\00"
@.str.2 = [4 x i8] c"\22a\22\00"
@.str.3 = [1 x i8] zeroinitializer
define void @test_lisp_char_string() {
%1 = call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 @test_parser_verify_parse(i32 %1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.3, i64 0, i64 0), i32 0)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"lisp\00"
@.str.1 = [5 x i8] c" \22a\22\00"
@.str.2 = [4 x i8] c"\22a\22\00"
@.str.3 = [1 x i8] zeroinitializer
define void @test_lisp_char_string() {
%1 = tail call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @test_parser_verify_parse(i32 %1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.3, i64 0, i64 0), i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float, float);
int main() {
  float variable1 = 10.5f;
  float variable2 = 10.12345f;
  printf("Value of %%.5f and %%.3g: %.5f and %.3g\n", variable1, variable2);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  0xee4(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  0xed3(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xef0(%rip),%rdi
movss  0xee0(%rip),%xmm0
movss  0xedc(%rip),%xmm1
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [41 x i8] c"Value of %%.5f and %%.3g: %.5f and %.3g\0A\00"
define i32 @main() {
%1 = alloca float
%2 = alloca float
store float 1.050000e+01, float* %1
store float 0x40243F34E0000000, float* %2
%3 = load float, float* %1
%4 = load float, float* %2
%5 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), float %3, float %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [41 x i8] c"Value of %%.5f and %%.3g: %.5f and %.3g\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), float 1.050000e+01, float 0x40243F34E0000000)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ puts(char const *const);
void license(void) {
  const char *const info =
      "Copyright (C) 2012, Kevin Polulak <kpolulak@gmail.com>\n"
      "License GPLv3+: GNU GPL version 3 or later "
      "<http://gnu.org/licenses/gpl.html>\n"
      "This is free software: you are free to change and redistribute it.\n"
      "There is NO WARRANTY, to the extent permitted by law.";
  puts(info);
}


x86 assembly (clang, -O0):
<license>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rax
mov    %rax,-0x8(%rbp)
lea    0xed6(%rip),%rdi
call   1030 <puts@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [254 x i8] c"Copyright (C) 2012, Kevin Polulak <kpolulak@gmail.com>\0ALicense GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>\0AThis is free software: you are free to change and redistribute it.\0AThere is NO WARRANTY, to the extent permitted by law.\00"
define void @license() {
%1 = alloca i8*
store i8* getelementptr inbounds ([254 x i8], [254 x i8]* @.str, i64 0, i64 0), i8** %1
%2 = call i32 @puts(i8* getelementptr inbounds ([254 x i8], [254 x i8]* @.str, i32 0, i32 0))
ret void
}

LLVM IR (-O2):
@.str = [254 x i8] c"Copyright (C) 2012, Kevin Polulak <kpolulak@gmail.com>\0ALicense GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>\0AThis is free software: you are free to change and redistribute it.\0AThere is NO WARRANTY, to the extent permitted by law.\00"
define void @license() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([254 x i8], [254 x i8]* @.str, i64 0, i64 0))
ret void
}
int threads_runnable(unsigned int *threads_running,
                     unsigned int *threads_total) {
  return -1;
}


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

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

LLVM IR (-O0):
define i32 @threads_runnable(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 @threads_runnable(i32* nocapture readnone %0, i32* nocapture readnone %1) {
ret i32 -1
}
void motion_result10(int *data) {
  int j;
  int p = data[1];
  int i = data[0];
  if (p)
    j = 1;
  else
    j = 2;
  do {
    i = i + j;
    data[data[2]] = 2;
  } while (i < data[3]);
}


x86 assembly (clang, -O0):
<motion_result10>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x10(%rbp)
je     1131 <motion_result10+0x31>
movl   $0x1,-0xc(%rbp)
jmp    1138 <motion_result10+0x38>
movl   $0x2,-0xc(%rbp)
jmp    113d <motion_result10+0x3d>
mov    -0x14(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x8(%rbp),%rcx
movslq 0x8(%rcx),%rcx
movl   $0x2,(%rax,%rcx,4)
mov    -0x14(%rbp),%eax
mov    -0x8(%rbp),%rcx
cmp    0xc(%rcx),%eax
jl     113d <motion_result10+0x3d>
pop    %rbp
ret

x86 assembly (clang, -O2):
<motion_result10>:
cmpl   $0x1,0x4(%rdi)
mov    (%rdi),%eax
mov    $0x1,%ecx
adc    $0x0,%ecx
xchg   %ax,%ax
add    %ecx,%eax
movslq 0x8(%rdi),%rdx
movl   $0x2,(%rdi,%rdx,4)
cmp    0xc(%rdi),%eax
jl     1110 <motion_result10+0x10>
ret

LLVM IR (-O0):
define void @motion_result10(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %2
%6 = load i32*, i32** %2
%7 = getelementptr inbounds i32, i32* %6, i64 1
%8 = load i32, i32* %7
store i32 %8, i32* %4
%9 = load i32*, i32** %2
%10 = getelementptr inbounds i32, i32* %9, i64 0
%11 = load i32, i32* %10
store i32 %11, i32* %5
%12 = load i32, i32* %4
%13 = icmp ne i32 %12, 0
br i1 %13, label %14, label %15
14: ; preds = %1
store i32 1, i32* %3
br label %16
15: ; preds = %1
store i32 2, i32* %3
br label %16
16: ; preds = %15, %14
br label %17
17: ; preds = %27, %16
%18 = load i32, i32* %5
%19 = load i32, i32* %3
%20 = add nsw i32 %18, %19
store i32 %20, i32* %5
%21 = load i32*, i32** %2
%22 = load i32*, i32** %2
%23 = getelementptr inbounds i32, i32* %22, i64 2
%24 = load i32, i32* %23
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds i32, i32* %21, i64 %25
store i32 2, i32* %26
br label %27
27: ; preds = %17
%28 = load i32, i32* %5
%29 = load i32*, i32** %2
%30 = getelementptr inbounds i32, i32* %29, i64 3
%31 = load i32, i32* %30
%32 = icmp slt i32 %28, %31
br i1 %32, label %17, label %33
33: ; preds = %27
ret void
}

LLVM IR (-O2):
define void @motion_result10(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 1
%3 = load i32, i32* %2
%4 = load i32, i32* %0
%5 = icmp eq i32 %3, 0
%6 = select i1 %5, i32 2, i32 1
%7 = getelementptr inbounds i32, i32* %0, i64 2
%8 = getelementptr inbounds i32, i32* %0, i64 3
br label %9
9: ; preds = %9, %1
%10 = phi i32 [ %4, %1 ], [ %11, %9 ]
%11 = add nsw i32 %10, %6
%12 = load i32, i32* %7
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i32, i32* %0, i64 %13
store i32 2, i32* %14
%15 = load i32, i32* %8
%16 = icmp slt i32 %11, %15
br i1 %16, label %9, label %17
17: ; preds = %9
ret void
}
char g(char x) {
  if (!x)
    return 1;
  else
    return 2 * g(x - 1);
}


x86 assembly (clang, -O0):
<g>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x2(%rbp)
cmpb   $0x0,-0x2(%rbp)
jne    1131 <g+0x21>
movb   $0x1,-0x1(%rbp)
jmp    1149 <g+0x39>
movsbl -0x2(%rbp),%eax
sub    $0x1,%eax
movsbl %al,%edi
call   1030 <g@plt>
movsbl %al,%eax
shl    $0x1,%eax
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<g>:
test   %dil,%dil
je     112a <g+0x1a>
push   %rax
add    $0xff,%dil
movsbl %dil,%edi
call   1030 <g@plt>
add    %al,%al
add    $0x8,%rsp
ret
mov    $0x1,%al
ret

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

LLVM IR (-O2):
define signext i8 @g(i8 signext %0) {
%2 = icmp eq i8 %0, 0
br i1 %2, label %3, label %5
3: ; preds = %1, %5
%4 = phi i8 [ %8, %5 ], [ 1, %1 ]
ret i8 %4
5: ; preds = %1
%6 = add i8 %0, -1
%7 = tail call signext i8 @g(i8 signext %6)
%8 = shl i8 %7, 1
br label %3
}
void *indirect_to_ptr(void *ptr) { return (void *)((unsigned long)ptr & ~1); }


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

x86 assembly (clang, -O2):
<indirect_to_ptr>:
mov    %rdi,%rax
and    $0xfffffffffffffffe,%rax
ret

LLVM IR (-O0):
define i8* @indirect_to_ptr(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = ptrtoint i8* %3 to i64
%5 = and i64 %4, -2
%6 = inttoptr i64 %5 to i8*
ret i8* %6
}

LLVM IR (-O2):
define i8* @indirect_to_ptr(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = and i64 %2, -2
%4 = inttoptr i64 %3 to i8*
ret i8* %4
}
int bitcount(unsigned int x) {
  int b = 0;
  for (; x != 0; x &= (x - 1))
    b++;
  return b;
}


x86 assembly (clang, -O0):
<bitcount>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1132 <bitcount+0x32>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
and    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    110e <bitcount+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitcount>:
xor    %eax,%eax
test   %edi,%edi
je     111c <bitcount+0x1c>
cs nopw 0x0(%rax,%rax,1)
add    $0x1,%eax
lea    -0x1(%rdi),%ecx
and    %edi,%ecx
mov    %ecx,%edi
jne    1110 <bitcount+0x10>
ret

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

LLVM IR (-O2):
define i32 @bitcount(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %10, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 0, %1 ]
%5 = phi i32 [ %8, %3 ], [ %0, %1 ]
%6 = add nuw nsw i32 %4, 1
%7 = add i32 %5, -1
%8 = and i32 %7, %5
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %3
10: ; preds = %3, %1
%11 = phi i32 [ 0, %1 ], [ %6, %3 ]
ret i32 %11
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  unsigned long subwindow;
};
struct TYPE_4__ {
  TYPE_1__ xkey;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
void set_XEvent_xkey_subwindow(void *_p, unsigned long _v) {
  ((XEvent *)_p)->xkey.subwindow = (unsigned long)_v;
}


x86 assembly (clang, -O0):
<set_XEvent_xkey_subwindow>:
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_XEvent_xkey_subwindow>:
mov    %rsi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i64 }
define void @set_XEvent_xkey_subwindow(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_4__*
%8 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %7, i32 0, i32 0
%9 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %8, i32 0, i32 0
store i64 %5, i64* %9
ret void
}

LLVM IR (-O2):
define void @set_XEvent_xkey_subwindow(i8* nocapture writeonly %0, i64 %1) {
%3 = bitcast i8* %0 to i64*
store i64 %1, i64* %3
ret void
}
void RTReqQueueCallVoid(void) {}


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

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

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

LLVM IR (-O2):
define void @RTReqQueueCallVoid() {
ret void
}
/* Variables and functions */
scalar_t__ islower(int);
int toupper(int c) { return islower(c) ? (c - 0x20) : c; }


x86 assembly (clang, -O0):
<toupper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <islower@plt>
cmp    $0x0,%rax
je     113b <toupper+0x2b>
mov    -0x4(%rbp),%eax
sub    $0x20,%eax
mov    %eax,-0x8(%rbp)
jmp    1141 <toupper+0x31>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<toupper>:
push   %rbx
mov    %edi,%ebx
call   1030 <islower@plt>
lea    -0x20(%rbx),%ecx
test   %rax,%rax
cmove  %ebx,%ecx
mov    %ecx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @toupper(i32 %0) {
%2 = tail call i64 @islower(i32 %0)
%3 = icmp eq i64 %2, 0
%4 = add nsw i32 %0, -32
%5 = select i1 %3, i32 %0, i32 %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void fail(char *message) {
  printf(message);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<fail>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <printf@plt>
mov    0x2ea4(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<fail>:
push   %rax
call   1030 <printf@plt>
mov    0x2eb3(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
define void @fail(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* %3)
%5 = load i32, i32* @EXIT_FAILURE
%6 = call i32 @exit(i32 %5)
unreachable
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
define void @fail(i8* nocapture %0) {
%2 = tail call i32 @printf(i8* dereferenceable(1) %0)
%3 = load i32, i32* @EXIT_FAILURE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
void gtk_statusbar_push() {}


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

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

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

LLVM IR (-O2):
define void @gtk_statusbar_push() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ main_double(int, char **);
int /*<<< orphan*/ main_float(int, char **);
int main(int argc, char *argv[]) {
  main_float(argc, argv);
  main_double(argc, argv);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <main_float@plt>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1040 <main_double@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
call   1030 <main_float@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
call   1040 <main_double@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
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 = load i8**, i8*** %5
%8 = call i32 @main_float(i32 %6, i8** %7)
%9 = load i32, i32* %4
%10 = load i8**, i8*** %5
%11 = call i32 @main_double(i32 %9, i8** %10)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @main_float(i32 %0, i8** %1)
%4 = tail call i32 @main_double(i32 %0, i8** %1)
ret i32 0
}
int start_tkwindow() { return 1; }


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

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

LLVM IR (-O0):
define i32 @start_tkwindow() {
ret i32 1
}

LLVM IR (-O2):
define i32 @start_tkwindow() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void handleKeypress(unsigned char key, int x, int y) {
  int do_redisp = 0;
  switch (key) {
  case 27:
    exit(0);
    break;
  }
}


x86 assembly (clang, -O0):
<handleKeypress>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x1(%rbp),%al
sub    $0x1b,%al
jne    1142 <handleKeypress+0x32>
jmp    113b <handleKeypress+0x2b>
xor    %edi,%edi
call   1030 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handleKeypress>:
cmp    $0x1b,%dil
je     1117 <handleKeypress+0x7>
ret
push   %rax
xor    %edi,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @handleKeypress(i8 zeroext %0, i32 %1, i32 %2) {
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i8 %0, i8* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
store i32 0, i32* %7
%8 = load i8, i8* %4
%9 = zext i8 %8 to i32
switch i32 %9, label %12 [
i32 27, label %10
]
10: ; preds = %3
%11 = call i32 @exit(i32 0)
unreachable
12: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @handleKeypress(i8 zeroext %0, i32 %1, i32 %2) {
%4 = icmp eq i8 %0, 27
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = tail call i32 @exit(i32 0)
unreachable
7: ; preds = %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int send(int, unsigned char *, int, int /*<<< orphan*/);
int send_byte(int sockfd, unsigned char data) {
  if (send(sockfd, &data, 1, 0) == -1) {
    printf("Error sending to client\n");
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<send_byte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %edi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%edi
lea    -0x9(%rbp),%rsi
mov    $0x1,%edx
xor    %ecx,%ecx
call   1030 <send@plt>
cmp    $0xffffffff,%eax
jne    1165 <send_byte+0x45>
lea    0xeac(%rip),%rdi
call   1040 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    116c <send_byte+0x4c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_byte>:
push   %rbx
sub    $0x10,%rsp
mov    %sil,0xf(%rsp)
lea    0xf(%rsp),%rsi
xor    %ebx,%ebx
mov    $0x1,%edx
xor    %ecx,%ecx
call   1040 <send@plt>
cmp    $0xffffffff,%eax
jne    1153 <send_byte+0x33>
lea    0xeb7(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%ebx
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"Error sending to client\0A\00"
define i32 @send_byte(i32 %0, i8 zeroext %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8
store i32 %0, i32* %4
store i8 %1, i8* %5
%6 = load i32, i32* %4
%7 = call i32 @send(i32 %6, i8* %5, i32 1, i32 0)
%8 = icmp eq i32 %7, -1
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %3
br label %12
11: ; preds = %2
store i32 0, i32* %3
br label %12
12: ; preds = %11, %9
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
@str = [24 x i8] c"Error sending to client\00"
define i32 @send_byte(i32 %0, i8 zeroext %1) {
%3 = alloca i8
store i8 %1, i8* %3
%4 = call i32 @send(i32 %0, i8* %3, i32 1, i32 0)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
br label %8
8: ; preds = %2, %6
%9 = phi i32 [ -1, %6 ], [ 0, %2 ]
ret i32 %9
}
int ascii_isupper(int c) { return (c >= 'A') && (c <= 'Z'); }


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

x86 assembly (clang, -O2):
<ascii_isupper>:
add    $0xffffffbf,%edi
xor    %eax,%eax
cmp    $0x1a,%edi
setb   %al
ret

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

LLVM IR (-O2):
define i32 @ascii_isupper(i32 %0) {
%2 = add i32 %0, -65
%3 = icmp ult i32 %2, 26
%4 = zext i1 %3 to i32
ret i32 %4
}
unsigned umin(unsigned a, unsigned b) { return (a < b) ? a : b; }


x86 assembly (clang, -O0):
<umin>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jae    1121 <umin+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <umin+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<umin>:
mov    %esi,%eax
cmp    %esi,%edi
cmovb  %edi,%eax
ret

LLVM IR (-O0):
define i32 @umin(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 ult i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %3
br label %12
10: ; preds = %2
%11 = load i32, i32* %4
br label %12
12: ; preds = %10, %8
%13 = phi i32 [ %9, %8 ], [ %11, %10 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @umin(i32 %0, i32 %1) {
%3 = icmp ult i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
void clflush(volatile void *ptr) {
  asm volatile("clflush %0" : "+m"(*(volatile char *)ptr));
}


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

x86 assembly (clang, -O2):
<clflush>:
clflush (%rdi)
ret

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

LLVM IR (-O2):
define void @clflush(i8* %0) {
tail call void asm sideeffect "clflush $0", "=*m,*m,~{dirflag},~{fpsr},~{flags}"(i8* elementtype(i8) %0, i8* elementtype(i8) %0)
ret void
}
int mid_farm() { return 1; }


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

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

LLVM IR (-O0):
define i32 @mid_farm() {
ret i32 1
}

LLVM IR (-O2):
define i32 @mid_farm() {
ret i32 1
}
/* Type definitions */
typedef scalar_t__ uint16_t;

/* Variables and functions */
uint16_t bmax_uint16(uint16_t a, uint16_t b) { return (a > b ? a : b); }


x86 assembly (clang, -O0):
<bmax_uint16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jle    1127 <bmax_uint16+0x27>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    112f <bmax_uint16+0x2f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bmax_uint16>:
mov    %rsi,%rax
cmp    %rsi,%rdi
cmovg  %rdi,%rax
ret

LLVM IR (-O0):
define i64 @bmax_uint16(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 sgt i64 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i64, i64* %3
br label %12
10: ; preds = %2
%11 = load i64, i64* %4
br label %12
12: ; preds = %10, %8
%13 = phi i64 [ %9, %8 ], [ %11, %10 ]
ret i64 %13
}

LLVM IR (-O2):
define i64 @bmax_uint16(i64 %0, i64 %1) {
%3 = icmp sgt i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
ret i64 %4
}
double sqr(double v) { return v * v; }


x86 assembly (clang, -O0):
<sqr>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<sqr>:
mulsd  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @sqr(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = fmul double %3, %4
ret double %5
}

LLVM IR (-O2):
define double @sqr(double %0) {
%2 = fmul double %0, %0
ret double %2
}
/* Variables and functions */
double fast_exp(double);
double gauss(double x, double sigma) {
  double ratio = -(x * x) / sigma;
  return fast_exp(ratio);
}


x86 assembly (clang, -O0):
<gauss>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
divsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1030 <fast_exp@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gauss>:
movapd 0xee8(%rip),%xmm2
xorpd  %xmm0,%xmm2
mulsd  %xmm2,%xmm0
divsd  %xmm1,%xmm0
jmp    1030 <fast_exp@plt>

LLVM IR (-O0):
define double @gauss(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %3
store double %1, double* %4
%6 = load double, double* %3
%7 = load double, double* %3
%8 = fmul double %6, %7
%9 = fneg double %8
%10 = load double, double* %4
%11 = fdiv double %9, %10
store double %11, double* %5
%12 = load double, double* %5
%13 = call double @fast_exp(double %12)
ret double %13
}

LLVM IR (-O2):
define double @gauss(double %0, double %1) {
%3 = fneg double %0
%4 = fmul double %3, %0
%5 = fdiv double %4, %1
%6 = tail call double @fast_exp(double %5)
ret double %6
}