xunge/DecIR huggingface dataset:
unsigned int EasyLifeElfUp(char *text) {
  unsigned int h = 0, g;
  while (*text) {
    h = (h << 4) + *text;
    if ((g = h & 0xF0000000))
      h ^= g >> 24;
    h &= ~g;
    text++;
  }
  return h;
}


x86 assembly (clang, -O0):
<EasyLifeElfUp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     116b <EasyLifeElfUp+0x6b>
mov    -0xc(%rbp),%eax
shl    $0x4,%eax
mov    -0x8(%rbp),%rcx
movsbl (%rcx),%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
and    $0xf0000000,%eax
mov    %eax,-0x10(%rbp)
cmp    $0x0,%eax
je     114e <EasyLifeElfUp+0x4e>
mov    -0x10(%rbp),%eax
shr    $0x18,%eax
xor    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
xor    $0xffffffff,%eax
and    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110f <EasyLifeElfUp+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<EasyLifeElfUp>:
mov    (%rdi),%cl
test   %cl,%cl
je     1136 <EasyLifeElfUp+0x36>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
shl    $0x4,%eax
movsbl %cl,%ecx
add    %eax,%ecx
mov    %ecx,%eax
and    $0xf0000000,%eax
mov    %eax,%edx
shr    $0x18,%edx
xor    %ecx,%edx
not    %eax
and    %edx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <EasyLifeElfUp+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @EasyLifeElfUp(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %19, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %17, %4 ], [ %2, %1 ]
%6 = phi i8* [ %16, %4 ], [ %0, %1 ]
%7 = phi i32 [ %15, %4 ], [ 0, %1 ]
%8 = shl i32 %7, 4
%9 = sext i8 %5 to i32
%10 = add i32 %8, %9
%11 = and i32 %10, -268435456
%12 = lshr exact i32 %11, 24
%13 = xor i32 %12, %10
%14 = xor i32 %11, -1
%15 = and i32 %13, %14
%16 = getelementptr inbounds i8, i8* %6, i64 1
%17 = load i8, i8* %16
%18 = icmp eq i8 %17, 0
br i1 %18, label %19, label %4
19: ; preds = %4, %1
%20 = phi i32 [ 0, %1 ], [ %15, %4 ]
ret i32 %20
}
/* Variables and functions */
int __builtin_arm_ldrex(int *);
int __builtin_arm_strex(int, int *);
int atomic_inc(int *addr) {
  int Failure, OldVal;
  do {
    OldVal = __builtin_arm_ldrex(addr);
    Failure = __builtin_arm_strex(OldVal + 1, addr);
  } while (Failure);
  return OldVal;
}


