xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ TRUE;
int /*<<< orphan*/ clear();
int /*<<< orphan*/ curs_set(int /*<<< orphan*/);
int /*<<< orphan*/ endwin();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ initscr();
int /*<<< orphan*/ keypad(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ noecho();
int /*<<< orphan*/ refresh();
int /*<<< orphan*/ smitmainmenu();
int /*<<< orphan*/ stdscr;
int default_smit() {
  initscr();
  noecho();
  keypad(stdscr, TRUE);
  curs_set(0);
  smitmainmenu();
  clear();
  refresh();
  endwin();
  exit(0);
}


x86 assembly (clang, -O0):
<default_smit>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <initscr@plt>
mov    $0x0,%al
call   1080 <noecho@plt>
mov    0x2e3f(%rip),%rax
mov    (%rax),%edi
mov    0x2e2e(%rip),%rax
mov    (%rax),%esi
call   1030 <keypad@plt>
xor    %edi,%edi
call   10b0 <curs_set@plt>
mov    $0x0,%al
call   1060 <smitmainmenu@plt>
mov    $0x0,%al
call   10a0 <clear@plt>
mov    $0x0,%al
call   1050 <refresh@plt>
mov    $0x0,%al
call   1070 <endwin@plt>
xor    %edi,%edi
call   1090 <exit@plt>

x86 assembly (clang, -O2):
<default_smit>:
push   %rax
xor    %eax,%eax
call   1040 <initscr@plt>
xor    %eax,%eax
call   1080 <noecho@plt>
mov    0x2e42(%rip),%rax
mov    (%rax),%edi
mov    0x2e31(%rip),%rax
mov    (%rax),%esi
call   1030 <keypad@plt>
xor    %edi,%edi
call   10b0 <curs_set@plt>
xor    %eax,%eax
call   1060 <smitmainmenu@plt>
xor    %eax,%eax
call   10a0 <clear@plt>
xor    %eax,%eax
call   1050 <refresh@plt>
xor    %eax,%eax
call   1070 <endwin@plt>
xor    %edi,%edi
call   1090 <exit@plt>

LLVM IR (-O0):
@stdscr = global i32 0
@TRUE = global i32 0
define i32 @default_smit() {
%1 = call i32 (...) @initscr()
%2 = call i32 (...) @noecho()
%3 = load i32, i32* @stdscr
%4 = load i32, i32* @TRUE
%5 = call i32 @keypad(i32 %3, i32 %4)
%6 = call i32 @curs_set(i32 0)
%7 = call i32 (...) @smitmainmenu()
%8 = call i32 (...) @clear()
%9 = call i32 (...) @refresh()
%10 = call i32 (...) @endwin()
%11 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@stdscr = global i32 0
@TRUE = global i32 0
define i32 @default_smit() {
%1 = tail call i32 (...) @initscr()
%2 = tail call i32 (...) @noecho()
%3 = load i32, i32* @stdscr
%4 = load i32, i32* @TRUE
%5 = tail call i32 @keypad(i32 %3, i32 %4)
%6 = tail call i32 @curs_set(i32 0)
%7 = tail call i32 (...) @smitmainmenu()
%8 = tail call i32 (...) @clear()
%9 = tail call i32 (...) @refresh()
%10 = tail call i32 (...) @endwin()
%11 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int rand();
int random_number(int a, int b) {
  b++;
  return rand() % (b - a) + a;
}


x86 assembly (clang, -O0):
<random_number>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    -0x8(%rbp),%ecx
sub    -0x4(%rbp),%ecx
cltd
idiv   %ecx
mov    %edx,%eax
add    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<random_number>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <rand@plt>
sub    %ebp,%ebx
add    $0x1,%ebx
cltd
idiv   %ebx
add    %edx,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @random_number(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = add nsw i32 %5, 1
store i32 %6, i32* %4
%7 = call i32 (...) @rand()
%8 = load i32, i32* %4
%9 = load i32, i32* %3
%10 = sub nsw i32 %8, %9
%11 = srem i32 %7, %10
%12 = load i32, i32* %3
%13 = add nsw i32 %11, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @random_number(i32 %0, i32 %1) {
%3 = tail call i32 (...) @rand()
%4 = sub i32 1, %0
%5 = add i32 %4, %1
%6 = srem i32 %3, %5
%7 = add nsw i32 %6, %0
ret i32 %7
}
void gtk_widget_remove_accelerator() {}


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

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

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

LLVM IR (-O2):
define void @gtk_widget_remove_accelerator() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ _wall_Date(int);
uint64_t real_Date(void) { return _wall_Date(true); }


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

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

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

LLVM IR (-O2):
define i32 @real_Date() {
%1 = tail call i32 @_wall_Date(i32 1)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isprint(int);
void t_isprint_0x95() {
  Assert_real((isprint(149) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isprint.c",
              750, ("isprint should be 0 for 0x95"));
}


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

x86 assembly (clang, -O2):
<t_isprint_0x95>:
push   %rax
mov    $0x95,%edi
call   1030 <isprint@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x2ee,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

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

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isprint.c\00"
@.str.1 = [29 x i8] c"isprint should be 0 for 0x95\00"
define void @t_isprint_0x95() {
%1 = tail call i64 @isprint(i32 149)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 750, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void outb(unsigned char value, unsigned short int port) {
  __asm__ __volatile__("outb %b0,%w1" : : "a"(value), "Nd"(port));
}


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

x86 assembly (clang, -O2):
<outb>:
mov    %esi,%edx
mov    %edi,%eax
out    %al,(%dx)
ret

LLVM IR (-O0):
define void @outb(i8 zeroext %0, i16 zeroext %1) {
%3 = alloca i8
%4 = alloca i16
store i8 %0, i8* %3
store i16 %1, i16* %4
%5 = load i8, i8* %3
%6 = load i16, i16* %4
ret void
}

LLVM IR (-O2):
define void @outb(i8 zeroext %0, i16 zeroext %1) {
tail call void asm sideeffect "outb ${0:b},${1:w}", "{ax},N{dx},~{dirflag},~{fpsr},~{flags}"(i8 %0, i16 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, double);
void ftod(double value, char *strDouble) { sprintf(strDouble, "%.2f", value); }


x86 assembly (clang, -O0):
<ftod>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
movsd  -0x8(%rbp),%xmm0
lea    0xecf(%rip),%rsi
call   1030 <sprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ftod>:
lea    0xee9(%rip),%rsi
jmp    1030 <sprintf@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"%.2f\00"
define void @ftod(double %0, i8* %1) {
%3 = alloca double
%4 = alloca i8*
store double %0, double* %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = load double, double* %3
%7 = call i32 @sprintf(i8* %5, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), double %6)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"%.2f\00"
define void @ftod(double %0, i8* nocapture writeonly %1) {
%3 = tail call i32 @sprintf(i8* dereferenceable(1) %1, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), double %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ __do_eh_ctor();
int /*<<< orphan*/ _pnacl_wrapper_start(int /*<<< orphan*/ *);
void __pnacl_start(uint32_t *info) {
  __do_eh_ctor();
  _pnacl_wrapper_start(info);
}


x86 assembly (clang, -O0):
<__pnacl_start>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <__do_eh_ctor@plt>
mov    -0x8(%rbp),%rdi
call   1040 <_pnacl_wrapper_start@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__pnacl_start>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <__do_eh_ctor@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <_pnacl_wrapper_start@plt>

LLVM IR (-O0):
define void @__pnacl_start(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = call i32 (...) @__do_eh_ctor()
%4 = load i32*, i32** %2
%5 = call i32 @_pnacl_wrapper_start(i32* %4)
ret void
}

LLVM IR (-O2):
define void @__pnacl_start(i32* %0) {
%2 = tail call i32 (...) @__do_eh_ctor()
%3 = tail call i32 @_pnacl_wrapper_start(i32* %0)
ret void
}
int cmp_long_lt(const void *a, const void *b) {
  long a_ = *(long *)a;
  long b_ = *(long *)b;
  if (a_ < b_)
    return -1;
  if (a_ > b_)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<cmp_long_lt>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x28(%rbp),%rax
jge    113c <cmp_long_lt+0x3c>
movl   $0xffffffff,-0x4(%rbp)
jmp    115d <cmp_long_lt+0x5d>
mov    -0x20(%rbp),%rax
cmp    -0x28(%rbp),%rax
jle    1156 <cmp_long_lt+0x56>
movl   $0x1,-0x4(%rbp)
jmp    115d <cmp_long_lt+0x5d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp_long_lt>:
mov    (%rdi),%rax
xor    %ecx,%ecx
cmp    (%rsi),%rax
setg   %cl
mov    $0xffffffff,%eax
cmovge %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @cmp_long_lt(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i64*
%4 = load i64, i64* %3
%5 = bitcast i8* %1 to i64*
%6 = load i64, i64* %5
%7 = icmp slt i64 %4, %6
%8 = icmp sgt i64 %4, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void mstatus(int state) { printf("state: %d\n", state); }


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

x86 assembly (clang, -O2):
<mstatus>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"state: %d\0A\00"
define void @mstatus(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"state: %d\0A\00"
define void @mstatus(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
int __child_left(const int idx) { return idx * 2 + 1; }


x86 assembly (clang, -O0):
<__child_left>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
add    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__child_left>:
lea    (%rdi,%rdi,1),%eax
add    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @__child_left(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 %3, 2
%5 = add nsw i32 %4, 1
ret i32 %5
}

LLVM IR (-O2):
define i32 @__child_left(i32 %0) {
%2 = shl nsw i32 %0, 1
%3 = or i32 %2, 1
ret i32 %3
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
void mcnet_write_uint16(uint8_t *out, uint16_t in) {
  out[0] = ((in >> 8) & 0xFF);
  out[1] = ((in >> 0) & 0xFF);
}


x86 assembly (clang, -O0):
<mcnet_write_uint16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
sar    $0x8,%ecx
and    $0xff,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0xc(%rbp),%ecx
sar    $0x0,%ecx
and    $0xff,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x4(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<mcnet_write_uint16>:
mov    %esi,%eax
movzbl %ah,%ecx
mov    %ecx,(%rdi)
movzbl %al,%eax
mov    %eax,0x4(%rdi)
ret

LLVM IR (-O0):
define void @mcnet_write_uint16(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = ashr i32 %5, 8
%7 = and i32 %6, 255
%8 = load i32*, i32** %3
%9 = getelementptr inbounds i32, i32* %8, i64 0
store i32 %7, i32* %9
%10 = load i32, i32* %4
%11 = ashr i32 %10, 0
%12 = and i32 %11, 255
%13 = load i32*, i32** %3
%14 = getelementptr inbounds i32, i32* %13, i64 1
store i32 %12, i32* %14
ret void
}

LLVM IR (-O2):
define void @mcnet_write_uint16(i32* nocapture writeonly %0, i32 %1) {
%3 = lshr i32 %1, 8
%4 = and i32 %3, 255
store i32 %4, i32* %0
%5 = and i32 %1, 255
%6 = getelementptr inbounds i32, i32* %0, i64 1
store i32 %5, i32* %6
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int x, y;
  x = 10;
  y = 20;
  x = x + y;
  printf("after addition: %d\n", x);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
movl   $0x14,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [20 x i8] c"after addition: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 10, i32* %2
store i32 20, i32* %3
%4 = load i32, i32* %2
%5 = load i32, i32* %3
%6 = add nsw i32 %4, %5
store i32 %6, i32* %2
%7 = load i32, i32* %2
%8 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [20 x i8] c"after addition: %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 30)
ret i32 0
}
/* Type definitions */
struct tsm_screen {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ inc_age(struct tsm_screen *);
int /*<<< orphan*/ screen_scroll_up(struct tsm_screen *, unsigned int);
__attribute__((visibility("default"))) void
tsm_screen_scroll_up(struct tsm_screen *con, unsigned int num) {
  if (!con || !num)
    return;
  inc_age(con);
  screen_scroll_up(con, num);
}


x86 assembly (clang, -O0):
<tsm_screen_scroll_up>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1144 <tsm_screen_scroll_up+0x24>
cmpl   $0x0,-0xc(%rbp)
jne    1149 <tsm_screen_scroll_up+0x29>
jmp    115e <tsm_screen_scroll_up+0x3e>
mov    -0x8(%rbp),%rdi
call   1030 <inc_age@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <screen_scroll_up@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tsm_screen_scroll_up>:
push   %rbp
push   %rbx
push   %rax
test   %rdi,%rdi
je     1146 <tsm_screen_scroll_up+0x26>
mov    %esi,%ebp
test   %esi,%esi
je     1146 <tsm_screen_scroll_up+0x26>
mov    %rdi,%rbx
call   1030 <inc_age@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <screen_scroll_up@plt>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.tsm_screen = type { i32 }
define void @tsm_screen_scroll_up(%struct.tsm_screen* %0, i32 %1) {
%3 = alloca %struct.tsm_screen*
%4 = alloca i32
store %struct.tsm_screen* %0, %struct.tsm_screen** %3
store i32 %1, i32* %4
%5 = load %struct.tsm_screen*, %struct.tsm_screen** %3
%6 = icmp ne %struct.tsm_screen* %5, null
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i32, i32* %4
%9 = icmp ne i32 %8, 0
br i1 %9, label %11, label %10
10: ; preds = %7, %2
br label %17
11: ; preds = %7
%12 = load %struct.tsm_screen*, %struct.tsm_screen** %3
%13 = call i32 @inc_age(%struct.tsm_screen* %12)
%14 = load %struct.tsm_screen*, %struct.tsm_screen** %3
%15 = load i32, i32* %4
%16 = call i32 @screen_scroll_up(%struct.tsm_screen* %14, i32 %15)
br label %17
17: ; preds = %11, %10
ret void
}

LLVM IR (-O2):
%struct.tsm_screen = type { i32 }
define void @tsm_screen_scroll_up(%struct.tsm_screen* %0, i32 %1) {
%3 = icmp ne %struct.tsm_screen* %0, null
%4 = icmp ne i32 %1, 0
%5 = and i1 %3, %4
br i1 %5, label %6, label %9
6: ; preds = %2
%7 = tail call i32 @inc_age(%struct.tsm_screen* %0)
%8 = tail call i32 @screen_scroll_up(%struct.tsm_screen* %0, i32 %1)
br label %9
9: ; preds = %2, %6
ret void
}
/* Variables and functions */
double atof(char *);
int /*<<< orphan*/ exit(int);
scalar_t__ fork();
double e(void (*f)(char *)) {
  char tmp[10];
  double x;
  f(tmp);
  x = atof(tmp);
  if (fork() != 0)
    exit(1);
  return x;
}


x86 assembly (clang, -O0):
<e>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
lea    -0x12(%rbp),%rdi
call   *%rax
lea    -0x12(%rbp),%rdi
call   1030 <atof@plt>
movsd  %xmm0,-0x20(%rbp)
mov    $0x0,%al
call   1050 <fork@plt>
cmp    $0x0,%rax
je     116f <e+0x3f>
mov    $0x1,%edi
call   1040 <exit@plt>
movsd  -0x20(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<e>:
push   %rbx
sub    $0x20,%rsp
mov    %rdi,%rax
lea    0x16(%rsp),%rbx
mov    %rbx,%rdi
call   *%rax
mov    %rbx,%rdi
call   1030 <atof@plt>
movsd  %xmm0,0x8(%rsp)
xor    %eax,%eax
call   1050 <fork@plt>
test   %rax,%rax
jne    1168 <e+0x38>
movsd  0x8(%rsp),%xmm0
add    $0x20,%rsp
pop    %rbx
ret
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define double @e(void (i8*)* %0) {
%2 = alloca void (i8*)*
%3 = alloca [10 x i8]
%4 = alloca double
store void (i8*)* %0, void (i8*)** %2
%5 = load void (i8*)*, void (i8*)** %2
%6 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%7 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%8 = call double @atof(i8* %7)
store double %8, double* %4
%9 = call i64 (...) @fork()
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %1
%12 = call i32 @exit(i32 1)
unreachable
13: ; preds = %1
%14 = load double, double* %4
ret double %14
}

LLVM IR (-O2):
define double @e(void (i8*)* nocapture %0) {
%2 = alloca [10 x i8]
%3 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%4 = call double @atof(i8* %3)
%5 = call i64 (...) @fork()
%6 = icmp eq i64 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %1
%8 = call i32 @exit(i32 1)
unreachable
9: ; preds = %1
ret double %4
}
/* Type definitions */
struct buffer {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ buf_advance(struct buffer *, int /*<<< orphan*/);
scalar_t__ buf_string_match_head_str(struct buffer *, char const *);
int /*<<< orphan*/ strlen(char const *);
int buf_string_compare_advance(struct buffer *src, const char *match) {
  if (buf_string_match_head_str(src, match)) {
    buf_advance(src, strlen(match));
    return 1;
  } else
    return 0;
}


x86 assembly (clang, -O0):
<buf_string_compare_advance>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <buf_string_match_head_str@plt>
cmp    $0x0,%rax
je     117f <buf_string_compare_advance+0x4f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x20(%rbp),%rdi
mov    %eax,%esi
call   1050 <buf_advance@plt>
movl   $0x1,-0x4(%rbp)
jmp    1186 <buf_string_compare_advance+0x56>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<buf_string_compare_advance>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
call   1040 <buf_string_match_head_str@plt>
test   %rax,%rax
je     115d <buf_string_compare_advance+0x2d>
mov    %rbx,%rdi
call   1030 <strlen@plt>
mov    %r14,%rdi
mov    %eax,%esi
call   1050 <buf_advance@plt>
mov    $0x1,%eax
jmp    115f <buf_string_compare_advance+0x2f>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.buffer = type { i32 }
define i32 @buf_string_compare_advance(%struct.buffer* %0, i8* %1) {
%3 = alloca i32
%4 = alloca %struct.buffer*
%5 = alloca i8*
store %struct.buffer* %0, %struct.buffer** %4
store i8* %1, i8** %5
%6 = load %struct.buffer*, %struct.buffer** %4
%7 = load i8*, i8** %5
%8 = call i64 @buf_string_match_head_str(%struct.buffer* %6, i8* %7)
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %15
10: ; preds = %2
%11 = load %struct.buffer*, %struct.buffer** %4
%12 = load i8*, i8** %5
%13 = call i32 @strlen(i8* %12)
%14 = call i32 @buf_advance(%struct.buffer* %11, i32 %13)
store i32 1, i32* %3
br label %16
15: ; preds = %2
store i32 0, i32* %3
br label %16
16: ; preds = %15, %10
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
%struct.buffer = type { i32 }
define i32 @buf_string_compare_advance(%struct.buffer* %0, i8* %1) {
%3 = tail call i64 @buf_string_match_head_str(%struct.buffer* %0, i8* %1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = tail call i32 @strlen(i8* %1)
%7 = tail call i32 @buf_advance(%struct.buffer* %0, i32 %6)
br label %8
8: ; preds = %2, %5
%9 = phi i32 [ 1, %5 ], [ 0, %2 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, unsigned char, int);
int /*<<< orphan*/ stderr;
void u(int x) { fprintf(stderr, "%c%d\n", 'u', x); }


x86 assembly (clang, -O0):
<u>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ebe(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%ecx
lea    0xed2(%rip),%rsi
mov    $0x75,%edx
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<u>:
mov    %edi,%ecx
mov    0x2ec7(%rip),%rax
mov    (%rax),%edi
lea    0xede(%rip),%rsi
mov    $0x75,%edx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [6 x i8] c"%c%d\0A\00"
define void @u(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @stderr
%4 = load i32, i32* %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8 zeroext 117, i32 %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [6 x i8] c"%c%d\0A\00"
define void @u(i32 %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8 zeroext 117, i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ arm_arith_add(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ arm_data_regi_op();
void arm_add_regi() { arm_arith_add(arm_data_regi_op(), 0); }


x86 assembly (clang, -O0):
<arm_add_regi>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <arm_data_regi_op@plt>
mov    %eax,%edi
xor    %esi,%esi
call   1030 <arm_arith_add@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<arm_add_regi>:
push   %rax
xor    %eax,%eax
call   1040 <arm_data_regi_op@plt>
mov    %eax,%edi
xor    %esi,%esi
pop    %rax
jmp    1030 <arm_arith_add@plt>

LLVM IR (-O0):
define void @arm_add_regi() {
%1 = call i32 (...) @arm_data_regi_op()
%2 = call i32 @arm_arith_add(i32 %1, i32 0)
ret void
}

LLVM IR (-O2):
define void @arm_add_regi() {
%1 = tail call i32 (...) @arm_data_regi_op()
%2 = tail call i32 @arm_arith_add(i32 %1, i32 0)
ret void
}
/* Type definitions */
typedef scalar_t__ uint64_t;
struct timespec {
  unsigned long long tv_sec;
  scalar_t__ tv_nsec;
};

/* Variables and functions */
int /*<<< orphan*/ CLOCK_MONOTONIC;
int /*<<< orphan*/ clock_gettime(int /*<<< orphan*/, struct timespec *);
uint64_t ns() {
  struct timespec ts;
  clock_gettime(CLOCK_MONOTONIC, &ts);
  return ts.tv_sec * 1000000000ULL + ts.tv_nsec;
}


x86 assembly (clang, -O0):
<ns>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    -0x10(%rbp),%rsi
call   1030 <clock_gettime@plt>
imul   $0x3b9aca00,-0x10(%rbp),%rax
3b
add    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ns>:
sub    $0x18,%rsp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
lea    0x8(%rsp),%rsi
call   1030 <clock_gettime@plt>
imul   $0x3b9aca00,0x8(%rsp),%rax
9a 3b
add    0x10(%rsp),%rax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timespec = type { i64, i64 }
@CLOCK_MONOTONIC = global i32 0
define i64 @ns() {
%1 = alloca %struct.timespec
%2 = load i32, i32* @CLOCK_MONOTONIC
%3 = call i32 @clock_gettime(i32 %2, %struct.timespec* %1)
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 0
%5 = load i64, i64* %4
%6 = mul i64 %5, 1000000000
%7 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 1
%8 = load i64, i64* %7
%9 = add i64 %6, %8
ret i64 %9
}

LLVM IR (-O2):
%struct.timespec = type { i64, i64 }
@CLOCK_MONOTONIC = global i32 0
define i64 @ns() {
%1 = alloca %struct.timespec
%2 = bitcast %struct.timespec* %1 to i8*
%3 = load i32, i32* @CLOCK_MONOTONIC
%4 = call i32 @clock_gettime(i32 %3, %struct.timespec* %1)
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 0
%6 = load i64, i64* %5
%7 = mul i64 %6, 1000000000
%8 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 1
%9 = load i64, i64* %8
%10 = add i64 %7, %9
ret i64 %10
}
void time_travel_set_time(unsigned long long ns) {}


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

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

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

LLVM IR (-O2):
define void @time_travel_set_time(i64 %0) {
ret void
}
/* Variables and functions */
int HibernateTamperStatusGet();
bool HibernateTamperExtOscValid(void) {
  if (HibernateTamperStatusGet() & (0x00000008 | 0x00000004)) {
    return (true);
  }
  return (false);
}


x86 assembly (clang, -O0):
<HibernateTamperExtOscValid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <HibernateTamperStatusGet@plt>
and    $0xc,%eax
cmp    $0x0,%eax
je     1137 <HibernateTamperExtOscValid+0x27>
movl   $0x1,-0x4(%rbp)
jmp    113e <HibernateTamperExtOscValid+0x2e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<HibernateTamperExtOscValid>:
push   %rax
xor    %eax,%eax
call   1030 <HibernateTamperStatusGet@plt>
xor    %ecx,%ecx
test   $0xc,%al
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @HibernateTamperExtOscValid() {
%1 = alloca i32
%2 = call i32 (...) @HibernateTamperStatusGet()
%3 = and i32 %2, 12
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %0
store i32 1, i32* %1
br label %7
6: ; preds = %0
store i32 0, i32* %1
br label %7
7: ; preds = %6, %5
%8 = load i32, i32* %1
ret i32 %8
}

LLVM IR (-O2):
define i32 @HibernateTamperExtOscValid() {
%1 = tail call i32 (...) @HibernateTamperStatusGet()
%2 = and i32 %1, 12
%3 = icmp ne i32 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
int isctype(char c, unsigned long f) {
  return (c < 1 || c > 10) ? 0 : !!(c & f);
}


x86 assembly (clang, -O0):
<isctype>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x1,%eax
jl     1128 <isctype+0x28>
movsbl -0x1(%rbp),%eax
cmp    $0xa,%eax
jle    1132 <isctype+0x32>
xor    %eax,%eax
mov    %eax,-0x14(%rbp)
jmp    114e <isctype+0x4e>
movsbq -0x1(%rbp),%rax
and    -0x10(%rbp),%rax
cmp    $0x0,%rax
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isctype>:
lea    -0x1(%rdi),%eax
cmp    $0xa,%al
setb   %al
movslq %edi,%rcx
test   %rsi,%rcx
setne  %cl
and    %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @isctype(i8 signext %0, i64 %1) {
%3 = alloca i8
%4 = alloca i64
store i8 %0, i8* %3
store i64 %1, i64* %4
%5 = load i8, i8* %3
%6 = sext i8 %5 to i32
%7 = icmp slt i32 %6, 1
br i1 %7, label %12, label %8
8: ; preds = %2
%9 = load i8, i8* %3
%10 = sext i8 %9 to i32
%11 = icmp sgt i32 %10, 10
br i1 %11, label %12, label %13
12: ; preds = %8, %2
br label %22
13: ; preds = %8
%14 = load i8, i8* %3
%15 = sext i8 %14 to i64
%16 = load i64, i64* %4
%17 = and i64 %15, %16
%18 = icmp ne i64 %17, 0
%19 = xor i1 %18, true
%20 = xor i1 %19, true
%21 = zext i1 %20 to i32
br label %22
22: ; preds = %13, %12
%23 = phi i32 [ 0, %12 ], [ %21, %13 ]
ret i32 %23
}

LLVM IR (-O2):
define i32 @isctype(i8 signext %0, i64 %1) {
%3 = add i8 %0, -1
%4 = icmp ult i8 %3, 10
%5 = sext i8 %0 to i64
%6 = and i64 %5, %1
%7 = icmp ne i64 %6, 0
%8 = and i1 %4, %7
%9 = zext i1 %8 to i32
ret i32 %9
}
/* Variables and functions */
int core7_swap(char *, int);
int U_EMRSETVIEWPORTORGEX_swap(char *record, int torev) {
  return (core7_swap(record, torev));
}


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

x86 assembly (clang, -O2):
<U_EMRSETVIEWPORTORGEX_swap>:
jmp    1030 <core7_swap@plt>

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

LLVM IR (-O2):
define i32 @U_EMRSETVIEWPORTORGEX_swap(i8* %0, i32 %1) {
%3 = tail call i32 @core7_swap(i8* %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ test_1();
int main(int argc, char *argv[]) {
  ((void)argc);
  ((void)argv);
  test_1();
  return EXIT_SUCCESS;
}


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 <test_1@plt>
mov    0x2eac(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = load i8**, i8*** %5
%8 = call i32 (...) @test_1()
%9 = load i32, i32* @EXIT_SUCCESS
ret i32 %9
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @test_1()
%4 = load i32, i32* @EXIT_SUCCESS
ret i32 %4
}
/* Variables and functions */
scalar_t__ strcmp(char const *, char *);
int isASN(const char *comm) { return strcmp(comm, "asn") == 0; }


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

x86 assembly (clang, -O2):
<isASN>:
push   %rax
lea    0xee8(%rip),%rsi
call   1030 <strcmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"asn\00"
define i32 @isASN(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @strcmp(i8* %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
@.str = [4 x i8] c"asn\00"
define i32 @isASN(i8* %0) {
%2 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i64 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ cng_current_color_index(int);
int /*<<< orphan*/ cng_get_mouse_x();
int /*<<< orphan*/ cng_get_mouse_y();
int /*<<< orphan*/ cng_put_pixel(int /*<<< orphan*/, int /*<<< orphan*/);
int mon_depla() {
  cng_current_color_index(1);
  cng_put_pixel(cng_get_mouse_x(), cng_get_mouse_y());
}


x86 assembly (clang, -O0):
<mon_depla>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x1,%edi
call   1040 <cng_current_color_index@plt>
mov    $0x0,%al
call   1060 <cng_get_mouse_x@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1050 <cng_get_mouse_y@plt>
mov    -0x8(%rbp),%edi
mov    %eax,%esi
call   1030 <cng_put_pixel@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mon_depla>:
push   %rbx
mov    $0x1,%edi
call   1040 <cng_current_color_index@plt>
xor    %eax,%eax
call   1060 <cng_get_mouse_x@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1050 <cng_get_mouse_y@plt>
mov    %ebx,%edi
mov    %eax,%esi
pop    %rbx
jmp    1030 <cng_put_pixel@plt>

LLVM IR (-O0):
define i32 @mon_depla() {
%1 = alloca i32
%2 = call i32 @cng_current_color_index(i32 1)
%3 = call i32 (...) @cng_get_mouse_x()
%4 = call i32 (...) @cng_get_mouse_y()
%5 = call i32 @cng_put_pixel(i32 %3, i32 %4)
%6 = load i32, i32* %1
ret i32 %6
}

LLVM IR (-O2):
define i32 @mon_depla() {
%1 = tail call i32 @cng_current_color_index(i32 1)
%2 = tail call i32 (...) @cng_get_mouse_x()
%3 = tail call i32 (...) @cng_get_mouse_y()
%4 = tail call i32 @cng_put_pixel(i32 %2, i32 %3)
ret i32 undef
}
/* Variables and functions */
double sig_aux(double);
double _sig(double t) { return t >= 0.0 ? sig_aux(t) : 1.0 - sig_aux(-t); }


x86 assembly (clang, -O0):
<_sig>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     1143 <_sig+0x33>
movsd  -0x8(%rbp),%xmm0
call   1030 <sig_aux@plt>
movsd  %xmm0,-0x10(%rbp)
jmp    1178 <_sig+0x68>
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
call   1030 <sig_aux@plt>
movaps %xmm0,%xmm1
movsd  0xe91(%rip),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_sig>:
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jae    113a <_sig+0x2a>
push   %rax
xorpd  0xedd(%rip),%xmm0
call   1030 <sig_aux@plt>
movsd  0xee0(%rip),%xmm1
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
pop    %rax
ret
jmp    1030 <sig_aux@plt>

LLVM IR (-O0):
define double @_sig(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp oge double %3, 0.000000e+00
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load double, double* %2
%7 = call double @sig_aux(double %6)
br label %13
8: ; preds = %1
%9 = load double, double* %2
%10 = fneg double %9
%11 = call double @sig_aux(double %10)
%12 = fsub double 1.000000e+00, %11
br label %13
13: ; preds = %8, %5
%14 = phi double [ %7, %5 ], [ %12, %8 ]
ret double %14
}

LLVM IR (-O2):
define double @_sig(double %0) {
%2 = fcmp ult double %0, 0.000000e+00
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call double @sig_aux(double %0)
br label %9
5: ; preds = %1
%6 = fneg double %0
%7 = tail call double @sig_aux(double %6)
%8 = fsub double 1.000000e+00, %7
br label %9
9: ; preds = %5, %3
%10 = phi double [ %4, %3 ], [ %8, %5 ]
ret double %10
}
/* Variables and functions */
int /*<<< orphan*/ quick_sort(int *, int /*<<< orphan*/, int);
void Qsort(int *array, int size) { quick_sort(array, 0, size - 1); }


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

x86 assembly (clang, -O2):
<Qsort>:
lea    -0x1(%rsi),%edx
xor    %esi,%esi
jmp    1030 <quick_sort@plt>

LLVM IR (-O0):
define void @Qsort(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32*, i32** %3
%6 = load i32, i32* %4
%7 = sub nsw i32 %6, 1
%8 = call i32 @quick_sort(i32* %5, i32 0, i32 %7)
ret void
}

LLVM IR (-O2):
define void @Qsort(i32* %0, i32 %1) {
%3 = add nsw i32 %1, -1
%4 = tail call i32 @quick_sort(i32* %0, i32 0, i32 %3)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ buf;

/* Variables and functions */
int /*<<< orphan*/ console_puts(char *);
int /*<<< orphan*/ snprintf(char *, int, char *, int);
void console_cur_up(int n) {
  char buf[32] = "\033[A";
  if (n)
    snprintf(buf, sizeof(buf), "\033[%dA", n);
  console_puts(buf);
}


x86 assembly (clang, -O0):
<console_cur_up>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    0xece(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xecb(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xec8(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec5(%rip),%rax
mov    %rax,-0x18(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1179 <console_cur_up+0x59>
lea    -0x30(%rbp),%rdi
mov    -0x4(%rbp),%ecx
mov    $0x20,%esi
lea    0xeac(%rip),%rdx
call   1040 <snprintf@plt>
lea    -0x30(%rbp),%rdi
call   1030 <console_puts@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<console_cur_up>:
sub    $0x28,%rsp
movaps 0xee5(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xec9(%rip),%xmm0
movaps %xmm0,(%rsp)
test   %edi,%edi
je     1155 <console_cur_up+0x35>
mov    %edi,%ecx
lea    0xed8(%rip),%rdx
mov    %rsp,%rdi
mov    $0x20,%esi
call   1040 <snprintf@plt>
mov    %rsp,%rdi
call   1030 <console_puts@plt>
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.console_cur_up.buf = [32 x i8] c"\1B[A\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@.str = [6 x i8] c"\1B[%dA\00"
define void @console_cur_up(i32 %0) {
%2 = alloca i32
%3 = alloca [32 x i8]
store i32 %0, i32* %2
%4 = bitcast [32 x i8]* %3 to i8*
%5 = load i32, i32* %2
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = getelementptr inbounds [32 x i8], [32 x i8]* %3, i64 0, i64 0
%9 = load i32, i32* %2
%10 = call i32 @snprintf(i8* %8, i32 32, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %9)
br label %11
11: ; preds = %7, %1
%12 = getelementptr inbounds [32 x i8], [32 x i8]* %3, i64 0, i64 0
%13 = call i32 @console_puts(i8* %12)
ret void
}

LLVM IR (-O2):
@__const.console_cur_up.buf = [32 x i8] c"\1B[A\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@.str = [6 x i8] c"\1B[%dA\00"
define void @console_cur_up(i32 %0) {
%2 = alloca [32 x i8]
%3 = getelementptr inbounds [32 x i8], [32 x i8]* %2, i64 0, i64 0
%4 = icmp eq i32 %0, 0
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = call i32 @snprintf(i8* %3, i32 32, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %0)
br label %7
7: ; preds = %5, %1
%8 = call i32 @console_puts(i8* %3)
ret void
}
int foo(int i, int j) {
  if (i < j) {
    if (i <= j)
      return j > i;
    else
      return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1144 <foo+0x44>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     1138 <foo+0x38>
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
setg   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
jmp    114b <foo+0x4b>
movl   $0x0,-0x4(%rbp)
jmp    114b <foo+0x4b>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @foo(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %4
%7 = load i32, i32* %5
%8 = icmp slt i32 %6, %7
br i1 %8, label %9, label %19
9: ; preds = %2
%10 = load i32, i32* %4
%11 = load i32, i32* %5
%12 = icmp sle i32 %10, %11
br i1 %12, label %13, label %18
13: ; preds = %9
%14 = load i32, i32* %5
%15 = load i32, i32* %4
%16 = icmp sgt i32 %14, %15
%17 = zext i1 %16 to i32
store i32 %17, i32* %3
br label %20
18: ; preds = %9
store i32 0, i32* %3
br label %20
19: ; preds = %2
store i32 1, i32* %3
br label %20
20: ; preds = %19, %18, %13
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
define i32 @foo(i32 %0, i32 %1) {
ret i32 1
}
int do_410() { return 410; }


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

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

LLVM IR (-O0):
define i32 @do_410() {
ret i32 410
}

LLVM IR (-O2):
define i32 @do_410() {
ret i32 410
}
/* Type definitions */
struct tuner {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
scalar_t__ tuner_is_muted(struct tuner const *);
void print_mute(const struct tuner *tuner) {
  if (tuner_is_muted(tuner))
    printf(" (radio is muted, use \"fm on\" to unmute)");
}


x86 assembly (clang, -O0):
<print_mute>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <tuner_is_muted@plt>
cmp    $0x0,%rax
je     114b <print_mute+0x2b>
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_mute>:
push   %rax
call   1040 <tuner_is_muted@plt>
test   %rax,%rax
je     1138 <print_mute+0x18>
lea    0xece(%rip),%rdi
pop    %rax
jmp    1030 <printf@plt>
pop    %rax
ret

LLVM IR (-O0):
%struct.tuner = type { i32 }
@.str = [41 x i8] c" (radio is muted, use \22fm on\22 to unmute)\00"
define void @print_mute(%struct.tuner* %0) {
%2 = alloca %struct.tuner*
store %struct.tuner* %0, %struct.tuner** %2
%3 = load %struct.tuner*, %struct.tuner** %2
%4 = call i64 @tuner_is_muted(%struct.tuner* %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %1
ret void
}

LLVM IR (-O2):
%struct.tuner = type { i32 }
@.str = [41 x i8] c" (radio is muted, use \22fm on\22 to unmute)\00"
define void @print_mute(%struct.tuner* %0) {
%2 = tail call i64 @tuner_is_muted(%struct.tuner* %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret void
}
int get32bit(unsigned char *p) {
  return (p[0] << 24) | (p[1] << 16) | (p[2] << 8) | p[3];
}


x86 assembly (clang, -O0):
<get32bit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
shl    $0x18,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x2(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x3(%rcx),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get32bit>:
mov    (%rdi),%eax
bswap  %eax
ret

LLVM IR (-O0):
define i32 @get32bit(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = shl i32 %6, 24
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = shl i32 %11, 16
%13 = or i32 %7, %12
%14 = load i8*, i8** %2
%15 = getelementptr inbounds i8, i8* %14, i64 2
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = shl i32 %17, 8
%19 = or i32 %13, %18
%20 = load i8*, i8** %2
%21 = getelementptr inbounds i8, i8* %20, i64 3
%22 = load i8, i8* %21
%23 = zext i8 %22 to i32
%24 = or i32 %19, %23
ret i32 %24
}

LLVM IR (-O2):
define i32 @get32bit(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = shl nuw i32 %3, 24
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = shl nuw nsw i32 %7, 16
%9 = or i32 %8, %4
%10 = getelementptr inbounds i8, i8* %0, i64 2
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = shl nuw nsw i32 %12, 8
%14 = or i32 %9, %13
%15 = getelementptr inbounds i8, i8* %0, i64 3
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = or i32 %14, %17
ret i32 %18
}
int quadratic(int n, int a, int b) { return n * n + a * n + b; }


x86 assembly (clang, -O0):
<quadratic>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
imul   -0x4(%rbp),%ecx
add    %ecx,%eax
add    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<quadratic>:
lea    (%rsi,%rdi,1),%eax
imul   %edi,%eax
add    %edx,%eax
ret

LLVM IR (-O0):
define i32 @quadratic(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %4
%9 = mul nsw i32 %7, %8
%10 = load i32, i32* %5
%11 = load i32, i32* %4
%12 = mul nsw i32 %10, %11
%13 = add nsw i32 %9, %12
%14 = load i32, i32* %6
%15 = add nsw i32 %13, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @quadratic(i32 %0, i32 %1, i32 %2) {
%4 = add i32 %1, %0
%5 = mul i32 %4, %0
%6 = add nsw i32 %5, %2
ret i32 %6
}