xunge/DecIR huggingface dataset:
int simple_cmp_keys(void *k1, void *k2) {
  if (k1 == k2)
    return 0;
  else if (k1 < k2)
    return 1;
  else
    return -1;
}


x86 assembly (clang, -O0):
<simple_cmp_keys>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jne    1126 <simple_cmp_keys+0x26>
movl   $0x0,-0x4(%rbp)
jmp    1147 <simple_cmp_keys+0x47>
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jae    1140 <simple_cmp_keys+0x40>
movl   $0x1,-0x4(%rbp)
jmp    1147 <simple_cmp_keys+0x47>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<simple_cmp_keys>:
xor    %ecx,%ecx
xor    %eax,%eax
cmp    %rsi,%rdi
setb   %al
lea    -0x1(%rax,%rax,1),%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @simple_cmp_keys(i8* readnone %0, i8* readnone %1) {
%3 = icmp eq i8* %0, %1
%4 = icmp ult i8* %0, %1
%5 = select i1 %4, i32 1, i32 -1
%6 = select i1 %3, i32 0, i32 %5
ret i32 %6
}
void gtk_cell_renderer_toggle_get_radio() {}


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

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

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

LLVM IR (-O2):
define void @gtk_cell_renderer_toggle_get_radio() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ CATCH_EINTR(int);
int /*<<< orphan*/ FD_CLOEXEC;
int /*<<< orphan*/ F_SETFD;
int errno;
int fcntl(int, int /*<<< orphan*/, int /*<<< orphan*/);
int os_set_exec_close(int fd) {
  int err;
  CATCH_EINTR(err = fcntl(fd, F_SETFD, FD_CLOEXEC));
  if (err < 0)
    return -errno;
  return err;
}


