xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void checkDent(int d) {
  if (d < 1) {
    printf("Unmatched brackets\n");
    exit(100);
  }
}


x86 assembly (clang, -O0):
<checkDent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x1,-0x4(%rbp)
jge    114b <checkDent+0x2b>
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
mov    $0x64,%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkDent>:
test   %edi,%edi
jle    1125 <checkDent+0x5>
ret
push   %rax
lea    0xed3(%rip),%rdi
call   1030 <puts@plt>
mov    $0x64,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"Unmatched brackets\0A\00"
define void @checkDent(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 %3, 1
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @exit(i32 100)
unreachable
8: ; preds = %1
ret void
}

LLVM IR (-O2):
@str = [19 x i8] c"Unmatched brackets\00"
define void @checkDent(i32 %0) {
%2 = icmp slt i32 %0, 1
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
%5 = tail call i32 @exit(i32 100)
unreachable
6: ; preds = %1
ret void
}
double da_square(double value, int index) { return value * value; }


x86 assembly (clang, -O0):
<da_square>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<da_square>:
mulsd  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @da_square(double %0, i32 %1) {
%3 = alloca double
%4 = alloca i32
store double %0, double* %3
store i32 %1, i32* %4
%5 = load double, double* %3
%6 = load double, double* %3
%7 = fmul double %5, %6
ret double %7
}

LLVM IR (-O2):
define double @da_square(double %0, i32 %1) {
%3 = fmul double %0, %0
ret double %3
}
void delay(void) {
  int i;
  for (i = 0; i < 1000000; i++)
    ;
}


x86 assembly (clang, -O0):
<delay>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0xf4240,-0x4(%rbp)
jge    112b <delay+0x2b>
jmp    111d <delay+0x1d>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110b <delay+0xb>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @delay() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ TCIOFLUSH;
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ tcflush(int, int /*<<< orphan*/);
void grf_uart_close(int fd) {
  assert(fd >= 0);
  tcflush(fd, TCIOFLUSH);
  close(fd);
}


x86 assembly (clang, -O0):
<grf_uart_close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
setge  %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    -0x4(%rbp),%edi
mov    0x2e8a(%rip),%rax
mov    (%rax),%esi
call   1030 <tcflush@plt>
mov    -0x4(%rbp),%edi
call   1040 <close@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<grf_uart_close>:
push   %rbx
mov    %edi,%ebx
not    %edi
shr    $0x1f,%edi
call   1050 <assert@plt>
mov    0x2e9c(%rip),%rax
mov    (%rax),%esi
mov    %ebx,%edi
call   1030 <tcflush@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <close@plt>

LLVM IR (-O0):
@TCIOFLUSH = global i32 0
define void @grf_uart_close(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 0
%5 = zext i1 %4 to i32
%6 = call i32 @assert(i32 %5)
%7 = load i32, i32* %2
%8 = load i32, i32* @TCIOFLUSH
%9 = call i32 @tcflush(i32 %7, i32 %8)
%10 = load i32, i32* %2
%11 = call i32 @close(i32 %10)
ret void
}

