xunge/DecIR huggingface dataset:
/* Variables and functions */
int _t_path_depth(int *);
int /*<<< orphan*/ printf(char *, int);
void ppath(int *fp) {
  int d = _t_path_depth(fp);
  for (int i = 0; i < d; i++) {
    printf("%d", fp[i]);
  }
}


x86 assembly (clang, -O0):
<ppath>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <_t_path_depth@plt>
mov    %eax,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1170 <ppath+0x50>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xea3(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    113f <ppath+0x1f>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ppath>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rdi,%r15
call   1040 <_t_path_depth@plt>
test   %eax,%eax
jle    1155 <ppath+0x35>
mov    %eax,%r12d
xor    %ebx,%ebx
lea    0xec0(%rip),%r14
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <ppath+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @ppath(i32* %0) {
%2 = tail call i32 @_t_path_depth(i32* %0)
%3 = icmp sgt i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = zext i32 %2 to i64
br label %7
6: ; preds = %7, %1
ret void
7: ; preds = %4, %7
%8 = phi i64 [ 0, %4 ], [ %12, %7 ]
%9 = getelementptr inbounds i32, i32* %0, i64 %8
%10 = load i32, i32* %9
%11 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = add nuw nsw i64 %8, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %6, label %7
}
/* Variables and functions */
int sqrt(double);
double test6(double a) { return 1 / sqrt(a); }


x86 assembly (clang, -O0):
<test6>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <sqrt@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cltd
idiv   %ecx
cvtsi2sd %eax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test6>:
push   %rax
call   1030 <sqrt@plt>
lea    0x1(%rax),%ecx
xor    %edx,%edx
cmp    $0x3,%ecx
cmovb  %eax,%edx
xorps  %xmm0,%xmm0
cvtsi2sd %edx,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @test6(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i32 @sqrt(double %3)
%5 = sdiv i32 1, %4
%6 = sitofp i32 %5 to double
ret double %6
}

LLVM IR (-O2):
define double @test6(double %0) {
%2 = tail call i32 @sqrt(double %0)
%3 = add i32 %2, 1
%4 = icmp ult i32 %3, 3
%5 = select i1 %4, i32 %2, i32 0
%6 = sitofp i32 %5 to double
ret double %6
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ _HibernateWriteComplete();
void HibernateRTCTrimSet(uint32_t ui32Trim) {
  ;
  (*((volatile uint32_t *)(0x400FC024))) = ui32Trim;
  _HibernateWriteComplete();
}


x86 assembly (clang, -O0):
<HibernateRTCTrimSet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
mov    $0x400fc024,%eax
mov    %ecx,(%rax)
mov    $0x0,%al
call   1030 <_HibernateWriteComplete@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<HibernateRTCTrimSet>:
mov    %edi,0x400fc024
xor    %eax,%eax
jmp    1030 <_HibernateWriteComplete@plt>

LLVM IR (-O0):
define void @HibernateRTCTrimSet(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
store volatile i32 %3, i32* inttoptr (i64 1074774052 to i32*)
%4 = call i32 (...) @_HibernateWriteComplete()
ret void
}

LLVM IR (-O2):
define void @HibernateRTCTrimSet(i32 %0) {
store volatile i32 %0, i32* inttoptr (i64 1074774052 to i32*)
%2 = tail call i32 (...) @_HibernateWriteComplete()
ret void
}
/* Type definitions */
typedef int int64_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
double stdlib_strided_dsmean(int, float *, int);
int main() {
  float x[] = {1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0};
  int64_t N = 4;
  int64_t stride = 2;
  double v = stdlib_strided_dsmean(N, x, stride);
  printf("mean: %lf\n", v);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xece(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xecb(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xec8(%rip),%rax
mov    %rax,-0x8(%rbp)
movl   $0x4,-0x24(%rbp)
movl   $0x2,-0x28(%rbp)
mov    -0x24(%rbp),%edi
lea    -0x20(%rbp),%rsi
mov    -0x28(%rbp),%edx
call   1040 <stdlib_strided_dsmean@plt>
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
lea    0xe9e(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
movaps 0xee5(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xec9(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rsi
mov    $0x4,%edi
mov    $0x2,%edx
call   1040 <stdlib_strided_dsmean@plt>
lea    0xecc(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.x = [8 x float] [float 1.000000e+00, float 2.000000e+00, float 3.000000e+00, float 4.000000e+00, float 5.000000e+00, float 6.000000e+00, float 7.000000e+00, float 8.000000e+00]
@.str = [11 x i8] c"mean: %lf\0A\00"
define i32 @main() {
%1 = alloca [8 x float]
%2 = alloca i32
%3 = alloca i32
%4 = alloca double
%5 = bitcast [8 x float]* %1 to i8*
store i32 4, i32* %2
store i32 2, i32* %3
%6 = load i32, i32* %2
%7 = getelementptr inbounds [8 x float], [8 x float]* %1, i64 0, i64 0
%8 = load i32, i32* %3
%9 = call double @stdlib_strided_dsmean(i32 %6, float* %7, i32 %8)
store double %9, double* %4
%10 = load double, double* %4
%11 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), double %10)
ret i32 0
}

LLVM IR (-O2):
@__const.main.x = [8 x float] [float 1.000000e+00, float 2.000000e+00, float 3.000000e+00, float 4.000000e+00, float 5.000000e+00, float 6.000000e+00, float 7.000000e+00, float 8.000000e+00]
@.str = [11 x i8] c"mean: %lf\0A\00"
define i32 @main() {
%1 = alloca [8 x float]
%2 = bitcast [8 x float]* %1 to i8*
%3 = getelementptr inbounds [8 x float], [8 x float]* %1, i64 0, i64 0
%4 = call double @stdlib_strided_dsmean(i32 4, float* %3, i32 2)
%5 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), double %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ DeinitFields();
void SwitchFrom_17c4x(void) { DeinitFields(); }


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

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

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

LLVM IR (-O2):
define void @SwitchFrom_17c4x() {
%1 = tail call i32 (...) @DeinitFields()
ret void
}
double mu_timer_cpu() { return -1; }


x86 assembly (clang, -O0):
<mu_timer_cpu>:
push   %rbp
mov    %rsp,%rbp
movsd  0xef4(%rip),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<mu_timer_cpu>:
movsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @mu_timer_cpu() {
ret double -1.000000e+00
}

LLVM IR (-O2):
define double @mu_timer_cpu() {
ret double -1.000000e+00
}
int nextMode_0(int m) {
  int _tmp036;
  if (m == 0) {
    _tmp036 = 1;
  } else if (m == 1) {
    _tmp036 = 0;
  }
  return _tmp036;
}


x86 assembly (clang, -O0):
<nextMode_0>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    111d <nextMode_0+0x1d>
movl   $0x1,-0x8(%rbp)
jmp    1133 <nextMode_0+0x33>
cmpl   $0x1,-0x4(%rbp)
jne    112e <nextMode_0+0x2e>
movl   $0x0,-0x8(%rbp)
jmp    1133 <nextMode_0+0x33>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nextMode_0>:
xor    %eax,%eax
cmp    $0x1,%edi
setne  %al
ret

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

LLVM IR (-O2):
define i32 @nextMode_0(i32 %0) {
%2 = icmp ne i32 %0, 1
%3 = zext i1 %2 to i32
ret i32 %3
}
int f(int c, int b, int d) {
  int r, r2, e;
  if (c) {
    r = b + d;
    r2 = d - b;
  } else {
    r2 = d - b;
    e = d + b;
    r = e;
  }
  return r - r2;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     112e <f+0x2e>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    1146 <f+0x46>
mov    -0xc(%rbp),%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
sub    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
lea    (%rsi,%rsi,1),%eax
ret

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

LLVM IR (-O2):
define i32 @f(i32 %0, i32 %1, i32 %2) {
%4 = shl i32 %1, 1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void icmpv4head(int osvers, int osrel, int ossub) {
  printf("intot/s outtot/s  inecho/s inerep/s  "
         "otecho/s oterep/s       _icmpv4_");
}


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

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

LLVM IR (-O0):
@.str = [70 x i8] c"intot/s outtot/s inecho/s inerep/s otecho/s oterep/s _icmpv4_\00"
define void @icmpv4head(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = call i32 @printf(i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [70 x i8] c"intot/s outtot/s inecho/s inerep/s otecho/s oterep/s _icmpv4_\00"
define void @icmpv4head(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([70 x i8], [70 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct timeval {
  scalar_t__ tv_usec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/);
double now() {
  struct timeval tp;
  gettimeofday(&tp, 0);
  return (double)tp.tv_sec + (double)tp.tv_usec * 1.e-6;
}


x86 assembly (clang, -O0):
<now>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
cvtsi2sdq -0x8(%rbp),%xmm1
cvtsi2sdq -0x10(%rbp),%xmm0
movsd  0xec9(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<now>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
cvtsi2sdq 0x10(%rsp),%xmm1
cvtsi2sdq 0x8(%rsp),%xmm0
mulsd  0xeca(%rip),%xmm0
addsd  %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define double @now() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32 0)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%4 = load i64, i64* %3
%5 = sitofp i64 %4 to double
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%7 = load i64, i64* %6
%8 = sitofp i64 %7 to double
%9 = call double @llvm.fmuladd.f64(double %8, double 0x3EB0C6F7A0B5ED8D, double %5)
ret double %9
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
define double @now() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32 0)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%5 = load i64, i64* %4
%6 = sitofp i64 %5 to double
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%8 = load i64, i64* %7
%9 = sitofp i64 %8 to double
%10 = call double @llvm.fmuladd.f64(double %9, double 0x3EB0C6F7A0B5ED8D, double %6)
ret double %10
}
/* Variables and functions */
int /*<<< orphan*/ work();
int main() {
  work();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @work()
ret i32 0
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int /*<<< orphan*/ spi_write_then_read(int, int *, int, int *, int);
uint8_t do_res(int fd) {
  uint8_t buf[4] = {0xAB, 0x00, 0x00, 0x00};
  uint8_t sign = 0;
  spi_write_then_read(fd, buf, 4, &sign, 1);
  return sign;
}


x86 assembly (clang, -O0):
<do_res>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    0xede(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xedb(%rip),%rax
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x20(%rbp),%rsi
mov    $0x4,%edx
lea    -0x24(%rbp),%rcx
mov    $0x1,%r8d
call   1030 <spi_write_then_read@plt>
mov    -0x24(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_res>:
sub    $0x28,%rsp
movaps 0xee5(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movl   $0x0,0xc(%rsp)
lea    0x10(%rsp),%rsi
lea    0xc(%rsp),%rcx
mov    $0x4,%edx
mov    $0x1,%r8d
call   1030 <spi_write_then_read@plt>
mov    0xc(%rsp),%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.do_res.buf = [4 x i32] [i32 171, i32 0, i32 0, i32 0]
define i32 @do_res(i32 %0) {
%2 = alloca i32
%3 = alloca [4 x i32]
%4 = alloca i32
store i32 %0, i32* %2
%5 = bitcast [4 x i32]* %3 to i8*
store i32 0, i32* %4
%6 = load i32, i32* %2
%7 = getelementptr inbounds [4 x i32], [4 x i32]* %3, i64 0, i64 0
%8 = call i32 @spi_write_then_read(i32 %6, i32* %7, i32 4, i32* %4, i32 1)
%9 = load i32, i32* %4
ret i32 %9
}

LLVM IR (-O2):
@__const.do_res.buf = [4 x i32] [i32 171, i32 0, i32 0, i32 0]
define i32 @do_res(i32 %0) {
%2 = alloca [4 x i32]
%3 = alloca i32
%4 = bitcast [4 x i32]* %2 to i8*
%5 = bitcast i32* %3 to i8*
store i32 0, i32* %3
%6 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 0
%7 = call i32 @spi_write_then_read(i32 %0, i32* %6, i32 4, i32* %3, i32 1)
%8 = load i32, i32* %3
ret i32 %8
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char const *);
void log_callback(const char *message, void *alien) {
  fprintf((FILE *)alien, "\nooops: %s\n", message);
}


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

x86 assembly (clang, -O2):
<log_callback>:
mov    %rsi,%rax
mov    %rdi,%rdx
lea    0xee3(%rip),%rsi
mov    %rax,%rdi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"\0Aooops: %s\0A\00"
define void @log_callback(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = bitcast i8* %5 to i32*
%7 = load i8*, i8** %3
%8 = call i32 @fprintf(i32* %6, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %7)
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"\0Aooops: %s\0A\00"
define void @log_callback(i8* %0, i8* nocapture %1) {
%3 = bitcast i8* %1 to i32*
%4 = tail call i32 @fprintf(i32* %3, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ pthread_testcancel();
void pthread_cancel_handler(int sig) {
  pthread_testcancel();
  assert(false);
}


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

x86 assembly (clang, -O2):
<pthread_cancel_handler>:
push   %rax
xor    %eax,%eax
call   1040 <pthread_testcancel@plt>
xor    %edi,%edi
pop    %rax
jmp    1030 <assert@plt>

LLVM IR (-O0):
define void @pthread_cancel_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @pthread_testcancel()
%4 = call i32 @assert(i32 0)
ret void
}

LLVM IR (-O2):
define void @pthread_cancel_handler(i32 %0) {
%2 = tail call i32 (...) @pthread_testcancel()
%3 = tail call i32 @assert(i32 0)
ret void
}
int strunvis(dst, src)
char *dst;
const char *src;
{ return strunvisx(dst, src, 0); }


x86 assembly (clang, -O0):
<strunvis>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
xor    %edx,%edx
mov    $0x0,%al
call   1030 <strunvisx@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strunvis>:
xor    %edx,%edx
xor    %eax,%eax
jmp    1030 <strunvisx@plt>

LLVM IR (-O0):
define i32 @strunvis(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i32 (i8*, i8*, i32, ...) bitcast (i32 (...)* @strunvisx to i32 (i8*, i8*, i32, ...)*)(i8* %5, i8* %6, i32 0)
ret i32 %7
}

LLVM IR (-O2):
define i32 @strunvis(i8* %0, i8* %1) {
%3 = tail call i32 (i8*, i8*, i32, ...) bitcast (i32 (...)* @strunvisx to i32 (i8*, i8*, i32, ...)*)(i8* %0, i8* %1, i32 0)
ret i32 %3
}
void load_cr4(unsigned long cr4) { asm volatile("mov %0, %%cr4" : : "r"(cr4)); }


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

x86 assembly (clang, -O2):
<load_cr4>:
mov    %rdi,%cr4
ret

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

LLVM IR (-O2):
define void @load_cr4(i64 %0) {
tail call void asm sideeffect "mov $0, %cr4", "r,~{dirflag},~{fpsr},~{flags}"(i64 %0)
ret void
}
void RandomFunc(unsigned int input[1], unsigned int output[1]) {
  unsigned int state[1];
  unsigned int local2;
  unsigned int local1;
  {
    state[0UL] = (input[0UL] | 51238316UL) >> 3U;
    local1 = 0UL;
    while (local1 < 0U) {
      local2 = 0UL;
      while (local2 < 0U) {
        local2 += 2UL;
      }
      local1 += 2UL;
    }
    output[0UL] = state[0UL] | 238489436UL;
  }
}


x86 assembly (clang, -O0):
<RandomFunc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
or     $0x30dd5ac,%rax
shr    $0x3,%rax
mov    %eax,-0x14(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jae    115f <RandomFunc+0x5f>
movl   $0x0,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jae    1150 <RandomFunc+0x50>
mov    -0x18(%rbp),%eax
add    $0x2,%rax
mov    %eax,-0x18(%rbp)
jmp    1137 <RandomFunc+0x37>
mov    -0x1c(%rbp),%eax
add    $0x2,%rax
mov    %eax,-0x1c(%rbp)
jmp    1126 <RandomFunc+0x26>
mov    -0x14(%rbp),%eax
or     $0xe370f5c,%rax
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<RandomFunc>:
mov    (%rdi),%eax
shr    $0x3,%eax
or     $0xe77bffd,%eax
mov    %eax,(%rsi)
ret

LLVM IR (-O0):
define void @RandomFunc(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca [1 x i32]
%6 = alloca i32
%7 = alloca i32
store i32* %0, i32** %3
store i32* %1, i32** %4
%8 = load i32*, i32** %3
%9 = getelementptr inbounds i32, i32* %8, i64 0
%10 = load i32, i32* %9
%11 = zext i32 %10 to i64
%12 = or i64 %11, 51238316
%13 = lshr i64 %12, 3
%14 = trunc i64 %13 to i32
%15 = getelementptr inbounds [1 x i32], [1 x i32]* %5, i64 0, i64 0
store i32 %14, i32* %15
store i32 0, i32* %7
br label %16
16: ; preds = %28, %2
%17 = load i32, i32* %7
%18 = icmp ult i32 %17, 0
br i1 %18, label %19, label %33
19: ; preds = %16
store i32 0, i32* %6
br label %20
20: ; preds = %23, %19
%21 = load i32, i32* %6
%22 = icmp ult i32 %21, 0
br i1 %22, label %23, label %28
23: ; preds = %20
%24 = load i32, i32* %6
%25 = zext i32 %24 to i64
%26 = add i64 %25, 2
%27 = trunc i64 %26 to i32
store i32 %27, i32* %6
br label %20
28: ; preds = %20
%29 = load i32, i32* %7
%30 = zext i32 %29 to i64
%31 = add i64 %30, 2
%32 = trunc i64 %31 to i32
store i32 %32, i32* %7
br label %16
33: ; preds = %16
%34 = getelementptr inbounds [1 x i32], [1 x i32]* %5, i64 0, i64 0
%35 = load i32, i32* %34
%36 = zext i32 %35 to i64
%37 = or i64 %36, 238489436
%38 = trunc i64 %37 to i32
%39 = load i32*, i32** %4
%40 = getelementptr inbounds i32, i32* %39, i64 0
store i32 %38, i32* %40
ret void
}

LLVM IR (-O2):
define void @RandomFunc(i32* nocapture %0, i32* nocapture writeonly %1) {
%3 = load i32, i32* %0
%4 = lshr i32 %3, 3
%5 = or i32 %4, 242728957
store i32 %5, i32* %1
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t LOHALF(uint8_t byte) { return byte & 0x0F; }


x86 assembly (clang, -O0):
<LOHALF>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xf,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<LOHALF>:
mov    %edi,%eax
and    $0xf,%eax
ret

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

LLVM IR (-O2):
define i32 @LOHALF(i32 %0) {
%2 = and i32 %0, 15
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  int n = 0;
  if (n = 0)
    printf("rowne\n");
  else
    printf("nierowne\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0x8(%rbp)
xor    %eax,%eax
test   $0x1,%al
jne    113c <main+0x2c>
jmp    114d <main+0x3d>
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
jmp    1159 <main+0x49>
lea    0xeac(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [7 x i8] c"rowne\0A\00"
@.str.1 = [10 x i8] c"nierowne\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
store i32 0, i32* %2
br i1 false, label %3, label %5
3: ; preds = %0
%4 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
br label %7
5: ; preds = %0
%6 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
br label %7
7: ; preds = %5, %3
%8 = load i32, i32* %1
ret i32 %8
}

LLVM IR (-O2):
@str = [9 x i8] c"nierowne\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char *, int);
int strlen(char *);
void delete (char *dest, int n) {
  memcpy(dest, dest + n, strlen(dest) - n + 1);
}


x86 assembly (clang, -O0):
<delete>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
sub    -0xc(%rbp),%edx
add    $0x1,%edx
call   1040 <memcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<delete>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%rbx
movslq %esi,%r15
lea    (%rdi,%r15,1),%r14
call   1030 <strlen@plt>
sub    %r15d,%eax
lea    0x1(%rax),%edx
mov    %rbx,%rdi
mov    %r14,%rsi
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <memcpy@plt>

LLVM IR (-O0):
define void @delete(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 i8*, i8** %3
%7 = load i32, i32* %4
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %6, i64 %8
%10 = load i8*, i8** %3
%11 = call i32 @strlen(i8* %10)
%12 = load i32, i32* %4
%13 = sub nsw i32 %11, %12
%14 = add nsw i32 %13, 1
%15 = call i32 @memcpy(i8* %5, i8* %9, i32 %14)
ret void
}

LLVM IR (-O2):
define void @delete(i8* %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = tail call i32 @strlen(i8* %0)
%6 = sub i32 1, %1
%7 = add i32 %6, %5
%8 = tail call i32 @memcpy(i8* %0, i8* %4, i32 %7)
ret void
}
double two_d_plus_1(int index, double x) { return 2 * index + 1; }


x86 assembly (clang, -O0):
<two_d_plus_1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
add    $0x1,%eax
cvtsi2sd %eax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<two_d_plus_1>:
lea    (%rdi,%rdi,1),%eax
add    $0x1,%eax
cvtsi2sd %eax,%xmm0
ret

LLVM IR (-O0):
define double @two_d_plus_1(i32 %0, double %1) {
%3 = alloca i32
%4 = alloca double
store i32 %0, i32* %3
store double %1, double* %4
%5 = load i32, i32* %3
%6 = mul nsw i32 2, %5
%7 = add nsw i32 %6, 1
%8 = sitofp i32 %7 to double
ret double %8
}

LLVM IR (-O2):
define double @two_d_plus_1(i32 %0, double %1) {
%3 = shl nsw i32 %0, 1
%4 = or i32 %3, 1
%5 = sitofp i32 %4 to double
ret double %5
}
/* Variables and functions */
unsigned char ds1337_read_register(int);
int /*<<< orphan*/ ds1337_write_register(int, unsigned char);
void ds1337_enable_interrupts() {
  unsigned char data = ds1337_read_register(0x0E);
  data |= 0x6;
  ds1337_write_register(0x0E, data);
}


x86 assembly (clang, -O0):
<ds1337_enable_interrupts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0xe,%edi
call   1040 <ds1337_read_register@plt>
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
or     $0x6,%eax
mov    %al,-0x1(%rbp)
mov    $0xe,%edi
movzbl -0x1(%rbp),%esi
call   1030 <ds1337_write_register@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ds1337_enable_interrupts>:
push   %rax
mov    $0xe,%edi
call   1040 <ds1337_read_register@plt>
or     $0x6,%al
movzbl %al,%esi
mov    $0xe,%edi
pop    %rax
jmp    1030 <ds1337_write_register@plt>

LLVM IR (-O0):
define void @ds1337_enable_interrupts() {
%1 = alloca i8
%2 = call zeroext i8 @ds1337_read_register(i32 14)
store i8 %2, i8* %1
%3 = load i8, i8* %1
%4 = zext i8 %3 to i32
%5 = or i32 %4, 6
%6 = trunc i32 %5 to i8
store i8 %6, i8* %1
%7 = load i8, i8* %1
%8 = call i32 @ds1337_write_register(i32 14, i8 zeroext %7)
ret void
}

LLVM IR (-O2):
define void @ds1337_enable_interrupts() {
%1 = tail call zeroext i8 @ds1337_read_register(i32 14)
%2 = or i8 %1, 6
%3 = tail call i32 @ds1337_write_register(i32 14, i8 zeroext %2)
ret void
}
double cos(double d) {
  double res;
  asm("fcos" : "=t"(res) : "0"(d));
  return res;
}


x86 assembly (clang, -O0):
<cos>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
fldl   -0x18(%rbp)
fcos
fstpl  -0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<cos>:
movsd  %xmm0,-0x8(%rsp)
fldl   -0x8(%rsp)
fcos
fstpl  -0x10(%rsp)
movsd  -0x10(%rsp),%xmm0
ret

LLVM IR (-O0):
define double @cos(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = call double asm "fcos", "={st},0,~{dirflag},~{fpsr},~{flags}"(double %4)
store double %5, double* %3
%6 = load double, double* %3
ret double %6
}

LLVM IR (-O2):
define double @cos(double %0) {
%2 = tail call double asm "fcos", "={st},0,~{dirflag},~{fpsr},~{flags}"(double %0)
ret double %2
}
adr0indreg1_set(r0, r1, x0, x1, p0, p1) int r0, r1;
int *p0, *p1;
{ (*((int *)10000000)) = (*p1); }


x86 assembly (clang, -O0):
<adr0indreg1_set>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    (%rax),%ecx
mov    $0x989680,%eax
mov    %ecx,(%rax)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<adr0indreg1_set>:
mov    (%r9),%eax
mov    %eax,0x989680
ret

LLVM IR (-O0):
define i32 @adr0indreg1_set(i32 %0, i32 %1, i32 %2, i32 %3, i32* %4, i32* %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32*
%13 = alloca i32*
store i32 %0, i32* %8
store i32 %1, i32* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i32* %4, i32** %12
store i32* %5, i32** %13
%14 = load i32*, i32** %13
%15 = load i32, i32* %14
store i32 %15, i32* inttoptr (i64 10000000 to i32*)
%16 = load i32, i32* %7
ret i32 %16
}

LLVM IR (-O2):
define i32 @adr0indreg1_set(i32 %0, i32 %1, i32 %2, i32 %3, i32* nocapture readnone %4, i32* nocapture %5) {
%7 = load i32, i32* %5
store i32 %7, i32* inttoptr (i64 10000000 to i32*)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void printindent(int indent) {
  int i;
  for (i = 0; i < indent; i++)
    printf("    ");
}


x86 assembly (clang, -O0):
<printindent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1148 <printindent+0x38>
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <printindent+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printindent>:
push   %r14
push   %rbx
push   %rax
test   %edi,%edi
jle    113d <printindent+0x2d>
mov    %edi,%ebx
lea    0xedf(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0xffffffff,%ebx
jne    1130 <printindent+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c" \00"
define void @printindent(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %8
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 0, %1 ]
%5 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%6 = add nuw nsw i32 %4, 1
%7 = icmp eq i32 %6, %0
br i1 %7, label %8, label %3
8: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ nand_addr(unsigned int);
void nand_send_addr(unsigned int addr) {
  nand_addr(addr & 0xff);
  nand_addr((addr >> 8) & 0x7);
  nand_addr((addr >> 11) & 0xff);
  nand_addr((addr >> 19) & 0xff);
  nand_addr((addr >> 27) & 0xff);
}


x86 assembly (clang, -O0):
<nand_send_addr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
and    $0xff,%edi
call   1030 <nand_addr@plt>
mov    -0x4(%rbp),%edi
shr    $0x8,%edi
and    $0x7,%edi
call   1030 <nand_addr@plt>
mov    -0x4(%rbp),%edi
shr    $0xb,%edi
and    $0xff,%edi
call   1030 <nand_addr@plt>
mov    -0x4(%rbp),%edi
shr    $0x13,%edi
and    $0xff,%edi
call   1030 <nand_addr@plt>
mov    -0x4(%rbp),%edi
shr    $0x1b,%edi
and    $0xff,%edi
call   1030 <nand_addr@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nand_send_addr>:
push   %rbx
mov    %edi,%ebx
movzbl %bl,%edi
call   1030 <nand_addr@plt>
mov    %ebx,%edi
shr    $0x8,%edi
and    $0x7,%edi
call   1030 <nand_addr@plt>
mov    %ebx,%eax
shr    $0xb,%eax
movzbl %al,%edi
call   1030 <nand_addr@plt>
mov    %ebx,%eax
shr    $0x13,%eax
movzbl %al,%edi
call   1030 <nand_addr@plt>
shr    $0x1b,%ebx
mov    %ebx,%edi
pop    %rbx
jmp    1030 <nand_addr@plt>

LLVM IR (-O0):
define void @nand_send_addr(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 255
%5 = call i32 @nand_addr(i32 %4)
%6 = load i32, i32* %2
%7 = lshr i32 %6, 8
%8 = and i32 %7, 7
%9 = call i32 @nand_addr(i32 %8)
%10 = load i32, i32* %2
%11 = lshr i32 %10, 11
%12 = and i32 %11, 255
%13 = call i32 @nand_addr(i32 %12)
%14 = load i32, i32* %2
%15 = lshr i32 %14, 19
%16 = and i32 %15, 255
%17 = call i32 @nand_addr(i32 %16)
%18 = load i32, i32* %2
%19 = lshr i32 %18, 27
%20 = and i32 %19, 255
%21 = call i32 @nand_addr(i32 %20)
ret void
}

LLVM IR (-O2):
define void @nand_send_addr(i32 %0) {
%2 = and i32 %0, 255
%3 = tail call i32 @nand_addr(i32 %2)
%4 = lshr i32 %0, 8
%5 = and i32 %4, 7
%6 = tail call i32 @nand_addr(i32 %5)
%7 = lshr i32 %0, 11
%8 = and i32 %7, 255
%9 = tail call i32 @nand_addr(i32 %8)
%10 = lshr i32 %0, 19
%11 = and i32 %10, 255
%12 = tail call i32 @nand_addr(i32 %11)
%13 = lshr i32 %0, 27
%14 = tail call i32 @nand_addr(i32 %13)
ret void
}
/* Variables and functions */
int rename(char const *, char const *);
int os_rename(const char *actual_name, const char *new_name) {
  return rename(actual_name, new_name);
}


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

x86 assembly (clang, -O2):
<os_rename>:
jmp    1030 <rename@plt>

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

LLVM IR (-O2):
define i32 @os_rename(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @rename(i8* %0, i8* %1)
ret i32 %3
}
/* Variables and functions */
int SIGUSR1;
int main() {
  int i = SIGUSR1;
  return 0;
}


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

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

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

LLVM IR (-O2):
@SIGUSR1 = global i32 0
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *, char);
int main() {
  char x;
  for (x = 'a'; x <= 'd'; x++)
    if (((x != 'a') + (x == 'c') + (x == 'd') + (x != 'd')) == 3)
      break;
  printf("%c", x);
  getchar();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movb   $0x61,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x64,%eax
jg     11a5 <main+0x85>
movsbl -0x5(%rbp),%eax
cmp    $0x61,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
movsbl -0x5(%rbp),%ecx
cmp    $0x63,%ecx
sete   %cl
and    $0x1,%cl
movzbl %cl,%ecx
add    %ecx,%eax
movsbl -0x5(%rbp),%ecx
cmp    $0x64,%ecx
sete   %cl
and    $0x1,%cl
movzbl %cl,%ecx
add    %ecx,%eax
movsbl -0x5(%rbp),%ecx
cmp    $0x64,%ecx
setne  %cl
and    $0x1,%cl
movzbl %cl,%ecx
add    %ecx,%eax
cmp    $0x3,%eax
jne    1193 <main+0x73>
jmp    11a5 <main+0x85>
jmp    1198 <main+0x78>
mov    -0x5(%rbp),%al
add    $0x1,%al
mov    %al,-0x5(%rbp)
jmp    1133 <main+0x13>
lea    0xe54(%rip),%rdi
movsbl -0x5(%rbp),%esi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
store i32 0, i32* %1
store i8 97, i8* %2
br label %3
3: ; preds = %30, %0
%4 = load i8, i8* %2
%5 = sext i8 %4 to i32
%6 = icmp sle i32 %5, 100
br i1 %6, label %7, label %33
7: ; preds = %3
%8 = load i8, i8* %2
%9 = sext i8 %8 to i32
%10 = icmp ne i32 %9, 97
%11 = zext i1 %10 to i32
%12 = load i8, i8* %2
%13 = sext i8 %12 to i32
%14 = icmp eq i32 %13, 99
%15 = zext i1 %14 to i32
%16 = add nsw i32 %11, %15
%17 = load i8, i8* %2
%18 = sext i8 %17 to i32
%19 = icmp eq i32 %18, 100
%20 = zext i1 %19 to i32
%21 = add nsw i32 %16, %20
%22 = load i8, i8* %2
%23 = sext i8 %22 to i32
%24 = icmp ne i32 %23, 100
%25 = zext i1 %24 to i32
%26 = add nsw i32 %21, %25
%27 = icmp eq i32 %26, 3
br i1 %27, label %28, label %29
28: ; preds = %7
br label %33
29: ; preds = %7
br label %30
30: ; preds = %29
%31 = load i8, i8* %2
%32 = add i8 %31, 1
store i8 %32, i8* %2
br label %3
33: ; preds = %28, %3
%34 = load i8, i8* %2
%35 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %34)
%36 = call i32 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext 99)
%2 = tail call i32 (...) @getchar()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ echo_off();
int /*<<< orphan*/ echo_on();
int /*<<< orphan*/ putchar(char);
int /*<<< orphan*/ scanf(char *, char *);
void input_token(char *s) {
  echo_off();
  scanf("%s", s);
  echo_on();
  putchar('\n');
}


x86 assembly (clang, -O0):
<input_token>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1050 <echo_off@plt>
mov    -0x8(%rbp),%rsi
lea    0xea2(%rip),%rdi
call   1060 <scanf@plt>
mov    $0x0,%al
call   1040 <echo_on@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<input_token>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1050 <echo_off@plt>
lea    0xeae(%rip),%rdi
mov    %rbx,%rsi
call   1060 <scanf@plt>
xor    %eax,%eax
call   1040 <echo_on@plt>
mov    $0xa,%edi
pop    %rbx
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define void @input_token(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @echo_off()
%4 = load i8*, i8** %2
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 (...) @echo_on()
%7 = call i32 @putchar(i8 signext 10)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @input_token(i8* %0) {
%2 = tail call i32 (...) @echo_off()
%3 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 (...) @echo_on()
%5 = tail call i32 @putchar(i8 signext 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned int, unsigned char, char const *);
void zraiseArityError(unsigned int passed, unsigned char expected,
                      const char *fname) {
  printf("Error: %u argument(s) passed to %u-ary function %s().\n", passed,
         expected, fname);
}


x86 assembly (clang, -O0):
<zraiseArityError>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %edi,-0x4(%rbp)
mov    %al,-0x5(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x5(%rbp),%al
mov    -0x10(%rbp),%rcx
lea    0xeca(%rip),%rdi
movzbl %al,%edx
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zraiseArityError>:
mov    %rdx,%rcx
mov    %esi,%edx
mov    %edi,%esi
lea    0xee2(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [55 x i8] c"Error: %u argument(s) passed to %u-ary function %s().\0A\00"
define void @zraiseArityError(i32 %0, i8 zeroext %1, i8* %2) {
%4 = alloca i32
%5 = alloca i8
%6 = alloca i8*
store i32 %0, i32* %4
store i8 %1, i8* %5
store i8* %2, i8** %6
%7 = load i32, i32* %4
%8 = load i8, i8* %5
%9 = load i8*, i8** %6
%10 = call i32 @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0), i32 %7, i8 zeroext %8, i8* %9)
ret void
}

LLVM IR (-O2):
@.str = [55 x i8] c"Error: %u argument(s) passed to %u-ary function %s().\0A\00"
define void @zraiseArityError(i32 %0, i8 zeroext %1, i8* %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0), i32 %0, i8 zeroext %1, i8* %2)
ret void
}
/* Type definitions */
struct vm_area_struct {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ flush_tlb_page(struct vm_area_struct *, unsigned long);
void flush_hugetlb_page(struct vm_area_struct *vma, unsigned long vmaddr) {
  flush_tlb_page(vma, vmaddr);
}


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

x86 assembly (clang, -O2):
<flush_hugetlb_page>:
jmp    1030 <flush_tlb_page@plt>

LLVM IR (-O0):
%struct.vm_area_struct = type { i32 }
define void @flush_hugetlb_page(%struct.vm_area_struct* %0, i64 %1) {
%3 = alloca %struct.vm_area_struct*
%4 = alloca i64
store %struct.vm_area_struct* %0, %struct.vm_area_struct** %3
store i64 %1, i64* %4
%5 = load %struct.vm_area_struct*, %struct.vm_area_struct** %3
%6 = load i64, i64* %4
%7 = call i32 @flush_tlb_page(%struct.vm_area_struct* %5, i64 %6)
ret void
}

LLVM IR (-O2):
%struct.vm_area_struct = type { i32 }
define void @flush_hugetlb_page(%struct.vm_area_struct* %0, i64 %1) {
%3 = tail call i32 @flush_tlb_page(%struct.vm_area_struct* %0, i64 %1)
ret void
}
/* Type definitions */
typedef int __int64_t;

/* Variables and functions */
__int64_t sqr(__int64_t a) { return a * a; }


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

x86 assembly (clang, -O2):
<sqr>:
mov    %edi,%eax
imul   %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @sqr(i32 %0) {
%2 = mul nsw i32 %0, %0
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printk(char *);
int open(const char *path, int oflag, ...) {
  printk("Write open();\n");
  return -1;
}


x86 assembly (clang, -O0):
<open>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <printk@plt>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [15 x i8] c"Write open();\0A\00"
define i32 @open(i8* %0, i32 %1, ...) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = call i32 @printk(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret i32 -1
}

LLVM IR (-O2):
@.str = [15 x i8] c"Write open();\0A\00"
define i32 @open(i8* nocapture readnone %0, i32 %1, ...) {
%3 = tail call i32 @printk(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret i32 -1
}
void g(int x, int y, int *z) {
  if (x > 0) {
    g(x - 1, y, z);
    *z = *z + 1;
  } else
    *z = y;
}


x86 assembly (clang, -O0):
<g>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    1152 <g+0x42>
mov    -0x4(%rbp),%edi
sub    $0x1,%edi
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%rdx
call   1030 <g@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
jmp    115b <g+0x4b>
mov    -0x8(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<g>:
push   %rbx
mov    %rdx,%rbx
test   %edi,%edi
jle    1128 <g+0x18>
add    $0xffffffff,%edi
mov    %rbx,%rdx
call   1030 <g@plt>
mov    (%rbx),%esi
add    $0x1,%esi
mov    %esi,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @g(i32 %0, i32 %1, i32* nocapture %2) {
%4 = icmp sgt i32 %0, 0
br i1 %4, label %5, label %9
5: ; preds = %3
%6 = add nsw i32 %0, -1
tail call void @g(i32 %6, i32 %1, i32* %2)
%7 = load i32, i32* %2
%8 = add nsw i32 %7, 1
br label %9
9: ; preds = %3, %5
%10 = phi i32 [ %8, %5 ], [ %1, %3 ]
store i32 %10, i32* %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ freelist_f(void **, size_t, int /*<<< orphan*/ *);
void freelist(void **list, size_t size) { freelist_f(list, size, NULL); }


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

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

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

LLVM IR (-O2):
define void @freelist(i8** %0, i64 %1) {
%3 = tail call i32 @freelist_f(i8** %0, i64 %1, i32* null)
ret void
}