xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ array;

/* Variables and functions */
int max_sum(int *, size_t);
int /*<<< orphan*/ output(int *, size_t);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char **argv) {
  int array[] = {-2, 4, -3, 5, -1, 3};
  size_t len = sizeof(array) / sizeof(array[0]);
  output(array, len);
  printf("max: %d\n", max_sum(array, len));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xeb3(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xeb0(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xead(%rip),%rax
mov    %rax,-0x20(%rbp)
movq   $0x6,-0x38(%rbp)
lea    -0x30(%rbp),%rdi
mov    -0x38(%rbp),%rsi
call   1030 <output@plt>
lea    -0x30(%rbp),%rdi
mov    -0x38(%rbp),%rsi
call   1040 <max_sum@plt>
mov    %eax,%esi
lea    0xe86(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
mov    0xed4(%rip),%rax
mov    %rax,0x10(%rsp)
movaps 0xeb8(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rbx
mov    $0x6,%esi
mov    %rbx,%rdi
call   1030 <output@plt>
mov    $0x6,%esi
mov    %rbx,%rdi
call   1040 <max_sum@plt>
lea    0xea8(%rip),%rdi
mov    %eax,%esi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@__const.main.array = [6 x i32] [i32 -2, i32 4, i32 -3, i32 5, i32 -1, i32 3]
@.str = [9 x i8] c"max: %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [6 x i32]
%4 = bitcast [6 x i32]* %3 to i8*
%5 = getelementptr inbounds [6 x i32], [6 x i32]* %3, i64 0, i64 0
%6 = call i32 @output(i32* %5, i64 6)
%7 = call i32 @max_sum(i32* %5, i64 6)
%8 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %7)
ret i32 0
}
char *decr(char *mp, char *mem, char *end, int a) {
  mp -= a;
  if (mp < mem)
    mp = end - (mem - mp);
  return mp;
}


x86 assembly (clang, -O0):
<decr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x1c(%rbp),%ecx
mov    -0x8(%rbp),%rax
movslq %ecx,%rdx
xor    %ecx,%ecx
sub    %rdx,%rcx
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1152 <decr+0x52>
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rdx
mov    -0x8(%rbp),%rcx
sub    %rcx,%rdx
xor    %ecx,%ecx
sub    %rdx,%rcx
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<decr>:
movslq %ecx,%rax
sub    %rax,%rdi
mov    %rdi,%rax
sub    %rsi,%rax
add    %rdx,%rax
cmp    %rsi,%rdi
cmovae %rdi,%rax
ret

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

LLVM IR (-O2):
define i8* @decr(i8* %0, i8* %1, i8* readnone %2, i32 %3) {
%5 = sext i32 %3 to i64
%6 = sub nsw i64 0, %5
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = icmp ult i8* %7, %1
%9 = ptrtoint i8* %1 to i64
%10 = ptrtoint i8* %7 to i64
%11 = sub i64 %10, %9
%12 = getelementptr inbounds i8, i8* %2, i64 %11
%13 = select i1 %8, i8* %12, i8* %7
ret i8* %13
}
int langdeflookup_shutdown(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @langdeflookup_shutdown() {
ret i32 0
}

LLVM IR (-O2):
define i32 @langdeflookup_shutdown() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ foo(int, int);
int main(int argc, char **argv) {
  foo(1, 1);
  foo(1, 2);
  foo(3, 2);
  foo(4, 4);
}


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @foo(i32 1, i32 1)
%4 = tail call i32 @foo(i32 1, i32 2)
%5 = tail call i32 @foo(i32 3, i32 2)
%6 = tail call i32 @foo(i32 4, i32 4)
ret i32 0
}
/* Variables and functions */
void smp_send_reschedule(int cpu) {}


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

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

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

LLVM IR (-O2):
define void @smp_send_reschedule(i32 %0) {
ret void
}
unsigned long long check_ulonglong() { return 0; }


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

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

LLVM IR (-O0):
define i64 @check_ulonglong() {
ret i64 0
}

LLVM IR (-O2):
define i64 @check_ulonglong() {
ret i64 0
}
/* Variables and functions */
int /*<<< orphan*/ __libclog_printf(char const *);
int /*<<< orphan*/ _exit(int);
void __dj_unimp(const char *fn) {
  __libclog_printf(fn);
  _exit(1);
}


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

x86 assembly (clang, -O2):
<__dj_unimp>:
push   %rax
call   1040 <__libclog_printf@plt>
mov    $0x1,%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
define void @__dj_unimp(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @__libclog_printf(i8* %3)
%5 = call i32 @_exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @__dj_unimp(i8* %0) {
%2 = tail call i32 @__libclog_printf(i8* %0)
%3 = tail call i32 @_exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr,
          "usage: mrsh [-nd%s]%s[-l login] [-M munge_socket] [-P service_port] "
          "host [command]\n",
          "", " ");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
lea    0xf18(%rip),%rdx
lea    0xf12(%rip),%rcx
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
lea    0xf1b(%rip),%rdx
lea    0xf15(%rip),%rcx
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [84 x i8] c"usage: mrsh [-nd%s]%s[-l login] [-M munge_socket] [-P service_port] host [command]\0A\00"
@.str.1 = [1 x i8] zeroinitializer
@.str.2 = [2 x i8] c" \00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([84 x i8], [84 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [84 x i8] c"usage: mrsh [-nd%s]%s[-l login] [-M munge_socket] [-P service_port] host [command]\0A\00"
@.str.1 = [1 x i8] zeroinitializer
@.str.2 = [2 x i8] c" \00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([84 x i8], [84 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
void alter(char a[]) { a[2] = 'r'; }


x86 assembly (clang, -O0):
<alter>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x72,0x2(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<alter>:
movb   $0x72,0x2(%rdi)
ret

LLVM IR (-O0):
define void @alter(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 2
store i8 114, i8* %4
ret void
}

LLVM IR (-O2):
define void @alter(i8* nocapture writeonly %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 2
store i8 114, i8* %2
ret void
}
void g_DUMMY_popup_container_close(int cont_id) { cont_id = cont_id; }


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

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

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

LLVM IR (-O2):
define void @g_DUMMY_popup_container_close(i32 %0) {
ret void
}
void gtk_tree_selection_select_iter() {}


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

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

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

LLVM IR (-O2):
define void @gtk_tree_selection_select_iter() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ v_swap(void *, int);
void endian_swap(void *p, int nbytes) { v_swap(p, nbytes); }


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

x86 assembly (clang, -O2):
<endian_swap>:
jmp    1030 <v_swap@plt>

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

LLVM IR (-O2):
define void @endian_swap(i8* %0, i32 %1) {
%3 = tail call i32 @v_swap(i8* %0, i32 %1)
ret void
}
void getPacket() {}


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

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

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

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


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, struct timezone *);
int /*<<< orphan*/ rtl_gettimeofday_to_iso8601date(struct timeval *,
                                                   struct timezone *, char *);
void rtl_getCurrentIso8601date(char *buf) {
  struct timeval tv;
  struct timezone tz;
  gettimeofday(&tv, &tz);
  rtl_gettimeofday_to_iso8601date(&tv, &tz, buf);
}


x86 assembly (clang, -O0):
<rtl_getCurrentIso8601date>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <gettimeofday@plt>
mov    -0x8(%rbp),%rdx
lea    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <rtl_gettimeofday_to_iso8601date@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rtl_getCurrentIso8601date>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
lea    0x8(%rsp),%r14
mov    %rsp,%r15
mov    %r14,%rdi
mov    %r15,%rsi
call   1030 <gettimeofday@plt>
mov    %r14,%rdi
mov    %r15,%rsi
mov    %rbx,%rdx
call   1040 <rtl_gettimeofday_to_iso8601date@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.timeval = type { i32 }
%struct.timezone = type { i32 }
define void @rtl_getCurrentIso8601date(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.timeval
%4 = alloca %struct.timezone
store i8* %0, i8** %2
%5 = call i32 @gettimeofday(%struct.timeval* %3, %struct.timezone* %4)
%6 = load i8*, i8** %2
%7 = call i32 @rtl_gettimeofday_to_iso8601date(%struct.timeval* %3, %struct.timezone* %4, i8* %6)
ret void
}

LLVM IR (-O2):
%struct.timeval = type { i32 }
%struct.timezone = type { i32 }
define void @rtl_getCurrentIso8601date(i8* %0) {
%2 = alloca %struct.timeval
%3 = alloca %struct.timezone
%4 = bitcast %struct.timeval* %2 to i8*
%5 = bitcast %struct.timezone* %3 to i8*
%6 = call i32 @gettimeofday(%struct.timeval* %2, %struct.timezone* %3)
%7 = call i32 @rtl_gettimeofday_to_iso8601date(%struct.timeval* %2, %struct.timezone* %3, i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ delay_nus(int);
void delay_nms(unsigned long n) {
  while (n--)
    delay_nus(1100);
}


x86 assembly (clang, -O0):
<delay_nms>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x8(%rbp)
cmp    $0x0,%rax
je     1144 <delay_nms+0x34>
mov    $0x44c,%edi
call   1030 <delay_nus@plt>
jmp    111c <delay_nms+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<delay_nms>:
push   %rbx
test   %rdi,%rdi
je     1130 <delay_nms+0x20>
mov    %rdi,%rbx
nopl   0x0(%rax)
mov    $0x44c,%edi
call   1030 <delay_nus@plt>
add    $0xffffffffffffffff,%rbx
jne    1120 <delay_nms+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @delay_nms(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %8, label %3
3: ; preds = %1, %3
%4 = phi i64 [ %5, %3 ], [ %0, %1 ]
%5 = add i64 %4, -1
%6 = tail call i32 @delay_nus(i32 1100)
%7 = icmp eq i64 %5, 0
br i1 %7, label %8, label %3
8: ; preds = %3, %1
ret void
}
/* Type definitions */
struct cdrom_subchnl {
  scalar_t__ cdsc_audiostatus;
};

/* Variables and functions */
scalar_t__ CDROM_AUDIO_PAUSED;
int /*<<< orphan*/ get_subchnl(struct cdrom_subchnl *);
int cd_is_paused() {
  struct cdrom_subchnl s;
  get_subchnl(&s);
  return (s.cdsc_audiostatus == CDROM_AUDIO_PAUSED);
}


x86 assembly (clang, -O0):
<cd_is_paused>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
call   1030 <get_subchnl@plt>
mov    -0x8(%rbp),%rax
mov    0x2ec4(%rip),%rcx
cmp    (%rcx),%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cd_is_paused>:
push   %rax
mov    %rsp,%rdi
call   1030 <get_subchnl@plt>
mov    (%rsp),%rcx
mov    0x2ecc(%rip),%rdx
xor    %eax,%eax
cmp    (%rdx),%rcx
sete   %al
pop    %rcx
ret

LLVM IR (-O0):
%struct.cdrom_subchnl = type { i64 }
@CDROM_AUDIO_PAUSED = global i64 0
define i32 @cd_is_paused() {
%1 = alloca %struct.cdrom_subchnl
%2 = call i32 @get_subchnl(%struct.cdrom_subchnl* %1)
%3 = getelementptr inbounds %struct.cdrom_subchnl, %struct.cdrom_subchnl* %1, i32 0, i32 0
%4 = load i64, i64* %3
%5 = load i64, i64* @CDROM_AUDIO_PAUSED
%6 = icmp eq i64 %4, %5
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
%struct.cdrom_subchnl = type { i64 }
@CDROM_AUDIO_PAUSED = global i64 0
define i32 @cd_is_paused() {
%1 = alloca %struct.cdrom_subchnl
%2 = bitcast %struct.cdrom_subchnl* %1 to i8*
%3 = call i32 @get_subchnl(%struct.cdrom_subchnl* %1)
%4 = getelementptr inbounds %struct.cdrom_subchnl, %struct.cdrom_subchnl* %1, i64 0, i32 0
%5 = load i64, i64* %4
%6 = load i64, i64* @CDROM_AUDIO_PAUSED
%7 = icmp eq i64 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
int atoi(char *);
int myatoi(char *);
int /*<<< orphan*/ printf(char *, int);
main() {
  char a[] = "1234";
  printf("%d\n", atoi(a));
  printf("%d\n", myatoi(a));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xec2(%rip),%eax
mov    %eax,-0x5(%rbp)
mov    0xebd(%rip),%al
mov    %al,-0x1(%rbp)
lea    -0x5(%rbp),%rdi
call   1050 <atoi@plt>
mov    %eax,%esi
lea    0xea9(%rip),%rdi
call   1040 <printf@plt>
lea    -0x5(%rbp),%rdi
call   1030 <myatoi@plt>
mov    %eax,%esi
lea    0xe92(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
movb   $0x0,0x4(%rsp)
movl   $0x34333231,(%rsp)
mov    %rsp,%r14
mov    %r14,%rdi
call   1050 <atoi@plt>
lea    0xeb3(%rip),%rbx
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    %r14,%rdi
call   1030 <myatoi@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@__const.main.a = [5 x i8] c"1234\00"
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca [5 x i8]
%2 = bitcast [5 x i8]* %1 to i8*
%3 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 0
%4 = call i32 @atoi(i8* %3)
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 0
%7 = call i32 @myatoi(i8* %6)
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %7)
ret i32 0
}

LLVM IR (-O2):
@__const.main.a = [5 x i8] c"1234\00"
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca [5 x i8]
%2 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 0
%3 = call i32 @atoi(i8* %2)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = call i32 @myatoi(i8* %2)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}
/* Variables and functions */
void *malloc(long long);
void _cgo_malloc(void *p) {
  struct a {
    long long n;
    void *ret;
  } *a = p;
  a->ret = malloc(a->n);
}


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

x86 assembly (clang, -O2):
<_cgo_malloc>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
call   1030 <malloc@plt>
mov    %rax,0x8(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
%struct.a = type { i64, i8* }
define void @_cgo_malloc(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.a*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to %struct.a*
store %struct.a* %5, %struct.a** %3
%6 = load %struct.a*, %struct.a** %3
%7 = getelementptr inbounds %struct.a, %struct.a* %6, i32 0, i32 0
%8 = load i64, i64* %7
%9 = call i8* @malloc(i64 %8)
%10 = load %struct.a*, %struct.a** %3
%11 = getelementptr inbounds %struct.a, %struct.a* %10, i32 0, i32 1
store i8* %9, i8** %11
ret void
}

LLVM IR (-O2):
define void @_cgo_malloc(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = tail call i8* @malloc(i64 %3)
%5 = getelementptr inbounds i8, i8* %0, i64 8
%6 = bitcast i8* %5 to i8**
store i8* %4, i8** %6
ret void
}
int p_File_is_open(char *fname) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @p_File_is_open(i8* nocapture readnone %0) {
ret i32 0
}
const char *event_get_version(void) { return ("2.0.16-stable"); }


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

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

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

LLVM IR (-O2):
@.str = [14 x i8] c"2.0.16-stable\00"
define i8* @event_get_version() {
ret i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void func2(void) { printf("func2 says hi\n"); }


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

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

LLVM IR (-O0):
@.str = [15 x i8] c"func2 says hi\0A\00"
define void @func2() {
%1 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [14 x i8] c"func2 says hi\00"
define void @func2() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret void
}
void CFGMR3QueryU16Def(void) {}


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

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

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

LLVM IR (-O2):
define void @CFGMR3QueryU16Def() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ DEBUG_ASSERT(int);
void PWMFaultIntClear(unsigned long ulBase) {
  DEBUG_ASSERT((ulBase == 0x40028000) || (ulBase == 0x40029000));
  (*((volatile unsigned long *)(ulBase + 0x0000001C))) = 0x00010000;
}


x86 assembly (clang, -O0):
<PWMFaultIntClear>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x1,%al
cmpq   $0x40028000,-0x8(%rbp)
40
mov    %al,-0x9(%rbp)
je     113d <PWMFaultIntClear+0x2d>
cmpq   $0x40029000,-0x8(%rbp)
40
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <DEBUG_ASSERT@plt>
mov    -0x8(%rbp),%rax
movq   $0x10000,0x1c(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PWMFaultIntClear>:
push   %rbx
mov    %rdi,%rbx
mov    %rdi,%rax
and    $0xffffffffffffefff,%rax
xor    %edi,%edi
cmp    $0x40028000,%rax
sete   %dil
call   1030 <DEBUG_ASSERT@plt>
movq   $0x10000,0x1c(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @PWMFaultIntClear(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp eq i64 %3, 1073905664
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = load i64, i64* %2
%7 = icmp eq i64 %6, 1073909760
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ true, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
%11 = call i32 @DEBUG_ASSERT(i32 %10)
%12 = load i64, i64* %2
%13 = add i64 %12, 28
%14 = inttoptr i64 %13 to i64*
store volatile i64 65536, i64* %14
ret void
}

LLVM IR (-O2):
define void @PWMFaultIntClear(i64 %0) {
%2 = and i64 %0, -4097
%3 = icmp eq i64 %2, 1073905664
%4 = zext i1 %3 to i32
%5 = tail call i32 @DEBUG_ASSERT(i32 %4)
%6 = add i64 %0, 28
%7 = inttoptr i64 %6 to i64*
store volatile i64 65536, i64* %7
ret void
}
/* Type definitions */
struct symbol {
  int dummy;
};
struct gstr {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ str_append(struct gstr *, char const *);
void expr_print_gstr_helper(void *data, struct symbol *sym, const char *str) {
  str_append((struct gstr *)data, str);
}


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

x86 assembly (clang, -O2):
<expr_print_gstr_helper>:
mov    %rdx,%rsi
jmp    1030 <str_append@plt>

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

LLVM IR (-O2):
%struct.symbol = type { i32 }
%struct.gstr = type { i32 }
define void @expr_print_gstr_helper(i8* %0, %struct.symbol* nocapture readnone %1, i8* %2) {
%4 = bitcast i8* %0 to %struct.gstr*
%5 = tail call i32 @str_append(%struct.gstr* %4, i8* %2)
ret void
}
void __attribute__((no, noclone)) fn11(void) {
  char ***volatile f[5];
  asm("" : : "r"(&f) : "memory");
  f[2] = f[5];
}


x86 assembly (clang, -O0):
<fn11>:
push   %rbp
mov    %rsp,%rbp
lea    -0x30(%rbp),%rax
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn11>:
lea    -0x28(%rsp),%rax
mov    (%rsp),%rax
mov    %rax,-0x18(%rsp)
ret

LLVM IR (-O0):
define void @fn11() {
%1 = alloca [5 x i8***]
%2 = getelementptr inbounds [5 x i8***], [5 x i8***]* %1, i64 0, i64 5
%3 = load volatile i8***, i8**** %2
%4 = getelementptr inbounds [5 x i8***], [5 x i8***]* %1, i64 0, i64 2
store volatile i8*** %3, i8**** %4
ret void
}

LLVM IR (-O2):
define void @fn11() {
%1 = alloca [5 x i8***]
%2 = bitcast [5 x i8***]* %1 to i8*
%3 = getelementptr inbounds [5 x i8***], [5 x i8***]* %1, i64 0, i64 5
%4 = load volatile i8***, i8**** %3
%5 = getelementptr inbounds [5 x i8***], [5 x i8***]* %1, i64 0, i64 2
store volatile i8*** %4, i8**** %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ PicocParseInteractiveNoStartPrompt(int);
int /*<<< orphan*/ PlatformPrintf(char *);
void PicocParseInteractive() {
  PlatformPrintf("starting picoc "
                 "v2.2"
                 "\n");
  PicocParseInteractiveNoStartPrompt(1);
}


x86 assembly (clang, -O0):
<PicocParseInteractive>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1040 <PlatformPrintf@plt>
mov    $0x1,%edi
call   1030 <PicocParseInteractiveNoStartPrompt@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<PicocParseInteractive>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <PlatformPrintf@plt>
mov    $0x1,%edi
pop    %rax
jmp    1030 <PicocParseInteractiveNoStartPrompt@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"starting picoc v2.2\0A\00"
define void @PicocParseInteractive() {
%1 = call i32 @PlatformPrintf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @PicocParseInteractiveNoStartPrompt(i32 1)
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"starting picoc v2.2\0A\00"
define void @PicocParseInteractive() {
%1 = tail call i32 @PlatformPrintf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @PicocParseInteractiveNoStartPrompt(i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ prompt();
int main() {
  prompt();
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <prompt@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @prompt()
ret i32 0
}
void freeTriangle(int **triangle, int rows) {
  while (--rows >= 0) {
    free(triangle[rows]);
  }
  free(triangle);
}


x86 assembly (clang, -O0):
<freeTriangle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
cmp    $0x0,%eax
jl     1147 <freeTriangle+0x37>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
jmp    111f <freeTriangle+0xf>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<freeTriangle>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
test   %esi,%esi
jle    1146 <freeTriangle+0x36>
mov    %esi,%ebx
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
lea    -0x2(%rbx),%eax
mov    (%r14,%rax,8),%rdi
call   1030 <free@plt>
add    $0xffffffffffffffff,%rbx
cmp    $0x1,%rbx
ja     1130 <freeTriangle+0x20>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @freeTriangle(i32** 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 [ %5, %4 ], [ %8, %6 ]
%8 = add nsw i64 %7, -1
%9 = and i64 %8, 4294967295
%10 = getelementptr inbounds i32*, i32** %0, i64 %9
%11 = bitcast i32** %10 to i8**
%12 = load i8*, i8** %11
tail call void @free(i8* %12)
%13 = icmp ugt i64 %7, 1
br i1 %13, label %6, label %14
14: ; preds = %6, %2
%15 = bitcast i32** %0 to i8*
tail call void @free(i8* %15)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fun_stub_base_v_stub(int *);
int /*<<< orphan*/ printf(char *, int);
int fun_stub_base_v_call(int a) {
  printf("fun_stub_base_v_call:a = %d \n", a);
  fun_stub_base_v_stub(&a);
  printf("fun_stub_base_v_stub return %d\n", a);
  return a;
}


x86 assembly (clang, -O0):
<fun_stub_base_v_call>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xecb(%rip),%rdi
call   1040 <printf@plt>
lea    -0x4(%rbp),%rdi
call   1030 <fun_stub_base_v_stub@plt>
mov    -0x4(%rbp),%esi
lea    0xed1(%rip),%rdi
call   1040 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fun_stub_base_v_call>:
push   %rax
mov    %edi,%esi
mov    %edi,0x4(%rsp)
lea    0xed2(%rip),%rdi
call   1040 <printf@plt>
lea    0x4(%rsp),%rdi
call   1030 <fun_stub_base_v_stub@plt>
mov    0x4(%rsp),%esi
lea    0xed6(%rip),%rdi
call   1040 <printf@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [30 x i8] c"fun_stub_base_v_call:a = %d \0A\00"
@.str.1 = [32 x i8] c"fun_stub_base_v_stub return %d\0A\00"
define i32 @fun_stub_base_v_call(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = call i32 @fun_stub_base_v_stub(i32* %2)
%6 = load i32, i32* %2
%7 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), i32 %6)
%8 = load i32, i32* %2
ret i32 %8
}

LLVM IR (-O2):
@.str = [30 x i8] c"fun_stub_base_v_call:a = %d \0A\00"
@.str.1 = [32 x i8] c"fun_stub_base_v_stub return %d\0A\00"
define i32 @fun_stub_base_v_call(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = tail call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 %0)
%4 = call i32 @fun_stub_base_v_stub(i32* %2)
%5 = load i32, i32* %2
%6 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), i32 %5)
%7 = load i32, i32* %2
ret i32 %7
}
int main() {
  int a, b, c, d, e, f, g, h, i, j;
  a = a++;
  a = b++ + 3;
  a = c++ + 4;
  a = d++ + 5;
  a = f++ + 6;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x4(%rbp)
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x8(%rbp)
add    $0x3,%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0xc(%rbp)
add    $0x4,%eax
mov    %eax,-0x4(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x10(%rbp)
add    $0x5,%eax
mov    %eax,-0x4(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x18(%rbp)
add    $0x6,%eax
mov    %eax,-0x4(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
void pci_pasid_init(struct pci_dev *dev) {}


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

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

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

LLVM IR (-O2):
%struct.pci_dev = type opaque
define void @pci_pasid_init(%struct.pci_dev* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit_program(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int socket(int, int, int);
int /*<<< orphan*/ stderr;
int Socket(int family, int type, int protocol) {
  int n;
  if ((n = socket(family, type, protocol)) < 0) {
    fprintf(stderr, "socket error\n");
    exit_program(1);
  }
  return n;
}


x86 assembly (clang, -O0):
<Socket>:
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   1050 <socket@plt>
mov    %eax,-0x10(%rbp)
cmp    $0x0,%eax
jge    117a <Socket+0x4a>
mov    0x2e7e(%rip),%rax
mov    (%rax),%edi
lea    0xe95(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit_program@plt>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Socket>:
push   %rbx
call   1050 <socket@plt>
mov    %eax,%ebx
test   %eax,%eax
jns    115b <Socket+0x2b>
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
lea    0xeb4(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit_program@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [14 x i8] c"socket error\0A\00"
define i32 @Socket(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %4
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = call i32 @socket(i32 %8, i32 %9, i32 %10)
store i32 %11, i32* %7
%12 = icmp slt i32 %11, 0
br i1 %12, label %13, label %17
13: ; preds = %3
%14 = load i32, i32* @stderr
%15 = call i32 @fprintf(i32 %14, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%16 = call i32 @exit_program(i32 1)
br label %17
17: ; preds = %13, %3
%18 = load i32, i32* %7
ret i32 %18
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [14 x i8] c"socket error\0A\00"
define i32 @Socket(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @socket(i32 %0, i32 %1, i32 %2)
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %3
%7 = load i32, i32* @stderr
%8 = tail call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%9 = tail call i32 @exit_program(i32 1)
br label %10
10: ; preds = %6, %3
ret i32 %4
}
void strip(char *str, int len) {
  int i;
  for (i = 0; i < len; i++) {
    if (str[i] == '\n') {
      str[i] = '\0';
      break;
    }
  }
}


x86 assembly (clang, -O0):
<strip>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1157 <strip+0x57>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0xa,%eax
jne    1144 <strip+0x44>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
jmp    1157 <strip+0x57>
jmp    1149 <strip+0x49>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1112 <strip+0x12>
pop    %rbp
ret

x86 assembly (clang, -O2):
<strip>:
test   %esi,%esi
jle    111f <strip+0x1f>
mov    %esi,%eax
xor    %ecx,%ecx
nopl   0x0(%rax,%rax,1)
cmpb   $0xa,(%rdi,%rcx,1)
je     1120 <strip+0x20>
add    $0x1,%rcx
cmp    %rcx,%rax
jne    1110 <strip+0x10>
ret
movb   $0x0,(%rdi,%rcx,1)
ret

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

LLVM IR (-O2):
define void @strip(i8* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %17
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %14
%7 = phi i64 [ 0, %4 ], [ %15, %14 ]
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 10
br i1 %10, label %11, label %14
11: ; preds = %6
%12 = and i64 %7, 4294967295
%13 = getelementptr inbounds i8, i8* %0, i64 %12
store i8 0, i8* %13
br label %17
14: ; preds = %6
%15 = add nuw nsw i64 %7, 1
%16 = icmp eq i64 %15, %5
br i1 %16, label %17, label %6
17: ; preds = %14, %2, %11
ret void
}
unsigned avcodec_build(void) { return 4680; }


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

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

LLVM IR (-O0):
define i32 @avcodec_build() {
ret i32 4680
}

LLVM IR (-O2):
define i32 @avcodec_build() {
ret i32 4680
}
int get_core_num() { return 0; }


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

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

LLVM IR (-O0):
define i32 @get_core_num() {
ret i32 0
}

LLVM IR (-O2):
define i32 @get_core_num() {
ret i32 0
}
/* Variables and functions */
int count(unsigned long, unsigned short);
long sum(unsigned long r, unsigned short size) {
  return 2 * count(r, size) - size;
}


x86 assembly (clang, -O0):
<sum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
mov    -0x8(%rbp),%rdi
movzwl -0xa(%rbp),%esi
call   1030 <count@plt>
shl    $0x1,%eax
movzwl -0xa(%rbp),%ecx
sub    %ecx,%eax
cltq
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sum>:
push   %rbx
mov    %esi,%ebx
call   1030 <count@plt>
add    %eax,%eax
sub    %ebx,%eax
cltq
pop    %rbx
ret

LLVM IR (-O0):
define i64 @sum(i64 %0, i16 zeroext %1) {
%3 = alloca i64
%4 = alloca i16
store i64 %0, i64* %3
store i16 %1, i16* %4
%5 = load i64, i64* %3
%6 = load i16, i16* %4
%7 = call i32 @count(i64 %5, i16 zeroext %6)
%8 = mul nsw i32 2, %7
%9 = load i16, i16* %4
%10 = zext i16 %9 to i32
%11 = sub nsw i32 %8, %10
%12 = sext i32 %11 to i64
ret i64 %12
}

LLVM IR (-O2):
define i64 @sum(i64 %0, i16 zeroext %1) {
%3 = tail call i32 @count(i64 %0, i16 zeroext %1)
%4 = shl nsw i32 %3, 1
%5 = zext i16 %1 to i32
%6 = sub nsw i32 %4, %5
%7 = sext i32 %6 to i64
ret i64 %7
}
int delete_obstacle(long obs[2 * 10 + 1]) {
  obs[0] = obs[0];
  return (1);
}


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

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

LLVM IR (-O0):
define i32 @delete_obstacle(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = getelementptr inbounds i64, i64* %3, i64 0
%5 = load i64, i64* %4
%6 = load i64*, i64** %2
%7 = getelementptr inbounds i64, i64* %6, i64 0
store i64 %5, i64* %7
ret i32 1
}

LLVM IR (-O2):
define i32 @delete_obstacle(i64* nocapture readnone %0) {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  bool a;
  for (a = 128; a > 0; a >>= 1) {
    printf("hi");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x80,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    114a <main+0x3a>
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [3 x i8] c"hi\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 128, i32* %2
br label %3
3: ; preds = %8, %0
%4 = load i32, i32* %2
%5 = icmp sgt i32 %4, 0
br i1 %5, label %6, label %11
6: ; preds = %3
%7 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6
%9 = load i32, i32* %2
%10 = ashr i32 %9, 1
store i32 %10, i32* %2
br label %3
11: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"hi\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
scalar_t__ EOF;
scalar_t__ getchar();
int /*<<< orphan*/ printf(char *, double);
void printCharNumberV2() {
  double nc;
  for (nc = 0; getchar() != EOF; ++nc) {
    ;
  }
  printf("%.0f\n", nc);
}


x86 assembly (clang, -O0):
<printCharNumberV2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    0x2eaa(%rip),%rcx
cmp    (%rcx),%rax
je     1163 <printCharNumberV2+0x43>
jmp    114c <printCharNumberV2+0x2c>
movsd  0xeac(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1130 <printCharNumberV2+0x10>
movsd  -0x8(%rbp),%xmm0
lea    0xe99(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printCharNumberV2>:
push   %rbx
sub    $0x10,%rsp
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2eb5(%rip),%rbx
xorpd  %xmm0,%xmm0
cmp    (%rbx),%rax
je     1160 <printCharNumberV2+0x40>
xorpd  %xmm0,%xmm0
addsd  0xeb8(%rip),%xmm0
movsd  %xmm0,0x8(%rsp)
xor    %eax,%eax
call   1040 <getchar@plt>
movsd  0x8(%rsp),%xmm0
cmp    (%rbx),%rax
jne    1140 <printCharNumberV2+0x20>
lea    0xea1(%rip),%rdi
add    $0x10,%rsp
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@EOF = global i64 0
@.str = [6 x i8] c"%.0f\0A\00"
define void @printCharNumberV2() {
%1 = alloca double
store double 0.000000e+00, double* %1
br label %2
2: ; preds = %7, %0
%3 = call i64 (...) @getchar()
%4 = load i64, i64* @EOF
%5 = icmp ne i64 %3, %4
br i1 %5, label %6, label %10
6: ; preds = %2
br label %7
7: ; preds = %6
%8 = load double, double* %1
%9 = fadd double %8, 1.000000e+00
store double %9, double* %1
br label %2
10: ; preds = %2
%11 = load double, double* %1
%12 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), double %11)
ret void
}

LLVM IR (-O2):
@EOF = global i64 0
@.str = [6 x i8] c"%.0f\0A\00"
define void @printCharNumberV2() {
%1 = tail call i64 (...) @getchar()
%2 = load i64, i64* @EOF
%3 = icmp eq i64 %1, %2
br i1 %3, label %10, label %4
4: ; preds = %0, %4
%5 = phi double [ %6, %4 ], [ 0.000000e+00, %0 ]
%6 = fadd double %5, 1.000000e+00
%7 = tail call i64 (...) @getchar()
%8 = load i64, i64* @EOF
%9 = icmp eq i64 %7, %8
br i1 %9, label %10, label %4
10: ; preds = %4, %0
%11 = phi double [ 0.000000e+00, %0 ], [ %6, %4 ]
%12 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), double %11)
ret void
}