xunge/DecIR huggingface dataset:
char *ft_strcpy(char *s1, const char *s2) {
  char *s;
  s = s1;
  while (*s2)
    *s1++ = *s2++;
  *s1 = '\0';
  return (s);
}


x86 assembly (clang, -O0):
<ft_strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1148 <ft_strcpy+0x48>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
jmp    1114 <ft_strcpy+0x14>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_strcpy>:
mov    %rdi,%rax
mov    (%rsi),%cl
mov    %rdi,%rdx
test   %cl,%cl
je     1131 <ft_strcpy+0x31>
add    $0x1,%rsi
mov    %rax,%rdx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %cl,(%rdx)
add    $0x1,%rdx
movzbl (%rsi),%ecx
add    $0x1,%rsi
test   %cl,%cl
jne    1120 <ft_strcpy+0x20>
movb   $0x0,(%rdx)
ret

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

LLVM IR (-O2):
define i8* @ft_strcpy(i8* returned writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %11, %5 ], [ %3, %2 ]
%7 = phi i8* [ %10, %5 ], [ %0, %2 ]
%8 = phi i8* [ %9, %5 ], [ %1, %2 ]
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = getelementptr inbounds i8, i8* %7, i64 1
store i8 %6, i8* %7
%11 = load i8, i8* %9
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %2
%14 = phi i8* [ %0, %2 ], [ %10, %5 ]
store i8 0, i8* %14
ret i8* %0
}
int do_725() { return 725; }


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

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

LLVM IR (-O0):
define i32 @do_725() {
ret i32 725
}

LLVM IR (-O2):
define i32 @do_725() {
ret i32 725
}
/* Variables and functions */
int /*<<< orphan*/ keyboard_inputWait();
int /*<<< orphan*/ outb(int, unsigned char);
void keyboard_sendData(unsigned char data) {
  keyboard_inputWait();
  outb(0x60, data);
}


x86 assembly (clang, -O0):
<keyboard_sendData>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x0,%al
call   1030 <keyboard_inputWait@plt>
mov    $0x60,%edi
movzbl -0x1(%rbp),%esi
call   1040 <outb@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<keyboard_sendData>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <keyboard_inputWait@plt>
mov    $0x60,%edi
mov    %ebx,%esi
pop    %rbx
jmp    1040 <outb@plt>

LLVM IR (-O0):
define void @keyboard_sendData(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = call i32 (...) @keyboard_inputWait()
%4 = load i8, i8* %2
%5 = call i32 @outb(i32 96, i8 zeroext %4)
ret void
}

