xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ stdout;
void dump_eta(double eta) {
  printf("eta = ");
  printf("%g", eta);
  printf("\n");
  fflush(stdout);
}


x86 assembly (clang, -O0):
<dump_eta>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
lea    0xecc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movsd  -0x8(%rbp),%xmm0
lea    0xec0(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xeb5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x2e7d(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dump_eta>:
push   %rax
movsd  %xmm0,(%rsp)
lea    0xec3(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xebc(%rip),%rdi
movsd  (%rsp),%xmm0
mov    $0x1,%al
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0x2e78(%rip),%rax
mov    (%rax),%edi
pop    %rax
jmp    1050 <fflush@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"eta = \00"
@.str.1 = [3 x i8] c"%g\00"
@.str.2 = [2 x i8] c"\0A\00"
@stdout = global i32 0
define void @dump_eta(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%4 = load double, double* %2
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), double %4)
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%7 = load i32, i32* @stdout
%8 = call i32 @fflush(i32 %7)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"eta = \00"
@.str.1 = [3 x i8] c"%g\00"
@stdout = global i32 0
define void @dump_eta(double %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), double %0)
%4 = tail call i32 @putchar(i32 10)
%5 = load i32, i32* @stdout
%6 = tail call i32 @fflush(i32 %5)
ret void
}
int drivers_test_lib_func() { return 2 * 2; }


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

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

LLVM IR (-O0):
define i32 @drivers_test_lib_func() {
ret i32 4
}

