xunge/DecIR huggingface dataset:
unsigned sub_u(unsigned minuend, unsigned subtrahend) {
  if (subtrahend > minuend)
    return 0;
  return (minuend - subtrahend);
}


x86 assembly (clang, -O0):
<sub_u>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jbe    1122 <sub_u+0x22>
movl   $0x0,-0x4(%rbp)
jmp    112b <sub_u+0x2b>
mov    -0x8(%rbp),%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sub_u>:
xor    %eax,%eax
sub    %esi,%edi
cmovae %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @sub_u(i32 %0, i32 %1) {
%3 = tail call i32 @llvm.usub.sat.i32(i32 %0, i32 %1)
ret i32 %3
}
int cddb_sum(int n) {
  int ret = 0;
  while (n > 0) {
    ret = ret + (n % 10);
    n = n / 10;
  }
  return ret;
}


x86 assembly (clang, -O0):
<cddb_sum>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    1144 <cddb_sum+0x44>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    -0xc(%rbp),%eax
add    %edx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
jmp    110e <cddb_sum+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cddb_sum>:
xor    %eax,%eax
test   %edi,%edi
jle    112d <cddb_sum+0x2d>
mov    $0xcccccccd,%r8d
nopl   0x0(%rax)
mov    %edi,%edx
imul   %r8,%rdx
shr    $0x23,%rdx
lea    (%rdx,%rdx,1),%esi
lea    (%rsi,%rsi,4),%esi
mov    %edi,%ecx
sub    %esi,%ecx
add    %ecx,%eax
cmp    $0x9,%edi
mov    %edx,%edi
ja     1110 <cddb_sum+0x10>
ret

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

LLVM IR (-O2):
define i32 @cddb_sum(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %10
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 0, %1 ]
%5 = phi i32 [ %8, %3 ], [ %0, %1 ]
%6 = urem i32 %5, 10
%7 = add nuw nsw i32 %4, %6
%8 = udiv i32 %5, 10
%9 = icmp ult i32 %5, 10
br i1 %9, label %10, label %3
10: ; preds = %3, %1
%11 = phi i32 [ 0, %1 ], [ %7, %3 ]
ret i32 %11
}
/* Variables and functions */
int factorial(int);
int /*<<< orphan*/ printf(char *, ...);
int main() {
  printf("Factorial de 5\n");
  int fac10 = factorial(5);
  printf("Resultado: %d\n", fac10);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x5,%edi
call   1030 <factorial@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed7(%rip),%rdi
call   1030 <puts@plt>
mov    $0x5,%edi
call   1040 <factorial@plt>
lea    0xeb2(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"Factorial de 5\0A\00"
@.str.1 = [15 x i8] c"Resultado: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @factorial(i32 5)
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [15 x i8] c"Resultado: %d\0A\00"
@str = [15 x i8] c"Factorial de 5\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @factorial(i32 5)
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32 %2)
ret i32 0
}
void av_color_primaries_name() {}


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

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

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

LLVM IR (-O2):
define void @av_color_primaries_name() {
ret void
}
/* Variables and functions */
double M_PI;
double cos(double);
double g(double x, double y) {
  return (x * x + y * y) * (2.0 + cos(M_PI * x) + cos(M_PI * y)) - 1.15;
}


