xunge/DecIR huggingface dataset:
/* Variables and functions */
int fork();
int getpid();
int /*<<< orphan*/ printf(char *, int, ...);
int /*<<< orphan*/ sleep(int);
int main() {
  int ret_from_fork, mypid;
  mypid = getpid();
  printf("Before: my pid is %d\n", mypid);
  ret_from_fork = fork();
  sleep(1);
  printf("After: my pid is %d, fork() said %d\n", getpid(), ret_from_fork);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xe9d(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x0,%al
call   1060 <fork@plt>
mov    %eax,-0x8(%rbp)
mov    $0x1,%edi
call   1050 <sleep@plt>
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,%esi
mov    -0x8(%rbp),%edx
lea    0xe85(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1030 <getpid@plt>
lea    0xeb1(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
call   1060 <fork@plt>
mov    %eax,%ebx
mov    $0x1,%edi
call   1050 <sleep@plt>
xor    %eax,%eax
call   1030 <getpid@plt>
lea    0xe9d(%rip),%rdi
mov    %eax,%esi
mov    %ebx,%edx
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [22 x i8] c"Before: my pid is %d\0A\00"
@.str.1 = [37 x i8] c"After: my pid is %d, fork() said %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 (...) @getpid()
store i32 %4, i32* %3
%5 = load i32, i32* %3
%6 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = call i32 (...) @fork()
store i32 %7, i32* %2
%8 = call i32 @sleep(i32 1)
%9 = call i32 (...) @getpid()
%10 = load i32, i32* %2
%11 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0), i32 %9, i32 %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [22 x i8] c"Before: my pid is %d\0A\00"
@.str.1 = [37 x i8] c"After: my pid is %d, fork() said %d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @getpid()
%2 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 (...) @fork()
%4 = tail call i32 @sleep(i32 1)
%5 = tail call i32 (...) @getpid()
%6 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0), i32 %5, i32 %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ _hmt_register_covercase(char *, char *);
void _hmt_covercase_HMM_CosF_init(void) {
  _hmt_register_covercase("HMM_CosF", "1");
}


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

x86 assembly (clang, -O2):
<_hmt_covercase_HMM_CosF_init>:
lea    0xee9(%rip),%rdi
lea    0xeeb(%rip),%rsi
jmp    1030 <_hmt_register_covercase@plt>

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

LLVM IR (-O2):
@.str = [9 x i8] c"HMM_CosF\00"
@.str.1 = [2 x i8] c"1\00"
define void @_hmt_covercase_HMM_CosF_init() {
%1 = tail call i32 @_hmt_register_covercase(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void cprop_test10(int *data) {
  int j = 1;
  if (j)
    j = 10;
  else
    j = data[0];
  data[0] = 21 * j + data[1];
}


x86 assembly (clang, -O0):
<cprop_test10>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1125 <cprop_test10+0x25>
movl   $0xa,-0xc(%rbp)
jmp    112e <cprop_test10+0x2e>
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
imul   $0x15,-0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
add    0x4(%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<cprop_test10>:
mov    $0xd2,%eax
add    0x4(%rdi),%eax
mov    %eax,(%rdi)
ret

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

LLVM IR (-O2):
define void @cprop_test10(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 1
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 210
store i32 %4, i32* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
void sequential_last() {
  int i = 0;
  while (i < 10)
    i++;
  while (1)
    assert(1);
}


x86 assembly (clang, -O0):
<sequential_last>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0xa,-0x4(%rbp)
jge    1137 <sequential_last+0x27>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <sequential_last+0xf>
jmp    113c <sequential_last+0x2c>
mov    $0x1,%edi
call   1030 <assert@plt>
jmp    113c <sequential_last+0x2c>

x86 assembly (clang, -O2):
<sequential_last>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0x1,%edi
call   1030 <assert@plt>
jmp    1120 <sequential_last+0x10>

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

LLVM IR (-O2):
define void @sequential_last() {
br label %1
1: ; preds = %0, %1
%2 = tail call i32 @assert(i32 1)
br label %1
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fputc(char, int /*<<< orphan*/ *);
void indent(FILE *fp, int lvl) {
  int i, ind = lvl * 4;
  for (i = 0; i < ind; i++) {
    fputc(' ', fp);
  }
}


x86 assembly (clang, -O0):
<indent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x2,%eax
mov    %eax,-0x14(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1157 <indent+0x47>
mov    -0x8(%rbp),%rsi
mov    $0x20,%edi
call   1030 <fputc@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    112f <indent+0x1f>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<indent>:
push   %rbp
push   %rbx
push   %rax
test   %esi,%esi
jle    1142 <indent+0x32>
mov    %rdi,%rbx
shl    $0x2,%esi
cmp    $0x2,%esi
mov    $0x1,%ebp
cmovge %esi,%ebp
nopl   0x0(%rax,%rax,1)
mov    $0x20,%edi
mov    %rbx,%rsi
call   1030 <fputc@plt>
add    $0xffffffff,%ebp
jne    1130 <indent+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define void @indent(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %12
4: ; preds = %2
%5 = shl i32 %1, 2
%6 = call i32 @llvm.smax.i32(i32 %5, i32 1)
br label %7
7: ; preds = %4, %7
%8 = phi i32 [ %10, %7 ], [ 0, %4 ]
%9 = tail call i32 @fputc(i8 signext 32, i32* %0)
%10 = add nuw nsw i32 %8, 1
%11 = icmp eq i32 %10, %6
br i1 %11, label %12, label %7
12: ; preds = %7, %2
ret void
}
void btusb_proc_exit(void) {}


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

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

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

LLVM IR (-O2):
define void @btusb_proc_exit() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ create_write_byte(int);
void create_wait_for_light() {
  ;
  create_write_byte(147);
  create_write_byte(4);
  create_write_byte(158);
  create_write_byte(18);
  create_write_byte(147);
  create_write_byte(0);
  ;
}


x86 assembly (clang, -O0):
<create_wait_for_light>:
push   %rbp
mov    %rsp,%rbp
mov    $0x93,%edi
call   1030 <create_write_byte@plt>
mov    $0x4,%edi
call   1030 <create_write_byte@plt>
mov    $0x9e,%edi
call   1030 <create_write_byte@plt>
mov    $0x12,%edi
call   1030 <create_write_byte@plt>
mov    $0x93,%edi
call   1030 <create_write_byte@plt>
xor    %edi,%edi
call   1030 <create_write_byte@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_wait_for_light>:
push   %rax
mov    $0x93,%edi
call   1030 <create_write_byte@plt>
mov    $0x4,%edi
call   1030 <create_write_byte@plt>
mov    $0x9e,%edi
call   1030 <create_write_byte@plt>
mov    $0x12,%edi
call   1030 <create_write_byte@plt>
mov    $0x93,%edi
call   1030 <create_write_byte@plt>
xor    %edi,%edi
pop    %rax
jmp    1030 <create_write_byte@plt>

LLVM IR (-O0):
define void @create_wait_for_light() {
%1 = call i32 @create_write_byte(i32 147)
%2 = call i32 @create_write_byte(i32 4)
%3 = call i32 @create_write_byte(i32 158)
%4 = call i32 @create_write_byte(i32 18)
%5 = call i32 @create_write_byte(i32 147)
%6 = call i32 @create_write_byte(i32 0)
ret void
}

LLVM IR (-O2):
define void @create_wait_for_light() {
%1 = tail call i32 @create_write_byte(i32 147)
%2 = tail call i32 @create_write_byte(i32 4)
%3 = tail call i32 @create_write_byte(i32 158)
%4 = tail call i32 @create_write_byte(i32 18)
%5 = tail call i32 @create_write_byte(i32 147)
%6 = tail call i32 @create_write_byte(i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
void example1(void) {
  int a[42];
  a[40] = 2;
  int i = 0;
  while (i < 41) {
    a[i] = 0;
    i++;
  }
  assert(a[2] == 0);
  assert(a[3] == 0);
}


x86 assembly (clang, -O0):
<example1>:
push   %rbp
mov    %rsp,%rbp
sub    $0xc0,%rsp
movl   $0x2,-0x10(%rbp)
movl   $0x0,-0xb4(%rbp)
cmpl   $0x29,-0xb4(%rbp)
jge    115f <example1+0x4f>
movslq -0xb4(%rbp),%rax
movl   $0x0,-0xb0(%rbp,%rax,4)
mov    -0xb4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xb4(%rbp)
jmp    112c <example1+0x1c>
cmpl   $0x0,-0xa8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
cmpl   $0x0,-0xa4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
add    $0xc0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<example1>:
push   %rax
mov    $0x1,%edi
call   1030 <assert@plt>
mov    $0x1,%edi
pop    %rax
jmp    1030 <assert@plt>

LLVM IR (-O0):
define void @example1() {
%1 = alloca [42 x i32]
%2 = alloca i32
%3 = getelementptr inbounds [42 x i32], [42 x i32]* %1, i64 0, i64 40
store i32 2, i32* %3
store i32 0, i32* %2
br label %4
4: ; preds = %7, %0
%5 = load i32, i32* %2
%6 = icmp slt i32 %5, 41
br i1 %6, label %7, label %13
7: ; preds = %4
%8 = load i32, i32* %2
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds [42 x i32], [42 x i32]* %1, i64 0, i64 %9
store i32 0, i32* %10
%11 = load i32, i32* %2
%12 = add nsw i32 %11, 1
store i32 %12, i32* %2
br label %4
13: ; preds = %4
%14 = getelementptr inbounds [42 x i32], [42 x i32]* %1, i64 0, i64 2
%15 = load i32, i32* %14
%16 = icmp eq i32 %15, 0
%17 = zext i1 %16 to i32
%18 = call i32 @assert(i32 %17)
%19 = getelementptr inbounds [42 x i32], [42 x i32]* %1, i64 0, i64 3
%20 = load i32, i32* %19
%21 = icmp eq i32 %20, 0
%22 = zext i1 %21 to i32
%23 = call i32 @assert(i32 %22)
ret void
}

LLVM IR (-O2):
define void @example1() {
%1 = tail call i32 @assert(i32 1)
%2 = tail call i32 @assert(i32 1)
ret void
}
char is_domain_edge(int x, int y) {
  return x == 0 || y == 0 || x + 1 == 100 || y + 1 == 50;
}


x86 assembly (clang, -O0):
<is_domain_edge>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x1,%al
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x9(%rbp)
je     114b <is_domain_edge+0x4b>
mov    $0x1,%al
cmpl   $0x0,-0x8(%rbp)
mov    %al,-0x9(%rbp)
je     114b <is_domain_edge+0x4b>
mov    -0x4(%rbp),%ecx
add    $0x1,%ecx
mov    $0x1,%al
cmp    $0x64,%ecx
mov    %al,-0x9(%rbp)
je     114b <is_domain_edge+0x4b>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
cmp    $0x32,%eax
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_domain_edge>:
test   %edi,%edi
sete   %al
test   %esi,%esi
sete   %cl
or     %al,%cl
cmp    $0x63,%edi
sete   %dl
cmp    $0x31,%esi
sete   %al
or     %dl,%al
or     %cl,%al
ret

LLVM IR (-O0):
define signext i8 @is_domain_edge(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 eq i32 %5, 0
br i1 %6, label %18, label %7
7: ; preds = %2
%8 = load i32, i32* %4
%9 = icmp eq i32 %8, 0
br i1 %9, label %18, label %10
10: ; preds = %7
%11 = load i32, i32* %3
%12 = add nsw i32 %11, 1
%13 = icmp eq i32 %12, 100
br i1 %13, label %18, label %14
14: ; preds = %10
%15 = load i32, i32* %4
%16 = add nsw i32 %15, 1
%17 = icmp eq i32 %16, 50
br label %18
18: ; preds = %14, %10, %7, %2
%19 = phi i1 [ true, %10 ], [ true, %7 ], [ true, %2 ], [ %17, %14 ]
%20 = zext i1 %19 to i32
%21 = trunc i32 %20 to i8
ret i8 %21
}

LLVM IR (-O2):
define signext i8 @is_domain_edge(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 0
%4 = icmp eq i32 %1, 0
%5 = or i1 %3, %4
%6 = icmp eq i32 %0, 99
%7 = or i1 %6, %5
%8 = icmp eq i32 %1, 49
%9 = or i1 %8, %7
%10 = zext i1 %9 to i8
ret i8 %10
}
int f1(int y, int x) {
  int a = y | x;
  return a & x;
}


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
or     -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
and    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f1>:
mov    %esi,%eax
ret

LLVM IR (-O0):
define i32 @f1(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = or i32 %6, %7
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = load i32, i32* %4
%11 = and i32 %9, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @f1(i32 %0, i32 returned %1) {
ret i32 %1
}
const char *funcname(const char *func) { return func ? func : ""; }


x86 assembly (clang, -O0):
<funcname>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1120 <funcname+0x20>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    1130 <funcname+0x30>
lea    0xed9(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    1130 <funcname+0x30>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<funcname>:
test   %rdi,%rdi
lea    0xef6(%rip),%rax
cmovne %rdi,%rax
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i8* @funcname(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = load i8*, i8** %2
br label %8
7: ; preds = %1
br label %8
8: ; preds = %7, %5
%9 = phi i8* [ %6, %5 ], [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), %7 ]
ret i8* %9
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i8* @funcname(i8* readnone %0) {
%2 = icmp eq i8* %0, null
%3 = select i1 %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* %0
ret i8* %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ xor_block(int /*<<< orphan*/ *, int /*<<< orphan*/ const *);
void add_round_key(uint8_t d[(4 * 4)], const uint8_t k[(4 * 4)]) {
  xor_block(d, k);
}


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

x86 assembly (clang, -O2):
<add_round_key>:
jmp    1030 <xor_block@plt>

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

LLVM IR (-O2):
define void @add_round_key(i32* %0, i32* %1) {
%3 = tail call i32 @xor_block(i32* %0, i32* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_StoreObjectCreate();
int /*<<< orphan*/ test_StoreObjectGettersSetters();
void test_SotreObjects() {
  test_StoreObjectCreate();
  test_StoreObjectGettersSetters();
}


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

x86 assembly (clang, -O2):
<test_SotreObjects>:
push   %rax
xor    %eax,%eax
call   1040 <test_StoreObjectCreate@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <test_StoreObjectGettersSetters@plt>

LLVM IR (-O0):
define void @test_SotreObjects() {
%1 = call i32 (...) @test_StoreObjectCreate()
%2 = call i32 (...) @test_StoreObjectGettersSetters()
ret void
}

LLVM IR (-O2):
define void @test_SotreObjects() {
%1 = tail call i32 (...) @test_StoreObjectCreate()
%2 = tail call i32 (...) @test_StoreObjectGettersSetters()
ret void
}
void g_object_get() {}


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

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

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

LLVM IR (-O2):
define void @g_object_get() {
ret void
}
/* Variables and functions */
char *get_mimetype_by_ext(char **);
char *strrchr(char *, char);
char *get_mimetype_by_name(char *name) {
  char *extension = strrchr(name, '.');
  if (!extension)
    return NULL;
  return get_mimetype_by_ext(&extension);
}


x86 assembly (clang, -O0):
<get_mimetype_by_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x2e,%esi
call   1040 <strrchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1156 <get_mimetype_by_name+0x36>
movq   $0x0,-0x8(%rbp)
jmp    1163 <get_mimetype_by_name+0x43>
lea    -0x18(%rbp),%rdi
call   1030 <get_mimetype_by_ext@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_mimetype_by_name>:
push   %rax
mov    $0x2e,%esi
call   1040 <strrchr@plt>
mov    %rax,(%rsp)
test   %rax,%rax
je     113e <get_mimetype_by_name+0x1e>
mov    %rsp,%rdi
call   1030 <get_mimetype_by_ext@plt>
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i8* @get_mimetype_by_name(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i8* @strrchr(i8* %5, i8 signext 46)
store i8* %6, i8** %4
%7 = load i8*, i8** %4
%8 = icmp ne i8* %7, null
br i1 %8, label %10, label %9
9: ; preds = %1
store i8* null, i8** %2
br label %12
10: ; preds = %1
%11 = call i8* @get_mimetype_by_ext(i8** %4)
store i8* %11, i8** %2
br label %12
12: ; preds = %10, %9
%13 = load i8*, i8** %2
ret i8* %13
}

LLVM IR (-O2):
define i8* @get_mimetype_by_name(i8* %0) {
%2 = alloca i8*
%3 = bitcast i8** %2 to i8*
%4 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 46)
store i8* %4, i8** %2
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = call i8* @get_mimetype_by_ext(i8** %2)
br label %8
8: ; preds = %1, %6
%9 = phi i8* [ %7, %6 ], [ null, %1 ]
ret i8* %9
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int _read_atollic(int /*<<< orphan*/, int /*<<< orphan*/ *, int /*<<< orphan*/);
int _read(int32_t file, uint8_t *ptr, int32_t len) {
  return _read_atollic(file, ptr, len);
}


x86 assembly (clang, -O0):
<_read>:
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
mov    -0x14(%rbp),%edx
call   1030 <_read_atollic@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_read>:
jmp    1030 <_read_atollic@plt>

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

LLVM IR (-O2):
define i32 @_read(i32 %0, i32* %1, i32 %2) {
%4 = tail call i32 @_read_atollic(i32 %0, i32* %1, i32 %2)
ret i32 %4
}
ttputc(c) { return 3; }


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

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

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

LLVM IR (-O2):
define i32 @ttputc(i32 %0) {
ret i32 3
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char *);
scalar_t__ strlen(char *);
char *xmalloc(scalar_t__);
char *strsave(char *str) {
  char *p = xmalloc(strlen(str) + 1);
  strcpy(p, str);
  return p;
}


x86 assembly (clang, -O0):
<strsave>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1050 <xmalloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strsave>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <xmalloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @strsave(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = add nsw i64 %5, 1
%7 = call i8* @xmalloc(i64 %6)
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = load i8*, i8** %2
%10 = call i32 @strcpy(i8* %8, i8* %9)
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
define i8* @strsave(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i8* @xmalloc(i64 %3)
%5 = tail call i32 @strcpy(i8* %4, i8* %0)
ret i8* %4
}
int int2perm(int val) {
  int i = 0;
  int v = 0;
  while (val) {
    v |= (val % 10) << (i * 3);
    val /= 10;
    i++;
  }
  return v;
}


x86 assembly (clang, -O0):
<int2perm>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1154 <int2perm+0x54>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
imul   $0x3,-0x8(%rbp),%ecx
shl    %cl,%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1115 <int2perm+0x15>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<int2perm>:
test   %edi,%edi
je     1143 <int2perm+0x43>
xor    %ecx,%ecx
xor    %eax,%eax
nopl   0x0(%rax,%rax,1)
movslq %edi,%rdx
imul   $0x66666667,%rdx,%rdi
mov    %rdi,%rsi
shr    $0x3f,%rsi
sar    $0x22,%rdi
add    %esi,%edi
lea    (%rdi,%rdi,1),%esi
lea    (%rsi,%rsi,4),%r8d
mov    %edx,%esi
sub    %r8d,%esi
shl    %cl,%esi
or     %esi,%eax
add    $0x9,%edx
add    $0x3,%ecx
cmp    $0x12,%edx
ja     1110 <int2perm+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @int2perm(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %15, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %10, %3 ], [ 0, %1 ]
%5 = phi i32 [ %12, %3 ], [ 0, %1 ]
%6 = phi i32 [ %11, %3 ], [ %0, %1 ]
%7 = srem i32 %6, 10
%8 = mul nsw i32 %5, 3
%9 = shl i32 %7, %8
%10 = or i32 %9, %4
%11 = sdiv i32 %6, 10
%12 = add nuw nsw i32 %5, 1
%13 = add i32 %6, 9
%14 = icmp ult i32 %13, 19
br i1 %14, label %15, label %3
15: ; preds = %3, %1
%16 = phi i32 [ 0, %1 ], [ %10, %3 ]
ret i32 %16
}
void remove_comments(char *line) {
  int i;
  for (i = 0; line[i] != '\0'; ++i) {
    if (line[i] == '#') {
      break;
    }
  }
  line[i] = '\n';
  line[i + 1] = '\0';
}


x86 assembly (clang, -O0):
<remove_comments>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1151 <remove_comments+0x51>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x23,%eax
jne    113e <remove_comments+0x3e>
jmp    1151 <remove_comments+0x51>
jmp    1143 <remove_comments+0x43>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <remove_comments+0xf>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0xa,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<remove_comments>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%rdi,%rax,1),%ecx
test   %cl,%cl
je     1123 <remove_comments+0x23>
cmp    $0x23,%cl
je     1123 <remove_comments+0x23>
add    $0x1,%rax
jmp    1110 <remove_comments+0x10>
mov    %eax,%ecx
movb   $0xa,(%rdi,%rcx,1)
add    $0x1,%eax
movb   $0x0,(%rdi,%rax,1)
ret

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

LLVM IR (-O2):
define void @remove_comments(i8* nocapture %0) {
br label %2
2: ; preds = %6, %1
%3 = phi i64 [ %7, %6 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
switch i8 %5, label %6 [
i8 0, label %8
i8 35, label %8
]
6: ; preds = %2
%7 = add nuw i64 %3, 1
br label %2
8: ; preds = %2, %2
%9 = and i64 %3, 4294967295
%10 = getelementptr inbounds i8, i8* %0, i64 %9
store i8 10, i8* %10
%11 = add i64 %3, 1
%12 = and i64 %11, 4294967295
%13 = getelementptr inbounds i8, i8* %0, i64 %12
store i8 0, i8* %13
ret void
}
int test_imm_1Duint16_mem(unsigned short *val) {
  return ((*val) & (0x1D << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_1Duint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 29
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float, float, float);
int main(int argc, char *argv[]) {
  float a = 94.83;
  printf("%e, %f, %g\n", a, a, a);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movss  0xed2(%rip),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
movss  -0x14(%rbp),%xmm1
movss  -0x14(%rbp),%xmm2
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xeec(%rip),%rdi
movss  0xee0(%rip),%xmm0
movaps %xmm0,%xmm1
movaps %xmm0,%xmm2
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"%e, %f, %g\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca float
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store float 0x4057B51EC0000000, float* %6
%7 = load float, float* %6
%8 = load float, float* %6
%9 = load float, float* %6
%10 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), float %7, float %8, float %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"%e, %f, %g\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), float 0x4057B51EC0000000, float 0x4057B51EC0000000, float 0x4057B51EC0000000)
ret i32 0
}
/* Type definitions */
typedef int mode_t;

/* Variables and functions */
int S_IWGRP;
int is_group_write(mode_t mode) { return mode & S_IWGRP; }


x86 assembly (clang, -O0):
<is_group_write>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    0x2ed7(%rip),%rcx
and    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_group_write>:
mov    %edi,%eax
mov    0x2edf(%rip),%rcx
and    (%rcx),%eax
ret

LLVM IR (-O0):
@S_IWGRP = global i32 0
define i32 @is_group_write(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @S_IWGRP
%5 = and i32 %3, %4
ret i32 %5
}

LLVM IR (-O2):
@S_IWGRP = global i32 0
define i32 @is_group_write(i32 %0) {
%2 = load i32, i32* @S_IWGRP
%3 = and i32 %2, %0
ret i32 %3
}
/* Variables and functions */
double cos(int);
double cosinefunc(double x, int term, int ioff) {
  return cos((ioff + term) * x);
}


x86 assembly (clang, -O0):
<cosinefunc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
mov    %esi,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    -0xc(%rbp),%eax
cvtsi2sd %eax,%xmm0
mulsd  -0x8(%rbp),%xmm0
cvttsd2si %xmm0,%edi
call   1030 <cos@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cosinefunc>:
add    %esi,%edi
cvtsi2sd %edi,%xmm1
mulsd  %xmm0,%xmm1
cvttsd2si %xmm1,%edi
jmp    1030 <cos@plt>

LLVM IR (-O0):
define double @cosinefunc(double %0, i32 %1, i32 %2) {
%4 = alloca double
%5 = alloca i32
%6 = alloca i32
store double %0, double* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %6
%8 = load i32, i32* %5
%9 = add nsw i32 %7, %8
%10 = sitofp i32 %9 to double
%11 = load double, double* %4
%12 = fmul double %10, %11
%13 = fptosi double %12 to i32
%14 = call double @cos(i32 %13)
ret double %14
}

LLVM IR (-O2):
define double @cosinefunc(double %0, i32 %1, i32 %2) {
%4 = add nsw i32 %2, %1
%5 = sitofp i32 %4 to double
%6 = fmul double %5, %0
%7 = fptosi double %6 to i32
%8 = tail call double @cos(i32 %7)
ret double %8
}
unsigned int _check_times(unsigned x, unsigned y) {
  unsigned long long whole_ans =
      ((unsigned long long)x) * ((unsigned long long)y);
  unsigned word_ans = (unsigned)whole_ans;
  if (word_ans < whole_ans || word_ans > (1 << 28))
    (_throw_badalloc_fn("/scratch/repos/new/home/jordi_armengol_estape/"
                        "c-scraper/outputs/2022-01-22/02-19-57/repos/FauxFaux/"
                        "cyclone/refs/heads/master/bin/genfiles/slowdict.c",
                        284));
  return word_ans;
}


x86 assembly (clang, -O0):
<_check_times>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
imul   %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%rax
jb     114d <_check_times+0x3d>
cmpl   $0x10000000,-0x14(%rbp)
jbe    1160 <_check_times+0x50>
lea    0xeac(%rip),%rdi
mov    $0x11c,%esi
mov    $0x0,%al
call   1030 <_throw_badalloc_fn@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_check_times>:
push   %rbx
mov    %edi,%eax
mul    %esi
mov    %eax,%ebx
jo     1121 <_check_times+0x11>
cmp    $0x10000001,%ebx
jb     1134 <_check_times+0x24>
lea    0xed8(%rip),%rdi
mov    $0x11c,%esi
xor    %eax,%eax
call   1030 <_throw_badalloc_fn@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [149 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/FauxFaux/cyclone/refs/heads/master/bin/genfiles/slowdict.c\00"
define i32 @_check_times(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i64
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %3
%8 = zext i32 %7 to i64
%9 = load i32, i32* %4
%10 = zext i32 %9 to i64
%11 = mul i64 %8, %10
store i64 %11, i64* %5
%12 = load i64, i64* %5
%13 = trunc i64 %12 to i32
store i32 %13, i32* %6
%14 = load i32, i32* %6
%15 = zext i32 %14 to i64
%16 = load i64, i64* %5
%17 = icmp ult i64 %15, %16
br i1 %17, label %21, label %18
18: ; preds = %2
%19 = load i32, i32* %6
%20 = icmp ugt i32 %19, 268435456
br i1 %20, label %21, label %23
21: ; preds = %18, %2
%22 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @_throw_badalloc_fn to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([149 x i8], [149 x i8]* @.str, i64 0, i64 0), i32 284)
br label %23
23: ; preds = %21, %18
%24 = load i32, i32* %6
ret i32 %24
}

LLVM IR (-O2):
@.str = [149 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/FauxFaux/cyclone/refs/heads/master/bin/genfiles/slowdict.c\00"
define i32 @_check_times(i32 %0, i32 %1) {
%3 = tail call { i32, i1 } @llvm.umul.with.overflow.i32(i32 %0, i32 %1)
%4 = extractvalue { i32, i1 } %3, 0
%5 = extractvalue { i32, i1 } %3, 1
%6 = icmp ugt i32 %4, 268435456
%7 = or i1 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = tail call i32 (i8*, i32, ...) bitcast (i32 (...)* @_throw_badalloc_fn to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([149 x i8], [149 x i8]* @.str, i64 0, i64 0), i32 284)
br label %10
10: ; preds = %2, %8
ret i32 %4
}
void clearrot(job) char job[150];
{ clear_rot(); }


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

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

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

LLVM IR (-O2):
define void @clearrot(i8* nocapture readnone %0) {
%2 = tail call i32 (...) @clear_rot()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  printf("\n##### Hello #####\n\n");
  while (1) {
  }
}


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>
jmp    1132 <main+0x22>

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
nopl   (%rax)
jmp    1120 <main+0x10>

LLVM IR (-O0):
@.str = [21 x i8] c"\0A##### Hello #####\0A\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 ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %2, %7
br label %7
}

LLVM IR (-O2):
@str = [20 x i8] c"\0A##### Hello #####\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
br label %4
4: ; preds = %2, %4
br label %4
}
/* Variables and functions */
char toupper(char);
void uppercase(char *ar) {
  while (*ar) {
    *ar = toupper(*ar);
    ar++;
  }
}


x86 assembly (clang, -O0):
<uppercase>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     114e <uppercase+0x3e>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <toupper@plt>
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <uppercase+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uppercase>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1136 <uppercase+0x26>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <toupper@plt>
mov    %al,-0x1(%rbx)
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <uppercase+0x10>
pop    %rbx
ret

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

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

/* Variables and functions */
void __u64_cpy(void *a, void *b) { *(uint64_t *)a = *(uint64_t *)b; }


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

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

LLVM IR (-O0):
define void @__u64_cpy(i8* %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 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
%8 = load i8*, i8** %3
%9 = bitcast i8* %8 to i32*
store i32 %7, i32* %9
ret void
}

LLVM IR (-O2):
define void @__u64_cpy(i8* nocapture writeonly %0, i8* nocapture %1) {
%3 = bitcast i8* %1 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %0 to i32*
store i32 %4, i32* %5
ret void
}
/* Variables and functions */
volatile unsigned int SPE_SWAP32(unsigned int data) {
  unsigned int cmd = data;
  unsigned char *p = &cmd;
  return ((p[3] << 0) | (p[2] << 8) | (p[1] << 16) | (p[0] << 24));
}


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

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

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

LLVM IR (-O2):
define i32 @SPE_SWAP32(i32 %0) {
%2 = tail call i32 @llvm.bswap.i32(i32 %0)
ret i32 %2
}
unsigned long increasing(unsigned long last) { return (last + 1); }


x86 assembly (clang, -O0):
<increasing>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<increasing>:
lea    0x1(%rdi),%rax
ret

LLVM IR (-O0):
define i64 @increasing(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add i64 %3, 1
ret i64 %4
}

LLVM IR (-O2):
define i64 @increasing(i64 %0) {
%2 = add i64 %0, 1
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void thanks_2() { printf("Thank you!\n"); }


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

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

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

LLVM IR (-O2):
@str = [11 x i8] c"Thank you!\00"
define void @thanks_2() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
ret void
}
struct cell *foo4() {
  return 0;
}


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

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

LLVM IR (-O0):
%struct.cell = type opaque
define %struct.cell* @foo4() {
ret %struct.cell* null
}

LLVM IR (-O2):
%struct.cell = type opaque
define noalias %struct.cell* @foo4() {
ret %struct.cell* null
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
int /*<<< orphan*/ _mm_adds_epi8(int /*<<< orphan*/, int /*<<< orphan*/);
__m128i test_mm_adds_epi8(__m128i A, __m128i B) { return _mm_adds_epi8(A, B); }


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

x86 assembly (clang, -O2):
<test_mm_adds_epi8>:
jmp    1030 <_mm_adds_epi8@plt>

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

LLVM IR (-O2):
define i32 @test_mm_adds_epi8(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_adds_epi8(i32 %0, i32 %1)
ret i32 %3
}
int shrink_left(int *arr, int min_index, int end_left) {
  int c;
  for (c = end_left - 1; c >= 0; c--) {
    if (arr[c] <= arr[min_index])
      return c + 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<shrink_left>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    -0x18(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jl     115e <shrink_left+0x5e>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    -0x10(%rbp),%rcx
movslq -0x14(%rbp),%rdx
cmp    (%rcx,%rdx,4),%eax
jg     114b <shrink_left+0x4b>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1165 <shrink_left+0x65>
jmp    1150 <shrink_left+0x50>
mov    -0x1c(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
jmp    1117 <shrink_left+0x17>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<shrink_left>:
movslq %esi,%rcx
mov    %edx,%eax
cs nopw 0x0(%rax,%rax,1)
nop
test   %eax,%eax
jle    1125 <shrink_left+0x25>
mov    -0x4(%rdi,%rax,4),%edx
add    $0xffffffffffffffff,%rax
cmp    (%rdi,%rcx,4),%edx
jg     1110 <shrink_left+0x10>
add    $0x1,%eax
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @shrink_left(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32* %0, i32** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
%9 = load i32, i32* %7
%10 = sub nsw i32 %9, 1
store i32 %10, i32* %8
br label %11
11: ; preds = %30, %3
%12 = load i32, i32* %8
%13 = icmp sge i32 %12, 0
br i1 %13, label %14, label %33
14: ; preds = %11
%15 = load i32*, i32** %5
%16 = load i32, i32* %8
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i32, i32* %15, i64 %17
%19 = load i32, i32* %18
%20 = load i32*, i32** %5
%21 = load i32, i32* %6
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds i32, i32* %20, i64 %22
%24 = load i32, i32* %23
%25 = icmp sle i32 %19, %24
br i1 %25, label %26, label %29
26: ; preds = %14
%27 = load i32, i32* %8
%28 = add nsw i32 %27, 1
store i32 %28, i32* %4
br label %34
29: ; preds = %14
br label %30
30: ; preds = %29
%31 = load i32, i32* %8
%32 = add nsw i32 %31, -1
store i32 %32, i32* %8
br label %11
33: ; preds = %11
store i32 0, i32* %4
br label %34
34: ; preds = %33, %26
%35 = load i32, i32* %4
ret i32 %35
}

LLVM IR (-O2):
define i32 @shrink_left(i32* nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = zext i32 %2 to i64
br label %7
7: ; preds = %12, %3
%8 = phi i64 [ %9, %12 ], [ %6, %3 ]
%9 = add nsw i64 %8, -1
%10 = trunc i64 %8 to i32
%11 = icmp sgt i32 %10, 0
br i1 %11, label %12, label %19
12: ; preds = %7
%13 = getelementptr inbounds i32, i32* %0, i64 %9
%14 = load i32, i32* %13
%15 = load i32, i32* %5
%16 = icmp sgt i32 %14, %15
br i1 %16, label %7, label %17
17: ; preds = %12
%18 = trunc i64 %8 to i32
br label %19
19: ; preds = %7, %17
%20 = phi i32 [ %18, %17 ], [ 0, %7 ]
ret i32 %20
}