xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ outop0str(char *);
void outfail() { outop0str("FAIL\t"); }


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

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

LLVM IR (-O0):
@.str = [6 x i8] c"FAIL\09\00"
define void @outfail() {
%1 = call i32 @outop0str(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"FAIL\09\00"
define void @outfail() {
%1 = tail call i32 @outop0str(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void sigfin_handler(int signo) { exit(0); }


x86 assembly (clang, -O0):
<sigfin_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
xor    %edi,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<sigfin_handler>:
push   %rax
xor    %edi,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @sigfin_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @sigfin_handler(i32 %0) {
%2 = tail call i32 @exit(i32 0)
unreachable
}
void CNT_export(char *name, void *dir, int nparms) {
  nparms = nparms;
  dir = dir;
  name = name;
}


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

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

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

LLVM IR (-O2):
define void @CNT_export(i8* nocapture %0, i8* nocapture %1, i32 %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("\nplaceholder for sloadhost-aduc8051\n");
  return (1);
}


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

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

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

LLVM IR (-O2):
@str = [36 x i8] c"\0Aplaceholder for sloadhost-aduc8051\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str, i64 0, i64 0))
ret i32 1
}
double max1(double a, double b) {
  if (a <= 0 && b <= 0) {
    return 0;
  } else if (a >= 0 && a >= b) {
    return a;
  } else if (b >= 0 && b >= a) {
    return b;
  }
}


x86 assembly (clang, -O0):
<max1>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
jb     1137 <max1+0x37>
xorps  %xmm0,%xmm0
ucomisd -0x18(%rbp),%xmm0
jb     1137 <max1+0x37>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    11a3 <max1+0xa3>
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     1168 <max1+0x68>
movsd  -0x10(%rbp),%xmm0
ucomisd -0x18(%rbp),%xmm0
jb     1168 <max1+0x68>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    11a3 <max1+0xa3>
movsd  -0x18(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     1199 <max1+0x99>
movsd  -0x18(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
jb     1199 <max1+0x99>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    11a3 <max1+0xa3>
jmp    119e <max1+0x9e>
jmp    11a3 <max1+0xa3>
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<max1>:
movapd %xmm1,%xmm2
cmpnlesd %xmm0,%xmm2
movapd %xmm2,%xmm3
andpd  %xmm1,%xmm3
andnpd %xmm0,%xmm2
orpd   %xmm3,%xmm2
xorpd  %xmm3,%xmm3
xorpd  %xmm4,%xmm4
cmpnlesd %xmm0,%xmm4
movapd %xmm4,%xmm5
andnpd %xmm2,%xmm5
andpd  %xmm1,%xmm4
orpd   %xmm5,%xmm4
cmplesd %xmm3,%xmm0
movapd %xmm0,%xmm2
andnpd %xmm4,%xmm2
cmplesd %xmm3,%xmm1
andnpd %xmm4,%xmm1
andpd  %xmm1,%xmm0
orpd   %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @max1(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %4
store double %1, double* %5
%6 = load double, double* %4
%7 = fcmp ole double %6, 0.000000e+00
br i1 %7, label %8, label %12
8: ; preds = %2
%9 = load double, double* %5
%10 = fcmp ole double %9, 0.000000e+00
br i1 %10, label %11, label %12
11: ; preds = %8
store double 0.000000e+00, double* %3
br label %32
12: ; preds = %8, %2
%13 = load double, double* %4
%14 = fcmp oge double %13, 0.000000e+00
br i1 %14, label %15, label %21
15: ; preds = %12
%16 = load double, double* %4
%17 = load double, double* %5
%18 = fcmp oge double %16, %17
br i1 %18, label %19, label %21
19: ; preds = %15
%20 = load double, double* %4
store double %20, double* %3
br label %32
21: ; preds = %15, %12
%22 = load double, double* %5
%23 = fcmp oge double %22, 0.000000e+00
br i1 %23, label %24, label %30
24: ; preds = %21
%25 = load double, double* %5
%26 = load double, double* %4
%27 = fcmp oge double %25, %26
br i1 %27, label %28, label %30
28: ; preds = %24
%29 = load double, double* %5
store double %29, double* %3
br label %32
30: ; preds = %24, %21
br label %31
31: ; preds = %30
br label %32
32: ; preds = %11, %19, %28, %31
%33 = load double, double* %3
ret double %33
}

LLVM IR (-O2):
define double @max1(double %0, double %1) {
%3 = fcmp ole double %0, 0.000000e+00
%4 = fcmp ole double %1, 0.000000e+00
%5 = and i1 %3, %4
%6 = fcmp ult double %0, 0.000000e+00
%7 = fcmp ult double %0, %1
%8 = or i1 %6, %7
%9 = select i1 %8, double %1, double %0
%10 = select i1 %5, double 0.000000e+00, double %9
ret double %10
}
void PRCMLoadSet(void) {
  (*((volatile unsigned long *)(0x60082000 + 0x00000028))) = 0x00000001;
}


x86 assembly (clang, -O0):
<PRCMLoadSet>:
push   %rbp
mov    %rsp,%rbp
mov    $0x60082028,%eax
movq   $0x1,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<PRCMLoadSet>:
movq   $0x1,0x60082028
ret

LLVM IR (-O0):
define void @PRCMLoadSet() {
store volatile i64 1, i64* inttoptr (i64 1611145256 to i64*)
ret void
}

LLVM IR (-O2):
define void @PRCMLoadSet() {
store volatile i64 1, i64* inttoptr (i64 1611145256 to i64*)
ret void
}
int l4x_l4syscall_get_nr(unsigned long error_code, unsigned long ip) {
  unsigned long val = ~ip;
  if (val < 8 || val > 40 || val % 4 != 3)
    return -1;
  return (val >> 2) - 2;
}


x86 assembly (clang, -O0):
<l4x_l4syscall_get_nr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rax
xor    $0xffffffffffffffff,%rax
mov    %rax,-0x20(%rbp)
cmpq   $0x8,-0x20(%rbp)
jb     1140 <l4x_l4syscall_get_nr+0x40>
cmpq   $0x28,-0x20(%rbp)
ja     1140 <l4x_l4syscall_get_nr+0x40>
mov    -0x20(%rbp),%rax
and    $0x3,%rax
cmp    $0x3,%rax
je     114c <l4x_l4syscall_get_nr+0x4c>
movl   $0xffffffff,-0x4(%rbp)
jmp    115b <l4x_l4syscall_get_nr+0x5b>
mov    -0x20(%rbp),%rax
shr    $0x2,%rax
sub    $0x2,%rax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<l4x_l4syscall_get_nr>:
mov    %rsi,%rax
not    %rax
lea    0x29(%rsi),%rcx
and    $0x3,%esi
shr    $0x2,%rax
add    $0xfffffffe,%eax
neg    %rsi
sbb    %edx,%edx
or     %eax,%edx
cmp    $0x21,%rcx
mov    $0xffffffff,%eax
cmovb  %edx,%eax
ret

LLVM IR (-O0):
define i32 @l4x_l4syscall_get_nr(i64 %0, i64 %1) {
%3 = alloca i32
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
%7 = load i64, i64* %5
%8 = xor i64 %7, -1
store i64 %8, i64* %6
%9 = load i64, i64* %6
%10 = icmp ult i64 %9, 8
br i1 %10, label %18, label %11
11: ; preds = %2
%12 = load i64, i64* %6
%13 = icmp ugt i64 %12, 40
br i1 %13, label %18, label %14
14: ; preds = %11
%15 = load i64, i64* %6
%16 = urem i64 %15, 4
%17 = icmp ne i64 %16, 3
br i1 %17, label %18, label %19
18: ; preds = %14, %11, %2
store i32 -1, i32* %3
br label %24
19: ; preds = %14
%20 = load i64, i64* %6
%21 = lshr i64 %20, 2
%22 = sub i64 %21, 2
%23 = trunc i64 %22 to i32
store i32 %23, i32* %3
br label %24
24: ; preds = %19, %18
%25 = load i32, i32* %3
ret i32 %25
}

LLVM IR (-O2):
define i32 @l4x_l4syscall_get_nr(i64 %0, i64 %1) {
%3 = xor i64 %1, -1
%4 = add i64 %1, 41
%5 = icmp ult i64 %4, 33
%6 = and i64 %3, 3
%7 = icmp eq i64 %6, 3
%8 = and i1 %5, %7
%9 = lshr i64 %3, 2
%10 = trunc i64 %9 to i32
%11 = add i32 %10, -2
%12 = select i1 %8, i32 %11, i32 -1
ret i32 %12
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int next_multprec_solution(int k) {
  int fail, *b;
  double *c;
  fail = _ada_use_c2phc4c(514, &k, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<next_multprec_solution>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    $0x202,%edi
lea    -0x4(%rbp),%rsi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<next_multprec_solution>:
push   %rax
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x202,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @next_multprec_solution(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32*
%5 = alloca double*
store i32 %0, i32* %2
%6 = load i32*, i32** %4
%7 = load double*, double** %5
%8 = call i32 @_ada_use_c2phc4c(i32 514, i32* %2, i32* %6, double* %7, i32 0)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @next_multprec_solution(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @_ada_use_c2phc4c(i32 514, i32* %2, i32* undef, double* undef, i32 0)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ drv_Sample_bang(int /*<<< orphan*/);
int /*<<< orphan*/ drv_generic_serial_write(char const *, unsigned int const);
void drv_Sample_send(const char *data, const unsigned int len) {
  unsigned int i;
  drv_generic_serial_write(data, len);
  for (i = 0; i < len; i++) {
    drv_Sample_bang(*data++);
  }
}


x86 assembly (clang, -O0):
<drv_Sample_send>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <drv_generic_serial_write@plt>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jae    1173 <drv_Sample_send+0x53>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
call   1030 <drv_Sample_bang@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1142 <drv_Sample_send+0x22>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<drv_Sample_send>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebp
mov    %rdi,%r14
call   1040 <drv_generic_serial_write@plt>
test   %ebp,%ebp
je     1152 <drv_Sample_send+0x32>
mov    %ebp,%ebp
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
movsbl (%r14,%rbx,1),%edi
call   1030 <drv_Sample_bang@plt>
add    $0x1,%rbx
cmp    %ebx,%ebp
jne    1140 <drv_Sample_send+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @drv_Sample_send(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = load i32, i32* %4
%8 = call i32 @drv_generic_serial_write(i8* %6, i32 %7)
store i32 0, i32* %5
br label %9
9: ; preds = %19, %2
%10 = load i32, i32* %5
%11 = load i32, i32* %4
%12 = icmp ult i32 %10, %11
br i1 %12, label %13, label %22
13: ; preds = %9
%14 = load i8*, i8** %3
%15 = getelementptr inbounds i8, i8* %14, i32 1
store i8* %15, i8** %3
%16 = load i8, i8* %14
%17 = sext i8 %16 to i32
%18 = call i32 @drv_Sample_bang(i32 %17)
br label %19
19: ; preds = %13
%20 = load i32, i32* %5
%21 = add i32 %20, 1
store i32 %21, i32* %5
br label %9
22: ; preds = %9
ret void
}

LLVM IR (-O2):
define void @drv_Sample_send(i8* %0, i32 %1) {
%3 = tail call i32 @drv_generic_serial_write(i8* %0, i32 %1)
%4 = icmp eq i32 %1, 0
br i1 %4, label %14, label %5
5: ; preds = %2, %5
%6 = phi i32 [ %12, %5 ], [ 0, %2 ]
%7 = phi i8* [ %8, %5 ], [ %0, %2 ]
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = load i8, i8* %7
%10 = sext i8 %9 to i32
%11 = tail call i32 @drv_Sample_bang(i32 %10)
%12 = add nuw i32 %6, 1
%13 = icmp eq i32 %12, %1
br i1 %13, label %14, label %5
14: ; preds = %5, %2
ret void
}
int hash_function(int key, int addresses_quantity) {
  return (key % addresses_quantity);
}


x86 assembly (clang, -O0):
<hash_function>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_function>:
mov    %edi,%eax
cltd
idiv   %esi
mov    %edx,%eax
ret

LLVM IR (-O0):
define i32 @hash_function(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 = srem i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @hash_function(i32 %0, i32 %1) {
%3 = srem i32 %0, %1
ret i32 %3
}
int minNum(int a, int b) { return a < b ? a : b; }


x86 assembly (clang, -O0):
<minNum>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1121 <minNum+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <minNum+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<minNum>:
mov    %esi,%eax
cmp    %esi,%edi
cmovl  %edi,%eax
ret

LLVM IR (-O0):
define i32 @minNum(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 = icmp slt i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %3
br label %12
10: ; preds = %2
%11 = load i32, i32* %4
br label %12
12: ; preds = %10, %8
%13 = phi i32 [ %9, %8 ], [ %11, %10 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @minNum(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ svga_writew_common(int /*<<< orphan*/, int /*<<< orphan*/,
                                      int /*<<< orphan*/, void *);
void svga_writew(uint32_t addr, uint16_t val, void *p) {
  svga_writew_common(addr, val, 0, p);
}


x86 assembly (clang, -O0):
<svga_writew>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%rcx
xor    %edx,%edx
call   1030 <svga_writew_common@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<svga_writew>:
mov    %rdx,%rcx
xor    %edx,%edx
jmp    1030 <svga_writew_common@plt>

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

LLVM IR (-O2):
define void @svga_writew(i32 %0, i32 %1, i8* %2) {
%4 = tail call i32 @svga_writew_common(i32 %0, i32 %1, i32 0, i8* %2)
ret void
}
/* Variables and functions */
char EOF;
char getchar();
int /*<<< orphan*/ printf(char *, char);
int main(int argc, char **argv) {
  char cEOF = 0;
  while (cEOF != EOF) {
    cEOF = getchar();
  }
  printf("EOF is %d\n", cEOF);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movb   $0x0,-0x11(%rbp)
movsbl -0x11(%rbp),%eax
mov    0x2ea3(%rip),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     115f <main+0x3f>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,-0x11(%rbp)
jmp    113a <main+0x1a>
lea    0xe9a(%rip),%rdi
movsbl -0x11(%rbp),%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    0x2ec0(%rip),%rbx
cmpb   $0x0,(%rbx)
je     113d <main+0x1d>
nopl   (%rax)
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    (%rbx),%al
jne    1130 <main+0x10>
jmp    113f <main+0x1f>
xor    %eax,%eax
movsbl %al,%esi
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@EOF = global i8 0
@.str = [11 x i8] c"EOF is %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = load i8, i8* @EOF
%4 = icmp eq i8 %3, 0
br i1 %4, label %9, label %5
5: ; preds = %2, %5
%6 = tail call signext i8 (...) @getchar()
%7 = load i8, i8* @EOF
%8 = icmp eq i8 %6, %7
br i1 %8, label %9, label %5
9: ; preds = %5, %2
%10 = phi i8 [ 0, %2 ], [ %6, %5 ]
%11 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8 signext %10)
ret i32 0
}
/* Type definitions */
struct stat {
  int st_size;
  int /*<<< orphan*/ member_0;
};

/* Variables and functions */
int /*<<< orphan*/ stat(char const *, struct stat *);
int fs_filesize(const char *restrict filename) {
  struct stat file_status = {0};
  stat(filename, &file_status);
  return file_status.st_size;
}


x86 assembly (clang, -O0):
<fs_filesize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x10(%rbp),%rdi
xor    %esi,%esi
mov    $0x8,%edx
call   1030 <memset@plt>
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <stat@plt>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fs_filesize>:
push   %rax
movq   $0x0,(%rsp)
mov    %rsp,%rsi
call   1030 <stat@plt>
mov    (%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32, i32 }
define i32 @fs_filesize(i8* noalias %0) {
%2 = alloca i8*
%3 = alloca %struct.stat
store i8* %0, i8** %2
%4 = bitcast %struct.stat* %3 to i8*
%5 = load i8*, i8** %2
%6 = call i32 @stat(i8* %5, %struct.stat* %3)
%7 = getelementptr inbounds %struct.stat, %struct.stat* %3, i32 0, i32 0
%8 = load i32, i32* %7
ret i32 %8
}

LLVM IR (-O2):
%struct.stat = type { i32, i32 }
define i32 @fs_filesize(i8* noalias nocapture %0) {
%2 = alloca i64
%3 = bitcast i64* %2 to %struct.stat*
%4 = bitcast i64* %2 to i8*
store i64 0, i64* %2
%5 = call i32 @stat(i8* %0, %struct.stat* %3)
%6 = bitcast i64* %2 to i32*
%7 = load i32, i32* %6
ret i32 %7
}
void swap(int *a, int *b) {
  int tmp;
  tmp = *a;
  *a = *b;
  *b = tmp;
}


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

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

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

LLVM IR (-O2):
define void @swap(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
store i32 %4, i32* %0
store i32 %3, i32* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ tosFilename_toUnix(char const *, char *, int);
void tosFilename_normalize(const char *pszFilename, char *pszSystemFilename,
                           int size) {
  tosFilename_toUnix(pszFilename, pszSystemFilename, size);
}


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

x86 assembly (clang, -O2):
<tosFilename_normalize>:
jmp    1030 <tosFilename_toUnix@plt>

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

LLVM IR (-O2):
define void @tosFilename_normalize(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @tosFilename_toUnix(i8* %0, i8* %1, i32 %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
scalar_t__ is_little_endian();
int /*<<< orphan*/ swap16(int /*<<< orphan*/);
uint16_t pgp_ntoh16(uint16_t in) {
  return (is_little_endian()) ? swap16(in) : in;
}


x86 assembly (clang, -O0):
<pgp_ntoh16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1040 <is_little_endian@plt>
cmp    $0x0,%rax
je     114c <pgp_ntoh16+0x2c>
mov    -0x4(%rbp),%edi
call   1030 <swap16@plt>
mov    %eax,-0x8(%rbp)
jmp    1152 <pgp_ntoh16+0x32>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pgp_ntoh16>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <is_little_endian@plt>
test   %rax,%rax
je     1137 <pgp_ntoh16+0x17>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <swap16@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @pgp_ntoh16(i32 %0) {
%2 = tail call i64 (...) @is_little_endian()
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @swap16(i32 %0)
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ %5, %4 ], [ %0, %1 ]
ret i32 %7
}
int main() {
  union {
    void *p0;
    struct {
      char c[2];
      void *p1;
      void *p2;
    } str;
  } data;
  data.p0 = malloc(37U);
  data.str.p2 = &data;
  free(data.p0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x25,%edi
call   1040 <malloc@plt>
mov    %rax,-0x20(%rbp)
lea    -0x20(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%union.anon = type { %struct.anon }
%struct.anon = type { [2 x i8], i8*, i8* }
define i32 @main() {
%1 = alloca i32
%2 = alloca %union.anon
store i32 0, i32* %1
%3 = call i8* @malloc(i64 37)
%4 = bitcast %union.anon* %2 to i8**
store i8* %3, i8** %4
%5 = bitcast %union.anon* %2 to i8*
%6 = bitcast %union.anon* %2 to %struct.anon*
%7 = getelementptr inbounds %struct.anon, %struct.anon* %6, i32 0, i32 2
store i8* %5, i8** %7
%8 = bitcast %union.anon* %2 to i8**
%9 = load i8*, i8** %8
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage() {
  printf("fft_mixed_radix_test -- test mixed-radix DFTs, compare to slow DFT "
         "method\n");
  printf("options (default values in []):\n");
  printf("  u/h   : print usage/help\n");
  printf("  p     : stride (freq)\n");
  printf("  q     : stride (time)\n");
}


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

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xf26(%rip),%rdi
call   1030 <puts@plt>
lea    0xf3a(%rip),%rdi
call   1030 <puts@plt>
lea    0xf49(%rip),%rdi
call   1030 <puts@plt>
lea    0xf55(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [75 x i8] c"fft_mixed_radix_test -- test mixed-radix DFTs, compare to slow DFT method\0A\00"
@.str.1 = [33 x i8] c"options (default values in []):\0A\00"
@.str.2 = [28 x i8] c" u/h : print usage/help\0A\00"
@.str.3 = [25 x i8] c" p : stride (freq)\0A\00"
@.str.4 = [25 x i8] c" q : stride (time)\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([75 x i8], [75 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.4, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [74 x i8] c"fft_mixed_radix_test -- test mixed-radix DFTs, compare to slow DFT method\00"
@str.5 = [32 x i8] c"options (default values in []):\00"
@str.6 = [27 x i8] c" u/h : print usage/help\00"
@str.7 = [24 x i8] c" p : stride (freq)\00"
@str.8 = [24 x i8] c" q : stride (time)\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([74 x i8], [74 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str.5, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str.6, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str.7, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str.8, i64 0, i64 0))
ret void
}
int omp_get_thread_num(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @omp_get_thread_num() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ FD_CLOEXEC;
int /*<<< orphan*/ F_SETFD;
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ error(char *);
scalar_t__ fcntl(int, int /*<<< orphan*/, int /*<<< orphan*/);
void fd_set_close_on_exec(int fd) {
  assert(fd >= 0);
  if (fcntl(fd, F_SETFD, FD_CLOEXEC) < 0)
    error("fcntl(F_SETFD) failed: %m");
  return;
}


x86 assembly (clang, -O0):
<fd_set_close_on_exec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
setge  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x4(%rbp),%edi
mov    0x2e8a(%rip),%rax
mov    (%rax),%esi
mov    0x2e79(%rip),%rax
mov    (%rax),%edx
call   1030 <fcntl@plt>
cmp    $0x0,%rax
jge    117c <fd_set_close_on_exec+0x4c>
lea    0xe89(%rip),%rdi
call   1050 <error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fd_set_close_on_exec>:
push   %rbx
mov    %edi,%ebx
not    %edi
shr    $0x1f,%edi
call   1040 <assert@plt>
mov    0x2e9c(%rip),%rax
mov    (%rax),%esi
mov    0x2e8b(%rip),%rax
mov    (%rax),%edx
mov    %ebx,%edi
call   1030 <fcntl@plt>
test   %rax,%rax
js     115d <fd_set_close_on_exec+0x2d>
pop    %rbx
ret
lea    0xe9c(%rip),%rdi
pop    %rbx
jmp    1050 <error@plt>

LLVM IR (-O0):
@F_SETFD = global i32 0
@FD_CLOEXEC = global i32 0
@.str = [26 x i8] c"fcntl(F_SETFD) failed: %m\00"
define void @fd_set_close_on_exec(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 0
%5 = zext i1 %4 to i32
%6 = call i32 @assert(i32 %5)
%7 = load i32, i32* %2
%8 = load i32, i32* @F_SETFD
%9 = load i32, i32* @FD_CLOEXEC
%10 = call i64 @fcntl(i32 %7, i32 %8, i32 %9)
%11 = icmp slt i64 %10, 0
br i1 %11, label %12, label %14
12: ; preds = %1
%13 = call i32 @error(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
br label %14
14: ; preds = %12, %1
ret void
}

LLVM IR (-O2):
@F_SETFD = global i32 0
@FD_CLOEXEC = global i32 0
@.str = [26 x i8] c"fcntl(F_SETFD) failed: %m\00"
define void @fd_set_close_on_exec(i32 %0) {
%2 = xor i32 %0, -1
%3 = lshr i32 %2, 31
%4 = tail call i32 @assert(i32 %3)
%5 = load i32, i32* @F_SETFD
%6 = load i32, i32* @FD_CLOEXEC
%7 = tail call i64 @fcntl(i32 %0, i32 %5, i32 %6)
%8 = icmp slt i64 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = tail call i32 @error(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %9, %1
ret void
}
/* Variables and functions */
unsigned int f38(unsigned int);
unsigned int f39(unsigned int a) { return f38(f38(a)); }


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

x86 assembly (clang, -O2):
<f39>:
push   %rax
call   1030 <f38@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <f38@plt>

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

LLVM IR (-O2):
define i32 @f39(i32 %0) {
%2 = tail call i32 @f38(i32 %0)
%3 = tail call i32 @f38(i32 %2)
ret i32 %3
}
/* Variables and functions */
unsigned int I2CReadReg16(int, unsigned char, int);
float ad7410GetTemp(int fd, unsigned char i2cAddress) {
  unsigned int readData = 0;
  float temperature;
  readData = I2CReadReg16(fd, i2cAddress, 0x00);
  temperature = readData * 0.0078f;
  return temperature;
}


x86 assembly (clang, -O0):
<ad7410GetTemp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %edi,-0x4(%rbp)
mov    %al,-0x5(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x4(%rbp),%edi
movzbl -0x5(%rbp),%esi
xor    %edx,%edx
call   1030 <I2CReadReg16@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cvtsi2ss %rax,%xmm0
movss  0xeb7(%rip),%xmm1
mulss  %xmm1,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ad7410GetTemp>:
push   %rax
xor    %edx,%edx
call   1030 <I2CReadReg16@plt>
mov    %eax,%eax
cvtsi2ss %rax,%xmm0
mulss  0xed9(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @ad7410GetTemp(i32 %0, i8 zeroext %1) {
%3 = alloca i32
%4 = alloca i8
%5 = alloca i32
%6 = alloca float
store i32 %0, i32* %3
store i8 %1, i8* %4
store i32 0, i32* %5
%7 = load i32, i32* %3
%8 = load i8, i8* %4
%9 = call i32 @I2CReadReg16(i32 %7, i8 zeroext %8, i32 0)
store i32 %9, i32* %5
%10 = load i32, i32* %5
%11 = uitofp i32 %10 to float
%12 = fmul float %11, 0x3F7FF2E480000000
store float %12, float* %6
%13 = load float, float* %6
ret float %13
}

LLVM IR (-O2):
define float @ad7410GetTemp(i32 %0, i8 zeroext %1) {
%3 = tail call i32 @I2CReadReg16(i32 %0, i8 zeroext %1, i32 0)
%4 = uitofp i32 %3 to float
%5 = fmul float %4, 0x3F7FF2E480000000
ret float %5
}
void B(float *d, float *s) {
  d[0] = s[0];
  d[1] = s[1];
  d[2] = s[2];
}


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

x86 assembly (clang, -O2):
<B>:
movss  (%rsi),%xmm0
movss  %xmm0,(%rdi)
movss  0x4(%rsi),%xmm0
movss  %xmm0,0x4(%rdi)
movss  0x8(%rsi),%xmm0
movss  %xmm0,0x8(%rdi)
ret

LLVM IR (-O0):
define void @B(float* %0, float* %1) {
%3 = alloca float*
%4 = alloca float*
store float* %0, float** %3
store float* %1, float** %4
%5 = load float*, float** %4
%6 = getelementptr inbounds float, float* %5, i64 0
%7 = load float, float* %6
%8 = load float*, float** %3
%9 = getelementptr inbounds float, float* %8, i64 0
store float %7, float* %9
%10 = load float*, float** %4
%11 = getelementptr inbounds float, float* %10, i64 1
%12 = load float, float* %11
%13 = load float*, float** %3
%14 = getelementptr inbounds float, float* %13, i64 1
store float %12, float* %14
%15 = load float*, float** %4
%16 = getelementptr inbounds float, float* %15, i64 2
%17 = load float, float* %16
%18 = load float*, float** %3
%19 = getelementptr inbounds float, float* %18, i64 2
store float %17, float* %19
ret void
}

LLVM IR (-O2):
define void @B(float* nocapture writeonly %0, float* nocapture %1) {
%3 = load float, float* %1
store float %3, float* %0
%4 = getelementptr inbounds float, float* %1, i64 1
%5 = load float, float* %4
%6 = getelementptr inbounds float, float* %0, i64 1
store float %5, float* %6
%7 = getelementptr inbounds float, float* %1, i64 2
%8 = load float, float* %7
%9 = getelementptr inbounds float, float* %0, i64 2
store float %8, float* %9
ret void
}
double sinh(double x) {
  puts("# ");
  puts(__FUNCTION__);
  puts("()\n");
  delay(100000000);
  (void)(x);
  return 0;
}


x86 assembly (clang, -O0):
<sinh>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
lea    0xecc(%rip),%rdi
mov    $0x0,%al
call   1030 <puts@plt>
lea    0xec1(%rip),%rdi
mov    $0x0,%al
call   1030 <puts@plt>
lea    0xeb8(%rip),%rdi
mov    $0x0,%al
call   1030 <puts@plt>
mov    $0x5f5e100,%edi
mov    $0x0,%al
call   1040 <delay@plt>
xorps  %xmm0,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sinh>:
push   %rax
lea    0xed8(%rip),%rdi
xor    %eax,%eax
call   1030 <puts@plt>
lea    0xecd(%rip),%rdi
xor    %eax,%eax
call   1030 <puts@plt>
lea    0xec4(%rip),%rdi
xor    %eax,%eax
call   1030 <puts@plt>
mov    $0x5f5e100,%edi
xor    %eax,%eax
call   1040 <delay@plt>
xorps  %xmm0,%xmm0
pop    %rax
ret

LLVM IR (-O0):
@.str = [3 x i8] c"# \00"
@__FUNCTION__.sinh = [5 x i8] c"sinh\00"
@.str.1 = [4 x i8] c"()\0A\00"
define double @sinh(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%4 = call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @__FUNCTION__.sinh, i64 0, i64 0))
%5 = call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 (i32, ...) bitcast (i32 (...)* @delay to i32 (i32, ...)*)(i32 100000000)
%7 = load double, double* %2
ret double 0.000000e+00
}

LLVM IR (-O2):
@.str = [3 x i8] c"# \00"
@__FUNCTION__.sinh = [5 x i8] c"sinh\00"
@.str.1 = [4 x i8] c"()\0A\00"
define double @sinh(double %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @__FUNCTION__.sinh, i64 0, i64 0))
%4 = tail call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 (i32, ...) bitcast (i32 (...)* @delay to i32 (i32, ...)*)(i32 100000000)
ret double 0.000000e+00
}
/* Variables and functions */
int /*<<< orphan*/ WriteFormatted(char *, int, ...);
int main() {
  WriteFormatted("Call with %d variable argument.\n", 1);
  WriteFormatted("Call with %d variable %s.\n", 2, "arguments");
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1030 <WriteFormatted@plt>
lea    0xef6(%rip),%rdi
lea    0xf0a(%rip),%rdx
mov    $0x2,%esi
xor    %eax,%eax
call   1030 <WriteFormatted@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [33 x i8] c"Call with %d variable argument.\0A\00"
@.str.1 = [27 x i8] c"Call with %d variable %s.\0A\00"
@.str.2 = [10 x i8] c"arguments\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (i8*, i32, ...) @WriteFormatted(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 1)
%3 = call i32 (i8*, i32, ...) @WriteFormatted(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i32 2, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [33 x i8] c"Call with %d variable argument.\0A\00"
@.str.1 = [27 x i8] c"Call with %d variable %s.\0A\00"
@.str.2 = [10 x i8] c"arguments\00"
define i32 @main() {
%1 = tail call i32 (i8*, i32, ...) @WriteFormatted(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 1)
%2 = tail call i32 (i8*, i32, ...) @WriteFormatted(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i32 2, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int main(int argc, char **argv) {
  bool a = true;
  bool b = false;
  bool c = a & b;
  bool d = a | b;
  bool e = a ^ b;
  bool f = a && b;
  bool g = a || b;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x14(%rbp),%eax
and    -0x18(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x14(%rbp),%eax
or     -0x18(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x14(%rbp),%eax
xor    -0x18(%rbp),%eax
mov    %eax,-0x24(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x14(%rbp)
mov    %al,-0x2d(%rbp)
je     1154 <main+0x54>
cmpl   $0x0,-0x18(%rbp)
setne  %al
mov    %al,-0x2d(%rbp)
mov    -0x2d(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x28(%rbp)
mov    $0x1,%al
cmpl   $0x0,-0x14(%rbp)
mov    %al,-0x2e(%rbp)
jne    1178 <main+0x78>
cmpl   $0x0,-0x18(%rbp)
setne  %al
mov    %al,-0x2e(%rbp)
mov    -0x2e(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x2c(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 1, i32* %6
store i32 0, i32* %7
%13 = load i32, i32* %6
%14 = load i32, i32* %7
%15 = and i32 %13, %14
store i32 %15, i32* %8
%16 = load i32, i32* %6
%17 = load i32, i32* %7
%18 = or i32 %16, %17
store i32 %18, i32* %9
%19 = load i32, i32* %6
%20 = load i32, i32* %7
%21 = xor i32 %19, %20
store i32 %21, i32* %10
%22 = load i32, i32* %6
%23 = icmp ne i32 %22, 0
br i1 %23, label %24, label %27
24: ; preds = %2
%25 = load i32, i32* %7
%26 = icmp ne i32 %25, 0
br label %27
27: ; preds = %24, %2
%28 = phi i1 [ false, %2 ], [ %26, %24 ]
%29 = zext i1 %28 to i32
store i32 %29, i32* %11
%30 = load i32, i32* %6
%31 = icmp ne i32 %30, 0
br i1 %31, label %35, label %32
32: ; preds = %27
%33 = load i32, i32* %7
%34 = icmp ne i32 %33, 0
br label %35
35: ; preds = %32, %27
%36 = phi i1 [ true, %27 ], [ %34, %32 ]
%37 = zext i1 %36 to i32
store i32 %37, i32* %12
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
double sqrt(int);
double EDDatan(double x) { return (x / sqrt(1. + x * x) / (1. - x * x)); }


x86 assembly (clang, -O0):
<EDDatan>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xec3(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1030 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
divsd  %xmm1,%xmm0
movsd  -0x8(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm2
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm1
movsd  0xe7d(%rip),%xmm2
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<EDDatan>:
sub    $0x18,%rsp
movsd  %xmm0,0x10(%rsp)
mulsd  %xmm0,%xmm0
movsd  %xmm0,0x8(%rsp)
addsd  0xed4(%rip),%xmm0
cvttsd2si %xmm0,%edi
call   1030 <sqrt@plt>
movsd  0x10(%rsp),%xmm1
divsd  %xmm0,%xmm1
movsd  0xeb9(%rip),%xmm0
subsd  0x8(%rsp),%xmm0
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @EDDatan(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = load double, double* %2
%6 = call double @llvm.fmuladd.f64(double %4, double %5, double 1.000000e+00)
%7 = fptosi double %6 to i32
%8 = call double @sqrt(i32 %7)
%9 = fdiv double %3, %8
%10 = load double, double* %2
%11 = load double, double* %2
%12 = fneg double %10
%13 = call double @llvm.fmuladd.f64(double %12, double %11, double 1.000000e+00)
%14 = fdiv double %9, %13
ret double %14
}

LLVM IR (-O2):
define double @EDDatan(double %0) {
%2 = tail call double @llvm.fmuladd.f64(double %0, double %0, double 1.000000e+00)
%3 = fptosi double %2 to i32
%4 = tail call double @sqrt(i32 %3)
%5 = fdiv double %0, %4
%6 = fneg double %0
%7 = tail call double @llvm.fmuladd.f64(double %6, double %0, double 1.000000e+00)
%8 = fdiv double %5, %7
ret double %8
}
/* Variables and functions */
bool test_shaman_owm(void) { return 1; }


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

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

LLVM IR (-O0):
define i32 @test_shaman_owm() {
ret i32 1
}

LLVM IR (-O2):
define i32 @test_shaman_owm() {
ret i32 1
}
__attribute__((__weak__)) void uart_txChar(int ch) { (void)ch; }


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

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

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

LLVM IR (-O2):
define weak void @uart_txChar(i32 %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
float word32ToFloat(uint32_t input) {
  union {
    float f;
    uint32_t l;
  } u;
  u.l = input;
  return u.f;
}


x86 assembly (clang, -O0):
<word32ToFloat>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<word32ToFloat>:
movd   %edi,%xmm0
ret

LLVM IR (-O0):
%union.anon = type { float }
define float @word32ToFloat(i32 %0) {
%2 = alloca i32
%3 = alloca %union.anon
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = bitcast %union.anon* %3 to i32*
store i32 %4, i32* %5
%6 = bitcast %union.anon* %3 to float*
%7 = load float, float* %6
ret float %7
}

LLVM IR (-O2):
define float @word32ToFloat(i32 %0) {
%2 = bitcast i32 %0 to float
ret float %2
}
/* Variables and functions */
int /*<<< orphan*/ bic(int, int);
int bis(int /*<<< orphan*/, int /*<<< orphan*/);
int bool_xor(int x, int y) {
  int result = bis(bic(y, x), bic(x, y));
  return result;
}


x86 assembly (clang, -O0):
<bool_xor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x4(%rbp),%esi
call   1030 <bic@plt>
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <bic@plt>
mov    -0x10(%rbp),%edi
mov    %eax,%esi
call   1040 <bis@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bool_xor>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebx
mov    %edi,%ebp
mov    %esi,%edi
mov    %ebp,%esi
call   1030 <bic@plt>
mov    %eax,%r14d
mov    %ebp,%edi
mov    %ebx,%esi
call   1030 <bic@plt>
mov    %r14d,%edi
mov    %eax,%esi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <bis@plt>

LLVM IR (-O0):
define i32 @bool_xor(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = load i32, i32* %3
%8 = call i32 @bic(i32 %6, i32 %7)
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = call i32 @bic(i32 %9, i32 %10)
%12 = call i32 @bis(i32 %8, i32 %11)
store i32 %12, i32* %5
%13 = load i32, i32* %5
ret i32 %13
}

LLVM IR (-O2):
define i32 @bool_xor(i32 %0, i32 %1) {
%3 = tail call i32 @bic(i32 %1, i32 %0)
%4 = tail call i32 @bic(i32 %0, i32 %1)
%5 = tail call i32 @bis(i32 %3, i32 %4)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ db(int);
void rdpmc() {
  db(0x0F);
  db(0x33);
}


x86 assembly (clang, -O0):
<rdpmc>:
push   %rbp
mov    %rsp,%rbp
mov    $0xf,%edi
call   1030 <db@plt>
mov    $0x33,%edi
call   1030 <db@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<rdpmc>:
push   %rax
mov    $0xf,%edi
call   1030 <db@plt>
mov    $0x33,%edi
pop    %rax
jmp    1030 <db@plt>

LLVM IR (-O0):
define void @rdpmc() {
%1 = call i32 @db(i32 15)
%2 = call i32 @db(i32 51)
ret void
}

LLVM IR (-O2):
define void @rdpmc() {
%1 = tail call i32 @db(i32 15)
%2 = tail call i32 @db(i32 51)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ INT_MAX;
char *readFile_sub(char const *, char const *, int /*<<< orphan*/,
                   int /*<<< orphan*/);
char *readFile(const char *prefix, const char *suffix) {
  return readFile_sub(prefix, suffix, 0, INT_MAX);
}


x86 assembly (clang, -O0):
<readFile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    0x2eb9(%rip),%rax
mov    (%rax),%ecx
xor    %edx,%edx
call   1030 <readFile_sub@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readFile>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%ecx
xor    %edx,%edx
jmp    1030 <readFile_sub@plt>

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

LLVM IR (-O2):
@INT_MAX = global i32 0
define i8* @readFile(i8* %0, i8* %1) {
%3 = load i32, i32* @INT_MAX
%4 = tail call i8* @readFile_sub(i8* %0, i8* %1, i32 0, i32 %3)
ret i8* %4
}