x86 assembly (clang, -O0):
<os_set_exec_close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    0x2eab(%rip),%rax
mov    (%rax),%esi
mov    0x2e9a(%rip),%rax
mov    (%rax),%edx
call   1030 <fcntl@plt>
mov    %eax,%edi
mov    %edi,-0xc(%rbp)
call   1040 <CATCH_EINTR@plt>
cmpl   $0x0,-0xc(%rbp)
jge    116c <os_set_exec_close+0x4c>
xor    %eax,%eax
mov    0x2e6e(%rip),%rcx
sub    (%rcx),%eax
mov    %eax,-0x4(%rbp)
jmp    1172 <os_set_exec_close+0x52>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<os_set_exec_close>:
push   %rbx
mov    0x2eb8(%rip),%rax
mov    (%rax),%esi
mov    0x2ea7(%rip),%rax
mov    (%rax),%edx
call   1030 <fcntl@plt>
mov    %eax,%ebx
mov    %eax,%edi
call   1040 <CATCH_EINTR@plt>
mov    0x2e88(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
test   %ebx,%ebx
cmovns %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@F_SETFD = global i32 0
@FD_CLOEXEC = global i32 0
@errno = global i32 0
define i32 @os_set_exec_close(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = load i32, i32* @F_SETFD
%7 = load i32, i32* @FD_CLOEXEC
%8 = call i32 @fcntl(i32 %5, i32 %6, i32 %7)
store i32 %8, i32* %4
%9 = call i32 @CATCH_EINTR(i32 %8)
%10 = load i32, i32* %4
%11 = icmp slt i32 %10, 0
br i1 %11, label %12, label %15
12: ; preds = %1
%13 = load i32, i32* @errno
%14 = sub nsw i32 0, %13
store i32 %14, i32* %2
br label %17
15: ; preds = %1
%16 = load i32, i32* %4
store i32 %16, i32* %2
br label %17
17: ; preds = %15, %12
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
@F_SETFD = global i32 0
@FD_CLOEXEC = global i32 0
@errno = global i32 0
define i32 @os_set_exec_close(i32 %0) {
%2 = load i32, i32* @F_SETFD
%3 = load i32, i32* @FD_CLOEXEC
%4 = tail call i32 @fcntl(i32 %0, i32 %2, i32 %3)
%5 = tail call i32 @CATCH_EINTR(i32 %4)
%6 = icmp slt i32 %4, 0
%7 = load i32, i32* @errno
%8 = sub nsw i32 0, %7
%9 = select i1 %6, i32 %8, i32 %4
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ free(int /*<<< orphan*/);
int /*<<< orphan*/ readline();
void comment(void) { free(readline()); }


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

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

LLVM IR (-O0):
define void @comment() {
%1 = call i32 (...) @readline()
%2 = call i32 @free(i32 %1)
ret void
}

LLVM IR (-O2):
define void @comment() {
%1 = tail call i32 (...) @readline()
%2 = tail call i32 @free(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void print_array(int *p, int n) {
  int i;
  for (i = 0; i < n; ++i)
    printf("%d\n", p[i]);
}


x86 assembly (clang, -O0):
<print_array>:
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    1157 <print_array+0x47>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <print_array+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_array>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1145 <print_array+0x35>
mov    %rdi,%r15
mov    %esi,%r12d
xor    %ebx,%ebx
lea    0xed5(%rip),%r14
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <print_array+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define void @print_array(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %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 i32*, i32** %3
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i32, i32* %11, i64 %13
%15 = load i32, i32* %14
%16 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %15)
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
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @print_array(i32* 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 i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret void
}
void print_str(const char *s) {
  const char *bfs;
  bfs = s;
  while (*bfs != '\0')
    print_char(*bfs), ++bfs;
}


x86 assembly (clang, -O0):
<print_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1153 <print_str+0x43>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
mov    $0x0,%al
call   1030 <print_char@plt>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1124 <print_str+0x14>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_str>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1135 <print_str+0x25>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
xor    %eax,%eax
call   1030 <print_char@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <print_str+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @print_str(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %10, %4 ], [ %2, %1 ]
%6 = phi i8* [ %9, %4 ], [ %0, %1 ]
%7 = sext i8 %5 to i32
%8 = tail call i32 (i32, ...) bitcast (i32 (...)* @print_char to i32 (i32, ...)*)(i32 %7)
%9 = getelementptr inbounds i8, i8* %6, i64 1
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
/* Variables and functions */
int rom_present(char *);
int xtide_at_ps2_available(void) {
  return (rom_present(L"roms/hdd/xtide/ide_at_1_1_5.bin"));
}


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

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

LLVM IR (-O0):
@.str = [32 x i32] [i32 114, i32 111, i32 109, i32 115, i32 47, i32 104, i32 100, i32 100, i32 47, i32 120, i32 116, i32 105, i32 100, i32 101, i32 47, i32 105, i32 100, i32 101, i32 95, i32 97, i32 116, i32 95, i32 49, i32 95, i32 49, i32 95, i32 53, i32 46, i32 98, i32 105, i32 110, i32 0]
define i32 @xtide_at_ps2_available() {
%1 = call i32 @rom_present(i8* bitcast ([32 x i32]* @.str to i8*))
ret i32 %1
}

LLVM IR (-O2):
@.str = [32 x i32] [i32 114, i32 111, i32 109, i32 115, i32 47, i32 104, i32 100, i32 100, i32 47, i32 120, i32 116, i32 105, i32 100, i32 101, i32 47, i32 105, i32 100, i32 101, i32 95, i32 97, i32 116, i32 95, i32 49, i32 95, i32 49, i32 95, i32 53, i32 46, i32 98, i32 105, i32 110, i32 0]
define i32 @xtide_at_ps2_available() {
%1 = tail call i32 @rom_present(i8* bitcast ([32 x i32]* @.str to i8*))
ret i32 %1
}
/* Variables and functions */
int f213(int *);
int f214(int *p) { return f213(p); }


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

x86 assembly (clang, -O2):
<f214>:
jmp    1030 <f213@plt>

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

LLVM IR (-O2):
define i32 @f214(i32* %0) {
%2 = tail call i32 @f213(i32* %0)
ret i32 %2
}
void fn06D4() { return; }


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

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

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

LLVM IR (-O2):
define void @fn06D4() {
ret void
}
int lisys_dir_filter_hidden(const char *dir, const char *name, void *data) {
  if (name[0] == '.')
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<lisys_dir_filter_hidden>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2e,%eax
jne    112c <lisys_dir_filter_hidden+0x2c>
movl   $0x1,-0x4(%rbp)
jmp    1133 <lisys_dir_filter_hidden+0x33>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lisys_dir_filter_hidden>:
xor    %eax,%eax
cmpb   $0x2e,(%rsi)
sete   %al
ret

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

LLVM IR (-O2):
define i32 @lisys_dir_filter_hidden(i8* nocapture readnone %0, i8* nocapture %1, i8* nocapture readnone %2) {
%4 = load i8, i8* %1
%5 = icmp eq i8 %4, 46
%6 = zext i1 %5 to i32
ret i32 %6
}
__typeof__(tolower(1)) test_tolower_73(void) { return tolower(1); }


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

x86 assembly (clang, -O2):
<test_tolower_73>:
mov    $0x1,%edi
jmp    1030 <tolower@plt>

LLVM IR (-O0):
define i32 @test_tolower_73() {
%1 = call i32 @tolower(i32 1)
ret i32 %1
}

LLVM IR (-O2):
define i32 @test_tolower_73() {
%1 = tail call i32 @tolower(i32 1)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ SUB_HOST_REG_W(int, int);
int /*<<< orphan*/ addbyte(int);
int CMP_HOST_REG_W(int dst_reg, int src_reg) {
  if (dst_reg & 8) {
    addbyte(0x44);
    addbyte(0x89);
    addbyte(0xc0 | ((dst_reg & 7) << 3) | 2);
    dst_reg = 2;
  }
  SUB_HOST_REG_W(dst_reg, src_reg);
  return dst_reg;
}


x86 assembly (clang, -O0):
<CMP_HOST_REG_W>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0x8,%eax
cmp    $0x0,%eax
je     116f <CMP_HOST_REG_W+0x4f>
mov    $0x44,%edi
call   1030 <addbyte@plt>
mov    $0x89,%edi
call   1030 <addbyte@plt>
mov    -0x4(%rbp),%edi
and    $0x7,%edi
shl    $0x3,%edi
or     $0xc0,%edi
or     $0x2,%edi
call   1030 <addbyte@plt>
movl   $0x2,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1040 <SUB_HOST_REG_W@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CMP_HOST_REG_W>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
test   $0x8,%bpl
je     1158 <CMP_HOST_REG_W+0x38>
mov    $0x44,%edi
call   1030 <addbyte@plt>
mov    $0x89,%edi
call   1030 <addbyte@plt>
shl    $0x3,%ebp
or     $0xc2,%ebp
movzbl %bpl,%edi
call   1030 <addbyte@plt>
mov    $0x2,%ebp
mov    %ebp,%edi
mov    %ebx,%esi
call   1040 <SUB_HOST_REG_W@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @CMP_HOST_REG_W(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 = and i32 %5, 8
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %17
8: ; preds = %2
%9 = call i32 @addbyte(i32 68)
%10 = call i32 @addbyte(i32 137)
%11 = load i32, i32* %3
%12 = and i32 %11, 7
%13 = shl i32 %12, 3
%14 = or i32 192, %13
%15 = or i32 %14, 2
%16 = call i32 @addbyte(i32 %15)
store i32 2, i32* %3
br label %17
17: ; preds = %8, %2
%18 = load i32, i32* %3
%19 = load i32, i32* %4
%20 = call i32 @SUB_HOST_REG_W(i32 %18, i32 %19)
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
define i32 @CMP_HOST_REG_W(i32 %0, i32 %1) {
%3 = and i32 %0, 8
%4 = icmp eq i32 %3, 0
br i1 %4, label %12, label %5
5: ; preds = %2
%6 = tail call i32 @addbyte(i32 68)
%7 = tail call i32 @addbyte(i32 137)
%8 = shl i32 %0, 3
%9 = and i32 %8, 56
%10 = or i32 %9, 194
%11 = tail call i32 @addbyte(i32 %10)
br label %12
12: ; preds = %5, %2
%13 = phi i32 [ 2, %5 ], [ %0, %2 ]
%14 = tail call i32 @SUB_HOST_REG_W(i32 %13, i32 %1)
ret i32 %13
}
/* Variables and functions */
scalar_t__ mock(char *);
char *cf_s_uplinks(char *s) { return (char *)mock(s); }


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

x86 assembly (clang, -O2):
<cf_s_uplinks>:
jmp    1030 <mock@plt>

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

LLVM IR (-O2):
define i8* @cf_s_uplinks(i8* %0) {
%2 = tail call i64 @mock(i8* %0)
%3 = inttoptr i64 %2 to i8*
ret i8* %3
}
/* Variables and functions */
int i2c_smbus_write_word_data(int, int, int);
int raspberrypiI2CWriteReg16(int fd, int reg, int data) {
  return i2c_smbus_write_word_data(fd, reg, data);
}


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

x86 assembly (clang, -O2):
<raspberrypiI2CWriteReg16>:
jmp    1030 <i2c_smbus_write_word_data@plt>

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

LLVM IR (-O2):
define i32 @raspberrypiI2CWriteReg16(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @i2c_smbus_write_word_data(i32 %0, i32 %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
int exp(double);
int sin(double);
double ue_eval(double x, double y) { return (7 * exp(x) * sin(y)); }


x86 assembly (clang, -O0):
<ue_eval>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <exp@plt>
imul   $0x7,%eax,%eax
mov    %eax,-0x14(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1030 <sin@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
imul   %ecx,%eax
cvtsi2sd %eax,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ue_eval>:
push   %rbx
sub    $0x10,%rsp
movsd  %xmm1,0x8(%rsp)
call   1040 <exp@plt>
mov    %eax,%ebx
movsd  0x8(%rsp),%xmm0
call   1030 <sin@plt>
imul   %ebx,%eax
lea    0x0(,%rax,8),%ecx
sub    %eax,%ecx
xorps  %xmm0,%xmm0
cvtsi2sd %ecx,%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define double @ue_eval(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = call i32 @exp(double %5)
%7 = mul nsw i32 7, %6
%8 = load double, double* %4
%9 = call i32 @sin(double %8)
%10 = mul nsw i32 %7, %9
%11 = sitofp i32 %10 to double
ret double %11
}

LLVM IR (-O2):
define double @ue_eval(double %0, double %1) {
%3 = tail call i32 @exp(double %0)
%4 = mul nsw i32 %3, 7
%5 = tail call i32 @sin(double %1)
%6 = mul nsw i32 %4, %5
%7 = sitofp i32 %6 to double
ret double %7
}
/* Variables and functions */
int /*<<< orphan*/ tommy_list_sort(void *, void *);
void sort_list(void *ll, void *cmp) { tommy_list_sort(ll, cmp); }


x86 assembly (clang, -O0):
<sort_list>:
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 <tommy_list_sort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sort_list>:
jmp    1030 <tommy_list_sort@plt>

LLVM IR (-O0):
define void @sort_list(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 @tommy_list_sort(i8* %5, i8* %6)
ret void
}

LLVM IR (-O2):
define void @sort_list(i8* %0, i8* %1) {
%3 = tail call i32 @tommy_list_sort(i8* %0, i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ audio_soft_reset();
int /*<<< orphan*/ delay_m(int);
int /*<<< orphan*/ vs_rst(int);
int /*<<< orphan*/ vs_spi_clk_data();
int /*<<< orphan*/ vs_write_reg(int, int);
int audio_reset(void) {
  unsigned short version_id = 0;
  vs_rst(0);
  delay_m(100);
  vs_rst(1);
  delay_m(100);
  audio_soft_reset();
  delay_m(100);
  vs_write_reg((0x03), 0x6000);
  vs_spi_clk_data();
  return version_id;
}


x86 assembly (clang, -O0):
<audio_reset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movw   $0x0,-0x2(%rbp)
xor    %edi,%edi
call   1030 <vs_rst@plt>
mov    $0x64,%edi
call   1050 <delay_m@plt>
mov    $0x1,%edi
call   1030 <vs_rst@plt>
mov    $0x64,%edi
call   1050 <delay_m@plt>
mov    $0x0,%al
call   1040 <audio_soft_reset@plt>
mov    $0x64,%edi
call   1050 <delay_m@plt>
mov    $0x3,%edi
mov    $0x6000,%esi
call   1070 <vs_write_reg@plt>
mov    $0x0,%al
call   1060 <vs_spi_clk_data@plt>
movzwl -0x2(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<audio_reset>:
push   %rax
xor    %edi,%edi
call   1030 <vs_rst@plt>
mov    $0x64,%edi
call   1050 <delay_m@plt>
mov    $0x1,%edi
call   1030 <vs_rst@plt>
mov    $0x64,%edi
call   1050 <delay_m@plt>
xor    %eax,%eax
call   1040 <audio_soft_reset@plt>
mov    $0x64,%edi
call   1050 <delay_m@plt>
mov    $0x3,%edi
mov    $0x6000,%esi
call   1070 <vs_write_reg@plt>
xor    %eax,%eax
call   1060 <vs_spi_clk_data@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @audio_reset() {
%1 = alloca i16
store i16 0, i16* %1
%2 = call i32 @vs_rst(i32 0)
%3 = call i32 @delay_m(i32 100)
%4 = call i32 @vs_rst(i32 1)
%5 = call i32 @delay_m(i32 100)
%6 = call i32 (...) @audio_soft_reset()
%7 = call i32 @delay_m(i32 100)
%8 = call i32 @vs_write_reg(i32 3, i32 24576)
%9 = call i32 (...) @vs_spi_clk_data()
%10 = load i16, i16* %1
%11 = zext i16 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @audio_reset() {
%1 = tail call i32 @vs_rst(i32 0)
%2 = tail call i32 @delay_m(i32 100)
%3 = tail call i32 @vs_rst(i32 1)
%4 = tail call i32 @delay_m(i32 100)
%5 = tail call i32 (...) @audio_soft_reset()
%6 = tail call i32 @delay_m(i32 100)
%7 = tail call i32 @vs_write_reg(i32 3, i32 24576)
%8 = tail call i32 (...) @vs_spi_clk_data()
ret i32 0
}
int function_of_interest(int arg) { return arg % 2; }


x86 assembly (clang, -O0):
<function_of_interest>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<function_of_interest>:
mov    %edi,%eax
mov    %edi,%ecx
shr    $0x1f,%ecx
add    %edi,%ecx
and    $0xfffffffe,%ecx
sub    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @function_of_interest(i32 %0) {
%2 = srem i32 %0, 2
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ count1s(int);
int main() {
  count1s(1);
  count1s(2);
  count1s(3);
  count1s(5);
  count1s(1023);
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @count1s(i32 1)
%3 = call i32 @count1s(i32 2)
%4 = call i32 @count1s(i32 3)
%5 = call i32 @count1s(i32 5)
%6 = call i32 @count1s(i32 1023)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @count1s(i32 1)
%2 = tail call i32 @count1s(i32 2)
%3 = tail call i32 @count1s(i32 3)
%4 = tail call i32 @count1s(i32 5)
%5 = tail call i32 @count1s(i32 1023)
ret i32 0
}
int is_arasan_v1(int version) { return version < 0x19; }


x86 assembly (clang, -O0):
<is_arasan_v1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x19,-0x4(%rbp)
setl   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_arasan_v1>:
xor    %eax,%eax
cmp    $0x19,%edi
setl   %al
ret

LLVM IR (-O0):
define i32 @is_arasan_v1(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 %3, 25
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @is_arasan_v1(i32 %0) {
%2 = icmp slt i32 %0, 25
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int can_size_add(const size_t x, const size_t y) {
  return x <= ((~((size_t)0)) - y);
}


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

x86 assembly (clang, -O2):
<can_size_add>:
not    %rsi
xor    %eax,%eax
cmp    %rdi,%rsi
setae  %al
ret

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

LLVM IR (-O2):
define i32 @can_size_add(i64 %0, i64 %1) {
%3 = xor i64 %1, -1
%4 = icmp uge i64 %3, %0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ usleep(unsigned int);
void Parrot_usleep(unsigned int microseconds) { usleep(microseconds); }


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

x86 assembly (clang, -O2):
<Parrot_usleep>:
jmp    1030 <usleep@plt>

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

LLVM IR (-O2):
define void @Parrot_usleep(i32 %0) {
%2 = tail call i32 @usleep(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ generate_random_salt(char *, int);
char *make_des_salt() {
  static char salt[3];
  generate_random_salt(salt, 2);
  salt[2] = '\0';
  return salt;
}


x86 assembly (clang, -O0):
<make_des_salt>:
push   %rbp
mov    %rsp,%rbp
lea    0x2f0e(%rip),%rdi
mov    $0x2,%esi
call   1030 <generate_random_salt@plt>
movb   $0x0,0x2eff(%rip)
lea    0x2ef6(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<make_des_salt>:
push   %rbx
lea    0x2f11(%rip),%rbx
mov    %rbx,%rdi
mov    $0x2,%esi
call   1030 <generate_random_salt@plt>
movb   $0x0,0x2eff(%rip)
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@make_des_salt.salt = internal global [3 x i8] zeroinitializer
define i8* @make_des_salt() {
%1 = call i32 @generate_random_salt(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @make_des_salt.salt, i64 0, i64 0), i32 2)
store i8 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @make_des_salt.salt, i64 0, i64 2)
ret i8* getelementptr inbounds ([3 x i8], [3 x i8]* @make_des_salt.salt, i64 0, i64 0)
}

LLVM IR (-O2):
@make_des_salt.salt = internal global [3 x i8] zeroinitializer
define i8* @make_des_salt() {
%1 = tail call i32 @generate_random_salt(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @make_des_salt.salt, i64 0, i64 0), i32 2)
store i8 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @make_des_salt.salt, i64 0, i64 2)
ret i8* getelementptr inbounds ([3 x i8], [3 x i8]* @make_des_salt.salt, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, char);
void print_arr_str(char arr[], int len) {
  int temp;
  for (temp = 0; temp < len; temp++) {
    printf("arr[%d] = %c\n", temp, arr[temp]);
  }
}


x86 assembly (clang, -O0):
<print_arr_str>:
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    115b <print_arr_str+0x4b>
mov    -0x10(%rbp),%esi
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
lea    0xebc(%rip),%rdi
movsbl (%rax,%rcx,1),%edx
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <print_arr_str+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_arr_str>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1148 <print_arr_str+0x38>
mov    %rdi,%r14
mov    %esi,%r12d
xor    %ebx,%ebx
lea    0xed5(%rip),%r15
nopl   0x0(%rax,%rax,1)
movsbl (%r14,%rbx,1),%edx
mov    %r15,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <print_arr_str+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [14 x i8] c"arr[%d] = %c\0A\00"
define void @print_arr_str(i8* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %14
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %12, %6 ]
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = trunc i64 %7 to i32
%11 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %10, i8 signext %9)
%12 = add nuw nsw i64 %7, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %14, label %6
14: ; preds = %6, %2
ret void
}
/* Variables and functions */
scalar_t__ input_joystick_available();
char const *lang_get(char *);
const char *f_input_down() {
  return lang_get(input_joystick_available() ? "INPUT_JOY_DOWN"
                                             : "INPUT_KEYB_DOWN");
}


x86 assembly (clang, -O0):
<f_input_down>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <input_joystick_available@plt>
mov    %rax,%rcx
lea    0xeda(%rip),%rdi
lea    0xec4(%rip),%rax
cmp    $0x0,%rcx
cmovne %rax,%rdi
call   1030 <lang_get@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_input_down>:
push   %rax
xor    %eax,%eax
call   1040 <input_joystick_available@plt>
test   %rax,%rax
lea    0xedd(%rip),%rax
lea    0xec7(%rip),%rdi
cmove  %rax,%rdi
pop    %rax
jmp    1030 <lang_get@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"INPUT_JOY_DOWN\00"
@.str.1 = [16 x i8] c"INPUT_KEYB_DOWN\00"
define i8* @f_input_down() {
%1 = call i64 (...) @input_joystick_available()
%2 = icmp ne i64 %1, 0
%3 = zext i1 %2 to i64
%4 = select i1 %2, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0)
%5 = call i8* @lang_get(i8* %4)
ret i8* %5
}

LLVM IR (-O2):
@.str = [15 x i8] c"INPUT_JOY_DOWN\00"
@.str.1 = [16 x i8] c"INPUT_KEYB_DOWN\00"
define i8* @f_input_down() {
%1 = tail call i64 (...) @input_joystick_available()
%2 = icmp eq i64 %1, 0
%3 = select i1 %2, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0)
%4 = tail call i8* @lang_get(i8* %3)
ret i8* %4
}
/* Variables and functions */
void *dmem_alloc(int);
int /*<<< orphan*/ dmem_release(void *);
int /*<<< orphan*/ memcpy(void *, void *, int);
void *dmem_realloc(void *ptr, int obytes, int nbytes) {
  void *nptr;
  nptr = dmem_alloc(nbytes);
  memcpy(nptr, ptr, (nbytes < obytes) ? nbytes : obytes);
  dmem_release(ptr);
  return nptr;
}


x86 assembly (clang, -O0):
<dmem_realloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x10(%rbp),%edi
call   1050 <dmem_alloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1175 <dmem_realloc+0x45>
mov    -0x10(%rbp),%eax
mov    %eax,-0x2c(%rbp)
jmp    117b <dmem_realloc+0x4b>
mov    -0xc(%rbp),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x20(%rbp),%rsi
mov    -0x28(%rbp),%rdi
mov    -0x2c(%rbp),%edx
call   1040 <memcpy@plt>
mov    -0x8(%rbp),%rdi
call   1030 <dmem_release@plt>
mov    -0x18(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dmem_realloc>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edx,%ebx
mov    %esi,%ebp
mov    %rdi,%r14
mov    %edx,%edi
call   1050 <dmem_alloc@plt>
mov    %rax,%r15
cmp    %ebp,%ebx
cmovl  %ebx,%ebp
mov    %rax,%rdi
mov    %r14,%rsi
mov    %ebp,%edx
call   1040 <memcpy@plt>
mov    %r14,%rdi
call   1030 <dmem_release@plt>
mov    %r15,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i8* @dmem_realloc(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %6
%9 = call i8* @dmem_alloc(i32 %8)
store i8* %9, i8** %7
%10 = load i8*, i8** %7
%11 = load i8*, i8** %4
%12 = load i32, i32* %6
%13 = load i32, i32* %5
%14 = icmp slt i32 %12, %13
br i1 %14, label %15, label %17
15: ; preds = %3
%16 = load i32, i32* %6
br label %19
17: ; preds = %3
%18 = load i32, i32* %5
br label %19
19: ; preds = %17, %15
%20 = phi i32 [ %16, %15 ], [ %18, %17 ]
%21 = call i32 @memcpy(i8* %10, i8* %11, i32 %20)
%22 = load i8*, i8** %4
%23 = call i32 @dmem_release(i8* %22)
%24 = load i8*, i8** %7
ret i8* %24
}

LLVM IR (-O2):
define i8* @dmem_realloc(i8* %0, i32 %1, i32 %2) {
%4 = tail call i8* @dmem_alloc(i32 %2)
%5 = icmp slt i32 %2, %1
%6 = select i1 %5, i32 %2, i32 %1
%7 = tail call i32 @memcpy(i8* %4, i8* %0, i32 %6)
%8 = tail call i32 @dmem_release(i8* %0)
ret i8* %4
}
void caller_2_1_1_2_2_2_1() {}


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

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

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

LLVM IR (-O2):
define void @caller_2_1_1_2_2_2_1() {
ret void
}
double Exp(x)
double x;
{ return errcheck(exp(x), "exp"); }


x86 assembly (clang, -O0):
<Exp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <exp@plt>
lea    0xec2(%rip),%rdi
mov    $0x1,%al
call   1030 <errcheck@plt>
cvtsi2sd %eax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Exp>:
push   %rax
call   1040 <exp@plt>
lea    0xed3(%rip),%rdi
mov    $0x1,%al
call   1030 <errcheck@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
@.str = [4 x i8] c"exp\00"
define double @Exp(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @exp(double %3)
%5 = call i32 (double, i8*, ...) bitcast (i32 (...)* @errcheck to i32 (double, i8*, ...)*)(double %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%6 = sitofp i32 %5 to double
ret double %6
}

LLVM IR (-O2):
@.str = [4 x i8] c"exp\00"
define double @Exp(double %0) {
%2 = tail call double @exp(double %0)
%3 = tail call i32 (double, i8*, ...) bitcast (i32 (...)* @errcheck to i32 (double, i8*, ...)*)(double %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%4 = sitofp i32 %3 to double
ret double %4
}
/* Variables and functions */
char tolower(char);
void string_to_lower(char string[]) {
  int i;
  for (i = 0; string[i] != '\0'; i++) {
    string[i] = tolower(string[i]);
  }
}


x86 assembly (clang, -O0):
<string_to_lower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1164 <string_to_lower+0x54>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <tolower@plt>
mov    %al,%dl
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <string_to_lower+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_to_lower>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1136 <string_to_lower+0x26>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <tolower@plt>
mov    %al,-0x1(%rbx)
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <string_to_lower+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @string_to_lower(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %9, %4 ], [ 0, %1 ]
%6 = phi i8 [ %11, %4 ], [ %2, %1 ]
%7 = phi i8* [ %10, %4 ], [ %0, %1 ]
%8 = tail call signext i8 @tolower(i8 signext %6)
store i8 %8, i8* %7
%9 = add nuw i64 %5, 1
%10 = getelementptr inbounds i8, i8* %0, i64 %9
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %4
13: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ delay(int);
int /*<<< orphan*/ mbus_remote_register_write(int, int, int);
void set_pmu_sleep_low() {
  mbus_remote_register_write(
      0x3, 0x17, ((3 << 14) | (0 << 13) | (1 << 9) | (1 << 5) | (1)));
  delay(100);
  mbus_remote_register_write(
      0x3, 0x17, ((3 << 14) | (0 << 13) | (1 << 9) | (1 << 5) | (1)));
  delay(100);
  mbus_remote_register_write(0x3, 0x15,
                             ((0 << 19) | (0 << 18) | (0 << 17) | (3 << 14) |
                              (0 << 13) | (1 << 9) | (1 << 5) | (1)));
  delay(100);
}


x86 assembly (clang, -O0):
<set_pmu_sleep_low>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3,%edi
mov    $0x17,%esi
mov    $0xc221,%edx
call   1040 <mbus_remote_register_write@plt>
mov    $0x64,%edi
call   1030 <delay@plt>
mov    $0x3,%edi
mov    $0x17,%esi
mov    $0xc221,%edx
call   1040 <mbus_remote_register_write@plt>
mov    $0x64,%edi
call   1030 <delay@plt>
mov    $0x3,%edi
mov    $0x15,%esi
mov    $0xc221,%edx
call   1040 <mbus_remote_register_write@plt>
mov    $0x64,%edi
call   1030 <delay@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_pmu_sleep_low>:
push   %rax
mov    $0x3,%edi
mov    $0x17,%esi
mov    $0xc221,%edx
call   1040 <mbus_remote_register_write@plt>
mov    $0x64,%edi
call   1030 <delay@plt>
mov    $0x3,%edi
mov    $0x17,%esi
mov    $0xc221,%edx
call   1040 <mbus_remote_register_write@plt>
mov    $0x64,%edi
call   1030 <delay@plt>
mov    $0x3,%edi
mov    $0x15,%esi
mov    $0xc221,%edx
call   1040 <mbus_remote_register_write@plt>
mov    $0x64,%edi
pop    %rax
jmp    1030 <delay@plt>

LLVM IR (-O0):
define void @set_pmu_sleep_low() {
%1 = call i32 @mbus_remote_register_write(i32 3, i32 23, i32 49697)
%2 = call i32 @delay(i32 100)
%3 = call i32 @mbus_remote_register_write(i32 3, i32 23, i32 49697)
%4 = call i32 @delay(i32 100)
%5 = call i32 @mbus_remote_register_write(i32 3, i32 21, i32 49697)
%6 = call i32 @delay(i32 100)
ret void
}

LLVM IR (-O2):
define void @set_pmu_sleep_low() {
%1 = tail call i32 @mbus_remote_register_write(i32 3, i32 23, i32 49697)
%2 = tail call i32 @delay(i32 100)
%3 = tail call i32 @mbus_remote_register_write(i32 3, i32 23, i32 49697)
%4 = tail call i32 @delay(i32 100)
%5 = tail call i32 @mbus_remote_register_write(i32 3, i32 21, i32 49697)
%6 = tail call i32 @delay(i32 100)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ printf(char *, unsigned int);
int main() {
  unsigned int top;
  unsigned int result;
  if (top != 3) {
    result = top * 1073741824;
    assert(result != 3221225472);
    printf("%u\n", result);
  }
  return result;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x3,-0x8(%rbp)
je     1169 <main+0x49>
mov    -0x8(%rbp),%eax
shl    $0x1e,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    $0xc0000000,%ecx
cmp    %rcx,%rax
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0xc(%rbp),%esi
lea    0xe9c(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [4 x i8] c"%u\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = load i32, i32* %2
%5 = icmp ne i32 %4, 3
br i1 %5, label %6, label %16
6: ; preds = %0
%7 = load i32, i32* %2
%8 = mul i32 %7, 1073741824
store i32 %8, i32* %3
%9 = load i32, i32* %3
%10 = zext i32 %9 to i64
%11 = icmp ne i64 %10, 3221225472
%12 = zext i1 %11 to i32
%13 = call i32 @assert(i32 %12)
%14 = load i32, i32* %3
%15 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %14)
br label %16
16: ; preds = %6, %0
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
void EVP_CIPHER_CTX_set_padding(void) {}


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

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

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

LLVM IR (-O2):
define void @EVP_CIPHER_CTX_set_padding() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
void print_version() {
  printf("mkdir %s\n", "0.01");
  printf("Written by Constantinos Georgiades\n");
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<print_version>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
lea    0xed8(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xecf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x2e92(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<print_version>:
push   %rax
lea    0xec8(%rip),%rdi
lea    0xecb(%rip),%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xec2(%rip),%rdi
call   1030 <puts@plt>
mov    0x2e87(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"mkdir %s\0A\00"
@.str.1 = [5 x i8] c"0.01\00"
@.str.2 = [36 x i8] c"Written by Constantinos Georgiades\0A\00"
@EXIT_SUCCESS = global i32 0
define void @print_version() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 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 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.2, i64 0, i64 0))
%3 = load i32, i32* @EXIT_SUCCESS
%4 = call i32 @exit(i32 %3)
unreachable
}

LLVM IR (-O2):
@.str = [10 x i8] c"mkdir %s\0A\00"
@.str.1 = [5 x i8] c"0.01\00"
@EXIT_SUCCESS = global i32 0
@str = [35 x i8] c"Written by Constantinos Georgiades\00"
define void @print_version() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 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 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str, i64 0, i64 0))
%3 = load i32, i32* @EXIT_SUCCESS
%4 = tail call i32 @exit(i32 %3)
unreachable
}
unsigned int hash_bytes(const void *_key, int len, unsigned int seed) {
  const unsigned char *key = (const unsigned char *)_key;
  const unsigned char *end;
  for (end = key + len; key < end; key++)
    seed = ((seed << 5) + seed) ^ *key;
  return seed;
}


x86 assembly (clang, -O0):
<hash_bytes>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movslq -0xc(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x20(%rbp),%rax
jae    1159 <hash_bytes+0x59>
mov    -0x10(%rbp),%eax
shl    $0x5,%eax
add    -0x10(%rbp),%eax
mov    -0x18(%rbp),%rcx
movzbl (%rcx),%ecx
xor    %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1125 <hash_bytes+0x25>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_bytes>:
mov    %edx,%eax
test   %esi,%esi
jle    1125 <hash_bytes+0x25>
movslq %esi,%rcx
add    %rdi,%rcx
nopl   0x0(%rax)
mov    %eax,%edx
shl    $0x5,%edx
add    %eax,%edx
movzbl (%rdi),%eax
xor    %edx,%eax
add    $0x1,%rdi
cmp    %rcx,%rdi
jb     1110 <hash_bytes+0x10>
ret

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

LLVM IR (-O2):
define i32 @hash_bytes(i8* %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = icmp sgt i32 %1, 0
br i1 %6, label %7, label %16
7: ; preds = %3, %7
%8 = phi i32 [ %13, %7 ], [ %2, %3 ]
%9 = phi i8* [ %14, %7 ], [ %0, %3 ]
%10 = mul i32 %8, 33
%11 = load i8, i8* %9
%12 = zext i8 %11 to i32
%13 = xor i32 %10, %12
%14 = getelementptr inbounds i8, i8* %9, i64 1
%15 = icmp ult i8* %14, %5
br i1 %15, label %7, label %16
16: ; preds = %7, %3
%17 = phi i32 [ %2, %3 ], [ %13, %7 ]
ret i32 %17
}
double electric_field_kqR2(double q, double radius) {
  return (8.9875517873681764e+9 * q) / (radius * radius);
}


x86 assembly (clang, -O0):
<electric_field_kqR2>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  0xeea(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
mulsd  -0x10(%rbp),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<electric_field_kqR2>:
mulsd  0xef8(%rip),%xmm0
mulsd  %xmm1,%xmm1
divsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @electric_field_kqR2(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = fmul double 0x4200BD99415AF206, %5
%7 = load double, double* %4
%8 = load double, double* %4
%9 = fmul double %7, %8
%10 = fdiv double %6, %9
ret double %10
}

LLVM IR (-O2):
define double @electric_field_kqR2(double %0, double %1) {
%3 = fmul double %0, 0x4200BD99415AF206
%4 = fmul double %1, %1
%5 = fdiv double %3, %4
ret double %5
}
void VP8DspInitMSA(void) {}


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

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

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

LLVM IR (-O2):
define void @VP8DspInitMSA() {
ret void
}