xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
uint64_t set_xlow_1_trail_0s(uint64_t u) { return -u ^ u; }


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

x86 assembly (clang, -O2):
<set_xlow_1_trail_0s>:
mov    %edi,%eax
neg    %eax
xor    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @set_xlow_1_trail_0s(i32 %0) {
%2 = sub nsw i32 0, %0
%3 = xor i32 %2, %0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(char *prog) {
  fprintf(stderr,
          "usage: %s dbpath [-V] [-n] [-e] [-r[r]] [-f[f[f]]] [-a|-s subdb]\n",
          prog);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e8c(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [66 x i8] c"usage: %s dbpath [-V] [-n] [-e] [-r[r]] [-f[f[f]]] [-a|-s subdb]\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @EXIT_FAILURE
%7 = call i32 @exit(i32 %6)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [66 x i8] c"usage: %s dbpath [-V] [-n] [-e] [-r[r]] [-f[f[f]]] [-a|-s subdb]\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @EXIT_FAILURE
%5 = tail call i32 @exit(i32 %4)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int XWarpPointer() {
  printf("XWarpPointer called\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [20 x i8] c"XWarpPointer called\00"
define i32 @XWarpPointer() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
ret i32 0
}
double su_get_ar_val(double ac, double bc, double g0) {
  return (ac - (bc * g0));
}


x86 assembly (clang, -O0):
<su_get_ar_val>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<su_get_ar_val>:
mulsd  %xmm2,%xmm1
subsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @su_get_ar_val(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %4
%8 = load double, double* %5
%9 = load double, double* %6
%10 = fneg double %8
%11 = call double @llvm.fmuladd.f64(double %10, double %9, double %7)
ret double %11
}

LLVM IR (-O2):
define double @su_get_ar_val(double %0, double %1, double %2) {
%4 = fneg double %1
%5 = tail call double @llvm.fmuladd.f64(double %4, double %2, double %0)
ret double %5
}
/* Variables and functions */
double pow(double, int);
double sRGB_from_linear(double l) {
  if (l <= 0.0031308)
    l *= 12.92;
  else
    l = 1.055 * pow(l, 1 / 2.4) - 0.055;
  return l;
}


x86 assembly (clang, -O0):
<sRGB_from_linear>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xedb(%rip),%xmm0
ucomisd -0x8(%rbp),%xmm0
jb     1147 <sRGB_from_linear+0x37>
movsd  0xee0(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1170 <sRGB_from_linear+0x60>
movsd  -0x8(%rbp),%xmm0
xor    %edi,%edi
call   1030 <pow@plt>
movsd  0xead(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xea9(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sRGB_from_linear>:
push   %rax
movsd  0xee7(%rip),%xmm1
ucomisd %xmm0,%xmm1
jae    1138 <sRGB_from_linear+0x28>
xor    %edi,%edi
call   1030 <pow@plt>
mulsd  0xee2(%rip),%xmm0
addsd  0xee2(%rip),%xmm0
pop    %rax
ret
mulsd  0xec8(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @sRGB_from_linear(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp ole double %3, 3.130800e-03
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load double, double* %2
%7 = fmul double %6, 1.292000e+01
store double %7, double* %2
br label %12
8: ; preds = %1
%9 = load double, double* %2
%10 = call double @pow(double %9, i32 0)
%11 = call double @llvm.fmuladd.f64(double 1.055000e+00, double %10, double -5.500000e-02)
store double %11, double* %2
br label %12
12: ; preds = %8, %5
%13 = load double, double* %2
ret double %13
}

LLVM IR (-O2):
define double @sRGB_from_linear(double %0) {
%2 = fcmp ugt double %0, 3.130800e-03
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = fmul double %0, 1.292000e+01
br label %8
5: ; preds = %1
%6 = tail call double @pow(double %0, i32 0)
%7 = tail call double @llvm.fmuladd.f64(double %6, double 1.055000e+00, double -5.500000e-02)
br label %8
8: ; preds = %5, %3
%9 = phi double [ %4, %3 ], [ %7, %5 ]
ret double %9
}
/* Variables and functions */
int /*<<< orphan*/ bar_turn_on();
int /*<<< orphan*/ zzz_sleep(int, char *);
void foo_turn_on(void) {
  bar_turn_on();
  zzz_sleep(1, "sleepy");
}


x86 assembly (clang, -O0):
<foo_turn_on>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <bar_turn_on@plt>
mov    $0x1,%edi
lea    0xec9(%rip),%rsi
call   1040 <zzz_sleep@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo_turn_on>:
push   %rax
xor    %eax,%eax
call   1030 <bar_turn_on@plt>
lea    0xed1(%rip),%rsi
mov    $0x1,%edi
pop    %rax
jmp    1040 <zzz_sleep@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"sleepy\00"
define void @foo_turn_on() {
%1 = call i32 (...) @bar_turn_on()
%2 = call i32 @zzz_sleep(i32 1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"sleepy\00"
define void @foo_turn_on() {
%1 = tail call i32 (...) @bar_turn_on()
%2 = tail call i32 @zzz_sleep(i32 1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}
void liba() {}


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

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

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

LLVM IR (-O2):
define void @liba() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ *pthread_create;
int pthreads_available(void) { return !!(pthread_create != NULL); }


x86 assembly (clang, -O0):
<pthreads_available>:
push   %rbp
mov    %rsp,%rbp
mov    0x2edd(%rip),%rax
cmpq   $0x0,(%rax)
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pthreads_available>:
mov    0x2ee1(%rip),%rcx
xor    %eax,%eax
cmpq   $0x0,(%rcx)
setne  %al
ret

LLVM IR (-O0):
@pthread_create = global i32* null
define i32 @pthreads_available() {
%1 = load i32*, i32** @pthread_create
%2 = icmp ne i32* %1, null
%3 = xor i1 %2, true
%4 = xor i1 %3, true
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
@pthread_create = global i32* null
define i32 @pthreads_available() {
%1 = load i32*, i32** @pthread_create
%2 = icmp ne i32* %1, null
%3 = zext i1 %2 to i32
ret i32 %3
}
double gsl_pow_9(const double x) {
  double x3 = x * x * x;
  return x3 * x3 * x3;
}


x86 assembly (clang, -O0):
<gsl_pow_9>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<gsl_pow_9>:
movapd %xmm0,%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm1,%xmm0
movapd %xmm0,%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @gsl_pow_9(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = load double, double* %2
%6 = fmul double %4, %5
%7 = load double, double* %2
%8 = fmul double %6, %7
store double %8, double* %3
%9 = load double, double* %3
%10 = load double, double* %3
%11 = fmul double %9, %10
%12 = load double, double* %3
%13 = fmul double %11, %12
ret double %13
}

LLVM IR (-O2):
define double @gsl_pow_9(double %0) {
%2 = fmul double %0, %0
%3 = fmul double %2, %0
%4 = fmul double %3, %3
%5 = fmul double %3, %4
ret double %5
}
/* Variables and functions */
int foo(int);
int bar(int a) { return 2 * foo(a); }


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <foo@plt>
shl    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @bar(i32 %0) {
%2 = tail call i32 @foo(i32 %0)
%3 = shl nsw i32 %2, 1
ret i32 %3
}
/* Variables and functions */
size_t strlen(char const *);
scalar_t__ strncmp(char const *, char const *, size_t);
bool startsWith(const char *pre, const char *str) {
  size_t lenpre = strlen(pre);
  size_t lenstr = strlen(str);
  return lenstr < lenpre ? false : strncmp(pre, str, lenpre) == 0;
}


x86 assembly (clang, -O0):
<startsWith>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x18(%rbp),%rax
jae    1162 <startsWith+0x42>
xor    %eax,%eax
mov    %eax,-0x24(%rbp)
jmp    1182 <startsWith+0x62>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<startsWith>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
call   1040 <strlen@plt>
mov    %rax,%rbx
mov    %r14,%rdi
call   1040 <strlen@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rbx,%rcx
jb     115e <startsWith+0x3e>
mov    %r15,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1030 <strncmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
sete   %al
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32 @startsWith(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i64
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = call i64 @strlen(i8* %7)
store i64 %8, i64* %5
%9 = load i8*, i8** %4
%10 = call i64 @strlen(i8* %9)
store i64 %10, i64* %6
%11 = load i64, i64* %6
%12 = load i64, i64* %5
%13 = icmp ult i64 %11, %12
br i1 %13, label %14, label %15
14: ; preds = %2
br label %22
15: ; preds = %2
%16 = load i8*, i8** %3
%17 = load i8*, i8** %4
%18 = load i64, i64* %5
%19 = call i64 @strncmp(i8* %16, i8* %17, i64 %18)
%20 = icmp eq i64 %19, 0
%21 = zext i1 %20 to i32
br label %22
22: ; preds = %15, %14
%23 = phi i32 [ 0, %14 ], [ %21, %15 ]
ret i32 %23
}

LLVM IR (-O2):
define i32 @startsWith(i8* %0, i8* %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%4 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%5 = icmp ult i64 %4, %3
br i1 %5, label %10, label %6
6: ; preds = %2
%7 = tail call i64 @strncmp(i8* %0, i8* %1, i64 %3)
%8 = icmp eq i64 %7, 0
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %2, %6
%11 = phi i32 [ %9, %6 ], [ 0, %2 ]
ret i32 %11
}
/* Variables and functions */
double abs(float);
float my_sqrt(float x) {
  float lastGuess = x / 2.0;
  float guess;
  while (true) {
    guess = (lastGuess + x / lastGuess) / 2.0;
    if (abs(guess - lastGuess) < .000001)
      return guess;
    lastGuess = guess;
  }
  return guess;
}


x86 assembly (clang, -O0):
<my_sqrt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xed2(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
movss  -0x4(%rbp),%xmm1
divss  -0x8(%rbp),%xmm1
addss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xea6(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
subss  -0x8(%rbp),%xmm0
call   1030 <abs@plt>
movaps %xmm0,%xmm1
movsd  0xe87(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    1196 <my_sqrt+0x86>
movss  -0xc(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
jmp    113b <my_sqrt+0x2b>

x86 assembly (clang, -O2):
<my_sqrt>:
push   %rax
movss  0xee7(%rip),%xmm1
movss  %xmm0,(%rsp)
mulss  %xmm0,%xmm1
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movss  (%rsp),%xmm0
divss  %xmm1,%xmm0
addss  %xmm1,%xmm0
mulss  0xebb(%rip),%xmm0
movss  %xmm0,0x4(%rsp)
subss  %xmm1,%xmm0
call   1030 <abs@plt>
movss  0x4(%rsp),%xmm1
movsd  0xea6(%rip),%xmm2
ucomisd %xmm0,%xmm2
jbe    1130 <my_sqrt+0x20>
movaps %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @my_sqrt(float %0) {
%2 = alloca float
%3 = alloca float
%4 = alloca float
store float %0, float* %2
%5 = load float, float* %2
%6 = fpext float %5 to double
%7 = fdiv double %6, 2.000000e+00
%8 = fptrunc double %7 to float
store float %8, float* %3
br label %9
9: ; preds = %1, %25
%10 = load float, float* %3
%11 = load float, float* %2
%12 = load float, float* %3
%13 = fdiv float %11, %12
%14 = fadd float %10, %13
%15 = fpext float %14 to double
%16 = fdiv double %15, 2.000000e+00
%17 = fptrunc double %16 to float
store float %17, float* %4
%18 = load float, float* %4
%19 = load float, float* %3
%20 = fsub float %18, %19
%21 = call double @abs(float %20)
%22 = fcmp olt double %21, 0x3EB0C6F7A0B5ED8D
br i1 %22, label %23, label %25
23: ; preds = %9
%24 = load float, float* %4
ret float %24
25: ; preds = %9
%26 = load float, float* %4
store float %26, float* %3
br label %9
}

LLVM IR (-O2):
define float @my_sqrt(float %0) {
%2 = fmul float %0, 5.000000e-01
br label %3
3: ; preds = %3, %1
%4 = phi float [ %2, %1 ], [ %7, %3 ]
%5 = fdiv float %0, %4
%6 = fadd float %4, %5
%7 = fmul float %6, 5.000000e-01
%8 = fsub float %7, %4
%9 = tail call double @abs(float %8)
%10 = fcmp olt double %9, 0x3EB0C6F7A0B5ED8D
br i1 %10, label %11, label %3
11: ; preds = %3
ret float %7
}
/* Variables and functions */
int GLUT_LEFT_BUTTON;
int /*<<< orphan*/ GLUT_WINDOW_HEIGHT;
int /*<<< orphan*/ GLUT_WINDOW_WIDTH;
int glutGet(int /*<<< orphan*/);
void mouse(int button, int state, int x, int y) {
  int w = glutGet(GLUT_WINDOW_WIDTH);
  int h = glutGet(GLUT_WINDOW_HEIGHT);
  if (button == GLUT_LEFT_BUTTON) {
  }
}


x86 assembly (clang, -O0):
<mouse>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    0x2ea5(%rip),%rax
mov    (%rax),%edi
call   1030 <glutGet@plt>
mov    %eax,-0x14(%rbp)
mov    0x2eac(%rip),%rax
mov    (%rax),%edi
call   1030 <glutGet@plt>
mov    %eax,-0x18(%rbp)
mov    -0x4(%rbp),%eax
mov    0x2e88(%rip),%rcx
cmp    (%rcx),%eax
jne    115d <mouse+0x4d>
jmp    115d <mouse+0x4d>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mouse>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%edi
call   1030 <glutGet@plt>
mov    0x2ec2(%rip),%rax
mov    (%rax),%edi
pop    %rax
jmp    1030 <glutGet@plt>

LLVM IR (-O0):
@GLUT_WINDOW_WIDTH = global i32 0
@GLUT_WINDOW_HEIGHT = global i32 0
@GLUT_LEFT_BUTTON = global i32 0
define void @mouse(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%11 = load i32, i32* @GLUT_WINDOW_WIDTH
%12 = call i32 @glutGet(i32 %11)
store i32 %12, i32* %9
%13 = load i32, i32* @GLUT_WINDOW_HEIGHT
%14 = call i32 @glutGet(i32 %13)
store i32 %14, i32* %10
%15 = load i32, i32* %5
%16 = load i32, i32* @GLUT_LEFT_BUTTON
%17 = icmp eq i32 %15, %16
br i1 %17, label %18, label %19
18: ; preds = %4
br label %19
19: ; preds = %18, %4
ret void
}

LLVM IR (-O2):
@GLUT_WINDOW_WIDTH = global i32 0
@GLUT_WINDOW_HEIGHT = global i32 0
@GLUT_LEFT_BUTTON = global i32 0
define void @mouse(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = load i32, i32* @GLUT_WINDOW_WIDTH
%6 = tail call i32 @glutGet(i32 %5)
%7 = load i32, i32* @GLUT_WINDOW_HEIGHT
%8 = tail call i32 @glutGet(i32 %7)
ret void
}
/* Type definitions */
struct sockaddr_in {
  int dummy;
};
struct sockaddr {
  int dummy;
};

/* Variables and functions */
int accept(int, struct sockaddr *, unsigned int *);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
int accept_(int *sockfd) {
  struct sockaddr_in c_addr;
  unsigned int c_len = sizeof(struct sockaddr);
  int clientfd = accept(*sockfd, (struct sockaddr *)&c_addr, &c_len);
  if (-1 == clientfd) {
    perror("accept");
    exit(1);
  }
  return clientfd;
}


x86 assembly (clang, -O0):
<accept_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x4,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
lea    -0x10(%rbp),%rsi
lea    -0x14(%rbp),%rdx
call   1040 <accept@plt>
mov    %eax,-0x18(%rbp)
mov    $0xffffffff,%eax
cmp    -0x18(%rbp),%eax
jne    117d <accept_+0x4d>
lea    0xe92(%rip),%rdi
call   1030 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<accept_>:
sub    $0x18,%rsp
movl   $0x4,0xc(%rsp)
mov    (%rdi),%edi
lea    0x10(%rsp),%rsi
lea    0xc(%rsp),%rdx
call   1040 <accept@plt>
cmp    $0xffffffff,%eax
je     1157 <accept_+0x27>
add    $0x18,%rsp
ret
lea    0xea2(%rip),%rdi
call   1030 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
%struct.sockaddr_in = type { i32 }
%struct.sockaddr = type { i32 }
@.str = [7 x i8] c"accept\00"
define i32 @accept_(i32* %0) {
%2 = alloca i32*
%3 = alloca %struct.sockaddr_in
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %2
store i32 4, i32* %4
%6 = load i32*, i32** %2
%7 = load i32, i32* %6
%8 = bitcast %struct.sockaddr_in* %3 to %struct.sockaddr*
%9 = call i32 @accept(i32 %7, %struct.sockaddr* %8, i32* %4)
store i32 %9, i32* %5
%10 = load i32, i32* %5
%11 = icmp eq i32 -1, %10
br i1 %11, label %12, label %15
12: ; preds = %1
%13 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%14 = call i32 @exit(i32 1)
unreachable
15: ; preds = %1
%16 = load i32, i32* %5
ret i32 %16
}

LLVM IR (-O2):
%struct.sockaddr_in = type { i32 }
%struct.sockaddr = type { i32 }
@.str = [7 x i8] c"accept\00"
define i32 @accept_(i32* nocapture %0) {
%2 = alloca %struct.sockaddr_in
%3 = alloca i32
%4 = bitcast %struct.sockaddr_in* %2 to i8*
%5 = bitcast i32* %3 to i8*
store i32 4, i32* %3
%6 = load i32, i32* %0
%7 = bitcast %struct.sockaddr_in* %2 to %struct.sockaddr*
%8 = call i32 @accept(i32 %6, %struct.sockaddr* %7, i32* %3)
%9 = icmp eq i32 %8, -1
br i1 %9, label %10, label %13
10: ; preds = %1
%11 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%12 = call i32 @exit(i32 1)
unreachable
13: ; preds = %1
ret i32 %8
}
int toascii(int c) { return (c & ~0x80); }


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

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

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

LLVM IR (-O2):
define i32 @toascii(i32 %0) {
%2 = and i32 %0, -129
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ func1();
int stack_direction(void) {
  int i;
  unsigned second_func_addr = (unsigned)(func1());
  unsigned first_func_addr = (unsigned)&i;
  return second_func_addr - first_func_addr;
}


x86 assembly (clang, -O0):
<stack_direction>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <func1@plt>
mov    %eax,-0x8(%rbp)
lea    -0x4(%rbp),%rax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
sub    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stack_direction>:
push   %rax
xor    %eax,%eax
call   1030 <func1@plt>
lea    0x4(%rsp),%rcx
sub    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @stack_direction() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = call i32 (...) @func1()
store i32 %4, i32* %2
%5 = ptrtoint i32* %1 to i32
store i32 %5, i32* %3
%6 = load i32, i32* %2
%7 = load i32, i32* %3
%8 = sub i32 %6, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @stack_direction() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (...) @func1()
%4 = ptrtoint i32* %1 to i64
%5 = trunc i64 %4 to i32
%6 = sub i32 %3, %5
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;
struct tm {
  int dummy;
};

/* Variables and functions */
char *asctime(struct tm const *);
int /*<<< orphan*/ mbstowcs(int /*<<< orphan*/ *, char *, int);
wchar_t *wasctime(const struct tm *timeptr) {
  static wchar_t result[26];
  char *time;
  time = asctime(timeptr);
  mbstowcs((wchar_t *)result, time, 26);
  return result;
}


x86 assembly (clang, -O0):
<wasctime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <asctime@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0x2efc(%rip),%rdi
mov    $0x1a,%edx
call   1030 <mbstowcs@plt>
lea    0x2eeb(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wasctime>:
push   %rbx
call   1040 <asctime@plt>
lea    0x2f13(%rip),%rbx
mov    %rbx,%rdi
mov    %rax,%rsi
mov    $0x1a,%edx
call   1030 <mbstowcs@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
@wasctime.result = internal global [26 x i32] zeroinitializer
define i32* @wasctime(%struct.tm* %0) {
%2 = alloca %struct.tm*
%3 = alloca i8*
store %struct.tm* %0, %struct.tm** %2
%4 = load %struct.tm*, %struct.tm** %2
%5 = call i8* @asctime(%struct.tm* %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = call i32 @mbstowcs(i32* getelementptr inbounds ([26 x i32], [26 x i32]* @wasctime.result, i64 0, i64 0), i8* %6, i32 26)
ret i32* getelementptr inbounds ([26 x i32], [26 x i32]* @wasctime.result, i64 0, i64 0)
}

LLVM IR (-O2):
%struct.tm = type { i32 }
@wasctime.result = internal global [26 x i32] zeroinitializer
define i32* @wasctime(%struct.tm* %0) {
%2 = tail call i8* @asctime(%struct.tm* %0)
%3 = tail call i32 @mbstowcs(i32* getelementptr inbounds ([26 x i32], [26 x i32]* @wasctime.result, i64 0, i64 0), i8* %2, i32 26)
ret i32* getelementptr inbounds ([26 x i32], [26 x i32]* @wasctime.result, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ LC_ALL;
int isspace(int);
int /*<<< orphan*/ setlocale(int /*<<< orphan*/, char *);
int ls_isspace(int c) {
  int ret;
  setlocale(LC_ALL, "");
  ret = isspace(c);
  setlocale(LC_ALL, "C");
  return ret;
}


x86 assembly (clang, -O0):
<ls_isspace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
lea    0xec6(%rip),%rsi
call   1040 <setlocale@plt>
mov    -0x4(%rbp),%edi
call   1030 <isspace@plt>
mov    %eax,-0x8(%rbp)
mov    0x2e8e(%rip),%rax
mov    (%rax),%edi
lea    0xea5(%rip),%rsi
call   1040 <setlocale@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ls_isspace>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
mov    0x2eb3(%rip),%r14
mov    (%r14),%edi
lea    0xeca(%rip),%rsi
call   1040 <setlocale@plt>
mov    %ebx,%edi
call   1030 <isspace@plt>
mov    %eax,%ebx
mov    (%r14),%edi
lea    0xeb1(%rip),%rsi
call   1040 <setlocale@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@LC_ALL = global i32 0
@.str = [1 x i8] zeroinitializer
@.str.1 = [2 x i8] c"C\00"
define i32 @ls_isspace(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* @LC_ALL
%5 = call i32 @setlocale(i32 %4, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* %2
%7 = call i32 @isspace(i32 %6)
store i32 %7, i32* %3
%8 = load i32, i32* @LC_ALL
%9 = call i32 @setlocale(i32 %8, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%10 = load i32, i32* %3
ret i32 %10
}

LLVM IR (-O2):
@LC_ALL = global i32 0
@.str = [1 x i8] zeroinitializer
@.str.1 = [2 x i8] c"C\00"
define i32 @ls_isspace(i32 %0) {
%2 = load i32, i32* @LC_ALL
%3 = tail call i32 @setlocale(i32 %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @isspace(i32 %0)
%5 = load i32, i32* @LC_ALL
%6 = tail call i32 @setlocale(i32 %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret i32 %4
}
int bitXor(int x, int y) { return ~(~(~x & y) & ~(~y & x)); }


x86 assembly (clang, -O0):
<bitXor>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
xor    $0xffffffff,%eax
and    -0x8(%rbp),%eax
xor    $0xffffffff,%eax
mov    -0x8(%rbp),%ecx
xor    $0xffffffff,%ecx
and    -0x4(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
xor    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitXor>:
mov    %edi,%eax
xor    %esi,%eax
ret

LLVM IR (-O0):
define i32 @bitXor(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 = xor i32 %5, -1
%7 = load i32, i32* %4
%8 = and i32 %6, %7
%9 = xor i32 %8, -1
%10 = load i32, i32* %4
%11 = xor i32 %10, -1
%12 = load i32, i32* %3
%13 = and i32 %11, %12
%14 = xor i32 %13, -1
%15 = and i32 %9, %14
%16 = xor i32 %15, -1
ret i32 %16
}

LLVM IR (-O2):
define i32 @bitXor(i32 %0, i32 %1) {
%3 = xor i32 %1, %0
ret i32 %3
}
void *pcvpf(void *context) { return 0; }


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

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

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

LLVM IR (-O2):
define noalias i8* @pcvpf(i8* nocapture readnone %0) {
ret i8* null
}
unsigned short vdp22_set_vlanid(unsigned short x) { return (x & 0xfff); }


x86 assembly (clang, -O0):
<vdp22_set_vlanid>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
and    $0xfff,%eax
movzwl %ax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define zeroext i16 @vdp22_set_vlanid(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = and i32 %4, 4095
%6 = trunc i32 %5 to i16
ret i16 %6
}

LLVM IR (-O2):
define zeroext i16 @vdp22_set_vlanid(i16 zeroext %0) {
%2 = and i16 %0, 4095
ret i16 %2
}
/* Variables and functions */
int /*<<< orphan*/ strtol(char const *, char **, int);
int ap_is_port(const char *s) {
  char *end;
  if (s == NULL || *s == 0)
    return 0;
  strtol(s, &end, 10);
  return *end == 0;
}


x86 assembly (clang, -O0):
<ap_is_port>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1137 <ap_is_port+0x27>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1143 <ap_is_port+0x33>
movl   $0x0,-0x4(%rbp)
jmp    116a <ap_is_port+0x5a>
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
mov    $0xa,%edx
call   1030 <strtol@plt>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ap_is_port>:
push   %rax
xor    %eax,%eax
test   %rdi,%rdi
je     1136 <ap_is_port+0x26>
cmpb   $0x0,(%rdi)
je     1136 <ap_is_port+0x26>
mov    %rsp,%rsi
mov    $0xa,%edx
call   1030 <strtol@plt>
mov    (%rsp),%rcx
xor    %eax,%eax
cmpb   $0x0,(%rcx)
sete   %al
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @ap_is_port(i8* %0) {
%2 = alloca i8*
%3 = bitcast i8** %2 to i8*
%4 = icmp eq i8* %0, null
br i1 %4, label %14, label %5
5: ; preds = %1
%6 = load i8, i8* %0
%7 = icmp eq i8 %6, 0
br i1 %7, label %14, label %8
8: ; preds = %5
%9 = call i32 @strtol(i8* %0, i8** %2, i32 10)
%10 = load i8*, i8** %2
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
%13 = zext i1 %12 to i32
br label %14
14: ; preds = %1, %5, %8
%15 = phi i32 [ %13, %8 ], [ 0, %5 ], [ 0, %1 ]
ret i32 %15
}
/* Type definitions */
struct UPnPService {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void AVRCP_ResponseSink_AVTransport_Previous(struct UPnPService *Service,
                                             int ErrorCode, void *User) {
  printf("AVRCP_ Invoke Response: AVTransport/Previous[ErrorCode:%d]()\r\n",
         ErrorCode);
}


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

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

LLVM IR (-O0):
%struct.UPnPService = type { i32 }
@.str = [63 x i8] c"AVRCP_ Invoke Response: AVTransport/Previous[ErrorCode:%d]()\0D\0A\00"
define void @AVRCP_ResponseSink_AVTransport_Previous(%struct.UPnPService* %0, i32 %1, i8* %2) {
%4 = alloca %struct.UPnPService*
%5 = alloca i32
%6 = alloca i8*
store %struct.UPnPService* %0, %struct.UPnPService** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i32, i32* %5
%8 = call i32 @printf(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str, i64 0, i64 0), i32 %7)
ret void
}

LLVM IR (-O2):
%struct.UPnPService = type { i32 }
@.str = [63 x i8] c"AVRCP_ Invoke Response: AVTransport/Previous[ErrorCode:%d]()\0D\0A\00"
define void @AVRCP_ResponseSink_AVTransport_Previous(%struct.UPnPService* nocapture readnone %0, i32 %1, i8* nocapture readnone %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ do_finish();
int /*<<< orphan*/ do_init();
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ *stdin;
int main(void) {
  extern int yyparse(void);
  extern FILE *yyin;
  yyin = stdin;
  do_init();
  if (yyparse()) {
    fprintf(stderr, "Error ! Error ! Error !\n");
    exit(1);
  }
  do_finish();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    0x2e8d(%rip),%rax
mov    (%rax),%rcx
mov    0x2e6b(%rip),%rax
mov    %rcx,(%rax)
mov    $0x0,%al
call   1060 <do_init@plt>
call   1040 <yyparse@plt>
cmp    $0x0,%eax
je     119c <main+0x4c>
mov    0x2e54(%rip),%rax
mov    (%rax),%edi
lea    0xe73(%rip),%rsi
call   1050 <fprintf@plt>
mov    $0x1,%edi
call   1070 <exit@plt>
mov    $0x0,%al
call   1030 <do_finish@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2e90(%rip),%rax
mov    (%rax),%rax
mov    0x2e6e(%rip),%rcx
mov    %rax,(%rcx)
xor    %eax,%eax
call   1060 <do_init@plt>
call   1040 <yyparse@plt>
test   %eax,%eax
jne    1180 <main+0x30>
xor    %eax,%eax
call   1030 <do_finish@plt>
xor    %eax,%eax
pop    %rcx
ret
mov    0x2e51(%rip),%rax
mov    (%rax),%edi
lea    0xe70(%rip),%rsi
call   1050 <fprintf@plt>
mov    $0x1,%edi
call   1070 <exit@plt>

LLVM IR (-O0):
@stdin = global i32* null
@yyin = external global i32*
@stderr = global i32 0
@.str = [25 x i8] c"Error ! Error ! Error !\0A\00"
define i32 @main() {
%1 = load i32*, i32** @stdin
store i32* %1, i32** @yyin
%2 = call i32 (...) @do_init()
%3 = call i32 @yyparse()
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %9
5: ; preds = %0
%6 = load i32, i32* @stderr
%7 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @exit(i32 1)
unreachable
9: ; preds = %0
%10 = call i32 (...) @do_finish()
ret i32 0
}

LLVM IR (-O2):
@stdin = global i32* null
@yyin = external global i32*
@stderr = global i32 0
@.str = [25 x i8] c"Error ! Error ! Error !\0A\00"
define i32 @main() {
%1 = load i32*, i32** @stdin
store i32* %1, i32** @yyin
%2 = tail call i32 (...) @do_init()
%3 = tail call i32 @yyparse()
%4 = icmp eq i32 %3, 0
br i1 %4, label %9, label %5
5: ; preds = %0
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %0
%10 = tail call i32 (...) @do_finish()
ret i32 0
}
int gf_sqr(const int x) { return x * x; }


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

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

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

LLVM IR (-O2):
define i32 @gf_sqr(i32 %0) {
%2 = mul nsw i32 %0, %0
ret i32 %2
}
/* Variables and functions */
scalar_t__ close(int);
int /*<<< orphan*/ t_error(char *);
void xclose(int fd) {
  if (close(fd) != 0) {
    t_error("failed to close file descriptor");
  }
}


x86 assembly (clang, -O0):
<xclose>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <close@plt>
cmp    $0x0,%rax
je     1149 <xclose+0x29>
lea    0xebc(%rip),%rdi
call   1040 <t_error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xclose>:
push   %rax
call   1030 <close@plt>
test   %rax,%rax
je     1138 <xclose+0x18>
lea    0xece(%rip),%rdi
pop    %rax
jmp    1040 <t_error@plt>
pop    %rax
ret

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

LLVM IR (-O2):
@.str = [32 x i8] c"failed to close file descriptor\00"
define void @xclose(i32 %0) {
%2 = tail call i64 @close(i32 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @t_error(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ jmp_buf;

/* Variables and functions */
int /*<<< orphan*/ longjmp(int /*<<< orphan*/, int);
int /*<<< orphan*/ printf(char *);
void baz(jmp_buf buf) {
  printf("Inside baz\n");
  longjmp(buf, 37);
}


x86 assembly (clang, -O0):
<baz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%edi
mov    $0x25,%esi
call   1040 <longjmp@plt>

x86 assembly (clang, -O2):
<baz>:
push   %rbx
mov    %edi,%ebx
lea    0xed6(%rip),%rdi
call   1030 <puts@plt>
mov    %ebx,%edi
mov    $0x25,%esi
call   1040 <longjmp@plt>

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

LLVM IR (-O2):
@str = [11 x i8] c"Inside baz\00"
define void @baz(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @longjmp(i32 %0, i32 37)
unreachable
}
/* Variables and functions */
long long scm_page_level(long long);
long long scm_page_rank(long long);
long long scm_page_col(long long i) {
  return scm_page_rank(i) % (1LL << scm_page_level(i));
}


x86 assembly (clang, -O0):
<scm_page_col>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <scm_page_rank@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <scm_page_level@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
mov    $0x1,%edx
shl    %cl,%rdx
mov    %rdx,%rcx
cqto
idiv   %rcx
mov    %rdx,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<scm_page_col>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1040 <scm_page_rank@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1030 <scm_page_level@plt>
mov    $0x1,%esi
mov    %eax,%ecx
shl    %cl,%rsi
mov    %r14,%rcx
bts    %rax,%rcx
shr    $0x20,%rcx
je     115b <scm_page_col+0x3b>
mov    %r14,%rax
cqto
idiv   %rsi
mov    %rdx,%rax
jmp    1164 <scm_page_col+0x44>
mov    %r14d,%eax
xor    %edx,%edx
div    %esi
mov    %edx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i64 @scm_page_col(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i64 @scm_page_rank(i64 %3)
%5 = load i64, i64* %2
%6 = call i64 @scm_page_level(i64 %5)
%7 = shl i64 1, %6
%8 = srem i64 %4, %7
ret i64 %8
}

LLVM IR (-O2):
define i64 @scm_page_col(i64 %0) {
%2 = tail call i64 @scm_page_rank(i64 %0)
%3 = tail call i64 @scm_page_level(i64 %0)
%4 = shl nuw i64 1, %3
%5 = srem i64 %2, %4
ret i64 %5
}
/* Type definitions */
typedef int off_t;

/* Variables and functions */
off_t sporkel_bsdiff_patchsize_max(off_t newsize, off_t oldsize) {
  return 2 * (((newsize) > (oldsize)) ? (newsize) : (oldsize)) + 102400;
}


x86 assembly (clang, -O0):
<sporkel_bsdiff_patchsize_max>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1121 <sporkel_bsdiff_patchsize_max+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <sporkel_bsdiff_patchsize_max+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
add    $0x19000,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sporkel_bsdiff_patchsize_max>:
cmp    %esi,%edi
cmovg  %edi,%esi
lea    (%rsi,%rsi,1),%eax
add    $0x19000,%eax
ret

LLVM IR (-O0):
define i32 @sporkel_bsdiff_patchsize_max(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 = icmp sgt i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %3
br label %12
10: ; preds = %2
%11 = load i32, i32* %4
br label %12
12: ; preds = %10, %8
%13 = phi i32 [ %9, %8 ], [ %11, %10 ]
%14 = mul nsw i32 2, %13
%15 = add nsw i32 %14, 102400
ret i32 %15
}

LLVM IR (-O2):
define i32 @sporkel_bsdiff_patchsize_max(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
%5 = shl nsw i32 %4, 1
%6 = add nsw i32 %5, 102400
ret i32 %6
}
void g_closure_ref() {}


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

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

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

LLVM IR (-O2):
define void @g_closure_ref() {
ret void
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int assign_quaddobl_coefficient_of_slice(int i, int j, double *r) {
  int fail;
  fail = _ada_use_c2phc(663, &i, &j, r);
  return fail;
}


x86 assembly (clang, -O0):
<assign_quaddobl_coefficient_of_slice>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
mov    $0x297,%edi
lea    -0x4(%rbp),%rsi
lea    -0x8(%rbp),%rdx
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<assign_quaddobl_coefficient_of_slice>:
push   %rax
mov    %rdx,%rcx
mov    %edi,0x4(%rsp)
mov    %esi,(%rsp)
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
mov    $0x297,%edi
call   1030 <_ada_use_c2phc@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @assign_quaddobl_coefficient_of_slice(i32 %0, i32 %1, double* %2) {
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = call i32 @_ada_use_c2phc(i32 663, i32* %4, i32* %5, double* %2)
ret i32 %6
}
/* Variables and functions */
int cr_main(int, char **);
int main(int argc, char **argv) { return cr_main(argc, argv); }


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)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <cr_main@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
jmp    1030 <cr_main@plt>

LLVM IR (-O0):
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 = load i32, i32* %4
%7 = load i8**, i8*** %5
%8 = call i32 @cr_main(i32 %6, i8** %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @cr_main(i32 %0, i8** %1)
ret i32 %3
}
/* Variables and functions */
int abs(int const);
int PointDistance(const int x1, const int y1, const int x2, const int y2) {
  return abs(x1 - x2) + abs(y1 - y2);
}


x86 assembly (clang, -O0):
<PointDistance>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%edi
sub    -0xc(%rbp),%edi
call   1030 <abs@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%edi
sub    -0x10(%rbp),%edi
call   1030 <abs@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
add    %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PointDistance>:
sub    %edx,%edi
mov    %edi,%edx
neg    %edx
cmovs  %edi,%edx
sub    %ecx,%esi
mov    %esi,%eax
neg    %eax
cmovs  %esi,%eax
add    %edx,%eax
ret

LLVM IR (-O0):
define i32 @PointDistance(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load i32, i32* %7
%11 = sub nsw i32 %9, %10
%12 = call i32 @abs(i32 %11)
%13 = load i32, i32* %6
%14 = load i32, i32* %8
%15 = sub nsw i32 %13, %14
%16 = call i32 @abs(i32 %15)
%17 = add nsw i32 %12, %16
ret i32 %17
}

LLVM IR (-O2):
define i32 @PointDistance(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = sub nsw i32 %0, %2
%6 = tail call i32 @llvm.abs.i32(i32 %5, i1 true)
%7 = sub nsw i32 %1, %3
%8 = tail call i32 @llvm.abs.i32(i32 %7, i1 true)
%9 = add nuw nsw i32 %8, %6
ret i32 %9
}
int id(int a) { return a; }


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

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

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

LLVM IR (-O2):
define i32 @id(i32 returned %0) {
ret i32 %0
}
void set_h0(unsigned char *h0, unsigned char val) { (*h0) |= (val & 0xf); }


x86 assembly (clang, -O0):
<set_h0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movzbl -0x9(%rbp),%edx
and    $0xf,%edx
mov    -0x8(%rbp),%rax
movzbl (%rax),%ecx
or     %edx,%ecx
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_h0>:
and    $0xf,%sil
or     %sil,(%rdi)
ret

LLVM IR (-O0):
define void @set_h0(i8* %0, i8 zeroext %1) {
%3 = alloca i8*
%4 = alloca i8
store i8* %0, i8** %3
store i8 %1, i8* %4
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = and i32 %6, 15
%8 = load i8*, i8** %3
%9 = load i8, i8* %8
%10 = zext i8 %9 to i32
%11 = or i32 %10, %7
%12 = trunc i32 %11 to i8
store i8 %12, i8* %8
ret void
}

LLVM IR (-O2):
define void @set_h0(i8* nocapture %0, i8 zeroext %1) {
%3 = and i8 %1, 15
%4 = load i8, i8* %0
%5 = or i8 %4, %3
store i8 %5, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ japi_separator(int);
void j_separator(int arg0) { japi_separator(arg0); }


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

x86 assembly (clang, -O2):
<j_separator>:
jmp    1030 <japi_separator@plt>

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

LLVM IR (-O2):
define void @j_separator(i32 %0) {
%2 = tail call i32 @japi_separator(i32 %0)
ret void
}