xunge/DecIR huggingface dataset:
int get_last(int *r) { return r[r[0] - 1]; }


x86 assembly (clang, -O0):
<get_last>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x8(%rbp),%rcx
mov    (%rcx),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_last>:
movslq (%rdi),%rax
mov    -0x4(%rdi,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @get_last(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32*, i32** %2
%5 = getelementptr inbounds i32, i32* %4, i64 0
%6 = load i32, i32* %5
%7 = sub nsw i32 %6, 1
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i32, i32* %3, i64 %8
%10 = load i32, i32* %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @get_last(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = add nsw i32 %2, -1
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = load i32, i32* %5
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ SIGALRM;
int /*<<< orphan*/ alarm(unsigned int);
int /*<<< orphan*/ clear_pending_blocked_signals(int /*<<< orphan*/);
void reset_alarm(unsigned int seconds) {
  alarm(0);
  clear_pending_blocked_signals(SIGALRM);
  alarm(seconds);
}


x86 assembly (clang, -O0):
<reset_alarm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
xor    %edi,%edi
call   1040 <alarm@plt>
mov    0x2eaf(%rip),%rax
mov    (%rax),%edi
call   1030 <clear_pending_blocked_signals@plt>
mov    -0x4(%rbp),%edi
call   1040 <alarm@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reset_alarm>:
push   %rbx
mov    %edi,%ebx
xor    %edi,%edi
call   1040 <alarm@plt>
mov    0x2eb7(%rip),%rax
mov    (%rax),%edi
call   1030 <clear_pending_blocked_signals@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <alarm@plt>

LLVM IR (-O0):
@SIGALRM = global i32 0
define void @reset_alarm(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @alarm(i32 0)
%4 = load i32, i32* @SIGALRM
%5 = call i32 @clear_pending_blocked_signals(i32 %4)
%6 = load i32, i32* %2
%7 = call i32 @alarm(i32 %6)
ret void
}

LLVM IR (-O2):
@SIGALRM = global i32 0
define void @reset_alarm(i32 %0) {
%2 = tail call i32 @alarm(i32 0)
%3 = load i32, i32* @SIGALRM
%4 = tail call i32 @clear_pending_blocked_signals(i32 %3)
%5 = tail call i32 @alarm(i32 %0)
ret void
}
void initialize() {}


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

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

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

LLVM IR (-O2):
define void @initialize() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
int isqrt(int);
void t_sqrt_146() {
  Assert_real((isqrt(146) == 12),
              "/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/stdlib/isqrt.c",
              735, ("Integer square root of 146 should be 12"));
}


x86 assembly (clang, -O0):
<t_sqrt_146>:
push   %rbp
mov    %rsp,%rbp
mov    $0x92,%edi
call   1030 <isqrt@plt>
cmp    $0xc,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xec0(%rip),%rsi
mov    $0x2df,%edx
lea    0xf56(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_sqrt_146>:
push   %rax
mov    $0x92,%edi
call   1030 <isqrt@plt>
xor    %edi,%edi
cmp    $0xc,%eax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf60(%rip),%rcx
mov    $0x2df,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [162 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/stdlib/isqrt.c\00"
@.str.1 = [40 x i8] c"Integer square root of 146 should be 12\00"
define void @t_sqrt_146() {
%1 = call i32 @isqrt(i32 146)
%2 = icmp eq i32 %1, 12
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 735, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [162 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/stdlib/isqrt.c\00"
@.str.1 = [40 x i8] c"Integer square root of 146 should be 12\00"
define void @t_sqrt_146() {
%1 = tail call i32 @isqrt(i32 146)
%2 = icmp eq i32 %1, 12
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 735, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
void f(int a, ...) { assert(a == 1); }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
sete   %al
movzbl %al,%edi
call   1030 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
xor    %eax,%eax
cmp    $0x1,%edi
sete   %al
mov    %eax,%edi
jmp    1030 <assert@plt>

LLVM IR (-O0):
define void @f(i32 %0, ...) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 1
%5 = zext i1 %4 to i32
%6 = call i32 @assert(i32 %5)
ret void
}

LLVM IR (-O2):
define void @f(i32 %0, ...) {
%2 = icmp eq i32 %0, 1
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
ret void
}
/* Type definitions */
struct error {
  int dummy;
};
struct child {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ child_close(struct child *);
int child_join(struct child *, struct error *);
int child_join_close(struct child *child, struct error *err) {
  child_close(child);
  return child_join(child, err);
}


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

x86 assembly (clang, -O2):
<child_join_close>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <child_close@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <child_join@plt>

LLVM IR (-O0):
%struct.child = type { i32 }
%struct.error = type { i32 }
define i32 @child_join_close(%struct.child* %0, %struct.error* %1) {
%3 = alloca %struct.child*
%4 = alloca %struct.error*
store %struct.child* %0, %struct.child** %3
store %struct.error* %1, %struct.error** %4
%5 = load %struct.child*, %struct.child** %3
%6 = call i32 @child_close(%struct.child* %5)
%7 = load %struct.child*, %struct.child** %3
%8 = load %struct.error*, %struct.error** %4
%9 = call i32 @child_join(%struct.child* %7, %struct.error* %8)
ret i32 %9
}

LLVM IR (-O2):
%struct.child = type { i32 }
%struct.error = type { i32 }
define i32 @child_join_close(%struct.child* %0, %struct.error* %1) {
%3 = tail call i32 @child_close(%struct.child* %0)
%4 = tail call i32 @child_join(%struct.child* %0, %struct.error* %1)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, ...);
void chars(void) {
  int a = 15;
  double b = 123555555678;
  double c = 12345678.1234567;
  char d = 'p';
  printf("a=%d\n", a);
  printf("a(%%d)=%d, a(%%5d)=%5d, a(%%o)=%o, a(%%x)=%x\n\n", a, a, a, a);
}


x86 assembly (clang, -O0):
<chars>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0xf,-0x4(%rbp)
movsd  0xee1(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xecc(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movb   $0x70,-0x19(%rbp)
mov    -0x4(%rbp),%esi
lea    0xec9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%esi
mov    -0x4(%rbp),%edx
mov    -0x4(%rbp),%ecx
mov    -0x4(%rbp),%r8d
lea    0xeb4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chars>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0xf,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xedb(%rip),%rdi
mov    $0xf,%esi
mov    $0xf,%edx
mov    $0xf,%ecx
mov    $0xf,%r8d
xor    %eax,%eax
pop    %r9
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"a=%d\0A\00"
@.str.1 = [47 x i8] c"a(%%d)=%d, a(%%5d)=%5d, a(%%o)=%o, a(%%x)=%x\0A\0A\00"
define void @chars() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
%4 = alloca i8
store i32 15, i32* %1
store double 0x423CC47C295E0000, double* %2
store double 0x41678C29C3F35B77, double* %3
store i8 112, i8* %4
%5 = load i32, i32* %1
%6 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i32, i32* %1
%8 = load i32, i32* %1
%9 = load i32, i32* %1
%10 = load i32, i32* %1
%11 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.1, i64 0, i64 0), i32 %7, i32 %8, i32 %9, i32 %10)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"a=%d\0A\00"
@.str.1 = [47 x i8] c"a(%%d)=%d, a(%%5d)=%5d, a(%%o)=%o, a(%%x)=%x\0A\0A\00"
define void @chars() {
%1 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 15)
%2 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.1, i64 0, i64 0), i32 15, i32 15, i32 15, i32 15)
ret void
}
int multiply(int a, int b) {
  if (b == 0)
    return 0;
  if (b == 1)
    return a;
  if (b % 2 == 0)
    return 2 * multiply(a, b / 2);
  else
    return 2 * multiply(a, b / 2) + a;
}


x86 assembly (clang, -O0):
<multiply>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1134 <multiply+0x24>
movl   $0x0,-0x4(%rbp)
jmp    119b <multiply+0x8b>
cmpl   $0x1,-0xc(%rbp)
jne    1149 <multiply+0x39>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    119b <multiply+0x8b>
mov    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    117d <multiply+0x6d>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%esi
call   1030 <multiply@plt>
shl    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    119b <multiply+0x8b>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%esi
call   1030 <multiply@plt>
shl    $0x1,%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<multiply>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%eax
test   %esi,%esi
je     1140 <multiply+0x30>
mov    %edi,%ebp
cmp    $0x1,%eax
jne    1124 <multiply+0x14>
mov    %ebp,%eax
jmp    1140 <multiply+0x30>
mov    %eax,%ebx
and    $0x1,%ebx
neg    %ebx
mov    %eax,%esi
shr    $0x1f,%esi
add    %eax,%esi
sar    %esi
mov    %ebp,%edi
call   1030 <multiply@plt>
and    %ebp,%ebx
lea    (%rbx,%rax,2),%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @multiply(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* %5
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %2
store i32 0, i32* %3
br label %32
9: ; preds = %2
%10 = load i32, i32* %5
%11 = icmp eq i32 %10, 1
br i1 %11, label %12, label %14
12: ; preds = %9
%13 = load i32, i32* %4
store i32 %13, i32* %3
br label %32
14: ; preds = %9
%15 = load i32, i32* %5
%16 = srem i32 %15, 2
%17 = icmp eq i32 %16, 0
br i1 %17, label %18, label %24
18: ; preds = %14
%19 = load i32, i32* %4
%20 = load i32, i32* %5
%21 = sdiv i32 %20, 2
%22 = call i32 @multiply(i32 %19, i32 %21)
%23 = mul nsw i32 2, %22
store i32 %23, i32* %3
br label %32
24: ; preds = %14
%25 = load i32, i32* %4
%26 = load i32, i32* %5
%27 = sdiv i32 %26, 2
%28 = call i32 @multiply(i32 %25, i32 %27)
%29 = mul nsw i32 2, %28
%30 = load i32, i32* %4
%31 = add nsw i32 %29, %30
store i32 %31, i32* %3
br label %32
32: ; preds = %24, %18, %12, %8
%33 = load i32, i32* %3
ret i32 %33
}

LLVM IR (-O2):
define i32 @multiply(i32 %0, i32 %1) {
switch i32 %1, label %4 [
i32 0, label %12
i32 1, label %3
]
3: ; preds = %2
br label %12
4: ; preds = %2
%5 = and i32 %1, 1
%6 = icmp eq i32 %5, 0
%7 = sdiv i32 %1, 2
%8 = tail call i32 @multiply(i32 %0, i32 %7)
%9 = shl nsw i32 %8, 1
%10 = select i1 %6, i32 0, i32 %0
%11 = add nsw i32 %9, %10
br label %12
12: ; preds = %4, %3, %2
%13 = phi i32 [ %0, %3 ], [ %1, %2 ], [ %11, %4 ]
ret i32 %13
}
/* Variables and functions */
void *calloc(int, int);
void *mhs_calloc(int num, int size) { return (calloc(num, size)); }


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

x86 assembly (clang, -O2):
<mhs_calloc>:
jmp    1030 <calloc@plt>

LLVM IR (-O0):
define i8* @mhs_calloc(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 i8* @calloc(i32 %5, i32 %6)
ret i8* %7
}

LLVM IR (-O2):
define noalias i8* @mhs_calloc(i32 %0, i32 %1) {
%3 = tail call i8* @calloc(i32 %0, i32 %1)
ret i8* %3
}
int compute_height(int feet, int inches) {
  int value = 0;
  value = (feet * 12) + inches;
  return value;
}


x86 assembly (clang, -O0):
<compute_height>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
imul   $0xc,-0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compute_height>:
lea    (%rdi,%rdi,2),%eax
lea    (%rsi,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @compute_height(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
store i32 0, i32* %5
%6 = load i32, i32* %3
%7 = mul nsw i32 %6, 12
%8 = load i32, i32* %4
%9 = add nsw i32 %7, %8
store i32 %9, i32* %5
%10 = load i32, i32* %5
ret i32 %10
}

LLVM IR (-O2):
define i32 @compute_height(i32 %0, i32 %1) {
%3 = mul nsw i32 %0, 12
%4 = add nsw i32 %3, %1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
unsigned int decrement(unsigned int, unsigned int, unsigned int);
unsigned int ringbuffer_decrement(unsigned int a, unsigned int delta,
                                  unsigned int begin, unsigned int end) {
  assert(end >= begin);
  assert(a >= begin);
  return decrement(a - begin, delta, end - begin) + begin;
}


x86 assembly (clang, -O0):
<ringbuffer_decrement>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
setae  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x4(%rbp),%eax
cmp    -0xc(%rbp),%eax
setae  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x4(%rbp),%edi
sub    -0xc(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%edx
sub    -0xc(%rbp),%edx
call   1030 <decrement@plt>
add    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ringbuffer_decrement>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %ecx,%ebp
mov    %edx,%r15d
mov    %esi,%r14d
mov    %edi,%ebx
xor    %edi,%edi
sub    %edx,%ebp
setae  %dil
call   1040 <assert@plt>
xor    %edi,%edi
sub    %r15d,%ebx
setae  %dil
call   1040 <assert@plt>
mov    %ebx,%edi
mov    %r14d,%esi
mov    %ebp,%edx
call   1030 <decrement@plt>
add    %r15d,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @ringbuffer_decrement(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %8
%10 = load i32, i32* %7
%11 = icmp uge i32 %9, %10
%12 = zext i1 %11 to i32
%13 = call i32 @assert(i32 %12)
%14 = load i32, i32* %5
%15 = load i32, i32* %7
%16 = icmp uge i32 %14, %15
%17 = zext i1 %16 to i32
%18 = call i32 @assert(i32 %17)
%19 = load i32, i32* %5
%20 = load i32, i32* %7
%21 = sub i32 %19, %20
%22 = load i32, i32* %6
%23 = load i32, i32* %8
%24 = load i32, i32* %7
%25 = sub i32 %23, %24
%26 = call i32 @decrement(i32 %21, i32 %22, i32 %25)
%27 = load i32, i32* %7
%28 = add i32 %26, %27
ret i32 %28
}

LLVM IR (-O2):
define i32 @ringbuffer_decrement(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = icmp uge i32 %3, %2
%6 = zext i1 %5 to i32
%7 = tail call i32 @assert(i32 %6)
%8 = icmp uge i32 %0, %2
%9 = zext i1 %8 to i32
%10 = tail call i32 @assert(i32 %9)
%11 = sub i32 %0, %2
%12 = sub i32 %3, %2
%13 = tail call i32 @decrement(i32 %11, i32 %1, i32 %12)
%14 = add i32 %13, %2
ret i32 %14
}
/* Variables and functions */
float pow(float, double);
float de_jongs(float x1, float x2) { return pow(x1, 2.0) + pow(x2, 2.0); }


x86 assembly (clang, -O0):
<de_jongs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movsd  0xed1(%rip),%xmm1
call   1030 <pow@plt>
movss  %xmm0,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
movsd  0xeba(%rip),%xmm1
call   1030 <pow@plt>
movaps %xmm0,%xmm1
movss  -0xc(%rbp),%xmm0
addss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<de_jongs>:
push   %rax
movss  %xmm1,0x4(%rsp)
movsd  0xee1(%rip),%xmm1
call   1030 <pow@plt>
movss  %xmm0,(%rsp)
movss  0x4(%rsp),%xmm0
movsd  0xec9(%rip),%xmm1
call   1030 <pow@plt>
addss  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @de_jongs(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = call float @pow(float %5, double 2.000000e+00)
%7 = load float, float* %4
%8 = call float @pow(float %7, double 2.000000e+00)
%9 = fadd float %6, %8
ret float %9
}

LLVM IR (-O2):
define float @de_jongs(float %0, float %1) {
%3 = tail call float @pow(float %0, double 2.000000e+00)
%4 = tail call float @pow(float %1, double 2.000000e+00)
%5 = fadd float %3, %4
ret float %5
}
/* Variables and functions */
scalar_t__ elapsed_time();
int /*<<< orphan*/ printf(char *, double);
void print_elapsed_time(int n) {
  printf("%.2f ", ((double)elapsed_time()) / n);
}


x86 assembly (clang, -O0):
<print_elapsed_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <elapsed_time@plt>
cvtsi2sd %rax,%xmm0
cvtsi2sdl -0x4(%rbp),%xmm1
divsd  %xmm1,%xmm0
lea    0xeb9(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_elapsed_time>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <elapsed_time@plt>
cvtsi2sd %rax,%xmm0
cvtsi2sd %ebx,%xmm1
divsd  %xmm1,%xmm0
lea    0xec2(%rip),%rdi
pop    %rbx
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"%.2f \00"
define void @print_elapsed_time(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i64 (...) @elapsed_time()
%4 = sitofp i64 %3 to double
%5 = load i32, i32* %2
%6 = sitofp i32 %5 to double
%7 = fdiv double %4, %6
%8 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), double %7)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"%.2f \00"
define void @print_elapsed_time(i32 %0) {
%2 = tail call i64 (...) @elapsed_time()
%3 = sitofp i64 %2 to double
%4 = sitofp i32 %0 to double
%5 = fdiv double %3, %4
%6 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), double %5)
ret void
}
char node_name(int n) { return ('A' + n); }


x86 assembly (clang, -O0):
<node_name>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x41,%eax
movsbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define signext i8 @node_name(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 65, %3
%5 = trunc i32 %4 to i8
ret i8 %5
}

LLVM IR (-O2):
define signext i8 @node_name(i32 %0) {
%2 = trunc i32 %0 to i8
%3 = add i8 %2, 65
ret i8 %3
}
void random_conf(void *arg, char *param1, char *param2) {}


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

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

LLVM IR (-O0):
define void @random_conf(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
ret void
}

LLVM IR (-O2):
define void @random_conf(i8* nocapture %0, i8* nocapture %1, i8* nocapture %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ die(char *);
void usage(void) { die("Usage: build boot system [> image]"); }


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

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

LLVM IR (-O0):
@.str = [35 x i8] c"Usage: build boot system [> image]\00"
define void @usage() {
%1 = call i32 @die(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [35 x i8] c"Usage: build boot system [> image]\00"
define void @usage() {
%1 = tail call i32 @die(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
ret void
}
void store_a(volatile int *p, int x) {
  __asm__ __volatile__("mov %1, %0" : "=m"(*p) : "r"(x) : "memory");
}


x86 assembly (clang, -O0):
<store_a>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<store_a>:
mov    %esi,(%rdi)
ret

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

LLVM IR (-O2):
define void @store_a(i32* %0, i32 %1) {
tail call void asm sideeffect "mov $1, $0", "=*m,r,~{memory},~{dirflag},~{fpsr},~{flags}"(i32* elementtype(i32) %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ nf_error(char *, int);
int write(int, char const *, int);
int server_write(int fd, const char *msg, int msgSize) {
  int n;
  n = write(fd, msg, msgSize);
  if (n < 0) {
    nf_error("ERROR: writing to socket", true);
  }
  return n;
}


x86 assembly (clang, -O0):
<server_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <write@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jge    115f <server_write+0x3f>
lea    0xeab(%rip),%rdi
mov    $0x1,%esi
call   1030 <nf_error@plt>
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<server_write>:
push   %rbx
call   1040 <write@plt>
mov    %eax,%ebx
test   %eax,%eax
jns    113d <server_write+0x1d>
lea    0xecd(%rip),%rdi
mov    $0x1,%esi
call   1030 <nf_error@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"ERROR: writing to socket\00"
define i32 @server_write(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = load i32, i32* %4
%9 = load i8*, i8** %5
%10 = load i32, i32* %6
%11 = call i32 @write(i32 %8, i8* %9, i32 %10)
store i32 %11, i32* %7
%12 = load i32, i32* %7
%13 = icmp slt i32 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %3
%15 = call i32 @nf_error(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 1)
br label %16
16: ; preds = %14, %3
%17 = load i32, i32* %7
ret i32 %17
}

LLVM IR (-O2):
@.str = [25 x i8] c"ERROR: writing to socket\00"
define i32 @server_write(i32 %0, i8* nocapture %1, i32 %2) {
%4 = tail call i32 @write(i32 %0, i8* %1, i32 %2)
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @nf_error(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 1)
br label %8
8: ; preds = %6, %3
ret i32 %4
}
int t19(void) { return 10; }


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

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

LLVM IR (-O0):
define i32 @t19() {
ret i32 10
}

LLVM IR (-O2):
define i32 @t19() {
ret i32 10
}
/* Variables and functions */
double sqrt(double);
double sqvar(double covar) { return covar < 0.0 ? -sqrt(-covar) : sqrt(covar); }


x86 assembly (clang, -O0):
<sqvar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    116d <sqvar+0x5d>
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
call   1030 <sqrt@plt>
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    117c <sqvar+0x6c>
movsd  -0x8(%rbp),%xmm0
call   1030 <sqrt@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sqvar>:
xorpd  %xmm1,%xmm1
ucomisd %xmm0,%xmm1
jbe    113e <sqvar+0x2e>
push   %rax
movapd 0xedd(%rip),%xmm1
xorpd  %xmm0,%xmm1
movsd  0xee1(%rip),%xmm2
ucomisd %xmm0,%xmm2
jb     1149 <sqvar+0x39>
xorps  %xmm0,%xmm0
sqrtsd %xmm1,%xmm0
jmp    1152 <sqvar+0x42>
ucomisd %xmm1,%xmm0
jb     115f <sqvar+0x4f>
sqrtsd %xmm0,%xmm0
ret
movapd %xmm1,%xmm0
call   1030 <sqrt@plt>
xorpd  0xea6(%rip),%xmm0
add    $0x8,%rsp
ret
jmp    1030 <sqrt@plt>

LLVM IR (-O0):
define double @sqvar(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp olt double %3, 0.000000e+00
br i1 %4, label %5, label %10
5: ; preds = %1
%6 = load double, double* %2
%7 = fneg double %6
%8 = call double @sqrt(double %7)
%9 = fneg double %8
br label %13
10: ; preds = %1
%11 = load double, double* %2
%12 = call double @sqrt(double %11)
br label %13
13: ; preds = %10, %5
%14 = phi double [ %9, %5 ], [ %12, %10 ]
ret double %14
}

LLVM IR (-O2):
define double @sqvar(double %0) {
%2 = fcmp olt double %0, 0.000000e+00
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = fneg double %0
%5 = tail call double @sqrt(double %4)
%6 = fneg double %5
br label %9
7: ; preds = %1
%8 = tail call double @sqrt(double %0)
br label %9
9: ; preds = %7, %3
%10 = phi double [ %6, %3 ], [ %8, %7 ]
ret double %10
}
void qdss_clk_disable(void) {}


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

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

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

LLVM IR (-O2):
define void @qdss_clk_disable() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ mpz_t;

/* Variables and functions */
int mpz_fits_slong_p(int /*<<< orphan*/);
int gmpint_fits_int(mpz_t *op) { return mpz_fits_slong_p(*op); }


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

x86 assembly (clang, -O2):
<gmpint_fits_int>:
mov    (%rdi),%edi
jmp    1030 <mpz_fits_slong_p@plt>

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

LLVM IR (-O2):
define i32 @gmpint_fits_int(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 @mpz_fits_slong_p(i32 %2)
ret i32 %3
}
/* Variables and functions */
long rand();
double uniformdoublerand() {
  double result;
  long a, b;
  a = rand();
  b = rand();
  result = (double)(a - 1073741824) * 8388608.0 + (double)(b >> 8);
  return result;
}


x86 assembly (clang, -O0):
<uniformdoublerand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    $0x0,%al
call   1030 <rand@plt>
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
sub    $0x40000000,%rax
cvtsi2sd %rax,%xmm0
mov    -0x18(%rbp),%rax
sar    $0x8,%rax
cvtsi2sd %rax,%xmm1
movsd  0xeae(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uniformdoublerand>:
push   %rbx
xor    %eax,%eax
call   1030 <rand@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1030 <rand@plt>
add    $0xffffffffc0000000,%rbx
cvtsi2sd %rbx,%xmm0
sar    $0x8,%rax
cvtsi2sd %rax,%xmm1
mulsd  0xec1(%rip),%xmm0
addsd  %xmm1,%xmm0
pop    %rbx
ret

LLVM IR (-O0):
define double @uniformdoublerand() {
%1 = alloca double
%2 = alloca i64
%3 = alloca i64
%4 = call i64 (...) @rand()
store i64 %4, i64* %2
%5 = call i64 (...) @rand()
store i64 %5, i64* %3
%6 = load i64, i64* %2
%7 = sub nsw i64 %6, 1073741824
%8 = sitofp i64 %7 to double
%9 = load i64, i64* %3
%10 = ashr i64 %9, 8
%11 = sitofp i64 %10 to double
%12 = call double @llvm.fmuladd.f64(double %8, double 0x4160000000000000, double %11)
store double %12, double* %1
%13 = load double, double* %1
ret double %13
}

LLVM IR (-O2):
define double @uniformdoublerand() {
%1 = tail call i64 (...) @rand()
%2 = tail call i64 (...) @rand()
%3 = add nsw i64 %1, -1073741824
%4 = sitofp i64 %3 to double
%5 = ashr i64 %2, 8
%6 = sitofp i64 %5 to double
%7 = tail call double @llvm.fmuladd.f64(double %4, double 0x4160000000000000, double %6)
ret double %7
}
void buflist_mouse_end() {}


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

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

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

LLVM IR (-O2):
define void @buflist_mouse_end() {
ret void
}
double foo(double a, double b, double c) { return (a + b + c); }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
addsd  -0x10(%rbp),%xmm0
addsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
addsd  %xmm1,%xmm0
addsd  %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @foo(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* %5
%9 = fadd double %7, %8
%10 = load double, double* %6
%11 = fadd double %9, %10
ret double %11
}

LLVM IR (-O2):
define double @foo(double %0, double %1, double %2) {
%4 = fadd double %0, %1
%5 = fadd double %4, %2
ret double %5
}
/* Variables and functions */
double Dl(double, double);
double Dv(double, double);
double drying_D(double T, double M, double por) {
  double DV, DL;
  DV = Dv(T, M);
  DL = Dl(T, M);
  return por * DV + (1 - por) * DL;
}


x86 assembly (clang, -O0):
<drying_D>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1030 <Dv@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1040 <Dl@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm2
movsd  0xe8f(%rip),%xmm1
subsd  -0x18(%rbp),%xmm1
mulsd  -0x28(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<drying_D>:
sub    $0x28,%rsp
movsd  %xmm2,0x20(%rsp)
movsd  %xmm1,0x10(%rsp)
movsd  %xmm0,0x8(%rsp)
call   1030 <Dv@plt>
movsd  %xmm0,0x18(%rsp)
movsd  0x8(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
call   1040 <Dl@plt>
movsd  0xea6(%rip),%xmm1
movsd  0x20(%rsp),%xmm2
subsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  0x18(%rsp),%xmm1
mulsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
add    $0x28,%rsp
ret

LLVM IR (-O0):
define double @drying_D(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%9 = load double, double* %4
%10 = load double, double* %5
%11 = call double @Dv(double %9, double %10)
store double %11, double* %7
%12 = load double, double* %4
%13 = load double, double* %5
%14 = call double @Dl(double %12, double %13)
store double %14, double* %8
%15 = load double, double* %6
%16 = load double, double* %7
%17 = load double, double* %6
%18 = fsub double 1.000000e+00, %17
%19 = load double, double* %8
%20 = fmul double %18, %19
%21 = call double @llvm.fmuladd.f64(double %15, double %16, double %20)
ret double %21
}

LLVM IR (-O2):
define double @drying_D(double %0, double %1, double %2) {
%4 = tail call double @Dv(double %0, double %1)
%5 = tail call double @Dl(double %0, double %1)
%6 = fsub double 1.000000e+00, %2
%7 = fmul double %6, %5
%8 = tail call double @llvm.fmuladd.f64(double %2, double %4, double %7)
ret double %8
}
float ftg__get_min(float a, float b, float c) {
  float r = a;
  if (r > b)
    r = b;
  if (r > c)
    r = c;
  return r;
}


x86 assembly (clang, -O0):
<ftg__get_min>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    1136 <ftg__get_min+0x36>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
ucomiss -0xc(%rbp),%xmm0
jbe    114f <ftg__get_min+0x4f>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<ftg__get_min>:
minss  %xmm0,%xmm1
minss  %xmm1,%xmm2
movaps %xmm2,%xmm0
ret

LLVM IR (-O0):
define float @ftg__get_min(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%8 = load float, float* %4
store float %8, float* %7
%9 = load float, float* %7
%10 = load float, float* %5
%11 = fcmp ogt float %9, %10
br i1 %11, label %12, label %14
12: ; preds = %3
%13 = load float, float* %5
store float %13, float* %7
br label %14
14: ; preds = %12, %3
%15 = load float, float* %7
%16 = load float, float* %6
%17 = fcmp ogt float %15, %16
br i1 %17, label %18, label %20
18: ; preds = %14
%19 = load float, float* %6
store float %19, float* %7
br label %20
20: ; preds = %18, %14
%21 = load float, float* %7
ret float %21
}

LLVM IR (-O2):
define float @ftg__get_min(float %0, float %1, float %2) {
%4 = fcmp ogt float %0, %1
%5 = select i1 %4, float %1, float %0
%6 = fcmp ogt float %5, %2
%7 = select i1 %6, float %2, float %5
ret float %7
}
/* Variables and functions */
int /*<<< orphan*/ inBits(char);
int /*<<< orphan*/ pow(int, int);
int round(int /*<<< orphan*/);
lampeSchalten(char *lights, int *index, int *command) {
  int div = round(pow(2, *index - 1));
  if (*command == 0) {
    div = -div;
  }
  *lights += div;
  inBits(*lights);
}


x86 assembly (clang, -O0):
<lampeSchalten>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%esi
sub    $0x1,%esi
mov    $0x2,%edi
call   1040 <pow@plt>
mov    %eax,%edi
call   1050 <round@plt>
mov    %eax,-0x24(%rbp)
mov    -0x20(%rbp),%rax
cmpl   $0x0,(%rax)
jne    1176 <lampeSchalten+0x46>
xor    %eax,%eax
sub    -0x24(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%edx
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
add    %edx,%ecx
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <inBits@plt>
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lampeSchalten>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rdi,%rbx
mov    (%rsi),%esi
add    $0xffffffff,%esi
mov    $0x2,%edi
call   1040 <pow@plt>
mov    %eax,%edi
call   1050 <round@plt>
mov    %eax,%ecx
neg    %cl
cmpl   $0x0,(%r14)
movzbl %cl,%ecx
cmovne %eax,%ecx
add    (%rbx),%cl
mov    %cl,(%rbx)
movsbl %cl,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <inBits@plt>

LLVM IR (-O0):
define i32 @lampeSchalten(i8* %0, i32* %1, i32* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32
store i8* %0, i8** %5
store i32* %1, i32** %6
store i32* %2, i32** %7
%9 = load i32*, i32** %6
%10 = load i32, i32* %9
%11 = sub nsw i32 %10, 1
%12 = call i32 @pow(i32 2, i32 %11)
%13 = call i32 @round(i32 %12)
store i32 %13, i32* %8
%14 = load i32*, i32** %7
%15 = load i32, i32* %14
%16 = icmp eq i32 %15, 0
br i1 %16, label %17, label %20
17: ; preds = %3
%18 = load i32, i32* %8
%19 = sub nsw i32 0, %18
store i32 %19, i32* %8
br label %20
20: ; preds = %17, %3
%21 = load i32, i32* %8
%22 = load i8*, i8** %5
%23 = load i8, i8* %22
%24 = sext i8 %23 to i32
%25 = add nsw i32 %24, %21
%26 = trunc i32 %25 to i8
store i8 %26, i8* %22
%27 = load i8*, i8** %5
%28 = load i8, i8* %27
%29 = call i32 @inBits(i8 signext %28)
%30 = load i32, i32* %4
ret i32 %30
}

LLVM IR (-O2):
define i32 @lampeSchalten(i8* nocapture %0, i32* nocapture %1, i32* nocapture %2) {
%4 = load i32, i32* %1
%5 = add nsw i32 %4, -1
%6 = tail call i32 @pow(i32 2, i32 %5)
%7 = tail call i32 @round(i32 %6)
%8 = load i32, i32* %2
%9 = icmp eq i32 %8, 0
%10 = sub nsw i32 0, %7
%11 = select i1 %9, i32 %10, i32 %7
%12 = load i8, i8* %0
%13 = trunc i32 %11 to i8
%14 = add i8 %12, %13
store i8 %14, i8* %0
%15 = tail call i32 @inBits(i8 signext %14)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ s_vSetKey(unsigned long, unsigned long);
void MIC_vInit(unsigned long dwK0, unsigned long dwK1) {
  s_vSetKey(dwK0, dwK1);
}


x86 assembly (clang, -O0):
<MIC_vInit>:
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 <s_vSetKey@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MIC_vInit>:
jmp    1030 <s_vSetKey@plt>

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

LLVM IR (-O2):
define void @MIC_vInit(i64 %0, i64 %1) {
%3 = tail call i32 @s_vSetKey(i64 %0, i64 %1)
ret void
}
void nand_init(void) {
  (*(volatile unsigned long *)(0x70200000 + 0x00)) =
      ((0x2 << 12) | (0xf << 8) | (0x7 << 4));
  (*(volatile unsigned long *)(0x70200000 + 0x04)) |= (0x3 << 0);
}


x86 assembly (clang, -O0):
<nand_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x70200000,%eax
movq   $0x2f70,(%rax)
mov    $0x70200004,%eax
mov    (%rax),%rcx
or     $0x3,%rcx
mov    $0x70200004,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<nand_init>:
movq   $0x2f70,0x70200000
orq    $0x3,0x70200004
70 03
ret

LLVM IR (-O0):
define void @nand_init() {
store volatile i64 12144, i64* inttoptr (i64 1881145344 to i64*)
%1 = load volatile i64, i64* inttoptr (i64 1881145348 to i64*)
%2 = or i64 %1, 3
store volatile i64 %2, i64* inttoptr (i64 1881145348 to i64*)
ret void
}

LLVM IR (-O2):
define void @nand_init() {
store volatile i64 12144, i64* inttoptr (i64 1881145344 to i64*)
%1 = load volatile i64, i64* inttoptr (i64 1881145348 to i64*)
%2 = or i64 %1, 3
store volatile i64 %2, i64* inttoptr (i64 1881145348 to i64*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ winpack_main_loop();
void mt_event_loop(void) { winpack_main_loop(); }


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

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

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

LLVM IR (-O2):
define void @mt_event_loop() {
%1 = tail call i32 (...) @winpack_main_loop()
ret void
}
int ph_ssl_determine_target(void *handler, struct sockaddr_in *addr) {
  return 0;
}


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

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

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

LLVM IR (-O2):
%struct.sockaddr_in = type opaque
define i32 @ph_ssl_determine_target(i8* nocapture readnone %0, %struct.sockaddr_in* nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ istrue(int);
char *itoa(int);
int /*<<< orphan*/ puts(char *);
void putsint(int i) {
  if (!istrue(i)) {
    puts("0");
  } else {
    puts(itoa(i));
  }
}


x86 assembly (clang, -O0):
<putsint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <istrue@plt>
cmp    $0x0,%eax
jne    115d <putsint+0x2d>
lea    0xead(%rip),%rdi
call   1030 <puts@plt>
jmp    116d <putsint+0x3d>
mov    -0x4(%rbp),%edi
call   1050 <itoa@plt>
mov    %rax,%rdi
call   1030 <puts@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putsint>:
push   %rbx
mov    %edi,%ebx
call   1040 <istrue@plt>
test   %eax,%eax
je     114c <putsint+0x1c>
mov    %ebx,%edi
call   1050 <itoa@plt>
mov    %rax,%rdi
pop    %rbx
jmp    1030 <puts@plt>
lea    0xead(%rip),%rdi
pop    %rbx
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"0\00"
define void @putsint(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @istrue(i32 %3)
%5 = icmp ne i32 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = call i32 @puts(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %12
8: ; preds = %1
%9 = load i32, i32* %2
%10 = call i8* @itoa(i32 %9)
%11 = call i32 @puts(i8* %10)
br label %12
12: ; preds = %8, %6
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"0\00"
define void @putsint(i32 %0) {
%2 = tail call i32 @istrue(i32 %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i8* @itoa(i32 %0)
br label %6
6: ; preds = %1, %4
%7 = phi i8* [ %5, %4 ], [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), %1 ]
%8 = tail call i32 @puts(i8* dereferenceable(1) %7)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ lround(double);
int /*<<< orphan*/ next_2n(int);
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int main(void) {
  next_2n(17);
  next_2n(200000);
  printf("%zu\n", lround(4.44089e-16));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x11,%edi
call   1050 <next_2n@plt>
mov    $0x30d40,%edi
call   1050 <next_2n@plt>
movsd  0xea5(%rip),%xmm0
call   1030 <lround@plt>
mov    %eax,%esi
lea    0xe9f(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x11,%edi
call   1050 <next_2n@plt>
mov    $0x30d40,%edi
call   1050 <next_2n@plt>
movsd  0xeb3(%rip),%xmm0
call   1030 <lround@plt>
lea    0xeaf(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%zu\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @next_2n(i32 17)
%3 = call i32 @next_2n(i32 200000)
%4 = call i32 @lround(double 4.440890e-16)
%5 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"%zu\0A\00"
define i32 @main() {
%1 = tail call i32 @next_2n(i32 17)
%2 = tail call i32 @next_2n(i32 200000)
%3 = tail call i32 @lround(double 4.440890e-16)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
void foo226(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo226(i32 %0) {
ret void
}
int do_085() { return 85; }


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

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

LLVM IR (-O0):
define i32 @do_085() {
ret i32 85
}

LLVM IR (-O2):
define i32 @do_085() {
ret i32 85
}
/* Variables and functions */
scalar_t__ strlen(char const *);
size_t r_strlen(const char *s) { return s ? (size_t)strlen(s) : 0; }


x86 assembly (clang, -O0):
<r_strlen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1139 <r_strlen+0x29>
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x10(%rbp)
jmp    1144 <r_strlen+0x34>
xor    %eax,%eax
mov    %rax,-0x10(%rbp)
jmp    1144 <r_strlen+0x34>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<r_strlen>:
test   %rdi,%rdi
je     111a <r_strlen+0xa>
jmp    1030 <strlen@plt>
xor    %eax,%eax
ret

LLVM IR (-O0):
define i64 @r_strlen(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = call i64 @strlen(i8* %6)
br label %9
8: ; preds = %1
br label %9
9: ; preds = %8, %5
%10 = phi i64 [ %7, %5 ], [ 0, %8 ]
ret i64 %10
}

LLVM IR (-O2):
define i64 @r_strlen(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i64 @strlen(i8* %0)
br label %5
5: ; preds = %1, %3
%6 = phi i64 [ %4, %3 ], [ 0, %1 ]
ret i64 %6
}
void swap(char **a, char **b) {
  char *temp = *a;
  *a = *b;
  *b = temp;
}


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

x86 assembly (clang, -O2):
<swap>:
mov    (%rdi),%rax
mov    (%rsi),%rcx
mov    %rcx,(%rdi)
mov    %rax,(%rsi)
ret

LLVM IR (-O0):
define void @swap(i8** %0, i8** %1) {
%3 = alloca i8**
%4 = alloca i8**
%5 = alloca i8*
store i8** %0, i8*** %3
store i8** %1, i8*** %4
%6 = load i8**, i8*** %3
%7 = load i8*, i8** %6
store i8* %7, i8** %5
%8 = load i8**, i8*** %4
%9 = load i8*, i8** %8
%10 = load i8**, i8*** %3
store i8* %9, i8** %10
%11 = load i8*, i8** %5
%12 = load i8**, i8*** %4
store i8* %11, i8** %12
ret void
}

LLVM IR (-O2):
define void @swap(i8** nocapture %0, i8** nocapture %1) {
%3 = load i8*, i8** %0
%4 = load i8*, i8** %1
store i8* %4, i8** %0
store i8* %3, i8** %1
ret void
}