LLVM IR (-O2):
define i32 @drivers_test_lib_func() {
ret i32 4
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int getpid();
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ stdout;
void sigHup(int signo) {
  printf("SIGHUP received, pid = %d\n", getpid());
  fflush(stdout);
}


x86 assembly (clang, -O0):
<sigHup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,%esi
lea    0xeb5(%rip),%rdi
call   1040 <printf@plt>
mov    0x2e89(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sigHup>:
push   %rax
xor    %eax,%eax
call   1030 <getpid@plt>
lea    0xec1(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    0x2e93(%rip),%rax
mov    (%rax),%edi
pop    %rax
jmp    1050 <fflush@plt>

LLVM IR (-O0):
@.str = [27 x i8] c"SIGHUP received, pid = %d\0A\00"
@stdout = global i32 0
define void @sigHup(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @getpid()
%4 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = load i32, i32* @stdout
%6 = call i32 @fflush(i32 %5)
ret void
}

LLVM IR (-O2):
@.str = [27 x i8] c"SIGHUP received, pid = %d\0A\00"
@stdout = global i32 0
define void @sigHup(i32 %0) {
%2 = tail call i32 (...) @getpid()
%3 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = load i32, i32* @stdout
%5 = tail call i32 @fflush(i32 %4)
ret void
}
void outb(unsigned short port, unsigned char val) {
  asm volatile("outb %0, %1" ::"a"(val), "dN"(port));
}


x86 assembly (clang, -O0):
<outb>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %al,-0x3(%rbp)
mov    -0x3(%rbp),%al
mov    -0x2(%rbp),%dx
out    %al,(%dx)
pop    %rbp
ret

x86 assembly (clang, -O2):
<outb>:
mov    %esi,%eax
mov    %edi,%edx
out    %al,(%dx)
ret

LLVM IR (-O0):
define void @outb(i16 zeroext %0, i8 zeroext %1) {
%3 = alloca i16
%4 = alloca i8
store i16 %0, i16* %3
store i8 %1, i8* %4
%5 = load i8, i8* %4
%6 = load i16, i16* %3
ret void
}

LLVM IR (-O2):
define void @outb(i16 zeroext %0, i8 zeroext %1) {
tail call void asm sideeffect "outb $0, $1", "{ax},{dx}N,~{dirflag},~{fpsr},~{flags}"(i8 %1, i16 %0)
ret void
}
int main(void) {
  int a[3];
  int b[2];
  &a[2] - &b[1];
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca [3 x i32]
%2 = alloca [2 x i32]
%3 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 2
%4 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 0, i64 1
%5 = ptrtoint i32* %3 to i64
%6 = ptrtoint i32* %4 to i64
%7 = sub i64 %5, %6
%8 = sdiv exact i64 %7, 4
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int system(char *);
void GetOpenCLCode(void) {
  int status;
  status = system("sh ../get_opencl_code.sh");
  assert(status == 0);
}


x86 assembly (clang, -O0):
<GetOpenCLCode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1030 <system@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetOpenCLCode>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <system@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
pop    %rax
jmp    1040 <assert@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"sh ../get_opencl_code.sh\00"
define void @GetOpenCLCode() {
%1 = alloca i32
%2 = call i32 @system(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = icmp eq i32 %3, 0
%5 = zext i1 %4 to i32
%6 = call i32 @assert(i32 %5)
ret void
}

LLVM IR (-O2):
@.str = [25 x i8] c"sh ../get_opencl_code.sh\00"
define void @GetOpenCLCode() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i32 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
ret void
}
/* Variables and functions */
int errno;
int getuid();
int __sulong_posix_getuid(void) {
  {
    int native_errno = errno;
    int result = getuid();
    if (result == (int)-1) {
      result = (int)(long)-errno;
    }
    errno = native_errno;
    return result;
  };
}


x86 assembly (clang, -O0):
<__sulong_posix_getuid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec1(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getuid@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0xffffffff,-0x8(%rbp)
jne    1148 <__sulong_posix_getuid+0x38>
xor    %eax,%eax
mov    0x2e9f(%rip),%rcx
sub    (%rcx),%eax
cltq
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%ecx
mov    0x2e8e(%rip),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__sulong_posix_getuid>:
push   %rbp
push   %r14
push   %rbx
mov    0x2ec5(%rip),%r14
mov    (%r14),%ebp
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <getuid@plt>
sub    (%r14),%ebx
cmp    $0xffffffff,%eax
cmove  %ebx,%eax
mov    %ebp,(%r14)
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@errno = global i32 0
define i32 @__sulong_posix_getuid() {
%1 = alloca i32
%2 = alloca i32
%3 = load i32, i32* @errno
store i32 %3, i32* %1
%4 = call i32 (...) @getuid()
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = icmp eq i32 %5, -1
br i1 %6, label %7, label %12
7: ; preds = %0
%8 = load i32, i32* @errno
%9 = sub nsw i32 0, %8
%10 = sext i32 %9 to i64
%11 = trunc i64 %10 to i32
store i32 %11, i32* %2
br label %12
12: ; preds = %7, %0
%13 = load i32, i32* %1
store i32 %13, i32* @errno
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
@errno = global i32 0
define i32 @__sulong_posix_getuid() {
%1 = load i32, i32* @errno
%2 = tail call i32 (...) @getuid()
%3 = icmp eq i32 %2, -1
%4 = load i32, i32* @errno
%5 = sub nsw i32 0, %4
%6 = select i1 %3, i32 %5, i32 %2
store i32 %1, i32* @errno
ret i32 %6
}
/* Variables and functions */
int strlen(char *);
void linha(char *nome) {
  if (nome[strlen(nome) - 1] == '\n') {
    nome[strlen(nome) - 1] = '\0';
  }
}


x86 assembly (clang, -O0):
<linha>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
sub    $0x1,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0xa,%eax
jne    1167 <linha+0x57>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
sub    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<linha>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
cltq
cmpb   $0xa,-0x1(%rax,%rbx,1)
jne    1131 <linha+0x21>
mov    %rbx,%rdi
call   1030 <strlen@plt>
cltq
movb   $0x0,-0x1(%rax,%rbx,1)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @linha(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, -1
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 10
br i1 %7, label %8, label %13
8: ; preds = %1
%9 = tail call i32 @strlen(i8* %0)
%10 = add nsw i32 %9, -1
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i8, i8* %0, i64 %11
store i8 0, i8* %12
br label %13
13: ; preds = %8, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int i, l, v;
  scanf("%d", &i);
  l = i * i;
  v = i * i * i;
  printf("%d\n", l);
  printf("%d\n", v);
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%6 = load i32, i32* %2
%7 = load i32, i32* %2
%8 = mul nsw i32 %6, %7
store i32 %8, i32* %3
%9 = load i32, i32* %2
%10 = load i32, i32* %2
%11 = mul nsw i32 %9, %10
%12 = load i32, i32* %2
%13 = mul nsw i32 %11, %12
store i32 %13, i32* %4
%14 = load i32, i32* %3
%15 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %14)
%16 = load i32, i32* %4
%17 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %16)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = mul nsw i32 %4, %4
%6 = mul nsw i32 %5, %4
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %5)
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %6)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ _flushall();
int scanf(char *, double *);
double enter_answer(void) {
  int error_check = 0;
  double answer = 0.0;
  while (!error_check) {
    _flushall();
    error_check = scanf("%lf", &answer);
  }
  return answer;
}


x86 assembly (clang, -O0):
<enter_answer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    114d <enter_answer+0x2d>
jmp    116c <enter_answer+0x4c>
mov    $0x0,%al
call   1030 <_flushall@plt>
lea    0xea5(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
mov    %eax,-0x4(%rbp)
jmp    1137 <enter_answer+0x17>
movsd  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<enter_answer>:
push   %r14
push   %rbx
push   %rax
movq   $0x0,(%rsp)
lea    0xecd(%rip),%r14
mov    %rsp,%rbx
cs nopw 0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <_flushall@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
test   %eax,%eax
je     1140 <enter_answer+0x20>
movsd  (%rsp),%xmm0
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%lf\00"
define double @enter_answer() {
%1 = alloca i32
%2 = alloca double
store i32 0, i32* %1
store double 0.000000e+00, double* %2
br label %3
3: ; preds = %7, %0
%4 = load i32, i32* %1
%5 = icmp ne i32 %4, 0
%6 = xor i1 %5, true
br i1 %6, label %7, label %10
7: ; preds = %3
%8 = call i32 (...) @_flushall()
%9 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %2)
store i32 %9, i32* %1
br label %3
10: ; preds = %3
%11 = load double, double* %2
ret double %11
}

LLVM IR (-O2):
@.str = [4 x i8] c"%lf\00"
define double @enter_answer() {
%1 = alloca double
%2 = bitcast double* %1 to i8*
store double 0.000000e+00, double* %1
br label %3
3: ; preds = %0, %3
%4 = call i32 (...) @_flushall()
%5 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %1)
%6 = icmp eq i32 %5, 0
br i1 %6, label %3, label %7
7: ; preds = %3
%8 = load double, double* %1
ret double %8
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int tv_nsec;
};
struct stat {
  int st_mtime;
  TYPE_1__ st_mtim;
};

/* Variables and functions */
unsigned long long millisecond(struct stat *info) {
  return info->st_mtime * 1000 + info->st_mtim.tv_nsec / 1000000;
}


x86 assembly (clang, -O0):
<millisecond>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
imul   $0x3e8,(%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%eax
mov    $0xf4240,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
cltq
pop    %rbp
ret

x86 assembly (clang, -O2):
<millisecond>:
movslq (%rdi),%rax
imul   $0x3e8,%rax,%rcx
movslq 0x4(%rdi),%rax
imul   $0x431bde83,%rax,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
sar    $0x32,%rax
add    %edx,%eax
cltq
add    %rcx,%rax
ret

LLVM IR (-O0):
%struct.stat = type { i32, %struct.TYPE_2__ }
%struct.TYPE_2__ = type { i32 }
define i64 @millisecond(%struct.stat* %0) {
%2 = alloca %struct.stat*
store %struct.stat* %0, %struct.stat** %2
%3 = load %struct.stat*, %struct.stat** %2
%4 = getelementptr inbounds %struct.stat, %struct.stat* %3, i32 0, i32 0
%5 = load i32, i32* %4
%6 = mul nsw i32 %5, 1000
%7 = load %struct.stat*, %struct.stat** %2
%8 = getelementptr inbounds %struct.stat, %struct.stat* %7, i32 0, i32 1
%9 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %8, i32 0, i32 0
%10 = load i32, i32* %9
%11 = sdiv i32 %10, 1000000
%12 = add nsw i32 %6, %11
%13 = sext i32 %12 to i64
ret i64 %13
}

LLVM IR (-O2):
%struct.stat = type { i32, %struct.TYPE_2__ }
%struct.TYPE_2__ = type { i32 }
define i64 @millisecond(%struct.stat* nocapture %0) {
%2 = getelementptr inbounds %struct.stat, %struct.stat* %0, i64 0, i32 0
%3 = load i32, i32* %2
%4 = mul nsw i32 %3, 1000
%5 = getelementptr inbounds %struct.stat, %struct.stat* %0, i64 0, i32 1, i32 0
%6 = load i32, i32* %5
%7 = sdiv i32 %6, 1000000
%8 = add nsw i32 %7, %4
%9 = sext i32 %8 to i64
ret i64 %9
}
/* Variables and functions */
scalar_t__ exp(double);
double hoppingRate(double gapEnergy, double KT, double reOrgEnergy) {
  return (double)exp(-(gapEnergy + reOrgEnergy) * (gapEnergy + reOrgEnergy) /
                     (4 * KT * reOrgEnergy));
}


x86 assembly (clang, -O0):
<hoppingRate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
addsd  -0x18(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  -0x8(%rbp),%xmm1
addsd  -0x18(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xea2(%rip),%xmm1
mulsd  -0x10(%rbp),%xmm1
mulsd  -0x18(%rbp),%xmm1
divsd  %xmm1,%xmm0
call   1030 <exp@plt>
cvtsi2sd %rax,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hoppingRate>:
push   %rax
addsd  %xmm2,%xmm0
mulsd  %xmm0,%xmm0
mulsd  0xedf(%rip),%xmm1
mulsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
call   1030 <exp@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @hoppingRate(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %4
%8 = load double, double* %6
%9 = fadd double %7, %8
%10 = fneg double %9
%11 = load double, double* %4
%12 = load double, double* %6
%13 = fadd double %11, %12
%14 = fmul double %10, %13
%15 = load double, double* %5
%16 = fmul double 4.000000e+00, %15
%17 = load double, double* %6
%18 = fmul double %16, %17
%19 = fdiv double %14, %18
%20 = call i64 @exp(double %19)
%21 = sitofp i64 %20 to double
ret double %21
}

LLVM IR (-O2):
define double @hoppingRate(double %0, double %1, double %2) {
%4 = fadd double %0, %2
%5 = fneg double %4
%6 = fmul double %4, %5
%7 = fmul double %1, 4.000000e+00
%8 = fmul double %7, %2
%9 = fdiv double %6, %8
%10 = tail call i64 @exp(double %9)
%11 = sitofp i64 %10 to double
ret double %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void gdbserver_usage(void) {
  printf("Usage:\tgdbserver COMM PROG [ARGS ...]\n"
         "\tgdbserver COMM --attach PID\n"
         "\n"
         "COMM may either be a tty device (for serial debugging), or \n"
         "HOST:PORT to listen for a TCP connection.\n");
}


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

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

LLVM IR (-O0):
@.str = [171 x i8] c"Usage:\09gdbserver COMM PROG [ARGS ...]\0A\09gdbserver COMM --attach PID\0A\0ACOMM may either be a tty device (for serial debugging), or \0AHOST:PORT to listen for a TCP connection.\0A\00"
define void @gdbserver_usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([171 x i8], [171 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [170 x i8] c"Usage:\09gdbserver COMM PROG [ARGS ...]\0A\09gdbserver COMM --attach PID\0A\0ACOMM may either be a tty device (for serial debugging), or \0AHOST:PORT to listen for a TCP connection.\00"
define void @gdbserver_usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([170 x i8], [170 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef scalar_t__ volatile uint32_t;

/* Variables and functions */
int /*<<< orphan*/ ASSERT(int /*<<< orphan*/);
int /*<<< orphan*/ _UARTBaseValid(scalar_t__ volatile);
void UARTDMAEnable(uint32_t ui32Base, uint32_t ui32DMAFlags) {
  ASSERT(_UARTBaseValid(ui32Base));
  (*((volatile uint32_t *)(ui32Base + 0x00000048))) |= ui32DMAFlags;
}


x86 assembly (clang, -O0):
<UARTDMAEnable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <_UARTBaseValid@plt>
mov    %eax,%edi
call   1040 <ASSERT@plt>
mov    -0x10(%rbp),%rdx
mov    -0x8(%rbp),%rax
mov    0x48(%rax),%rcx
or     %rdx,%rcx
mov    %rcx,0x48(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UARTDMAEnable>:
sub    $0x18,%rsp
mov    %rdi,0x8(%rsp)
mov    %rsi,0x10(%rsp)
mov    0x8(%rsp),%rdi
call   1030 <_UARTBaseValid@plt>
mov    %eax,%edi
call   1040 <ASSERT@plt>
mov    0x10(%rsp),%rax
mov    0x8(%rsp),%rcx
or     %rax,0x48(%rcx)
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
define void @UARTDMAEnable(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store volatile i64 %0, i64* %3
store volatile i64 %1, i64* %4
%5 = load volatile i64, i64* %3
%6 = tail call i32 @_UARTBaseValid(i64 %5)
%7 = tail call i32 @ASSERT(i32 %6)
%8 = load volatile i64, i64* %4
%9 = load volatile i64, i64* %3
%10 = add nsw i64 %9, 72
%11 = inttoptr i64 %10 to i64*
%12 = load volatile i64, i64* %11
%13 = or i64 %12, %8
store volatile i64 %13, i64* %11
ret void
}
long adjust_n(long n) {
  long i;
  n *= 5;
  for (i = 2; i < n; i++) {
    if (n % i == 0) {
      n++;
      i = 1;
    }
  }
  return (n);
}


x86 assembly (clang, -O0):
<adjust_n>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
imul   $0x5,-0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
movq   $0x2,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x8(%rbp),%rax
jge    1165 <adjust_n+0x65>
mov    -0x8(%rbp),%rax
cqto
idivq  -0x10(%rbp)
cmp    $0x0,%rdx
jne    114f <adjust_n+0x4f>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
movq   $0x1,-0x10(%rbp)
jmp    1154 <adjust_n+0x54>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1119 <adjust_n+0x19>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<adjust_n>:
lea    (%rdi,%rdi,4),%rcx
cmp    $0x3,%rcx
jl     1154 <adjust_n+0x54>
mov    $0x2,%esi
mov    $0x2,%edi
jmp    1140 <adjust_n+0x40>
cs nopw 0x0(%rax,%rax,1)
mov    %rcx,%rax
cqto
idiv   %rsi
add    $0x1,%rsi
xor    %eax,%eax
test   %rdx,%rdx
sete   %al
cmove  %rdi,%rsi
add    %rax,%rcx
cmp    %rcx,%rsi
jge    1154 <adjust_n+0x54>
mov    %rcx,%rax
or     %rsi,%rax
shr    $0x20,%rax
jne    1120 <adjust_n+0x20>
mov    %ecx,%eax
xor    %edx,%edx
div    %esi
jmp    1128 <adjust_n+0x28>
mov    %rcx,%rax
ret

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

LLVM IR (-O2):
define i64 @adjust_n(i64 %0) {
%2 = mul nsw i64 %0, 5
%3 = icmp sgt i64 %2, 2
br i1 %3, label %4, label %14
4: ; preds = %1, %4
%5 = phi i64 [ %12, %4 ], [ 2, %1 ]
%6 = phi i64 [ %10, %4 ], [ %2, %1 ]
%7 = srem i64 %6, %5
%8 = icmp eq i64 %7, 0
%9 = zext i1 %8 to i64
%10 = add nsw i64 %6, %9
%11 = add nsw i64 %5, 1
%12 = select i1 %8, i64 2, i64 %11
%13 = icmp slt i64 %12, %10
br i1 %13, label %4, label %14
14: ; preds = %4, %1
%15 = phi i64 [ %2, %1 ], [ %10, %4 ]
ret i64 %15
}
/* Type definitions */
typedef int /*<<< orphan*/ wint_t;
typedef int /*<<< orphan*/ wchar_t;
struct aFILE {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ _get_actual_fp(struct aFILE *);
int /*<<< orphan*/ putwc(int /*<<< orphan*/, int /*<<< orphan*/);
wint_t my_putwc(wchar_t c, struct aFILE *fp) {
  return putwc(c, _get_actual_fp(fp));
}


x86 assembly (clang, -O0):
<my_putwc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <_get_actual_fp@plt>
mov    -0x14(%rbp),%edi
mov    %eax,%esi
call   1030 <putwc@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_putwc>:
push   %rbx
mov    %edi,%ebx
mov    %rsi,%rdi
call   1040 <_get_actual_fp@plt>
mov    %ebx,%edi
mov    %eax,%esi
pop    %rbx
jmp    1030 <putwc@plt>

LLVM IR (-O0):
%struct.aFILE = type { i32 }
define i32 @my_putwc(i32 %0, %struct.aFILE* %1) {
%3 = alloca i32
%4 = alloca %struct.aFILE*
store i32 %0, i32* %3
store %struct.aFILE* %1, %struct.aFILE** %4
%5 = load i32, i32* %3
%6 = load %struct.aFILE*, %struct.aFILE** %4
%7 = call i32 @_get_actual_fp(%struct.aFILE* %6)
%8 = call i32 @putwc(i32 %5, i32 %7)
ret i32 %8
}

LLVM IR (-O2):
%struct.aFILE = type { i32 }
define i32 @my_putwc(i32 %0, %struct.aFILE* %1) {
%3 = tail call i32 @_get_actual_fp(%struct.aFILE* %1)
%4 = tail call i32 @putwc(i32 %0, i32 %3)
ret i32 %4
}
void gdk_window_get_frame_extents() {}


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

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

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

LLVM IR (-O2):
define void @gdk_window_get_frame_extents() {
ret void
}
/* Type definitions */
struct demod_state {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ selcall_init(struct demod_state *);
void zvei1_init(struct demod_state *s) { selcall_init(s); }


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

x86 assembly (clang, -O2):
<zvei1_init>:
jmp    1030 <selcall_init@plt>

LLVM IR (-O0):
%struct.demod_state = type { i32 }
define void @zvei1_init(%struct.demod_state* %0) {
%2 = alloca %struct.demod_state*
store %struct.demod_state* %0, %struct.demod_state** %2
%3 = load %struct.demod_state*, %struct.demod_state** %2
%4 = call i32 @selcall_init(%struct.demod_state* %3)
ret void
}

LLVM IR (-O2):
%struct.demod_state = type { i32 }
define void @zvei1_init(%struct.demod_state* %0) {
%2 = tail call i32 @selcall_init(%struct.demod_state* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ endwin();
void closescreen() { endwin(); }


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

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

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

LLVM IR (-O2):
define void @closescreen() {
%1 = tail call i32 (...) @endwin()
ret void
}
int bt_keys_store(struct bt_keys *keys) { return 0; }


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

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

LLVM IR (-O0):
%struct.bt_keys = type opaque
define i32 @bt_keys_store(%struct.bt_keys* %0) {
%2 = alloca %struct.bt_keys*
store %struct.bt_keys* %0, %struct.bt_keys** %2
ret i32 0
}

LLVM IR (-O2):
%struct.bt_keys = type opaque
define i32 @bt_keys_store(%struct.bt_keys* nocapture readnone %0) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ X509;
typedef int /*<<< orphan*/ SCT_CTX;

/* Variables and functions */
int SCT_CTX_set1_issuer_pubkey(int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ X509_get_X509_PUBKEY(int /*<<< orphan*/ const *);
int SCT_CTX_set1_issuer(SCT_CTX *sctx, const X509 *issuer) {
  return SCT_CTX_set1_issuer_pubkey(sctx, X509_get_X509_PUBKEY(issuer));
}


x86 assembly (clang, -O0):
<SCT_CTX_set1_issuer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <X509_get_X509_PUBKEY@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%esi
call   1040 <SCT_CTX_set1_issuer_pubkey@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SCT_CTX_set1_issuer>:
push   %rbx
mov    %rdi,%rbx
mov    %rsi,%rdi
call   1030 <X509_get_X509_PUBKEY@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1040 <SCT_CTX_set1_issuer_pubkey@plt>

LLVM IR (-O0):
define i32 @SCT_CTX_set1_issuer(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 @X509_get_X509_PUBKEY(i32* %6)
%8 = call i32 @SCT_CTX_set1_issuer_pubkey(i32* %5, i32 %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @SCT_CTX_set1_issuer(i32* %0, i32* %1) {
%3 = tail call i32 @X509_get_X509_PUBKEY(i32* %1)
%4 = tail call i32 @SCT_CTX_set1_issuer_pubkey(i32* %0, i32 %3)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ cleanup(int);
int /*<<< orphan*/ perror(char const *);
void check(int test, const char *message) {
  if (!test) {
    perror(message);
    cleanup(-1);
  }
}


x86 assembly (clang, -O0):
<check>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    114c <check+0x2c>
mov    -0x10(%rbp),%rdi
call   1040 <perror@plt>
mov    $0xffffffff,%edi
call   1030 <cleanup@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check>:
test   %edi,%edi
je     1125 <check+0x5>
ret
push   %rax
mov    %rsi,%rdi
call   1040 <perror@plt>
mov    $0xffffffff,%edi
pop    %rax
jmp    1030 <cleanup@plt>

LLVM IR (-O0):
define void @check(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 = icmp ne i32 %5, 0
br i1 %6, label %11, label %7
7: ; preds = %2
%8 = load i8*, i8** %4
%9 = call i32 @perror(i8* %8)
%10 = call i32 @cleanup(i32 -1)
br label %11
11: ; preds = %7, %2
ret void
}

LLVM IR (-O2):
define void @check(i32 %0, i8* nocapture %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = tail call i32 @perror(i8* %1)
%6 = tail call i32 @cleanup(i32 -1)
br label %7
7: ; preds = %4, %2
ret void
}
unsigned long long fib_recur(int n) {
  if (n == 0) {
    return 0;
  } else if (n == 1) {
    return 1;
  } else {
    return fib_recur(n - 1) + fib_recur(n - 2);
  }
}


x86 assembly (clang, -O0):
<fib_recur>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1132 <fib_recur+0x22>
movq   $0x0,-0x8(%rbp)
jmp    1171 <fib_recur+0x61>
cmpl   $0x1,-0xc(%rbp)
jne    1149 <fib_recur+0x39>
movq   $0x1,-0x8(%rbp)
jmp    1171 <fib_recur+0x61>
mov    -0xc(%rbp),%edi
sub    $0x1,%edi
call   1030 <fib_recur@plt>
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%edi
sub    $0x2,%edi
call   1030 <fib_recur@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fib_recur>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
xor    %r14d,%r14d
test   %ebx,%ebx
je     1137 <fib_recur+0x27>
nopl   (%rax)
cmp    $0x1,%ebx
je     113b <fib_recur+0x2b>
lea    -0x1(%rbx),%edi
call   1030 <fib_recur@plt>
add    %rax,%r14
add    $0xfffffffe,%ebx
test   %ebx,%ebx
jne    1120 <fib_recur+0x10>
xor    %eax,%eax
jmp    1140 <fib_recur+0x30>
mov    $0x1,%eax
add    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i64 @fib_recur(i32 %0) {
br label %2
2: ; preds = %5, %1
%3 = phi i64 [ 0, %1 ], [ %9, %5 ]
%4 = phi i32 [ %0, %1 ], [ %8, %5 ]
switch i32 %4, label %5 [
i32 0, label %10
i32 1, label %11
]
5: ; preds = %2
%6 = add nsw i32 %4, -1
%7 = tail call i64 @fib_recur(i32 %6)
%8 = add nsw i32 %4, -2
%9 = add i64 %7, %3
br label %2
10: ; preds = %2
br label %11
11: ; preds = %2, %10
%12 = phi i64 [ 0, %10 ], [ 1, %2 ]
%13 = add i64 %12, %3
ret i64 %13
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage() {
  fprintf(stderr,
          "usage: %s -i <in_filename> -o <out_filename> [-p <pad_byte>]\n",
          "bin2png");
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [62 x i8] c"usage: %s -i <in_filename> -o <out_filename> [-p <pad_byte>]\0A\00"
@.str.1 = [8 x i8] c"bin2png\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [62 x i8] c"usage: %s -i <in_filename> -o <out_filename> [-p <pad_byte>]\0A\00"
@.str.1 = [8 x i8] c"bin2png\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
ret void
}
double test_log2(double x) { return __builtin_log2(x); }


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

x86 assembly (clang, -O2):
<test_log2>:
jmp    1030 <log2@plt>

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

LLVM IR (-O2):
define double @test_log2(double %0) {
%2 = tail call double @log2(double %0)
ret double %2
}
void REMOVE_WS(char **LINE) {
  while (((**LINE) == ' ') || ((**LINE) == '	'))
    (*LINE)++;
}


x86 assembly (clang, -O0):
<REMOVE_WS>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x9(%rbp)
je     1133 <REMOVE_WS+0x33>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
cmp    $0x9,%eax
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    1143 <REMOVE_WS+0x43>
jmp    1156 <REMOVE_WS+0x56>
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
jmp    1108 <REMOVE_WS+0x8>
pop    %rbp
ret

x86 assembly (clang, -O2):
<REMOVE_WS>:
mov    (%rdi),%rax
jmp    1113 <REMOVE_WS+0x13>
cs nopw 0x0(%rax,%rax,1)
nop
mov    %rax,(%rdi)
add    $0x1,%rax
movzbl -0x1(%rax),%ecx
cmp    $0x20,%cl
je     1110 <REMOVE_WS+0x10>
cmp    $0x9,%cl
je     1110 <REMOVE_WS+0x10>
ret

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

LLVM IR (-O2):
define void @REMOVE_WS(i8** nocapture %0) {
%2 = load i8*, i8** %0
br label %3
3: ; preds = %6, %1
%4 = phi i8* [ %7, %6 ], [ %2, %1 ]
%5 = load i8, i8* %4
switch i8 %5, label %8 [
i8 32, label %6
i8 9, label %6
]
6: ; preds = %3, %3
%7 = getelementptr inbounds i8, i8* %4, i64 1
store i8* %7, i8** %0
br label %3
8: ; preds = %3
ret void
}
int wpa_cipher_bits(int cipher) {
  switch (cipher) {
  case (1 << (4)):
    return 128;
  case (1 << (3)):
    return 256;
  case (1 << (2)):
    return 104;
  case (1 << (1)):
    return 40;
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<wpa_cipher_bits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0xfffffffe,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0xe,%eax
ja     1160 <wpa_cipher_bits+0x60>
mov    -0x10(%rbp),%rax
lea    0xed9(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x80,-0x4(%rbp)
jmp    1167 <wpa_cipher_bits+0x67>
movl   $0x100,-0x4(%rbp)
jmp    1167 <wpa_cipher_bits+0x67>
movl   $0x68,-0x4(%rbp)
jmp    1167 <wpa_cipher_bits+0x67>
movl   $0x28,-0x4(%rbp)
jmp    1167 <wpa_cipher_bits+0x67>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<wpa_cipher_bits>:
add    $0xfffffffe,%edi
ror    %edi
xor    %eax,%eax
cmp    $0x7,%edi
ja     1119 <wpa_cipher_bits+0x19>
movslq %edi,%rax
lea    0xeea(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @wpa_cipher_bits(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %9 [
i32 16, label %5
i32 8, label %6
i32 4, label %7
i32 2, label %8
]
5: ; preds = %1
store i32 128, i32* %2
br label %10
6: ; preds = %1
store i32 256, i32* %2
br label %10
7: ; preds = %1
store i32 104, i32* %2
br label %10
8: ; preds = %1
store i32 40, i32* %2
br label %10
9: ; preds = %1
store i32 0, i32* %2
br label %10
10: ; preds = %9, %8, %7, %6, %5
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
@switch.table.wpa_cipher_bits = [8 x i32] [i32 40, i32 104, i32 0, i32 256, i32 0, i32 0, i32 0, i32 128]
define i32 @wpa_cipher_bits(i32 %0) {
%2 = add i32 %0, -2
%3 = tail call i32 @llvm.fshl.i32(i32 %2, i32 %2, i32 31)
%4 = icmp ult i32 %3, 8
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = sext i32 %3 to i64
%7 = getelementptr inbounds [8 x i32], [8 x i32]* @switch.table.wpa_cipher_bits, i64 0, i64 %6
%8 = load i32, i32* %7
br label %9
9: ; preds = %1, %5
%10 = phi i32 [ %8, %5 ], [ 0, %1 ]
ret i32 %10
}
void finn_vec3_right(float *vec) {
  vec[0] = 1;
  vec[1] = 0;
  vec[2] = 0;
}


x86 assembly (clang, -O0):
<finn_vec3_right>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movss  0xeec(%rip),%xmm0
movss  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,0x4(%rax)
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<finn_vec3_right>:
movq   $0x3f800000,(%rdi)
movl   $0x0,0x8(%rdi)
ret

LLVM IR (-O0):
define void @finn_vec3_right(float* %0) {
%2 = alloca float*
store float* %0, float** %2
%3 = load float*, float** %2
%4 = getelementptr inbounds float, float* %3, i64 0
store float 1.000000e+00, float* %4
%5 = load float*, float** %2
%6 = getelementptr inbounds float, float* %5, i64 1
store float 0.000000e+00, float* %6
%7 = load float*, float** %2
%8 = getelementptr inbounds float, float* %7, i64 2
store float 0.000000e+00, float* %8
ret void
}

LLVM IR (-O2):
define void @finn_vec3_right(float* nocapture writeonly %0) {
store float 1.000000e+00, float* %0
%2 = getelementptr inbounds float, float* %0, i64 1
store float 0.000000e+00, float* %2
%3 = getelementptr inbounds float, float* %0, i64 2
store float 0.000000e+00, float* %3
ret void
}
/* Variables and functions */
float vectorAngleBetween_norm(float *, float *);
int /*<<< orphan*/ vectorNormalize(float *, float const *);
float vectorAngleBetween(const float a[3], const float b[3]) {
  float normA[3], normB[3];
  vectorNormalize(normA, a);
  vectorNormalize(normB, b);
  return vectorAngleBetween_norm(normA, normB);
}


x86 assembly (clang, -O0):
<vectorAngleBetween>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x1c(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <vectorNormalize@plt>
lea    -0x28(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <vectorNormalize@plt>
lea    -0x1c(%rbp),%rdi
lea    -0x28(%rbp),%rsi
call   1040 <vectorAngleBetween_norm@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vectorAngleBetween>:
push   %r15
push   %r14
push   %rbx
sub    $0x20,%rsp
mov    %rsi,%rbx
mov    %rdi,%rsi
lea    0x14(%rsp),%r14
mov    %r14,%rdi
call   1030 <vectorNormalize@plt>
lea    0x8(%rsp),%r15
mov    %r15,%rdi
mov    %rbx,%rsi
call   1030 <vectorNormalize@plt>
mov    %r14,%rdi
mov    %r15,%rsi
call   1040 <vectorAngleBetween_norm@plt>
add    $0x20,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define float @vectorAngleBetween(float* %0, float* %1) {
%3 = alloca float*
%4 = alloca float*
%5 = alloca [3 x float]
%6 = alloca [3 x float]
store float* %0, float** %3
store float* %1, float** %4
%7 = getelementptr inbounds [3 x float], [3 x float]* %5, i64 0, i64 0
%8 = load float*, float** %3
%9 = call i32 @vectorNormalize(float* %7, float* %8)
%10 = getelementptr inbounds [3 x float], [3 x float]* %6, i64 0, i64 0
%11 = load float*, float** %4
%12 = call i32 @vectorNormalize(float* %10, float* %11)
%13 = getelementptr inbounds [3 x float], [3 x float]* %5, i64 0, i64 0
%14 = getelementptr inbounds [3 x float], [3 x float]* %6, i64 0, i64 0
%15 = call float @vectorAngleBetween_norm(float* %13, float* %14)
ret float %15
}

LLVM IR (-O2):
define float @vectorAngleBetween(float* %0, float* %1) {
%3 = alloca [3 x float]
%4 = alloca [3 x float]
%5 = bitcast [3 x float]* %3 to i8*
%6 = bitcast [3 x float]* %4 to i8*
%7 = getelementptr inbounds [3 x float], [3 x float]* %3, i64 0, i64 0
%8 = call i32 @vectorNormalize(float* %7, float* %0)
%9 = getelementptr inbounds [3 x float], [3 x float]* %4, i64 0, i64 0
%10 = call i32 @vectorNormalize(float* %9, float* %1)
%11 = call float @vectorAngleBetween_norm(float* %7, float* %9)
ret float %11
}
/* Variables and functions */
int atan(int);
double rad2deg(double rad) { return (180.0 * rad / ((4 * atan(1)))); }


x86 assembly (clang, -O0):
<rad2deg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xedb(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    $0x1,%edi
call   1030 <atan@plt>
movsd  -0x10(%rbp),%xmm0
shl    $0x2,%eax
cvtsi2sd %eax,%xmm1
divsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rad2deg>:
push   %rax
mulsd  0xee7(%rip),%xmm0
movsd  %xmm0,(%rsp)
mov    $0x1,%edi
call   1030 <atan@plt>
shl    $0x2,%eax
cvtsi2sd %eax,%xmm1
movsd  (%rsp),%xmm0
divsd  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @rad2deg(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double 1.800000e+02, %3
%5 = call i32 @atan(i32 1)
%6 = mul nsw i32 4, %5
%7 = sitofp i32 %6 to double
%8 = fdiv double %4, %7
ret double %8
}

LLVM IR (-O2):
define double @rad2deg(double %0) {
%2 = fmul double %0, 1.800000e+02
%3 = tail call i32 @atan(i32 1)
%4 = shl nsw i32 %3, 2
%5 = sitofp i32 %4 to double
%6 = fdiv double %2, %5
ret double %6
}
/* Variables and functions */
int /*<<< orphan*/ func3();
int /*<<< orphan*/ printf(char *, int);
void func2() {
  int i = 7;
  printf("\t\t[in func2] i = %d\n", i);
  func3();
  printf("\t\t[back in func2] i = %d\n", i);
}


x86 assembly (clang, -O0):
<func2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x7,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xec7(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <func3@plt>
mov    -0x4(%rbp),%esi
lea    0xec6(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<func2>:
push   %rax
lea    0xed8(%rip),%rdi
mov    $0x7,%esi
call   1040 <printf@plt>
xor    %eax,%eax
call   1030 <func3@plt>
lea    0xed5(%rip),%rdi
mov    $0x7,%esi
pop    %rax
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"\09\09[in func2] i = %d\0A\00"
@.str.1 = [26 x i8] c"\09\09[back in func2] i = %d\0A\00"
define void @func2() {
%1 = alloca i32
store i32 7, i32* %1
%2 = load i32, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = call i32 (...) @func3()
%5 = load i32, i32* %1
%6 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"\09\09[in func2] i = %d\0A\00"
@.str.1 = [26 x i8] c"\09\09[back in func2] i = %d\0A\00"
define void @func2() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 7)
%2 = tail call i32 (...) @func3()
%3 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i32 7)
ret void
}
void test3() {
  int x;
  (__extension__ x) = 10;
}


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

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

LLVM IR (-O0):
define void @test3() {
%1 = alloca i32
store i32 10, i32* %1
ret void
}

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