xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isodigit(int);
void t_isodigit_0xcc() {
  Assert_real((isodigit(204) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isodigit.c",
              1025, ("isodigit should be 0 for 0xcc"));
}


x86 assembly (clang, -O0):
<t_isodigit_0xcc>:
push   %rbp
mov    %rsp,%rbp
mov    $0xcc,%edi
call   1040 <isodigit@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x401,%edx
lea    0xf5c(%rip),%rcx
call   1030 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isodigit_0xcc>:
push   %rax
mov    $0xcc,%edi
call   1040 <isodigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x401,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isodigit.c\00"
@.str.1 = [30 x i8] c"isodigit should be 0 for 0xcc\00"
define void @t_isodigit_0xcc() {
%1 = call i64 @isodigit(i32 204)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 1025, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isodigit.c\00"
@.str.1 = [30 x i8] c"isodigit should be 0 for 0xcc\00"
define void @t_isodigit_0xcc() {
%1 = tail call i64 @isodigit(i32 204)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 1025, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
char *s_home() { return "home"; }


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

x86 assembly (clang, -O2):
<s_home>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [5 x i8] c"home\00"
define i8* @s_home() {
ret i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [5 x i8] c"home\00"
define i8* @s_home() {
ret i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0)
}
/* Type definitions */
typedef int int64_t;

/* Variables and functions */
int round(int /*<<< orphan*/);
int /*<<< orphan*/ sqrt(double);
int64_t perfect_square(int64_t n) {
  int64_t x = round(sqrt((double)n));
  return (x * x) == n;
}


x86 assembly (clang, -O0):
<perfect_square>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
call   1040 <sqrt@plt>
mov    %eax,%edi
call   1030 <round@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
imul   -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<perfect_square>:
push   %rbx
mov    %edi,%ebx
cvtsi2sd %edi,%xmm0
call   1040 <sqrt@plt>
mov    %eax,%edi
call   1030 <round@plt>
imul   %eax,%eax
xor    %ecx,%ecx
cmp    %ebx,%eax
sete   %cl
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @perfect_square(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sitofp i32 %4 to double
%6 = call i32 @sqrt(double %5)
%7 = call i32 @round(i32 %6)
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = load i32, i32* %3
%10 = mul nsw i32 %8, %9
%11 = load i32, i32* %2
%12 = icmp eq i32 %10, %11
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
define i32 @perfect_square(i32 %0) {
%2 = sitofp i32 %0 to double
%3 = tail call i32 @sqrt(double %2)
%4 = tail call i32 @round(i32 %3)
%5 = mul nsw i32 %4, %4
%6 = icmp eq i32 %5, %0
%7 = zext i1 %6 to i32
ret i32 %7
}
void print_buf(char buf[], int size) {
  int i;
  for (i = 0; i < size; i++)
    printf(1, "%d", buf[i]);
  printf(1, "\n");
}


x86 assembly (clang, -O0):
<print_buf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    115f <print_buf+0x4f>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%edx
mov    $0x1,%edi
lea    0xeb6(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <print_buf+0x16>
mov    $0x1,%edi
lea    0xe98(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_buf>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    114d <print_buf+0x3d>
mov    %rdi,%r15
mov    %esi,%r12d
lea    0xed7(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
movsbl (%r15,%rbx,1),%edx
mov    $0x1,%edi
mov    %r14,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <print_buf+0x20>
lea    0xeaf(%rip),%rsi
mov    $0x1,%edi
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [2 x i8] c"\0A\00"
define void @print_buf(i8* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %14
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %12, %6 ]
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = tail call i32 (i8*, ...) @printf(i8* inttoptr (i64 1 to i8*), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = add nuw nsw i64 %7, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %14, label %6
14: ; preds = %6, %2
%15 = tail call i32 (i8*, ...) @printf(i8* inttoptr (i64 1 to i8*), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int fib(unsigned int n) {
  int a = 0;
  int b = 1;
  while (n--) {
    int tmp = b;
    b = b + a;
    a = tmp;
  };
  return a;
}


x86 assembly (clang, -O0):
<fib>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x4(%rbp)
cmp    $0x0,%eax
je     1143 <fib+0x43>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1115 <fib+0x15>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fib>:
test   %edi,%edi
je     111a <fib+0x1a>
lea    -0x1(%rdi),%eax
mov    %edi,%ecx
and    $0x7,%ecx
cmp    $0x7,%eax
jae    111d <fib+0x1d>
xor    %edx,%edx
mov    $0x1,%esi
jmp    1145 <fib+0x45>
xor    %eax,%eax
ret
and    $0xfffffff8,%edi
xor    %edx,%edx
mov    $0x1,%esi
nopw   0x0(%rax,%rax,1)
add    %esi,%edx
add    %edx,%esi
add    %esi,%edx
add    %edx,%esi
add    %esi,%edx
add    %edx,%esi
add    %esi,%edx
add    %edx,%esi
add    $0xfffffff8,%edi
jne    1130 <fib+0x30>
mov    %edx,%eax
test   %ecx,%ecx
je     115d <fib+0x5d>
nopl   0x0(%rax,%rax,1)
mov    %esi,%eax
add    %esi,%edx
mov    %edx,%esi
mov    %eax,%edx
add    $0xffffffff,%ecx
jne    1150 <fib+0x50>
ret

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

LLVM IR (-O2):
define i32 @fib(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %35, label %3
3: ; preds = %1
%4 = add i32 %0, -1
%5 = and i32 %0, 7
%6 = icmp ult i32 %4, 7
br i1 %6, label %23, label %7
7: ; preds = %3
%8 = and i32 %0, -8
br label %9
9: ; preds = %9, %7
%10 = phi i32 [ 1, %7 ], [ %20, %9 ]
%11 = phi i32 [ 0, %7 ], [ %19, %9 ]
%12 = phi i32 [ 0, %7 ], [ %21, %9 ]
%13 = add nsw i32 %10, %11
%14 = add nsw i32 %13, %10
%15 = add nsw i32 %14, %13
%16 = add nsw i32 %15, %14
%17 = add nsw i32 %16, %15
%18 = add nsw i32 %17, %16
%19 = add nsw i32 %18, %17
%20 = add nsw i32 %19, %18
%21 = add i32 %12, 8
%22 = icmp eq i32 %21, %8
br i1 %22, label %23, label %9
23: ; preds = %9, %3
%24 = phi i32 [ undef, %3 ], [ %19, %9 ]
%25 = phi i32 [ 1, %3 ], [ %20, %9 ]
%26 = phi i32 [ 0, %3 ], [ %19, %9 ]
%27 = icmp eq i32 %5, 0
br i1 %27, label %35, label %28
28: ; preds = %23, %28
%29 = phi i32 [ %32, %28 ], [ %25, %23 ]
%30 = phi i32 [ %29, %28 ], [ %26, %23 ]
%31 = phi i32 [ %33, %28 ], [ 0, %23 ]
%32 = add nsw i32 %29, %30
%33 = add i32 %31, 1
%34 = icmp eq i32 %33, %5
br i1 %34, label %35, label %28
35: ; preds = %23, %28, %1
%36 = phi i32 [ 0, %1 ], [ %24, %23 ], [ %29, %28 ]
ret i32 %36
}
/* Variables and functions */
int /*<<< orphan*/ outbyte(unsigned int);
void outword(unsigned w) {
  outbyte(w);
  outbyte(w >> 8);
  outbyte(w >> 16);
  outbyte(w >> 24);
}


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

x86 assembly (clang, -O2):
<outword>:
push   %rbx
mov    %edi,%ebx
call   1030 <outbyte@plt>
mov    %ebx,%edi
shr    $0x8,%edi
call   1030 <outbyte@plt>
mov    %ebx,%edi
shr    $0x10,%edi
call   1030 <outbyte@plt>
shr    $0x18,%ebx
mov    %ebx,%edi
pop    %rbx
jmp    1030 <outbyte@plt>

LLVM IR (-O0):
define void @outword(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @outbyte(i32 %3)
%5 = load i32, i32* %2
%6 = lshr i32 %5, 8
%7 = call i32 @outbyte(i32 %6)
%8 = load i32, i32* %2
%9 = lshr i32 %8, 16
%10 = call i32 @outbyte(i32 %9)
%11 = load i32, i32* %2
%12 = lshr i32 %11, 24
%13 = call i32 @outbyte(i32 %12)
ret void
}

LLVM IR (-O2):
define void @outword(i32 %0) {
%2 = tail call i32 @outbyte(i32 %0)
%3 = lshr i32 %0, 8
%4 = tail call i32 @outbyte(i32 %3)
%5 = lshr i32 %0, 16
%6 = tail call i32 @outbyte(i32 %5)
%7 = lshr i32 %0, 24
%8 = tail call i32 @outbyte(i32 %7)
ret void
}
/* Variables and functions */
int atoi_nonlocalized(char *);
int /*<<< orphan*/ strncpy(char *, char const *, int);
int antoi(const char *input_str, int len) {
  char str[4096];
  if (len > 4095)
    len = 4095;
  strncpy(str, input_str, len);
  str[len] = 0;
  return atoi_nonlocalized(str);
}


x86 assembly (clang, -O0):
<antoi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1010,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0xfff,-0xc(%rbp)
jle    1146 <antoi+0x26>
movl   $0xfff,-0xc(%rbp)
lea    -0x1010(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1030 <strncpy@plt>
movslq -0xc(%rbp),%rax
movb   $0x0,-0x1010(%rbp,%rax,1)
lea    -0x1010(%rbp),%rdi
call   1040 <atoi_nonlocalized@plt>
add    $0x1010,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<antoi>:
push   %r14
push   %rbx
sub    $0x1008,%rsp
mov    %rdi,%rax
cmp    $0xfff,%esi
mov    $0xfff,%ebx
cmovl  %esi,%ebx
mov    %rsp,%r14
mov    %r14,%rdi
mov    %rax,%rsi
mov    %ebx,%edx
call   1030 <strncpy@plt>
movslq %ebx,%rax
movb   $0x0,(%rsp,%rax,1)
mov    %r14,%rdi
call   1040 <atoi_nonlocalized@plt>
add    $0x1008,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @antoi(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca [4096 x i8]
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = icmp sgt i32 %6, 4095
br i1 %7, label %8, label %9
8: ; preds = %2
store i32 4095, i32* %4
br label %9
9: ; preds = %8, %2
%10 = getelementptr inbounds [4096 x i8], [4096 x i8]* %5, i64 0, i64 0
%11 = load i8*, i8** %3
%12 = load i32, i32* %4
%13 = call i32 @strncpy(i8* %10, i8* %11, i32 %12)
%14 = load i32, i32* %4
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds [4096 x i8], [4096 x i8]* %5, i64 0, i64 %15
store i8 0, i8* %16
%17 = getelementptr inbounds [4096 x i8], [4096 x i8]* %5, i64 0, i64 0
%18 = call i32 @atoi_nonlocalized(i8* %17)
ret i32 %18
}

LLVM IR (-O2):
define i32 @antoi(i8* %0, i32 %1) {
%3 = alloca [4096 x i8]
%4 = getelementptr inbounds [4096 x i8], [4096 x i8]* %3, i64 0, i64 0
%5 = icmp slt i32 %1, 4095
%6 = select i1 %5, i32 %1, i32 4095
%7 = call i32 @strncpy(i8* %4, i8* %0, i32 %6)
%8 = sext i32 %6 to i64
%9 = getelementptr inbounds [4096 x i8], [4096 x i8]* %3, i64 0, i64 %8
store i8 0, i8* %9
%10 = call i32 @atoi_nonlocalized(i8* %4)
ret i32 %10
}
/* Variables and functions */
int is_palindrome_rec_ex(char *, int);
int strlen(char *);
int is_palindrome_rec(char *str) {
  int str_len = strlen(str);
  return is_palindrome_rec_ex(str, str_len);
}


x86 assembly (clang, -O0):
<is_palindrome_rec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <is_palindrome_rec_ex@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_palindrome_rec>:
push   %rbx
mov    %rdi,%rbx
call   1040 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1030 <is_palindrome_rec_ex@plt>

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

LLVM IR (-O2):
define i32 @is_palindrome_rec(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = tail call i32 @is_palindrome_rec_ex(i8* %0, i32 %2)
ret i32 %3
}
void view_returnDefaultValues(void) {}


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

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

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

LLVM IR (-O2):
define void @view_returnDefaultValues() {
ret void
}
double foo(int N) {
  double v = 0.0;
  for (int i = 0; i < N; i++)
    v = v + 1.0;
  return v;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1142 <foo+0x42>
movsd  0xed6(%rip),%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1116 <foo+0x16>
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
test   %edi,%edi
jle    1117 <foo+0x17>
lea    -0x1(%rdi),%ecx
mov    %edi,%eax
and    $0x7,%eax
cmp    $0x7,%ecx
jae    111b <foo+0x1b>
xorpd  %xmm0,%xmm0
jmp    1155 <foo+0x55>
xorps  %xmm0,%xmm0
ret
and    $0xfffffff8,%edi
xorpd  %xmm0,%xmm0
movsd  0xed6(%rip),%xmm1
nopw   0x0(%rax,%rax,1)
addsd  %xmm1,%xmm0
addsd  %xmm1,%xmm0
addsd  %xmm1,%xmm0
addsd  %xmm1,%xmm0
addsd  %xmm1,%xmm0
addsd  %xmm1,%xmm0
addsd  %xmm1,%xmm0
addsd  %xmm1,%xmm0
add    $0xfffffff8,%edi
jne    1130 <foo+0x30>
test   %eax,%eax
je     1179 <foo+0x79>
movsd  0xe9f(%rip),%xmm1
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
addsd  %xmm1,%xmm0
add    $0xffffffff,%eax
jne    1170 <foo+0x70>
ret

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

LLVM IR (-O2):
define double @foo(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %19
3: ; preds = %1
%4 = add i32 %0, -1
%5 = and i32 %0, 7
%6 = icmp ult i32 %4, 7
br i1 %6, label %9, label %7
7: ; preds = %3
%8 = and i32 %0, -8
br label %21
9: ; preds = %21, %3
%10 = phi double [ undef, %3 ], [ %31, %21 ]
%11 = phi double [ 0.000000e+00, %3 ], [ %31, %21 ]
%12 = icmp eq i32 %5, 0
br i1 %12, label %19, label %13
13: ; preds = %9, %13
%14 = phi double [ %16, %13 ], [ %11, %9 ]
%15 = phi i32 [ %17, %13 ], [ 0, %9 ]
%16 = fadd double %14, 1.000000e+00
%17 = add i32 %15, 1
%18 = icmp eq i32 %17, %5
br i1 %18, label %19, label %13
19: ; preds = %9, %13, %1
%20 = phi double [ 0.000000e+00, %1 ], [ %10, %9 ], [ %16, %13 ]
ret double %20
21: ; preds = %21, %7
%22 = phi double [ 0.000000e+00, %7 ], [ %31, %21 ]
%23 = phi i32 [ 0, %7 ], [ %32, %21 ]
%24 = fadd double %22, 1.000000e+00
%25 = fadd double %24, 1.000000e+00
%26 = fadd double %25, 1.000000e+00
%27 = fadd double %26, 1.000000e+00
%28 = fadd double %27, 1.000000e+00
%29 = fadd double %28, 1.000000e+00
%30 = fadd double %29, 1.000000e+00
%31 = fadd double %30, 1.000000e+00
%32 = add i32 %23, 8
%33 = icmp eq i32 %32, %8
br i1 %33, label %9, label %21
}
void __stp_stack_print(struct pt_regs *regs, int verbose, int levels) {}


x86 assembly (clang, -O0):
<__stp_stack_print>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.pt_regs = type opaque
define void @__stp_stack_print(%struct.pt_regs* %0, i32 %1, i32 %2) {
%4 = alloca %struct.pt_regs*
%5 = alloca i32
%6 = alloca i32
store %struct.pt_regs* %0, %struct.pt_regs** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
ret void
}

LLVM IR (-O2):
%struct.pt_regs = type opaque
define void @__stp_stack_print(%struct.pt_regs* nocapture %0, i32 %1, i32 %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ expect(char *, char *);
int checkprefix(char *str, char *substr) { return !expect(str, substr); }


x86 assembly (clang, -O0):
<checkprefix>:
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 <expect@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkprefix>:
push   %rax
call   1030 <expect@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @checkprefix(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i32 @expect(i8* %5, i8* %6)
%8 = icmp ne i32 %7, 0
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @checkprefix(i8* %0, i8* %1) {
%3 = tail call i32 @expect(i8* %0, i8* %1)
%4 = icmp eq i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ host_initialize_profiling_timer();
__attribute__((always_)) void initialize_profiling_timer(void) {
  host_initialize_profiling_timer();
}


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

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

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

LLVM IR (-O2):
define void @initialize_profiling_timer() {
%1 = tail call i32 (...) @host_initialize_profiling_timer()
ret void
}
/* Variables and functions */
scalar_t__ malloc(size_t);
char *strcat(char *, char const *);
size_t strlen(char const *);
char *stradd(const char *a, const char *b) {
  size_t len = strlen(a) + strlen(b);
  char *ret = (char *)malloc(len * sizeof(char) + 1);
  *ret = '\0';
  return strcat(strcat(ret, a), b);
}


x86 assembly (clang, -O0):
<stradd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,%rcx
mov    -0x28(%rbp),%rax
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
shl    $0x0,%rdi
add    $0x1,%rdi
call   1040 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1050 <strcat@plt>
mov    %rax,%rdi
mov    -0x10(%rbp),%rsi
call   1050 <strcat@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stradd>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%r12
call   1030 <strlen@plt>
mov    %rax,%r15
mov    %r14,%rdi
call   1030 <strlen@plt>
lea    (%r15,%rax,1),%rdi
add    $0x1,%rdi
call   1040 <malloc@plt>
mov    %rax,%rbx
movb   $0x0,(%rax)
mov    %rax,%rdi
mov    %r12,%rsi
call   1050 <strcat@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1050 <strcat@plt>

LLVM IR (-O0):
define i8* @stradd(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = call i64 @strlen(i8* %7)
%9 = load i8*, i8** %4
%10 = call i64 @strlen(i8* %9)
%11 = add i64 %8, %10
store i64 %11, i64* %5
%12 = load i64, i64* %5
%13 = mul i64 %12, 1
%14 = add i64 %13, 1
%15 = call i64 @malloc(i64 %14)
%16 = inttoptr i64 %15 to i8*
store i8* %16, i8** %6
%17 = load i8*, i8** %6
store i8 0, i8* %17
%18 = load i8*, i8** %6
%19 = load i8*, i8** %3
%20 = call i8* @strcat(i8* %18, i8* %19)
%21 = load i8*, i8** %4
%22 = call i8* @strcat(i8* %20, i8* %21)
ret i8* %22
}

LLVM IR (-O2):
define i8* @stradd(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%4 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%5 = add i64 %3, 1
%6 = add i64 %5, %4
%7 = tail call i64 @malloc(i64 %6)
%8 = inttoptr i64 %7 to i8*
store i8 0, i8* %8
%9 = tail call i8* @strcat(i8* %8, i8* dereferenceable(1) %0)
%10 = tail call i8* @strcat(i8* %8, i8* dereferenceable(1) %1)
ret i8* %8
}
/* Variables and functions */
double sqrt(int);
double circularEaseOutd(double p) { return sqrt((2 - p) * p); }


x86 assembly (clang, -O0):
<circularEaseOutd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xedb(%rip),%xmm0
subsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
cvttsd2si %xmm0,%edi
call   1030 <sqrt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<circularEaseOutd>:
movsd  0xee8(%rip),%xmm1
subsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
cvttsd2si %xmm1,%edi
jmp    1030 <sqrt@plt>

LLVM IR (-O0):
define double @circularEaseOutd(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fsub double 2.000000e+00, %3
%5 = load double, double* %2
%6 = fmul double %4, %5
%7 = fptosi double %6 to i32
%8 = call double @sqrt(i32 %7)
ret double %8
}

LLVM IR (-O2):
define double @circularEaseOutd(double %0) {
%2 = fsub double 2.000000e+00, %0
%3 = fmul double %2, %0
%4 = fptosi double %3 to i32
%5 = tail call double @sqrt(i32 %4)
ret double %5
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
int /*<<< orphan*/ _mm_undefined_si128();
__m128i test_mm_undefined_si128() { return _mm_undefined_si128(); }


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

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

LLVM IR (-O0):
define i32 @test_mm_undefined_si128() {
%1 = call i32 (...) @_mm_undefined_si128()
ret i32 %1
}

LLVM IR (-O2):
define i32 @test_mm_undefined_si128() {
%1 = tail call i32 (...) @_mm_undefined_si128()
ret i32 %1
}
/* Type definitions */
typedef scalar_t__ uint64_t;
struct timeval {
  long tv_sec;
  scalar_t__ tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
uint64_t getCurrentTimeUs() {
  struct timeval now;
  gettimeofday(&now, NULL);
  return ((now.tv_sec * 1000000L) + now.tv_usec);
}


x86 assembly (clang, -O0):
<getCurrentTimeUs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
imul   $0xf4240,-0x10(%rbp),%rax
add    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getCurrentTimeUs>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
imul   $0xf4240,0x8(%rsp),%rax
add    0x10(%rsp),%rax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define i64 @getCurrentTimeUs() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%4 = load i64, i64* %3
%5 = mul nsw i64 %4, 1000000
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%7 = load i64, i64* %6
%8 = add nsw i64 %5, %7
ret i64 %8
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
define i64 @getCurrentTimeUs() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load i64, i64* %4
%6 = mul nsw i64 %5, 1000000
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%8 = load i64, i64* %7
%9 = add nsw i64 %6, %8
ret i64 %9
}
/* Variables and functions */
int /*<<< orphan*/ __set_errno(int);
int __syscall_error(void) {
  register int eax __asm__("%eax");
  int _errno = -eax;
  __set_errno(_errno);
  return -1;
}


x86 assembly (clang, -O0):
<__syscall_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %eax,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__syscall_error>:
push   %rax
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @__syscall_error() {
%1 = alloca i32
%2 = alloca i32
%3 = load i32, i32* %1
%4 = sub nsw i32 0, %3
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = call i32 @__set_errno(i32 %5)
ret i32 -1
}

LLVM IR (-O2):
define i32 @__syscall_error() {
%1 = tail call i32 @__set_errno(i32 undef)
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ link_failure_log();
scalar_t__ log(double);
void test_log(double d) {
  if (log(d) != log(d))
    link_failure_log();
}


x86 assembly (clang, -O0):
<test_log>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <log@plt>
mov    %rax,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <log@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
cmp    %rcx,%rax
je     115c <test_log+0x3c>
mov    $0x0,%al
call   1040 <link_failure_log@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_log>:
push   %rbx
sub    $0x10,%rsp
movsd  %xmm0,0x8(%rsp)
call   1030 <log@plt>
mov    %rax,%rbx
movsd  0x8(%rsp),%xmm0
call   1030 <log@plt>
cmp    %rax,%rbx
jne    1149 <test_log+0x29>
add    $0x10,%rsp
pop    %rbx
ret
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
jmp    1040 <link_failure_log@plt>

LLVM IR (-O0):
define void @test_log(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i64 @log(double %3)
%5 = load double, double* %2
%6 = call i64 @log(double %5)
%7 = icmp ne i64 %4, %6
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 (...) @link_failure_log()
br label %10
10: ; preds = %8, %1
ret void
}

LLVM IR (-O2):
define void @test_log(double %0) {
%2 = tail call i64 @log(double %0)
%3 = tail call i64 @log(double %0)
%4 = icmp eq i64 %2, %3
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 (...) @link_failure_log()
br label %7
7: ; preds = %5, %1
ret void
}
/* Variables and functions */
double eval_sin2pi(int, int, double);
double eval_cos2pi(int hilo, int j, double x) {
  return (eval_sin2pi(hilo, (j + 1) % 4, x));
}


x86 assembly (clang, -O0):
<eval_cos2pi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
mov    %edx,%esi
movsd  -0x10(%rbp),%xmm0
call   1030 <eval_sin2pi@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eval_cos2pi>:
lea    0x1(%rsi),%eax
lea    0x4(%rsi),%ecx
test   %eax,%eax
cmovns %eax,%ecx
and    $0xfffffffc,%ecx
neg    %ecx
add    %ecx,%esi
add    $0x1,%esi
jmp    1030 <eval_sin2pi@plt>

LLVM IR (-O0):
define double @eval_cos2pi(i32 %0, i32 %1, double %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca double
store i32 %0, i32* %4
store i32 %1, i32* %5
store double %2, double* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = add nsw i32 %8, 1
%10 = srem i32 %9, 4
%11 = load double, double* %6
%12 = call double @eval_sin2pi(i32 %7, i32 %10, double %11)
ret double %12
}

LLVM IR (-O2):
define double @eval_cos2pi(i32 %0, i32 %1, double %2) {
%4 = add nsw i32 %1, 1
%5 = srem i32 %4, 4
%6 = tail call double @eval_sin2pi(i32 %0, i32 %5, double %2)
ret double %6
}
/* Variables and functions */
int j2g(int year) {
  return (year < 1500) ? 0 : 10 + (year / 100 - 16) - ((year / 100 - 16) / 4);
}


x86 assembly (clang, -O0):
<j2g>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x5dc,-0x4(%rbp)
jge    111e <j2g+0x1e>
xor    %eax,%eax
mov    %eax,-0x8(%rbp)
jmp    1152 <j2g+0x52>
mov    -0x4(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
sub    $0x10,%eax
add    $0xa,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
sub    $0x10,%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<j2g>:
xor    %eax,%eax
cmp    $0x5dc,%edi
jl     112c <j2g+0x2c>
mov    %edi,%eax
imul   $0x51eb851f,%rax,%rax
shr    $0x25,%rax
lea    -0x10(%rax),%ecx
lea    -0xd(%rax),%edx
test   %ecx,%ecx
cmovns %ecx,%edx
sar    $0x2,%edx
neg    %edx
add    %edx,%eax
add    $0xfffffffa,%eax
ret

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

LLVM IR (-O2):
define i32 @j2g(i32 %0) {
%2 = icmp slt i32 %0, 1500
br i1 %2, label %9, label %3
3: ; preds = %1
%4 = udiv i32 %0, 100
%5 = add nsw i32 %4, -16
%6 = add nsw i32 %4, -6
%7 = sdiv i32 %5, -4
%8 = add nsw i32 %6, %7
br label %9
9: ; preds = %1, %3
%10 = phi i32 [ %8, %3 ], [ 0, %1 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int func_two() {
  printf("this is function two\n");
  return 2;
}


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

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

LLVM IR (-O0):
@.str = [22 x i8] c"this is function two\0A\00"
define i32 @func_two() {
%1 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
ret i32 2
}

LLVM IR (-O2):
@str = [21 x i8] c"this is function two\00"
define i32 @func_two() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
ret i32 2
}
void UARTParityModeSet(unsigned int baseAdd, unsigned int parityFlag) {
  (*((volatile unsigned int *)(baseAdd + (0xC)))) &=
      ~(((0x00000020u) | (0x00000010u) | (0x00000008u)));
  (*((volatile unsigned int *)(baseAdd + (0xC)))) |=
      (parityFlag & ((0x00000020u) | (0x00000010u) | (0x00000008u)));
}


x86 assembly (clang, -O0):
<UARTParityModeSet>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0xc,%eax
mov    %eax,%eax
mov    (%rax),%ecx
and    $0xffffffc7,%ecx
mov    %ecx,(%rax)
mov    -0x8(%rbp),%edx
and    $0x38,%edx
mov    -0x4(%rbp),%eax
add    $0xc,%eax
mov    %eax,%eax
mov    (%rax),%ecx
or     %edx,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<UARTParityModeSet>:
add    $0xc,%edi
andl   $0xffffffc7,(%rdi)
and    $0x38,%esi
or     %esi,(%rdi)
ret

LLVM IR (-O0):
define void @UARTParityModeSet(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 = add i32 %5, 12
%7 = zext i32 %6 to i64
%8 = inttoptr i64 %7 to i32*
%9 = load volatile i32, i32* %8
%10 = and i32 %9, -57
store volatile i32 %10, i32* %8
%11 = load i32, i32* %4
%12 = and i32 %11, 56
%13 = load i32, i32* %3
%14 = add i32 %13, 12
%15 = zext i32 %14 to i64
%16 = inttoptr i64 %15 to i32*
%17 = load volatile i32, i32* %16
%18 = or i32 %17, %12
store volatile i32 %18, i32* %16
ret void
}

LLVM IR (-O2):
define void @UARTParityModeSet(i32 %0, i32 %1) {
%3 = add i32 %0, 12
%4 = zext i32 %3 to i64
%5 = inttoptr i64 %4 to i32*
%6 = load volatile i32, i32* %5
%7 = and i32 %6, -57
store volatile i32 %7, i32* %5
%8 = and i32 %1, 56
%9 = load volatile i32, i32* %5
%10 = or i32 %9, %8
store volatile i32 %10, i32* %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char const *);
int main(void) {
  {
    printf((char const *__restrict)"Hello world\n");
    return (0);
  }
}


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

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

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

LLVM IR (-O2):
@str = [12 x i8] c"Hello world\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret i32 0
}
int security_nfsservctl(int cmd, struct nfsctl_arg *arg) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.nfsctl_arg = type opaque
define i32 @security_nfsservctl(i32 %0, %struct.nfsctl_arg* nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int COM_Rand();
int COM_RandInRange(int min, int max) {
  if (min == max) {
    return min;
  }
  return min + COM_Rand() % (max - min + 1);
}


x86 assembly (clang, -O0):
<COM_RandInRange>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jne    1135 <COM_RandInRange+0x25>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1156 <COM_RandInRange+0x46>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    $0x0,%al
call   1030 <COM_Rand@plt>
mov    -0xc(%rbp),%ecx
sub    -0x8(%rbp),%ecx
add    $0x1,%ecx
cltd
idiv   %ecx
mov    -0x10(%rbp),%eax
add    %edx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<COM_RandInRange>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%eax
mov    %esi,%ebp
sub    %edi,%ebp
je     112e <COM_RandInRange+0x1e>
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <COM_Rand@plt>
add    $0x1,%ebp
cltd
idiv   %ebp
mov    %edx,%eax
add    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @COM_RandInRange(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 = load i32, i32* %5
%8 = icmp eq i32 %6, %7
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load i32, i32* %4
store i32 %10, i32* %3
br label %20
11: ; preds = %2
%12 = load i32, i32* %4
%13 = call i32 (...) @COM_Rand()
%14 = load i32, i32* %5
%15 = load i32, i32* %4
%16 = sub nsw i32 %14, %15
%17 = add nsw i32 %16, 1
%18 = srem i32 %13, %17
%19 = add nsw i32 %12, %18
store i32 %19, i32* %3
br label %20
20: ; preds = %11, %9
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
define i32 @COM_RandInRange(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, %0
br i1 %3, label %10, label %4
4: ; preds = %2
%5 = tail call i32 (...) @COM_Rand()
%6 = sub i32 1, %0
%7 = add i32 %6, %1
%8 = srem i32 %5, %7
%9 = add nsw i32 %8, %0
br label %10
10: ; preds = %2, %4
%11 = phi i32 [ %9, %4 ], [ %1, %2 ]
ret i32 %11
}
int net_initialize() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @net_initialize() {
ret i32 0
}
void *ft_minus_pt(void *p1, void *p2) {
  int *i;
  i = (int *)(malloc(sizeof(int)));
  *i = (*(int *)p1) - (*(int *)p2);
  return (i);
}


x86 assembly (clang, -O0):
<ft_minus_pt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x4,%edi
call   1030 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
mov    -0x10(%rbp),%rax
sub    (%rax),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_minus_pt>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    $0x4,%edi
call   1030 <malloc@plt>
mov    (%rbx),%ecx
sub    (%r14),%ecx
mov    %ecx,(%rax)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @ft_minus_pt(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = call i8* @malloc(i64 4)
%7 = bitcast i8* %6 to i32*
store i32* %7, i32** %5
%8 = load i8*, i8** %3
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %9
%11 = load i8*, i8** %4
%12 = bitcast i8* %11 to i32*
%13 = load i32, i32* %12
%14 = sub nsw i32 %10, %13
%15 = load i32*, i32** %5
store i32 %14, i32* %15
%16 = load i32*, i32** %5
%17 = bitcast i32* %16 to i8*
ret i8* %17
}

LLVM IR (-O2):
define noalias i8* @ft_minus_pt(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call dereferenceable_or_null(4) i8* @malloc(i64 4)
%4 = bitcast i8* %3 to i32*
%5 = bitcast i8* %0 to i32*
%6 = load i32, i32* %5
%7 = bitcast i8* %1 to i32*
%8 = load i32, i32* %7
%9 = sub nsw i32 %6, %8
store i32 %9, i32* %4
ret i8* %3
}
int getgid(void) { return 1000; }


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

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

LLVM IR (-O0):
define i32 @getgid() {
ret i32 1000
}

LLVM IR (-O2):
define i32 @getgid() {
ret i32 1000
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int main(void) {
  int i;
  int vc[5] = {1, 2, 3, 4, 5};
  for (i = 0; i < 5; i++) {
    printf("vc[%d] = %d\n", i, vc[i]);
  }
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xed7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xed5(%rip),%eax
mov    %eax,-0x10(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x5,-0x8(%rbp)
jge    1174 <main+0x64>
mov    -0x8(%rbp),%esi
movslq -0x8(%rbp),%rax
mov    -0x20(%rbp,%rax,4),%edx
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1145 <main+0x35>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x1,%edx
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x2,%edx
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
mov    $0x3,%edx
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
mov    $0x4,%edx
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
mov    $0x5,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [13 x i8] c"vc[%d] = %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 0, i32 1)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 1, i32 2)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 2, i32 3)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 3, i32 4)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 4, i32 5)
ret i32 0
}
int digit_to_int(char digit) { return digit - '0'; }


x86 assembly (clang, -O0):
<digit_to_int>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
sub    $0x30,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<digit_to_int>:
lea    -0x30(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @digit_to_int(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = sub nsw i32 %4, 48
ret i32 %5
}

LLVM IR (-O2):
define i32 @digit_to_int(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = add nsw i32 %2, -48
ret i32 %3
}
/* Variables and functions */
char *vrna_random_string(int, char const *);
char *random_string(int l, const char symbols[]) {
  return vrna_random_string(l, symbols);
}


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

x86 assembly (clang, -O2):
<random_string>:
jmp    1030 <vrna_random_string@plt>

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

LLVM IR (-O2):
define i8* @random_string(i32 %0, i8* %1) {
%3 = tail call i8* @vrna_random_string(i32 %0, i8* %1)
ret i8* %3
}
int main() {
  printf(__func__);
  printf("\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@__func__.main = [5 x i8] c"main\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @__func__.main, i64 0, i64 0))
%2 = tail call i32 @putchar(i32 10)
ret i32 0
}
void omap4_sar_save(void) {}


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

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

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

LLVM IR (-O2):
define void @omap4_sar_save() {
ret void
}