LLVM IR (-O2):
@TCIOFLUSH = global i32 0
define void @grf_uart_close(i32 %0) {
%2 = xor i32 %0, -1
%3 = lshr i32 %2, 31
%4 = tail call i32 @assert(i32 %3)
%5 = load i32, i32* @TCIOFLUSH
%6 = tail call i32 @tcflush(i32 %0, i32 %5)
%7 = tail call i32 @close(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ errx(char *, char *, int, char *);
void lsd_nomem_error(char *file, int line, char *mesg) {
  errx("%p: %s:%d: %s: Out of memory\n", file, line, mesg);
}


x86 assembly (clang, -O0):
<lsd_nomem_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%rcx
lea    0xecb(%rip),%rdi
call   1030 <errx@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lsd_nomem_error>:
mov    %rdx,%rcx
mov    %esi,%edx
mov    %rdi,%rsi
lea    0xee1(%rip),%rdi
jmp    1030 <errx@plt>

LLVM IR (-O0):
@.str = [30 x i8] c"%p: %s:%d: %s: Out of memory\0A\00"
define void @lsd_nomem_error(i8* %0, i32 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = load i32, i32* %5
%9 = load i8*, i8** %6
%10 = call i32 @errx(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %7, i32 %8, i8* %9)
ret void
}

LLVM IR (-O2):
@.str = [30 x i8] c"%p: %s:%d: %s: Out of memory\0A\00"
define void @lsd_nomem_error(i8* %0, i32 %1, i8* %2) {
%4 = tail call i32 @errx(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1, i8* %2)
ret void
}
/* Variables and functions */
int rand();
int getrand(int min, int max) { return (rand() % (max - min) + min); }


x86 assembly (clang, -O0):
<getrand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-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):
<getrand>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <rand@plt>
sub    %ebp,%ebx
cltd
idiv   %ebx
add    %edx,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

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


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

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

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

LLVM IR (-O2):
define void @cleanup() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gfx_clear_screen(int /*<<< orphan*/);
void gui_clear_screen(void) { gfx_clear_screen(0); }


x86 assembly (clang, -O0):
<gui_clear_screen>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <gfx_clear_screen@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<gui_clear_screen>:
xor    %edi,%edi
jmp    1030 <gfx_clear_screen@plt>

LLVM IR (-O0):
define void @gui_clear_screen() {
%1 = call i32 @gfx_clear_screen(i32 0)
ret void
}

LLVM IR (-O2):
define void @gui_clear_screen() {
%1 = tail call i32 @gfx_clear_screen(i32 0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ int64_t;
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void mumble_serversync_callback(char *welcome_text, int32_t session,
                                int32_t max_bandwidth, int64_t permissions,
                                void *user_data) {
  printf("%s\n", welcome_text);
}


x86 assembly (clang, -O0):
<mumble_serversync_callback>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xecc(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mumble_serversync_callback>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @mumble_serversync_callback(i8* %0, i32 %1, i32 %2, i32 %3, i8* nocapture readnone %4) {
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
struct tcb {
  int dummy;
};

/* Variables and functions */
int do_eventfd(struct tcb *, int);
int sys_eventfd(struct tcb *tcp) { return do_eventfd(tcp, -1); }


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

x86 assembly (clang, -O2):
<sys_eventfd>:
mov    $0xffffffff,%esi
jmp    1030 <do_eventfd@plt>

LLVM IR (-O0):
%struct.tcb = type { i32 }
define i32 @sys_eventfd(%struct.tcb* %0) {
%2 = alloca %struct.tcb*
store %struct.tcb* %0, %struct.tcb** %2
%3 = load %struct.tcb*, %struct.tcb** %2
%4 = call i32 @do_eventfd(%struct.tcb* %3, i32 -1)
ret i32 %4
}

LLVM IR (-O2):
%struct.tcb = type { i32 }
define i32 @sys_eventfd(%struct.tcb* %0) {
%2 = tail call i32 @do_eventfd(%struct.tcb* %0, i32 -1)
ret i32 %2
}
int main() {
  unsigned int a = 1, b = 1, i = 0, temp = 0;
  for (i = 0; i < 20; i++) {
    temp = a;
    a = b;
    b += temp;
  }
  return a;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x14,-0x10(%rbp)
jae    115b <main+0x5b>
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x14(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    112e <main+0x2e>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 10946
}
/* Variables and functions */
void *calloc(size_t, size_t);
int /*<<< orphan*/ die(char *);
void *xcalloc(size_t siz, size_t n) {
  void *ptr = calloc(siz, n);
  if (!ptr)
    die("Out of memory\n");
  return ptr;
}


x86 assembly (clang, -O0):
<xcalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <calloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1158 <xcalloc+0x38>
lea    0xead(%rip),%rdi
call   1040 <die@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xcalloc>:
push   %rbx
call   1030 <calloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113a <xcalloc+0x1a>
lea    0xecb(%rip),%rdi
call   1040 <die@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [15 x i8] c"Out of memory\0A\00"
define noalias i8* @xcalloc(i64 %0, i64 %1) {
%3 = tail call i8* @calloc(i64 %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @die(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %2
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
void vmci_close(int s) {
  if (s != -1) {
    close(s);
  }
}


x86 assembly (clang, -O0):
<vmci_close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0xffffffff,-0x4(%rbp)
je     112d <vmci_close+0x1d>
mov    -0x4(%rbp),%edi
call   1030 <close@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vmci_close>:
cmp    $0xffffffff,%edi
je     111a <vmci_close+0xa>
jmp    1030 <close@plt>
ret

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

LLVM IR (-O2):
define void @vmci_close(i32 %0) {
%2 = icmp eq i32 %0, -1
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @close(i32 %0)
br label %5
5: ; preds = %3, %1
ret void
}
yywrap() { return (0); }


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

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

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

LLVM IR (-O2):
define i32 @yywrap() {
ret i32 0
}
int cmpf(void *t, const void *a, const void *b) {
  (void)t;
  (void)a;
  (void)b;
  return 0;
}


x86 assembly (clang, -O0):
<cmpf>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @cmpf(i8* nocapture readnone %0, i8* nocapture readnone %1, i8* nocapture readnone %2) {
ret i32 0
}
void dcircle(xc, yc, x, y) double xc, yc, x, y;
{
  double radius;
  radius = sqrt((y - yc) * (y - yc) + (x - xc) * (x - xc));
  circle(xc, yc, radius);
}


x86 assembly (clang, -O0):
<dcircle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm2
subsd  -0x10(%rbp),%xmm2
movsd  -0x18(%rbp),%xmm1
subsd  -0x8(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm3
subsd  -0x8(%rbp),%xmm3
mulsd  %xmm3,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1040 <sqrt@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm2
mov    $0x3,%al
call   1030 <circle@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dcircle>:
movapd %xmm0,%xmm4
subsd  %xmm1,%xmm3
subsd  %xmm0,%xmm2
mulsd  %xmm2,%xmm2
mulsd  %xmm3,%xmm3
addsd  %xmm2,%xmm3
xorpd  %xmm0,%xmm0
ucomisd %xmm0,%xmm3
jb     114b <dcircle+0x2b>
xorps  %xmm2,%xmm2
sqrtsd %xmm3,%xmm2
jmp    1178 <dcircle+0x58>
sub    $0x18,%rsp
movapd %xmm3,%xmm0
movsd  %xmm1,0x10(%rsp)
movsd  %xmm4,0x8(%rsp)
call   1040 <sqrt@plt>
movsd  0x8(%rsp),%xmm4
movsd  0x10(%rsp),%xmm1
movapd %xmm0,%xmm2
add    $0x18,%rsp
movapd %xmm4,%xmm0
mov    $0x3,%al
jmp    1030 <circle@plt>

LLVM IR (-O0):
define void @dcircle(double %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%10 = load double, double* %8
%11 = load double, double* %6
%12 = fsub double %10, %11
%13 = load double, double* %8
%14 = load double, double* %6
%15 = fsub double %13, %14
%16 = load double, double* %7
%17 = load double, double* %5
%18 = fsub double %16, %17
%19 = load double, double* %7
%20 = load double, double* %5
%21 = fsub double %19, %20
%22 = fmul double %18, %21
%23 = call double @llvm.fmuladd.f64(double %12, double %15, double %22)
%24 = call double @sqrt(double %23)
store double %24, double* %9
%25 = load double, double* %5
%26 = load double, double* %6
%27 = load double, double* %9
%28 = call i32 (double, double, double, ...) bitcast (i32 (...)* @circle to i32 (double, double, double, ...)*)(double %25, double %26, double %27)
ret void
}

LLVM IR (-O2):
define void @dcircle(double %0, double %1, double %2, double %3) {
%5 = fsub double %3, %1
%6 = fsub double %2, %0
%7 = fmul double %6, %6
%8 = tail call double @llvm.fmuladd.f64(double %5, double %5, double %7)
%9 = tail call double @sqrt(double %8)
%10 = tail call i32 (double, double, double, ...) bitcast (i32 (...)* @circle to i32 (double, double, double, ...)*)(double %0, double %1, double %9)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bind_to_cpus();
int /*<<< orphan*/ create_threads();
int /*<<< orphan*/ monitor_threads();
int /*<<< orphan*/ parse_args(int, char **);
int /*<<< orphan*/ print_banner();
int main(int argc, char *argv[]) {
  parse_args(argc, argv);
  print_banner();
  bind_to_cpus();
  create_threads();
  monitor_threads();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1050 <parse_args@plt>
mov    $0x0,%al
call   1070 <print_banner@plt>
mov    $0x0,%al
call   1040 <bind_to_cpus@plt>
mov    $0x0,%al
call   1030 <create_threads@plt>
mov    $0x0,%al
call   1060 <monitor_threads@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
call   1050 <parse_args@plt>
xor    %eax,%eax
call   1070 <print_banner@plt>
xor    %eax,%eax
call   1040 <bind_to_cpus@plt>
xor    %eax,%eax
call   1030 <create_threads@plt>
xor    %eax,%eax
call   1060 <monitor_threads@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
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 @parse_args(i32 %6, i8** %7)
%9 = call i32 (...) @print_banner()
%10 = call i32 (...) @bind_to_cpus()
%11 = call i32 (...) @create_threads()
%12 = call i32 (...) @monitor_threads()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @parse_args(i32 %0, i8** %1)
%4 = tail call i32 (...) @print_banner()
%5 = tail call i32 (...) @bind_to_cpus()
%6 = tail call i32 (...) @create_threads()
%7 = tail call i32 (...) @monitor_threads()
ret i32 0
}
/* Type definitions */
typedef scalar_t__ uint64_t;

/* Variables and functions */
scalar_t__ systemtimer_get();
void delayus(int us) {
  uint64_t end = systemtimer_get() + us;
  while (systemtimer_get() < end)
    ;
}


x86 assembly (clang, -O0):
<delayus>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <systemtimer_get@plt>
movslq -0x4(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1030 <systemtimer_get@plt>
cmp    -0x10(%rbp),%rax
jge    1143 <delayus+0x33>
jmp    112d <delayus+0x1d>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<delayus>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <systemtimer_get@plt>
movslq %ebx,%rbx
add    %rax,%rbx
xor    %eax,%eax
call   1030 <systemtimer_get@plt>
cmp    %rbx,%rax
jl     1120 <delayus+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @delayus(i32 %0) {
%2 = alloca i32
%3 = alloca i64
store i32 %0, i32* %2
%4 = call i64 (...) @systemtimer_get()
%5 = load i32, i32* %2
%6 = sext i32 %5 to i64
%7 = add nsw i64 %4, %6
store i64 %7, i64* %3
br label %8
8: ; preds = %12, %1
%9 = call i64 (...) @systemtimer_get()
%10 = load i64, i64* %3
%11 = icmp slt i64 %9, %10
br i1 %11, label %12, label %13
12: ; preds = %8
br label %8
13: ; preds = %8
ret void
}

LLVM IR (-O2):
define void @delayus(i32 %0) {
%2 = tail call i64 (...) @systemtimer_get()
%3 = sext i32 %0 to i64
%4 = add nsw i64 %2, %3
br label %5
5: ; preds = %5, %1
%6 = tail call i64 (...) @systemtimer_get()
%7 = icmp slt i64 %6, %4
br i1 %7, label %5, label %8
8: ; preds = %5
ret void
}
void ft_striter(char *s, void (*f)(char *)) {
  int i;
  i = 0;
  if (f)
    if (s)
      while (s[i])
        f((s + i++));
}


x86 assembly (clang, -O0):
<ft_striter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     116e <ft_striter+0x6e>
cmpq   $0x0,-0x8(%rbp)
je     1169 <ft_striter+0x69>
jmp    1132 <ft_striter+0x32>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     1164 <ft_striter+0x64>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x14(%rbp)
movslq %ecx,%rcx
add    %rcx,%rdi
call   *%rax
jmp    1132 <ft_striter+0x32>
jmp    1169 <ft_striter+0x69>
jmp    116e <ft_striter+0x6e>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_striter>:
push   %r14
push   %rbx
push   %rax
test   %rdi,%rdi
je     1130 <ft_striter+0x30>
mov    %rsi,%r14
test   %rsi,%rsi
je     1130 <ft_striter+0x30>
mov    %rdi,%rbx
cmpb   $0x0,(%rdi)
je     1130 <ft_striter+0x30>
nopl   0x0(%rax)
mov    %rbx,%rdi
call   *%r14
cmpb   $0x0,0x1(%rbx)
lea    0x1(%rbx),%rbx
jne    1120 <ft_striter+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @ft_striter(i8* %0, void (i8*)* %1) {
%3 = icmp ne void (i8*)* %1, null
%4 = icmp ne i8* %0, null
%5 = and i1 %4, %3
br i1 %5, label %6, label %16
6: ; preds = %2
%7 = load i8, i8* %0
%8 = icmp eq i8 %7, 0
br i1 %8, label %16, label %9
9: ; preds = %6, %9
%10 = phi i64 [ %12, %9 ], [ 0, %6 ]
%11 = phi i8* [ %13, %9 ], [ %0, %6 ]
%12 = add nuw i64 %10, 1
tail call void %1(i8* %11)
%13 = getelementptr inbounds i8, i8* %0, i64 %12
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %9
16: ; preds = %9, %6, %2
ret void
}
/* Variables and functions */
size_t strlen(char const *);
size_t get_n_terms(const char *str) {
  size_t n_terms = 0;
  for (unsigned long i = 0; i < strlen(str); ++i) {
    if (*str == 'x') {
      n_terms++;
    }
  }
  return strlen(str);
}


x86 assembly (clang, -O0):
<get_n_terms>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
cmp    %rcx,%rax
jae    117f <get_n_terms+0x6f>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x78,%eax
jne    1169 <get_n_terms+0x59>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    116e <get_n_terms+0x5e>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    112c <get_n_terms+0x1c>
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_n_terms>:
jmp    1030 <strlen@plt>

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

LLVM IR (-O2):
define i64 @get_n_terms(i8* nocapture %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
ret i64 %2
}
void mdp4_mddi_pipe_queue(int cndx, struct mdp4_overlay_pipe *pipe) {}


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

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

LLVM IR (-O0):
%struct.mdp4_overlay_pipe = type opaque
define void @mdp4_mddi_pipe_queue(i32 %0, %struct.mdp4_overlay_pipe* %1) {
%3 = alloca i32
%4 = alloca %struct.mdp4_overlay_pipe*
store i32 %0, i32* %3
store %struct.mdp4_overlay_pipe* %1, %struct.mdp4_overlay_pipe** %4
ret void
}

LLVM IR (-O2):
%struct.mdp4_overlay_pipe = type opaque
define void @mdp4_mddi_pipe_queue(i32 %0, %struct.mdp4_overlay_pipe* nocapture %1) {
ret void
}
eword(wd) int wd;
{
  emit(hibyte(wd));
  emit(lobyte(wd));
}


x86 assembly (clang, -O0):
<eword>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    $0x0,%al
call   1040 <hibyte@plt>
mov    %eax,%edi
mov    $0x0,%al
call   1050 <emit@plt>
mov    -0x8(%rbp),%edi
mov    $0x0,%al
call   1030 <lobyte@plt>
mov    %eax,%edi
mov    $0x0,%al
call   1050 <emit@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eword>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <hibyte@plt>
mov    %eax,%edi
xor    %eax,%eax
call   1050 <emit@plt>
mov    %ebx,%edi
xor    %eax,%eax
call   1030 <lobyte@plt>
mov    %eax,%edi
xor    %eax,%eax
pop    %rbx
jmp    1050 <emit@plt>

LLVM IR (-O0):
define i32 @eword(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = call i32 (i32, ...) bitcast (i32 (...)* @hibyte to i32 (i32, ...)*)(i32 %4)
%6 = call i32 (i32, ...) bitcast (i32 (...)* @emit to i32 (i32, ...)*)(i32 %5)
%7 = load i32, i32* %3
%8 = call i32 (i32, ...) bitcast (i32 (...)* @lobyte to i32 (i32, ...)*)(i32 %7)
%9 = call i32 (i32, ...) bitcast (i32 (...)* @emit to i32 (i32, ...)*)(i32 %8)
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
define i32 @eword(i32 %0) {
%2 = tail call i32 (i32, ...) bitcast (i32 (...)* @hibyte to i32 (i32, ...)*)(i32 %0)
%3 = tail call i32 (i32, ...) bitcast (i32 (...)* @emit to i32 (i32, ...)*)(i32 %2)
%4 = tail call i32 (i32, ...) bitcast (i32 (...)* @lobyte to i32 (i32, ...)*)(i32 %0)
%5 = tail call i32 (i32, ...) bitcast (i32 (...)* @emit to i32 (i32, ...)*)(i32 %4)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void s2main(void) { puts("Hello from 32-bit C"); }


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

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

LLVM IR (-O0):
@.str = [20 x i8] c"Hello from 32-bit C\00"
define void @s2main() {
%1 = call i32 @puts(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"Hello from 32-bit C\00"
define void @s2main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
ret void
}
void udelay(unsigned usecs) {
  unsigned stop = (*(volatile unsigned long *)(0x60005010)) + usecs;
  while (((long)((*(volatile unsigned long *)(0x60005010))) - (long)(stop) < 0))
    ;
}


x86 assembly (clang, -O0):
<udelay>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x60005010,%eax
mov    (%rax),%rax
mov    -0x4(%rbp),%ecx
add    %rcx,%rax
mov    %eax,-0x8(%rbp)
mov    $0x60005010,%eax
mov    (%rax),%rax
mov    -0x8(%rbp),%ecx
sub    %rcx,%rax
cmp    $0x0,%rax
jge    1135 <udelay+0x35>
jmp    1118 <udelay+0x18>
pop    %rbp
ret

x86 assembly (clang, -O2):
<udelay>:
mov    0x60005010,%rax
60
add    %edi,%eax
nopw   0x0(%rax,%rax,1)
mov    0x60005010,%rcx
60
cmp    %rax,%rcx
jl     1110 <udelay+0x10>
ret

LLVM IR (-O0):
define void @udelay(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load volatile i64, i64* inttoptr (i64 1610633232 to i64*)
%5 = load i32, i32* %2
%6 = zext i32 %5 to i64
%7 = add i64 %4, %6
%8 = trunc i64 %7 to i32
store i32 %8, i32* %3
br label %9
9: ; preds = %15, %1
%10 = load volatile i64, i64* inttoptr (i64 1610633232 to i64*)
%11 = load i32, i32* %3
%12 = zext i32 %11 to i64
%13 = sub nsw i64 %10, %12
%14 = icmp slt i64 %13, 0
br i1 %14, label %15, label %16
15: ; preds = %9
br label %9
16: ; preds = %9
ret void
}

LLVM IR (-O2):
define void @udelay(i32 %0) {
%2 = load volatile i64, i64* inttoptr (i64 1610633232 to i64*)
%3 = trunc i64 %2 to i32
%4 = add i32 %3, %0
%5 = zext i32 %4 to i64
br label %6
6: ; preds = %6, %1
%7 = load volatile i64, i64* inttoptr (i64 1610633232 to i64*)
%8 = icmp slt i64 %7, %5
br i1 %8, label %6, label %9
9: ; preds = %6
ret void
}
unsigned long USBEndpointStatus(unsigned long ulBase,
                                unsigned long ulEndpoint) {
  unsigned long ulStatus;
  ;

  ;
  ulStatus = (*(
      (volatile unsigned short *)(ulBase + (ulEndpoint - 0x10) + 0x00000112)));
  ulStatus |= (((*((volatile unsigned short *)(ulBase + (ulEndpoint - 0x10) +
                                               0x00000116))))
               << 16);
  return (ulStatus);
}


x86 assembly (clang, -O0):
<USBEndpointStatus>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    $0x10,%rcx
add    %rcx,%rax
mov    0x112(%rax),%ax
movzwl %ax,%eax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    $0x10,%rcx
add    %rcx,%rax
mov    0x116(%rax),%ax
movzwl %ax,%eax
shl    $0x10,%eax
cltq
or     -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<USBEndpointStatus>:
movzwl 0x102(%rdi,%rsi,1),%ecx
movzwl 0x106(%rdi,%rsi,1),%eax
shl    $0x10,%eax
cltq
or     %rcx,%rax
ret

LLVM IR (-O0):
define i64 @USBEndpointStatus(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %3
%7 = load i64, i64* %4
%8 = sub i64 %7, 16
%9 = add i64 %6, %8
%10 = add i64 %9, 274
%11 = inttoptr i64 %10 to i16*
%12 = load volatile i16, i16* %11
%13 = zext i16 %12 to i64
store i64 %13, i64* %5
%14 = load i64, i64* %3
%15 = load i64, i64* %4
%16 = sub i64 %15, 16
%17 = add i64 %14, %16
%18 = add i64 %17, 278
%19 = inttoptr i64 %18 to i16*
%20 = load volatile i16, i16* %19
%21 = zext i16 %20 to i32
%22 = shl i32 %21, 16
%23 = sext i32 %22 to i64
%24 = load i64, i64* %5
%25 = or i64 %24, %23
store i64 %25, i64* %5
%26 = load i64, i64* %5
ret i64 %26
}

LLVM IR (-O2):
define i64 @USBEndpointStatus(i64 %0, i64 %1) {
%3 = add i64 %0, -16
%4 = add i64 %3, %1
%5 = add i64 %4, 274
%6 = inttoptr i64 %5 to i16*
%7 = load volatile i16, i16* %6
%8 = zext i16 %7 to i64
%9 = add i64 %4, 278
%10 = inttoptr i64 %9 to i16*
%11 = load volatile i16, i16* %10
%12 = zext i16 %11 to i32
%13 = shl nuw i32 %12, 16
%14 = sext i32 %13 to i64
%15 = or i64 %14, %8
ret i64 %15
}
/* Type definitions */
struct twopence_target {
  int dummy;
};
struct twopence_pipe_target {
  int dummy;
};

/* Variables and functions */
int __twopence_pipe_exit_remote(struct twopence_pipe_target *);
int twopence_pipe_exit_remote(struct twopence_target *opaque_handle) {
  struct twopence_pipe_target *handle =
      (struct twopence_pipe_target *)opaque_handle;
  return __twopence_pipe_exit_remote(handle);
}


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

x86 assembly (clang, -O2):
<twopence_pipe_exit_remote>:
jmp    1030 <__twopence_pipe_exit_remote@plt>

LLVM IR (-O0):
%struct.twopence_target = type { i32 }
%struct.twopence_pipe_target = type { i32 }
define i32 @twopence_pipe_exit_remote(%struct.twopence_target* %0) {
%2 = alloca %struct.twopence_target*
%3 = alloca %struct.twopence_pipe_target*
store %struct.twopence_target* %0, %struct.twopence_target** %2
%4 = load %struct.twopence_target*, %struct.twopence_target** %2
%5 = bitcast %struct.twopence_target* %4 to %struct.twopence_pipe_target*
store %struct.twopence_pipe_target* %5, %struct.twopence_pipe_target** %3
%6 = load %struct.twopence_pipe_target*, %struct.twopence_pipe_target** %3
%7 = call i32 @__twopence_pipe_exit_remote(%struct.twopence_pipe_target* %6)
ret i32 %7
}

LLVM IR (-O2):
%struct.twopence_target = type { i32 }
%struct.twopence_pipe_target = type { i32 }
define i32 @twopence_pipe_exit_remote(%struct.twopence_target* %0) {
%2 = bitcast %struct.twopence_target* %0 to %struct.twopence_pipe_target*
%3 = tail call i32 @__twopence_pipe_exit_remote(%struct.twopence_pipe_target* %2)
ret i32 %3
}
/* Variables and functions */
void *calloc(size_t, size_t);
int /*<<< orphan*/ nomem();
void *sipCalloc(size_t nr, size_t n) {
  void *h;
  if ((h = calloc(nr, n)) == NULL)
    nomem();
  return h;
}


x86 assembly (clang, -O0):
<sipCalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <calloc@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    1152 <sipCalloc+0x32>
mov    $0x0,%al
call   1040 <nomem@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sipCalloc>:
push   %rbx
call   1030 <calloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1135 <sipCalloc+0x15>
xor    %eax,%eax
call   1040 <nomem@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @sipCalloc(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i8*
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %3
%7 = load i64, i64* %4
%8 = call i8* @calloc(i64 %6, i64 %7)
store i8* %8, i8** %5
%9 = icmp eq i8* %8, null
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = call i32 (...) @nomem()
br label %12
12: ; preds = %10, %2
%13 = load i8*, i8** %5
ret i8* %13
}

LLVM IR (-O2):
define noalias i8* @sipCalloc(i64 %0, i64 %1) {
%3 = tail call i8* @calloc(i64 %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 (...) @nomem()
br label %7
7: ; preds = %5, %2
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ usage(int /*<<< orphan*/);
void of_help(const char *nullpointer) { usage(0); }


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

x86 assembly (clang, -O2):
<of_help>:
xor    %edi,%edi
jmp    1030 <usage@plt>

LLVM IR (-O0):
define void @of_help(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @usage(i32 0)
ret void
}

LLVM IR (-O2):
define void @of_help(i8* nocapture readnone %0) {
%2 = tail call i32 @usage(i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  extern char *__progname;
  fprintf(stderr, "usage: %s [-ikpw ] [ -m a | e | l | m | s] [file ...]\n",
          __progname);
  exit(1);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [55 x i8] c"usage: %s [-ikpw ] [ -m a | e | l | m | s] [file ...]\0A\00"
@__progname = external global i8*
define void @usage() {
%1 = load i32, i32* @stderr
%2 = load i8*, i8** @__progname
%3 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [55 x i8] c"usage: %s [-ikpw ] [ -m a | e | l | m | s] [file ...]\0A\00"
@__progname = external global i8*
define void @usage() {
%1 = load i32, i32* @stderr
%2 = load i8*, i8** @__progname
%3 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
typedef scalar_t__ uint32_t;
struct riku_devfs_node {
  int dummy;
};

/* Variables and functions */
int null_read(struct riku_devfs_node *self, const char *buf, uint32_t count) {
  for (uint32_t i = 0; i < count; i++)
    *(char *)(buf + i) = 0x0;
  return 0;
}


x86 assembly (clang, -O0):
<null_read>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x18(%rbp),%rax
jge    1143 <null_read+0x43>
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    1118 <null_read+0x18>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.riku_devfs_node = type { i32 }
define i32 @null_read(%struct.riku_devfs_node* %0, i8* %1, i64 %2) {
%4 = alloca %struct.riku_devfs_node*
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i64
store %struct.riku_devfs_node* %0, %struct.riku_devfs_node** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
store i64 0, i64* %7
br label %8
8: ; preds = %16, %3
%9 = load i64, i64* %7
%10 = load i64, i64* %6
%11 = icmp slt i64 %9, %10
br i1 %11, label %12, label %19
12: ; preds = %8
%13 = load i8*, i8** %5
%14 = load i64, i64* %7
%15 = getelementptr inbounds i8, i8* %13, i64 %14
store i8 0, i8* %15
br label %16
16: ; preds = %12
%17 = load i64, i64* %7
%18 = add nsw i64 %17, 1
store i64 %18, i64* %7
br label %8
19: ; preds = %8
ret i32 0
}

LLVM IR (-O2):
%struct.riku_devfs_node = type { i32 }
define i32 @null_read(%struct.riku_devfs_node* nocapture readnone %0, i8* nocapture writeonly %1, i64 %2) {
%4 = icmp sgt i64 %2, 0
br i1 %4, label %5, label %6
5: ; preds = %3
br label %6
6: ; preds = %5, %3
ret i32 0
}
/* Variables and functions */
int backtrace(void **, int);
int FastOS_backtrace(void **array, int size) { return backtrace(array, size); }


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

x86 assembly (clang, -O2):
<FastOS_backtrace>:
jmp    1030 <backtrace@plt>

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

LLVM IR (-O2):
define i32 @FastOS_backtrace(i8** %0, i32 %1) {
%3 = tail call i32 @backtrace(i8** %0, i32 %1)
ret i32 %3
}
int main() {
  int r[3][3];
  int a[3][3] = {{1, 3, 9}, {2, 4, 7}, {9, 3, 8}};
  int b[3][3] = {{5, 0, 2}, {12, 7, 8}, {5, 9, 1}};
  int i;
  int j;
  for (i = 0; i < 3; ++i) {
    for (j = 0; j < 3; ++j) {
    }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x60(%rbp),%rdi
lea    0xed3(%rip),%rsi
mov    $0x24,%edx
call   1030 <memcpy@plt>
lea    -0x90(%rbp),%rdi
lea    0xeeb(%rip),%rsi
mov    $0x24,%edx
call   1030 <memcpy@plt>
movl   $0x0,-0x94(%rbp)
cmpl   $0x3,-0x94(%rbp)
jge    11af <main+0x9f>
movl   $0x0,-0x98(%rbp)
cmpl   $0x3,-0x98(%rbp)
jge    1196 <main+0x86>
jmp    1182 <main+0x72>
mov    -0x98(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x98(%rbp)
jmp    1170 <main+0x60>
jmp    119b <main+0x8b>
mov    -0x94(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x94(%rbp)
jmp    1159 <main+0x49>
mov    -0x4(%rbp),%eax
add    $0xa0,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ test_chunk();
int main(int argc, char **argv) {
  printf("Running test_chunk()\n");
  test_chunk();
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [22 x i8] c"Running test_chunk()\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%7 = call i32 (...) @test_chunk()
ret i32 0
}

LLVM IR (-O2):
@str = [21 x i8] c"Running test_chunk()\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 (...) @test_chunk()
ret i32 0
}
double cube(x)
double x;
{ return (x * x * x); }


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

x86 assembly (clang, -O2):
<cube>:
movapd %xmm0,%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @cube(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = fmul double %3, %4
%6 = load double, double* %2
%7 = fmul double %5, %6
ret double %7
}

LLVM IR (-O2):
define double @cube(double %0) {
%2 = fmul double %0, %0
%3 = fmul double %2, %0
ret double %3
}
/* Variables and functions */
int strcmp(char const *, char const *);
int SortStrcmp(const void *p1, const void *p2) {
  return strcmp(*(const char **)p1, *(const char **)p2);
}


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

x86 assembly (clang, -O2):
<SortStrcmp>:
mov    (%rdi),%rdi
mov    (%rsi),%rsi
jmp    1030 <strcmp@plt>

LLVM IR (-O0):
define i32 @SortStrcmp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to i8**
%7 = load i8*, i8** %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i8**
%10 = load i8*, i8** %9
%11 = call i32 @strcmp(i8* %7, i8* %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @SortStrcmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = load i8*, i8** %3
%5 = bitcast i8* %1 to i8**
%6 = load i8*, i8** %5
%7 = tail call i32 @strcmp(i8* dereferenceable(1) %4, i8* dereferenceable(1) %6)
ret i32 %7
}
/* Variables and functions */
__attribute__((visibility("default"))) void *
sd_bus_slot_get_userdata(void *slot) {
  return NULL;
}


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

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

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

LLVM IR (-O2):
define noalias i8* @sd_bus_slot_get_userdata(i8* nocapture readnone %0) {
ret i8* null
}