xunge/DecIR huggingface dataset:
int main() {
  printf("in func %s, line %d\n", __func__, 14);
  printf("in func %s, line %d\n", __func__, 15);
  sleep(1);
  func();
  printf("in func %s, line %d\n", __func__, 18);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    0xec8(%rip),%rsi
mov    $0xe,%edx
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xea0(%rip),%rdi
lea    0xeae(%rip),%rsi
mov    $0xf,%edx
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x1,%edi
mov    $0x0,%al
call   1050 <sleep@plt>
mov    $0x0,%al
call   1040 <func@plt>
lea    0xe73(%rip),%rdi
lea    0xe81(%rip),%rsi
mov    $0x12,%edx
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xec5(%rip),%rbx
lea    0xed3(%rip),%r14
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0xe,%edx
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0xf,%edx
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0x1,%edi
xor    %eax,%eax
call   1050 <sleep@plt>
xor    %eax,%eax
call   1040 <func@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x12,%edx
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [21 x i8] c"in func %s, line %d\0A\00"
@__func__.main = [5 x i8] c"main\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @__func__.main, i64 0, i64 0), i32 14)
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @__func__.main, i64 0, i64 0), i32 15)
%4 = call i32 (i32, ...) bitcast (i32 (...)* @sleep to i32 (i32, ...)*)(i32 1)
%5 = call i32 (...) @func()
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @__func__.main, i64 0, i64 0), i32 18)
ret i32 0
}

LLVM IR (-O2):
@.str = [21 x i8] c"in func %s, line %d\0A\00"
@__func__.main = [5 x i8] c"main\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @__func__.main, i64 0, i64 0), i32 14)
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @__func__.main, i64 0, i64 0), i32 15)
%3 = tail call i32 (i32, ...) bitcast (i32 (...)* @sleep to i32 (i32, ...)*)(i32 1)
%4 = tail call i32 (...) @func()
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @__func__.main, i64 0, i64 0), i32 18)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ hardware_init();
int /*<<< orphan*/ memory_init(unsigned int);
int /*<<< orphan*/ sched_init();
int /*<<< orphan*/ timer_init();
void initialize(unsigned int memlen) {
  hardware_init();
  memory_init(memlen);
  sched_init();
  timer_init();
}


x86 assembly (clang, -O0):
<initialize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1050 <hardware_init@plt>
mov    -0x4(%rbp),%edi
call   1030 <memory_init@plt>
mov    $0x0,%al
call   1040 <sched_init@plt>
mov    $0x0,%al
call   1060 <timer_init@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<initialize>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1050 <hardware_init@plt>
mov    %ebx,%edi
call   1030 <memory_init@plt>
xor    %eax,%eax
call   1040 <sched_init@plt>
xor    %eax,%eax
pop    %rbx
jmp    1060 <timer_init@plt>

LLVM IR (-O0):
define void @initialize(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @hardware_init()
%4 = load i32, i32* %2
%5 = call i32 @memory_init(i32 %4)
%6 = call i32 (...) @sched_init()
%7 = call i32 (...) @timer_init()
ret void
}

LLVM IR (-O2):
define void @initialize(i32 %0) {
%2 = tail call i32 (...) @hardware_init()
%3 = tail call i32 @memory_init(i32 %0)
%4 = tail call i32 (...) @sched_init()
%5 = tail call i32 (...) @timer_init()
ret void
}
void J420ToARGB() {}


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

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

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

LLVM IR (-O2):
define void @J420ToARGB() {
ret void
}
/* Variables and functions */
char const *strcasestr(char const *, char const *);
const char *jet_strcasestr(const char *haystack, const char *needle) {
  return strcasestr(haystack, needle);
}


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

x86 assembly (clang, -O2):
<jet_strcasestr>:
jmp    1030 <strcasestr@plt>

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

