xunge/DecIR huggingface dataset:
char eyetest(double sight) {
  if (sight < 0.2) {
    return 'D';
  } else if (sight < 0.6) {
    return 'C';
  } else if (sight < 1.1) {
    return 'B';
  } else {
    return 'A';
  }
}


x86 assembly (clang, -O0):
<eyetest>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  0xeef(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    1125 <eyetest+0x25>
movb   $0x44,-0x1(%rbp)
jmp    1161 <eyetest+0x61>
movsd  0xedb(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    1141 <eyetest+0x41>
movb   $0x43,-0x1(%rbp)
jmp    1161 <eyetest+0x61>
movsd  0xec7(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    115d <eyetest+0x5d>
movb   $0x42,-0x1(%rbp)
jmp    1161 <eyetest+0x61>
movb   $0x41,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<eyetest>:
mov    $0x44,%al
movsd  0xef6(%rip),%xmm1
ucomisd %xmm0,%xmm1
ja     1131 <eyetest+0x31>
mov    $0x43,%al
movsd  0xeee(%rip),%xmm1
ucomisd %xmm0,%xmm1
ja     1131 <eyetest+0x31>
movsd  0xee8(%rip),%xmm1
ucomisd %xmm0,%xmm1
seta   %al
add    $0x41,%al
ret

LLVM IR (-O0):
define signext i8 @eyetest(double %0) {
%2 = alloca i8
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp olt double %4, 2.000000e-01
br i1 %5, label %6, label %7
6: ; preds = %1
store i8 68, i8* %2
br label %16
7: ; preds = %1
%8 = load double, double* %3
%9 = fcmp olt double %8, 6.000000e-01
br i1 %9, label %10, label %11
10: ; preds = %7
store i8 67, i8* %2
br label %16
11: ; preds = %7
%12 = load double, double* %3
%13 = fcmp olt double %12, 1.100000e+00
br i1 %13, label %14, label %15
14: ; preds = %11
store i8 66, i8* %2
br label %16
15: ; preds = %11
store i8 65, i8* %2
br label %16
16: ; preds = %15, %14, %10, %6
%17 = load i8, i8* %2
ret i8 %17
}

LLVM IR (-O2):
define signext i8 @eyetest(double %0) {
%2 = fcmp olt double %0, 2.000000e-01
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = fcmp olt double %0, 6.000000e-01
br i1 %4, label %8, label %5
5: ; preds = %3
%6 = fcmp olt double %0, 1.100000e+00
%7 = select i1 %6, i8 66, i8 65
br label %8
8: ; preds = %5, %3, %1
%9 = phi i8 [ 68, %1 ], [ 67, %3 ], [ %7, %5 ]
ret i8 %9
}
/* Variables and functions */
scalar_t__ abs(float);
float max(scalar_t__, float);
float min(float, float);
float fOpUnionSoft(float a, float b, float r) {
  float e = max(r - abs(a - b), 0.f);
  return min(a, b) - e * e * 0.25f / r;
}


x86 assembly (clang, -O0):
<fOpUnionSoft>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x4(%rbp),%xmm0
subss  -0x8(%rbp),%xmm0
call   1030 <abs@plt>
movss  -0x14(%rbp),%xmm0
cvtsi2ss %rax,%xmm1
subss  %xmm1,%xmm0
cvttss2si %xmm0,%rdi
xorps  %xmm0,%xmm0
call   1050 <max@plt>
movss  %xmm0,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
call   1040 <min@plt>
movss  -0x10(%rbp),%xmm1
mulss  -0x10(%rbp),%xmm1
movss  0xe5f(%rip),%xmm2
mulss  %xmm2,%xmm1
divss  -0xc(%rbp),%xmm1
subss  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fOpUnionSoft>:
sub    $0x18,%rsp
movss  %xmm2,0x8(%rsp)
movss  %xmm1,0x14(%rsp)
movss  %xmm0,0x10(%rsp)
subss  %xmm1,%xmm0
call   1030 <abs@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
movss  0x8(%rsp),%xmm1
subss  %xmm0,%xmm1
cvttss2si %xmm1,%rdi
xorps  %xmm0,%xmm0
call   1050 <max@plt>
movss  %xmm0,0xc(%rsp)
movss  0x10(%rsp),%xmm0
movss  0x14(%rsp),%xmm1
call   1040 <min@plt>
movss  0xc(%rsp),%xmm1
mulss  %xmm1,%xmm1
mulss  0xe69(%rip),%xmm1
divss  0x8(%rsp),%xmm1
addss  %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define float @fOpUnionSoft(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%8 = load float, float* %6
%9 = load float, float* %4
%10 = load float, float* %5
%11 = fsub float %9, %10
%12 = call i64 @abs(float %11)
%13 = sitofp i64 %12 to float
%14 = fsub float %8, %13
%15 = fptosi float %14 to i64
%16 = call float @max(i64 %15, float 0.000000e+00)
store float %16, float* %7
%17 = load float, float* %4
%18 = load float, float* %5
%19 = call float @min(float %17, float %18)
%20 = load float, float* %7
%21 = load float, float* %7
%22 = fmul float %20, %21
%23 = fmul float %22, 2.500000e-01
%24 = load float, float* %6
%25 = fdiv float %23, %24
%26 = fsub float %19, %25
ret float %26
}

LLVM IR (-O2):
define float @fOpUnionSoft(float %0, float %1, float %2) {
%4 = fsub float %0, %1
%5 = tail call i64 @abs(float %4)
%6 = sitofp i64 %5 to float
%7 = fsub float %2, %6
%8 = fptosi float %7 to i64
%9 = tail call float @max(i64 %8, float 0.000000e+00)
%10 = tail call float @min(float %0, float %1)
%11 = fmul float %9, %9
%12 = fmul float %11, 2.500000e-01
%13 = fdiv float %12, %2
%14 = fsub float %10, %13
ret float %14
}
/* Type definitions */
typedef int /*<<< orphan*/ u_int32_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int __ivaliduser2(int /*<<< orphan*/ *, int /*<<< orphan*/, char const *,
                  char const *, char *);
int __ivaliduser(FILE *hostf, u_int32_t raddr, const char *luser,
                 const char *ruser) {
  return __ivaliduser2(hostf, raddr, luser, ruser, "-");
}


x86 assembly (clang, -O0):
<__ivaliduser>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
lea    0xec3(%rip),%r8
call   1030 <__ivaliduser2@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [2 x i8] c"-\00"
define i32 @__ivaliduser(i32* %0, i32 %1, i8* %2, i8* %3) {
%5 = tail call i32 @__ivaliduser2(i32* %0, i32 %1, i8* %2, i8* %3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i32 %5
}
float lerp(float t, float a, float b) { return (a + t * (b - a)); }


x86 assembly (clang, -O0):
<lerp>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x8(%rbp),%xmm1
movss  -0x4(%rbp),%xmm0
movss  -0xc(%rbp),%xmm2
subss  -0x8(%rbp),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<lerp>:
subss  %xmm1,%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @lerp(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%7 = load float, float* %5
%8 = load float, float* %4
%9 = load float, float* %6
%10 = load float, float* %5
%11 = fsub float %9, %10
%12 = call float @llvm.fmuladd.f32(float %8, float %11, float %7)
ret float %12
}

LLVM IR (-O2):
define float @lerp(float %0, float %1, float %2) {
%4 = fsub float %2, %1
%5 = tail call float @llvm.fmuladd.f32(float %0, float %4, float %1)
ret float %5
}
int modulus(int dividend, int divisor) {
  if (dividend < divisor)
    return dividend;
  return modulus(dividend - divisor, divisor);
}


x86 assembly (clang, -O0):
<modulus>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1135 <modulus+0x25>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1146 <modulus+0x36>
mov    -0x8(%rbp),%edi
sub    -0xc(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <modulus@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<modulus>:
mov    %edi,%eax
add    %esi,%eax
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
sub    %esi,%eax
cmp    %esi,%eax
jge    1110 <modulus+0x10>
ret

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

LLVM IR (-O2):
define i32 @modulus(i32 %0, i32 %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i32 [ %0, %2 ], [ %6, %3 ]
%5 = icmp slt i32 %4, %1
%6 = sub nsw i32 %4, %1
br i1 %5, label %7, label %3
7: ; preds = %3
ret i32 %4
}
/* Type definitions */
struct timespec {
  int /*<<< orphan*/ tv_nsec;
  int /*<<< orphan*/ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int /*<<< orphan*/,
                           int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
void format_time(const struct timespec *tv) {
  fprintf(stdout, "%lu.%09lu\n", tv->tv_sec, tv->tv_nsec);
}


x86 assembly (clang, -O0):
<format_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%edx
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
lea    0xec7(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<format_time>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%eax
mov    (%rdi),%ecx
mov    0x4(%rdi),%edx
lea    0xedb(%rip),%rsi
mov    %eax,%edi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
%struct.timespec = type { i32, i32 }
@stdout = global i32 0
@.str = [11 x i8] c"%lu.%09lu\0A\00"
define void @format_time(%struct.timespec* %0) {
%2 = alloca %struct.timespec*
store %struct.timespec* %0, %struct.timespec** %2
%3 = load i32, i32* @stdout
%4 = load %struct.timespec*, %struct.timespec** %2
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %4, i32 0, i32 1
%6 = load i32, i32* %5
%7 = load %struct.timespec*, %struct.timespec** %2
%8 = getelementptr inbounds %struct.timespec, %struct.timespec* %7, i32 0, i32 0
%9 = load i32, i32* %8
%10 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %9)
ret void
}

LLVM IR (-O2):
%struct.timespec = type { i32, i32 }
@stdout = global i32 0
@.str = [11 x i8] c"%lu.%09lu\0A\00"
define void @format_time(%struct.timespec* nocapture %0) {
%2 = load i32, i32* @stdout
%3 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 1
%4 = load i32, i32* %3
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 0
%6 = load i32, i32* %5
%7 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %4, i32 %6)
ret void
}
void fspath_print_tree(const char path[]) {}


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

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

LLVM IR (-O0):
define void @fspath_print_tree(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
ret void
}

LLVM IR (-O2):
define void @fspath_print_tree(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ compute(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, double *, int);
int /*<<< orphan*/ stderr;
void appli_function1(double *array, int size) {
  fprintf(stderr, "appli function1 (%p, %d)\n", array, size);
  compute(10);
}


x86 assembly (clang, -O0):
<appli_function1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0xc(%rbp),%ecx
lea    0xeba(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xa,%edi
call   1040 <compute@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<appli_function1>:
push   %rax
mov    %esi,%ecx
mov    %rdi,%rdx
mov    0x2eb3(%rip),%rax
mov    (%rax),%edi
lea    0xeca(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xa,%edi
pop    %rax
jmp    1040 <compute@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [26 x i8] c"appli function1 (%p, %d)\0A\00"
define void @appli_function1(double* %0, i32 %1) {
%3 = alloca double*
%4 = alloca i32
store double* %0, double** %3
store i32 %1, i32* %4
%5 = load i32, i32* @stderr
%6 = load double*, double** %3
%7 = load i32, i32* %4
%8 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), double* %6, i32 %7)
%9 = call i32 @compute(i32 10)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [26 x i8] c"appli function1 (%p, %d)\0A\00"
define void @appli_function1(double* %0, i32 %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), double* %0, i32 %1)
%5 = tail call i32 @compute(i32 10)
ret void
}
/* Variables and functions */
int mysnprintf(char *, size_t, char *, int, int, float);
int fixed2str(float value, int width, int prec, char *buf, size_t len) {
  return mysnprintf(buf, len, "%*.*f", width, prec, value);
}


x86 assembly (clang, -O0):
<fixed2str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x8(%rbp),%ecx
mov    -0xc(%rbp),%r8d
movss  -0x4(%rbp),%xmm0
lea    0xeba(%rip),%rdx
call   1030 <mysnprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fixed2str>:
mov    %rdx,%rax
mov    %esi,%r8d
mov    %edi,%r9d
lea    0xee0(%rip),%rdx
mov    %rax,%rdi
mov    %rcx,%rsi
mov    %r9d,%ecx
jmp    1030 <mysnprintf@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"%*.*f\00"
define i32 @fixed2str(float %0, i32 %1, i32 %2, i8* %3, i64 %4) {
%6 = alloca float
%7 = alloca i32
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i64
store float %0, float* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i8* %3, i8** %9
store i64 %4, i64* %10
%11 = load i8*, i8** %9
%12 = load i64, i64* %10
%13 = load i32, i32* %7
%14 = load i32, i32* %8
%15 = load float, float* %6
%16 = call i32 @mysnprintf(i8* %11, i64 %12, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %13, i32 %14, float %15)
ret i32 %16
}

LLVM IR (-O2):
@.str = [6 x i8] c"%*.*f\00"
define i32 @fixed2str(float %0, i32 %1, i32 %2, i8* %3, i64 %4) {
%6 = tail call i32 @mysnprintf(i8* %3, i64 %4, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %2, float %0)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ _write(int, char *, int);
void _exit(int status) {
  if (status) {
  }
  _write(1, "exit", 4);
  while (1) {
    ;
  }
}


x86 assembly (clang, -O0):
<_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     112a <_exit+0x1a>
jmp    112a <_exit+0x1a>
mov    $0x1,%edi
lea    0xeca(%rip),%rsi
mov    $0x4,%edx
call   1030 <_write@plt>
jmp    1140 <_exit+0x30>

x86 assembly (clang, -O2):
<_exit>:
push   %rax
lea    0xee8(%rip),%rsi
mov    $0x1,%edi
mov    $0x4,%edx
call   1030 <_write@plt>
nopw   0x0(%rax,%rax,1)
jmp    1130 <_exit+0x20>

LLVM IR (-O0):
@.str = [5 x i8] c"exit\00"
define void @_exit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %1
br label %6
6: ; preds = %5, %1
%7 = call i32 @_write(i32 1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 4)
br label %8
8: ; preds = %6, %8
br label %8
}

LLVM IR (-O2):
@.str = [5 x i8] c"exit\00"
define void @_exit(i32 %0) {
%2 = tail call i32 @_write(i32 1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 4)
br label %3
3: ; preds = %1, %3
br label %3
}
int getdate_yyerror(const char *s) {
  s = s;
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @getdate_yyerror(i8* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ write_src(char *);
void lognot_handler(void) { write_src("PUSH(!POP());\n"); }


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

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

LLVM IR (-O0):
@.str = [15 x i8] c"PUSH(!POP());\0A\00"
define void @lognot_handler() {
%1 = call i32 @write_src(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"PUSH(!POP());\0A\00"
define void @lognot_handler() {
%1 = tail call i32 @write_src(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret void
}
int ti_nvi_start(double const *options) {
  (void)options;
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @ti_nvi_start(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load double*, double** %2
ret i32 0
}

LLVM IR (-O2):
define i32 @ti_nvi_start(double* nocapture readnone %0) {
ret i32 0
}
void chomp(char *string) {
  while (*string != 0) {
    if (*string == 13 || *string == 10) {
      *string = 0;
      return;
    }
    string++;
  }
  return;
}


x86 assembly (clang, -O0):
<chomp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1155 <chomp+0x55>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xd,%eax
je     1138 <chomp+0x38>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
jne    1144 <chomp+0x44>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
jmp    115a <chomp+0x5a>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <chomp+0x8>
jmp    115a <chomp+0x5a>
pop    %rbp
ret

x86 assembly (clang, -O2):
<chomp>:
movzbl (%rdi),%eax
test   %al,%al
je     1118 <chomp+0x18>
cmp    $0xd,%al
je     1115 <chomp+0x15>
cmp    $0xa,%al
je     1115 <chomp+0x15>
add    $0x1,%rdi
jmp    1100 <chomp>
movb   $0x0,(%rdi)
ret

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

LLVM IR (-O2):
define void @chomp(i8* nocapture %0) {
br label %2
2: ; preds = %6, %1
%3 = phi i8* [ %0, %1 ], [ %7, %6 ]
%4 = load i8, i8* %3
switch i8 %4, label %6 [
i8 0, label %8
i8 13, label %5
i8 10, label %5
]
5: ; preds = %2, %2
store i8 0, i8* %3
br label %8
6: ; preds = %2
%7 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
8: ; preds = %2, %5
ret void
}
/* Variables and functions */
int sscanf(char *, char const *, char *);
int get_nickname(char *rawline, char *buf) {
  static const char *USER_SSCANF = ":%32[^!]!";
  return sscanf(rawline, USER_SSCANF, buf);
}


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

x86 assembly (clang, -O2):
<get_nickname>:
mov    %rsi,%rdx
lea    0xee6(%rip),%rsi
jmp    1030 <sscanf@plt>

LLVM IR (-O0):
@get_nickname.USER_SSCANF = internal global i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i32 0, i32 0)
@.str = [10 x i8] c":%32[^!]!\00"
define i32 @get_nickname(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** @get_nickname.USER_SSCANF
%7 = load i8*, i8** %4
%8 = call i32 @sscanf(i8* %5, i8* %6, i8* %7)
ret i32 %8
}

LLVM IR (-O2):
@.str = [10 x i8] c":%32[^!]!\00"
define i32 @get_nickname(i8* nocapture %0, i8* %1) {
%3 = tail call i32 @sscanf(i8* %0, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ core3_swap(char *, int);
void U_EMRSETMITERLIMIT_swap(char *record, int torev) {
  core3_swap(record, torev);
}


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

x86 assembly (clang, -O2):
<U_EMRSETMITERLIMIT_swap>:
jmp    1030 <core3_swap@plt>

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

LLVM IR (-O2):
define void @U_EMRSETMITERLIMIT_swap(i8* %0, i32 %1) {
%3 = tail call i32 @core3_swap(i8* %0, i32 %1)
ret void
}
int mc_sync_open_sock(char *master_name, int master_port, char *my_name) {
  return -1;
}


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

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

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

LLVM IR (-O2):
define i32 @mc_sync_open_sock(i8* nocapture readnone %0, i32 %1, i8* nocapture readnone %2) {
ret i32 -1
}
int *f() {
  {
    int x = 5;
    return &x;
  }
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
movl   $0x5,-0x4(%rbp)
lea    -0x4(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
lea    -0x4(%rsp),%rax
ret

LLVM IR (-O0):
define i32* @f() {
%1 = alloca i32
store i32 5, i32* %1
ret i32* %1
}

LLVM IR (-O2):
define noalias i32* @f() {
%1 = alloca i32
ret i32* %1
}
/* Variables and functions */
int /*<<< orphan*/ Immediate16(int);
int /*<<< orphan*/ SBC16(int /*<<< orphan*/);
void OpE9M0(void) { SBC16(Immediate16(1)); }


x86 assembly (clang, -O0):
<OpE9M0>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <Immediate16@plt>
mov    %eax,%edi
call   1040 <SBC16@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<OpE9M0>:
push   %rax
mov    $0x1,%edi
call   1030 <Immediate16@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <SBC16@plt>

LLVM IR (-O0):
define void @OpE9M0() {
%1 = call i32 @Immediate16(i32 1)
%2 = call i32 @SBC16(i32 %1)
ret void
}

LLVM IR (-O2):
define void @OpE9M0() {
%1 = tail call i32 @Immediate16(i32 1)
%2 = tail call i32 @SBC16(i32 %1)
ret void
}
float add(float x, float y) { return x + y; }


x86 assembly (clang, -O0):
<add>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
addss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<add>:
addss  %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define float @add(float %0, float %1) {
%3 = fadd float %0, %1
ret float %3
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ bfc_halt(int /*<<< orphan*/);
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdout;
void bfc_panic(void) {
  fflush(stdout);
  perror("bfc_rts");
  fflush(stderr);
  bfc_halt(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<bfc_panic>:
push   %rbp
mov    %rsp,%rbp
mov    0x2e95(%rip),%rax
mov    (%rax),%edi
call   1030 <fflush@plt>
lea    0xeb7(%rip),%rdi
call   1050 <perror@plt>
mov    0x2e8b(%rip),%rax
mov    (%rax),%edi
call   1030 <fflush@plt>
mov    0x2e75(%rip),%rax
mov    (%rax),%edi
call   1040 <bfc_halt@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<bfc_panic>:
push   %rax
mov    0x2e98(%rip),%rax
mov    (%rax),%edi
call   1030 <fflush@plt>
lea    0xeba(%rip),%rdi
call   1050 <perror@plt>
mov    0x2e8e(%rip),%rax
mov    (%rax),%edi
call   1030 <fflush@plt>
mov    0x2e78(%rip),%rax
mov    (%rax),%edi
pop    %rax
jmp    1040 <bfc_halt@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [8 x i8] c"bfc_rts\00"
@stderr = global i32 0
@EXIT_FAILURE = global i32 0
define void @bfc_panic() {
%1 = load i32, i32* @stdout
%2 = call i32 @fflush(i32 %1)
%3 = call i32 @perror(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @stderr
%5 = call i32 @fflush(i32 %4)
%6 = load i32, i32* @EXIT_FAILURE
%7 = call i32 @bfc_halt(i32 %6)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [8 x i8] c"bfc_rts\00"
@stderr = global i32 0
@EXIT_FAILURE = global i32 0
define void @bfc_panic() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fflush(i32 %1)
%3 = tail call i32 @perror(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @stderr
%5 = tail call i32 @fflush(i32 %4)
%6 = load i32, i32* @EXIT_FAILURE
%7 = tail call i32 @bfc_halt(i32 %6)
ret void
}
/* Variables and functions */
int even_ones(int);
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  int even_one = 6;
  int odd_ones = 2;
  printf("%x has even ones? : %x\n", even_one, even_ones(even_one));
  printf("%x has even ones? : %x\n", odd_ones, even_ones(odd_ones));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x6,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <even_ones@plt>
mov    -0x14(%rbp),%esi
mov    %eax,%edx
lea    0xea9(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%edi
call   1040 <even_ones@plt>
mov    -0x10(%rbp),%esi
mov    %eax,%edx
lea    0xe8a(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x6,%edi
call   1040 <even_ones@plt>
lea    0xece(%rip),%rbx
mov    %rbx,%rdi
mov    $0x6,%esi
mov    %eax,%edx
call   1030 <printf@plt>
mov    $0x2,%edi
call   1040 <even_ones@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
mov    %eax,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [24 x i8] c"%x has even ones? : %x\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 6, i32* %2
store i32 2, i32* %3
%4 = load i32, i32* %2
%5 = load i32, i32* %2
%6 = call i32 @even_ones(i32 %5)
%7 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %4, i32 %6)
%8 = load i32, i32* %3
%9 = load i32, i32* %3
%10 = call i32 @even_ones(i32 %9)
%11 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %8, i32 %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [24 x i8] c"%x has even ones? : %x\0A\00"
define i32 @main() {
%1 = tail call i32 @even_ones(i32 6)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 6, i32 %1)
%3 = tail call i32 @even_ones(i32 2)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 2, i32 %3)
ret i32 0
}
/* Variables and functions */
int get_mtrand_int32();
int get_mtrand_int31(void) { return (int)(get_mtrand_int32() >> 1); }


x86 assembly (clang, -O0):
<get_mtrand_int31>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <get_mtrand_int32@plt>
sar    $0x1,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @get_mtrand_int31() {
%1 = call i32 (...) @get_mtrand_int32()
%2 = ashr i32 %1, 1
ret i32 %2
}

LLVM IR (-O2):
define i32 @get_mtrand_int31() {
%1 = tail call i32 (...) @get_mtrand_int32()
%2 = ashr i32 %1, 1
ret i32 %2
}
void pcp_print_pwr_cpufreq_stats(struct activity *a, int curr) {}


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

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

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

LLVM IR (-O2):
%struct.activity = type opaque
define void @pcp_print_pwr_cpufreq_stats(%struct.activity* nocapture %0, i32 %1) {
ret void
}
long double conv_tdc_to_ns(int tdc_reg) { return tdc_reg * 7.8125e-3; }


x86 assembly (clang, -O0):
<conv_tdc_to_ns>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
movsd  0xeec(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
fldl   -0x10(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<conv_tdc_to_ns>:
cvtsi2sd %edi,%xmm0
mulsd  0xef4(%rip),%xmm0
movsd  %xmm0,-0x8(%rsp)
fldl   -0x8(%rsp)
ret

LLVM IR (-O0):
define x86_fp80 @conv_tdc_to_ns(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sitofp i32 %3 to double
%5 = fmul double %4, 7.812500e-03
%6 = fpext double %5 to x86_fp80
ret x86_fp80 %6
}

LLVM IR (-O2):
define x86_fp80 @conv_tdc_to_ns(i32 %0) {
%2 = sitofp i32 %0 to double
%3 = fmul double %2, 7.812500e-03
%4 = fpext double %3 to x86_fp80
ret x86_fp80 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uintmax_t;

/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ panic_message(char const *, int /*<<< orphan*/, char const *,
                                 char const *, int);
int xensure0_(int value, const char *file, uintmax_t line, const char *func,
              const char *format) {
  if (value) {
    panic_message(file, line, func, format, value);
    abort();
  }
  return value;
}


x86 assembly (clang, -O0):
<xensure0_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1163 <xensure0_+0x43>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x20(%rbp),%rdx
mov    -0x28(%rbp),%rcx
mov    -0x4(%rbp),%r8d
call   1040 <panic_message@plt>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xensure0_>:
test   %edi,%edi
jne    1127 <xensure0_+0x7>
xor    %eax,%eax
ret
push   %rax
mov    %edi,%eax
mov    %rsi,%rdi
mov    %edx,%esi
mov    %rcx,%rdx
mov    %r8,%rcx
mov    %eax,%r8d
call   1040 <panic_message@plt>
xor    %eax,%eax
call   1030 <abort@plt>

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

LLVM IR (-O2):
define i32 @xensure0_(i32 %0, i8* %1, i32 %2, i8* %3, i8* %4) {
%6 = icmp eq i32 %0, 0
br i1 %6, label %10, label %7
7: ; preds = %5
%8 = tail call i32 @panic_message(i8* %1, i32 %2, i8* %3, i8* %4, i32 %0)
%9 = tail call i32 (...) @abort()
unreachable
10: ; preds = %5
ret i32 0
}
/* Variables and functions */
char getchar();
void input_oneline(char *p) {
  int i = 0;
  while ((p[i] = getchar()) != '\n')
    i++;
  p[i] = '\0';
}


x86 assembly (clang, -O0):
<input_oneline>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    $0x0,%al
call   1030 <getchar@plt>
mov    -0x8(%rbp),%rcx
movslq -0xc(%rbp),%rdx
mov    %al,(%rcx,%rdx,1)
movsbl %al,%eax
cmp    $0xa,%eax
je     114f <input_oneline+0x3f>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <input_oneline+0x13>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<input_oneline>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    $0xffffffffffffffff,%rbx
xchg   %ax,%ax
xor    %eax,%eax
call   1030 <getchar@plt>
mov    %al,0x1(%r14,%rbx,1)
add    $0x1,%rbx
cmp    $0xa,%al
jne    1120 <input_oneline+0x10>
mov    %ebx,%eax
movb   $0x0,(%r14,%rax,1)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @input_oneline(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %12, %1
%5 = call signext i8 (...) @getchar()
%6 = load i8*, i8** %2
%7 = load i32, i32* %3
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %6, i64 %8
store i8 %5, i8* %9
%10 = sext i8 %5 to i32
%11 = icmp ne i32 %10, 10
br i1 %11, label %12, label %15
12: ; preds = %4
%13 = load i32, i32* %3
%14 = add nsw i32 %13, 1
store i32 %14, i32* %3
br label %4
15: ; preds = %4
%16 = load i8*, i8** %2
%17 = load i32, i32* %3
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i8, i8* %16, i64 %18
store i8 0, i8* %19
ret void
}

LLVM IR (-O2):
define void @input_oneline(i8* nocapture writeonly %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = tail call signext i8 (...) @getchar()
%5 = getelementptr inbounds i8, i8* %0, i64 %3
store i8 %4, i8* %5
%6 = icmp eq i8 %4, 10
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = and i64 %3, 4294967295
%10 = getelementptr inbounds i8, i8* %0, i64 %9
store i8 0, i8* %10
ret void
}
int HelpItem99(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @HelpItem99() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ write(int, char *, int);
int /*<<< orphan*/ write_int(int, int);
void stderr_int(int n) {
  write_int(2, n);
  write(2, "\n", 1);
}


x86 assembly (clang, -O0):
<stderr_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
mov    $0x2,%edi
call   1040 <write_int@plt>
mov    $0x2,%edi
lea    0xebc(%rip),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stderr_int>:
push   %rax
mov    %edi,%esi
mov    $0x2,%edi
call   1040 <write_int@plt>
lea    0xecc(%rip),%rsi
mov    $0x2,%edi
mov    $0x1,%edx
pop    %rax
jmp    1030 <write@plt>

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

LLVM IR (-O2):
@.str = [2 x i8] c"\0A\00"
define void @stderr_int(i32 %0) {
%2 = tail call i32 @write_int(i32 2, i32 %0)
%3 = tail call i32 @write(i32 2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
ret void
}
int TTWAIN_IsCapImageLayoutSupported(void) { return 1; }


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

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

LLVM IR (-O0):
define i32 @TTWAIN_IsCapImageLayoutSupported() {
ret i32 1
}

LLVM IR (-O2):
define i32 @TTWAIN_IsCapImageLayoutSupported() {
ret i32 1
}
unsigned int sigmund_ilog2(int n) {
  int ret = -1;
  while (n) {
    n >>= 1;
    ret++;
  }
  return (ret);
}


x86 assembly (clang, -O0):
<sigmund_ilog2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0xffffffff,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     112f <sigmund_ilog2+0x2f>
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <sigmund_ilog2+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sigmund_ilog2>:
mov    $0xffffffff,%eax
test   %edi,%edi
je     111c <sigmund_ilog2+0x1c>
mov    %edi,%ecx
nopl   0x0(%rax,%rax,1)
sar    %ecx
add    $0x1,%eax
cmp    $0x1,%edi
mov    %ecx,%edi
ja     1110 <sigmund_ilog2+0x10>
ret

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

LLVM IR (-O2):
define i32 @sigmund_ilog2(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %9, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ -1, %1 ]
%5 = phi i32 [ %6, %3 ], [ %0, %1 ]
%6 = ashr i32 %5, 1
%7 = add nsw i32 %4, 1
%8 = icmp ult i32 %5, 2
br i1 %8, label %9, label %3
9: ; preds = %3, %1
%10 = phi i32 [ -1, %1 ], [ %7, %3 ]
ret i32 %10
}
/* Type definitions */
typedef int /*<<< orphan*/ s;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  char s[] = "Hello";
  printf("size = %lu\n", sizeof(s));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xedb(%rip),%eax
mov    %eax,-0xa(%rbp)
mov    0xed5(%rip),%ax
mov    %ax,-0x6(%rbp)
lea    0xecc(%rip),%rdi
mov    $0x6,%esi
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    $0x6,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@__const.main.s = [6 x i8] c"Hello\00"
@.str = [12 x i8] c"size = %lu\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [6 x i8]
store i32 0, i32* %1
%3 = bitcast [6 x i8]* %2 to i8*
%4 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 6)
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"size = %lu\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 6)
ret i32 0
}
/* Variables and functions */
int fgetc(int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
int consoleInputCharacter(void) {
  int b = fgetc(stdin);
  b &= 0x7f;
  if (b == '\n')
    b = '\r';
  return b;
}


x86 assembly (clang, -O0):
<consoleInputCharacter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
call   1030 <fgetc@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x7f,%eax
mov    %eax,-0x4(%rbp)
cmpl   $0xa,-0x4(%rbp)
jne    1143 <consoleInputCharacter+0x33>
movl   $0xd,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<consoleInputCharacter>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
call   1030 <fgetc@plt>
and    $0x7f,%eax
cmp    $0xa,%eax
mov    $0xd,%ecx
cmove  %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stdin = global i32 0
define i32 @consoleInputCharacter() {
%1 = alloca i32
%2 = load i32, i32* @stdin
%3 = call i32 @fgetc(i32 %2)
store i32 %3, i32* %1
%4 = load i32, i32* %1
%5 = and i32 %4, 127
store i32 %5, i32* %1
%6 = load i32, i32* %1
%7 = icmp eq i32 %6, 10
br i1 %7, label %8, label %9
8: ; preds = %0
store i32 13, i32* %1
br label %9
9: ; preds = %8, %0
%10 = load i32, i32* %1
ret i32 %10
}

LLVM IR (-O2):
@stdin = global i32 0
define i32 @consoleInputCharacter() {
%1 = load i32, i32* @stdin
%2 = tail call i32 @fgetc(i32 %1)
%3 = and i32 %2, 127
%4 = icmp eq i32 %3, 10
%5 = select i1 %4, i32 13, i32 %3
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ menu_back(int);
void menu_msg_close(void) { menu_back(1); }


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

x86 assembly (clang, -O2):
<menu_msg_close>:
mov    $0x1,%edi
jmp    1030 <menu_back@plt>

LLVM IR (-O0):
define void @menu_msg_close() {
%1 = call i32 @menu_back(i32 1)
ret void
}

LLVM IR (-O2):
define void @menu_msg_close() {
%1 = tail call i32 @menu_back(i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, int);
void Print_int(char message[], int n) { printf("%s %d\n", message, n); }


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

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

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

LLVM IR (-O2):
@.str = [7 x i8] c"%s %d\0A\00"
define void @Print_int(i8* %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1)
ret void
}
/* Variables and functions */
size_t strnlen(const char *s, size_t n) {
  char *t = (char *)s;
  while (n-- && *t)
    t++;
  return (t - s);
}


x86 assembly (clang, -O0):
<strnlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rcx
mov    %rcx,%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x10(%rbp)
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x19(%rbp)
je     1142 <strnlen+0x42>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    1152 <strnlen+0x52>
jmp    1163 <strnlen+0x63>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1114 <strnlen+0x14>
mov    -0x18(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strnlen>:
mov    %rdi,%rax
test   %rsi,%rsi
je     1125 <strnlen+0x25>
lea    (%rdi,%rsi,1),%rcx
mov    %rdi,%rax
nop
cmpb   $0x0,(%rax)
je     1125 <strnlen+0x25>
add    $0xffffffffffffffff,%rsi
add    $0x1,%rax
test   %rsi,%rsi
jne    1110 <strnlen+0x10>
mov    %rcx,%rax
sub    %rdi,%rax
ret

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

LLVM IR (-O2):
define i64 @strnlen(i8* %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %15, label %4
4: ; preds = %2
%5 = getelementptr i8, i8* %0, i64 %1
br label %6
6: ; preds = %4, %12
%7 = phi i64 [ %9, %12 ], [ %1, %4 ]
%8 = phi i8* [ %13, %12 ], [ %0, %4 ]
%9 = add i64 %7, -1
%10 = load i8, i8* %8
%11 = icmp eq i8 %10, 0
br i1 %11, label %15, label %12
12: ; preds = %6
%13 = getelementptr inbounds i8, i8* %8, i64 1
%14 = icmp eq i64 %9, 0
br i1 %14, label %15, label %6
15: ; preds = %6, %12, %2
%16 = phi i8* [ %0, %2 ], [ %5, %12 ], [ %8, %6 ]
%17 = ptrtoint i8* %16 to i64
%18 = ptrtoint i8* %0 to i64
%19 = sub i64 %17, %18
ret i64 %19
}
int stack_pushstring(char *ret) {
  int (*signature)(char *);
  *((int *)(&signature)) = 0x080A9DEC;
  return signature(ret);
}


x86 assembly (clang, -O0):
<stack_pushstring>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x80a9dec,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdi
call   *%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stack_pushstring>:
mov    $0x80a9dec,%eax
jmp    *%rax

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

LLVM IR (-O2):
define i32 @stack_pushstring(i8* %0) {
%2 = tail call i32 inttoptr (i64 134913516 to i32 (i8*)*)(i8* %0)
ret i32 %2
}
/* Type definitions */
struct forth_instance {
  int dummy;
};

/* Variables and functions */
intptr_t st_pop(struct forth_instance *);
int /*<<< orphan*/ st_push(struct forth_instance *, intptr_t);
void divide(struct forth_instance *fi) {
  intptr_t tp;
  tp = st_pop(fi);
  st_push(fi, st_pop(fi) / tp);
}


x86 assembly (clang, -O0):
<divide>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <st_pop@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <st_pop@plt>
mov    -0x18(%rbp),%rdi
cqto
idivq  -0x10(%rbp)
mov    %rax,%rsi
call   1040 <st_push@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<divide>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <st_pop@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1030 <st_pop@plt>
mov    %rax,%rcx
or     %r14,%rcx
shr    $0x20,%rcx
je     114a <divide+0x2a>
cqto
idiv   %r14
jmp    114f <divide+0x2f>
xor    %edx,%edx
div    %r14d
mov    %rbx,%rdi
mov    %rax,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <st_push@plt>

LLVM IR (-O0):
%struct.forth_instance = type { i32 }
define void @divide(%struct.forth_instance* %0) {
%2 = alloca %struct.forth_instance*
%3 = alloca i64
store %struct.forth_instance* %0, %struct.forth_instance** %2
%4 = load %struct.forth_instance*, %struct.forth_instance** %2
%5 = call i64 @st_pop(%struct.forth_instance* %4)
store i64 %5, i64* %3
%6 = load %struct.forth_instance*, %struct.forth_instance** %2
%7 = load %struct.forth_instance*, %struct.forth_instance** %2
%8 = call i64 @st_pop(%struct.forth_instance* %7)
%9 = load i64, i64* %3
%10 = sdiv i64 %8, %9
%11 = call i32 @st_push(%struct.forth_instance* %6, i64 %10)
ret void
}

LLVM IR (-O2):
%struct.forth_instance = type { i32 }
define void @divide(%struct.forth_instance* %0) {
%2 = tail call i64 @st_pop(%struct.forth_instance* %0)
%3 = tail call i64 @st_pop(%struct.forth_instance* %0)
%4 = sdiv i64 %3, %2
%5 = tail call i32 @st_push(%struct.forth_instance* %0, i64 %4)
ret void
}