LLVM IR (-O2):
define void @keyboard_sendData(i8 zeroext %0) {
%2 = tail call i32 (...) @keyboard_inputWait()
%3 = tail call i32 @outb(i32 96, i8 zeroext %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ serial_putc(int /*<<< orphan*/, char const);
void puts(const char *s) {
  while (*s) {
    serial_putc(0, *s);
    if (*s == '\n') {
      serial_putc(0, '\r');
    }
    s++;
  }
}


x86 assembly (clang, -O0):
<puts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1164 <puts+0x54>
mov    -0x8(%rbp),%rax
xor    %edi,%edi
movsbl (%rax),%esi
call   1030 <serial_putc@plt>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
jne    1153 <puts+0x43>
xor    %edi,%edi
mov    $0xd,%esi
call   1030 <serial_putc@plt>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <puts+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<puts>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1149 <puts+0x39>
mov    %rdi,%rbx
add    $0x1,%rbx
jmp    112b <puts+0x1b>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
je     1149 <puts+0x39>
movsbl %al,%esi
xor    %edi,%edi
call   1030 <serial_putc@plt>
cmpb   $0xa,-0x1(%rbx)
jne    1120 <puts+0x10>
xor    %edi,%edi
mov    $0xd,%esi
call   1030 <serial_putc@plt>
jmp    1120 <puts+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @puts(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %16, label %4
4: ; preds = %1, %12
%5 = phi i8 [ %14, %12 ], [ %2, %1 ]
%6 = phi i8* [ %13, %12 ], [ %0, %1 ]
%7 = tail call i32 @serial_putc(i32 0, i8 signext %5)
%8 = load i8, i8* %6
%9 = icmp eq i8 %8, 10
br i1 %9, label %10, label %12
10: ; preds = %4
%11 = tail call i32 @serial_putc(i32 0, i8 signext 13)
br label %12
12: ; preds = %10, %4
%13 = getelementptr inbounds i8, i8* %6, i64 1
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %4
16: ; preds = %12, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int);
int rand_r(unsigned int *);
int main() {
  unsigned int next = 1;
  printf("%d\n", rand_r(&next));
  printf("%d\n", rand_r(&next));
  printf("%d\n", rand_r(&next));
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
lea    -0x8(%rbp),%rdi
call   1030 <rand_r@plt>
mov    %eax,%esi
lea    0xea8(%rip),%rdi
call   1040 <printf@plt>
lea    -0x8(%rbp),%rdi
call   1030 <rand_r@plt>
mov    %eax,%esi
lea    0xe91(%rip),%rdi
call   1040 <printf@plt>
lea    -0x8(%rbp),%rdi
call   1030 <rand_r@plt>
mov    %eax,%esi
lea    0xe7a(%rip),%rdi
call   1040 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
movl   $0x1,0x4(%rsp)
lea    0x4(%rsp),%r14
mov    %r14,%rdi
call   1030 <rand_r@plt>
lea    0xeb0(%rip),%rbx
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    %r14,%rdi
call   1030 <rand_r@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    %r14,%rdi
call   1030 <rand_r@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %2
%3 = call i32 @rand_r(i32* %2)
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = call i32 @rand_r(i32* %2)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = call i32 @rand_r(i32* %2)
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 1, i32* %1
%3 = call i32 @rand_r(i32* %1)
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = call i32 @rand_r(i32* %1)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = call i32 @rand_r(i32* %1)
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = call i32 @exit(i32 0)
unreachable
}
const char *buzz(int i) {
  if ((i % 5) == 0) {
    return "Buzz";
  } else {
    return "";
  }
}


x86 assembly (clang, -O0):
<buzz>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    112b <buzz+0x2b>
lea    0xede(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1136 <buzz+0x36>
lea    0xed2(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<buzz>:
imul   $0xcccccccd,%edi,%eax
add    $0x19999999,%eax
cmp    $0x33333333,%eax
lea    0xee9(%rip),%rcx
lea    0xee6(%rip),%rax
cmovb  %rcx,%rax
ret

LLVM IR (-O0):
@.str = [5 x i8] c"Buzz\00"
@.str.1 = [1 x i8] zeroinitializer
define i8* @buzz(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = srem i32 %4, 5
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8** %2
br label %9
8: ; preds = %1
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %9
9: ; preds = %8, %7
%10 = load i8*, i8** %2
ret i8* %10
}

LLVM IR (-O2):
@.str = [5 x i8] c"Buzz\00"
@.str.1 = [1 x i8] zeroinitializer
define i8* @buzz(i32 %0) {
%2 = srem i32 %0, 5
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0)
ret i8* %4
}
/* Variables and functions */
int strlen(char const *);
int slash_followed(const char *s) {
  int len;
  if (!s) {
    return 0;
  }
  if ((len = strlen(s)) == 0) {
    return 0;
  }
  return (s[len - 1] == '/') ? 1 : 0;
}


x86 assembly (clang, -O0):
<slash_followed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1133 <slash_followed+0x23>
movl   $0x0,-0x4(%rbp)
jmp    1175 <slash_followed+0x65>
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
jne    1154 <slash_followed+0x44>
movl   $0x0,-0x4(%rbp)
jmp    1175 <slash_followed+0x65>
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x2f,%edx
cmove  %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<slash_followed>:
push   %rbp
push   %rbx
push   %rax
xor    %ebp,%ebp
test   %rdi,%rdi
je     1133 <slash_followed+0x23>
mov    %rdi,%rbx
call   1030 <strlen@plt>
test   %eax,%eax
je     1133 <slash_followed+0x23>
cltq
xor    %ebp,%ebp
cmpb   $0x2f,-0x1(%rax,%rbx,1)
sete   %bpl
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @slash_followed(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %13, label %3
3: ; preds = %1
%4 = tail call i32 @strlen(i8* %0)
%5 = icmp eq i32 %4, 0
br i1 %5, label %13, label %6
6: ; preds = %3
%7 = add nsw i32 %4, -1
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %0, i64 %8
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 47
%12 = zext i1 %11 to i32
br label %13
13: ; preds = %3, %1, %6
%14 = phi i32 [ %12, %6 ], [ 0, %1 ], [ 0, %3 ]
ret i32 %14
}
int main(void) {
  int x = 0;
  while (x < 5) {
    x++;
  }
  do {
    x++;
  } while (x < 5);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x5,-0x8(%rbp)
jge    112a <main+0x2a>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1112 <main+0x12>
jmp    112f <main+0x2f>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x5,-0x8(%rbp)
jl     112f <main+0x2f>
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
int instr_util_shgetlo(unsigned int val) {
  return (int)(short int)(val & 0xffff);
}


x86 assembly (clang, -O0):
<instr_util_shgetlo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xffff,%eax
cwtl
pop    %rbp
ret

x86 assembly (clang, -O2):
<instr_util_shgetlo>:
movswl %di,%eax
ret

LLVM IR (-O0):
define i32 @instr_util_shgetlo(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 65535
%5 = trunc i32 %4 to i16
%6 = sext i16 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @instr_util_shgetlo(i32 %0) {
%2 = shl i32 %0, 16
%3 = ashr exact i32 %2, 16
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ _PROCEDURE_LINKAGE_TABLE_();
void getpid() {
  _PROCEDURE_LINKAGE_TABLE_();
  return;
}


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

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

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

LLVM IR (-O2):
define void @getpid() {
%1 = tail call i32 (...) @_PROCEDURE_LINKAGE_TABLE_()
ret void
}
int toi_prepare_usm(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @toi_prepare_usm() {
ret i32 0
}
/* Type definitions */
typedef char *uint16_t;

/* Variables and functions */
uint16_t get_fs(void) {
  uint16_t result;
  asm volatile("movw %%"
               "fs"
               ", %0"
               : "=m"(result));
  return result;
}


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

x86 assembly (clang, -O2):
<get_fs>:
mov    %fs,-0x8(%rsp)
mov    -0x8(%rsp),%rax
ret

LLVM IR (-O0):
define i8* @get_fs() {
%1 = alloca i8*
%2 = load i8*, i8** %1
ret i8* %2
}

LLVM IR (-O2):
define i8* @get_fs() {
%1 = alloca i8*
%2 = bitcast i8** %1 to i8*
%3 = load i8*, i8** %1
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  printf("I can only come into existence via trickery.\n");
  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    0xed3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [46 x i8] c"I can only come into existence via trickery.\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 ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [45 x i8] c"I can only come into existence via trickery.\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @str, i64 0, i64 0))
ret i32 0
}
void UARTDMAEnable(unsigned long ulBase, unsigned long ulDMAFlags) {
  ;
  (*((volatile unsigned long *)(ulBase + 0x00000048))) |= ulDMAFlags;
}


x86 assembly (clang, -O0):
<UARTDMAEnable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdx
mov    -0x8(%rbp),%rax
mov    0x48(%rax),%rcx
or     %rdx,%rcx
mov    %rcx,0x48(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<UARTDMAEnable>:
or     %rsi,0x48(%rdi)
ret

LLVM IR (-O0):
define void @UARTDMAEnable(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i64, i64* %3
%7 = add i64 %6, 72
%8 = inttoptr i64 %7 to i64*
%9 = load volatile i64, i64* %8
%10 = or i64 %9, %5
store volatile i64 %10, i64* %8
ret void
}

LLVM IR (-O2):
define void @UARTDMAEnable(i64 %0, i64 %1) {
%3 = add i64 %0, 72
%4 = inttoptr i64 %3 to i64*
%5 = load volatile i64, i64* %4
%6 = or i64 %5, %1
store volatile i64 %6, i64* %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
extern void calls_free(void *ptr) { free(ptr); }


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

x86 assembly (clang, -O2):
<calls_free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @calls_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
int test_imm_37uint64_highword_reg(unsigned long long val) {
  return ((val >> 32) & (0x37 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_37uint64_highword_reg>:
movabs $0x3700000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_37uint64_highword_reg(i64 %0) {
%2 = and i64 %0, 236223201280
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void PAUSE(void) { __asm__ __volatile__("pause" :); }


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

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

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

LLVM IR (-O2):
define void @PAUSE() {
tail call void asm sideeffect "pause", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, int);
void array_println(FILE *fp, int *arr, size_t length) {
  size_t i;
  for (i = 0; i < length; ++i) {
    fprintf(fp, "%d\n", arr[i]);
  }
}


x86 assembly (clang, -O0):
<array_println>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x18(%rbp),%rax
jae    1166 <array_println+0x56>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
lea    0xeb0(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    112c <array_println+0x1c>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<array_println>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
test   %rdx,%rdx
je     1148 <array_println+0x38>
mov    %rdx,%r13
mov    %rsi,%r14
mov    %rdi,%r15
xor    %ebx,%ebx
lea    0xed0(%rip),%r12
mov    (%r14,%rbx,4),%edx
mov    %r15,%rdi
mov    %r12,%rsi
call   1030 <fprintf@plt>
add    $0x1,%rbx
cmp    %rbx,%r13
jne    1130 <array_println+0x20>
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @array_println(i32* nocapture %0, i32* nocapture %1, i64 %2) {
%4 = icmp eq i64 %2, 0
br i1 %4, label %12, label %5
5: ; preds = %3, %5
%6 = phi i64 [ %10, %5 ], [ 0, %3 ]
%7 = getelementptr inbounds i32, i32* %1, i64 %6
%8 = load i32, i32* %7
%9 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = add nuw i64 %6, 1
%11 = icmp eq i64 %10, %2
br i1 %11, label %12, label %5
12: ; preds = %5, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ NoDepBFunction();
int /*<<< orphan*/ NoDepCFunction();
int /*<<< orphan*/ SixAFunction();
int /*<<< orphan*/ SixBFunction();
int /*<<< orphan*/ printf(char *);
int main() {
  SixAFunction();
  SixBFunction();
  NoDepBFunction();
  NoDepCFunction();
  printf("Dependency test executable ran successfully.\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1070 <SixAFunction@plt>
mov    $0x0,%al
call   1030 <SixBFunction@plt>
mov    $0x0,%al
call   1050 <NoDepBFunction@plt>
mov    $0x0,%al
call   1060 <NoDepCFunction@plt>
lea    0xe7e(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1070 <SixAFunction@plt>
xor    %eax,%eax
call   1040 <SixBFunction@plt>
xor    %eax,%eax
call   1050 <NoDepBFunction@plt>
xor    %eax,%eax
call   1060 <NoDepCFunction@plt>
lea    0xe8c(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [46 x i8] c"Dependency test executable ran successfully.\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @SixAFunction()
%3 = call i32 (...) @SixBFunction()
%4 = call i32 (...) @NoDepBFunction()
%5 = call i32 (...) @NoDepCFunction()
%6 = call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [45 x i8] c"Dependency test executable ran successfully.\00"
define i32 @main() {
%1 = tail call i32 (...) @SixAFunction()
%2 = tail call i32 (...) @SixBFunction()
%3 = tail call i32 (...) @NoDepBFunction()
%4 = tail call i32 (...) @NoDepCFunction()
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ value;
typedef int /*<<< orphan*/ eventfd_t;

/* Variables and functions */
int write(int, int /*<<< orphan*/ *, int);
int eventfd_write(int fd, eventfd_t value) {
  return (sizeof(value) == write(fd, &value, sizeof(value))) ? 0 : -1;
}


x86 assembly (clang, -O0):
<eventfd_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x8(%rbp),%rsi
mov    $0x4,%edx
call   1030 <write@plt>
movslq %eax,%rsi
mov    $0x4,%edx
mov    $0xffffffff,%eax
xor    %ecx,%ecx
cmp    %rsi,%rdx
cmove  %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eventfd_write>:
push   %rax
mov    %esi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x4,%edx
call   1030 <write@plt>
xor    %ecx,%ecx
cmp    $0x4,%eax
setne  %cl
neg    %ecx
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @eventfd_write(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = call i32 @write(i32 %5, i32* %4, i32 4)
%7 = sext i32 %6 to i64
%8 = icmp eq i64 4, %7
%9 = zext i1 %8 to i64
%10 = select i1 %8, i32 0, i32 -1
ret i32 %10
}

LLVM IR (-O2):
define i32 @eventfd_write(i32 %0, i32 %1) {
%3 = alloca i32
store i32 %1, i32* %3
%4 = call i32 @write(i32 %0, i32* %3, i32 4)
%5 = icmp ne i32 %4, 4
%6 = sext i1 %5 to i32
ret i32 %6
}
long long td(long long a, long long b) { return (b == 0) ? 0 : (a / b); }


x86 assembly (clang, -O0):
<td>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1122 <td+0x22>
xor    %eax,%eax
mov    %rax,-0x18(%rbp)
jmp    1130 <td+0x30>
mov    -0x8(%rbp),%rax
cqto
idivq  -0x10(%rbp)
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<td>:
test   %rsi,%rsi
je     111a <td+0x1a>
mov    %rdi,%rax
or     %rsi,%rax
shr    $0x20,%rax
je     111d <td+0x1d>
mov    %rdi,%rax
cqto
idiv   %rsi
ret
xor    %eax,%eax
ret
mov    %edi,%eax
xor    %edx,%edx
div    %esi
ret

LLVM IR (-O0):
define i64 @td(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %2
br label %12
8: ; preds = %2
%9 = load i64, i64* %3
%10 = load i64, i64* %4
%11 = sdiv i64 %9, %10
br label %12
12: ; preds = %8, %7
%13 = phi i64 [ 0, %7 ], [ %11, %8 ]
ret i64 %13
}

LLVM IR (-O2):
define i64 @td(i64 %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = sdiv i64 %0, %1
br label %6
6: ; preds = %2, %4
%7 = phi i64 [ %5, %4 ], [ 0, %2 ]
ret i64 %7
}
/* Variables and functions */
int /*<<< orphan*/ ds2751_writeByte(int);
void ds2751_skipROM() { ds2751_writeByte(0xcc); }


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

x86 assembly (clang, -O2):
<ds2751_skipROM>:
mov    $0xcc,%edi
jmp    1030 <ds2751_writeByte@plt>

LLVM IR (-O0):
define void @ds2751_skipROM() {
%1 = call i32 @ds2751_writeByte(i32 204)
ret void
}

LLVM IR (-O2):
define void @ds2751_skipROM() {
%1 = tail call i32 @ds2751_writeByte(i32 204)
ret void
}
void setcelltype(int *flag, int type) {
  if (type == 1) {
    *flag = *flag & 16191;
  }
}


x86 assembly (clang, -O0):
<setcelltype>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
jne    1127 <setcelltype+0x27>
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
and    $0x3f3f,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<setcelltype>:
cmp    $0x1,%esi
jne    110b <setcelltype+0xb>
andl   $0x3f3f,(%rdi)
ret

LLVM IR (-O0):
define void @setcelltype(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = icmp eq i32 %5, 1
br i1 %6, label %7, label %12
7: ; preds = %2
%8 = load i32*, i32** %3
%9 = load i32, i32* %8
%10 = and i32 %9, 16191
%11 = load i32*, i32** %3
store i32 %10, i32* %11
br label %12
12: ; preds = %7, %2
ret void
}

LLVM IR (-O2):
define void @setcelltype(i32* nocapture %0, i32 %1) {
%3 = icmp eq i32 %1, 1
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = load i32, i32* %0
%6 = and i32 %5, 16191
store i32 %6, i32* %0
br label %7
7: ; preds = %4, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char *);
int /*<<< orphan*/ write(int, char *, int /*<<< orphan*/);
void putstr(char *str) { write(1, str, strlen(str)); }


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

x86 assembly (clang, -O2):
<putstr>:
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 void @putstr(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
%6 = call i32 @write(i32 1, i8* %3, i32 %5)
ret void
}

LLVM IR (-O2):
define void @putstr(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = tail call i32 @write(i32 1, i8* %0, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ parse_cfg(int, char **);
void do_osid(int argc, char *argv[], int start) {
  (void)start;
  parse_cfg(argc, argv);
}


x86 assembly (clang, -O0):
<do_osid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <parse_cfg@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_osid>:
jmp    1030 <parse_cfg@plt>

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

LLVM IR (-O2):
define void @do_osid(i32 %0, i8** %1, i32 %2) {
%4 = tail call i32 @parse_cfg(i32 %0, i8** %1)
ret void
}
/* Variables and functions */
unsigned long long getReverse(unsigned long long);
unsigned long long int
createReverseComplimentKMer(unsigned long long int kmer) {
  unsigned long long int reverse;
  unsigned long long int reverseCompliment;
  reverse = getReverse(kmer);
  reverseCompliment = ~(reverse);
  return reverseCompliment << 2;
}


x86 assembly (clang, -O0):
<createReverseComplimentKMer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <getReverse@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
xor    $0xffffffffffffffff,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
shl    $0x2,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<createReverseComplimentKMer>:
push   %rax
call   1030 <getReverse@plt>
not    %rax
shl    $0x2,%rax
pop    %rcx
ret

LLVM IR (-O0):
define i64 @createReverseComplimentKMer(i64 %0) {
%2 = alloca i64
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %2
%5 = load i64, i64* %2
%6 = call i64 @getReverse(i64 %5)
store i64 %6, i64* %3
%7 = load i64, i64* %3
%8 = xor i64 %7, -1
store i64 %8, i64* %4
%9 = load i64, i64* %4
%10 = shl i64 %9, 2
ret i64 %10
}

LLVM IR (-O2):
define i64 @createReverseComplimentKMer(i64 %0) {
%2 = tail call i64 @getReverse(i64 %0)
%3 = xor i64 %2, -1
%4 = shl i64 %3, 2
ret i64 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ history;

/* Variables and functions */
int /*<<< orphan*/ memmove(unsigned char *, unsigned char *, int);
void addRunToHistory(unsigned char run, unsigned char history[7]) {
  memmove(&history[1], &history[0], 6 * sizeof(history[0]));
  history[0] = run;
}


x86 assembly (clang, -O0):
<addRunToHistory>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
add    $0x1,%rdi
mov    -0x10(%rbp),%rsi
mov    $0x6,%edx
call   1030 <memmove@plt>
mov    -0x1(%rbp),%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<addRunToHistory>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
lea    0x1(%rsi),%rdi
mov    $0x6,%edx
call   1030 <memmove@plt>
mov    %bpl,(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define void @addRunToHistory(i8 zeroext %0, i8* %1) {
%3 = getelementptr inbounds i8, i8* %1, i64 1
%4 = tail call i32 @memmove(i8* %3, i8* %1, i32 6)
store i8 %0, i8* %1
ret void
}
void logistic_map(double r, double *x) {}


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

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

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

LLVM IR (-O2):
define void @logistic_map(double %0, double* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ f();
int /*<<< orphan*/ f1();
int /*<<< orphan*/ g();
int /*<<< orphan*/ r();
void main(void) {
  {
    f1();
    f();
    g();
    r();
    return;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <f1@plt>
mov    $0x0,%al
call   1040 <f@plt>
mov    $0x0,%al
call   1060 <g@plt>
mov    $0x0,%al
call   1030 <r@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <f1@plt>
xor    %eax,%eax
call   1040 <f@plt>
xor    %eax,%eax
call   1060 <g@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <r@plt>

LLVM IR (-O0):
define void @main() {
%1 = call i32 (...) @f1()
%2 = call i32 (...) @f()
%3 = call i32 (...) @g()
%4 = call i32 (...) @r()
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 (...) @f1()
%2 = tail call i32 (...) @f()
%3 = tail call i32 (...) @g()
%4 = tail call i32 (...) @r()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void PrintUsage(void) {
  fprintf(stderr, "strip_comment <filename>\n");
  return;
}


x86 assembly (clang, -O0):
<PrintUsage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<PrintUsage>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [26 x i8] c"strip_comment <filename>\0A\00"
define void @PrintUsage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [26 x i8] c"strip_comment <filename>\0A\00"
define void @PrintUsage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
ret void
}
void process_header_default(void *vp_hdr, void *vp_val, void *vp_msg) {}


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

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

LLVM IR (-O0):
define void @process_header_default(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
ret void
}

LLVM IR (-O2):
define void @process_header_default(i8* nocapture %0, i8* nocapture %1, i8* nocapture %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, long);
void printTime(long time, int roundNum) {
  printf("%3d. %8.4f\n", roundNum, time / 1000000.0);
}


x86 assembly (clang, -O0):
<printTime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%esi
cvtsi2sdq -0x8(%rbp),%xmm0
movsd  0xed0(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%rdx
lea    0xec8(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printTime>:
cvtsi2sd %rdi,%xmm0
divsd  0xee3(%rip),%xmm0
cvttsd2si %xmm0,%rdx
lea    0xedf(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"%3d. %8.4f\0A\00"
define void @printTime(i64 %0, i32 %1) {
%3 = alloca i64
%4 = alloca i32
store i64 %0, i64* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i64, i64* %3
%7 = sitofp i64 %6 to double
%8 = fdiv double %7, 1.000000e+06
%9 = fptosi double %8 to i64
%10 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %5, i64 %9)
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"%3d. %8.4f\0A\00"
define void @printTime(i64 %0, i32 %1) {
%3 = sitofp i64 %0 to double
%4 = fdiv double %3, 1.000000e+06
%5 = fptosi double %4 to i64
%6 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %1, i64 %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ put16(int, int);
void mcb_set_size(int mcb, int sz) {
  if (mcb < 0)
    return;
  put16(mcb * 16 + 3, sz);
}


x86 assembly (clang, -O0):
<mcb_set_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    112d <mcb_set_size+0x1d>
jmp    113e <mcb_set_size+0x2e>
mov    -0x4(%rbp),%edi
shl    $0x4,%edi
add    $0x3,%edi
mov    -0x8(%rbp),%esi
call   1030 <put16@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mcb_set_size>:
test   %edi,%edi
js     111f <mcb_set_size+0xf>
shl    $0x4,%edi
or     $0x3,%edi
jmp    1030 <put16@plt>
ret

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

LLVM IR (-O2):
define void @mcb_set_size(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, 0
br i1 %3, label %8, label %4
4: ; preds = %2
%5 = shl nsw i32 %0, 4
%6 = or i32 %5, 3
%7 = tail call i32 @put16(i32 %6, i32 %1)
br label %8
8: ; preds = %2, %4
ret void
}
int fSign(float x) {
  if (x == 0.0f) {
    return 0;
  } else {
    if (x < 0.0f) {
      return -1;
    } else {
      return 1;
    }
  }
}


x86 assembly (clang, -O0):
<fSign>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    112c <fSign+0x2c>
jp     112c <fSign+0x2c>
movl   $0x0,-0x4(%rbp)
jmp    114c <fSign+0x4c>
xorps  %xmm0,%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    1145 <fSign+0x45>
movl   $0xffffffff,-0x4(%rbp)
jmp    114c <fSign+0x4c>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fSign>:
xorps  %xmm1,%xmm1
xor    %ecx,%ecx
ucomiss %xmm0,%xmm1
setbe  %cl
xor    %eax,%eax
ucomiss %xmm1,%xmm0
lea    -0x1(%rcx,%rcx,1),%ecx
cmovne %ecx,%eax
cmovp  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @fSign(float %0) {
%2 = alloca i32
%3 = alloca float
store float %0, float* %3
%4 = load float, float* %3
%5 = fcmp oeq float %4, 0.000000e+00
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 0, i32* %2
br label %12
7: ; preds = %1
%8 = load float, float* %3
%9 = fcmp olt float %8, 0.000000e+00
br i1 %9, label %10, label %11
10: ; preds = %7
store i32 -1, i32* %2
br label %12
11: ; preds = %7
store i32 1, i32* %2
br label %12
12: ; preds = %11, %10, %6
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
define i32 @fSign(float %0) {
%2 = fcmp oeq float %0, 0.000000e+00
%3 = fcmp olt float %0, 0.000000e+00
%4 = select i1 %3, i32 -1, i32 1
%5 = select i1 %2, i32 0, i32 %4
ret i32 %5
}
void SCHalMemoryOverflowed() {}


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

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

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

LLVM IR (-O2):
define void @SCHalMemoryOverflowed() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ InvCipher(int, unsigned char *, unsigned char *,
                             unsigned char **, unsigned char *);
void AES_decryptWithKey(unsigned char *in, unsigned char *out,
                        unsigned char *RoundKey) {
  int Nr = 10;
  int Nk = 4;
  unsigned char state[4][4];
  InvCipher(Nr, in, out, state, RoundKey);
  return;
}


x86 assembly (clang, -O0):
<AES_decryptWithKey>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0xa,-0x1c(%rbp)
movl   $0x4,-0x20(%rbp)
mov    -0x1c(%rbp),%edi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    -0x30(%rbp),%rcx
mov    -0x18(%rbp),%r8
call   1030 <InvCipher@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<AES_decryptWithKey>:
sub    $0x18,%rsp
mov    %rdx,%r8
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    %rsp,%rcx
mov    $0xa,%edi
call   1030 <InvCipher@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define void @AES_decryptWithKey(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
%9 = alloca [4 x [4 x i8]]
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
store i32 10, i32* %7
store i32 4, i32* %8
%10 = load i32, i32* %7
%11 = load i8*, i8** %4
%12 = load i8*, i8** %5
%13 = getelementptr inbounds [4 x [4 x i8]], [4 x [4 x i8]]* %9, i64 0, i64 0
%14 = bitcast [4 x i8]* %13 to i8**
%15 = load i8*, i8** %6
%16 = call i32 @InvCipher(i32 %10, i8* %11, i8* %12, i8** %14, i8* %15)
ret void
}

LLVM IR (-O2):
define void @AES_decryptWithKey(i8* %0, i8* %1, i8* %2) {
%4 = alloca [4 x [4 x i8]]
%5 = getelementptr inbounds [4 x [4 x i8]], [4 x [4 x i8]]* %4, i64 0, i64 0, i64 0
%6 = bitcast [4 x [4 x i8]]* %4 to i8**
%7 = call i32 @InvCipher(i32 10, i8* %0, i8* %1, i8** %6, i8* %2)
ret void
}
/* Type definitions */
struct timeval {
  double tv_sec;
  int tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
double accurate_clock() {
  struct timeval tp;
  gettimeofday(&tp, NULL);
  return tp.tv_sec + tp.tv_usec / 1e6;
}


x86 assembly (clang, -O0):
<accurate_clock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
movsd  -0x10(%rbp),%xmm0
cvtsi2sdl -0x8(%rbp),%xmm1
movsd  0xec9(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<accurate_clock>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
cvtsi2sdl 0x10(%rsp),%xmm0
divsd  0xed2(%rip),%xmm0
addsd  0x8(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { double, i32 }
define double @accurate_clock() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%4 = load double, double* %3
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%6 = load i32, i32* %5
%7 = sitofp i32 %6 to double
%8 = fdiv double %7, 1.000000e+06
%9 = fadd double %4, %8
ret double %9
}

LLVM IR (-O2):
%struct.timeval = type { double, i32 }
define double @accurate_clock() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load double, double* %4
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%7 = load i32, i32* %6
%8 = sitofp i32 %7 to double
%9 = fdiv double %8, 1.000000e+06
%10 = fadd double %5, %9
ret double %10
}
int batadv_bla_tx(struct batadv_priv *bat_priv, struct sk_buff *skb,
                  unsigned short vid) {
  return 0;
}


x86 assembly (clang, -O0):
<batadv_bla_tx>:
push   %rbp
mov    %rsp,%rbp
mov    %dx,%ax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %ax,-0x12(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.batadv_priv = type opaque
%struct.sk_buff = type opaque
define i32 @batadv_bla_tx(%struct.batadv_priv* %0, %struct.sk_buff* %1, i16 zeroext %2) {
%4 = alloca %struct.batadv_priv*
%5 = alloca %struct.sk_buff*
%6 = alloca i16
store %struct.batadv_priv* %0, %struct.batadv_priv** %4
store %struct.sk_buff* %1, %struct.sk_buff** %5
store i16 %2, i16* %6
ret i32 0
}

LLVM IR (-O2):
%struct.batadv_priv = type opaque
%struct.sk_buff = type opaque
define i32 @batadv_bla_tx(%struct.batadv_priv* nocapture readnone %0, %struct.sk_buff* nocapture readnone %1, i16 zeroext %2) {
ret i32 0
}
/* Type definitions */
struct term {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ parse_app(char *, struct term **);
struct term *parse_term(char *s) {
  struct term *t = NULL;
  parse_app(s, &t);
  return t;
}


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

x86 assembly (clang, -O2):
<parse_term>:
push   %rax
movq   $0x0,(%rsp)
mov    %rsp,%rsi
call   1030 <parse_app@plt>
mov    (%rsp),%rax
pop    %rcx
ret

LLVM IR (-O0):
%struct.term = type { i32 }
define %struct.term* @parse_term(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.term*
store i8* %0, i8** %2
store %struct.term* null, %struct.term** %3
%4 = load i8*, i8** %2
%5 = call i32 @parse_app(i8* %4, %struct.term** %3)
%6 = load %struct.term*, %struct.term** %3
ret %struct.term* %6
}

LLVM IR (-O2):
%struct.term = type { i32 }
define %struct.term* @parse_term(i8* %0) {
%2 = alloca %struct.term*
%3 = bitcast %struct.term** %2 to i8*
store %struct.term* null, %struct.term** %2
%4 = call i32 @parse_app(i8* %0, %struct.term** %2)
%5 = load %struct.term*, %struct.term** %2
ret %struct.term* %5
}
struct s3c2400_adc *s3c2400_get_base_adc(void) {
  return (struct s3c2400_adc *)0x15800000;
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
mov    $0x15800000,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
mov    $0x15800000,%eax
ret

LLVM IR (-O0):
%struct.s3c2400_adc = type opaque
define %struct.s3c2400_adc* @s3c2400_get_base_adc() {
ret %struct.s3c2400_adc* inttoptr (i64 360710144 to %struct.s3c2400_adc*)
}

LLVM IR (-O2):
%struct.s3c2400_adc = type opaque
define %struct.s3c2400_adc* @s3c2400_get_base_adc() {
ret %struct.s3c2400_adc* inttoptr (i64 360710144 to %struct.s3c2400_adc*)
}