xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ fork();
int /*<<< orphan*/ printf(char *);
int main(void) {
  fork();
  fork();
  fork();
  printf("hehe!\n");
  while (1)
    ;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <fork@plt>
mov    $0x0,%al
call   1040 <fork@plt>
mov    $0x0,%al
call   1040 <fork@plt>
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
jmp    1150 <main+0x30>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <fork@plt>
xor    %eax,%eax
call   1040 <fork@plt>
xor    %eax,%eax
call   1040 <fork@plt>
lea    0xec3(%rip),%rdi
call   1030 <puts@plt>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
jmp    1150 <main+0x30>

LLVM IR (-O0):
@.str = [7 x i8] c"hehe!\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @fork()
%3 = call i32 (...) @fork()
%4 = call i32 (...) @fork()
%5 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %0, %6
br label %6
}

LLVM IR (-O2):
@str = [6 x i8] c"hehe!\00"
define i32 @main() {
%1 = tail call i32 (...) @fork()
%2 = tail call i32 (...) @fork()
%3 = tail call i32 (...) @fork()
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
br label %5
5: ; preds = %0, %5
br label %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sub_fun(char *);
int sub_fun2(int, int);
int fun(char x) {
  int y;
  (void)y;
  x = x + 1;
  sub_fun(((&x)));
  int r = 10 + 10 * (sub_fun2(10, 20));
  if (r) {
    printf("G");
  }
  y = sub_fun2(10, 20);
  ;
  x = x + 1;
  return x;
}


x86 assembly (clang, -O0):
<fun>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x1,%eax
mov    %al,-0x1(%rbp)
lea    -0x1(%rbp),%rdi
call   1030 <sub_fun@plt>
mov    $0xa,%edi
mov    $0x14,%esi
call   1040 <sub_fun2@plt>
imul   $0xa,%eax,%eax
add    $0xa,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     117f <fun+0x4f>
lea    0xe86(%rip),%rdi
call   1050 <printf@plt>
mov    $0xa,%edi
mov    $0x14,%esi
call   1040 <sub_fun2@plt>
mov    %eax,-0x8(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x1,%eax
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fun>:
push   %rax
add    $0x1,%dil
mov    %dil,0x7(%rsp)
lea    0x7(%rsp),%rdi
call   1040 <sub_fun@plt>
mov    $0xa,%edi
mov    $0x14,%esi
call   1050 <sub_fun2@plt>
cmp    $0xffffffff,%eax
je     1162 <fun+0x32>
mov    $0x47,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
mov    $0x14,%esi
call   1050 <sub_fun2@plt>
mov    0x7(%rsp),%al
add    $0x1,%al
movsbl %al,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @fun(i8 signext %0) {
%2 = alloca i8
%3 = add i8 %0, 1
store i8 %3, i8* %2
%4 = call i32 @sub_fun(i8* %2)
%5 = call i32 @sub_fun2(i32 10, i32 20)
%6 = icmp eq i32 %5, -1
br i1 %6, label %9, label %7
7: ; preds = %1
%8 = call i32 @putchar(i32 71)
br label %9
9: ; preds = %7, %1
%10 = call i32 @sub_fun2(i32 10, i32 20)
%11 = load i8, i8* %2
%12 = add i8 %11, 1
%13 = sext i8 %12 to i32
ret i32 %13
}
/* Variables and functions */
int ircd_main(int, char **);
int main(int argc, char **argv) { return ircd_main(argc, argv); }


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   1030 <ircd_main@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
jmp    1030 <ircd_main@plt>

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 @ircd_main(i32 %6, i8** %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @ircd_main(i32 %0, i8** %1)
ret i32 %3
}
/* Type definitions */
typedef scalar_t__ pid_t;

/* Variables and functions */
int /*<<< orphan*/ shellexec(char *);
scalar_t__ vfork();
pid_t shellfork(char *cmd) {
  pid_t child = vfork();
  if (child == 0) {
    shellexec(cmd);
  }
  return child;
}


x86 assembly (clang, -O0):
<shellfork>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <vfork@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    114b <shellfork+0x2b>
mov    -0x8(%rbp),%rdi
call   1030 <shellexec@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shellfork>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
xor    %eax,%eax
call   1040 <vfork@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113e <shellfork+0x1e>
mov    %r14,%rdi
call   1030 <shellexec@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i64 @shellfork(i8* %0) {
%2 = tail call i64 (...) @vfork()
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @shellexec(i8* %0)
br label %6
6: ; preds = %4, %1
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ F_OK;
int access(char *, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int);
main() {
  printf("result is %d\n",
         access("/home/bbs/0Announce/groups/GROUP_0/sysop/A3CEBDB27", F_OK));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ead(%rip),%rax
mov    (%rax),%esi
lea    0xeda(%rip),%rdi
call   1040 <access@plt>
mov    %eax,%esi
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2eb0(%rip),%rax
mov    (%rax),%esi
lea    0xedd(%rip),%rdi
call   1040 <access@plt>
lea    0xec3(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"result is %d\0A\00"
@.str.1 = [51 x i8] c"/home/bbs/0Announce/groups/GROUP_0/sysop/A3CEBDB27\00"
@F_OK = global i32 0
define i32 @main() {
%1 = load i32, i32* @F_OK
%2 = call i32 @access(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.1, i64 0, i64 0), i32 %1)
%3 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"result is %d\0A\00"
@.str.1 = [51 x i8] c"/home/bbs/0Announce/groups/GROUP_0/sysop/A3CEBDB27\00"
@F_OK = global i32 0
define i32 @main() {
%1 = load i32, i32* @F_OK
%2 = tail call i32 @access(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.1, i64 0, i64 0), i32 %1)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
void *malloc(size_t);
int /*<<< orphan*/ stderr;
void *hmalloc(size_t size) {
  void *p = malloc(size);
  if (p == NULL) {
    fprintf(stderr, "owfs-tlm"
                    ": out of memory\n");
    abort();
  }
  return p;
}


x86 assembly (clang, -O0):
<hmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1170 <hmalloc+0x40>
mov    0x2e85(%rip),%rax
mov    (%rax),%edi
lea    0xe9c(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hmalloc>:
push   %rax
call   1050 <malloc@plt>
test   %rax,%rax
je     113d <hmalloc+0xd>
pop    %rcx
ret
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
lea    0xeb3(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [25 x i8] c"owfs-tlm: out of memory\0A\00"
define i8* @hmalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = load i32, i32* @stderr
%10 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%11 = call i32 (...) @abort()
unreachable
12: ; preds = %1
%13 = load i8*, i8** %3
ret i8* %13
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [25 x i8] c"owfs-tlm: out of memory\0A\00"
define noalias i8* @hmalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 (...) @abort()
unreachable
8: ; preds = %1
ret i8* %2
}
/* Variables and functions */
unsigned long long z(unsigned long long);
unsigned long long f(unsigned long long a) {
  return z(a & 0xffff000000000000ull);
}


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

x86 assembly (clang, -O2):
<f>:
movabs $0xffff000000000000,%rax
and    %rax,%rdi
jmp    1030 <z@plt>

LLVM IR (-O0):
define i64 @f(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, -281474976710656
%5 = call i64 @z(i64 %4)
ret i64 %5
}

LLVM IR (-O2):
define i64 @f(i64 %0) {
%2 = and i64 %0, -281474976710656
%3 = tail call i64 @z(i64 %2)
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int sum_4_5();
int main() {
  int s = sum_4_5();
  printf("Sum of 4 and 5 is: %d\n", s);
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [23 x i8] c"Sum of 4 and 5 is: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (...) @sum_4_5()
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [23 x i8] c"Sum of 4 and 5 is: %d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @sum_4_5()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
void indent(int level) {
  while (level--)
    putchar(' ');
}


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

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

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

LLVM IR (-O2):
define void @indent(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %8, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %5, %3 ], [ %0, %1 ]
%5 = add nsw i32 %4, -1
%6 = tail call i32 @putchar(i8 signext 32)
%7 = icmp eq i32 %5, 0
br i1 %7, label %8, label %3
8: ; preds = %3, %1
ret void
}
int test_imm_15uint8_reg(unsigned char val) {
  return ((val) & (-0x15 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_15uint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edx
and    $0xffffffeb,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_15uint8_reg>:
test   $0xeb,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_15uint8_reg(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = and i32 %4, -21
%6 = icmp ne i32 %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_15uint8_reg(i8 zeroext %0) {
%2 = and i8 %0, -21
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ put8(int);
void fstp_preg64_qword(int reg64) {
  put8(0xDD);
  put8(0x18 + reg64);
}


x86 assembly (clang, -O0):
<fstp_preg64_qword>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0xdd,%edi
call   1030 <put8@plt>
mov    -0x4(%rbp),%edi
add    $0x18,%edi
call   1030 <put8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fstp_preg64_qword>:
push   %rbx
mov    %edi,%ebx
mov    $0xdd,%edi
call   1030 <put8@plt>
add    $0x18,%ebx
mov    %ebx,%edi
pop    %rbx
jmp    1030 <put8@plt>

LLVM IR (-O0):
define void @fstp_preg64_qword(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @put8(i32 221)
%4 = load i32, i32* %2
%5 = add nsw i32 24, %4
%6 = call i32 @put8(i32 %5)
ret void
}

LLVM IR (-O2):
define void @fstp_preg64_qword(i32 %0) {
%2 = tail call i32 @put8(i32 221)
%3 = add nsw i32 %0, 24
%4 = tail call i32 @put8(i32 %3)
ret void
}
void fb_write_cell(unsigned char row, unsigned char col, char c,
                   unsigned char fg_color, unsigned char bg_color) {
  char *cell = ((char *)0x000B8000);
  cell += (2 * 80 * row) + (2 * col);
  cell[0] = c;
  cell[1] = ((bg_color << 4) & 0xf0) | (fg_color & 0x0f);
}


x86 assembly (clang, -O0):
<fb_write_cell>:
push   %rbp
mov    %rsp,%rbp
mov    %r8b,%al
mov    %dil,-0x1(%rbp)
mov    %sil,-0x2(%rbp)
mov    %dl,-0x3(%rbp)
mov    %cl,-0x4(%rbp)
mov    %al,-0x5(%rbp)
mov    $0xb8000,%eax
mov    %rax,-0x10(%rbp)
movzbl -0x1(%rbp),%eax
imul   $0xa0,%eax,%ecx
movzbl -0x2(%rbp),%eax
shl    $0x1,%eax
add    %eax,%ecx
mov    -0x10(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x3(%rbp),%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
movzbl -0x5(%rbp),%eax
shl    $0x4,%eax
and    $0xf0,%eax
movzbl -0x4(%rbp),%ecx
and    $0xf,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x1(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<fb_write_cell>:
mov    %edi,%eax
lea    (%rax,%rax,4),%rax
shl    $0x5,%rax
mov    %esi,%esi
mov    %dl,0xb8000(%rax,%rsi,2)
shl    $0x4,%r8b
and    $0xf,%cl
or     %r8b,%cl
mov    %cl,0xb8001(%rax,%rsi,2)
ret

LLVM IR (-O0):
define void @fb_write_cell(i8 zeroext %0, i8 zeroext %1, i8 signext %2, i8 zeroext %3, i8 zeroext %4) {
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8
%10 = alloca i8
%11 = alloca i8*
store i8 %0, i8* %6
store i8 %1, i8* %7
store i8 %2, i8* %8
store i8 %3, i8* %9
store i8 %4, i8* %10
store i8* inttoptr (i64 753664 to i8*), i8** %11
%12 = load i8, i8* %6
%13 = zext i8 %12 to i32
%14 = mul nsw i32 160, %13
%15 = load i8, i8* %7
%16 = zext i8 %15 to i32
%17 = mul nsw i32 2, %16
%18 = add nsw i32 %14, %17
%19 = load i8*, i8** %11
%20 = sext i32 %18 to i64
%21 = getelementptr inbounds i8, i8* %19, i64 %20
store i8* %21, i8** %11
%22 = load i8, i8* %8
%23 = load i8*, i8** %11
%24 = getelementptr inbounds i8, i8* %23, i64 0
store i8 %22, i8* %24
%25 = load i8, i8* %10
%26 = zext i8 %25 to i32
%27 = shl i32 %26, 4
%28 = and i32 %27, 240
%29 = load i8, i8* %9
%30 = zext i8 %29 to i32
%31 = and i32 %30, 15
%32 = or i32 %28, %31
%33 = trunc i32 %32 to i8
%34 = load i8*, i8** %11
%35 = getelementptr inbounds i8, i8* %34, i64 1
store i8 %33, i8* %35
ret void
}

LLVM IR (-O2):
define void @fb_write_cell(i8 zeroext %0, i8 zeroext %1, i8 signext %2, i8 zeroext %3, i8 zeroext %4) {
%6 = zext i8 %0 to i64
%7 = mul nuw nsw i64 %6, 160
%8 = zext i8 %1 to i64
%9 = shl nuw nsw i64 %8, 1
%10 = add nuw nsw i64 %9, %7
%11 = getelementptr inbounds i8, i8* inttoptr (i64 753664 to i8*), i64 %10
store i8 %2, i8* %11
%12 = shl i8 %4, 4
%13 = and i8 %3, 15
%14 = or i8 %12, %13
%15 = getelementptr inbounds i8, i8* %11, i64 1
store i8 %14, i8* %15
ret void
}
int scan_type(unsigned char *buf, int len) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @scan_type(i8* nocapture readnone %0, i32 %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ DEBUG_ASSERT(int /*<<< orphan*/);
int /*<<< orphan*/ I2CSlaveBaseValid(unsigned long);
void I2CSlaveIntClear(unsigned long ulBase) {
  DEBUG_ASSERT(I2CSlaveBaseValid(ulBase));
  (*((volatile unsigned long *)(ulBase + 0x00000018))) = 0x00000001;
}


x86 assembly (clang, -O0):
<I2CSlaveIntClear>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <I2CSlaveBaseValid@plt>
mov    %eax,%edi
call   1030 <DEBUG_ASSERT@plt>
mov    -0x8(%rbp),%rax
movq   $0x1,0x18(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<I2CSlaveIntClear>:
push   %rbx
mov    %rdi,%rbx
call   1040 <I2CSlaveBaseValid@plt>
mov    %eax,%edi
call   1030 <DEBUG_ASSERT@plt>
movq   $0x1,0x18(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @I2CSlaveIntClear(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i32 @I2CSlaveBaseValid(i64 %3)
%5 = call i32 @DEBUG_ASSERT(i32 %4)
%6 = load i64, i64* %2
%7 = add i64 %6, 24
%8 = inttoptr i64 %7 to i64*
store volatile i64 1, i64* %8
ret void
}

LLVM IR (-O2):
define void @I2CSlaveIntClear(i64 %0) {
%2 = tail call i32 @I2CSlaveBaseValid(i64 %0)
%3 = tail call i32 @DEBUG_ASSERT(i32 %2)
%4 = add i64 %0, 24
%5 = inttoptr i64 %4 to i64*
store volatile i64 1, i64* %5
ret void
}
/* Type definitions */
struct timeval {
  int /*<<< orphan*/ member_1;
  int /*<<< orphan*/ member_0;
};
typedef int /*<<< orphan*/ fd_set;

/* Variables and functions */
int /*<<< orphan*/ FD_SET(int /*<<< orphan*/, int /*<<< orphan*/ *);
int /*<<< orphan*/ FD_ZERO(int /*<<< orphan*/ *);
int select(int, int /*<<< orphan*/ *, int /*<<< orphan*/ *,
           int /*<<< orphan*/ *, struct timeval *);
int CSLP_PollChar() {
  int retVal = 0;
  struct timeval sTime = {0, 0};
  fd_set readfds;
  FD_ZERO(&readfds);
  FD_SET(0, &readfds);
  retVal = select(1, &readfds, NULL, NULL, &sTime);
  return retVal;
}


x86 assembly (clang, -O0):
<CSLP_PollChar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x10(%rbp),%rdi
xor    %esi,%esi
mov    $0x8,%edx
call   1030 <memset@plt>
lea    -0x14(%rbp),%rdi
call   1040 <FD_ZERO@plt>
xor    %edi,%edi
lea    -0x14(%rbp),%rsi
call   1060 <FD_SET@plt>
mov    $0x1,%edi
lea    -0x14(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%ecx
lea    -0x10(%rbp),%r8
mov    %rcx,%rdx
call   1050 <select@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CSLP_PollChar>:
push   %rbx
sub    $0x10,%rsp
movq   $0x0,(%rsp)
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
call   1030 <FD_ZERO@plt>
xor    %edi,%edi
mov    %rbx,%rsi
call   1050 <FD_SET@plt>
mov    %rsp,%r8
mov    $0x1,%edi
mov    %rbx,%rsi
xor    %edx,%edx
xor    %ecx,%ecx
call   1040 <select@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
define i32 @CSLP_PollChar() {
%1 = alloca i32
%2 = alloca %struct.timeval
%3 = alloca i32
store i32 0, i32* %1
%4 = bitcast %struct.timeval* %2 to i8*
%5 = call i32 @FD_ZERO(i32* %3)
%6 = call i32 @FD_SET(i32 0, i32* %3)
%7 = call i32 @select(i32 1, i32* %3, i32* null, i32* null, %struct.timeval* %2)
store i32 %7, i32* %1
%8 = load i32, i32* %1
ret i32 %8
}

LLVM IR (-O2):
%struct.timeval = type { i32, i32 }
define i32 @CSLP_PollChar() {
%1 = alloca i64
%2 = bitcast i64* %1 to %struct.timeval*
%3 = alloca i32
%4 = bitcast i64* %1 to i8*
store i64 0, i64* %1
%5 = bitcast i32* %3 to i8*
%6 = call i32 @FD_ZERO(i32* %3)
%7 = call i32 @FD_SET(i32 0, i32* %3)
%8 = call i32 @select(i32 1, i32* %3, i32* null, i32* null, %struct.timeval* %2)
ret i32 %8
}
int score_argv(char **argv) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @score_argv(i8** nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ AF_PACKET;
int /*<<< orphan*/ SOCK_RAW;
int /*<<< orphan*/ htons(int);
int /*<<< orphan*/ printf(char *);
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int create_socket() {
  int fd;
  fd = socket(AF_PACKET, SOCK_RAW, htons(0x0806));
  if (fd == -1)
    printf("socket error\n");
  return fd;
}


x86 assembly (clang, -O0):
<create_socket>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2e99(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    0x2e9d(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
mov    $0x806,%edi
call   1030 <htons@plt>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    %eax,%edx
call   1050 <socket@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0xffffffff,-0x4(%rbp)
jne    1180 <create_socket+0x50>
lea    0xe85(%rip),%rdi
call   1040 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_socket>:
push   %rbp
push   %rbx
push   %rax
mov    0x2e9e(%rip),%rax
mov    (%rax),%ebx
mov    0x2ea5(%rip),%rax
mov    (%rax),%ebp
mov    $0x806,%edi
call   1040 <htons@plt>
mov    %ebx,%edi
mov    %ebp,%esi
mov    %eax,%edx
call   1050 <socket@plt>
mov    %eax,%ebx
cmp    $0xffffffff,%eax
jne    116d <create_socket+0x3d>
lea    0xe98(%rip),%rdi
call   1030 <puts@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@AF_PACKET = global i32 0
@SOCK_RAW = global i32 0
@.str = [14 x i8] c"socket error\0A\00"
define i32 @create_socket() {
%1 = alloca i32
%2 = load i32, i32* @AF_PACKET
%3 = load i32, i32* @SOCK_RAW
%4 = call i32 @htons(i32 2054)
%5 = call i32 @socket(i32 %2, i32 %3, i32 %4)
store i32 %5, i32* %1
%6 = load i32, i32* %1
%7 = icmp eq i32 %6, -1
br i1 %7, label %8, label %10
8: ; preds = %0
%9 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %0
%11 = load i32, i32* %1
ret i32 %11
}

LLVM IR (-O2):
@AF_PACKET = global i32 0
@SOCK_RAW = global i32 0
@str = [13 x i8] c"socket error\00"
define i32 @create_socket() {
%1 = load i32, i32* @AF_PACKET
%2 = load i32, i32* @SOCK_RAW
%3 = tail call i32 @htons(i32 2054)
%4 = tail call i32 @socket(i32 %1, i32 %2, i32 %3)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
br label %8
8: ; preds = %6, %0
ret i32 %4
}
void d_fetchul(register const unsigned char **ptr,
               register unsigned long *dest) {
  *dest = (((unsigned long)(*ptr)[0] << 24) | ((unsigned long)(*ptr)[1] << 16) |
           ((unsigned long)(*ptr)[2] << 8) | ((unsigned long)(*ptr)[3] << 0));
  *ptr += 4;
}


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

x86 assembly (clang, -O2):
<d_fetchul>:
mov    (%rdi),%rax
mov    (%rax),%ecx
shl    $0x20,%rcx
bswap  %rcx
mov    %rcx,(%rsi)
add    $0x4,%rax
mov    %rax,(%rdi)
ret

LLVM IR (-O0):
define void @d_fetchul(i8** %0, i64* %1) {
%3 = alloca i8**
%4 = alloca i64*
store i8** %0, i8*** %3
store i64* %1, i64** %4
%5 = load i8**, i8*** %3
%6 = load i8*, i8** %5
%7 = getelementptr inbounds i8, i8* %6, i64 0
%8 = load i8, i8* %7
%9 = zext i8 %8 to i64
%10 = shl i64 %9, 24
%11 = load i8**, i8*** %3
%12 = load i8*, i8** %11
%13 = getelementptr inbounds i8, i8* %12, i64 1
%14 = load i8, i8* %13
%15 = zext i8 %14 to i64
%16 = shl i64 %15, 16
%17 = or i64 %10, %16
%18 = load i8**, i8*** %3
%19 = load i8*, i8** %18
%20 = getelementptr inbounds i8, i8* %19, i64 2
%21 = load i8, i8* %20
%22 = zext i8 %21 to i64
%23 = shl i64 %22, 8
%24 = or i64 %17, %23
%25 = load i8**, i8*** %3
%26 = load i8*, i8** %25
%27 = getelementptr inbounds i8, i8* %26, i64 3
%28 = load i8, i8* %27
%29 = zext i8 %28 to i64
%30 = shl i64 %29, 0
%31 = or i64 %24, %30
%32 = load i64*, i64** %4
store i64 %31, i64* %32
%33 = load i8**, i8*** %3
%34 = load i8*, i8** %33
%35 = getelementptr inbounds i8, i8* %34, i64 4
store i8* %35, i8** %33
ret void
}

LLVM IR (-O2):
define void @d_fetchul(i8** nocapture %0, i64* nocapture writeonly %1) {
%3 = load i8*, i8** %0
%4 = load i8, i8* %3
%5 = zext i8 %4 to i64
%6 = shl nuw nsw i64 %5, 24
%7 = getelementptr inbounds i8, i8* %3, i64 1
%8 = load i8, i8* %7
%9 = zext i8 %8 to i64
%10 = shl nuw nsw i64 %9, 16
%11 = or i64 %10, %6
%12 = getelementptr inbounds i8, i8* %3, i64 2
%13 = load i8, i8* %12
%14 = zext i8 %13 to i64
%15 = shl nuw nsw i64 %14, 8
%16 = or i64 %11, %15
%17 = getelementptr inbounds i8, i8* %3, i64 3
%18 = load i8, i8* %17
%19 = zext i8 %18 to i64
%20 = or i64 %16, %19
store i64 %20, i64* %1
%21 = getelementptr inbounds i8, i8* %3, i64 4
store i8* %21, i8** %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void hello() { printf("Hello, PaperHouse!\n"); }


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

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

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

LLVM IR (-O2):
@str = [19 x i8] c"Hello, PaperHouse!\00"
define void @hello() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct v4l2_framebuffer {
  int dummy;
};
typedef int /*<<< orphan*/ f;

/* Variables and functions */
int main(void) {
  struct v4l2_framebuffer f;
  (void)f;
  return sizeof(f);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    $0x4,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 4
}
void strcharrep(char *str, char fm, char to) {
  while (*str) {
    if (*str == fm)
      *str = to;
    str++;
  }
}


x86 assembly (clang, -O0):
<strcharrep>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     114d <strcharrep+0x4d>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x9(%rbp),%ecx
cmp    %ecx,%eax
jne    113c <strcharrep+0x3c>
mov    -0xa(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1113 <strcharrep+0x13>
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcharrep>:
mov    (%rdi),%al
test   %al,%al
je     1125 <strcharrep+0x25>
add    $0x1,%rdi
jmp    111b <strcharrep+0x1b>
nopl   0x0(%rax)
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
je     1125 <strcharrep+0x25>
cmp    %sil,%al
jne    1110 <strcharrep+0x10>
mov    %dl,-0x1(%rdi)
jmp    1110 <strcharrep+0x10>
ret

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

LLVM IR (-O2):
define void @strcharrep(i8* nocapture %0, i8 signext %1, i8 signext %2) {
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %15, label %6
6: ; preds = %3, %11
%7 = phi i8 [ %13, %11 ], [ %4, %3 ]
%8 = phi i8* [ %12, %11 ], [ %0, %3 ]
%9 = icmp eq i8 %7, %1
br i1 %9, label %10, label %11
10: ; preds = %6
store i8 %2, i8* %8
br label %11
11: ; preds = %10, %6
%12 = getelementptr inbounds i8, i8* %8, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %6
15: ; preds = %11, %3
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
unsigned int spw(int /*<<< orphan*/ *);
unsigned int setPassword(uint8_t *outbuf) { return spw(outbuf); }


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

x86 assembly (clang, -O2):
<setPassword>:
jmp    1030 <spw@plt>

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

LLVM IR (-O2):
define i32 @setPassword(i32* %0) {
%2 = tail call i32 @spw(i32* %0)
ret i32 %2
}
long atol(const char *str) { return 0; }


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

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

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

LLVM IR (-O2):
define i64 @atol(i8* nocapture readnone %0) {
ret i64 0
}
/* Variables and functions */
double log(double);
double tauint_to_eta(double);
double tauint_to_tauexp(double tauint) {
  double eta = tauint_to_eta(tauint);
  double tauexp = -1.0 / log(eta);
  return tauexp;
}


x86 assembly (clang, -O0):
<tauint_to_tauexp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <tauint_to_eta@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1040 <log@plt>
movaps %xmm0,%xmm1
movsd  0xeaf(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tauint_to_tauexp>:
push   %rax
call   1030 <tauint_to_eta@plt>
call   1040 <log@plt>
movsd  0xecd(%rip),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @tauint_to_tauexp(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
store double %0, double* %2
%5 = load double, double* %2
%6 = call double @tauint_to_eta(double %5)
store double %6, double* %3
%7 = load double, double* %3
%8 = call double @log(double %7)
%9 = fdiv double -1.000000e+00, %8
store double %9, double* %4
%10 = load double, double* %4
ret double %10
}

LLVM IR (-O2):
define double @tauint_to_tauexp(double %0) {
%2 = tail call double @tauint_to_eta(double %0)
%3 = tail call double @log(double %2)
%4 = fdiv double -1.000000e+00, %3
ret double %4
}
/* Type definitions */
struct cpl_allocator {
  int dummy;
};

/* Variables and functions */
void *realloc(void *, size_t);
void *cpl_default_realloc(struct cpl_allocator *pAllocator, void *ptr,
                          size_t sz) {
  return realloc(ptr, sz);
}


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

x86 assembly (clang, -O2):
<cpl_default_realloc>:
mov    %rsi,%rdi
mov    %rdx,%rsi
jmp    1030 <realloc@plt>

LLVM IR (-O0):
%struct.cpl_allocator = type { i32 }
define i8* @cpl_default_realloc(%struct.cpl_allocator* %0, i8* %1, i64 %2) {
%4 = alloca %struct.cpl_allocator*
%5 = alloca i8*
%6 = alloca i64
store %struct.cpl_allocator* %0, %struct.cpl_allocator** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i8*, i8** %5
%8 = load i64, i64* %6
%9 = call i8* @realloc(i8* %7, i64 %8)
ret i8* %9
}

LLVM IR (-O2):
%struct.cpl_allocator = type { i32 }
define noalias i8* @cpl_default_realloc(%struct.cpl_allocator* nocapture readnone %0, i8* nocapture %1, i64 %2) {
%4 = tail call i8* @realloc(i8* %1, i64 %2)
ret i8* %4
}
int test_imm_9Duint64_lowword_mem(unsigned long long *val) {
  return ((*val) & (0x9D << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_9Duint64_lowword_mem>:
testb  $0x9d,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_9Duint64_lowword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = and i64 %4, 157
%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_9Duint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 157
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ inflush();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ readnl();
void holdit(void) {
  inflush();
  printf("Push <RETURN>");
  readnl();
}


x86 assembly (clang, -O0):
<holdit>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <inflush@plt>
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1050 <readnl@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<holdit>:
push   %rax
xor    %eax,%eax
call   1040 <inflush@plt>
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <readnl@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"Push <RETURN>\00"
define void @holdit() {
%1 = call i32 (...) @inflush()
%2 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @readnl()
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"Push <RETURN>\00"
define void @holdit() {
%1 = tail call i32 (...) @inflush()
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @readnl()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int square(int);
int main() {
  int i = square(5);
  printf("i is %d\n", i);
  return (0);
}


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

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

LLVM IR (-O0):
@.str = [9 x i8] c"i is %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @square(i32 5)
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"i is %d\0A\00"
define i32 @main() {
%1 = tail call i32 @square(i32 5)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int /*<<< orphan*/ scanf(char *, int *, int *);
int /*<<< orphan*/ update(int *, int *);
int main() {
  int a, b;
  int *pa = &a, *pb = &b;
  scanf("%d %d", &a, &b);
  update(pa, pb);
  printf("%d\n%d", a, b);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
lea    -0xc(%rbp),%rax
mov    %rax,-0x20(%rbp)
lea    0xeaa(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1050 <scanf@plt>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1030 <update@plt>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xe89(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xec5(%rip),%rdi
lea    0x4(%rsp),%rbx
mov    %rsp,%r14
mov    %rbx,%rsi
mov    %r14,%rdx
call   1050 <scanf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <update@plt>
mov    0x4(%rsp),%esi
mov    (%rsp),%edx
lea    0xe9f(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [6 x i8] c"%d\0A%d\00"
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* %2, i32** %4
store i32* %3, i32** %5
%6 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %3)
%7 = load i32*, i32** %4
%8 = load i32*, i32** %5
%9 = call i32 @update(i32* %7, i32* %8)
%10 = load i32, i32* %2
%11 = load i32, i32* %3
%12 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 %10, i32 %11)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [6 x i8] c"%d\0A%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = call i32 @update(i32* %1, i32* %2)
%7 = load i32, i32* %1
%8 = load i32, i32* %2
%9 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 %7, i32 %8)
ret i32 0
}
/* Variables and functions */
scalar_t__ RAND_MAX;
scalar_t__ rand();
double rand_d() { return (((double)rand()) / ((double)RAND_MAX)); }


x86 assembly (clang, -O0):
<rand_d>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <rand@plt>
cvtsi2sd %rax,%xmm0
mov    0x2ec1(%rip),%rax
cvtsi2sdq (%rax),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand_d>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
cvtsi2sd %rax,%xmm0
mov    0x2ec4(%rip),%rax
cvtsi2sdq (%rax),%xmm1
divsd  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
@RAND_MAX = global i64 0
define double @rand_d() {
%1 = call i64 (...) @rand()
%2 = sitofp i64 %1 to double
%3 = load i64, i64* @RAND_MAX
%4 = sitofp i64 %3 to double
%5 = fdiv double %2, %4
ret double %5
}

LLVM IR (-O2):
@RAND_MAX = global i64 0
define double @rand_d() {
%1 = tail call i64 (...) @rand()
%2 = sitofp i64 %1 to double
%3 = load i64, i64* @RAND_MAX
%4 = sitofp i64 %3 to double
%5 = fdiv double %2, %4
ret double %5
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ init(int, char **);
int /*<<< orphan*/ process();
int main(int argc, char **argv) {
  init(argc, argv);
  process();
  exit(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   1040 <init@plt>
mov    $0x0,%al
call   1030 <process@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
call   1040 <init@plt>
xor    %eax,%eax
call   1030 <process@plt>
xor    %edi,%edi
call   1050 <exit@plt>

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 @init(i32 %6, i8** %7)
%9 = call i32 (...) @process()
%10 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @init(i32 %0, i8** %1)
%4 = tail call i32 (...) @process()
%5 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
unsigned short VIM_HIF_GetReg16(int);
void VIM_IPP_GetDispalyWindowSize(unsigned short *wWidth,
                                  unsigned short *wHeight) {
  *wWidth = VIM_HIF_GetReg16((0x1c00 + 0x00E));
  *wHeight = VIM_HIF_GetReg16((0x1c00 + 0x010));
}


x86 assembly (clang, -O0):
<VIM_IPP_GetDispalyWindowSize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x1c0e,%edi
call   1030 <VIM_HIF_GetReg16@plt>
mov    %ax,%cx
mov    -0x8(%rbp),%rax
mov    %cx,(%rax)
mov    $0x1c10,%edi
call   1030 <VIM_HIF_GetReg16@plt>
mov    %ax,%cx
mov    -0x10(%rbp),%rax
mov    %cx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<VIM_IPP_GetDispalyWindowSize>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    $0x1c0e,%edi
call   1030 <VIM_HIF_GetReg16@plt>
mov    %ax,(%rbx)
mov    $0x1c10,%edi
call   1030 <VIM_HIF_GetReg16@plt>
mov    %ax,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @VIM_IPP_GetDispalyWindowSize(i16* %0, i16* %1) {
%3 = alloca i16*
%4 = alloca i16*
store i16* %0, i16** %3
store i16* %1, i16** %4
%5 = call zeroext i16 @VIM_HIF_GetReg16(i32 7182)
%6 = load i16*, i16** %3
store i16 %5, i16* %6
%7 = call zeroext i16 @VIM_HIF_GetReg16(i32 7184)
%8 = load i16*, i16** %4
store i16 %7, i16* %8
ret void
}

LLVM IR (-O2):
define void @VIM_IPP_GetDispalyWindowSize(i16* nocapture writeonly %0, i16* nocapture writeonly %1) {
%3 = tail call zeroext i16 @VIM_HIF_GetReg16(i32 7182)
store i16 %3, i16* %0
%4 = tail call zeroext i16 @VIM_HIF_GetReg16(i32 7184)
store i16 %4, i16* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ io_print(char *);
void io_prompt() { io_print(">"); }


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

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

LLVM IR (-O0):
@.str = [2 x i8] c">\00"
define void @io_prompt() {
%1 = call i32 @io_print(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c">\00"
define void @io_prompt() {
%1 = tail call i32 @io_print(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}
int mlt(int x, int y) {
  if (x == 0 || y == 0)
    return 0;
  return ((x + y - 2) % (256 - 1)) + 1;
}


x86 assembly (clang, -O0):
<mlt>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     111e <mlt+0x1e>
cmpl   $0x0,-0xc(%rbp)
jne    112a <mlt+0x2a>
movl   $0x0,-0x4(%rbp)
jmp    1141 <mlt+0x41>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
sub    $0x2,%eax
mov    $0xff,%ecx
cltd
idiv   %ecx
add    $0x1,%edx
mov    %edx,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mlt>:
xor    %eax,%eax
test   %edi,%edi
je     113c <mlt+0x3c>
test   %esi,%esi
je     113c <mlt+0x3c>
lea    (%rdi,%rsi,1),%eax
lea    (%rdi,%rsi,1),%ecx
add    $0xfffffffe,%ecx
movslq %ecx,%rcx
imul   $0xffffffff80808081,%rcx,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
add    $0xfffffffe,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
sar    $0x7,%ecx
add    %edx,%ecx
mov    %ecx,%edx
shl    $0x8,%edx
sub    %edx,%ecx
add    %ecx,%eax
add    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
define i32 @mlt(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 0
%4 = icmp eq i32 %1, 0
%5 = or i1 %3, %4
br i1 %5, label %11, label %6
6: ; preds = %2
%7 = add i32 %0, -2
%8 = add i32 %7, %1
%9 = srem i32 %8, 255
%10 = add nsw i32 %9, 1
br label %11
11: ; preds = %2, %6
%12 = phi i32 [ %10, %6 ], [ 0, %2 ]
ret i32 %12
}