x86 assembly (clang, -O0):
<g>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm2
movsd  -0x10(%rbp),%xmm1
mulsd  -0x10(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    0x2e9e(%rip),%rax
movsd  (%rax),%xmm0
mulsd  -0x8(%rbp),%xmm0
call   1030 <cos@plt>
movaps %xmm0,%xmm1
movsd  0xea5(%rip),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    0x2e75(%rip),%rax
movsd  (%rax),%xmm0
mulsd  -0x10(%rbp),%xmm0
call   1030 <cos@plt>
movsd  -0x20(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x18(%rbp),%xmm0
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe62(%rip),%xmm1
addsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<g>:
push   %rbx
sub    $0x20,%rsp
movsd  %xmm1,0x10(%rsp)
movapd %xmm1,%xmm3
mulsd  %xmm1,%xmm3
movapd %xmm0,%xmm2
mulsd  %xmm0,%xmm2
addsd  %xmm3,%xmm2
movsd  %xmm2,0x18(%rsp)
mov    0x2eac(%rip),%rbx
mulsd  (%rbx),%xmm0
call   1030 <cos@plt>
addsd  0xeb3(%rip),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0x10(%rsp),%xmm0
mulsd  (%rbx),%xmm0
call   1030 <cos@plt>
addsd  0x8(%rsp),%xmm0
mulsd  0x18(%rsp),%xmm0
addsd  0xe92(%rip),%xmm0
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@M_PI = global double 0.000000e+00
define double @g(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %3
%7 = load double, double* %4
%8 = load double, double* %4
%9 = fmul double %7, %8
%10 = call double @llvm.fmuladd.f64(double %5, double %6, double %9)
%11 = load double, double* @M_PI
%12 = load double, double* %3
%13 = fmul double %11, %12
%14 = call double @cos(double %13)
%15 = fadd double 2.000000e+00, %14
%16 = load double, double* @M_PI
%17 = load double, double* %4
%18 = fmul double %16, %17
%19 = call double @cos(double %18)
%20 = fadd double %15, %19
%21 = call double @llvm.fmuladd.f64(double %10, double %20, double -1.150000e+00)
ret double %21
}

LLVM IR (-O2):
@M_PI = global double 0.000000e+00
define double @g(double %0, double %1) {
%3 = fmul double %1, %1
%4 = tail call double @llvm.fmuladd.f64(double %0, double %0, double %3)
%5 = load double, double* @M_PI
%6 = fmul double %5, %0
%7 = tail call double @cos(double %6)
%8 = fadd double %7, 2.000000e+00
%9 = load double, double* @M_PI
%10 = fmul double %9, %1
%11 = tail call double @cos(double %10)
%12 = fadd double %8, %11
%13 = tail call double @llvm.fmuladd.f64(double %4, double %12, double -1.150000e+00)
ret double %13
}
short callback3_short_int_short(int (*f)(short)) { return f(3); }


x86 assembly (clang, -O0):
<callback3_short_int_short>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x3,%edi
call   *-0x8(%rbp)
cwtl
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<callback3_short_int_short>:
push   %rax
mov    %rdi,%rax
mov    $0x3,%edi
call   *%rax
pop    %rcx
ret

LLVM IR (-O0):
define signext i16 @callback3_short_int_short(i32 (i16)* %0) {
%2 = alloca i32 (i16)*
store i32 (i16)* %0, i32 (i16)** %2
%3 = load i32 (i16)*, i32 (i16)** %2
%4 = call i32 %3(i16 signext 3)
%5 = trunc i32 %4 to i16
ret i16 %5
}

LLVM IR (-O2):
define signext i16 @callback3_short_int_short(i32 (i16)* nocapture %0) {
%2 = tail call i32 %0(i16 signext 3)
%3 = trunc i32 %2 to i16
ret i16 %3
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ ispunct(int);
void t_ispunct_0x8c() {
  Assert_real((ispunct(140) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_ispunct.c",
              705, ("ispunct should be 0 for 0x8c"));
}


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

x86 assembly (clang, -O2):
<t_ispunct_0x8c>:
push   %rax
mov    $0x8c,%edi
call   1030 <ispunct@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x2c1,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

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

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_ispunct.c\00"
@.str.1 = [29 x i8] c"ispunct should be 0 for 0x8c\00"
define void @t_ispunct_0x8c() {
%1 = tail call i64 @ispunct(i32 140)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 705, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void reverse(char str[], int left, int right) {
  if (left < right) {
    char ch = str[left];
    str[left] = str[right];
    str[right] = ch;
    reverse(str, ++left, --right);
  }
}


x86 assembly (clang, -O0):
<reverse>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    117b <reverse+0x6b>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x11(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x11(%rbp),%dl
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
add    $0x1,%esi
mov    %esi,-0xc(%rbp)
mov    -0x10(%rbp),%edx
add    $0xffffffff,%edx
mov    %edx,-0x10(%rbp)
call   1030 <reverse@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reverse>:
cmp    %edx,%esi
jge    1131 <reverse+0x31>
movslq %edx,%rax
movslq %esi,%rcx
add    $0xffffffffffffffff,%rax
xchg   %ax,%ax
movzbl (%rdi,%rcx,1),%esi
movzbl 0x1(%rdi,%rax,1),%edx
mov    %dl,(%rdi,%rcx,1)
mov    %sil,0x1(%rdi,%rax,1)
add    $0x1,%rcx
lea    -0x1(%rax),%rdx
cmp    %rax,%rcx
mov    %rdx,%rax
jl     1110 <reverse+0x10>
ret

LLVM IR (-O0):
define void @reverse(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %36
11: ; preds = %3
%12 = load i8*, i8** %4
%13 = load i32, i32* %5
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i8, i8* %12, i64 %14
%16 = load i8, i8* %15
store i8 %16, i8* %7
%17 = load i8*, i8** %4
%18 = load i32, i32* %6
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds i8, i8* %17, i64 %19
%21 = load i8, i8* %20
%22 = load i8*, i8** %4
%23 = load i32, i32* %5
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds i8, i8* %22, i64 %24
store i8 %21, i8* %25
%26 = load i8, i8* %7
%27 = load i8*, i8** %4
%28 = load i32, i32* %6
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds i8, i8* %27, i64 %29
store i8 %26, i8* %30
%31 = load i8*, i8** %4
%32 = load i32, i32* %5
%33 = add nsw i32 %32, 1
store i32 %33, i32* %5
%34 = load i32, i32* %6
%35 = add nsw i32 %34, -1
store i32 %35, i32* %6
br label %36
36: ; preds = %11, %3
ret void
}

LLVM IR (-O2):
define void @reverse(i8* nocapture %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %2
br i1 %4, label %5, label %18
5: ; preds = %3
%6 = sext i32 %2 to i64
%7 = sext i32 %1 to i64
br label %8
8: ; preds = %5, %8
%9 = phi i64 [ %7, %5 ], [ %15, %8 ]
%10 = phi i64 [ %6, %5 ], [ %16, %8 ]
%11 = getelementptr inbounds i8, i8* %0, i64 %9
%12 = load i8, i8* %11
%13 = getelementptr inbounds i8, i8* %0, i64 %10
%14 = load i8, i8* %13
store i8 %14, i8* %11
store i8 %12, i8* %13
%15 = add nsw i64 %9, 1
%16 = add nsw i64 %10, -1
%17 = icmp slt i64 %15, %16
br i1 %17, label %8, label %18
18: ; preds = %8, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ f1(int /*<<< orphan*/, int);
int /*<<< orphan*/ f2(int /*<<< orphan*/, int, int);
int /*<<< orphan*/ f3(int /*<<< orphan*/, int, int /*<<< orphan*/, int);
int /*<<< orphan*/ f4(int /*<<< orphan*/, int, int /*<<< orphan*/, int);
int main() {
  f1(0, 1024);
  f2(0, 1024, 17);
  f3(0, 32, 0, 32);
  f4(0, 32, 0, 32);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %edi,%edi
mov    $0x400,%esi
call   1050 <f1@plt>
xor    %edi,%edi
mov    $0x400,%esi
mov    $0x11,%edx
call   1030 <f2@plt>
xor    %edx,%edx
mov    $0x20,%ecx
mov    %edx,%edi
mov    %ecx,%esi
call   1040 <f3@plt>
xor    %edx,%edx
mov    $0x20,%ecx
mov    %edx,%edi
mov    %ecx,%esi
call   1060 <f4@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
mov    $0x400,%esi
call   1050 <f1@plt>
xor    %edi,%edi
mov    $0x400,%esi
mov    $0x11,%edx
call   1030 <f2@plt>
xor    %edi,%edi
mov    $0x20,%esi
xor    %edx,%edx
mov    $0x20,%ecx
call   1040 <f3@plt>
xor    %edi,%edi
mov    $0x20,%esi
xor    %edx,%edx
mov    $0x20,%ecx
call   1060 <f4@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @f1(i32 0, i32 1024)
%3 = call i32 @f2(i32 0, i32 1024, i32 17)
%4 = call i32 @f3(i32 0, i32 32, i32 0, i32 32)
%5 = call i32 @f4(i32 0, i32 32, i32 0, i32 32)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @f1(i32 0, i32 1024)
%2 = tail call i32 @f2(i32 0, i32 1024, i32 17)
%3 = tail call i32 @f3(i32 0, i32 32, i32 0, i32 32)
%4 = tail call i32 @f4(i32 0, i32 32, i32 0, i32 32)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
int xlink(char *old, char *new) {
  printf("link() not implemented\n");
  exit(-1);
}


x86 assembly (clang, -O0):
<xlink>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<xlink>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"link() not implemented\0A\00"
define i32 @xlink(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@str = [23 x i8] c"link() not implemented\00"
define i32 @xlink(i8* nocapture readnone %0, i8* nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @exit(i32 -1)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ fd_set;

/* Variables and functions */
int /*<<< orphan*/ FD_SET(int, int /*<<< orphan*/ *);
int /*<<< orphan*/ FD_ZERO(int /*<<< orphan*/ *);
int select(int, int /*<<< orphan*/ *, int /*<<< orphan*/ *,
           int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int monitor(int inotifyFd) {
  fd_set readSet;
  FD_ZERO(&readSet);
  FD_SET(inotifyFd, &readSet);
  return select(inotifyFd + 1, &readSet, NULL, NULL, NULL);
}


x86 assembly (clang, -O0):
<monitor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x8(%rbp),%rdi
call   1030 <FD_ZERO@plt>
mov    -0x4(%rbp),%edi
lea    -0x8(%rbp),%rsi
call   1050 <FD_SET@plt>
mov    -0x4(%rbp),%edi
add    $0x1,%edi
lea    -0x8(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%r8d
mov    %r8,%rdx
mov    %r8,%rcx
call   1040 <select@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<monitor>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
lea    0x4(%rsp),%r14
mov    %r14,%rdi
call   1030 <FD_ZERO@plt>
mov    %ebx,%edi
mov    %r14,%rsi
call   1050 <FD_SET@plt>
add    $0x1,%ebx
mov    %ebx,%edi
mov    %r14,%rsi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
call   1040 <select@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @monitor(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = call i32 @FD_ZERO(i32* %3)
%5 = load i32, i32* %2
%6 = call i32 @FD_SET(i32 %5, i32* %3)
%7 = load i32, i32* %2
%8 = add nsw i32 %7, 1
%9 = call i32 @select(i32 %8, i32* %3, i32* null, i32* null, i32* null)
ret i32 %9
}

LLVM IR (-O2):
define i32 @monitor(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @FD_ZERO(i32* %2)
%5 = call i32 @FD_SET(i32 %0, i32* %2)
%6 = add nsw i32 %0, 1
%7 = call i32 @select(i32 %6, i32* %2, i32* null, i32* null, i32* null)
ret i32 %7
}
int test_imm_8Euint16_mem(unsigned short *val) {
  return ((*val) & (0x8E << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_8Euint16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = zext i16 %4 to i32
%6 = and i32 %5, 142
%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_8Euint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 142
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
int main(int argc, char *argv[]) {
  float f = 2;
  printf("%f\n", f);
  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)
movss  0xed2(%rip),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [4 x i8] c"%f\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca float
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store float 2.000000e+00, float* %6
%7 = load float, float* %6
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), float %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%f\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), float 2.000000e+00)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ console_puts(char *);
int putchar(int c) {
  console_puts((char *)&c);
  return c;
}


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

x86 assembly (clang, -O2):
<putchar>:
push   %rax
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1030 <console_puts@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @putchar(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = bitcast i32* %2 to i8*
%4 = call i32 @console_puts(i8* %3)
%5 = load i32, i32* %2
ret i32 %5
}

LLVM IR (-O2):
define i32 @putchar(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = bitcast i32* %2 to i8*
%4 = call i32 @console_puts(i8* %3)
%5 = load i32, i32* %2
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ sigset_t;

/* Variables and functions */
int /*<<< orphan*/ memset(int /*<<< orphan*/ *, int /*<<< orphan*/, int);
int sigemptyset(sigset_t *set) {
  memset(set, 0, sizeof *set);
  return 0;
}


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

x86 assembly (clang, -O2):
<sigemptyset>:
push   %rax
xor    %esi,%esi
mov    $0x4,%edx
call   1030 <memset@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @sigemptyset(i32* %0) {
%2 = tail call i32 @memset(i32* %0, i32 0, i32 4)
ret i32 0
}
int test_imm_83int64_highword_mem(long long *val) {
  return ((*val >> 32) & (0x83 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_83int64_highword_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
sar    $0x20,%rdx
and    $0x83,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_83int64_highword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = ashr i64 %4, 32
%6 = and i64 %5, 131
%7 = icmp ne i64 %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_83int64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 562640715776
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
bool SHAREMIND_MAP_KEY_LESS_uint32_t(uint32_t const k1, uint32_t const k2) {
  return k1 < k2;
}


x86 assembly (clang, -O0):
<SHAREMIND_MAP_KEY_LESS_uint32_t>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
setl   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SHAREMIND_MAP_KEY_LESS_uint32_t>:
xor    %eax,%eax
cmp    %rsi,%rdi
setl   %al
ret

LLVM IR (-O0):
define i32 @SHAREMIND_MAP_KEY_LESS_uint32_t(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = icmp slt i64 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @SHAREMIND_MAP_KEY_LESS_uint32_t(i64 %0, i64 %1) {
%3 = icmp slt i64 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int set_continuation_parameters(double *c) {
  int *a, *b, fail;
  fail = _ada_use_c2phc(73, a, b, c);
  return fail;
}


x86 assembly (clang, -O0):
<set_continuation_parameters>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x8(%rbp),%rcx
mov    $0x49,%edi
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_continuation_parameters>:
mov    %rdi,%rcx
mov    $0x49,%edi
jmp    1030 <_ada_use_c2phc@plt>

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

LLVM IR (-O2):
define i32 @set_continuation_parameters(double* %0) {
%2 = tail call i32 @_ada_use_c2phc(i32 73, i32* undef, i32* undef, double* %0)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ u_int64_t;
struct timespec {
  int tv_sec;
  int tv_nsec;
};

/* Variables and functions */
int /*<<< orphan*/ CLOCK_MONOTONIC;
int /*<<< orphan*/ clock_gettime(int /*<<< orphan*/, struct timespec *);
u_int64_t kore_time_ms(void) {
  struct timespec ts;
  (void)clock_gettime(CLOCK_MONOTONIC, &ts);
  return ((u_int64_t)(ts.tv_sec * 1000 + (ts.tv_nsec / 1000000)));
}


x86 assembly (clang, -O0):
<kore_time_ms>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    -0x8(%rbp),%rsi
call   1030 <clock_gettime@plt>
imul   $0x3e8,-0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xf4240,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kore_time_ms>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
mov    %rsp,%rsi
call   1030 <clock_gettime@plt>
imul   $0x3e8,(%rsp),%ecx
movslq 0x4(%rsp),%rax
imul   $0x431bde83,%rax,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
sar    $0x32,%rax
add    %edx,%eax
add    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.timespec = type { i32, i32 }
@CLOCK_MONOTONIC = global i32 0
define i32 @kore_time_ms() {
%1 = alloca %struct.timespec
%2 = load i32, i32* @CLOCK_MONOTONIC
%3 = call i32 @clock_gettime(i32 %2, %struct.timespec* %1)
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 0
%5 = load i32, i32* %4
%6 = mul nsw i32 %5, 1000
%7 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 1
%8 = load i32, i32* %7
%9 = sdiv i32 %8, 1000000
%10 = add nsw i32 %6, %9
ret i32 %10
}

LLVM IR (-O2):
%struct.timespec = type { i32, i32 }
@CLOCK_MONOTONIC = global i32 0
define i32 @kore_time_ms() {
%1 = alloca %struct.timespec
%2 = bitcast %struct.timespec* %1 to i8*
%3 = load i32, i32* @CLOCK_MONOTONIC
%4 = call i32 @clock_gettime(i32 %3, %struct.timespec* %1)
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 0
%6 = load i32, i32* %5
%7 = mul nsw i32 %6, 1000
%8 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 1
%9 = load i32, i32* %8
%10 = sdiv i32 %9, 1000000
%11 = add nsw i32 %10, %7
ret i32 %11
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int vfprintf(int /*<<< orphan*/ *, char const *, int /*<<< orphan*/);
signed int vprintf(const char *pFormat, va_list ap) {
  return vfprintf(NULL, pFormat, ap);
}


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

x86 assembly (clang, -O2):
<vprintf>:
mov    %esi,%edx
mov    %rdi,%rsi
xor    %edi,%edi
jmp    1030 <vfprintf@plt>

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

LLVM IR (-O2):
define i32 @vprintf(i8* nocapture %0, i32 %1) {
%3 = tail call i32 @vfprintf(i32* null, i8* %0, i32 %1)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ SEEK_END;
int /*<<< orphan*/ SEEK_SET;
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, int /*<<< orphan*/,
                         int /*<<< orphan*/);
long ftell(int /*<<< orphan*/ *);
long get_file_length(FILE *file) {
  fseek(file, 0, SEEK_END);
  long file_len = ftell(file);
  fseek(file, 0, SEEK_SET);
  return file_len;
}


x86 assembly (clang, -O0):
<get_file_length>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2eb1(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1040 <fseek@plt>
mov    -0x8(%rbp),%rdi
call   1030 <ftell@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2e80(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1040 <fseek@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_file_length>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2eba(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1040 <fseek@plt>
mov    %rbx,%rdi
call   1030 <ftell@plt>
mov    %rax,%r14
mov    0x2e8f(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   1040 <fseek@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@SEEK_END = global i32 0
@SEEK_SET = global i32 0
define i64 @get_file_length(i32* %0) {
%2 = alloca i32*
%3 = alloca i64
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = load i32, i32* @SEEK_END
%6 = call i32 @fseek(i32* %4, i32 0, i32 %5)
%7 = load i32*, i32** %2
%8 = call i64 @ftell(i32* %7)
store i64 %8, i64* %3
%9 = load i32*, i32** %2
%10 = load i32, i32* @SEEK_SET
%11 = call i32 @fseek(i32* %9, i32 0, i32 %10)
%12 = load i64, i64* %3
ret i64 %12
}

LLVM IR (-O2):
@SEEK_END = global i32 0
@SEEK_SET = global i32 0
define i64 @get_file_length(i32* nocapture %0) {
%2 = load i32, i32* @SEEK_END
%3 = tail call i32 @fseek(i32* %0, i32 0, i32 %2)
%4 = tail call i64 @ftell(i32* %0)
%5 = load i32, i32* @SEEK_SET
%6 = tail call i32 @fseek(i32* %0, i32 0, i32 %5)
ret i64 %4
}
/* Variables and functions */
int system(char *);
int mysystem(char *cmd) { return system(cmd); }


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

x86 assembly (clang, -O2):
<mysystem>:
jmp    1030 <system@plt>

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

LLVM IR (-O2):
define i32 @mysystem(i8* nocapture %0) {
%2 = tail call i32 @system(i8* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ set_task_10ms(int /*<<< orphan*/ *);
void close_timer(void) { set_task_10ms(NULL); }


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

x86 assembly (clang, -O2):
<close_timer>:
xor    %edi,%edi
jmp    1030 <set_task_10ms@plt>

LLVM IR (-O0):
define void @close_timer() {
%1 = call i32 @set_task_10ms(i32* null)
ret void
}

LLVM IR (-O2):
define void @close_timer() {
%1 = tail call i32 @set_task_10ms(i32* null)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "usage: cplay [OPTIONS] filename\n"
                  "-c\tcard number\n"
                  "-d\tdevice node\n"
                  "-b\tbuffer size\n"
                  "-f\tfragments\n\n"
                  "-v\tverbose mode\n"
                  "-h\tPrints this help list\n\n"
                  "Example:\n"
                  "\tcplay -c 1 -d 2 test.mp3\n"
                  "\tcplay -f 5 test.mp3\n");
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e98(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e9b(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [190 x i8] c"usage: cplay [OPTIONS] filename\0A-c\09card number\0A-d\09device node\0A-b\09buffer size\0A-f\09fragments\0A\0A-v\09verbose mode\0A-h\09Prints this help list\0A\0AExample:\0A\09cplay -c 1 -d 2 test.mp3\0A\09cplay -f 5 test.mp3\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([190 x i8], [190 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EXIT_FAILURE
%4 = call i32 @exit(i32 %3)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [190 x i8] c"usage: cplay [OPTIONS] filename\0A-c\09card number\0A-d\09device node\0A-b\09buffer size\0A-f\09fragments\0A\0A-v\09verbose mode\0A-h\09Prints this help list\0A\0AExample:\0A\09cplay -c 1 -d 2 test.mp3\0A\09cplay -f 5 test.mp3\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([190 x i8], [190 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EXIT_FAILURE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ sunxi_gpio_output(unsigned int, unsigned char);
void digitalWrite(unsigned int pin, unsigned char value) {
  sunxi_gpio_output(pin, value);
}


x86 assembly (clang, -O0):
<digitalWrite>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %edi,-0x4(%rbp)
mov    %al,-0x5(%rbp)
mov    -0x4(%rbp),%edi
movzbl -0x5(%rbp),%esi
call   1030 <sunxi_gpio_output@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<digitalWrite>:
jmp    1030 <sunxi_gpio_output@plt>

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

LLVM IR (-O2):
define void @digitalWrite(i32 %0, i8 zeroext %1) {
%3 = tail call i32 @sunxi_gpio_output(i32 %0, i8 zeroext %1)
ret void
}
int main() {
  int a = 3 / 0;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %eax,-0x8(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
void Util_ZeroString(char *str) {
  if (str != ((void *)0)) {
    memset(str, 0, strlen(str));
  }
}


x86 assembly (clang, -O0):
<Util_ZeroString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1156 <Util_ZeroString+0x36>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x10(%rbp),%rdi
mov    %rax,%rdx
xor    %esi,%esi
call   1040 <memset@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Util_ZeroString>:
test   %rdi,%rdi
je     113c <Util_ZeroString+0x1c>
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    %rax,%rdx
pop    %rbx
jmp    1040 <memset@plt>
ret

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

LLVM IR (-O2):
define void @Util_ZeroString(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i64 @strlen(i8* %0)
tail call void @llvm.memset.p0i8.i64(i8* align 1 %0, i8 0, i64 %4, i1 false)
br label %5
5: ; preds = %3, %1
ret void
}
/* Type definitions */
struct passwd {
  int pw_uid;
};

/* Variables and functions */
struct passwd *getpwnam(char *);
unsigned get_shell_uid() {
  struct passwd *ppwd = getpwnam("shell");
  if (NULL == ppwd)
    return 2000;
  return ppwd->pw_uid;
}


x86 assembly (clang, -O0):
<get_shell_uid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <getpwnam@plt>
mov    %rax,-0x10(%rbp)
xor    %eax,%eax
cmp    -0x10(%rbp),%rax
jne    1140 <get_shell_uid+0x30>
movl   $0x7d0,-0x4(%rbp)
jmp    1149 <get_shell_uid+0x39>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_shell_uid>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <getpwnam@plt>
test   %rax,%rax
je     1126 <get_shell_uid+0x16>
mov    (%rax),%eax
pop    %rcx
ret
mov    $0x7d0,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.passwd = type { i32 }
@.str = [6 x i8] c"shell\00"
define i32 @get_shell_uid() {
%1 = alloca i32
%2 = alloca %struct.passwd*
%3 = call %struct.passwd* @getpwnam(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
store %struct.passwd* %3, %struct.passwd** %2
%4 = load %struct.passwd*, %struct.passwd** %2
%5 = icmp eq %struct.passwd* null, %4
br i1 %5, label %6, label %7
6: ; preds = %0
store i32 2000, i32* %1
br label %11
7: ; preds = %0
%8 = load %struct.passwd*, %struct.passwd** %2
%9 = getelementptr inbounds %struct.passwd, %struct.passwd* %8, i32 0, i32 0
%10 = load i32, i32* %9
store i32 %10, i32* %1
br label %11
11: ; preds = %7, %6
%12 = load i32, i32* %1
ret i32 %12
}

LLVM IR (-O2):
%struct.passwd = type { i32 }
@.str = [6 x i8] c"shell\00"
define i32 @get_shell_uid() {
%1 = tail call %struct.passwd* @getpwnam(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq %struct.passwd* %1, null
br i1 %2, label %6, label %3
3: ; preds = %0
%4 = getelementptr inbounds %struct.passwd, %struct.passwd* %1, i64 0, i32 0
%5 = load i32, i32* %4
br label %6
6: ; preds = %0, %3
%7 = phi i32 [ %5, %3 ], [ 2000, %0 ]
ret i32 %7
}
int test_imm_CDuint64_midword_mem(unsigned long long *val) {
  return ((*val >> 16) & (0xCD << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_CDuint64_midword_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
shr    $0x10,%rdx
and    $0xcd,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_CDuint64_midword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = lshr i64 %4, 16
%6 = and i64 %5, 205
%7 = icmp ne i64 %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_CDuint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 13434880
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ TestVarArg(char *, float);
void TestPassVarFloat(float x) { TestVarArg("A", x); }


x86 assembly (clang, -O0):
<TestPassVarFloat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
lea    0xed7(%rip),%rdi
call   1030 <TestVarArg@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [2 x i8] c"A\00"
define void @TestPassVarFloat(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call i32 @TestVarArg(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), float %3)
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"A\00"
define void @TestPassVarFloat(float %0) {
%2 = tail call i32 @TestVarArg(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), float %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *);
void err_end(char *msg) {
  printf("%s error\n", msg);
  exit(1);
}


x86 assembly (clang, -O0):
<err_end>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<err_end>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"%s error\0A\00"
define void @err_end(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [10 x i8] c"%s error\0A\00"
define void @err_end(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int abs(int);
int note_without_pitch(int value) {
  int out = abs(value) % 7;
  if (value < 0)
    out = 7 - out;
  return out;
}


x86 assembly (clang, -O0):
<note_without_pitch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <abs@plt>
mov    $0x7,%ecx
cltd
idiv   %ecx
mov    %edx,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    1143 <note_without_pitch+0x33>
mov    $0x7,%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<note_without_pitch>:
mov    %edi,%eax
neg    %eax
cmovs  %edi,%eax
imul   $0x24924925,%rax,%rcx
shr    $0x20,%rcx
mov    %eax,%edx
sub    %ecx,%edx
shr    %edx
add    %ecx,%edx
shr    $0x2,%edx
lea    0x0(,%rdx,8),%ecx
sub    %ecx,%edx
add    %eax,%edx
mov    %edx,%eax
xor    $0x7,%eax
test   %edi,%edi
cmovns %edx,%eax
ret

LLVM IR (-O0):
define i32 @note_without_pitch(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @abs(i32 %4)
%6 = srem i32 %5, 7
store i32 %6, i32* %3
%7 = load i32, i32* %2
%8 = icmp slt i32 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = load i32, i32* %3
%11 = sub nsw i32 7, %10
store i32 %11, i32* %3
br label %12
12: ; preds = %9, %1
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
define i32 @note_without_pitch(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
%3 = urem i32 %2, 7
%4 = icmp slt i32 %0, 0
%5 = xor i32 %3, 7
%6 = select i1 %4, i32 %5, i32 %3
ret i32 %6
}
int read_short(const unsigned char *data, int offset) {
  return (data[offset] << 8) + data[offset + 1];
}


x86 assembly (clang, -O0):
<read_short>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movzbl (%rax,%rcx,1),%eax
shl    $0x8,%eax
mov    -0x8(%rbp),%rcx
mov    -0xc(%rbp),%edx
add    $0x1,%edx
movslq %edx,%rdx
movzbl (%rcx,%rdx,1),%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_short>:
movslq %esi,%rax
movzwl (%rdi,%rax,1),%eax
shl    $0x10,%eax
bswap  %eax
ret

LLVM IR (-O0):
define i32 @read_short(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 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %5, i64 %7
%9 = load i8, i8* %8
%10 = zext i8 %9 to i32
%11 = shl i32 %10, 8
%12 = load i8*, i8** %3
%13 = load i32, i32* %4
%14 = add nsw i32 %13, 1
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8, i8* %12, i64 %15
%17 = load i8, i8* %16
%18 = zext i8 %17 to i32
%19 = add nsw i32 %11, %18
ret i32 %19
}

LLVM IR (-O2):
define i32 @read_short(i8* nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = shl nuw nsw i32 %6, 8
%8 = add nsw i32 %1, 1
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i8, i8* %0, i64 %9
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = or i32 %7, %12
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ SysCtlClockConfigSet(int);
int /*<<< orphan*/ SysCtlPeripheralDisable(int);
void SystemInit(void) {
  (*((volatile unsigned long *)(0x400FB980))) = 0xA5A5A5A5;
  SysCtlClockConfigSet(0x80000000 | (0x0000007F & 0xF) | 0x00000000 |
                       0x00040000 | 0x00030000);
  SysCtlPeripheralDisable(0x00101000);
  SysCtlPeripheralDisable(0x00000008);
}


x86 assembly (clang, -O0):
<SystemInit>:
push   %rbp
mov    %rsp,%rbp
mov    $0x400fb980,%eax
mov    $0xa5a5a5a5,%ecx
mov    %rcx,(%rax)
mov    $0x8007000f,%edi
call   1040 <SysCtlClockConfigSet@plt>
mov    $0x101000,%edi
call   1030 <SysCtlPeripheralDisable@plt>
mov    $0x8,%edi
call   1030 <SysCtlPeripheralDisable@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<SystemInit>:
push   %rax
mov    $0xa5a5a5a5,%eax
mov    %rax,0x400fb980
40
mov    $0x8007000f,%edi
call   1040 <SysCtlClockConfigSet@plt>
mov    $0x101000,%edi
call   1030 <SysCtlPeripheralDisable@plt>
mov    $0x8,%edi
pop    %rax
jmp    1030 <SysCtlPeripheralDisable@plt>

LLVM IR (-O0):
define void @SystemInit() {
store volatile i64 2779096485, i64* inttoptr (i64 1074772352 to i64*)
%1 = call i32 @SysCtlClockConfigSet(i32 -2147024881)
%2 = call i32 @SysCtlPeripheralDisable(i32 1052672)
%3 = call i32 @SysCtlPeripheralDisable(i32 8)
ret void
}

LLVM IR (-O2):
define void @SystemInit() {
store volatile i64 2779096485, i64* inttoptr (i64 1074772352 to i64*)
%1 = tail call i32 @SysCtlClockConfigSet(i32 -2147024881)
%2 = tail call i32 @SysCtlPeripheralDisable(i32 1052672)
%3 = tail call i32 @SysCtlPeripheralDisable(i32 8)
ret void
}
int main(void) {
  put_str("I an kernel\n");
  init_all();
  asm volatile("sti");
  while (1)
    ;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1040 <put_str@plt>
mov    $0x0,%al
call   1030 <init_all@plt>
sti
jmp    1145 <main+0x25>

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
xor    %eax,%eax
call   1040 <put_str@plt>
xor    %eax,%eax
call   1030 <init_all@plt>
sti
nopw   0x0(%rax,%rax,1)
jmp    1140 <main+0x20>

LLVM IR (-O0):
@.str = [13 x i8] c"I an kernel\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (i8*, ...) bitcast (i32 (...)* @put_str to i32 (i8*, ...)*)(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @init_all()
br label %4
4: ; preds = %0, %4
br label %4
}

LLVM IR (-O2):
@.str = [13 x i8] c"I an kernel\0A\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) bitcast (i32 (...)* @put_str to i32 (i8*, ...)*)(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @init_all()
tail call void asm sideeffect "sti", "~{dirflag},~{fpsr},~{flags}"()
br label %3
3: ; preds = %0, %3
br label %3
}
void startADC(void) {}


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

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

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

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