xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ M_PI;
int asinh(double);
scalar_t__ cos(int);
scalar_t__ cosh(int /*<<< orphan*/);
int sqrt(scalar_t__);
double f(double t) {
  return sqrt(cos(3 * asinh(t)) + cosh(M_PI)) / (1 + t * t);
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1060 <asinh@plt>
imul   $0x3,%eax,%edi
call   1040 <cos@plt>
mov    %rax,-0x10(%rbp)
mov    0x2e7e(%rip),%rax
mov    (%rax),%edi
call   1030 <cosh@plt>
mov    -0x10(%rbp),%rdi
add    %rax,%rdi
call   1050 <sqrt@plt>
cvtsi2sd %eax,%xmm0
movsd  -0x8(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm2
mulsd  %xmm2,%xmm1
movsd  0xe69(%rip),%xmm2
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
push   %rbx
sub    $0x10,%rsp
movsd  %xmm0,0x8(%rsp)
call   1060 <asinh@plt>
lea    (%rax,%rax,2),%edi
call   1040 <cos@plt>
mov    %rax,%rbx
mov    0x2e86(%rip),%rax
mov    (%rax),%edi
call   1030 <cosh@plt>
add    %rax,%rbx
mov    %rbx,%rdi
call   1050 <sqrt@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  0x8(%rsp),%xmm1
mulsd  %xmm1,%xmm1
addsd  0xe73(%rip),%xmm1
divsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@M_PI = global i32 0
define double @f(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i32 @asinh(double %3)
%5 = mul nsw i32 3, %4
%6 = call i64 @cos(i32 %5)
%7 = load i32, i32* @M_PI
%8 = call i64 @cosh(i32 %7)
%9 = add nsw i64 %6, %8
%10 = call i32 @sqrt(i64 %9)
%11 = sitofp i32 %10 to double
%12 = load double, double* %2
%13 = load double, double* %2
%14 = call double @llvm.fmuladd.f64(double %12, double %13, double 1.000000e+00)
%15 = fdiv double %11, %14
ret double %15
}

LLVM IR (-O2):
@M_PI = global i32 0
define double @f(double %0) {
%2 = tail call i32 @asinh(double %0)
%3 = mul nsw i32 %2, 3
%4 = tail call i64 @cos(i32 %3)
%5 = load i32, i32* @M_PI
%6 = tail call i64 @cosh(i32 %5)
%7 = add nsw i64 %6, %4
%8 = tail call i32 @sqrt(i64 %7)
%9 = sitofp i32 %8 to double
%10 = tail call double @llvm.fmuladd.f64(double %0, double %0, double 1.000000e+00)
%11 = fdiv double %9, %10
ret double %11
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ munmap(void volatile *, size_t);
void munmap_perith(volatile void *mem, size_t size, int *fd) {
  munmap(mem, size);
  close(*fd);
  *fd = -1;
}


x86 assembly (clang, -O0):
<munmap_perith>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <munmap@plt>
mov    -0x18(%rbp),%rax
mov    (%rax),%edi
call   1030 <close@plt>
mov    -0x18(%rbp),%rax
movl   $0xffffffff,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<munmap_perith>:
push   %rbx
mov    %rdx,%rbx
call   1040 <munmap@plt>
mov    (%rbx),%edi
call   1030 <close@plt>
movl   $0xffffffff,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @munmap_perith(i8* %0, i64 %1, i32* %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i32*
store i8* %0, i8** %4
store i64 %1, i64* %5
store i32* %2, i32** %6
%7 = load i8*, i8** %4
%8 = load i64, i64* %5
%9 = call i32 @munmap(i8* %7, i64 %8)
%10 = load i32*, i32** %6
%11 = load i32, i32* %10
%12 = call i32 @close(i32 %11)
%13 = load i32*, i32** %6
store i32 -1, i32* %13
ret void
}

LLVM IR (-O2):
define void @munmap_perith(i8* %0, i64 %1, i32* nocapture %2) {
%4 = tail call i32 @munmap(i8* %0, i64 %1)
%5 = load i32, i32* %2
%6 = tail call i32 @close(i32 %5)
store i32 -1, i32* %2
ret void
}
/* Variables and functions */
int bar();
int foo();
int foo_new();
int main() {
  int x;
  x = foo();
  x = foo_new();
  x = bar();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <foo@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <foo_new@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1040 <bar@plt>
mov    %eax,-0x4(%rbp)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <foo@plt>
xor    %eax,%eax
call   1030 <foo_new@plt>
xor    %eax,%eax
call   1040 <bar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = call i32 (...) @foo()
store i32 %2, i32* %1
%3 = call i32 (...) @foo_new()
store i32 %3, i32* %1
%4 = call i32 (...) @bar()
store i32 %4, i32* %1
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @foo()
%2 = tail call i32 (...) @foo_new()
%3 = tail call i32 (...) @bar()
ret i32 0
}
/* Variables and functions */
int core12_safe(char const *);
int U_EMRCREATEDIBPATTERNBRUSHPT_safe(const char *record) {
  return (core12_safe(record));
}


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

x86 assembly (clang, -O2):
<U_EMRCREATEDIBPATTERNBRUSHPT_safe>:
jmp    1030 <core12_safe@plt>

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

LLVM IR (-O2):
define i32 @U_EMRCREATEDIBPATTERNBRUSHPT_safe(i8* %0) {
%2 = tail call i32 @core12_safe(i8* %0)
ret i32 %2
}
/* Type definitions */
typedef int uint64_t;
typedef int int64_t;

/* Variables and functions */
int64_t read_sign_rotated(const int64_t *argv) {
  uint64_t u64 = *argv;
  if ((u64 & 1) == 0)
    return u64 >> 1;
  if (u64 != 1)
    return -(u64 >> 1);
  return 1ULL << 63;
}


x86 assembly (clang, -O0):
<read_sign_rotated>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
jne    112e <read_sign_rotated+0x2e>
mov    -0x14(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1151 <read_sign_rotated+0x51>
cmpl   $0x1,-0x14(%rbp)
je     114a <read_sign_rotated+0x4a>
mov    -0x14(%rbp),%ecx
sar    $0x1,%ecx
xor    %eax,%eax
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    1151 <read_sign_rotated+0x51>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_sign_rotated>:
mov    (%rdi),%ecx
test   $0x1,%cl
jne    110b <read_sign_rotated+0xb>
sar    %ecx
jmp    1116 <read_sign_rotated+0x16>
xor    %eax,%eax
cmp    $0x1,%ecx
je     1118 <read_sign_rotated+0x18>
sar    %ecx
neg    %ecx
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @read_sign_rotated(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 1
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = ashr i32 %2, 1
br label %12
7: ; preds = %1
%8 = icmp eq i32 %2, 1
br i1 %8, label %12, label %9
9: ; preds = %7
%10 = ashr i32 %2, 1
%11 = sub nsw i32 0, %10
br label %12
12: ; preds = %7, %9, %5
%13 = phi i32 [ %6, %5 ], [ %11, %9 ], [ 0, %7 ]
ret i32 %13
}
float scalarprod(float *v1, float *v2) {
  return v1[0] * v2[0] + v1[1] * v2[1] + v1[2] * v2[2];
}


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

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

LLVM IR (-O0):
define float @scalarprod(float* %0, float* %1) {
%3 = alloca float*
%4 = alloca float*
store float* %0, float** %3
store float* %1, float** %4
%5 = load float*, float** %3
%6 = getelementptr inbounds float, float* %5, i64 0
%7 = load float, float* %6
%8 = load float*, float** %4
%9 = getelementptr inbounds float, float* %8, i64 0
%10 = load float, float* %9
%11 = load float*, float** %3
%12 = getelementptr inbounds float, float* %11, i64 1
%13 = load float, float* %12
%14 = load float*, float** %4
%15 = getelementptr inbounds float, float* %14, i64 1
%16 = load float, float* %15
%17 = fmul float %13, %16
%18 = call float @llvm.fmuladd.f32(float %7, float %10, float %17)
%19 = load float*, float** %3
%20 = getelementptr inbounds float, float* %19, i64 2
%21 = load float, float* %20
%22 = load float*, float** %4
%23 = getelementptr inbounds float, float* %22, i64 2
%24 = load float, float* %23
%25 = call float @llvm.fmuladd.f32(float %21, float %24, float %18)
ret float %25
}

LLVM IR (-O2):
define float @scalarprod(float* nocapture %0, float* nocapture %1) {
%3 = load float, float* %0
%4 = load float, float* %1
%5 = getelementptr inbounds float, float* %0, i64 1
%6 = load float, float* %5
%7 = getelementptr inbounds float, float* %1, i64 1
%8 = load float, float* %7
%9 = fmul float %6, %8
%10 = tail call float @llvm.fmuladd.f32(float %3, float %4, float %9)
%11 = getelementptr inbounds float, float* %0, i64 2
%12 = load float, float* %11
%13 = getelementptr inbounds float, float* %1, i64 2
%14 = load float, float* %13
%15 = tail call float @llvm.fmuladd.f32(float %12, float %14, float %10)
ret float %15
}
int ChaNumToType(int cha) {
  switch (cha) {
  case (3):
    return ((3));
  case (0):
    return ((0));
  case (2):
    return ((2));
  case (4):
    return ((4));
  case (5):
    return ((5));
  case (1):
    return ((1));
  case (6):
    return ((6));
  default:
    return ((0xE004FFFD));
  }
}


x86 assembly (clang, -O0):
<ChaNumToType>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %rax,-0x10(%rbp)
sub    $0x6,%rax
ja     1180 <ChaNumToType+0x80>
mov    -0x10(%rbp),%rax
lea    0xedd(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x3,-0x4(%rbp)
jmp    1187 <ChaNumToType+0x87>
movl   $0x0,-0x4(%rbp)
jmp    1187 <ChaNumToType+0x87>
movl   $0x2,-0x4(%rbp)
jmp    1187 <ChaNumToType+0x87>
movl   $0x4,-0x4(%rbp)
jmp    1187 <ChaNumToType+0x87>
movl   $0x5,-0x4(%rbp)
jmp    1187 <ChaNumToType+0x87>
movl   $0x1,-0x4(%rbp)
jmp    1187 <ChaNumToType+0x87>
movl   $0x6,-0x4(%rbp)
jmp    1187 <ChaNumToType+0x87>
movl   $0xe004fffd,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ChaNumToType>:
cmp    $0x7,%edi
mov    $0xe004fffd,%eax
cmovb  %edi,%eax
ret

LLVM IR (-O0):
define i32 @ChaNumToType(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %12 [
i32 3, label %5
i32 0, label %6
i32 2, label %7
i32 4, label %8
i32 5, label %9
i32 1, label %10
i32 6, label %11
]
5: ; preds = %1
store i32 3, i32* %2
br label %13
6: ; preds = %1
store i32 0, i32* %2
br label %13
7: ; preds = %1
store i32 2, i32* %2
br label %13
8: ; preds = %1
store i32 4, i32* %2
br label %13
9: ; preds = %1
store i32 5, i32* %2
br label %13
10: ; preds = %1
store i32 1, i32* %2
br label %13
11: ; preds = %1
store i32 6, i32* %2
br label %13
12: ; preds = %1
store i32 -536543235, i32* %2
br label %13
13: ; preds = %12, %11, %10, %9, %8, %7, %6, %5
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
define i32 @ChaNumToType(i32 %0) {
%2 = icmp ult i32 %0, 7
%3 = select i1 %2, i32 %0, i32 -536543235
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, unsigned long);
int main() {
  int n, count;
  long unsigned int factorial;
  factorial = 1;
  n = 10;
  for (count = 1; count <= n; count++) {
    factorial *= count;
  }
  printf("Factorial of %d = %lu\n", n, factorial);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x1,-0x18(%rbp)
movl   $0xa,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     115c <main+0x4c>
movslq -0xc(%rbp),%rax
imul   -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1135 <main+0x25>
mov    -0x8(%rbp),%esi
mov    -0x18(%rbp),%rdx
lea    0xe96(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x375f00,%edx
mov    $0xa,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"Factorial of %d = %lu\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i64
store i32 0, i32* %1
store i64 1, i64* %4
store i32 10, i32* %2
store i32 1, i32* %3
br label %5
5: ; preds = %14, %0
%6 = load i32, i32* %3
%7 = load i32, i32* %2
%8 = icmp sle i32 %6, %7
br i1 %8, label %9, label %17
9: ; preds = %5
%10 = load i32, i32* %3
%11 = sext i32 %10 to i64
%12 = load i64, i64* %4
%13 = mul i64 %12, %11
store i64 %13, i64* %4
br label %14
14: ; preds = %9
%15 = load i32, i32* %3
%16 = add nsw i32 %15, 1
store i32 %16, i32* %3
br label %5
17: ; preds = %5
%18 = load i32, i32* %2
%19 = load i64, i64* %4
%20 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %18, i64 %19)
ret i32 0
}

LLVM IR (-O2):
@.str = [23 x i8] c"Factorial of %d = %lu\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 10, i64 3628800)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ warterm_erase();
int /*<<< orphan*/ warterm_move(int /*<<< orphan*/, int);
int warterm_endwin() {
  warterm_erase();
  warterm_move(0, 29);
  return 0;
}


x86 assembly (clang, -O0):
<warterm_endwin>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <warterm_erase@plt>
xor    %edi,%edi
mov    $0x1d,%esi
call   1030 <warterm_move@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<warterm_endwin>:
push   %rax
xor    %eax,%eax
call   1040 <warterm_erase@plt>
xor    %edi,%edi
mov    $0x1d,%esi
call   1030 <warterm_move@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @warterm_endwin() {
%1 = call i32 (...) @warterm_erase()
%2 = call i32 @warterm_move(i32 0, i32 29)
ret i32 0
}

LLVM IR (-O2):
define i32 @warterm_endwin() {
%1 = tail call i32 (...) @warterm_erase()
%2 = tail call i32 @warterm_move(i32 0, i32 29)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ ol(char *);
ult() {
  ol("CMP  BX,AX");
  ol("MOV  AX,1");
  ol("JB   $+5");
  ol("MOV  AX,0");
}


x86 assembly (clang, -O0):
<ult>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <ol@plt>
lea    0xee0(%rip),%rdi
call   1030 <ol@plt>
lea    0xede(%rip),%rdi
call   1030 <ol@plt>
lea    0xedb(%rip),%rdi
call   1030 <ol@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ult>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <ol@plt>
lea    0xee7(%rip),%rdi
call   1030 <ol@plt>
lea    0xee5(%rip),%rdi
call   1030 <ol@plt>
lea    0xee2(%rip),%rdi
pop    %rax
jmp    1030 <ol@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"CMP BX,AX\00"
@.str.1 = [10 x i8] c"MOV AX,1\00"
@.str.2 = [9 x i8] c"JB $+5\00"
@.str.3 = [10 x i8] c"MOV AX,0\00"
define i32 @ult() {
%1 = alloca i32
%2 = call i32 @ol(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @ol(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @ol(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
%5 = call i32 @ol(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0))
%6 = load i32, i32* %1
ret i32 %6
}

LLVM IR (-O2):
@.str = [11 x i8] c"CMP BX,AX\00"
@.str.1 = [10 x i8] c"MOV AX,1\00"
@.str.2 = [9 x i8] c"JB $+5\00"
@.str.3 = [10 x i8] c"MOV AX,0\00"
define i32 @ult() {
%1 = tail call i32 @ol(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @ol(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @ol(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @ol(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0))
ret i32 undef
}
int test_imm_A7int8_mem(signed char *val) {
  return ((*val) & (0xA7 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_A7int8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = and i32 %5, 167
%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_A7int8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -89
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ EA_AY_IX_8();
int /*<<< orphan*/ m68ki_write_8(int /*<<< orphan*/, int /*<<< orphan*/);
void m68k_op_sf_8_ix(void) { m68ki_write_8(EA_AY_IX_8(), 0); }


x86 assembly (clang, -O0):
<m68k_op_sf_8_ix>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <EA_AY_IX_8@plt>
mov    %eax,%edi
xor    %esi,%esi
call   1040 <m68ki_write_8@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<m68k_op_sf_8_ix>:
push   %rax
xor    %eax,%eax
call   1030 <EA_AY_IX_8@plt>
mov    %eax,%edi
xor    %esi,%esi
pop    %rax
jmp    1040 <m68ki_write_8@plt>

LLVM IR (-O0):
define void @m68k_op_sf_8_ix() {
%1 = call i32 (...) @EA_AY_IX_8()
%2 = call i32 @m68ki_write_8(i32 %1, i32 0)
ret void
}

LLVM IR (-O2):
define void @m68k_op_sf_8_ix() {
%1 = tail call i32 (...) @EA_AY_IX_8()
%2 = tail call i32 @m68ki_write_8(i32 %1, i32 0)
ret void
}
/* Variables and functions */
void *calloc(int, int);
int /*<<< orphan*/ strncpy(void *, void *, int);
void *stripPKCS7(void *data, int dataLength) {
  void *result;
  result = calloc(dataLength + 1, sizeof(char));
  int paddingLength = ((unsigned char *)data)[dataLength - 1];
  strncpy(result, data, dataLength - paddingLength);
  return result;
}


x86 assembly (clang, -O0):
<stripPKCS7>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
add    $0x1,%edi
mov    $0x1,%esi
call   1040 <calloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movzbl (%rax,%rcx,1),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
sub    -0x1c(%rbp),%edx
call   1030 <strncpy@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stripPKCS7>:
push   %r15
push   %r14
push   %rbx
mov    %esi,%ebx
mov    %rdi,%r14
lea    0x1(%rbx),%edi
mov    $0x1,%esi
call   1040 <calloc@plt>
mov    %rax,%r15
movslq %ebx,%rdx
movzbl -0x1(%rdx,%r14,1),%eax
sub    %eax,%edx
mov    %r15,%rdi
mov    %r14,%rsi
call   1030 <strncpy@plt>
mov    %r15,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @stripPKCS7(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%7 = load i32, i32* %4
%8 = add nsw i32 %7, 1
%9 = call i8* @calloc(i32 %8, i32 1)
store i8* %9, i8** %5
%10 = load i8*, i8** %3
%11 = load i32, i32* %4
%12 = sub nsw i32 %11, 1
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i8, i8* %10, i64 %13
%15 = load i8, i8* %14
%16 = zext i8 %15 to i32
store i32 %16, i32* %6
%17 = load i8*, i8** %5
%18 = load i8*, i8** %3
%19 = load i32, i32* %4
%20 = load i32, i32* %6
%21 = sub nsw i32 %19, %20
%22 = call i32 @strncpy(i8* %17, i8* %18, i32 %21)
%23 = load i8*, i8** %5
ret i8* %23
}

LLVM IR (-O2):
define i8* @stripPKCS7(i8* %0, i32 %1) {
%3 = add nsw i32 %1, 1
%4 = tail call i8* @calloc(i32 %3, i32 1)
%5 = add nsw i32 %1, -1
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = load i8, i8* %7
%9 = zext i8 %8 to i32
%10 = sub nsw i32 %1, %9
%11 = tail call i32 @strncpy(i8* %4, i8* %0, i32 %10)
ret i8* %4
}
int rfcomm_init_ttys(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @rfcomm_init_ttys() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ AcpiShowHeaders();
int AcpiHeaders(int argc, char *argv[]) {
  AcpiShowHeaders();
  return 0;
}


x86 assembly (clang, -O0):
<AcpiHeaders>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <AcpiShowHeaders@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @AcpiHeaders(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 (...) @AcpiShowHeaders()
ret i32 0
}

LLVM IR (-O2):
define i32 @AcpiHeaders(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @AcpiShowHeaders()
ret i32 0
}
int ls_cost_nm4_n_out(void) { return 2; }


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

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

LLVM IR (-O0):
define i32 @ls_cost_nm4_n_out() {
ret i32 2
}

LLVM IR (-O2):
define i32 @ls_cost_nm4_n_out() {
ret i32 2
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void SysTickIntEnable(void) {
  (*((volatile uint32_t *)(0xE000E010))) |= 0x00000002;
}


x86 assembly (clang, -O0):
<SysTickIntEnable>:
push   %rbp
mov    %rsp,%rbp
mov    $0xe000e010,%eax
mov    (%rax),%ecx
or     $0x2,%ecx
mov    $0xe000e010,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<SysTickIntEnable>:
mov    $0xe000e010,%eax
orl    $0x2,(%rax)
ret

LLVM IR (-O0):
define void @SysTickIntEnable() {
%1 = load volatile i32, i32* inttoptr (i64 3758153744 to i32*)
%2 = or i32 %1, 2
store volatile i32 %2, i32* inttoptr (i64 3758153744 to i32*)
ret void
}

LLVM IR (-O2):
define void @SysTickIntEnable() {
%1 = load volatile i32, i32* inttoptr (i64 3758153744 to i32*)
%2 = or i32 %1, 2
store volatile i32 %2, i32* inttoptr (i64 3758153744 to i32*)
ret void
}
void set_bit(unsigned int nr, unsigned long *addr) {
  addr[((nr) / (sizeof(long) * 8))] |= (1UL << ((nr) % (sizeof(long) * 8)));
}


x86 assembly (clang, -O0):
<set_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
and    $0x3f,%rcx
mov    $0x1,%edx
shl    %cl,%rdx
mov    -0x10(%rbp),%rax
mov    -0x4(%rbp),%ecx
shr    $0x6,%rcx
or     (%rax,%rcx,8),%rdx
mov    %rdx,(%rax,%rcx,8)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_bit>:
mov    %edi,%ecx
mov    %edi,%eax
shr    $0x3,%eax
mov    $0x1,%edx
shl    %cl,%rdx
and    $0xfffffff8,%eax
or     %rdx,(%rsi,%rax,1)
ret

LLVM IR (-O0):
define void @set_bit(i32 %0, i64* %1) {
%3 = alloca i32
%4 = alloca i64*
store i32 %0, i32* %3
store i64* %1, i64** %4
%5 = load i32, i32* %3
%6 = zext i32 %5 to i64
%7 = urem i64 %6, 64
%8 = shl i64 1, %7
%9 = load i64*, i64** %4
%10 = load i32, i32* %3
%11 = zext i32 %10 to i64
%12 = udiv i64 %11, 64
%13 = getelementptr inbounds i64, i64* %9, i64 %12
%14 = load i64, i64* %13
%15 = or i64 %14, %8
store i64 %15, i64* %13
ret void
}

LLVM IR (-O2):
define void @set_bit(i32 %0, i64* nocapture %1) {
%3 = zext i32 %0 to i64
%4 = and i64 %3, 63
%5 = shl nuw i64 1, %4
%6 = lshr i64 %3, 6
%7 = getelementptr inbounds i64, i64* %1, i64 %6
%8 = load i64, i64* %7
%9 = or i64 %8, %5
store i64 %9, i64* %7
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memset(char *, char, int);
char *xmalloc(int);
char *char_repeat(int n, char c) {
  char *dest = xmalloc(n + 1);
  memset(dest, c, n);
  dest[n] = '\0';
  return dest;
}


x86 assembly (clang, -O0):
<char_repeat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %edi,-0x4(%rbp)
mov    %al,-0x5(%rbp)
mov    -0x4(%rbp),%edi
add    $0x1,%edi
call   1040 <xmalloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x5(%rbp),%al
mov    -0x4(%rbp),%edx
movsbl %al,%esi
call   1030 <memset@plt>
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<char_repeat>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%r14d
mov    %edi,%ebx
lea    0x1(%rbx),%edi
call   1040 <xmalloc@plt>
mov    %rax,%rbp
mov    %rax,%rdi
mov    %r14d,%esi
mov    %ebx,%edx
call   1030 <memset@plt>
movslq %ebx,%rax
movb   $0x0,0x0(%rbp,%rax,1)
mov    %rbp,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i8* @char_repeat(i32 %0, i8 signext %1) {
%3 = alloca i32
%4 = alloca i8
%5 = alloca i8*
store i32 %0, i32* %3
store i8 %1, i8* %4
%6 = load i32, i32* %3
%7 = add nsw i32 %6, 1
%8 = call i8* @xmalloc(i32 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = load i8, i8* %4
%11 = load i32, i32* %3
%12 = call i32 @memset(i8* %9, i8 signext %10, i32 %11)
%13 = load i8*, i8** %5
%14 = load i32, i32* %3
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8, i8* %13, i64 %15
store i8 0, i8* %16
%17 = load i8*, i8** %5
ret i8* %17
}

LLVM IR (-O2):
define i8* @char_repeat(i32 %0, i8 signext %1) {
%3 = add nsw i32 %0, 1
%4 = tail call i8* @xmalloc(i32 %3)
%5 = tail call i32 @memset(i8* %4, i8 signext %1, i32 %0)
%6 = sext i32 %0 to i64
%7 = getelementptr inbounds i8, i8* %4, i64 %6
store i8 0, i8* %7
ret i8* %4
}
/* Variables and functions */
int rom_present(char *);
int mach64gx_available() { return rom_present("mach64gx/bios.bin"); }


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

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

LLVM IR (-O0):
@.str = [18 x i8] c"mach64gx/bios.bin\00"
define i32 @mach64gx_available() {
%1 = call i32 @rom_present(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}

LLVM IR (-O2):
@.str = [18 x i8] c"mach64gx/bios.bin\00"
define i32 @mach64gx_available() {
%1 = tail call i32 @rom_present(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
void jmp(p, a, s) struct h8_opcode *p;
char *a;
int s;
{ printf("npc = (lval>>1) + saved_state.mem;\n"); }


x86 assembly (clang, -O0):
<jmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
lea    0xed6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.h8_opcode = type opaque
@.str = [36 x i8] c"npc = (lval>>1) + saved_state.mem;\0A\00"
define void @jmp(%struct.h8_opcode* %0, i8* %1, i32 %2) {
%4 = alloca %struct.h8_opcode*
%5 = alloca i8*
%6 = alloca i32
store %struct.h8_opcode* %0, %struct.h8_opcode** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
%struct.h8_opcode = type opaque
@str = [35 x i8] c"npc = (lval>>1) + saved_state.mem;\00"
define void @jmp(%struct.h8_opcode* nocapture readnone %0, i8* nocapture readnone %1, i32 %2) {
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str, i64 0, i64 0))
ret void
}
int isvar(int c) {
  return ((unsigned)((c) - ('a')) <= (unsigned)(('z') - ('a'))) ||
         ((unsigned)((c) - ('A')) <= (unsigned)(('Z') - ('A'))) ||
         ((unsigned)((c) - ('0')) <= (unsigned)(('9') - ('0'))) || c == '_';
}


x86 assembly (clang, -O0):
<isvar>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
sub    $0x61,%ecx
mov    $0x1,%al
cmp    $0x19,%ecx
mov    %al,-0x5(%rbp)
jbe    114d <isvar+0x4d>
mov    -0x4(%rbp),%ecx
sub    $0x41,%ecx
mov    $0x1,%al
cmp    $0x19,%ecx
mov    %al,-0x5(%rbp)
jbe    114d <isvar+0x4d>
mov    -0x4(%rbp),%ecx
sub    $0x30,%ecx
mov    $0x1,%al
cmp    $0x9,%ecx
mov    %al,-0x5(%rbp)
jbe    114d <isvar+0x4d>
cmpl   $0x5f,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isvar>:
lea    -0x61(%rdi),%eax
cmp    $0x1a,%eax
setb   %al
lea    -0x41(%rdi),%ecx
cmp    $0x1a,%ecx
setb   %cl
or     %al,%cl
lea    -0x30(%rdi),%eax
cmp    $0xa,%eax
setb   %al
cmp    $0x5f,%edi
sete   %dl
or     %al,%dl
or     %cl,%dl
movzbl %dl,%eax
ret

LLVM IR (-O0):
define i32 @isvar(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sub nsw i32 %3, 97
%5 = icmp ule i32 %4, 25
br i1 %5, label %17, label %6
6: ; preds = %1
%7 = load i32, i32* %2
%8 = sub nsw i32 %7, 65
%9 = icmp ule i32 %8, 25
br i1 %9, label %17, label %10
10: ; preds = %6
%11 = load i32, i32* %2
%12 = sub nsw i32 %11, 48
%13 = icmp ule i32 %12, 9
br i1 %13, label %17, label %14
14: ; preds = %10
%15 = load i32, i32* %2
%16 = icmp eq i32 %15, 95
br label %17
17: ; preds = %14, %10, %6, %1
%18 = phi i1 [ true, %10 ], [ true, %6 ], [ true, %1 ], [ %16, %14 ]
%19 = zext i1 %18 to i32
ret i32 %19
}

LLVM IR (-O2):
define i32 @isvar(i32 %0) {
%2 = add nsw i32 %0, -97
%3 = icmp ult i32 %2, 26
%4 = add nsw i32 %0, -65
%5 = icmp ult i32 %4, 26
%6 = select i1 %3, i1 true, i1 %5
%7 = add nsw i32 %0, -48
%8 = icmp ult i32 %7, 10
%9 = select i1 %6, i1 true, i1 %8
%10 = icmp eq i32 %0, 95
%11 = or i1 %10, %9
%12 = zext i1 %11 to i32
ret i32 %12
}
void Dummy() {}


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

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

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

LLVM IR (-O2):
define void @Dummy() {
ret void
}
char *procprt_FSUID_e(struct tstat *curstat, int avgval, int nsecs) {
  return "-       ";
}


x86 assembly (clang, -O0):
<procprt_FSUID_e>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
lea    0xeeb(%rip),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.tstat = type opaque
@.str = [9 x i8] c"- \00"
define i8* @procprt_FSUID_e(%struct.tstat* %0, i32 %1, i32 %2) {
%4 = alloca %struct.tstat*
%5 = alloca i32
%6 = alloca i32
store %struct.tstat* %0, %struct.tstat** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
ret i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
%struct.tstat = type opaque
@.str = [9 x i8] c"- \00"
define i8* @procprt_FSUID_e(%struct.tstat* nocapture readnone %0, i32 %1, i32 %2) {
ret i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
void *array_go_at(size_t, size_t, void *, size_t const *);
int /*<<< orphan*/ array_write_at(size_t, size_t, void *, void *,
                                  size_t const *);
void array_copy_at(size_t dim, size_t v_size, void *from, void *to,
                   const size_t from_index[dim], const size_t to_index[dim]) {
  void *data = array_go_at(dim, v_size, from, from_index);
  array_write_at(dim, v_size, to, data, to_index);
}


x86 assembly (clang, -O0):
<array_copy_at>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x28(%rbp),%rcx
call   1040 <array_go_at@plt>
mov    %rax,-0x38(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x38(%rbp),%rcx
mov    -0x30(%rbp),%r8
call   1030 <array_write_at@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<array_copy_at>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %r9,%r14
mov    %rcx,%r15
mov    %rsi,%r12
mov    %rdi,%rbx
mov    %r8,%rcx
call   1040 <array_go_at@plt>
mov    %rbx,%rdi
mov    %r12,%rsi
mov    %r15,%rdx
mov    %rax,%rcx
mov    %r14,%r8
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <array_write_at@plt>

LLVM IR (-O0):
define void @array_copy_at(i64 %0, i64 %1, i8* %2, i8* %3, i64* %4, i64* %5) {
%7 = alloca i64
%8 = alloca i64
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i64*
%12 = alloca i64*
%13 = alloca i8*
store i64 %0, i64* %7
store i64 %1, i64* %8
store i8* %2, i8** %9
store i8* %3, i8** %10
store i64* %4, i64** %11
store i64* %5, i64** %12
%14 = load i64, i64* %7
%15 = load i64, i64* %7
%16 = load i64, i64* %7
%17 = load i64, i64* %8
%18 = load i8*, i8** %9
%19 = load i64*, i64** %11
%20 = call i8* @array_go_at(i64 %16, i64 %17, i8* %18, i64* %19)
store i8* %20, i8** %13
%21 = load i64, i64* %7
%22 = load i64, i64* %8
%23 = load i8*, i8** %10
%24 = load i8*, i8** %13
%25 = load i64*, i64** %12
%26 = call i32 @array_write_at(i64 %21, i64 %22, i8* %23, i8* %24, i64* %25)
ret void
}

LLVM IR (-O2):
define void @array_copy_at(i64 %0, i64 %1, i8* %2, i8* %3, i64* %4, i64* %5) {
%7 = tail call i8* @array_go_at(i64 %0, i64 %1, i8* %2, i64* %4)
%8 = tail call i32 @array_write_at(i64 %0, i64 %1, i8* %3, i8* %7, i64* %5)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ internal_fiat_p521_relax(uintptr_t, uintptr_t);
void fiat_p521_relax(uint64_t out1[9], const uint64_t arg1[9]) {
  internal_fiat_p521_relax((uintptr_t)out1, (uintptr_t)arg1);
}


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

x86 assembly (clang, -O2):
<fiat_p521_relax>:
jmp    1030 <internal_fiat_p521_relax@plt>

LLVM IR (-O0):
define void @fiat_p521_relax(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 = ptrtoint i32* %5 to i64
%7 = load i32*, i32** %4
%8 = ptrtoint i32* %7 to i64
%9 = call i32 @internal_fiat_p521_relax(i64 %6, i64 %8)
ret void
}

LLVM IR (-O2):
define void @fiat_p521_relax(i32* %0, i32* %1) {
%3 = ptrtoint i32* %0 to i64
%4 = ptrtoint i32* %1 to i64
%5 = tail call i32 @internal_fiat_p521_relax(i64 %3, i64 %4)
ret void
}
int compare_int(const void *av, const void *bv) {
  const int *a = (const int *)av;
  const int *b = (const int *)bv;
  if (*a < *b)
    return -1;
  else if (*a > *b)
    return +1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<compare_int>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
mov    -0x28(%rbp),%rcx
cmp    (%rcx),%eax
jge    113a <compare_int+0x3a>
movl   $0xffffffff,-0x4(%rbp)
jmp    115f <compare_int+0x5f>
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
mov    -0x28(%rbp),%rcx
cmp    (%rcx),%eax
jle    1158 <compare_int+0x58>
movl   $0x1,-0x4(%rbp)
jmp    115f <compare_int+0x5f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare_int>:
mov    (%rdi),%eax
xor    %ecx,%ecx
cmp    (%rsi),%eax
setg   %cl
mov    $0xffffffff,%eax
cmovge %ecx,%eax
ret

LLVM IR (-O0):
define i32 @compare_int(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32*
%7 = alloca i32*
store i8* %0, i8** %4
store i8* %1, i8** %5
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i32*
store i32* %9, i32** %6
%10 = load i8*, i8** %5
%11 = bitcast i8* %10 to i32*
store i32* %11, i32** %7
%12 = load i32*, i32** %6
%13 = load i32, i32* %12
%14 = load i32*, i32** %7
%15 = load i32, i32* %14
%16 = icmp slt i32 %13, %15
br i1 %16, label %17, label %18
17: ; preds = %2
store i32 -1, i32* %3
br label %26
18: ; preds = %2
%19 = load i32*, i32** %6
%20 = load i32, i32* %19
%21 = load i32*, i32** %7
%22 = load i32, i32* %21
%23 = icmp sgt i32 %20, %22
br i1 %23, label %24, label %25
24: ; preds = %18
store i32 1, i32* %3
br label %26
25: ; preds = %18
store i32 0, i32* %3
br label %26
26: ; preds = %25, %24, %17
%27 = load i32, i32* %3
ret i32 %27
}

LLVM IR (-O2):
define i32 @compare_int(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = bitcast i8* %1 to i32*
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = icmp slt i32 %5, %6
%8 = icmp sgt i32 %5, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void print_help(void) {
  puts("Grammar constructs:\n"
       " [constant|variable]\n"
       " [+|-|~] expression\n"
       " expression [+|-|*|/|//|^|%|<<|>>|and|or|xor] expression\n"
       " ( expression )\n"
       " [ expression ]\n"
       " { expression }\n"
       " function [(] arg1, arg2, ... [)]\n"
       "\n"
       "Available constants: (case-insensitive)\n"
       " pi, e, inf, nan\n"
       "\n"
       "Available functions:\n"
       " abs, acos, asin, atan, atanh, cbrt, ceil, cos, cosh, dim, exp,\n"
       " exp2, floor, gamma, log, log10, log2, logb, ln, max, min, rint,\n"
       " rt, round, sin, sinh, sqrt, tan, tanh, trunc\n");
}


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

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

LLVM IR (-O0):
@.str = [456 x i8] c"Grammar constructs:\0A [constant|variable]\0A [+|-|~] expression\0A expression [+|-|*|/|//|^|%|<<|>>|and|or|xor] expression\0A ( expression )\0A [ expression ]\0A { expression }\0A function [(] arg1, arg2, ... [)]\0A\0AAvailable constants: (case-insensitive)\0A pi, e, inf, nan\0A\0AAvailable functions:\0A abs, acos, asin, atan, atanh, cbrt, ceil, cos, cosh, dim, exp,\0A exp2, floor, gamma, log, log10, log2, logb, ln, max, min, rint,\0A rt, round, sin, sinh, sqrt, tan, tanh, trunc\0A\00"
define void @print_help() {
%1 = call i32 @puts(i8* getelementptr inbounds ([456 x i8], [456 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [456 x i8] c"Grammar constructs:\0A [constant|variable]\0A [+|-|~] expression\0A expression [+|-|*|/|//|^|%|<<|>>|and|or|xor] expression\0A ( expression )\0A [ expression ]\0A { expression }\0A function [(] arg1, arg2, ... [)]\0A\0AAvailable constants: (case-insensitive)\0A pi, e, inf, nan\0A\0AAvailable functions:\0A abs, acos, asin, atan, atanh, cbrt, ceil, cos, cosh, dim, exp,\0A exp2, floor, gamma, log, log10, log2, logb, ln, max, min, rint,\0A rt, round, sin, sinh, sqrt, tan, tanh, trunc\0A\00"
define void @print_help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([456 x i8], [456 x i8]* @.str, i64 0, i64 0))
ret void
}
int number(int a) {
  int count;
  count = 0;
  if (a > 0) {
    while (a > 0) {
      a--;
      count++;
    }
    return count;
  }
  if (a < 0) {
    while (a < 0) {
      a++;
      count++;
    }
    return count;
  }
  return count;
}


x86 assembly (clang, -O0):
<number>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    1149 <number+0x49>
jmp    111d <number+0x1d>
cmpl   $0x0,-0x8(%rbp)
jle    113e <number+0x3e>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    111d <number+0x1d>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    118a <number+0x8a>
cmpl   $0x0,-0x8(%rbp)
jge    1184 <number+0x84>
jmp    1158 <number+0x58>
cmpl   $0x0,-0x8(%rbp)
jge    1179 <number+0x79>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1158 <number+0x58>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    118a <number+0x8a>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<number>:
mov    %edi,%ecx
neg    %ecx
mov    %edi,%eax
sar    $0x1f,%eax
and    %ecx,%eax
test   %edi,%edi
cmovg  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @number(i32 %0) {
%2 = icmp sgt i32 %0, 0
%3 = icmp slt i32 %0, 0
%4 = sub i32 0, %0
%5 = select i1 %3, i32 %4, i32 0
%6 = select i1 %2, i32 %0, i32 %5
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ const uint64_t;

/* Variables and functions */
__attribute__((always_)) uint64_t B_UNBUF64(void const *const buf) {
  return *(uint64_t const *)buf;
}


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

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

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

LLVM IR (-O2):
define i32 @B_UNBUF64(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
ret i32 %3
}
int main() {
  int x = 1;
  int y = x * 10;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
imul   $0xa,-0x8(%rbp),%eax
mov    %eax,-0xc(%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
%3 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %2
%4 = load i32, i32* %2
%5 = mul nsw i32 %4, 10
store i32 %5, i32* %3
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ e_imm();
int /*<<< orphan*/ e_sbc();
void e_sbc_imm() {
  e_imm();
  e_sbc();
}


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

x86 assembly (clang, -O2):
<e_sbc_imm>:
push   %rax
xor    %eax,%eax
call   1030 <e_imm@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <e_sbc@plt>

LLVM IR (-O0):
define void @e_sbc_imm() {
%1 = call i32 (...) @e_imm()
%2 = call i32 (...) @e_sbc()
ret void
}

LLVM IR (-O2):
define void @e_sbc_imm() {
%1 = tail call i32 (...) @e_imm()
%2 = tail call i32 (...) @e_sbc()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
void baz(float arg) { printf("%2f \n", arg); }


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

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

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

LLVM IR (-O2):
@.str = [6 x i8] c"%2f \0A\00"
define void @baz(float %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), float %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
void post_process(void) { putchar('\n'); }


x86 assembly (clang, -O0):
<post_process>:
push   %rbp
mov    %rsp,%rbp
mov    $0xa,%edi
call   1030 <putchar@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<post_process>:
mov    $0xa,%edi
jmp    1030 <putchar@plt>

LLVM IR (-O0):
define void @post_process() {
%1 = call i32 @putchar(i8 signext 10)
ret void
}

LLVM IR (-O2):
define void @post_process() {
%1 = tail call i32 @putchar(i8 signext 10)
ret void
}
int regex_compile() {
  int c, c1;
  char str[6 + 1];
  c1 = 0;
  for (; 1;) {
    do {
    } while (0);
    if (c1 == 6)
      break;
    str[c1++] = c;
  }
}


x86 assembly (clang, -O0):
<regex_compile>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0xc(%rbp)
mov    $0x1,%al
test   $0x1,%al
jne    111a <regex_compile+0x1a>
jmp    114e <regex_compile+0x4e>
jmp    111f <regex_compile+0x1f>
jmp    1124 <regex_compile+0x24>
cmpl   $0x6,-0xc(%rbp)
jne    1133 <regex_compile+0x33>
jmp    114e <regex_compile+0x4e>
mov    -0x8(%rbp),%eax
mov    %al,%cl
mov    -0xc(%rbp),%eax
mov    %eax,%edx
add    $0x1,%edx
mov    %edx,-0xc(%rbp)
cltq
mov    %cl,-0x13(%rbp,%rax,1)
jmp    110b <regex_compile+0xb>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @regex_compile() {
ret i32 undef
}