xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ MAP_SHARED;
int PROT_READ;
int PROT_WRITE;
char *mmap(int /*<<< orphan*/, int, int, int /*<<< orphan*/, int,
           int /*<<< orphan*/);
char *u2mfn_alloc_kpage_with_fd(int fd) {
  char *ret;
  ret = mmap(0, 4096, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
  return ret;
}


x86 assembly (clang, -O0):
<u2mfn_alloc_kpage_with_fd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ed6(%rip),%rax
mov    (%rax),%edx
mov    0x2ea5(%rip),%rax
or     (%rax),%edx
mov    0x2eb4(%rip),%rax
mov    (%rax),%ecx
mov    -0x4(%rbp),%r8d
xor    %r9d,%r9d
mov    $0x1000,%esi
mov    %r9d,%edi
call   1030 <mmap@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<u2mfn_alloc_kpage_with_fd>:
mov    %edi,%r8d
mov    0x2ede(%rip),%rax
mov    0x2eaf(%rip),%rcx
mov    (%rcx),%edx
or     (%rax),%edx
mov    0x2ebc(%rip),%rax
mov    (%rax),%ecx
xor    %edi,%edi
mov    $0x1000,%esi
xor    %r9d,%r9d
jmp    1030 <mmap@plt>

LLVM IR (-O0):
@PROT_READ = global i32 0
@PROT_WRITE = global i32 0
@MAP_SHARED = global i32 0
define i8* @u2mfn_alloc_kpage_with_fd(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* @PROT_READ
%5 = load i32, i32* @PROT_WRITE
%6 = or i32 %4, %5
%7 = load i32, i32* @MAP_SHARED
%8 = load i32, i32* %2
%9 = call i8* @mmap(i32 0, i32 4096, i32 %6, i32 %7, i32 %8, i32 0)
store i8* %9, i8** %3
%10 = load i8*, i8** %3
ret i8* %10
}

LLVM IR (-O2):
@PROT_READ = global i32 0
@PROT_WRITE = global i32 0
@MAP_SHARED = global i32 0
define i8* @u2mfn_alloc_kpage_with_fd(i32 %0) {
%2 = load i32, i32* @PROT_READ
%3 = load i32, i32* @PROT_WRITE
%4 = or i32 %3, %2
%5 = load i32, i32* @MAP_SHARED
%6 = tail call i8* @mmap(i32 0, i32 4096, i32 %4, i32 %5, i32 %0, i32 0)
ret i8* %6
}
void gf8mul_00001010(void) {
  __asm__ __volatile__("\tpxor    %xmm7, %xmm5\n"
                       "\tpxor    %xmm7, %xmm4\n"
                       "\tpxor    %xmm7, %xmm1\n"
                       "\tpxor    %xmm6, %xmm4\n"
                       "\tpxor    %xmm6, %xmm3\n"
                       "\tpxor    %xmm6, %xmm0\n"
                       "\tpxor    %xmm5, %xmm6\n"
                       "\tpxor    %xmm5, %xmm2\n"
                       "\tpxor    %xmm5, %xmm0\n"
                       "\tpxor    %xmm4, %xmm7\n"
                       "\tpxor    %xmm4, %xmm5\n"
                       "\tpxor    %xmm5, %xmm4\n"
                       "\tpxor    %xmm3, %xmm6\n"
                       "\tpxor    %xmm3, %xmm4\n"
                       "\tpxor    %xmm4, %xmm3\n"
                       "\tpxor    %xmm2, %xmm5\n"
                       "\tpxor    %xmm2, %xmm3\n"
                       "\tpxor    %xmm3, %xmm2\n"
                       "\tpxor    %xmm1, %xmm4\n"
                       "\tpxor    %xmm1, %xmm2\n"
                       "\tpxor    %xmm2, %xmm1\n"
                       "\tpxor    %xmm0, %xmm3\n"
                       "\tpxor    %xmm0, %xmm1\n"
                       "\tpxor    %xmm1, %xmm0\n");
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
pxor   %xmm7,%xmm5
pxor   %xmm7,%xmm4
pxor   %xmm7,%xmm1
pxor   %xmm6,%xmm4
pxor   %xmm6,%xmm3
pxor   %xmm6,%xmm0
pxor   %xmm5,%xmm6
pxor   %xmm5,%xmm2
pxor   %xmm5,%xmm0
pxor   %xmm4,%xmm7
pxor   %xmm4,%xmm5
pxor   %xmm5,%xmm4
pxor   %xmm3,%xmm6
pxor   %xmm3,%xmm4
pxor   %xmm4,%xmm3
pxor   %xmm2,%xmm5
pxor   %xmm2,%xmm3
pxor   %xmm3,%xmm2
pxor   %xmm1,%xmm4
pxor   %xmm1,%xmm2
pxor   %xmm2,%xmm1
pxor   %xmm0,%xmm3
pxor   %xmm0,%xmm1
pxor   %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
pxor   %xmm7,%xmm5
pxor   %xmm7,%xmm4
pxor   %xmm7,%xmm1
pxor   %xmm6,%xmm4
pxor   %xmm6,%xmm3
pxor   %xmm6,%xmm0
pxor   %xmm5,%xmm6
pxor   %xmm5,%xmm2
pxor   %xmm5,%xmm0
pxor   %xmm4,%xmm7
pxor   %xmm4,%xmm5
pxor   %xmm5,%xmm4
pxor   %xmm3,%xmm6
pxor   %xmm3,%xmm4
pxor   %xmm4,%xmm3
pxor   %xmm2,%xmm5
pxor   %xmm2,%xmm3
pxor   %xmm3,%xmm2
pxor   %xmm1,%xmm4
pxor   %xmm1,%xmm2
pxor   %xmm2,%xmm1
pxor   %xmm0,%xmm3
pxor   %xmm0,%xmm1
pxor   %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define void @gf8mul_00001010() {
tail call void asm sideeffect "\09pxor %xmm7, %xmm5\0A\09pxor %xmm7, %xmm4\0A\09pxor %xmm7, %xmm1\0A\09pxor %xmm6, %xmm4\0A\09pxor %xmm6, %xmm3\0A\09pxor %xmm6, %xmm0\0A\09pxor %xmm5, %xmm6\0A\09pxor %xmm5, %xmm2\0A\09pxor %xmm5, %xmm0\0A\09pxor %xmm4, %xmm7\0A\09pxor %xmm4, %xmm5\0A\09pxor %xmm5, %xmm4\0A\09pxor %xmm3, %xmm6\0A\09pxor %xmm3, %xmm4\0A\09pxor %xmm4, %xmm3\0A\09pxor %xmm2, %xmm5\0A\09pxor %xmm2, %xmm3\0A\09pxor %xmm3, %xmm2\0A\09pxor %xmm1, %xmm4\0A\09pxor %xmm1, %xmm2\0A\09pxor %xmm2, %xmm1\0A\09pxor %xmm0, %xmm3\0A\09pxor %xmm0, %xmm1\0A\09pxor %xmm1, %xmm0\0A", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Type definitions */
struct t_config_option {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ buflist_bar_item_update();
void buflist_config_change_buflist(const void *pointer, void *data,
                                   struct t_config_option *option) {
  (void)pointer;
  (void)data;
  (void)option;
  buflist_bar_item_update();
}


x86 assembly (clang, -O0):
<buflist_config_change_buflist>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0x0,%al
call   1030 <buflist_bar_item_update@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
%struct.t_config_option = type { i32 }
define void @buflist_config_change_buflist(i8* nocapture readnone %0, i8* nocapture readnone %1, %struct.t_config_option* nocapture readnone %2) {
%4 = tail call i32 (...) @buflist_bar_item_update()
ret void
}
char *module_name() { return "dummy"; }


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

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

LLVM IR (-O0):
@.str = [6 x i8] c"dummy\00"
define i8* @module_name() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [6 x i8] c"dummy\00"
define i8* @module_name() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
scalar_t__ strlen(char *);
void free_mk_t(char *value) {
  if (strlen(value) > 0)
    free(value);
}


x86 assembly (clang, -O0):
<free_mk_t>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
cmp    $0x0,%rax
jle    1148 <free_mk_t+0x28>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_mk_t>:
push   %rbx
mov    %rdi,%rbx
call   1040 <strlen@plt>
test   %rax,%rax
jle    1137 <free_mk_t+0x17>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @free_mk_t(i8* nocapture %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = icmp sgt i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @free(i8* %0)
br label %6
6: ; preds = %4, %1
ret void
}
/* Type definitions */
struct utmpx {
  int dummy;
};
struct utmp {
  int dummy;
};

/* Variables and functions */
scalar_t__ __pututline(struct utmp const *);
struct utmpx *__pututxline(const struct utmpx *utmpx) {
  return (struct utmpx *)__pututline((const struct utmp *)utmpx);
}


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

x86 assembly (clang, -O2):
<__pututxline>:
jmp    1030 <__pututline@plt>

LLVM IR (-O0):
%struct.utmpx = type { i32 }
%struct.utmp = type { i32 }
define %struct.utmpx* @__pututxline(%struct.utmpx* %0) {
%2 = alloca %struct.utmpx*
store %struct.utmpx* %0, %struct.utmpx** %2
%3 = load %struct.utmpx*, %struct.utmpx** %2
%4 = bitcast %struct.utmpx* %3 to %struct.utmp*
%5 = call i64 @__pututline(%struct.utmp* %4)
%6 = inttoptr i64 %5 to %struct.utmpx*
ret %struct.utmpx* %6
}

LLVM IR (-O2):
%struct.utmpx = type { i32 }
%struct.utmp = type { i32 }
define %struct.utmpx* @__pututxline(%struct.utmpx* %0) {
%2 = bitcast %struct.utmpx* %0 to %struct.utmp*
%3 = tail call i64 @__pututline(%struct.utmp* %2)
%4 = inttoptr i64 %3 to %struct.utmpx*
ret %struct.utmpx* %4
}
void srand(unsigned int seed) { return; }


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

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

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

LLVM IR (-O2):
define void @srand(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit_syscall_process(char const *, int, double, int, void *);
void syscall_exit_process(const char *modname, int pass, double clock, int cpu,
                          void *args) {
  exit_syscall_process(modname, pass, clock, cpu, args);
}


x86 assembly (clang, -O0):
<syscall_exit_process>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movsd  %xmm0,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    %rcx,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
movsd  -0x18(%rbp),%xmm0
mov    -0x1c(%rbp),%edx
mov    -0x28(%rbp),%rcx
call   1030 <exit_syscall_process@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<syscall_exit_process>:
jmp    1030 <exit_syscall_process@plt>

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

LLVM IR (-O2):
define void @syscall_exit_process(i8* %0, i32 %1, double %2, i32 %3, i8* %4) {
%6 = tail call i32 @exit_syscall_process(i8* %0, i32 %1, double %2, i32 %3, i8* %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isodigit(int);
void t_isodigit_0xdd() {
  Assert_real((isodigit(221) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isodigit.c",
              1110, ("isodigit should be 0 for 0xdd"));
}


x86 assembly (clang, -O0):
<t_isodigit_0xdd>:
push   %rbp
mov    %rsp,%rbp
mov    $0xdd,%edi
call   1040 <isodigit@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x456,%edx
lea    0xf5c(%rip),%rcx
call   1030 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isodigit_0xdd>:
push   %rax
mov    $0xdd,%edi
call   1040 <isodigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x456,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isodigit.c\00"
@.str.1 = [30 x i8] c"isodigit should be 0 for 0xdd\00"
define void @t_isodigit_0xdd() {
%1 = call i64 @isodigit(i32 221)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 1110, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isodigit.c\00"
@.str.1 = [30 x i8] c"isodigit should be 0 for 0xdd\00"
define void @t_isodigit_0xdd() {
%1 = tail call i64 @isodigit(i32 221)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 1110, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ shared_printf(char *, int, char *, char, int, char);
void print_philosopher(int n, char left, char right) {
  int i;
  shared_printf("%*s%c %d %c\n", (n * 4) + 2, "", left, n, right);
}


x86 assembly (clang, -O0):
<print_philosopher>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dl,%al
mov    %sil,%cl
mov    %edi,-0x4(%rbp)
mov    %cl,-0x5(%rbp)
mov    %al,-0x6(%rbp)
mov    -0x4(%rbp),%esi
shl    $0x2,%esi
add    $0x2,%esi
mov    -0x5(%rbp),%al
mov    -0x4(%rbp),%r8d
lea    0xec3(%rip),%rdi
lea    0xec8(%rip),%rdx
movsbl %al,%ecx
movsbl -0x6(%rbp),%r9d
call   1030 <shared_printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_philosopher>:
mov    %edx,%r9d
mov    %esi,%ecx
mov    %edi,%r8d
lea    0x2(,%r8,4),%esi
lea    0xed9(%rip),%rdi
lea    0xede(%rip),%rdx
jmp    1030 <shared_printf@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"%*s%c %d %c\0A\00"
@.str.1 = [1 x i8] zeroinitializer
define void @print_philosopher(i32 %0, i8 signext %1, i8 signext %2) {
%4 = alloca i32
%5 = alloca i8
%6 = alloca i8
%7 = alloca i32
store i32 %0, i32* %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%8 = load i32, i32* %4
%9 = mul nsw i32 %8, 4
%10 = add nsw i32 %9, 2
%11 = load i8, i8* %5
%12 = load i32, i32* %4
%13 = load i8, i8* %6
%14 = call i32 @shared_printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %10, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8 signext %11, i32 %12, i8 signext %13)
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"%*s%c %d %c\0A\00"
@.str.1 = [1 x i8] zeroinitializer
define void @print_philosopher(i32 %0, i8 signext %1, i8 signext %2) {
%4 = shl nsw i32 %0, 2
%5 = or i32 %4, 2
%6 = tail call i32 @shared_printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %5, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8 signext %1, i32 %0, i8 signext %2)
ret void
}
/* Variables and functions */
int partition(int *, int, int);
void quick_sort(int arr[], int l, int r) {
  int p;
  if (l < r) {
    p = partition(arr, l, r);
    quick_sort(arr, l, p - 1);
    quick_sort(arr, p + 1, r);
  }
}


x86 assembly (clang, -O0):
<quick_sort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1174 <quick_sort+0x54>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <partition@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
sub    $0x1,%edx
call   1040 <quick_sort@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%edx
call   1040 <quick_sort@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quick_sort>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
cmp    %edx,%esi
jge    1166 <quick_sort+0x46>
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,%r15
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r15,%rdi
mov    %ebp,%esi
mov    %r14d,%edx
call   1030 <partition@plt>
mov    %eax,%ebx
lea    -0x1(%rbx),%edx
mov    %r15,%rdi
mov    %ebp,%esi
call   1040 <quick_sort@plt>
add    $0x1,%ebx
mov    %ebx,%ebp
cmp    %r14d,%ebx
jl     1140 <quick_sort+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @quick_sort(i32* %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %2
br i1 %4, label %5, label %11
5: ; preds = %3, %5
%6 = phi i32 [ %9, %5 ], [ %1, %3 ]
%7 = tail call i32 @partition(i32* %0, i32 %6, i32 %2)
%8 = add nsw i32 %7, -1
tail call void @quick_sort(i32* %0, i32 %6, i32 %8)
%9 = add nsw i32 %7, 1
%10 = icmp slt i32 %9, %2
br i1 %10, label %5, label %11
11: ; preds = %5, %3
ret void
}
int GetQMIMessageID(void *pQMIMessage, unsigned short messageLen) {
  if (messageLen < 2) {
    return -61;
  } else {
    return *(unsigned short *)pQMIMessage;
  }
}


x86 assembly (clang, -O0):
<GetQMIMessageID>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %rdi,-0x10(%rbp)
mov    %ax,-0x12(%rbp)
movzwl -0x12(%rbp),%eax
cmp    $0x2,%eax
jge    1128 <GetQMIMessageID+0x28>
movl   $0xffffffc3,-0x4(%rbp)
jmp    1132 <GetQMIMessageID+0x32>
mov    -0x10(%rbp),%rax
movzwl (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetQMIMessageID>:
mov    $0xffffffc3,%eax
cmp    $0x2,%si
jb     110e <GetQMIMessageID+0xe>
movzwl (%rdi),%eax
ret

LLVM IR (-O0):
define i32 @GetQMIMessageID(i8* %0, i16 zeroext %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i16
store i8* %0, i8** %4
store i16 %1, i16* %5
%6 = load i16, i16* %5
%7 = zext i16 %6 to i32
%8 = icmp slt i32 %7, 2
br i1 %8, label %9, label %10
9: ; preds = %2
store i32 -61, i32* %3
br label %15
10: ; preds = %2
%11 = load i8*, i8** %4
%12 = bitcast i8* %11 to i16*
%13 = load i16, i16* %12
%14 = zext i16 %13 to i32
store i32 %14, i32* %3
br label %15
15: ; preds = %10, %9
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
define i32 @GetQMIMessageID(i8* nocapture %0, i16 zeroext %1) {
%3 = icmp ult i16 %1, 2
br i1 %3, label %8, label %4
4: ; preds = %2
%5 = bitcast i8* %0 to i16*
%6 = load i16, i16* %5
%7 = zext i16 %6 to i32
br label %8
8: ; preds = %2, %4
%9 = phi i32 [ %7, %4 ], [ -61, %2 ]
ret i32 %9
}
/* Variables and functions */
double arccot(double);
double aoffcot(double n, int offset) {
  return arccot(n) + 2 * 3.14159265358979323846 * offset;
}


x86 assembly (clang, -O0):
<aoffcot>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <arccot@plt>
movaps %xmm0,%xmm1
cvtsi2sdl -0xc(%rbp),%xmm0
movsd  0xec6(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<aoffcot>:
push   %rbx
mov    %edi,%ebx
call   1030 <arccot@plt>
cvtsi2sd %ebx,%xmm1
mulsd  0xedc(%rip),%xmm1
addsd  %xmm1,%xmm0
pop    %rbx
ret

LLVM IR (-O0):
define double @aoffcot(double %0, i32 %1) {
%3 = alloca double
%4 = alloca i32
store double %0, double* %3
store i32 %1, i32* %4
%5 = load double, double* %3
%6 = call double @arccot(double %5)
%7 = load i32, i32* %4
%8 = sitofp i32 %7 to double
%9 = call double @llvm.fmuladd.f64(double 0x401921FB54442D18, double %8, double %6)
ret double %9
}

LLVM IR (-O2):
define double @aoffcot(double %0, i32 %1) {
%3 = tail call double @arccot(double %0)
%4 = sitofp i32 %1 to double
%5 = tail call double @llvm.fmuladd.f64(double %4, double 0x401921FB54442D18, double %3)
ret double %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double, double);
int /*<<< orphan*/ scanf(char *, double *);
int main(void) {
  double num;
  scanf("%lf", &num);
  printf("a. The input is %.1f or %.1e\n", num, num);
  printf("b. The input is %+.3f or %.3E\n", num, num);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
movsd  -0x10(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
movsd  -0x10(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
mov    %rsp,%rsi
call   1040 <scanf@plt>
movsd  (%rsp),%xmm0
lea    0xec8(%rip),%rdi
movaps %xmm0,%xmm1
call   1030 <printf@plt>
movsd  (%rsp),%xmm0
lea    0xed2(%rip),%rdi
movaps %xmm0,%xmm1
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%lf\00"
@.str.1 = [30 x i8] c"a. The input is %.1f or %.1e\0A\00"
@.str.2 = [31 x i8] c"b. The input is %+.3f or %.3E\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
store i32 0, i32* %1
%3 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %2)
%4 = load double, double* %2
%5 = load double, double* %2
%6 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), double %4, double %5)
%7 = load double, double* %2
%8 = load double, double* %2
%9 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0), double %7, double %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%lf\00"
@.str.1 = [30 x i8] c"a. The input is %.1f or %.1e\0A\00"
@.str.2 = [31 x i8] c"b. The input is %+.3f or %.3E\0A\00"
define i32 @main() {
%1 = alloca double
%2 = bitcast double* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %1)
%4 = load double, double* %1
%5 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), double %4, double %4)
%6 = load double, double* %1
%7 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0), double %6, double %6)
ret i32 0
}
void elv_add_request(struct request_queue *x, struct request *y, int z, int u) {
  return;
}


x86 assembly (clang, -O0):
<elv_add_request>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.request_queue = type opaque
%struct.request = type opaque
define void @elv_add_request(%struct.request_queue* %0, %struct.request* %1, i32 %2, i32 %3) {
%5 = alloca %struct.request_queue*
%6 = alloca %struct.request*
%7 = alloca i32
%8 = alloca i32
store %struct.request_queue* %0, %struct.request_queue** %5
store %struct.request* %1, %struct.request** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
ret void
}

LLVM IR (-O2):
%struct.request_queue = type opaque
%struct.request = type opaque
define void @elv_add_request(%struct.request_queue* nocapture %0, %struct.request* nocapture %1, i32 %2, i32 %3) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ outb(int, int);
void timer_phase(int hz) {
  int divisor = 1193180 / hz;
  outb(0x43, 0x36);
  outb(0x40, divisor & 0xFF);
  outb(0x40, divisor >> 8);
}


x86 assembly (clang, -O0):
<timer_phase>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x1234dc,%eax
cltd
idivl  -0x4(%rbp)
mov    %eax,-0x8(%rbp)
mov    $0x43,%edi
mov    $0x36,%esi
call   1030 <outb@plt>
mov    -0x8(%rbp),%esi
and    $0xff,%esi
mov    $0x40,%edi
call   1030 <outb@plt>
mov    -0x8(%rbp),%esi
sar    $0x8,%esi
mov    $0x40,%edi
call   1030 <outb@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<timer_phase>:
push   %rbx
mov    $0x1234dc,%eax
xor    %edx,%edx
idiv   %edi
mov    %eax,%ebx
mov    $0x43,%edi
mov    $0x36,%esi
call   1030 <outb@plt>
movzbl %bl,%esi
mov    $0x40,%edi
call   1030 <outb@plt>
sar    $0x8,%ebx
mov    $0x40,%edi
mov    %ebx,%esi
pop    %rbx
jmp    1030 <outb@plt>

LLVM IR (-O0):
define void @timer_phase(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sdiv i32 1193180, %4
store i32 %5, i32* %3
%6 = call i32 @outb(i32 67, i32 54)
%7 = load i32, i32* %3
%8 = and i32 %7, 255
%9 = call i32 @outb(i32 64, i32 %8)
%10 = load i32, i32* %3
%11 = ashr i32 %10, 8
%12 = call i32 @outb(i32 64, i32 %11)
ret void
}

LLVM IR (-O2):
define void @timer_phase(i32 %0) {
%2 = sdiv i32 1193180, %0
%3 = tail call i32 @outb(i32 67, i32 54)
%4 = and i32 %2, 255
%5 = tail call i32 @outb(i32 64, i32 %4)
%6 = ashr i32 %2, 8
%7 = tail call i32 @outb(i32 64, i32 %6)
ret void
}
readline(n) { return (readock(n, 1)); }


x86 assembly (clang, -O0):
<readline>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x1,%esi
mov    $0x0,%al
call   1030 <readock@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readline>:
mov    $0x1,%esi
xor    %eax,%eax
jmp    1030 <readock@plt>

LLVM IR (-O0):
define i32 @readline(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 (i32, i32, ...) bitcast (i32 (...)* @readock to i32 (i32, i32, ...)*)(i32 %3, i32 1)
ret i32 %4
}

LLVM IR (-O2):
define i32 @readline(i32 %0) {
%2 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @readock to i32 (i32, i32, ...)*)(i32 %0, i32 1)
ret i32 %2
}
/* Variables and functions */
int sqrt(int);
bool isPrime(int n) {
  for (int i = 2; i < sqrt(n); i++) {
    if (n % i == 0) {
      return false;
    }
  }
  return true;
}


x86 assembly (clang, -O0):
<isPrime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <sqrt@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
cmp    %ecx,%eax
jge    116c <isPrime+0x5c>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    1159 <isPrime+0x49>
movl   $0x0,-0x4(%rbp)
jmp    1173 <isPrime+0x63>
jmp    115e <isPrime+0x4e>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1122 <isPrime+0x12>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isPrime>:
push   %rbp
push   %r14
push   %rbx
mov    %edi,%ebp
call   1030 <sqrt@plt>
mov    $0x1,%r14d
cmp    $0x3,%eax
jl     114c <isPrime+0x3c>
mov    $0x2,%ebx
nopl   0x0(%rax,%rax,1)
mov    %ebp,%eax
cltd
idiv   %ebx
test   %edx,%edx
je     1149 <isPrime+0x39>
add    $0x1,%ebx
mov    %ebp,%edi
call   1030 <sqrt@plt>
cmp    %eax,%ebx
jl     1130 <isPrime+0x20>
jmp    114c <isPrime+0x3c>
xor    %r14d,%r14d
mov    %r14d,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @isPrime(i32 %0) {
%2 = tail call i32 @sqrt(i32 %0)
%3 = icmp sgt i32 %2, 2
br i1 %3, label %7, label %12
4: ; preds = %7
%5 = tail call i32 @sqrt(i32 %0)
%6 = icmp slt i32 %11, %5
br i1 %6, label %7, label %12
7: ; preds = %1, %4
%8 = phi i32 [ %11, %4 ], [ 2, %1 ]
%9 = srem i32 %0, %8
%10 = icmp eq i32 %9, 0
%11 = add nuw nsw i32 %8, 1
br i1 %10, label %12, label %4
12: ; preds = %4, %7, %1
%13 = phi i32 [ 1, %1 ], [ 0, %7 ], [ 1, %4 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ sfmt_lrand64();
double sfmt_to_res53(int /*<<< orphan*/);
double sfmt_drand64() { return sfmt_to_res53(sfmt_lrand64()); }


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

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

LLVM IR (-O0):
define double @sfmt_drand64() {
%1 = call i32 (...) @sfmt_lrand64()
%2 = call double @sfmt_to_res53(i32 %1)
ret double %2
}

LLVM IR (-O2):
define double @sfmt_drand64() {
%1 = tail call i32 (...) @sfmt_lrand64()
%2 = tail call double @sfmt_to_res53(i32 %1)
ret double %2
}
/* Type definitions */
struct libavl_allocator {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ free(void *);
void prb_free(struct libavl_allocator *allocator, void *block) {
  assert(allocator != NULL && block != NULL);
  free(block);
}


x86 assembly (clang, -O0):
<prb_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0x11(%rbp)
je     114b <prb_free+0x2b>
cmpq   $0x0,-0x10(%rbp)
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<prb_free>:
push   %rbx
mov    %rsi,%rbx
test   %rdi,%rdi
setne  %al
test   %rsi,%rsi
setne  %cl
and    %al,%cl
movzbl %cl,%edi
call   1040 <assert@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.libavl_allocator = type { i32 }
define void @prb_free(%struct.libavl_allocator* %0, i8* %1) {
%3 = alloca %struct.libavl_allocator*
%4 = alloca i8*
store %struct.libavl_allocator* %0, %struct.libavl_allocator** %3
store i8* %1, i8** %4
%5 = load %struct.libavl_allocator*, %struct.libavl_allocator** %3
%6 = icmp ne %struct.libavl_allocator* %5, null
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i8*, i8** %4
%9 = icmp ne i8* %8, null
br label %10
10: ; preds = %7, %2
%11 = phi i1 [ false, %2 ], [ %9, %7 ]
%12 = zext i1 %11 to i32
%13 = call i32 @assert(i32 %12)
%14 = load i8*, i8** %4
%15 = call i32 @free(i8* %14)
ret void
}

LLVM IR (-O2):
%struct.libavl_allocator = type { i32 }
define void @prb_free(%struct.libavl_allocator* readnone %0, i8* %1) {
%3 = icmp ne %struct.libavl_allocator* %0, null
%4 = icmp ne i8* %1, null
%5 = and i1 %3, %4
%6 = zext i1 %5 to i32
%7 = tail call i32 @assert(i32 %6)
%8 = tail call i32 @free(i8* %1)
ret void
}
/* Variables and functions */
int write(int, char const *, int);
int serial_write(int port, const char *buffer, int bytesToWrite) {
  return (write(port, buffer, bytesToWrite));
}


x86 assembly (clang, -O0):
<serial_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <write@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<serial_write>:
jmp    1030 <write@plt>

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

LLVM IR (-O2):
define i32 @serial_write(i32 %0, i8* nocapture %1, i32 %2) {
%4 = tail call i32 @write(i32 %0, i8* %1, i32 %2)
ret i32 %4
}
void swap(double *this, double *that) {
  double tmp;
  tmp = *this;
  *this = *that;
  *that = tmp;
}


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

x86 assembly (clang, -O2):
<swap>:
movsd  (%rdi),%xmm0
movsd  (%rsi),%xmm1
movsd  %xmm1,(%rdi)
movsd  %xmm0,(%rsi)
ret

LLVM IR (-O0):
define void @swap(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* %6
store double %7, double* %5
%8 = load double*, double** %4
%9 = load double, double* %8
%10 = load double*, double** %3
store double %9, double* %10
%11 = load double, double* %5
%12 = load double*, double** %4
store double %11, double* %12
ret void
}

LLVM IR (-O2):
define void @swap(double* nocapture %0, double* nocapture %1) {
%3 = load double, double* %0
%4 = load double, double* %1
store double %4, double* %0
store double %3, double* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _Exit(int);
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
void exit(int status) {
  fputs("WARNING: Please call `quick_exit()` to terminate the process.\n"
        "         Thorough cleanup is not feasible.\n",
        stderr);
  fflush(0);
  _Exit(status);
}


x86 assembly (clang, -O0):
<exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2e9e(%rip),%rax
mov    (%rax),%esi
lea    0xeb5(%rip),%rdi
call   1030 <fputs@plt>
xor    %edi,%edi
call   1040 <fflush@plt>
mov    -0x4(%rbp),%edi
call   1050 <_Exit@plt>

x86 assembly (clang, -O2):
<exit>:
push   %rbx
mov    %edi,%ebx
mov    0x2ea6(%rip),%rax
mov    (%rax),%esi
lea    0xebd(%rip),%rdi
call   1030 <fputs@plt>
xor    %edi,%edi
call   1040 <fflush@plt>
mov    %ebx,%edi
call   1050 <_Exit@plt>

LLVM IR (-O0):
@.str = [106 x i8] c"WARNING: Please call `quick_exit()` to terminate the process.\0A Thorough cleanup is not feasible.\0A\00"
@stderr = global i32 0
define void @exit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @stderr
%4 = call i32 @fputs(i8* getelementptr inbounds ([106 x i8], [106 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = call i32 @fflush(i32 0)
%6 = load i32, i32* %2
%7 = call i32 @_Exit(i32 %6)
unreachable
}

LLVM IR (-O2):
@.str = [106 x i8] c"WARNING: Please call `quick_exit()` to terminate the process.\0A Thorough cleanup is not feasible.\0A\00"
@stderr = global i32 0
define void @exit(i32 %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fputs(i8* getelementptr inbounds ([106 x i8], [106 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = tail call i32 @fflush(i32 0)
%5 = tail call i32 @_Exit(i32 %0)
unreachable
}
int mu_strlen(char const *str) {
  int len = 0;
  while (*str++)
    len++;
  return len;
}


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

x86 assembly (clang, -O2):
<mu_strlen>:
cmpb   $0x0,(%rdi)
je     111c <mu_strlen+0x1c>
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <mu_strlen+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @mu_strlen(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %8, %4 ], [ 0, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = add nuw nsw i32 %5, 1
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i32 [ 0, %1 ], [ %8, %4 ]
ret i32 %12
}
void destroyNodeArrays(double **node_array, int size) {
  int i;
  for (i = 0; i < size; i++) {
    free(node_array[i]);
  }
  free(node_array);
}


x86 assembly (clang, -O0):
<destroyNodeArrays>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1151 <destroyNodeArrays+0x41>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <destroyNodeArrays+0x16>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<destroyNodeArrays>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
test   %esi,%esi
jle    1142 <destroyNodeArrays+0x32>
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <destroyNodeArrays+0x20>
mov    %r14,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @destroyNodeArrays(double** nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds double*, double** %0, i64 %7
%9 = bitcast double** %8 to i8**
%10 = load i8*, i8** %9
tail call void @free(i8* %10)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
%14 = bitcast double** %0 to i8*
tail call void @free(i8* %14)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ intmax_t;

/* Variables and functions */
intmax_t imaxabs(intmax_t j) { return (j < 0 ? -j : j); }


x86 assembly (clang, -O0):
<imaxabs>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    111e <imaxabs+0x1e>
xor    %eax,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1124 <imaxabs+0x24>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<imaxabs>:
mov    %edi,%eax
neg    %eax
cmovs  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @imaxabs(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
ret i32 %2
}
unsigned long int mod_rhs(const long int rhs) {
  if (rhs == 0)
    return 1;
  return rhs;
}


x86 assembly (clang, -O0):
<mod_rhs>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1120 <mod_rhs+0x20>
movq   $0x1,-0x8(%rbp)
jmp    1128 <mod_rhs+0x28>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mod_rhs>:
test   %rdi,%rdi
mov    $0x1,%eax
cmovne %rdi,%rax
ret

LLVM IR (-O0):
define i64 @mod_rhs(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %3
%4 = load i64, i64* %3
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
store i64 1, i64* %2
br label %9
7: ; preds = %1
%8 = load i64, i64* %3
store i64 %8, i64* %2
br label %9
9: ; preds = %7, %6
%10 = load i64, i64* %2
ret i64 %10
}

LLVM IR (-O2):
define i64 @mod_rhs(i64 %0) {
%2 = icmp eq i64 %0, 0
%3 = select i1 %2, i64 1, i64 %0
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ outb(long, int);
int /*<<< orphan*/ outl(long, int);
void cbstore(long cfgadr, long value) {
  outl((cfgadr | 0x80000000) & ~3, 0xcf8);
  outb(value, 0xcfc + (cfgadr & 3));
}


x86 assembly (clang, -O0):
<cbstore>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movabs $0x80000000,%rdi
or     -0x8(%rbp),%rdi
and    $0xfffffffffffffffc,%rdi
mov    $0xcf8,%esi
call   1040 <outl@plt>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rax
and    $0x3,%rax
add    $0xcfc,%rax
mov    %eax,%esi
call   1030 <outb@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cbstore>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
movabs $0xffffffff7ffffffc,%rax
ff ff ff
and    %rdi,%rax
mov    $0x80000000,%edi
or     %rax,%rdi
mov    $0xcf8,%esi
call   1040 <outl@plt>
or     $0xcfc,%ebx
and    $0xcff,%ebx
mov    %r14,%rdi
mov    %ebx,%esi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <outb@plt>

LLVM IR (-O0):
define void @cbstore(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 = or i64 %5, 2147483648
%7 = and i64 %6, -4
%8 = call i32 @outl(i64 %7, i32 3320)
%9 = load i64, i64* %4
%10 = load i64, i64* %3
%11 = and i64 %10, 3
%12 = add nsw i64 3324, %11
%13 = trunc i64 %12 to i32
%14 = call i32 @outb(i64 %9, i32 %13)
ret void
}

LLVM IR (-O2):
define void @cbstore(i64 %0, i64 %1) {
%3 = and i64 %0, -2147483652
%4 = or i64 %3, 2147483648
%5 = tail call i32 @outl(i64 %4, i32 3320)
%6 = trunc i64 %0 to i32
%7 = and i32 %6, 3
%8 = or i32 %7, 3324
%9 = tail call i32 @outb(i64 %1, i32 %8)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __WFI();
void PWR_Sleep(void) { __WFI(); }


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

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

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

LLVM IR (-O2):
define void @PWR_Sleep() {
%1 = tail call i32 (...) @__WFI()
ret void
}
void __attribute__((format(printf, 1, 2)))
___mark_check_format(const char *fmt, ...) {}


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

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

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

LLVM IR (-O2):
define void @___mark_check_format(i8* nocapture %0, ...) {
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
uint32_t posix_getpid() {
  printf(" .... Hello from getpid()\n");
  return 0xdeadbeef;
}


x86 assembly (clang, -O0):
<posix_getpid>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
mov    $0xdeadbeef,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<posix_getpid>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
mov    $0xdeadbeef,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [27 x i8] c" .... Hello from getpid()\0A\00"
define i32 @posix_getpid() {
%1 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
ret i32 -559038737
}

LLVM IR (-O2):
@str = [26 x i8] c" .... Hello from getpid()\00"
define i32 @posix_getpid() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
ret i32 -559038737
}
void X509_ATTRIBUTE_set1_data(void) {}


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

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

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

LLVM IR (-O2):
define void @X509_ATTRIBUTE_set1_data() {
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void swap_byte_order_32(uint32_t *val) {
  *val = (*val >> 24) | ((*val << 8) & 0x00FF0000) |
         ((*val >> 8) & 0x0000FF00) | (*val << 24);
}


x86 assembly (clang, -O0):
<swap_byte_order_32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
sar    $0x18,%ecx
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
shl    $0x8,%eax
and    $0xff0000,%eax
or     %eax,%ecx
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
sar    $0x8,%eax
and    $0xff00,%eax
or     %eax,%ecx
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
shl    $0x18,%eax
or     %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap_byte_order_32>:
mov    (%rdi),%eax
mov    %eax,%ecx
sar    $0x18,%ecx
mov    %eax,%edx
shl    $0x8,%edx
and    $0xff0000,%edx
mov    %eax,%esi
shr    $0x8,%esi
and    $0xff00,%esi
shl    $0x18,%eax
or     %ecx,%eax
or     %edx,%eax
or     %esi,%eax
mov    %eax,(%rdi)
ret

LLVM IR (-O0):
define void @swap_byte_order_32(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = ashr i32 %4, 24
%6 = load i32*, i32** %2
%7 = load i32, i32* %6
%8 = shl i32 %7, 8
%9 = and i32 %8, 16711680
%10 = or i32 %5, %9
%11 = load i32*, i32** %2
%12 = load i32, i32* %11
%13 = ashr i32 %12, 8
%14 = and i32 %13, 65280
%15 = or i32 %10, %14
%16 = load i32*, i32** %2
%17 = load i32, i32* %16
%18 = shl i32 %17, 24
%19 = or i32 %15, %18
%20 = load i32*, i32** %2
store i32 %19, i32* %20
ret void
}

LLVM IR (-O2):
define void @swap_byte_order_32(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = ashr i32 %2, 24
%4 = shl i32 %2, 8
%5 = and i32 %4, 16711680
%6 = lshr i32 %2, 8
%7 = and i32 %6, 65280
%8 = shl i32 %2, 24
%9 = or i32 %8, %3
%10 = or i32 %9, %5
%11 = or i32 %10, %7
store i32 %11, i32* %0
ret void
}