x86 assembly (clang, -O0):
<atomic_inc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <__builtin_arm_ldrex@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%edi
add    $0x1,%edi
mov    -0x8(%rbp),%rsi
call   1030 <__builtin_arm_strex@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    112c <atomic_inc+0xc>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<atomic_inc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
nopw   0x0(%rax,%rax,1)
mov    %r14,%rdi
call   1040 <__builtin_arm_ldrex@plt>
mov    %eax,%ebx
lea    0x1(%rbx),%edi
mov    %r14,%rsi
call   1030 <__builtin_arm_strex@plt>
test   %eax,%eax
jne    1130 <atomic_inc+0x10>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @atomic_inc(i32* %0) {
br label %2
2: ; preds = %2, %1
%3 = tail call i32 @__builtin_arm_ldrex(i32* %0)
%4 = add nsw i32 %3, 1
%5 = tail call i32 @__builtin_arm_strex(i32 %4, i32* %0)
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %2
7: ; preds = %2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ lpc_uart_reg_write(int /*<<< orphan*/, char);
scalar_t__ lpc_uart_tx_full();
void lpc_uart_write(char c) {
  while (lpc_uart_tx_full()) {
    ;
  }
  lpc_uart_reg_write(0, c);
}


x86 assembly (clang, -O0):
<lpc_uart_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x0,%al
call   1030 <lpc_uart_tx_full@plt>
cmp    $0x0,%rax
je     1144 <lpc_uart_write+0x24>
jmp    112e <lpc_uart_write+0xe>
xor    %edi,%edi
movsbl -0x1(%rbp),%esi
call   1040 <lpc_uart_reg_write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lpc_uart_write>:
push   %rbx
mov    %edi,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
xor    %eax,%eax
call   1030 <lpc_uart_tx_full@plt>
test   %rax,%rax
jne    1130 <lpc_uart_write+0x10>
movsbl %bl,%esi
xor    %edi,%edi
pop    %rbx
jmp    1040 <lpc_uart_reg_write@plt>

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

LLVM IR (-O2):
define void @lpc_uart_write(i8 signext %0) {
br label %2
2: ; preds = %2, %1
%3 = tail call i64 (...) @lpc_uart_tx_full()
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %2
5: ; preds = %2
%6 = tail call i32 @lpc_uart_reg_write(i32 0, i8 signext %0)
ret void
}
/* Variables and functions */
double atan(double);
int /*<<< orphan*/ printf(char *, double, double);
int main() {
  double x, ret, val;
  x = 1.0;
  val = 180.0 / 3.14159265;
  ret = atan(x) * val;
  printf("The arc tangent of %lf is %lf degrees\n", x, ret);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xed1(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xebc(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1040 <atan@plt>
mulsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
lea    0xea2(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movsd  0xed7(%rip),%xmm0
call   1040 <atan@plt>
lea    0xedb(%rip),%rdi
movsd  0xecb(%rip),%xmm1
movsd  0xebb(%rip),%xmm0
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [39 x i8] c"The arc tangent of %lf is %lf degrees\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
%4 = alloca double
store i32 0, i32* %1
store double 1.000000e+00, double* %2
store double 0x404CA5DC1AF05A77, double* %4
%5 = load double, double* %2
%6 = call double @atan(double %5)
%7 = load double, double* %4
%8 = fmul double %6, %7
store double %8, double* %3
%9 = load double, double* %2
%10 = load double, double* %3
%11 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), double %9, double %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [39 x i8] c"The arc tangent of %lf is %lf degrees\0A\00"
define i32 @main() {
%1 = tail call double @atan(double 1.000000e+00)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), double 1.000000e+00, double 0x40468000006E6C71)
ret i32 0
}
/* Type definitions */
struct timeval {
  int tv_sec;
  long tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
long myclock() {
  struct timeval tv;
  gettimeofday(&tv, NULL);
  return (tv.tv_sec * 1000000) + tv.tv_usec;
}


x86 assembly (clang, -O0):
<myclock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
imul   $0xf4240,-0x10(%rbp),%eax
cltq
add    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<myclock>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
movslq 0x8(%rsp),%rax
imul   $0xf4240,%rax,%rax
add    0x10(%rsp),%rax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i64 }
define i64 @myclock() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%4 = load i32, i32* %3
%5 = mul nsw i32 %4, 1000000
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%8 = load i64, i64* %7
%9 = add nsw i64 %6, %8
ret i64 %9
}

LLVM IR (-O2):
%struct.timeval = type { i32, i64 }
define i64 @myclock() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load i32, i32* %4
%6 = mul nsw i32 %5, 1000000
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%9 = load i64, i64* %8
%10 = add nsw i64 %9, %7
ret i64 %10
}
int f(int a) {
  int b = -0x7fffffff - 1;
  a &= b;
  return a == b;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x80000000,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
mov    %edi,%eax
shr    $0x1f,%eax
ret

LLVM IR (-O0):
define i32 @f(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 -2147483648, i32* %3
%4 = load i32, i32* %3
%5 = load i32, i32* %2
%6 = and i32 %5, %4
store i32 %6, i32* %2
%7 = load i32, i32* %2
%8 = load i32, i32* %3
%9 = icmp eq i32 %7, %8
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @f(i32 %0) {
%2 = lshr i32 %0, 31
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int kj, ni;
  scanf("\n%d", &kj);
  ni = kj * kj;
  printf("\n%d", ni);
  ni = ni * kj;
  printf("\n%d", ni);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xead(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xe94(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
lea    0xed6(%rip),%rbx
lea    0x4(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
mov    0x4(%rsp),%ebp
imul   %ebp,%ebp
mov    %rbx,%rdi
mov    %ebp,%esi
call   1030 <printf@plt>
imul   0x4(%rsp),%ebp
mov    %rbx,%rdi
mov    %ebp,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"\0A%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
%6 = load i32, i32* %2
%7 = mul nsw i32 %5, %6
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = load i32, i32* %3
%11 = load i32, i32* %2
%12 = mul nsw i32 %10, %11
store i32 %12, i32* %3
%13 = load i32, i32* %3
%14 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %13)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"\0A%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = mul nsw i32 %4, %4
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i32, i32* %1
%8 = mul nsw i32 %7, %5
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %8)
ret i32 0
}
/* Variables and functions */
double mercatorY(double);
double geohashGetYMercator(double lat) {
  if (lat > 90 || lat < -90) {
    return lat;
  }
  return mercatorY(lat);
}


x86 assembly (clang, -O0):
<geohashGetYMercator>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xed6(%rip),%xmm1
ucomisd %xmm1,%xmm0
ja     1147 <geohashGetYMercator+0x37>
movsd  0xecc(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    1156 <geohashGetYMercator+0x46>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1165 <geohashGetYMercator+0x55>
movsd  -0x10(%rbp),%xmm0
call   1030 <mercatorY@plt>
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<geohashGetYMercator>:
ucomisd 0xee8(%rip),%xmm0
ja     112d <geohashGetYMercator+0x1d>
movsd  0xee6(%rip),%xmm1
ucomisd %xmm0,%xmm1
ja     112d <geohashGetYMercator+0x1d>
jmp    1030 <mercatorY@plt>
ret

LLVM IR (-O0):
define double @geohashGetYMercator(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp ogt double %4, 9.000000e+01
br i1 %5, label %9, label %6
6: ; preds = %1
%7 = load double, double* %3
%8 = fcmp olt double %7, -9.000000e+01
br i1 %8, label %9, label %11
9: ; preds = %6, %1
%10 = load double, double* %3
store double %10, double* %2
br label %14
11: ; preds = %6
%12 = load double, double* %3
%13 = call double @mercatorY(double %12)
store double %13, double* %2
br label %14
14: ; preds = %11, %9
%15 = load double, double* %2
ret double %15
}

LLVM IR (-O2):
define double @geohashGetYMercator(double %0) {
%2 = fcmp ogt double %0, 9.000000e+01
%3 = fcmp olt double %0, -9.000000e+01
%4 = or i1 %2, %3
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call double @mercatorY(double %0)
br label %7
7: ; preds = %1, %5
%8 = phi double [ %6, %5 ], [ %0, %1 ]
ret double %8
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
char *fgets(char *s __attribute__((unused)), int size __attribute__((unused)),
            FILE *stream __attribute__((unused))) {
  return NULL;
}


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

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

LLVM IR (-O0):
define i8* @fgets(i8* %0, i32 %1, i32* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32* %2, i32** %6
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @fgets(i8* nocapture readnone %0, i32 %1, i32* nocapture readnone %2) {
ret i8* null
}
/* Variables and functions */
int errno;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char const *);
void __attribute__((noreturn))
scheme_posix_error(char const *message, int posix_errno) {
  errno = posix_errno;
  perror(message);
  exit(1);
}


x86 assembly (clang, -O0):
<scheme_posix_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    0x2ea7(%rip),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rdi
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<scheme_posix_error>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    %esi,(%rax)
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@errno = global i32 0
define void @scheme_posix_error(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
store i32 %5, i32* @errno
%6 = load i8*, i8** %3
%7 = call i32 @perror(i8* %6)
%8 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@errno = global i32 0
define void @scheme_posix_error(i8* nocapture %0, i32 %1) {
store i32 %1, i32* @errno
%3 = tail call i32 @perror(i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
int main() {
  int a, b;
  a = b + b + b + b + b + b + b + b + b + b + b;
  return a;
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = load i32, i32* %3
%5 = load i32, i32* %3
%6 = add nsw i32 %4, %5
%7 = load i32, i32* %3
%8 = add nsw i32 %6, %7
%9 = load i32, i32* %3
%10 = add nsw i32 %8, %9
%11 = load i32, i32* %3
%12 = add nsw i32 %10, %11
%13 = load i32, i32* %3
%14 = add nsw i32 %12, %13
%15 = load i32, i32* %3
%16 = add nsw i32 %14, %15
%17 = load i32, i32* %3
%18 = add nsw i32 %16, %17
%19 = load i32, i32* %3
%20 = add nsw i32 %18, %19
%21 = load i32, i32* %3
%22 = add nsw i32 %20, %21
%23 = load i32, i32* %3
%24 = add nsw i32 %22, %23
store i32 %24, i32* %2
%25 = load i32, i32* %2
ret i32 %25
}

LLVM IR (-O2):
define i32 @main() {
ret i32 undef
}
/* Variables and functions */
void *ets_memcpy(void *, void const *, unsigned int);
void *memcpy(void *str1, const void *str2, unsigned int n) {
  return ets_memcpy(str1, str2, n);
}


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

x86 assembly (clang, -O2):
<memcpy>:
jmp    1030 <ets_memcpy@plt>

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

LLVM IR (-O2):
define i8* @memcpy(i8* %0, i8* %1, i32 %2) {
%4 = tail call i8* @ets_memcpy(i8* %0, i8* %1, i32 %2)
ret i8* %4
}
/* Variables and functions */
float NAN;
float scanative_libc_nan() { return NAN; }


x86 assembly (clang, -O0):
<scanative_libc_nan>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eed(%rip),%rax
movss  (%rax),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<scanative_libc_nan>:
mov    0x2ef1(%rip),%rax
movss  (%rax),%xmm0
ret

LLVM IR (-O0):
@NAN = global float 0.000000e+00
define float @scanative_libc_nan() {
%1 = load float, float* @NAN
ret float %1
}

LLVM IR (-O2):
@NAN = global float 0.000000e+00
define float @scanative_libc_nan() {
%1 = load float, float* @NAN
ret float %1
}
/* Variables and functions */
int /*<<< orphan*/ outdec(int);
int /*<<< orphan*/ outstr(char *);
void queuelabel(int label) {
  outstr("i_");
  outdec(label);
}


x86 assembly (clang, -O0):
<queuelabel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
call   1030 <outstr@plt>
mov    -0x4(%rbp),%edi
call   1040 <outdec@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<queuelabel>:
push   %rbx
mov    %edi,%ebx
lea    0xed6(%rip),%rdi
call   1030 <outstr@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <outdec@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"i_\00"
define void @queuelabel(i32 %0) {
%2 = tail call i32 @outstr(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @outdec(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, char *);
int /*<<< orphan*/ system(char *);
void make_executable(char *rename_table_filename) {
  char sys_string[512];
  sprintf(sys_string, "chmod -x,ug+x %s 2>/dev/null", rename_table_filename);
  system(sys_string);
}


x86 assembly (clang, -O0):
<make_executable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x210,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x210(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xebf(%rip),%rsi
call   1040 <sprintf@plt>
lea    -0x210(%rbp),%rdi
call   1030 <system@plt>
add    $0x210,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<make_executable>:
push   %rbx
sub    $0x200,%rsp
mov    %rdi,%rdx
lea    0xece(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
add    $0x200,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [29 x i8] c"chmod -x,ug+x %s 2>/dev/null\00"
define void @make_executable(i8* %0) {
%2 = alloca i8*
%3 = alloca [512 x i8]
store i8* %0, i8** %2
%4 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 0
%5 = load i8*, i8** %2
%6 = call i32 @sprintf(i8* %4, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 0
%8 = call i32 @system(i8* %7)
ret void
}

LLVM IR (-O2):
@.str = [29 x i8] c"chmod -x,ug+x %s 2>/dev/null\00"
define void @make_executable(i8* %0) {
%2 = alloca [512 x i8]
%3 = getelementptr inbounds [512 x i8], [512 x i8]* %2, i64 0, i64 0
%4 = call i32 @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* %0)
%5 = call i32 @system(i8* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __sevl();
void check__sevl(void) { __sevl(); }


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

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

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

LLVM IR (-O2):
define void @check__sevl() {
%1 = tail call i32 (...) @__sevl()
ret void
}
/* Variables and functions */
bool is_oper(char s) {
  if (s == '+' || s == '-' || s == '*' || s == '/' || s == '$') {
    return true;
  } else {
    return false;
  }
}


x86 assembly (clang, -O0):
<is_oper>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x2b,%eax
je     114b <is_oper+0x4b>
movsbl -0x5(%rbp),%eax
cmp    $0x2d,%eax
je     114b <is_oper+0x4b>
movsbl -0x5(%rbp),%eax
cmp    $0x2a,%eax
je     114b <is_oper+0x4b>
movsbl -0x5(%rbp),%eax
cmp    $0x2f,%eax
je     114b <is_oper+0x4b>
movsbl -0x5(%rbp),%eax
cmp    $0x24,%eax
jne    1157 <is_oper+0x57>
movl   $0x1,-0x4(%rbp)
jmp    115e <is_oper+0x5e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_oper>:
add    $0xdc,%dil
xor    %eax,%eax
cmp    $0xb,%dil
ja     111a <is_oper+0x1a>
movsbq %dil,%rax
lea    0xee9(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @is_oper(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp eq i32 %5, 43
br i1 %6, label %23, label %7
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp eq i32 %9, 45
br i1 %10, label %23, label %11
11: ; preds = %7
%12 = load i8, i8* %3
%13 = sext i8 %12 to i32
%14 = icmp eq i32 %13, 42
br i1 %14, label %23, label %15
15: ; preds = %11
%16 = load i8, i8* %3
%17 = sext i8 %16 to i32
%18 = icmp eq i32 %17, 47
br i1 %18, label %23, label %19
19: ; preds = %15
%20 = load i8, i8* %3
%21 = sext i8 %20 to i32
%22 = icmp eq i32 %21, 36
br i1 %22, label %23, label %24
23: ; preds = %19, %15, %11, %7, %1
store i32 1, i32* %2
br label %25
24: ; preds = %19
store i32 0, i32* %2
br label %25
25: ; preds = %24, %23
%26 = load i32, i32* %2
ret i32 %26
}

LLVM IR (-O2):
@switch.table.is_oper = [12 x i32] [i32 1, i32 0, i32 0, i32 0, i32 0, i32 0, i32 1, i32 1, i32 0, i32 1, i32 0, i32 1]
define i32 @is_oper(i8 signext %0) {
%2 = add i8 %0, -36
%3 = icmp ult i8 %2, 12
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = sext i8 %2 to i64
%6 = getelementptr inbounds [12 x i32], [12 x i32]* @switch.table.is_oper, i64 0, i64 %5
%7 = load i32, i32* %6
br label %8
8: ; preds = %1, %4
%9 = phi i32 [ %7, %4 ], [ 0, %1 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int /*<<< orphan*/ free(void *);
void _MyFree(void **var) {
  assert(var != NULL);
  if (*var != NULL)
    free(*var);
  *var = NULL;
}


x86 assembly (clang, -O0):
<_MyFree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
je     1158 <_MyFree+0x38>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rax
movq   $0x0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_MyFree>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
test   %rbx,%rbx
setne  %dil
call   1040 <assert@plt>
mov    (%rbx),%rdi
test   %rdi,%rdi
je     113f <_MyFree+0x1f>
call   1030 <free@plt>
movq   $0x0,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @_MyFree(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i8**, i8*** %2
%4 = icmp ne i8** %3, null
%5 = zext i1 %4 to i32
%6 = call i32 @assert(i32 %5)
%7 = load i8**, i8*** %2
%8 = load i8*, i8** %7
%9 = icmp ne i8* %8, null
br i1 %9, label %10, label %14
10: ; preds = %1
%11 = load i8**, i8*** %2
%12 = load i8*, i8** %11
%13 = call i32 @free(i8* %12)
br label %14
14: ; preds = %10, %1
%15 = load i8**, i8*** %2
store i8* null, i8** %15
ret void
}

LLVM IR (-O2):
define void @_MyFree(i8** %0) {
%2 = icmp ne i8** %0, null
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = load i8*, i8** %0
%6 = icmp eq i8* %5, null
br i1 %6, label %9, label %7
7: ; preds = %1
%8 = tail call i32 @free(i8* %5)
br label %9
9: ; preds = %7, %1
store i8* null, i8** %0
ret void
}
/* Variables and functions */
char *strtok(char *, char const *);
char *my_strtok(char *token, const char *delim) { return strtok(token, delim); }


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

x86 assembly (clang, -O2):
<my_strtok>:
jmp    1030 <strtok@plt>

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

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

/* Variables and functions */
int EVP_DigestUpdate(int /*<<< orphan*/ *, unsigned char *, size_t);
size_t fread(unsigned char *, int, int, int /*<<< orphan*/ *);
int update_hash(FILE *file, EVP_MD_CTX *mdctx) {
  int read_ok = 1;
  unsigned char buffer[1024];
  size_t r_size = fread(buffer, sizeof(char), 1024, file);
  if (!r_size) {
    read_ok = 0;
  } else {
    read_ok = EVP_DigestUpdate(mdctx, buffer, r_size);
  }
  return read_ok;
}


x86 assembly (clang, -O0):
<update_hash>:
push   %rbp
mov    %rsp,%rbp
sub    $0x430,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
lea    -0x420(%rbp),%rdi
mov    -0x8(%rbp),%rcx
mov    $0x1,%esi
mov    $0x400,%edx
call   1030 <fread@plt>
mov    %rax,-0x428(%rbp)
cmpq   $0x0,-0x428(%rbp)
jne    1175 <update_hash+0x55>
movl   $0x0,-0x14(%rbp)
jmp    118f <update_hash+0x6f>
mov    -0x10(%rbp),%rdi
lea    -0x420(%rbp),%rsi
mov    -0x428(%rbp),%rdx
call   1040 <EVP_DigestUpdate@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x430,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<update_hash>:
push   %rbx
sub    $0x400,%rsp
mov    %rsi,%rbx
mov    %rdi,%rcx
mov    %rsp,%rdi
mov    $0x1,%esi
mov    $0x400,%edx
call   1030 <fread@plt>
test   %rax,%rax
je     1155 <update_hash+0x35>
mov    %rsp,%rsi
mov    %rbx,%rdi
mov    %rax,%rdx
call   1040 <EVP_DigestUpdate@plt>
jmp    1157 <update_hash+0x37>
xor    %eax,%eax
add    $0x400,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @update_hash(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32
%6 = alloca [1024 x i8]
%7 = alloca i64
store i32* %0, i32** %3
store i32* %1, i32** %4
store i32 1, i32* %5
%8 = getelementptr inbounds [1024 x i8], [1024 x i8]* %6, i64 0, i64 0
%9 = load i32*, i32** %3
%10 = call i64 @fread(i8* %8, i32 1, i32 1024, i32* %9)
store i64 %10, i64* %7
%11 = load i64, i64* %7
%12 = icmp ne i64 %11, 0
br i1 %12, label %14, label %13
13: ; preds = %2
store i32 0, i32* %5
br label %19
14: ; preds = %2
%15 = load i32*, i32** %4
%16 = getelementptr inbounds [1024 x i8], [1024 x i8]* %6, i64 0, i64 0
%17 = load i64, i64* %7
%18 = call i32 @EVP_DigestUpdate(i32* %15, i8* %16, i64 %17)
store i32 %18, i32* %5
br label %19
19: ; preds = %14, %13
%20 = load i32, i32* %5
ret i32 %20
}

LLVM IR (-O2):
define i32 @update_hash(i32* nocapture %0, i32* %1) {
%3 = alloca [1024 x i8]
%4 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%5 = call i64 @fread(i8* %4, i32 1, i32 1024, i32* %0)
%6 = icmp eq i64 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %2
%8 = call i32 @EVP_DigestUpdate(i32* %1, i8* %4, i64 %5)
br label %9
9: ; preds = %2, %7
%10 = phi i32 [ %8, %7 ], [ 0, %2 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ puts(char *);
int f(int *p, int n) {
  for (int i = 0; i < n; i++)
    printf("%d  ", p[i]);
  puts("");
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1167 <f+0x47>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xeac(%rip),%rdi
call   1040 <printf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1136 <f+0x16>
lea    0xe96(%rip),%rdi
call   1030 <puts@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1155 <f+0x35>
mov    %rdi,%r15
mov    %esi,%r12d
xor    %ebx,%ebx
lea    0xec5(%rip),%r14
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <f+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"%d \00"
@.str.1 = [1 x i8] zeroinitializer
define i32 @f(i32* %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 0, i32* %6
br label %7
7: ; preds = %18, %2
%8 = load i32, i32* %6
%9 = load i32, i32* %5
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %21
11: ; preds = %7
%12 = load i32*, i32** %4
%13 = load i32, i32* %6
%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 ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %16)
br label %18
18: ; preds = %11
%19 = load i32, i32* %6
%20 = add nsw i32 %19, 1
store i32 %20, i32* %6
br label %7
21: ; preds = %7
%22 = call i32 @puts(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
%23 = load i32, i32* %3
ret i32 %23
}

LLVM IR (-O2):
@.str = [5 x i8] c"%d \00"
define i32 @f(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %8
6: ; preds = %8, %2
%7 = tail call i32 @putchar(i32 10)
ret i32 undef
8: ; preds = %4, %8
%9 = phi i64 [ 0, %4 ], [ %13, %8 ]
%10 = getelementptr inbounds i32, i32* %0, i64 %9
%11 = load i32, i32* %10
%12 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %11)
%13 = add nuw nsw i64 %9, 1
%14 = icmp eq i64 %13, %5
br i1 %14, label %6, label %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int main(int argc, char *argv[]) {
  printf("%d bytes for a long double, %d bytes for a double\n",
         sizeof(long double), sizeof(double));
  printf("%d bytes for an int, %d bytes for a long int\n", sizeof(int),
         sizeof(long int));
  printf("%d bytes for a char, %d bytes for a float\n", sizeof(char),
         sizeof(float));
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [51 x i8] c"%d bytes for a long double, %d bytes for a double\0A\00"
@.str.1 = [46 x i8] c"%d bytes for an int, %d bytes for a long int\0A\00"
@.str.2 = [43 x i8] c"%d bytes for a char, %d bytes for a float\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0), i32 16, i32 8)
%7 = call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.1, i64 0, i64 0), i32 4, i32 8)
%8 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.2, i64 0, i64 0), i32 1, i32 4)
ret i32 0
}

LLVM IR (-O2):
@.str = [51 x i8] c"%d bytes for a long double, %d bytes for a double\0A\00"
@.str.1 = [46 x i8] c"%d bytes for an int, %d bytes for a long int\0A\00"
@.str.2 = [43 x i8] c"%d bytes for a char, %d bytes for a float\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0), i32 16, i32 8)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.1, i64 0, i64 0), i32 4, i32 8)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.2, i64 0, i64 0), i32 1, i32 4)
ret i32 0
}
long money_add(long x, long y) { return x + y; }


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

x86 assembly (clang, -O2):
<money_add>:
lea    (%rdi,%rsi,1),%rax
ret

LLVM IR (-O0):
define i64 @money_add(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = add nsw i64 %5, %6
ret i64 %7
}

LLVM IR (-O2):
define i64 @money_add(i64 %0, i64 %1) {
%3 = add nsw i64 %1, %0
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ move(unsigned int, unsigned int);
void curses_move(unsigned int x, unsigned int y) { move(x, y); }


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

x86 assembly (clang, -O2):
<curses_move>:
jmp    1030 <move@plt>

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

LLVM IR (-O2):
define void @curses_move(i32 %0, i32 %1) {
%3 = tail call i32 @move(i32 %0, i32 %1)
ret void
}
void sort_conditional(struct List *l) {}


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

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

LLVM IR (-O0):
%struct.List = type opaque
define void @sort_conditional(%struct.List* %0) {
%2 = alloca %struct.List*
store %struct.List* %0, %struct.List** %2
ret void
}

LLVM IR (-O2):
%struct.List = type opaque
define void @sort_conditional(%struct.List* nocapture %0) {
ret void
}
/* Type definitions */
struct mdea_object {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ mdea_error(char **, char *);
int mdea_array_node_get_object(void *p, struct mdea_object **object,
                               char **error) {
  mdea_error(error, "Expected object, got array");
  return -1;
}


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

x86 assembly (clang, -O2):
<mdea_array_node_get_object>:
push   %rax
mov    %rdx,%rdi
lea    0xee5(%rip),%rsi
call   1030 <mdea_error@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.mdea_object = type { i32 }
@.str = [27 x i8] c"Expected object, got array\00"
define i32 @mdea_array_node_get_object(i8* %0, %struct.mdea_object** %1, i8** %2) {
%4 = alloca i8*
%5 = alloca %struct.mdea_object**
%6 = alloca i8**
store i8* %0, i8** %4
store %struct.mdea_object** %1, %struct.mdea_object*** %5
store i8** %2, i8*** %6
%7 = load i8**, i8*** %6
%8 = call i32 @mdea_error(i8** %7, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
ret i32 -1
}

LLVM IR (-O2):
%struct.mdea_object = type { i32 }
@.str = [27 x i8] c"Expected object, got array\00"
define i32 @mdea_array_node_get_object(i8* nocapture readnone %0, %struct.mdea_object** nocapture readnone %1, i8** %2) {
%4 = tail call i32 @mdea_error(i8** %2, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
ret i32 -1
}
void fc153(int n) {
a : {
  typedef int(*b)[n];
  {
    typedef int(*c)[n];
    0;
  }
  {
    typedef int(*d)[n];
    0;
  };
  typedef int(*e)[n];
  0;
};
  {
    typedef int(*f)[n];
    {
      typedef int(*g)[n];
      goto a;
      0;
    };
    {
      typedef int(*h)[n];
      0;
    };
    ;
    typedef int(*i)[n];
    0;
  };
  ;
  typedef int(*j)[n];
  0;
}


x86 assembly (clang, -O0):
<fc153>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
jmp    1107 <fc153+0x7>

x86 assembly (clang, -O2):
<fc153>:
jmp    1100 <fc153>

LLVM IR (-O0):
define void @fc153(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %3, %1
%4 = load i32, i32* %2
%5 = zext i32 %4 to i64
%6 = load i32, i32* %2
%7 = zext i32 %6 to i64
%8 = load i32, i32* %2
%9 = zext i32 %8 to i64
%10 = load i32, i32* %2
%11 = zext i32 %10 to i64
%12 = load i32, i32* %2
%13 = zext i32 %12 to i64
%14 = load i32, i32* %2
%15 = zext i32 %14 to i64
br label %3
16: ; No predecessors!
%17 = load i32, i32* %2
%18 = zext i32 %17 to i64
%19 = load i32, i32* %2
%20 = zext i32 %19 to i64
%21 = load i32, i32* %2
%22 = zext i32 %21 to i64
ret void
}

LLVM IR (-O2):
define void @fc153(i32 %0) {
br label %2
2: ; preds = %2, %1
br label %2
}
/* Variables and functions */
int /*<<< orphan*/ BNCIO2(int, int /*<<< orphan*/);
long int BNCFrontOff() {
  long int stat = 99;
  BNCIO2(32, 0);
  return (0);
}


x86 assembly (clang, -O0):
<BNCFrontOff>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x63,-0x8(%rbp)
mov    $0x20,%edi
xor    %esi,%esi
call   1030 <BNCIO2@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BNCFrontOff>:
push   %rax
mov    $0x20,%edi
xor    %esi,%esi
call   1030 <BNCIO2@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i64 @BNCFrontOff() {
%1 = alloca i64
store i64 99, i64* %1
%2 = call i32 @BNCIO2(i32 32, i32 0)
ret i64 0
}

LLVM IR (-O2):
define i64 @BNCFrontOff() {
%1 = tail call i32 @BNCIO2(i32 32, i32 0)
ret i64 0
}
void spower_unregister_driver(void) {}


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

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

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

LLVM IR (-O2):
define void @spower_unregister_driver() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void printAAA() { printf("AAA\n"); }


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

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

LLVM IR (-O0):
@.str = [5 x i8] c"AAA\0A\00"
define void @printAAA() {
%1 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [4 x i8] c"AAA\00"
define void @printAAA() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int /*<<< orphan*/ vwscanf(int /*<<< orphan*/ *, int /*<<< orphan*/);
void uninivar_vwscanf(void) {
  wchar_t *format;
  va_list arg;
  (void)vwscanf(format, arg);
}


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

x86 assembly (clang, -O2):
<uninivar_vwscanf>:
jmp    1030 <vwscanf@plt>

LLVM IR (-O0):
define void @uninivar_vwscanf() {
%1 = alloca i32*
%2 = alloca i32
%3 = load i32*, i32** %1
%4 = load i32, i32* %2
%5 = call i32 @vwscanf(i32* %3, i32 %4)
ret void
}

LLVM IR (-O2):
define void @uninivar_vwscanf() {
%1 = tail call i32 @vwscanf(i32* undef, i32 undef)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ encrypt(char *);
scalar_t__ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ stdin;
int main() {
  char msg[80];
  while (fgets(msg, 80, stdin)) {
    encrypt(msg);
    printf("%s", msg);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x60(%rbp),%rdi
mov    0x2e9e(%rip),%rax
mov    (%rax),%edx
mov    $0x50,%esi
call   1050 <fgets@plt>
cmp    $0x0,%rax
je     117e <main+0x4e>
lea    -0x60(%rbp),%rdi
call   1040 <encrypt@plt>
lea    -0x60(%rbp),%rsi
lea    0xe8c(%rip),%rdi
call   1030 <printf@plt>
jmp    113f <main+0xf>
mov    -0x4(%rbp),%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x50,%rsp
mov    0x2ea8(%rip),%r15
mov    (%r15),%edx
mov    %rsp,%rdi
mov    $0x50,%esi
call   1050 <fgets@plt>
test   %rax,%rax
je     1188 <main+0x58>
mov    %rsp,%rbx
lea    0xea1(%rip),%r14
nop
mov    %rbx,%rdi
call   1040 <encrypt@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    (%r15),%edx
mov    %rbx,%rdi
mov    $0x50,%esi
call   1050 <fgets@plt>
test   %rax,%rax
jne    1160 <main+0x30>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@stdin = global i32 0
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca [80 x i8]
%2 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%3 = load i32, i32* @stdin
%4 = call i64 @fgets(i8* %2, i32 80, i32 %3)
%5 = icmp eq i64 %4, 0
br i1 %5, label %12, label %6
6: ; preds = %0, %6
%7 = call i32 @encrypt(i8* %2)
%8 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%9 = load i32, i32* @stdin
%10 = call i64 @fgets(i8* %2, i32 80, i32 %9)
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %6
12: ; preds = %6, %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
void *realloc(void *, size_t);
int /*<<< orphan*/ stderr;
void *xrealloc(void *ptr, size_t size) {
  ptr = realloc(ptr, size);
  if (!ptr) {
    fprintf(stderr, "out of memory\n");
    exit(1);
  }
  return ptr;
}


x86 assembly (clang, -O0):
<xrealloc>:
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   1040 <realloc@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    117b <xrealloc+0x4b>
mov    0x2e7d(%rip),%rax
mov    (%rax),%edi
lea    0xe94(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrealloc>:
push   %rax
call   1040 <realloc@plt>
test   %rax,%rax
je     113d <xrealloc+0xd>
pop    %rcx
ret
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
lea    0xeb3(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [15 x i8] c"out of memory\0A\00"
define i8* @xrealloc(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 i8* @realloc(i8* %5, i64 %6)
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = icmp ne i8* %8, null
br i1 %9, label %14, label %10
10: ; preds = %2
%11 = load i32, i32* @stderr
%12 = call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%13 = call i32 @exit(i32 1)
unreachable
14: ; preds = %2
%15 = load i8*, i8** %3
ret i8* %15
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [15 x i8] c"out of memory\0A\00"
define noalias i8* @xrealloc(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %2
ret i8* %3
}