xunge/DecIR huggingface dataset:
const char *ls_cost_nm2_name_out(int i) {
  switch (i) {
  case 0:
    return "o0";
  case 1:
    return "o1";
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<ls_cost_nm2_name_out>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
test   %eax,%eax
je     112b <ls_cost_nm2_name_out+0x2b>
jmp    111a <ls_cost_nm2_name_out+0x1a>
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
je     113b <ls_cost_nm2_name_out+0x3b>
jmp    114b <ls_cost_nm2_name_out+0x4b>
lea    0xece(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1153 <ls_cost_nm2_name_out+0x53>
lea    0xec1(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1153 <ls_cost_nm2_name_out+0x53>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ls_cost_nm2_name_out>:
xor    %ecx,%ecx
cmp    $0x1,%edi
lea    0xef7(%rip),%rax
cmove  %rax,%rcx
test   %edi,%edi
lea    0xee7(%rip),%rax
cmovne %rcx,%rax
ret

LLVM IR (-O0):
@.str = [3 x i8] c"o0\00"
@.str.1 = [3 x i8] c"o1\00"
define i8* @ls_cost_nm2_name_out(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %7 [
i32 0, label %5
i32 1, label %6
]
5: ; preds = %1
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8** %2
br label %8
6: ; preds = %1
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %8
7: ; preds = %1
store i8* null, i8** %2
br label %8
8: ; preds = %7, %6, %5
%9 = load i8*, i8** %2
ret i8* %9
}

LLVM IR (-O2):
@.str = [3 x i8] c"o0\00"
@.str.1 = [3 x i8] c"o1\00"
define i8* @ls_cost_nm2_name_out(i32 %0) {
%2 = icmp eq i32 %0, 1
%3 = select i1 %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* null
%4 = icmp eq i32 %0, 0
%5 = select i1 %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
main() { printf("hello, my cat\n"); }


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

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

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

LLVM IR (-O2):
@str = [14 x i8] c"hello, my cat\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
void cont_handler(int num) {}


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

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

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

LLVM IR (-O2):
define void @cont_handler(i32 %0) {
ret void
}
/* Type definitions */
struct clk {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ might_sleep();
int clk_prepare(struct clk *clk) {
  might_sleep();
  return 0;
}


x86 assembly (clang, -O0):
<clk_prepare>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <might_sleep@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.clk = type { i32 }
define i32 @clk_prepare(%struct.clk* %0) {
%2 = alloca %struct.clk*
store %struct.clk* %0, %struct.clk** %2
%3 = call i32 (...) @might_sleep()
ret i32 0
}

LLVM IR (-O2):
%struct.clk = type { i32 }
define i32 @clk_prepare(%struct.clk* nocapture readnone %0) {
%2 = tail call i32 (...) @might_sleep()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
scalar_t__ malloc(int);
scalar_t__ no_malloc(int);
scalar_t__ smalloc(int);
int main(void) {
  int *v;
  v = (int *)smalloc(sizeof(*v));
  *v = 10;
  v = (int *)malloc(sizeof(*v));
  if (v == 0) {
    assert(0);
  } else {
    assert(0);
    *v != 0;
  }
  v = (int *)no_malloc(sizeof(*v));
  *v = 10;
  if (v == 0)
    exit(0);
  assert(0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x4,%edi
call   1050 <smalloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movl   $0xa,(%rax)
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    119c <main+0x4c>
xor    %edi,%edi
call   1030 <assert@plt>
jmp    11a3 <main+0x53>
xor    %edi,%edi
call   1030 <assert@plt>
mov    $0x4,%edi
call   1070 <no_malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movl   $0xa,(%rax)
cmpq   $0x0,-0x10(%rbp)
jne    11cd <main+0x7d>
xor    %edi,%edi
call   1060 <exit@plt>
xor    %edi,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x4,%edi
call   1050 <smalloc@plt>
movl   $0xa,(%rax)
mov    $0x4,%edi
call   1040 <malloc@plt>
xor    %edi,%edi
call   1030 <assert@plt>
mov    $0x4,%edi
call   1060 <no_malloc@plt>
movl   $0xa,(%rax)
xor    %edi,%edi
call   1030 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
store i32 0, i32* %1
%3 = call i64 @smalloc(i32 4)
%4 = inttoptr i64 %3 to i32*
store i32* %4, i32** %2
%5 = load i32*, i32** %2
store i32 10, i32* %5
%6 = call i64 @malloc(i32 4)
%7 = inttoptr i64 %6 to i32*
store i32* %7, i32** %2
%8 = load i32*, i32** %2
%9 = icmp eq i32* %8, null
br i1 %9, label %10, label %12
10: ; preds = %0
%11 = call i32 @assert(i32 0)
br label %18
12: ; preds = %0
%13 = call i32 @assert(i32 0)
%14 = load i32*, i32** %2
%15 = load i32, i32* %14
%16 = icmp ne i32 %15, 0
%17 = zext i1 %16 to i32
br label %18
18: ; preds = %12, %10
%19 = call i64 @no_malloc(i32 4)
%20 = inttoptr i64 %19 to i32*
store i32* %20, i32** %2
%21 = load i32*, i32** %2
store i32 10, i32* %21
%22 = load i32*, i32** %2
%23 = icmp eq i32* %22, null
br i1 %23, label %24, label %26
24: ; preds = %18
%25 = call i32 @exit(i32 0)
unreachable
26: ; preds = %18
%27 = call i32 @assert(i32 0)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 @smalloc(i32 4)
%2 = inttoptr i64 %1 to i32*
store i32 10, i32* %2
%3 = tail call i64 @malloc(i32 4)
%4 = tail call i32 @assert(i32 0)
%5 = tail call i64 @no_malloc(i32 4)
%6 = inttoptr i64 %5 to i32*
store i32 10, i32* %6
%7 = tail call i32 @assert(i32 0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ lock();
int rand();
int /*<<< orphan*/ unlock();
int f() {
  if (rand() % 2 == 0) {
    unlock();
  } else {
    f();
    lock();
  }
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1060 <rand@plt>
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    116c <f+0x2c>
mov    $0x0,%al
call   1030 <unlock@plt>
jmp    1178 <f+0x38>
call   1050 <f@plt>
mov    $0x0,%al
call   1040 <lock@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
push   %rax
xor    %eax,%eax
call   1060 <rand@plt>
test   $0x1,%al
jne    1155 <f+0x15>
xor    %eax,%eax
call   1030 <unlock@plt>
pop    %rcx
ret
call   1050 <f@plt>
xor    %eax,%eax
call   1040 <lock@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @f() {
%1 = alloca i32
%2 = call i32 (...) @rand()
%3 = srem i32 %2, 2
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = call i32 (...) @unlock()
br label %10
7: ; preds = %0
%8 = call i32 @f()
%9 = call i32 (...) @lock()
br label %10
10: ; preds = %7, %5
%11 = load i32, i32* %1
ret i32 %11
}

LLVM IR (-O2):
define i32 @f() {
%1 = tail call i32 (...) @rand()
%2 = and i32 %1, 1
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %7
4: ; preds = %0
%5 = tail call i32 (...) @unlock()
br label %6
6: ; preds = %4, %7
ret i32 undef
7: ; preds = %0
%8 = tail call i32 @f()
%9 = tail call i32 (...) @lock()
br label %6
}
/* Variables and functions */
int /*<<< orphan*/ __delay_cycles(int);
void delay_s(int s) {
  while (s--) {
    __delay_cycles(12004802);
  }
}


x86 assembly (clang, -O0):
<delay_s>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x4(%rbp)
cmp    $0x0,%eax
je     113e <delay_s+0x2e>
mov    $0xb72dc2,%edi
call   1030 <__delay_cycles@plt>
jmp    111b <delay_s+0xb>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<delay_s>:
push   %rbx
test   %edi,%edi
je     112f <delay_s+0x1f>
mov    %edi,%ebx
nopw   0x0(%rax,%rax,1)
mov    $0xb72dc2,%edi
call   1030 <__delay_cycles@plt>
add    $0xffffffff,%ebx
jne    1120 <delay_s+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @delay_s(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %8, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %5, %3 ], [ %0, %1 ]
%5 = add nsw i32 %4, -1
%6 = tail call i32 @__delay_cycles(i32 12004802)
%7 = icmp eq i32 %5, 0
br i1 %7, label %8, label %3
8: ; preds = %3, %1
ret void
}
/* Variables and functions */
int O_CREAT;
int O_WRONLY;
scalar_t__ fork();
int open(char *, int, int);
int /*<<< orphan*/ write(int, char *, int);
int main() {
  int fd = open("fff", O_WRONLY | O_CREAT, 0777);
  if (fork()) {
    write(fd, "Hello", 5);
  } else {
    write(fd, "Hello", 5);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2e8a(%rip),%rax
mov    (%rax),%esi
mov    0x2ea9(%rip),%rax
or     (%rax),%esi
lea    0xea8(%rip),%rdi
mov    $0x1ff,%edx
call   1040 <open@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1050 <fork@plt>
cmp    $0x0,%rax
je     118f <main+0x5f>
mov    -0x8(%rbp),%edi
lea    0xe84(%rip),%rsi
mov    $0x5,%edx
call   1030 <write@plt>
jmp    11a3 <main+0x73>
mov    -0x8(%rbp),%edi
lea    0xe6b(%rip),%rsi
mov    $0x5,%edx
call   1030 <write@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    0x2e98(%rip),%rax
mov    0x2eb9(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
lea    0xeb6(%rip),%rdi
mov    $0x1ff,%edx
call   1040 <open@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1050 <fork@plt>
lea    0xea0(%rip),%rsi
mov    %ebx,%edi
mov    $0x5,%edx
call   1030 <write@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"fff\00"
@O_WRONLY = global i32 0
@O_CREAT = global i32 0
@.str.1 = [6 x i8] c"Hello\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = load i32, i32* @O_WRONLY
%4 = load i32, i32* @O_CREAT
%5 = or i32 %3, %4
%6 = call i32 @open(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5, i32 511)
store i32 %6, i32* %2
%7 = call i64 (...) @fork()
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %0
%10 = load i32, i32* %2
%11 = call i32 @write(i32 %10, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 5)
br label %15
12: ; preds = %0
%13 = load i32, i32* %2
%14 = call i32 @write(i32 %13, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 5)
br label %15
15: ; preds = %12, %9
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"fff\00"
@O_WRONLY = global i32 0
@O_CREAT = global i32 0
@.str.1 = [6 x i8] c"Hello\00"
define i32 @main() {
%1 = load i32, i32* @O_WRONLY
%2 = load i32, i32* @O_CREAT
%3 = or i32 %2, %1
%4 = tail call i32 @open(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3, i32 511)
%5 = tail call i64 (...) @fork()
%6 = tail call i32 @write(i32 %4, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void cleanup(int foo) {
  fprintf(stderr, "writer stopped\n");
  fflush(stderr);
  exit(0);
}


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

x86 assembly (clang, -O2):
<cleanup>:
push   %rbx
mov    0x2ea8(%rip),%rbx
mov    (%rbx),%edi
lea    0xebf(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
call   1040 <fflush@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [16 x i8] c"writer stopped\0A\00"
define void @cleanup(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* @stderr
%6 = call i32 @fflush(i32 %5)
%7 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [16 x i8] c"writer stopped\0A\00"
define void @cleanup(i32 %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @stderr
%5 = tail call i32 @fflush(i32 %4)
%6 = tail call i32 @exit(i32 0)
unreachable
}
void ff_get_unscaled_swscale_arm() {}


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

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

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

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

/* Variables and functions */
int decode_uint8(int /*<<< orphan*/ **);
int /*<<< orphan*/ memcpy(char *, int /*<<< orphan*/ *, int);
void decode_str(uint8_t **payload, char *str) {
  int len = decode_uint8(payload);
  memcpy(str, (*payload), len);
  str[len] = 0;
  (*payload) += len;
}


x86 assembly (clang, -O0):
<decode_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <decode_uint8@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rax
mov    (%rax),%rsi
mov    -0x14(%rbp),%edx
call   1040 <memcpy@plt>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
movslq %edx,%rdx
shl    $0x2,%rdx
add    %rdx,%rcx
mov    %rcx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<decode_str>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <decode_uint8@plt>
mov    %eax,%ebp
mov    (%rbx),%rsi
mov    %r14,%rdi
mov    %eax,%edx
call   1040 <memcpy@plt>
movslq %ebp,%rax
movb   $0x0,(%r14,%rax,1)
shl    $0x2,%rax
add    %rax,(%rbx)
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @decode_str(i32** %0, i8* %1) {
%3 = alloca i32**
%4 = alloca i8*
%5 = alloca i32
store i32** %0, i32*** %3
store i8* %1, i8** %4
%6 = load i32**, i32*** %3
%7 = call i32 @decode_uint8(i32** %6)
store i32 %7, i32* %5
%8 = load i8*, i8** %4
%9 = load i32**, i32*** %3
%10 = load i32*, i32** %9
%11 = load i32, i32* %5
%12 = call i32 @memcpy(i8* %8, i32* %10, i32 %11)
%13 = load i8*, i8** %4
%14 = load i32, i32* %5
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8, i8* %13, i64 %15
store i8 0, i8* %16
%17 = load i32, i32* %5
%18 = load i32**, i32*** %3
%19 = load i32*, i32** %18
%20 = sext i32 %17 to i64
%21 = getelementptr inbounds i32, i32* %19, i64 %20
store i32* %21, i32** %18
ret void
}

LLVM IR (-O2):
define void @decode_str(i32** %0, i8* %1) {
%3 = tail call i32 @decode_uint8(i32** %0)
%4 = load i32*, i32** %0
%5 = tail call i32 @memcpy(i8* %1, i32* %4, i32 %3)
%6 = sext i32 %3 to i64
%7 = getelementptr inbounds i8, i8* %1, i64 %6
store i8 0, i8* %7
%8 = load i32*, i32** %0
%9 = getelementptr inbounds i32, i32* %8, i64 %6
store i32* %9, i32** %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ recv(int, char *, int, int /*<<< orphan*/);
void receiver(int sock, char *message) {
  printf("waiting for other player\n");
  recv(sock, message, 1024, 0);
  printf("<other player>:%s\n", message);
}


x86 assembly (clang, -O0):
<receiver>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    $0x400,%edx
xor    %ecx,%ecx
call   1030 <recv@plt>
mov    -0x10(%rbp),%rsi
lea    0xebf(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<receiver>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
lea    0xed4(%rip),%rdi
call   1040 <puts@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    $0x400,%edx
xor    %ecx,%ecx
call   1030 <recv@plt>
lea    0xea4(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <printf@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"waiting for other player\0A\00"
@.str.1 = [19 x i8] c"<other player>:%s\0A\00"
define void @receiver(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* %3
%7 = load i8*, i8** %4
%8 = call i32 @recv(i32 %6, i8* %7, i32 1024, i32 0)
%9 = load i8*, i8** %4
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i8* %9)
ret void
}

LLVM IR (-O2):
@.str.1 = [19 x i8] c"<other player>:%s\0A\00"
@str = [25 x i8] c"waiting for other player\00"
define void @receiver(i32 %0, i8* %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @recv(i32 %0, i8* %1, i32 1024, i32 0)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i8* %1)
ret void
}
/* Variables and functions */
scalar_t__ EOF;
int /*<<< orphan*/ imprimirAtrasoMaximo(int, int);
scalar_t__ scanf(char *, int *, int *);
int main(void) {
  int hora, minuto;
  while (scanf("%d:%d\n", &hora, &minuto) != EOF) {
    imprimirAtrasoMaximo(hora, minuto);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <scanf@plt>
mov    0x2e9e(%rip),%rcx
cmp    (%rcx),%rax
je     1163 <main+0x43>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <imprimirAtrasoMaximo@plt>
jmp    112f <main+0xf>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
lea    0xed1(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1040 <scanf@plt>
mov    0x2ea5(%rip),%r12
cmp    (%r12),%rax
je     1180 <main+0x60>
lea    0xeb0(%rip),%r14
lea    0x4(%rsp),%r15
mov    %rsp,%rbx
nopl   0x0(%rax,%rax,1)
mov    0x4(%rsp),%edi
mov    (%rsp),%esi
call   1030 <imprimirAtrasoMaximo@plt>
mov    %r14,%rdi
mov    %r15,%rsi
mov    %rbx,%rdx
call   1040 <scanf@plt>
cmp    (%r12),%rax
jne    1160 <main+0x40>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c"%d:%d\0A\00"
@EOF = global i64 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i64 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i64, i64* @EOF
%7 = icmp eq i64 %5, %6
br i1 %7, label %15, label %8
8: ; preds = %0, %8
%9 = load i32, i32* %1
%10 = load i32, i32* %2
%11 = call i32 @imprimirAtrasoMaximo(i32 %9, i32 %10)
%12 = call i64 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%13 = load i64, i64* @EOF
%14 = icmp eq i64 %12, %13
br i1 %14, label %15, label %8
15: ; preds = %8, %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ SIGABRT;
int /*<<< orphan*/ pause();
int /*<<< orphan*/ raise(int /*<<< orphan*/);
void my_abort() {
  raise(SIGABRT);
  pause();
}


x86 assembly (clang, -O0):
<my_abort>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
call   1030 <raise@plt>
mov    $0x0,%al
call   1040 <pause@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_abort>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
call   1030 <raise@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <pause@plt>

LLVM IR (-O0):
@SIGABRT = global i32 0
define void @my_abort() {
%1 = load i32, i32* @SIGABRT
%2 = call i32 @raise(i32 %1)
%3 = call i32 (...) @pause()
ret void
}

LLVM IR (-O2):
@SIGABRT = global i32 0
define void @my_abort() {
%1 = load i32, i32* @SIGABRT
%2 = tail call i32 @raise(i32 %1)
%3 = tail call i32 (...) @pause()
ret void
}
/* Type definitions */
struct timeval {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ exit(int);
scalar_t__ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
int /*<<< orphan*/ perror(char *);
void gettimeofday_or_die(struct timeval *tv) {
  if (gettimeofday(tv, NULL) < 0) {
    perror("gettimeofday failed");
    exit(2);
  }
}


x86 assembly (clang, -O0):
<gettimeofday_or_die>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
cmp    $0x0,%rax
jge    1169 <gettimeofday_or_die+0x39>
lea    0xea6(%rip),%rdi
call   1040 <perror@plt>
mov    $0x2,%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gettimeofday_or_die>:
push   %rax
xor    %esi,%esi
call   1030 <gettimeofday@plt>
test   %rax,%rax
js     113f <gettimeofday_or_die+0xf>
pop    %rax
ret
lea    0xeba(%rip),%rdi
call   1040 <perror@plt>
mov    $0x2,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
%struct.timeval = type { i32 }
@.str = [20 x i8] c"gettimeofday failed\00"
define void @gettimeofday_or_die(%struct.timeval* %0) {
%2 = alloca %struct.timeval*
store %struct.timeval* %0, %struct.timeval** %2
%3 = load %struct.timeval*, %struct.timeval** %2
%4 = call i64 @gettimeofday(%struct.timeval* %3, i32* null)
%5 = icmp slt i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = call i32 @perror(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @exit(i32 2)
unreachable
9: ; preds = %1
ret void
}

LLVM IR (-O2):
%struct.timeval = type { i32 }
@.str = [20 x i8] c"gettimeofday failed\00"
define void @gettimeofday_or_die(%struct.timeval* nocapture %0) {
%2 = tail call i64 @gettimeofday(%struct.timeval* %0, i32* null)
%3 = icmp slt i64 %2, 0
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 @perror(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @exit(i32 2)
unreachable
7: ; preds = %1
ret void
}
int livepatch_init(const char *base_path) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @livepatch_init(i8* nocapture readnone %0) {
ret i32 0
}
/* Type definitions */
struct _WsbmBufStorage {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ abort();
unsigned long pool_poolOffset(struct _WsbmBufStorage *buf) { abort(); }


x86 assembly (clang, -O0):
<pool_poolOffset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<pool_poolOffset>:
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
%struct._WsbmBufStorage = type { i32 }
define i64 @pool_poolOffset(%struct._WsbmBufStorage* %0) {
%2 = alloca %struct._WsbmBufStorage*
store %struct._WsbmBufStorage* %0, %struct._WsbmBufStorage** %2
%3 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
%struct._WsbmBufStorage = type { i32 }
define i64 @pool_poolOffset(%struct._WsbmBufStorage* nocapture readnone %0) {
%2 = tail call i32 (...) @abort()
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ Set_RGB_LED_Values(int /*<<< orphan*/, int /*<<< orphan*/,
                                      int /*<<< orphan*/);
void Set_RGB_LED(uint16_t *data) {
  Set_RGB_LED_Values(data[0], data[1], data[2]);
}


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

x86 assembly (clang, -O2):
<Set_RGB_LED>:
mov    (%rdi),%eax
mov    0x4(%rdi),%esi
mov    0x8(%rdi),%edx
mov    %eax,%edi
jmp    1030 <Set_RGB_LED_Values@plt>

LLVM IR (-O0):
define void @Set_RGB_LED(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 0
%5 = load i32, i32* %4
%6 = load i32*, i32** %2
%7 = getelementptr inbounds i32, i32* %6, i64 1
%8 = load i32, i32* %7
%9 = load i32*, i32** %2
%10 = getelementptr inbounds i32, i32* %9, i64 2
%11 = load i32, i32* %10
%12 = call i32 @Set_RGB_LED_Values(i32 %5, i32 %8, i32 %11)
ret void
}

LLVM IR (-O2):
define void @Set_RGB_LED(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = getelementptr inbounds i32, i32* %0, i64 1
%4 = load i32, i32* %3
%5 = getelementptr inbounds i32, i32* %0, i64 2
%6 = load i32, i32* %5
%7 = tail call i32 @Set_RGB_LED_Values(i32 %2, i32 %4, i32 %6)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ _strlen(char const *);
int /*<<< orphan*/ write(int, char const *, int /*<<< orphan*/);
ssize_t __write1(const char *s) { write(1, s, _strlen(s)); }


x86 assembly (clang, -O0):
<__write1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <_strlen@plt>
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
mov    $0x1,%edi
call   1030 <write@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__write1>:
push   %rbx
mov    %rdi,%rbx
call   1040 <_strlen@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    %eax,%edx
pop    %rbx
jmp    1030 <write@plt>

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

LLVM IR (-O2):
define i32 @__write1(i8* %0) {
%2 = tail call i32 @_strlen(i8* %0)
%3 = tail call i32 @write(i32 1, i8* %0, i32 %2)
ret i32 undef
}
void TMTimerGetNano(void) {}


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

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

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

LLVM IR (-O2):
define void @TMTimerGetNano() {
ret void
}
/* Variables and functions */
char *ft_strchr(const char *src, int c) {
  while (*src != c) {
    if (*src == '\0')
      return (NULL);
    src++;
  }
  return ((char *)src);
}


x86 assembly (clang, -O0):
<ft_strchr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    -0x14(%rbp),%eax
je     1149 <ft_strchr+0x49>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1138 <ft_strchr+0x38>
movq   $0x0,-0x8(%rbp)
jmp    1151 <ft_strchr+0x51>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    110b <ft_strchr+0xb>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_strchr>:
mov    %rdi,%rax
movsbl (%rdi),%ecx
cmp    %esi,%ecx
je     1120 <ft_strchr+0x20>
nopw   0x0(%rax,%rax,1)
test   %cl,%cl
je     1121 <ft_strchr+0x21>
movsbl 0x1(%rax),%ecx
add    $0x1,%rax
cmp    %esi,%ecx
jne    1110 <ft_strchr+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @ft_strchr(i8* %0, i32 %1) {
%3 = load i8, i8* %0
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, %1
br i1 %5, label %15, label %6
6: ; preds = %2, %10
%7 = phi i8 [ %12, %10 ], [ %3, %2 ]
%8 = phi i8* [ %11, %10 ], [ %0, %2 ]
%9 = icmp eq i8 %7, 0
br i1 %9, label %15, label %10
10: ; preds = %6
%11 = getelementptr inbounds i8, i8* %8, i64 1
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = icmp eq i32 %13, %1
br i1 %14, label %15, label %6
15: ; preds = %6, %10, %2
%16 = phi i8* [ %0, %2 ], [ %11, %10 ], [ null, %6 ]
ret i8* %16
}
/* Variables and functions */
scalar_t__ is_space(char const);
char *skip_spaces(const char *str) {
  while (is_space(*str)) {
    ++str;
  }
  return (char *)str;
}


x86 assembly (clang, -O0):
<skip_spaces>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <is_space@plt>
cmp    $0x0,%rax
je     1143 <skip_spaces+0x33>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <skip_spaces+0xc>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_spaces>:
push   %rbx
mov    %rdi,%rbx
add    $0xffffffffffffffff,%rbx
nopl   0x0(%rax,%rax,1)
movsbl 0x1(%rbx),%edi
add    $0x1,%rbx
call   1030 <is_space@plt>
test   %rax,%rax
jne    1120 <skip_spaces+0x10>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @skip_spaces(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %7, %2 ]
%4 = load i8, i8* %3
%5 = tail call i64 @is_space(i8 signext %4)
%6 = icmp eq i64 %5, 0
%7 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %6, label %8, label %2
8: ; preds = %2
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ system(char *);
int main() {
  printf("Hello World\n");
  system("ls /");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [13 x i8] c"Hello World\0A\00"
@.str.1 = [5 x i8] c"ls /\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @system(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [5 x i8] c"ls /\00"
@str = [12 x i8] c"Hello World\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @system(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
double fabs(scalar_t__);
scalar_t__ priceClose(int);
double priceHigh(int);
double priceLow(int);
scalar_t__ priceOpen(int);
int candle_doji(int idx) {
  double threshold = 0.1 * (priceHigh(idx) - priceLow(idx));
  if (fabs(priceOpen(idx) - priceClose(idx)) < threshold)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<candle_doji>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <priceHigh@plt>
movsd  %xmm0,-0x20(%rbp)
mov    -0x8(%rbp),%edi
call   1060 <priceLow@plt>
movsd  -0x20(%rbp),%xmm1
subsd  %xmm0,%xmm1
movsd  0xe7f(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%edi
call   1070 <priceOpen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <priceClose@plt>
mov    -0x18(%rbp),%rdi
sub    %rax,%rdi
call   1050 <fabs@plt>
movaps %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    11c8 <candle_doji+0x78>
movl   $0x1,-0x4(%rbp)
jmp    11cf <candle_doji+0x7f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<candle_doji>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
call   1040 <priceHigh@plt>
movsd  %xmm0,(%rsp)
mov    %ebp,%edi
call   1060 <priceLow@plt>
movsd  (%rsp),%xmm1
subsd  %xmm0,%xmm1
mulsd  0xe89(%rip),%xmm1
movsd  %xmm1,(%rsp)
mov    %ebp,%edi
call   1070 <priceOpen@plt>
mov    %rax,%rbx
mov    %ebp,%edi
call   1030 <priceClose@plt>
sub    %rax,%rbx
mov    %rbx,%rdi
call   1050 <fabs@plt>
xor    %eax,%eax
movsd  (%rsp),%xmm1
ucomisd %xmm0,%xmm1
seta   %al
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @candle_doji(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca double
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = call double @priceHigh(i32 %5)
%7 = load i32, i32* %3
%8 = call double @priceLow(i32 %7)
%9 = fsub double %6, %8
%10 = fmul double 1.000000e-01, %9
store double %10, double* %4
%11 = load i32, i32* %3
%12 = call i64 @priceOpen(i32 %11)
%13 = load i32, i32* %3
%14 = call i64 @priceClose(i32 %13)
%15 = sub nsw i64 %12, %14
%16 = call double @fabs(i64 %15)
%17 = load double, double* %4
%18 = fcmp olt double %16, %17
br i1 %18, label %19, label %20
19: ; preds = %1
store i32 1, i32* %2
br label %21
20: ; preds = %1
store i32 0, i32* %2
br label %21
21: ; preds = %20, %19
%22 = load i32, i32* %2
ret i32 %22
}

LLVM IR (-O2):
define i32 @candle_doji(i32 %0) {
%2 = tail call double @priceHigh(i32 %0)
%3 = tail call double @priceLow(i32 %0)
%4 = fsub double %2, %3
%5 = fmul double %4, 1.000000e-01
%6 = tail call i64 @priceOpen(i32 %0)
%7 = tail call i64 @priceClose(i32 %0)
%8 = sub nsw i64 %6, %7
%9 = tail call double @fabs(i64 %8)
%10 = fcmp olt double %9, %5
%11 = zext i1 %10 to i32
ret i32 %11
}
int msm_watchdog_resume(struct device *dev) {}


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

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

LLVM IR (-O0):
%struct.device = type opaque
define i32 @msm_watchdog_resume(%struct.device* %0) {
%2 = alloca i32
%3 = alloca %struct.device*
store %struct.device* %0, %struct.device** %3
%4 = load i32, i32* %2
ret i32 %4
}

LLVM IR (-O2):
%struct.device = type opaque
define i32 @msm_watchdog_resume(%struct.device* nocapture readnone %0) {
ret i32 undef
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
uint16_t image_raster_pixel_index_from_tile(uint8_t tile_index, uint8_t x,
                                            uint8_t y) {
  uint8_t image_x = x + (tile_index % 16) * 8;
  uint8_t image_y = y + (tile_index / 16) * 8;
  return 16 * 8 * image_y + image_x;
}


x86 assembly (clang, -O0):
<image_raster_pixel_index_from_tile>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x10,%ecx
cltd
idiv   %ecx
mov    -0x1c(%rbp),%eax
shl    $0x3,%edx
add    %edx,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x10,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x18(%rbp),%eax
shl    $0x3,%ecx
add    %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
shl    $0x7,%eax
add    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<image_raster_pixel_index_from_tile>:
lea    0xf(%rdi),%eax
test   %edi,%edi
cmovns %edi,%eax
mov    %eax,%ecx
and    $0xfffffff0,%ecx
sub    %ecx,%edi
lea    (%rsi,%rdi,8),%ecx
sar    $0x4,%eax
lea    (%rdx,%rax,8),%eax
shl    $0x7,%eax
add    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @image_raster_pixel_index_from_tile(i32 %0, i32 %1, i32 %2) {
%4 = srem i32 %0, 16
%5 = shl nsw i32 %4, 3
%6 = add nsw i32 %5, %1
%7 = sdiv i32 %0, 16
%8 = shl nsw i32 %7, 3
%9 = add nsw i32 %8, %2
%10 = shl nsw i32 %9, 7
%11 = add nsw i32 %6, %10
ret i32 %11
}
void _debug_print(const char *function, const char *fmt, ...) {}


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

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

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

LLVM IR (-O2):
define void @_debug_print(i8* nocapture %0, i8* nocapture %1, ...) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bemit(int);
void wemit(int word) {
  bemit(word >> 8);
  bemit(word & 0xff);
}


x86 assembly (clang, -O0):
<wemit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
sar    $0x8,%edi
call   1030 <bemit@plt>
mov    -0x4(%rbp),%edi
and    $0xff,%edi
call   1030 <bemit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wemit>:
push   %rbx
mov    %edi,%ebx
sar    $0x8,%edi
call   1030 <bemit@plt>
movzbl %bl,%edi
pop    %rbx
jmp    1030 <bemit@plt>

LLVM IR (-O0):
define void @wemit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 8
%5 = call i32 @bemit(i32 %4)
%6 = load i32, i32* %2
%7 = and i32 %6, 255
%8 = call i32 @bemit(i32 %7)
ret void
}

LLVM IR (-O2):
define void @wemit(i32 %0) {
%2 = ashr i32 %0, 8
%3 = tail call i32 @bemit(i32 %2)
%4 = and i32 %0, 255
%5 = tail call i32 @bemit(i32 %4)
ret void
}
/* Variables and functions */
unsigned int seconds();
int rand() {
  unsigned int secs = seconds(), secs2 = seconds();
  int random = 1;
  secs = secs << 1;
  secs += secs2 << 4;
  random += secs;
  return random;
}


x86 assembly (clang, -O0):
<rand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <seconds@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <seconds@plt>
mov    %eax,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x4,%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand>:
push   %rbx
xor    %eax,%eax
call   1030 <seconds@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <seconds@plt>
shl    $0x4,%eax
lea    (%rax,%rbx,2),%eax
add    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @rand() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = call i32 (...) @seconds()
store i32 %4, i32* %1
%5 = call i32 (...) @seconds()
store i32 %5, i32* %2
store i32 1, i32* %3
%6 = load i32, i32* %1
%7 = shl i32 %6, 1
store i32 %7, i32* %1
%8 = load i32, i32* %2
%9 = shl i32 %8, 4
%10 = load i32, i32* %1
%11 = add i32 %10, %9
store i32 %11, i32* %1
%12 = load i32, i32* %1
%13 = load i32, i32* %3
%14 = add i32 %13, %12
store i32 %14, i32* %3
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
define i32 @rand() {
%1 = tail call i32 (...) @seconds()
%2 = tail call i32 (...) @seconds()
%3 = shl i32 %1, 1
%4 = shl i32 %2, 4
%5 = add i32 %4, %3
%6 = or i32 %5, 1
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ write(int, char *, int);
void ft_generic(void) { write(1, "Tut tut ; Tut tut\n", 18); }


x86 assembly (clang, -O0):
<ft_generic>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
lea    0xee0(%rip),%rsi
mov    $0x12,%edx
call   1030 <write@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_generic>:
lea    0xee9(%rip),%rsi
mov    $0x1,%edi
mov    $0x12,%edx
jmp    1030 <write@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"Tut tut ; Tut tut\0A\00"
define void @ft_generic() {
%1 = call i32 @write(i32 1, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 18)
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"Tut tut ; Tut tut\0A\00"
define void @ft_generic() {
%1 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 18)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ glutStrokeMonoRoman;
unsigned glob_glutStrokeMonoRoman(void) {
  return (unsigned)&glutStrokeMonoRoman;
}


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

x86 assembly (clang, -O2):
<glob_glutStrokeMonoRoman>:
mov    0x2eda(%rip),%eax
ret

LLVM IR (-O0):
@glutStrokeMonoRoman = global i32 0
define i32 @glob_glutStrokeMonoRoman() {
ret i32 ptrtoint (i32* @glutStrokeMonoRoman to i32)
}

LLVM IR (-O2):
@glutStrokeMonoRoman = global i32 0
define i32 @glob_glutStrokeMonoRoman() {
ret i32 ptrtoint (i32* @glutStrokeMonoRoman to i32)
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int print_arr(int *arr, int size) {
  for (int i = 0; i < size; i++) {
    printf("%i ", arr[i]);
  }
  return 0;
}


x86 assembly (clang, -O0):
<print_arr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1157 <print_arr+0x47>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <print_arr+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%i \00"
define i32 @print_arr(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %7
6: ; preds = %7, %2
ret i32 0
7: ; preds = %4, %7
%8 = phi i64 [ 0, %4 ], [ %12, %7 ]
%9 = getelementptr inbounds i32, i32* %0, i64 %8
%10 = load i32, i32* %9
%11 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = add nuw nsw i64 %8, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %6, label %7
}
/* Variables and functions */
double fact_rec(double);
double fact(double *args) { return fact_rec(args[0]); }


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

x86 assembly (clang, -O2):
<fact>:
movsd  (%rdi),%xmm0
jmp    1030 <fact_rec@plt>

LLVM IR (-O0):
define double @fact(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load double*, double** %2
%4 = getelementptr inbounds double, double* %3, i64 0
%5 = load double, double* %4
%6 = call double @fact_rec(double %5)
ret double %6
}

LLVM IR (-O2):
define double @fact(double* nocapture %0) {
%2 = load double, double* %0
%3 = tail call double @fact_rec(double %2)
ret double %3
}