LLVM IR (-O2):
define i8* @jet_strcasestr(i8* %0, i8* %1) {
%3 = tail call i8* @strcasestr(i8* %0, i8* %1)
ret i8* %3
}
/* Type definitions */
struct node {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ pathrecur(struct node *, int *, int /*<<< orphan*/);
void printpath(struct node *root) {
  int path[200];
  pathrecur(root, path, 0);
}


x86 assembly (clang, -O0):
<printpath>:
push   %rbp
mov    %rsp,%rbp
sub    $0x330,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x330(%rbp),%rsi
xor    %edx,%edx
call   1030 <pathrecur@plt>
add    $0x330,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printpath>:
sub    $0x328,%rsp
mov    %rsp,%rsi
xor    %edx,%edx
call   1030 <pathrecur@plt>
add    $0x328,%rsp
ret

LLVM IR (-O0):
%struct.node = type { i32 }
define void @printpath(%struct.node* %0) {
%2 = alloca %struct.node*
%3 = alloca [200 x i32]
store %struct.node* %0, %struct.node** %2
%4 = load %struct.node*, %struct.node** %2
%5 = getelementptr inbounds [200 x i32], [200 x i32]* %3, i64 0, i64 0
%6 = call i32 @pathrecur(%struct.node* %4, i32* %5, i32 0)
ret void
}

LLVM IR (-O2):
%struct.node = type { i32 }
define void @printpath(%struct.node* %0) {
%2 = alloca [200 x i32]
%3 = bitcast [200 x i32]* %2 to i8*
%4 = getelementptr inbounds [200 x i32], [200 x i32]* %2, i64 0, i64 0
%5 = call i32 @pathrecur(%struct.node* %0, i32* %4, i32 0)
ret void
}
/* Variables and functions */
int O_NONBLOCK;
int get_socket_flags(int);
int /*<<< orphan*/ set_socket_flags(int, int);
int unset_socket_non_blocking(int socket_fd) {
  int flags;
  flags = get_socket_flags(socket_fd);
  set_socket_flags(socket_fd, flags & ~O_NONBLOCK);
  return flags;
}


x86 assembly (clang, -O0):
<unset_socket_non_blocking>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <get_socket_flags@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    0x2ea5(%rip),%rax
mov    (%rax),%eax
xor    $0xffffffff,%eax
and    %eax,%esi
call   1030 <set_socket_flags@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unset_socket_non_blocking>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
call   1040 <get_socket_flags@plt>
mov    %eax,%ebp
mov    0x2eb5(%rip),%rax
mov    (%rax),%esi
not    %esi
and    %ebp,%esi
mov    %ebx,%edi
call   1030 <set_socket_flags@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@O_NONBLOCK = global i32 0
define i32 @unset_socket_non_blocking(i32 %0) {
%2 = tail call i32 @get_socket_flags(i32 %0)
%3 = load i32, i32* @O_NONBLOCK
%4 = xor i32 %3, -1
%5 = and i32 %2, %4
%6 = tail call i32 @set_socket_flags(i32 %0, i32 %5)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ glutPostRedisplay();
void scene() { glutPostRedisplay(); }


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ bswap_16(int /*<<< orphan*/);
uint16_t little16(uint16_t n) { return bswap_16(n); }


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

x86 assembly (clang, -O2):
<little16>:
jmp    1030 <bswap_16@plt>

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

LLVM IR (-O2):
define i32 @little16(i32 %0) {
%2 = tail call i32 @bswap_16(i32 %0)
ret i32 %2
}
void misc_args(int i, long j, long long k, double l, long double m) {}


x86 assembly (clang, -O0):
<misc_args>:
push   %rbp
mov    %rsp,%rbp
fldt   0x10(%rbp)
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movsd  %xmm0,-0x20(%rbp)
fstpt  -0x30(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @misc_args(i32 %0, i64 %1, i64 %2, double %3, x86_fp80 %4) {
ret void
}
int cmp1_crc32(const void *p, const void *q) {
  return *(const unsigned int *)p - *(const unsigned int *)q;
}


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

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

LLVM IR (-O0):
define i32 @cmp1_crc32(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 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %9
%11 = sub i32 %7, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @cmp1_crc32(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = sub i32 %4, %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
main() { printf("hello git"); }


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

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

LLVM IR (-O0):
@.str = [10 x i8] c"hello git\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"hello git\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
int test_short(char *ptr) { return ++*((unsigned short *)ptr); }


x86 assembly (clang, -O0):
<test_short>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
mov    (%rcx),%ax
add    $0x1,%ax
mov    %ax,(%rcx)
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_short>:
movzwl (%rdi),%eax
add    $0x1,%eax
mov    %ax,(%rdi)
movzwl %ax,%eax
ret

LLVM IR (-O0):
define i32 @test_short(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to i16*
%5 = load i16, i16* %4
%6 = add i16 %5, 1
store i16 %6, i16* %4
%7 = zext i16 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @test_short(i8* nocapture %0) {
%2 = bitcast i8* %0 to i16*
%3 = load i16, i16* %2
%4 = add i16 %3, 1
store i16 %4, i16* %2
%5 = zext i16 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ endwin();
int /*<<< orphan*/ getch();
int /*<<< orphan*/ initscr();
int /*<<< orphan*/ printw(char *);
int /*<<< orphan*/ refresh();
int main(int argc, char const *argv[]) {
  initscr();
  printw("Hello world !!!");
  refresh();
  getch();
  endwin();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <initscr@plt>
lea    0xe8c(%rip),%rdi
call   1040 <printw@plt>
mov    $0x0,%al
call   1050 <refresh@plt>
mov    $0x0,%al
call   1060 <getch@plt>
mov    $0x0,%al
call   1070 <endwin@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <initscr@plt>
lea    0xea1(%rip),%rdi
call   1040 <printw@plt>
xor    %eax,%eax
call   1050 <refresh@plt>
xor    %eax,%eax
call   1060 <getch@plt>
xor    %eax,%eax
call   1070 <endwin@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"Hello world !!!\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @initscr()
%7 = call i32 @printw(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%8 = call i32 (...) @refresh()
%9 = call i32 (...) @getch()
%10 = call i32 (...) @endwin()
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"Hello world !!!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @initscr()
%4 = tail call i32 @printw(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 (...) @refresh()
%6 = tail call i32 (...) @getch()
%7 = tail call i32 (...) @endwin()
ret i32 0
}
/* Variables and functions */
scalar_t__ isdigit(int);
int isxdigit(int c) {
  return (isdigit(c) || (c >= 'A' && c <= 'F') || (c >= 'a' && c <= 'f'));
}


x86 assembly (clang, -O0):
<isxdigit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <isdigit@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x5(%rbp)
jne    116d <isxdigit+0x5d>
cmpl   $0x41,-0x4(%rbp)
jl     114e <isxdigit+0x3e>
mov    $0x1,%al
cmpl   $0x46,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    116d <isxdigit+0x5d>
xor    %eax,%eax
cmpl   $0x61,-0x4(%rbp)
mov    %al,-0x6(%rbp)
jl     1167 <isxdigit+0x57>
cmpl   $0x66,-0x4(%rbp)
setle  %al
mov    %al,-0x6(%rbp)
mov    -0x6(%rbp),%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isxdigit>:
push   %rbx
mov    %edi,%ebx
call   1030 <isdigit@plt>
test   %rax,%rax
setne  %al
and    $0xffffffdf,%ebx
add    $0xffffffbf,%ebx
cmp    $0x6,%ebx
setb   %cl
or     %al,%cl
movzbl %cl,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @isxdigit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @isdigit(i32 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %20, label %6
6: ; preds = %1
%7 = load i32, i32* %2
%8 = icmp sge i32 %7, 65
br i1 %8, label %9, label %12
9: ; preds = %6
%10 = load i32, i32* %2
%11 = icmp sle i32 %10, 70
br i1 %11, label %20, label %12
12: ; preds = %9, %6
%13 = load i32, i32* %2
%14 = icmp sge i32 %13, 97
br i1 %14, label %15, label %18
15: ; preds = %12
%16 = load i32, i32* %2
%17 = icmp sle i32 %16, 102
br label %18
18: ; preds = %15, %12
%19 = phi i1 [ false, %12 ], [ %17, %15 ]
br label %20
20: ; preds = %18, %9, %1
%21 = phi i1 [ true, %9 ], [ true, %1 ], [ %19, %18 ]
%22 = zext i1 %21 to i32
ret i32 %22
}

LLVM IR (-O2):
define i32 @isxdigit(i32 %0) {
%2 = tail call i64 @isdigit(i32 %0)
%3 = icmp ne i64 %2, 0
%4 = and i32 %0, -33
%5 = add i32 %4, -65
%6 = icmp ult i32 %5, 6
%7 = or i1 %6, %3
%8 = zext i1 %7 to i32
ret i32 %8
}
int test_imm_11int64_highword_mem(long long *val) {
  return ((*val >> 32) & (0x11 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_11int64_highword_mem>:
testb  $0x11,0x4(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_11int64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 73014444032
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
struct termios {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ TCSANOW;
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ tcsetattr(int, int /*<<< orphan*/, struct termios const *);
void serial_close(int fd, const struct termios *tio_saved) {
  tcsetattr(fd, TCSANOW, tio_saved);
  close(fd);
}


x86 assembly (clang, -O0):
<serial_close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2eaf(%rip),%rax
mov    (%rax),%esi
mov    -0x10(%rbp),%rdx
call   1040 <tcsetattr@plt>
mov    -0x4(%rbp),%edi
call   1030 <close@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<serial_close>:
push   %rbx
mov    %rsi,%rdx
mov    %edi,%ebx
mov    0x2ebb(%rip),%rax
mov    (%rax),%esi
call   1040 <tcsetattr@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <close@plt>

LLVM IR (-O0):
%struct.termios = type { i32 }
@TCSANOW = global i32 0
define void @serial_close(i32 %0, %struct.termios* %1) {
%3 = alloca i32
%4 = alloca %struct.termios*
store i32 %0, i32* %3
store %struct.termios* %1, %struct.termios** %4
%5 = load i32, i32* %3
%6 = load i32, i32* @TCSANOW
%7 = load %struct.termios*, %struct.termios** %4
%8 = call i32 @tcsetattr(i32 %5, i32 %6, %struct.termios* %7)
%9 = load i32, i32* %3
%10 = call i32 @close(i32 %9)
ret void
}

LLVM IR (-O2):
%struct.termios = type { i32 }
@TCSANOW = global i32 0
define void @serial_close(i32 %0, %struct.termios* %1) {
%3 = load i32, i32* @TCSANOW
%4 = tail call i32 @tcsetattr(i32 %0, i32 %3, %struct.termios* %1)
%5 = tail call i32 @close(i32 %0)
ret void
}
void mem_test() {
  int *a = malloc(sizeof(5));
  printf("\n%x\n", a);
  a = malloc(sizeof(5));
  printf("\n%x\n", a);
  a = malloc(sizeof(5));
  printf("\n%x\n", a);
}


x86 assembly (clang, -O0):
<mem_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xebf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xe9f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xe7f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mem_test>:
push   %rbx
mov    $0x4,%edi
call   1040 <malloc@plt>
lea    0xece(%rip),%rbx
mov    %rbx,%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
xor    %eax,%eax
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"\0A%x\0A\00"
define void @mem_test() {
%1 = alloca i32*
%2 = call i8* @malloc(i64 4)
%3 = bitcast i8* %2 to i32*
store i32* %3, i32** %1
%4 = load i32*, i32** %1
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %4)
%6 = call i8* @malloc(i64 4)
%7 = bitcast i8* %6 to i32*
store i32* %7, i32** %1
%8 = load i32*, i32** %1
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %8)
%10 = call i8* @malloc(i64 4)
%11 = bitcast i8* %10 to i32*
store i32* %11, i32** %1
%12 = load i32*, i32** %1
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %12)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"\0A%x\0A\00"
define void @mem_test() {
%1 = tail call dereferenceable_or_null(4) i8* @malloc(i64 4)
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %1)
%3 = tail call dereferenceable_or_null(4) i8* @malloc(i64 4)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = tail call dereferenceable_or_null(4) i8* @malloc(i64 4)
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %5)
ret void
}
void board_play_tune(const char *str) {}


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

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

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

LLVM IR (-O2):
define void @board_play_tune(i8* nocapture %0) {
ret void
}
int cmd_mmc_erase_raw_partition(const char *partition) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @cmd_mmc_erase_raw_partition(i8* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int file_load(char *);
char *file_mkpath(char const *, char const *);
int /*<<< orphan*/ free(char *);
int file_load_from_dir(const char *dirname, const char *fname) {
  int ret = -1;
  char *path = file_mkpath(dirname, fname);
  if (path) {
    ret = file_load(path);
    free(path);
  }
  return ret;
}


x86 assembly (clang, -O0):
<file_load_from_dir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0xffffffff,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <file_mkpath@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     1178 <file_load_from_dir+0x48>
mov    -0x20(%rbp),%rdi
call   1050 <file_load@plt>
mov    %eax,-0x14(%rbp)
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_load_from_dir>:
push   %rbp
push   %rbx
push   %rax
call   1040 <file_mkpath@plt>
test   %rax,%rax
je     1156 <file_load_from_dir+0x26>
mov    %rax,%rbx
mov    %rax,%rdi
call   1050 <file_load@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %ebp,%eax
jmp    115b <file_load_from_dir+0x2b>
mov    $0xffffffff,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @file_load_from_dir(i8* %0, i8* %1) {
%3 = tail call i8* @file_mkpath(i8* %0, i8* %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = tail call i32 @file_load(i8* %3)
%7 = tail call i32 @free(i8* %3)
br label %8
8: ; preds = %5, %2
%9 = phi i32 [ %6, %5 ], [ -1, %2 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ die(char *);
void *realloc(void *, size_t);
void *nrealloc(void *ptr, size_t howmuch) {
  void *r = realloc(ptr, howmuch);
  if (r == NULL && howmuch != 0)
    die(("nano is out of memory!"));
  return r;
}


x86 assembly (clang, -O0):
<nrealloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <realloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1163 <nrealloc+0x43>
cmpq   $0x0,-0x10(%rbp)
je     1163 <nrealloc+0x43>
lea    0xea2(%rip),%rdi
call   1040 <die@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nrealloc>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
call   1030 <realloc@plt>
mov    %rax,%r14
test   %rbx,%rbx
je     1145 <nrealloc+0x25>
test   %r14,%r14
jne    1145 <nrealloc+0x25>
lea    0xec0(%rip),%rdi
call   1040 <die@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [23 x i8] c"nano is out of memory!\00"
define i8* @nrealloc(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i8*, i8** %3
%7 = load i64, i64* %4
%8 = call i8* @realloc(i8* %6, i64 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %16
11: ; preds = %2
%12 = load i64, i64* %4
%13 = icmp ne i64 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %11
%15 = call i32 @die(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
br label %16
16: ; preds = %14, %11, %2
%17 = load i8*, i8** %5
ret i8* %17
}

LLVM IR (-O2):
@.str = [23 x i8] c"nano is out of memory!\00"
define noalias i8* @nrealloc(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp eq i8* %3, null
%5 = icmp ne i64 %1, 0
%6 = and i1 %5, %4
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = tail call i32 @die(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %2
ret i8* %3
}
float floating() { return 3.5; }


x86 assembly (clang, -O0):
<floating>:
push   %rbp
mov    %rsp,%rbp
movss  0xef4(%rip),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<floating>:
movss  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define float @floating() {
ret float 3.500000e+00
}

LLVM IR (-O2):
define float @floating() {
ret float 3.500000e+00
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ pause();
void wait_and_exit(void) {
  pause();
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<wait_and_exit>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <pause@plt>
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<wait_and_exit>:
push   %rax
xor    %eax,%eax
call   1030 <pause@plt>
mov    0x2eb1(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
define void @wait_and_exit() {
%1 = call i32 (...) @pause()
%2 = load i32, i32* @EXIT_SUCCESS
%3 = call i32 @exit(i32 %2)
unreachable
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define void @wait_and_exit() {
%1 = tail call i32 (...) @pause()
%2 = load i32, i32* @EXIT_SUCCESS
%3 = tail call i32 @exit(i32 %2)
unreachable
}
int f7(unsigned char c) {
  if (c != 0x22 && c != 0x20 && c >= 0x20)
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<f7>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movzbl -0x5(%rbp),%eax
cmp    $0x22,%eax
je     113d <f7+0x3d>
movzbl -0x5(%rbp),%eax
cmp    $0x20,%eax
je     113d <f7+0x3d>
movzbl -0x5(%rbp),%eax
cmp    $0x20,%eax
jl     113d <f7+0x3d>
movl   $0x0,-0x4(%rbp)
jmp    1144 <f7+0x44>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f7>:
mov    %edi,%eax
and    $0xfd,%al
cmp    $0x20,%al
sete   %al
cmp    $0x20,%dil
setb   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @f7(i8 zeroext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = icmp ne i32 %5, 34
br i1 %6, label %7, label %16
7: ; preds = %1
%8 = load i8, i8* %3
%9 = zext i8 %8 to i32
%10 = icmp ne i32 %9, 32
br i1 %10, label %11, label %16
11: ; preds = %7
%12 = load i8, i8* %3
%13 = zext i8 %12 to i32
%14 = icmp sge i32 %13, 32
br i1 %14, label %15, label %16
15: ; preds = %11
store i32 0, i32* %2
br label %17
16: ; preds = %11, %7, %1
store i32 1, i32* %2
br label %17
17: ; preds = %16, %15
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
define i32 @f7(i8 zeroext %0) {
%2 = and i8 %0, -3
%3 = icmp eq i8 %2, 32
%4 = icmp ult i8 %0, 32
%5 = or i1 %4, %3
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Forward declarations */
typedef struct TYPE_5__ TYPE_2__;
typedef struct TYPE_4__ TYPE_1__;

/* Type definitions */
typedef int /*<<< orphan*/ XPointer;
struct TYPE_4__ {
  scalar_t__ window;
};
struct TYPE_5__ {
  TYPE_1__ xany;
};
typedef TYPE_2__ XEvent;
typedef scalar_t__ Window;
typedef int /*<<< orphan*/ Display;
typedef int Bool;

/* Variables and functions */
Bool predicate(Display *display, XEvent *event, XPointer args) {
  Window w = (Window)args;
  return event->xany.window == w;
}


x86 assembly (clang, -O0):
<predicate>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movslq -0x14(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
cmp    -0x20(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<predicate>:
movslq %edx,%rcx
xor    %eax,%eax
cmp    %rcx,(%rsi)
sete   %al
ret

LLVM IR (-O0):
%struct.TYPE_5__ = type { %struct.TYPE_4__ }
%struct.TYPE_4__ = type { i64 }
define i32 @predicate(i32* %0, %struct.TYPE_5__* %1, i32 %2) {
%4 = alloca i32*
%5 = alloca %struct.TYPE_5__*
%6 = alloca i32
%7 = alloca i64
store i32* %0, i32** %4
store %struct.TYPE_5__* %1, %struct.TYPE_5__** %5
store i32 %2, i32* %6
%8 = load i32, i32* %6
%9 = sext i32 %8 to i64
store i64 %9, i64* %7
%10 = load %struct.TYPE_5__*, %struct.TYPE_5__** %5
%11 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %10, i32 0, i32 0
%12 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %11, i32 0, i32 0
%13 = load i64, i64* %12
%14 = load i64, i64* %7
%15 = icmp eq i64 %13, %14
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
%struct.TYPE_5__ = type { %struct.TYPE_4__ }
%struct.TYPE_4__ = type { i64 }
define i32 @predicate(i32* nocapture readnone %0, %struct.TYPE_5__* nocapture %1, i32 %2) {
%4 = sext i32 %2 to i64
%5 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %1, i64 0, i32 0, i32 0
%6 = load i64, i64* %5
%7 = icmp eq i64 %6, %4
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int /*<<< orphan*/ vwprintf(int /*<<< orphan*/ *, int /*<<< orphan*/);
void uninitvar_vwprintf(wchar_t *Format, va_list Arg) {
  wchar_t *format1, *format2;
  va_list arg;
  (void)vwprintf(format1, arg);
  (void)vwprintf(format2, Arg);
  (void)vwprintf(Format, Arg);
  (void)vwprintf(Format, arg);
}


x86 assembly (clang, -O0):
<uninitvar_vwprintf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x24(%rbp),%esi
call   1030 <vwprintf@plt>
mov    -0x20(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <vwprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <vwprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x24(%rbp),%esi
call   1030 <vwprintf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uninitvar_vwprintf>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
call   1030 <vwprintf@plt>
mov    %ebx,%esi
call   1030 <vwprintf@plt>
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <vwprintf@plt>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <vwprintf@plt>

LLVM IR (-O0):
define void @uninitvar_vwprintf(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%8 = load i32*, i32** %5
%9 = load i32, i32* %7
%10 = call i32 @vwprintf(i32* %8, i32 %9)
%11 = load i32*, i32** %6
%12 = load i32, i32* %4
%13 = call i32 @vwprintf(i32* %11, i32 %12)
%14 = load i32*, i32** %3
%15 = load i32, i32* %4
%16 = call i32 @vwprintf(i32* %14, i32 %15)
%17 = load i32*, i32** %3
%18 = load i32, i32* %7
%19 = call i32 @vwprintf(i32* %17, i32 %18)
ret void
}

LLVM IR (-O2):
define void @uninitvar_vwprintf(i32* %0, i32 %1) {
%3 = tail call i32 @vwprintf(i32* undef, i32 undef)
%4 = tail call i32 @vwprintf(i32* undef, i32 %1)
%5 = tail call i32 @vwprintf(i32* %0, i32 %1)
%6 = tail call i32 @vwprintf(i32* %0, i32 undef)
ret void
}
/* Variables and functions */
void zeromem(void *out, size_t outlen) {
  unsigned char *mem = out;
  while (outlen-- > 0) {
    *mem++ = 0;
  }
}


x86 assembly (clang, -O0):
<zeromem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x10(%rbp)
cmp    $0x0,%rax
jbe    1144 <zeromem+0x44>
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
movb   $0x0,(%rax)
jmp    1114 <zeromem+0x14>
pop    %rbp
ret

x86 assembly (clang, -O2):
<zeromem>:
test   %rsi,%rsi
je     1124 <zeromem+0x14>
push   %rax
mov    %rsi,%rdx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define void @zeromem(i8* nocapture writeonly %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %5, label %4
4: ; preds = %2
br label %5
5: ; preds = %4, %2
ret void
}
void CPlayerEntity_OnEndClass(void) {}


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

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

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

LLVM IR (-O2):
define void @CPlayerEntity_OnEndClass() {
ret void
}
void char_short_arg(char a, short b) {}


x86 assembly (clang, -O0):
<char_short_arg>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %ax,-0x4(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @char_short_arg(i8 signext %0, i16 signext %1) {
ret void
}
/* Variables and functions */
int soundio_int_max(int /*<<< orphan*/, int);
int /*<<< orphan*/ soundio_int_min(int, int);
int soundio_int_clamp(int min_value, int value, int max_value) {
  return soundio_int_max(soundio_int_min(value, max_value), min_value);
}


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

x86 assembly (clang, -O2):
<soundio_int_clamp>:
push   %rbx
mov    %edi,%ebx
mov    %esi,%edi
mov    %edx,%esi
call   1030 <soundio_int_min@plt>
mov    %eax,%edi
mov    %ebx,%esi
pop    %rbx
jmp    1040 <soundio_int_max@plt>

LLVM IR (-O0):
define i32 @soundio_int_clamp(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* %5
%8 = load i32, i32* %6
%9 = call i32 @soundio_int_min(i32 %7, i32 %8)
%10 = load i32, i32* %4
%11 = call i32 @soundio_int_max(i32 %9, i32 %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @soundio_int_clamp(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @soundio_int_min(i32 %1, i32 %2)
%5 = tail call i32 @soundio_int_max(i32 %4, i32 %0)
ret i32 %5
}
unsigned is_palindrome(unsigned num) {
  unsigned tmp = num;
  unsigned rnum = 0;
  while (tmp) {
    rnum = rnum * 10 + tmp % 10;
    tmp /= 10;
  }
  if (rnum == num)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<is_palindrome>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     114d <is_palindrome+0x4d>
imul   $0xa,-0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
mov    $0xa,%ecx
xor    %edx,%edx
div    %ecx
mov    -0x14(%rbp),%eax
add    %edx,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    $0xa,%ecx
xor    %edx,%edx
div    %ecx
mov    %eax,-0xc(%rbp)
jmp    1114 <is_palindrome+0x14>
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jne    1165 <is_palindrome+0x65>
movl   $0x1,-0x4(%rbp)
jmp    116c <is_palindrome+0x6c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_palindrome>:
xor    %edx,%edx
test   %edi,%edi
je     1133 <is_palindrome+0x33>
mov    $0xcccccccd,%r8d
mov    %edi,%ecx
xchg   %ax,%ax
lea    (%rdx,%rdx,4),%r9d
mov    %ecx,%esi
imul   %r8,%rsi
shr    $0x23,%rsi
lea    (%rsi,%rsi,1),%eax
lea    (%rax,%rax,4),%eax
mov    %ecx,%edx
sub    %eax,%edx
lea    (%rdx,%r9,2),%edx
cmp    $0x9,%ecx
mov    %esi,%ecx
ja     1110 <is_palindrome+0x10>
xor    %eax,%eax
cmp    %edi,%edx
sete   %al
ret

LLVM IR (-O0):
define i32 @is_palindrome(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
%6 = load i32, i32* %3
store i32 %6, i32* %4
store i32 0, i32* %5
br label %7
7: ; preds = %10, %1
%8 = load i32, i32* %4
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %18
10: ; preds = %7
%11 = load i32, i32* %5
%12 = mul i32 %11, 10
%13 = load i32, i32* %4
%14 = urem i32 %13, 10
%15 = add i32 %12, %14
store i32 %15, i32* %5
%16 = load i32, i32* %4
%17 = udiv i32 %16, 10
store i32 %17, i32* %4
br label %7
18: ; preds = %7
%19 = load i32, i32* %5
%20 = load i32, i32* %3
%21 = icmp eq i32 %19, %20
br i1 %21, label %22, label %23
22: ; preds = %18
store i32 1, i32* %2
br label %24
23: ; preds = %18
store i32 0, i32* %2
br label %24
24: ; preds = %23, %22
%25 = load i32, i32* %2
ret i32 %25
}

LLVM IR (-O2):
define i32 @is_palindrome(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %11, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ 0, %1 ]
%5 = phi i32 [ %9, %3 ], [ %0, %1 ]
%6 = mul i32 %4, 10
%7 = urem i32 %5, 10
%8 = add i32 %6, %7
%9 = udiv i32 %5, 10
%10 = icmp ult i32 %5, 10
br i1 %10, label %11, label %3
11: ; preds = %3, %1
%12 = phi i32 [ 0, %1 ], [ %8, %3 ]
%13 = icmp eq i32 %12, %0
%14 = zext i1 %13 to i32
ret i32 %14
}
float vectorSquareLength(const float v[3]) {
  return v[0] * v[0] + v[1] * v[1] + v[2] * v[2];
}


x86 assembly (clang, -O0):
<vectorSquareLength>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm1
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm2
mov    -0x8(%rbp),%rax
movss  0x4(%rax),%xmm0
mov    -0x8(%rbp),%rax
mulss  0x4(%rax),%xmm0
mulss  %xmm2,%xmm1
addss  %xmm0,%xmm1
mov    -0x8(%rbp),%rax
movss  0x8(%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  0x8(%rax),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<vectorSquareLength>:
movss  (%rdi),%xmm1
movss  0x4(%rdi),%xmm0
mulss  %xmm0,%xmm0
mulss  %xmm1,%xmm1
addss  %xmm0,%xmm1
movss  0x8(%rdi),%xmm0
mulss  %xmm0,%xmm0
addss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @vectorSquareLength(float* %0) {
%2 = alloca float*
store float* %0, float** %2
%3 = load float*, float** %2
%4 = getelementptr inbounds float, float* %3, i64 0
%5 = load float, float* %4
%6 = load float*, float** %2
%7 = getelementptr inbounds float, float* %6, i64 0
%8 = load float, float* %7
%9 = load float*, float** %2
%10 = getelementptr inbounds float, float* %9, i64 1
%11 = load float, float* %10
%12 = load float*, float** %2
%13 = getelementptr inbounds float, float* %12, i64 1
%14 = load float, float* %13
%15 = fmul float %11, %14
%16 = call float @llvm.fmuladd.f32(float %5, float %8, float %15)
%17 = load float*, float** %2
%18 = getelementptr inbounds float, float* %17, i64 2
%19 = load float, float* %18
%20 = load float*, float** %2
%21 = getelementptr inbounds float, float* %20, i64 2
%22 = load float, float* %21
%23 = call float @llvm.fmuladd.f32(float %19, float %22, float %16)
ret float %23
}

LLVM IR (-O2):
define float @vectorSquareLength(float* nocapture %0) {
%2 = load float, float* %0
%3 = getelementptr inbounds float, float* %0, i64 1
%4 = load float, float* %3
%5 = fmul float %4, %4
%6 = tail call float @llvm.fmuladd.f32(float %2, float %2, float %5)
%7 = getelementptr inbounds float, float* %0, i64 2
%8 = load float, float* %7
%9 = tail call float @llvm.fmuladd.f32(float %8, float %8, float %6)
ret float %9
}
double manage_mantissa(const char *str) {}


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

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

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

LLVM IR (-O2):
define double @manage_mantissa(i8* nocapture readnone %0) {
ret double undef
}
/* Variables and functions */
int INT_MIN;
int /*<<< orphan*/ itoa(int, char *);
int /*<<< orphan*/ printf(char *, ...);
int main(void) {
  char s[100];
  int n = INT_MIN;
  printf("int   : %d\n", n);
  itoa(n, s);
  printf("string: %s\n", s);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2eaf(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x74(%rbp)
mov    -0x74(%rbp),%esi
lea    0xeb8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x74(%rbp),%edi
lea    -0x70(%rbp),%rsi
call   1040 <itoa@plt>
lea    -0x70(%rbp),%rsi
lea    0xea6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x68,%rsp
mov    0x2eba(%rip),%rax
mov    (%rax),%ebx
lea    0xec9(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rsp,%r14
mov    %ebx,%edi
mov    %r14,%rsi
call   1040 <itoa@plt>
lea    0xeb8(%rip),%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x68,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@INT_MIN = global i32 0
@.str = [12 x i8] c"int : %d\0A\00"
@.str.1 = [12 x i8] c"string: %s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [100 x i8]
%3 = alloca i32
store i32 0, i32* %1
%4 = load i32, i32* @INT_MIN
store i32 %4, i32* %3
%5 = load i32, i32* %3
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i32, i32* %3
%8 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%9 = call i32 @itoa(i32 %7, i8* %8)
%10 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* %10)
ret i32 0
}

LLVM IR (-O2):
@INT_MIN = global i32 0
@.str = [12 x i8] c"int : %d\0A\00"
@.str.1 = [12 x i8] c"string: %s\0A\00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%3 = load i32, i32* @INT_MIN
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = call i32 @itoa(i32 %3, i8* %2)
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* %2)
ret i32 0
}
void free_matrix(int ***data_ptr, int n) {
  int row;
  int **data = *data_ptr;
  for (row = 0; row < n; row++)
    free(data[row]);
  free(data);
}


x86 assembly (clang, -O0):
<free_matrix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    115c <free_matrix+0x4c>
mov    -0x18(%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    1131 <free_matrix+0x21>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_matrix>:
push   %r15
push   %r14
push   %rbx
mov    (%rdi),%r14
test   %esi,%esi
jle    1142 <free_matrix+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 <free_matrix+0x20>
mov    %r14,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>

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

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