xunge/DecIR huggingface dataset:
/* Variables and functions */
double exp(double);
double hermite_gauss_ptr(double x) { return 3.0 * x * x * exp(-1.1 * x * x); }


x86 assembly (clang, -O0):
<hermite_gauss_ptr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xee3(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xec4(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
call   1030 <exp@plt>
movaps %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
mulsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hermite_gauss_ptr>:
push   %rax
movsd  0xee7(%rip),%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,(%rsp)
movsd  0xeda(%rip),%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm1,%xmm0
call   1030 <exp@plt>
mulsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @hermite_gauss_ptr(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double 3.000000e+00, %3
%5 = load double, double* %2
%6 = fmul double %4, %5
%7 = load double, double* %2
%8 = fmul double -1.100000e+00, %7
%9 = load double, double* %2
%10 = fmul double %8, %9
%11 = call double @exp(double %10)
%12 = fmul double %6, %11
ret double %12
}

LLVM IR (-O2):
define double @hermite_gauss_ptr(double %0) {
%2 = fmul double %0, 3.000000e+00
%3 = fmul double %2, %0
%4 = fmul double %0, -1.100000e+00
%5 = fmul double %4, %0
%6 = tail call double @exp(double %5)
%7 = fmul double %3, %6
ret double %7
}
void swap_cards(int size, int deck[size], int a, int b) {
  int tmp = deck[a];
  deck[a] = deck[b];
  deck[b] = tmp;
}


x86 assembly (clang, -O0):
<swap_cards>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x1c(%rbp),%edx
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap_cards>:
movslq %edx,%rax
mov    (%rsi,%rax,4),%edx
movslq %ecx,%rcx
mov    (%rsi,%rcx,4),%edi
mov    %edi,(%rsi,%rax,4)
mov    %edx,(%rsi,%rcx,4)
ret

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

LLVM IR (-O2):
define void @swap_cards(i32 %0, i32* nocapture %1, i32 %2, i32 %3) {
%5 = sext i32 %2 to i64
%6 = getelementptr inbounds i32, i32* %1, i64 %5
%7 = load i32, i32* %6
%8 = sext i32 %3 to i64
%9 = getelementptr inbounds i32, i32* %1, i64 %8
%10 = load i32, i32* %9
store i32 %10, i32* %6
store i32 %7, i32* %9
ret void
}
int fib(int m) {
  int a, b, c;
  a = 0;
  b = 1;
  c = a + b;
  while (c < m) {
    a = b;
    b = c;
    c = a + b;
  }
  return b;
}


x86 assembly (clang, -O0):
<fib>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1144 <fib+0x44>
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    111e <fib+0x1e>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fib>:
mov    $0x1,%edx
mov    $0x1,%ecx
nopw   0x0(%rax,%rax,1)
mov    %edx,%eax
mov    %ecx,%edx
lea    (%rcx,%rax,1),%esi
cmp    %edi,%ecx
mov    %esi,%ecx
jl     1110 <fib+0x10>
ret

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

LLVM IR (-O2):
define i32 @fib(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ 1, %1 ], [ %4, %2 ]
%4 = phi i32 [ 1, %1 ], [ %6, %2 ]
%5 = icmp slt i32 %4, %0
%6 = add nsw i32 %4, %3
br i1 %5, label %2, label %7
7: ; preds = %2
ret i32 %3
}
/* Variables and functions */
unsigned int abs(int);
unsigned int hexMagnitude(signed int x, signed int y) {
  if ((x ^ y) < 0)
    return abs(x) > abs(y) ? abs(x) : abs(y);
  else
    return abs(x + y);
}


x86 assembly (clang, -O0):
<hexMagnitude>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
xor    -0xc(%rbp),%eax
cmp    $0x0,%eax
jge    1173 <hexMagnitude+0x63>
mov    -0x8(%rbp),%edi
call   1030 <abs@plt>
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <abs@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
cmp    %ecx,%eax
jbe    115d <hexMagnitude+0x4d>
mov    -0x8(%rbp),%edi
call   1030 <abs@plt>
mov    %eax,-0x14(%rbp)
jmp    1168 <hexMagnitude+0x58>
mov    -0xc(%rbp),%edi
call   1030 <abs@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1181 <hexMagnitude+0x71>
mov    -0x8(%rbp),%edi
add    -0xc(%rbp),%edi
call   1030 <abs@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hexMagnitude>:
mov    %esi,%eax
xor    %edi,%eax
js     1110 <hexMagnitude+0x10>
add    %edi,%esi
mov    %esi,%eax
neg    %eax
cmovs  %esi,%eax
ret
mov    %edi,%ecx
neg    %ecx
cmovs  %edi,%ecx
mov    %esi,%eax
neg    %eax
cmovs  %esi,%eax
cmp    %eax,%ecx
cmova  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @hexMagnitude(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %4
%7 = load i32, i32* %5
%8 = xor i32 %6, %7
%9 = icmp slt i32 %8, 0
br i1 %9, label %10, label %24
10: ; preds = %2
%11 = load i32, i32* %4
%12 = call i32 @abs(i32 %11)
%13 = load i32, i32* %5
%14 = call i32 @abs(i32 %13)
%15 = icmp ugt i32 %12, %14
br i1 %15, label %16, label %19
16: ; preds = %10
%17 = load i32, i32* %4
%18 = call i32 @abs(i32 %17)
br label %22
19: ; preds = %10
%20 = load i32, i32* %5
%21 = call i32 @abs(i32 %20)
br label %22
22: ; preds = %19, %16
%23 = phi i32 [ %18, %16 ], [ %21, %19 ]
store i32 %23, i32* %3
br label %29
24: ; preds = %2
%25 = load i32, i32* %4
%26 = load i32, i32* %5
%27 = add nsw i32 %25, %26
%28 = call i32 @abs(i32 %27)
store i32 %28, i32* %3
br label %29
29: ; preds = %24, %22
%30 = load i32, i32* %3
ret i32 %30
}

LLVM IR (-O2):
define i32 @hexMagnitude(i32 %0, i32 %1) {
%3 = xor i32 %1, %0
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %10
5: ; preds = %2
%6 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
%7 = tail call i32 @llvm.abs.i32(i32 %1, i1 true)
%8 = icmp ugt i32 %6, %7
%9 = select i1 %8, i32 %6, i32 %7
br label %13
10: ; preds = %2
%11 = add nsw i32 %1, %0
%12 = tail call i32 @llvm.abs.i32(i32 %11, i1 true)
br label %13
13: ; preds = %10, %5
%14 = phi i32 [ %9, %5 ], [ %12, %10 ]
ret i32 %14
}
/* Type definitions */
typedef int /*<<< orphan*/ __u8;

/* Variables and functions */
int /*<<< orphan*/ _exit(int /*<<< orphan*/);
int /*<<< orphan*/ abort();
int __bail(int for_realz, bool no_print, __u8 step) {
  if (for_realz) {
    if (no_print)
      _exit(step);
    abort();
  }
  return 0;
}


x86 assembly (clang, -O0):
<__bail>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1154 <__bail+0x34>
cmpl   $0x0,-0x8(%rbp)
je     114d <__bail+0x2d>
mov    -0xc(%rbp),%edi
call   1040 <_exit@plt>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__bail>:
push   %rax
test   %edi,%edi
jne    1129 <__bail+0x9>
xor    %eax,%eax
pop    %rcx
ret
test   %esi,%esi
jne    1134 <__bail+0x14>
xor    %eax,%eax
call   1030 <abort@plt>
mov    %edx,%edi
call   1040 <_exit@plt>

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

LLVM IR (-O2):
define i32 @__bail(i32 %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %0, 0
br i1 %4, label %11, label %5
5: ; preds = %3
%6 = icmp eq i32 %1, 0
br i1 %6, label %9, label %7
7: ; preds = %5
%8 = tail call i32 @_exit(i32 %2)
unreachable
9: ; preds = %5
%10 = tail call i32 (...) @abort()
unreachable
11: ; preds = %3
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ ft_putstr(char *);
void ft_error(char *str) {
  ft_putstr(str);
  exit(0);
}


x86 assembly (clang, -O0):
<ft_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <ft_putstr@plt>
xor    %edi,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
define void @ft_error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @ft_putstr(i8* %3)
%5 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @ft_error(i8* %0) {
%2 = tail call i32 @ft_putstr(i8* %0)
%3 = tail call i32 @exit(i32 0)
unreachable
}
void tegra_mc_timing_restore(void) {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @g_atomic_int_compare_and_exchange() {
ret void
}
/* Variables and functions */
size_t ft_strnlen(const char *s, size_t n) {
  size_t len;
  len = 0;
  while (s[len] != '\0' && len < n)
    len++;
  return (len);
}


x86 assembly (clang, -O0):
<ft_strnlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x19(%rbp)
je     113c <ft_strnlen+0x3c>
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
setb   %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    114c <ft_strnlen+0x4c>
jmp    115d <ft_strnlen+0x5d>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1114 <ft_strnlen+0x14>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_strnlen>:
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
lea    0x1(%rcx),%rax
cmpb   $0x0,(%rdi,%rcx,1)
je     1122 <ft_strnlen+0x22>
cmp    %rsi,%rcx
mov    %rax,%rcx
jb     1110 <ft_strnlen+0x10>
add    $0xffffffffffffffff,%rax
ret

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

LLVM IR (-O2):
define i64 @ft_strnlen(i8* nocapture %0, i64 %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i64 [ 0, %2 ], [ %10, %3 ]
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = icmp ne i8 %6, 0
%8 = icmp ult i64 %4, %1
%9 = select i1 %7, i1 %8, i1 false
%10 = add nuw i64 %4, 1
br i1 %9, label %3, label %11
11: ; preds = %3
ret i64 %4
}
int reset_release_all(struct reset_ctl *reset_ctl, int count) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.reset_ctl = type opaque
define i32 @reset_release_all(%struct.reset_ctl* nocapture readnone %0, i32 %1) {
ret i32 0
}
int test_imm_B8uint8_mem(unsigned char *val) {
  return ((*val) & (-0xB8 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_B8uint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 72
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ __udivmodsi4(int /*<<< orphan*/, int /*<<< orphan*/,
                                int /*<<< orphan*/ *);
uint32_t __udivsi3(uint32_t num, uint32_t den) {
  return __udivmodsi4(num, den, NULL);
}


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

x86 assembly (clang, -O2):
<__udivsi3>:
xor    %edx,%edx
jmp    1030 <__udivmodsi4@plt>

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

LLVM IR (-O2):
define i32 @__udivsi3(i32 %0, i32 %1) {
%3 = tail call i32 @__udivmodsi4(i32 %0, i32 %1, i32* null)
ret i32 %3
}
/* Type definitions */
struct timeval {
  scalar_t__ tv_usec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
double timeval_to_double(const struct timeval *const tv) {
  return (double)tv->tv_sec + ((double)tv->tv_usec / 1000000.0);
}


x86 assembly (clang, -O0):
<timeval_to_double>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cvtsi2sdq 0x8(%rax),%xmm0
mov    -0x8(%rbp),%rax
cvtsi2sdq (%rax),%xmm1
movsd  0xedd(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<timeval_to_double>:
cvtsi2sdq 0x8(%rdi),%xmm1
cvtsi2sdq (%rdi),%xmm0
divsd  0xeed(%rip),%xmm0
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define double @timeval_to_double(%struct.timeval* %0) {
%2 = alloca %struct.timeval*
store %struct.timeval* %0, %struct.timeval** %2
%3 = load %struct.timeval*, %struct.timeval** %2
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 1
%5 = load i64, i64* %4
%6 = sitofp i64 %5 to double
%7 = load %struct.timeval*, %struct.timeval** %2
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %7, i32 0, i32 0
%9 = load i64, i64* %8
%10 = sitofp i64 %9 to double
%11 = fdiv double %10, 1.000000e+06
%12 = fadd double %6, %11
ret double %12
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
define double @timeval_to_double(%struct.timeval* nocapture %0) {
%2 = getelementptr inbounds %struct.timeval, %struct.timeval* %0, i64 0, i32 1
%3 = load i64, i64* %2
%4 = sitofp i64 %3 to double
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %0, i64 0, i32 0
%6 = load i64, i64* %5
%7 = sitofp i64 %6 to double
%8 = fdiv double %7, 1.000000e+06
%9 = fadd double %8, %4
ret double %9
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int);
void sprint_pop(char *str, uint8_t direct) {
  sprintf(str,
          "POP   "
          "0x%02X"
          "                      ",
          direct);
}


x86 assembly (clang, -O0):
<sprint_pop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
lea    0xed3(%rip),%rsi
call   1030 <sprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sprint_pop>:
mov    %esi,%edx
lea    0xee7(%rip),%rsi
jmp    1030 <sprintf@plt>

LLVM IR (-O0):
@.str = [35 x i8] c"POP 0x%02X \00"
define void @sprint_pop(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = call i32 @sprintf(i8* %5, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [35 x i8] c"POP 0x%02X \00"
define void @sprint_pop(i8* nocapture writeonly %0, i32 %1) {
%3 = tail call i32 @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
void f(int *p) { (int __attribute__((vector_size(16))) *)p; }


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

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

LLVM IR (-O0):
define void @f(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = bitcast i32* %3 to <4 x i32>*
ret void
}

LLVM IR (-O2):
define void @f(i32* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, unsigned char *, int);
void writeChar(unsigned char value, char *out) { memcpy(out, &value, 1); }


x86 assembly (clang, -O0):
<writeChar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x1(%rbp),%rsi
mov    $0x1,%edx
call   1030 <memcpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<writeChar>:
push   %rax
mov    %rsi,%rax
mov    %dil,0x7(%rsp)
lea    0x7(%rsp),%rsi
mov    %rax,%rdi
mov    $0x1,%edx
call   1030 <memcpy@plt>
pop    %rax
ret

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

LLVM IR (-O2):
define void @writeChar(i8 zeroext %0, i8* %1) {
%3 = alloca i8
store i8 %0, i8* %3
%4 = call i32 @memcpy(i8* %1, i8* %3, i32 1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
pid_t vfork(void) {
  assert(0);
  return 0;
}


x86 assembly (clang, -O0):
<vfork>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <assert@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<vfork>:
push   %rax
xor    %edi,%edi
call   1030 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @vfork() {
%1 = call i32 @assert(i32 0)
ret i32 0
}

LLVM IR (-O2):
define i32 @vfork() {
%1 = tail call i32 @assert(i32 0)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutex_t;

/* Variables and functions */
int pthread_mutex_trylock(int /*<<< orphan*/ *);
int __attribute__((unused)) ___pthread_mutex_try_lock(pthread_mutex_t *mutex) {
  return pthread_mutex_trylock(mutex);
}


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

x86 assembly (clang, -O2):
<___pthread_mutex_try_lock>:
jmp    1030 <pthread_mutex_trylock@plt>

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

LLVM IR (-O2):
define i32 @___pthread_mutex_try_lock(i32* %0) {
%2 = tail call i32 @pthread_mutex_trylock(i32* %0)
ret i32 %2
}
char *dlerror(void) { return ("ok"); }


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"ok\00"
define i8* @dlerror() {
ret i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0)
}
/* Type definitions */
typedef scalar_t__ clock_t;

/* Variables and functions */
double CLOCKS_PER_SEC;
scalar_t__ clock();
delay_s(double seconds) {
  clock_t end = clock() + (seconds * CLOCKS_PER_SEC);
  while (clock() < end) {
    ;
  }
}


x86 assembly (clang, -O0):
<delay_s>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x10(%rbp)
mov    $0x0,%al
call   1030 <clock@plt>
cvtsi2sd %rax,%xmm1
movsd  -0x10(%rbp),%xmm0
mov    0x2eb3(%rip),%rax
movsd  (%rax),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%rax
mov    %rax,-0x18(%rbp)
mov    $0x0,%al
call   1030 <clock@plt>
cmp    -0x18(%rbp),%rax
jge    1160 <delay_s+0x50>
jmp    114a <delay_s+0x3a>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<delay_s>:
push   %rbx
sub    $0x10,%rsp
movsd  %xmm0,0x8(%rsp)
xor    %eax,%eax
call   1030 <clock@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
mov    0x2eb7(%rip),%rax
movsd  0x8(%rsp),%xmm1
mulsd  (%rax),%xmm1
addsd  %xmm0,%xmm1
cvttsd2si %xmm1,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
xor    %eax,%eax
call   1030 <clock@plt>
cmp    %rbx,%rax
jl     1150 <delay_s+0x40>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@CLOCKS_PER_SEC = global double 0.000000e+00
define i32 @delay_s(double %0) {
%2 = alloca i32
%3 = alloca double
%4 = alloca i64
store double %0, double* %3
%5 = call i64 (...) @clock()
%6 = sitofp i64 %5 to double
%7 = load double, double* %3
%8 = load double, double* @CLOCKS_PER_SEC
%9 = call double @llvm.fmuladd.f64(double %7, double %8, double %6)
%10 = fptosi double %9 to i64
store i64 %10, i64* %4
br label %11
11: ; preds = %15, %1
%12 = call i64 (...) @clock()
%13 = load i64, i64* %4
%14 = icmp slt i64 %12, %13
br i1 %14, label %15, label %16
15: ; preds = %11
br label %11
16: ; preds = %11
%17 = load i32, i32* %2
ret i32 %17
}

LLVM IR (-O2):
@CLOCKS_PER_SEC = global double 0.000000e+00
define i32 @delay_s(double %0) {
%2 = tail call i64 (...) @clock()
%3 = sitofp i64 %2 to double
%4 = load double, double* @CLOCKS_PER_SEC
%5 = tail call double @llvm.fmuladd.f64(double %0, double %4, double %3)
%6 = fptosi double %5 to i64
br label %7
7: ; preds = %7, %1
%8 = tail call i64 (...) @clock()
%9 = icmp slt i64 %8, %6
br i1 %9, label %7, label %10
10: ; preds = %7
ret i32 undef
}
void av_find_best_stream() {}


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

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

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

LLVM IR (-O2):
define void @av_find_best_stream() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, int);
void printButton(char *value, int cmd) {
  printf("<input type='submit' value='%s' onclick='SysCommand(%d);' />\n",
         value, cmd);
}


x86 assembly (clang, -O0):
<printButton>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printButton>:
mov    %esi,%edx
mov    %rdi,%rsi
lea    0xee4(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [62 x i8] c"<input type='submit' value='%s' onclick='SysCommand(%d);' />\0A\00"
define void @printButton(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = call i32 @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str, i64 0, i64 0), i8* %5, i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [62 x i8] c"<input type='submit' value='%s' onclick='SysCommand(%d);' />\0A\00"
define void @printButton(i8* %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1)
ret void
}
void _mesa_init_all_x86_64_transform_asm(void) {}


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

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

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

LLVM IR (-O2):
define void @_mesa_init_all_x86_64_transform_asm() {
ret void
}
/* Variables and functions */
unsigned long gfx_ind(int);
int /*<<< orphan*/ gfx_outd(int, unsigned long);
void Dorado9211SetDataOut(void) {
  unsigned long value;
  value = gfx_ind(0x6400 + 0x04);
  gfx_outd(0x6400 + 0x00, value | 0x00040000);
}


x86 assembly (clang, -O0):
<Dorado9211SetDataOut>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x6404,%edi
call   1040 <gfx_ind@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
or     $0x40000,%rsi
mov    $0x6400,%edi
call   1030 <gfx_outd@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Dorado9211SetDataOut>:
push   %rax
mov    $0x6404,%edi
call   1040 <gfx_ind@plt>
or     $0x40000,%rax
mov    $0x6400,%edi
mov    %rax,%rsi
pop    %rax
jmp    1030 <gfx_outd@plt>

LLVM IR (-O0):
define void @Dorado9211SetDataOut() {
%1 = alloca i64
%2 = call i64 @gfx_ind(i32 25604)
store i64 %2, i64* %1
%3 = load i64, i64* %1
%4 = or i64 %3, 262144
%5 = call i32 @gfx_outd(i32 25600, i64 %4)
ret void
}

LLVM IR (-O2):
define void @Dorado9211SetDataOut() {
%1 = tail call i64 @gfx_ind(i32 25604)
%2 = or i64 %1, 262144
%3 = tail call i32 @gfx_outd(i32 25600, i64 %2)
ret void
}
const char *rp_app_desc() {
  return "Red Pitaya SDR receiver compatible with HPSDR.\n";
}


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

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

LLVM IR (-O0):
@.str = [48 x i8] c"Red Pitaya SDR receiver compatible with HPSDR.\0A\00"
define i8* @rp_app_desc() {
ret i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [48 x i8] c"Red Pitaya SDR receiver compatible with HPSDR.\0A\00"
define i8* @rp_app_desc() {
ret i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0)
}
unsigned int nsvg__RGBA(unsigned char r, unsigned char g, unsigned char b,
                        unsigned char a) {
  return (r) | (g << 8) | (b << 16) | (a << 24);
}


x86 assembly (clang, -O0):
<nsvg__RGBA>:
push   %rbp
mov    %rsp,%rbp
mov    %cl,%al
mov    %dl,%cl
mov    %sil,%dl
mov    %dil,%sil
mov    %sil,-0x1(%rbp)
mov    %dl,-0x2(%rbp)
mov    %cl,-0x3(%rbp)
mov    %al,-0x4(%rbp)
movzbl -0x1(%rbp),%eax
movzbl -0x2(%rbp),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
movzbl -0x3(%rbp),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
movzbl -0x4(%rbp),%ecx
shl    $0x18,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nsvg__RGBA>:
shl    $0x8,%esi
lea    (%rsi,%rdi,1),%eax
shl    $0x10,%edx
or     %edx,%eax
shl    $0x18,%ecx
or     %ecx,%eax
ret

LLVM IR (-O0):
define i32 @nsvg__RGBA(i8 zeroext %0, i8 zeroext %1, i8 zeroext %2, i8 zeroext %3) {
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
store i8 %0, i8* %5
store i8 %1, i8* %6
store i8 %2, i8* %7
store i8 %3, i8* %8
%9 = load i8, i8* %5
%10 = zext i8 %9 to i32
%11 = load i8, i8* %6
%12 = zext i8 %11 to i32
%13 = shl i32 %12, 8
%14 = or i32 %10, %13
%15 = load i8, i8* %7
%16 = zext i8 %15 to i32
%17 = shl i32 %16, 16
%18 = or i32 %14, %17
%19 = load i8, i8* %8
%20 = zext i8 %19 to i32
%21 = shl i32 %20, 24
%22 = or i32 %18, %21
ret i32 %22
}

LLVM IR (-O2):
define i32 @nsvg__RGBA(i8 zeroext %0, i8 zeroext %1, i8 zeroext %2, i8 zeroext %3) {
%5 = zext i8 %0 to i32
%6 = zext i8 %1 to i32
%7 = shl nuw nsw i32 %6, 8
%8 = or i32 %7, %5
%9 = zext i8 %2 to i32
%10 = shl nuw nsw i32 %9, 16
%11 = or i32 %8, %10
%12 = zext i8 %3 to i32
%13 = shl nuw i32 %12, 24
%14 = or i32 %11, %13
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
int verbose(int verbose, const char *string) {
  if (verbose) {
    fprintf(stderr, "%s", string);
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<verbose>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     114e <verbose+0x3e>
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
lea    0xec3(%rip),%rsi
call   1030 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1155 <verbose+0x45>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<verbose>:
test   %edi,%edi
je     1137 <verbose+0x27>
push   %rax
mov    %rsi,%rdx
mov    0x2ec1(%rip),%rax
mov    (%rax),%edi
lea    0xed8(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%eax
add    $0x8,%rsp
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [3 x i8] c"%s\00"
define i32 @verbose(i32 %0, i8* %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %1)
br label %7
7: ; preds = %2, %4
%8 = phi i32 [ 1, %4 ], [ 0, %2 ]
ret i32 %8
}
double dbl(double x) { return x * 2; }


x86 assembly (clang, -O0):
<dbl>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<dbl>:
addsd  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @dbl(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double %3, 2.000000e+00
ret double %4
}

LLVM IR (-O2):
define double @dbl(double %0) {
%2 = fmul double %0, 2.000000e+00
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage() {
  printf("Test AY/YM library programm.\n"
         "Visit http://libayemu.sourceforge.net for detalis\n"
         "Usage: test [option(s)]\n"
         "  -y --ym\tym chip test (default ay)\n"
         "  -t --test <number>\tstart test number (default 0)\n"
         "  -s --seconds <number>\tnumber of seconds to each test (default 1)\n"
         "  -h --help\n"
         "  -u --usage\tthis help\n");
}


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

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

LLVM IR (-O0):
@.str = [293 x i8] c"Test AY/YM library programm.\0AVisit http://libayemu.sourceforge.net for detalis\0AUsage: test [option(s)]\0A -y --ym\09ym chip test (default ay)\0A -t --test <number>\09start test number (default 0)\0A -s --seconds <number>\09number of seconds to each test (default 1)\0A -h --help\0A -u --usage\09this help\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([293 x i8], [293 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [292 x i8] c"Test AY/YM library programm.\0AVisit http://libayemu.sourceforge.net for detalis\0AUsage: test [option(s)]\0A -y --ym\09ym chip test (default ay)\0A -t --test <number>\09start test number (default 0)\0A -s --seconds <number>\09number of seconds to each test (default 1)\0A -h --help\0A -u --usage\09this help\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([292 x i8], [292 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
size_t ft_strlen(const char *str) {
  size_t i;
  i = 0;
  while (str[i]) {
    i++;
  }
  return (i);
}


x86 assembly (clang, -O0):
<ft_strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     1133 <ft_strlen+0x33>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <ft_strlen+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_strlen>:
mov    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <ft_strlen+0x10>
ret

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

LLVM IR (-O2):
define i64 @ft_strlen(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ 0, %1 ], [ %7, %2 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
ret i64 %3
}
void Location_execute_initialization() {}


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

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

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

LLVM IR (-O2):
define void @Location_execute_initialization() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, const char *argv[]) {
  printf("This is the best momoment of the world\n");
  printf("This is the worst moment of the world\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [40 x i8] c"This is the best momoment of the world\0A\00"
@.str.1 = [39 x i8] c"This is the worst moment of the world\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [39 x i8] c"This is the best momoment of the world\00"
@str.2 = [38 x i8] c"This is the worst moment of the world\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str.2, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ I2C_Get(int, int, unsigned char *);
unsigned char mpu_read_int_status(void) {
  unsigned char val;
  I2C_Get(0xA6, 0x30, &val);
  ;
  return val;
}


x86 assembly (clang, -O0):
<mpu_read_int_status>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0xa6,%edi
mov    $0x30,%esi
lea    -0x1(%rbp),%rdx
call   1030 <I2C_Get@plt>
movzbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mpu_read_int_status>:
push   %rax
lea    0x7(%rsp),%rdx
mov    $0xa6,%edi
mov    $0x30,%esi
call   1030 <I2C_Get@plt>
mov    0x7(%rsp),%al
pop    %rcx
ret

LLVM IR (-O0):
define zeroext i8 @mpu_read_int_status() {
%1 = alloca i8
%2 = call i32 @I2C_Get(i32 166, i32 48, i8* %1)
%3 = load i8, i8* %1
ret i8 %3
}

LLVM IR (-O2):
define zeroext i8 @mpu_read_int_status() {
%1 = alloca i8
%2 = call i32 @I2C_Get(i32 166, i32 48, i8* %1)
%3 = load i8, i8* %1
ret i8 %3
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
double rand_norm();
int sample_unif_dir(void) {
  int dir = rand_norm() * 4.0;
  assert(dir >= 0 && dir <= 4);
  if (dir == 4)
    dir = 3;
  return dir;
}


x86 assembly (clang, -O0):
<sample_unif_dir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <rand_norm@plt>
movsd  0xec9(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     115b <sample_unif_dir+0x3b>
cmpl   $0x4,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
cmpl   $0x4,-0x4(%rbp)
jne    1179 <sample_unif_dir+0x59>
movl   $0x3,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sample_unif_dir>:
push   %rbx
xor    %eax,%eax
call   1030 <rand_norm@plt>
mulsd  0xed0(%rip),%xmm0
cvttsd2si %xmm0,%ebx
xor    %edi,%edi
cmp    $0x5,%ebx
setb   %dil
call   1040 <assert@plt>
cmp    $0x4,%ebx
mov    $0x3,%eax
cmovne %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @sample_unif_dir() {
%1 = alloca i32
%2 = call double (...) @rand_norm()
%3 = fmul double %2, 4.000000e+00
%4 = fptosi double %3 to i32
store i32 %4, i32* %1
%5 = load i32, i32* %1
%6 = icmp sge i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %0
%8 = load i32, i32* %1
%9 = icmp sle i32 %8, 4
br label %10
10: ; preds = %7, %0
%11 = phi i1 [ false, %0 ], [ %9, %7 ]
%12 = zext i1 %11 to i32
%13 = call i32 @assert(i32 %12)
%14 = load i32, i32* %1
%15 = icmp eq i32 %14, 4
br i1 %15, label %16, label %17
16: ; preds = %10
store i32 3, i32* %1
br label %17
17: ; preds = %16, %10
%18 = load i32, i32* %1
ret i32 %18
}

LLVM IR (-O2):
define i32 @sample_unif_dir() {
%1 = tail call double (...) @rand_norm()
%2 = fmul double %1, 4.000000e+00
%3 = fptosi double %2 to i32
%4 = icmp ult i32 %3, 5
%5 = zext i1 %4 to i32
%6 = tail call i32 @assert(i32 %5)
%7 = icmp eq i32 %3, 4
%8 = select i1 %7, i32 3, i32 %3
ret i32 %8
}
void GetError() { return; }


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

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

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

LLVM IR (-O2):
define void @GetError() {
ret void
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
int pb_eval_vint_length(uint64_t value) {
  int eval_length = 0;
  if (value == 0)
    return 1;
  while (value) {
    value >>= 7;
    eval_length++;
  }
  return eval_length;
}


x86 assembly (clang, -O0):
<pb_eval_vint_length>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1124 <pb_eval_vint_length+0x24>
movl   $0x1,-0x4(%rbp)
jmp    1150 <pb_eval_vint_length+0x50>
jmp    1129 <pb_eval_vint_length+0x29>
cmpl   $0x0,-0x8(%rbp)
je     114a <pb_eval_vint_length+0x4a>
mov    -0x8(%rbp),%eax
sar    $0x7,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1129 <pb_eval_vint_length+0x29>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pb_eval_vint_length>:
test   %edi,%edi
je     111e <pb_eval_vint_length+0x1e>
xor    %eax,%eax
mov    %edi,%ecx
nopl   0x0(%rax,%rax,1)
sar    $0x7,%ecx
add    $0x1,%eax
cmp    $0x7f,%edi
mov    %ecx,%edi
ja     1110 <pb_eval_vint_length+0x10>
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @pb_eval_vint_length(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %9, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 0, %1 ]
%5 = phi i32 [ %6, %3 ], [ %0, %1 ]
%6 = ashr i32 %5, 7
%7 = add nuw nsw i32 %4, 1
%8 = icmp ult i32 %5, 128
br i1 %8, label %9, label %3
9: ; preds = %3, %1
%10 = phi i32 [ 1, %1 ], [ %7, %3 ]
ret i32 %10
}
void swr_is_initialized() {}


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

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

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

LLVM IR (-O2):
define void @swr_is_initialized() {
ret void
}
void SteamAPI_vr_void_FreeRenderModel(void *self,
                                      struct RenderModel_t *pRenderModel) {
  xlogf("%s(self = %p, pRenderModel = %p)\n", __func__, self, pRenderModel);
}


x86 assembly (clang, -O0):
<SteamAPI_vr_void_FreeRenderModel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    0xed1(%rip),%rdi
lea    0xeec(%rip),%rsi
mov    $0x0,%al
call   1030 <xlogf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SteamAPI_vr_void_FreeRenderModel>:
mov    %rsi,%rcx
mov    %rdi,%rdx
lea    0xee3(%rip),%rdi
lea    0xefe(%rip),%rsi
xor    %eax,%eax
jmp    1030 <xlogf@plt>

LLVM IR (-O0):
%struct.RenderModel_t = type opaque
@.str = [34 x i8] c"%s(self = %p, pRenderModel = %p)\0A\00"
@__func__.SteamAPI_vr_void_FreeRenderModel = [33 x i8] c"SteamAPI_vr_void_FreeRenderModel\00"
define void @SteamAPI_vr_void_FreeRenderModel(i8* %0, %struct.RenderModel_t* %1) {
%3 = alloca i8*
%4 = alloca %struct.RenderModel_t*
store i8* %0, i8** %3
store %struct.RenderModel_t* %1, %struct.RenderModel_t** %4
%5 = load i8*, i8** %3
%6 = load %struct.RenderModel_t*, %struct.RenderModel_t** %4
%7 = call i32 (i8*, i8*, i8*, %struct.RenderModel_t*, ...) bitcast (i32 (...)* @xlogf to i32 (i8*, i8*, i8*, %struct.RenderModel_t*, ...)*)(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([33 x i8], [33 x i8]* @__func__.SteamAPI_vr_void_FreeRenderModel, i64 0, i64 0), i8* %5, %struct.RenderModel_t* %6)
ret void
}

LLVM IR (-O2):
%struct.RenderModel_t = type opaque
@.str = [34 x i8] c"%s(self = %p, pRenderModel = %p)\0A\00"
@__func__.SteamAPI_vr_void_FreeRenderModel = [33 x i8] c"SteamAPI_vr_void_FreeRenderModel\00"
define void @SteamAPI_vr_void_FreeRenderModel(i8* %0, %struct.RenderModel_t* %1) {
%3 = tail call i32 (i8*, i8*, i8*, %struct.RenderModel_t*, ...) bitcast (i32 (...)* @xlogf to i32 (i8*, i8*, i8*, %struct.RenderModel_t*, ...)*)(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([33 x i8], [33 x i8]* @__func__.SteamAPI_vr_void_FreeRenderModel, i64 0, i64 0), i8* %0, %struct.RenderModel_t* %1)
ret void
}
float f1(float x, unsigned short y) { return x * y; }


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
movss  %xmm0,-0x4(%rbp)
mov    %ax,-0x6(%rbp)
movss  -0x4(%rbp),%xmm0
movzwl -0x6(%rbp),%eax
cvtsi2ss %eax,%xmm1
mulss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<f1>:
cvtsi2ss %edi,%xmm1
mulss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @f1(float %0, i16 zeroext %1) {
%3 = alloca float
%4 = alloca i16
store float %0, float* %3
store i16 %1, i16* %4
%5 = load float, float* %3
%6 = load i16, i16* %4
%7 = zext i16 %6 to i32
%8 = sitofp i32 %7 to float
%9 = fmul float %5, %8
ret float %9
}

LLVM IR (-O2):
define float @f1(float %0, i16 zeroext %1) {
%3 = uitofp i16 %1 to float
%4 = fmul float %3, %0
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ lcdWriteChar(int /*<<< orphan*/);
void lcdWriteStrC(const char *s) {
  while (*s)
    lcdWriteChar(*s++);
}


x86 assembly (clang, -O0):
<lcdWriteStrC>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1145 <lcdWriteStrC+0x35>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
call   1030 <lcdWriteChar@plt>
jmp    111c <lcdWriteStrC+0xc>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @lcdWriteStrC(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %10, %4 ], [ %2, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = sext i8 %5 to i32
%9 = tail call i32 @lcdWriteChar(i32 %8)
%10 = load i8, i8* %7
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}