xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void pr(int *arr, int size) {
  int i;
  for (i = 0; i < size; ++i)
    printf("%d, ", arr[i]);
  printf("\n");
}


x86 assembly (clang, -O0):
<pr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1159 <pr+0x49>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <pr+0x16>
lea    0xea5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [5 x i8] c"%d, \00"
define void @pr(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
%14 = tail call i32 @putchar(i32 10)
ret void
}
long __ccaprice_syscall_args_5(long A0, long A1, long A2, long A3, long A4,
                               long A5) {
  unsigned long R;
  register long R10 __asm__("r10") = A4;
  register long R08 __asm__("r8") = A5;
  __asm__ __volatile__("syscall"
                       : "=a"(R)
                       : "a"(A0), "D"(A1), "S"(A2), "d"(A3), "r"(R10), "r"(R08)
                       : "rcx", "r11", "memory");
  return R;
}


x86 assembly (clang, -O0):
<__ccaprice_syscall_args_5>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x30(%rbp),%rax
mov    %rax,-0x48(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x40(%rbp),%r10
mov    -0x48(%rbp),%r8
syscall
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__ccaprice_syscall_args_5>:
mov    %rdi,%rax
mov    %rsi,%rdi
mov    %rdx,%rsi
mov    %rcx,%rdx
mov    %r8,%r10
mov    %r9,%r8
syscall
ret

LLVM IR (-O0):
define i64 @__ccaprice_syscall_args_5(i64 %0, i64 %1, i64 %2, i64 %3, i64 %4, i64 %5) {
%7 = alloca i64
%8 = alloca i64
%9 = alloca i64
%10 = alloca i64
%11 = alloca i64
%12 = alloca i64
%13 = alloca i64
%14 = alloca i64
%15 = alloca i64
store i64 %0, i64* %7
store i64 %1, i64* %8
store i64 %2, i64* %9
store i64 %3, i64* %10
store i64 %4, i64* %11
store i64 %5, i64* %12
%16 = load i64, i64* %11
store i64 %16, i64* %14
%17 = load i64, i64* %12
store i64 %17, i64* %15
%18 = load i64, i64* %7
%19 = load i64, i64* %8
%20 = load i64, i64* %9
%21 = load i64, i64* %10
%22 = load i64, i64* %14
%23 = load i64, i64* %15
%24 = call i64 asm sideeffect "syscall", "={ax},{ax},{di},{si},{dx},{r10},{r8},~{rcx},~{r11},~{memory},~{dirflag},~{fpsr},~{flags}"(i64 %18, i64 %19, i64 %20, i64 %21, i64 %22, i64 %23)
store i64 %24, i64* %13
%25 = load i64, i64* %13
ret i64 %25
}

LLVM IR (-O2):
define i64 @__ccaprice_syscall_args_5(i64 %0, i64 %1, i64 %2, i64 %3, i64 %4, i64 %5) {
%7 = tail call i64 asm sideeffect "syscall", "={ax},{ax},{di},{si},{dx},{r10},{r8},~{rcx},~{r11},~{memory},~{dirflag},~{fpsr},~{flags}"(i64 %0, i64 %1, i64 %2, i64 %3, i64 %4, i64 %5)
ret i64 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_attr_t;

/* Variables and functions */
int pthread_attr_init(pthread_attr_t *attr) {
  ;
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @pthread_attr_init(i32* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
float sin(float);
float d2y1(float x) { return sin(x) + x; }


x86 assembly (clang, -O0):
<d2y1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <sin@plt>
addss  -0x4(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<d2y1>:
push   %rax
movss  %xmm0,0x4(%rsp)
call   1030 <sin@plt>
addss  0x4(%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @d2y1(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @sin(float %3)
%5 = load float, float* %2
%6 = fadd float %4, %5
ret float %6
}

LLVM IR (-O2):
define float @d2y1(float %0) {
%2 = tail call float @sin(float %0)
%3 = fadd float %2, %0
ret float %3
}
/* Variables and functions */
int /*<<< orphan*/ raise(int);
main() { raise(11); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0xb,%edi
call   1030 <raise@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xb,%edi
call   1030 <raise@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 @raise(i32 11)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @raise(i32 11)
ret i32 0
}
void test_clear_cache_chars(char *start, char *end) {
  __clear_cache(start, end);
}


x86 assembly (clang, -O0):
<test_clear_cache_chars>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x0,%al
call   1130 <__clear_cache>
add    $0x10,%rsp
pop    %rbp
ret
cs nopw 0x0(%rax,%rax,1)
nop

x86 assembly (clang, -O2):
<test_clear_cache_chars>:
xor    %eax,%eax
jmp    1110 <__clear_cache>
nopw   0x0(%rax,%rax,1)

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

LLVM IR (-O2):
define void @test_clear_cache_chars(i8* %0, i8* %1) {
%3 = tail call i32 (i8*, i8*, ...) bitcast (i32 (...)* @__clear_cache to i32 (i8*, i8*, ...)*)(i8* %0, i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ example1();
int /*<<< orphan*/ example2();
int main(void) {
  example1();
  example2();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <example1@plt>
mov    $0x0,%al
call   1030 <example2@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @example1()
%2 = call i32 (...) @example2()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @example1()
%2 = tail call i32 (...) @example2()
ret i32 0
}
/* Variables and functions */
int limit(int /*<<< orphan*/, int /*<<< orphan*/, int);
int /*<<< orphan*/ round(int);
int pixlerp(int v0, int v1, float a) {
  return limit(round(v0 * (1.0 - a) + v1 * a), 0, 255);
}


x86 assembly (clang, -O0):
<pixlerp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
movsd  0xeb7(%rip),%xmm2
subsd  %xmm1,%xmm2
cvtsi2ssl -0x8(%rbp),%xmm1
mulss  -0xc(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1040 <round@plt>
mov    %eax,%edi
xor    %esi,%esi
mov    $0xff,%edx
call   1030 <limit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pixlerp>:
push   %rax
cvtsi2sd %edi,%xmm1
cvtss2sd %xmm0,%xmm2
movsd  0xecf(%rip),%xmm3
subsd  %xmm2,%xmm3
mulsd  %xmm1,%xmm3
xorps  %xmm1,%xmm1
cvtsi2ss %esi,%xmm1
mulss  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtss2sd %xmm1,%xmm0
addsd  %xmm3,%xmm0
cvttsd2si %xmm0,%edi
call   1040 <round@plt>
mov    %eax,%edi
xor    %esi,%esi
mov    $0xff,%edx
pop    %rax
jmp    1030 <limit@plt>

LLVM IR (-O0):
define i32 @pixlerp(i32 %0, i32 %1, float %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca float
store i32 %0, i32* %4
store i32 %1, i32* %5
store float %2, float* %6
%7 = load i32, i32* %4
%8 = sitofp i32 %7 to double
%9 = load float, float* %6
%10 = fpext float %9 to double
%11 = fsub double 1.000000e+00, %10
%12 = load i32, i32* %5
%13 = sitofp i32 %12 to float
%14 = load float, float* %6
%15 = fmul float %13, %14
%16 = fpext float %15 to double
%17 = call double @llvm.fmuladd.f64(double %8, double %11, double %16)
%18 = fptosi double %17 to i32
%19 = call i32 @round(i32 %18)
%20 = call i32 @limit(i32 %19, i32 0, i32 255)
ret i32 %20
}

LLVM IR (-O2):
define i32 @pixlerp(i32 %0, i32 %1, float %2) {
%4 = sitofp i32 %0 to double
%5 = fpext float %2 to double
%6 = fsub double 1.000000e+00, %5
%7 = sitofp i32 %1 to float
%8 = fmul float %7, %2
%9 = fpext float %8 to double
%10 = tail call double @llvm.fmuladd.f64(double %4, double %6, double %9)
%11 = fptosi double %10 to i32
%12 = tail call i32 @round(i32 %11)
%13 = tail call i32 @limit(i32 %12, i32 0, i32 255)
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ write(char *, char *, int /*<<< orphan*/ *);
void post_task() { write("msproject.xml", "</Task>\n", NULL); }


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

x86 assembly (clang, -O2):
<post_task>:
lea    0xee9(%rip),%rdi
lea    0xef0(%rip),%rsi
xor    %edx,%edx
jmp    1030 <write@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"msproject.xml\00"
@.str.1 = [9 x i8] c"</Task>\0A\00"
define void @post_task() {
%1 = call i32 @write(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32* null)
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"msproject.xml\00"
@.str.1 = [9 x i8] c"</Task>\0A\00"
define void @post_task() {
%1 = tail call i32 @write(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32* null)
ret void
}
int test3(int a, int b) {
  int lt = a <= b;
  int eq = a == b;
  return (lt || eq);
}


x86 assembly (clang, -O0):
<test3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
setle  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x10(%rbp)
mov    $0x1,%al
cmpl   $0x0,-0xc(%rbp)
mov    %al,-0x11(%rbp)
jne    1145 <test3+0x45>
cmpl   $0x0,-0x10(%rbp)
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test3>:
xor    %eax,%eax
cmp    %esi,%edi
setle  %al
ret

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

LLVM IR (-O2):
define i32 @test3(i32 %0, i32 %1) {
%3 = icmp sle i32 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int sqrtx(int);
int main(int argc, char *argv[]) {
  printf("%d\n", sqrtx(5444));
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @sqrtx(i32 5444)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ bar(int);
void foo(int param) {
  int local = param;
  bar(local);
}


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

x86 assembly (clang, -O2):
<foo>:
jmp    1030 <bar@plt>

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

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


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

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

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

LLVM IR (-O2):
define void @uniphier_ld11_sbc_init() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gen_emit_impl(int, char *, char const *);
void gen_jmp(const char *label) {
  gen_emit_impl(458,
                "\t"
                "jmp %s",
                label);
}


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

x86 assembly (clang, -O2):
<gen_jmp>:
mov    %rdi,%rdx
lea    0xee6(%rip),%rsi
mov    $0x1ca,%edi
jmp    1030 <gen_emit_impl@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"\09jmp %s\00"
define void @gen_jmp(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @gen_emit_impl(i32 458, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"\09jmp %s\00"
define void @gen_jmp(i8* %0) {
%2 = tail call i32 @gen_emit_impl(i32 458, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void macscp2_1() { puts("macscp2_1"); }


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

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

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

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

/* Variables and functions */
char *ctime(const time_t *timep) { return 0; }


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

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

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

LLVM IR (-O2):
define noalias i8* @ctime(i32* nocapture readnone %0) {
ret i8* null
}
/* Variables and functions */
scalar_t__ isPrime(int);
int PrimeCounter(int arr[5], int size) {
  int count = 0;
  int i;
  for (i = 0; i < size; i++)
    if (isPrime(i))
      count++;
  return count;
}


x86 assembly (clang, -O0):
<PrimeCounter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1167 <PrimeCounter+0x57>
mov    -0x14(%rbp),%edi
call   1030 <isPrime@plt>
cmp    $0x0,%rax
je     1154 <PrimeCounter+0x44>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1159 <PrimeCounter+0x49>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112d <PrimeCounter+0x1d>
mov    -0x10(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PrimeCounter>:
push   %rbp
push   %r14
push   %rbx
test   %esi,%esi
jle    1138 <PrimeCounter+0x28>
mov    %esi,%r14d
xor    %ebx,%ebx
xor    %ebp,%ebp
nop
mov    %ebx,%edi
call   1030 <isPrime@plt>
cmp    $0x1,%rax
sbb    $0xffffffff,%ebp
add    $0x1,%ebx
cmp    %ebx,%r14d
jne    1120 <PrimeCounter+0x10>
jmp    113a <PrimeCounter+0x2a>
xor    %ebp,%ebp
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @PrimeCounter(i32* nocapture readnone %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2, %4
%5 = phi i32 [ %11, %4 ], [ 0, %2 ]
%6 = phi i32 [ %10, %4 ], [ 0, %2 ]
%7 = tail call i64 @isPrime(i32 %5)
%8 = icmp ne i64 %7, 0
%9 = zext i1 %8 to i32
%10 = add nuw nsw i32 %6, %9
%11 = add nuw nsw i32 %5, 1
%12 = icmp eq i32 %11, %1
br i1 %12, label %13, label %4
13: ; preds = %4, %2
%14 = phi i32 [ 0, %2 ], [ %10, %4 ]
ret i32 %14
}
int read_proc_table(int index) {
  int i, j, k, len, ret = 0;
  char *local_func, *local_proc;
  return 0;
}


x86 assembly (clang, -O0):
<read_proc_table>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x18(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @read_proc_table(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i8*
store i32 %0, i32* %2
store i32 0, i32* %7
ret i32 0
}

LLVM IR (-O2):
define i32 @read_proc_table(i32 %0) {
ret i32 0
}
int test_imm_93int8_reg(signed char val) {
  return ((val) & (0x93 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_93int8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
and    $0x93,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_93int8_reg>:
test   $0x93,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_93int8_reg(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = and i32 %4, 147
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_93int8_reg(i8 signext %0) {
%2 = and i8 %0, -109
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int parentIndex(int index) { return (index - 1) / 2; }


x86 assembly (clang, -O0):
<parentIndex>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @parentIndex(i32 %0) {
%2 = add nsw i32 %0, -1
%3 = sdiv i32 %2, 2
ret i32 %3
}
/* Variables and functions */
scalar_t__ chars_is_upper(char);
char chars_to_lower(char c) {
  if (chars_is_upper(c))
    return c + ('a' - 'A');
  else
    return c;
}


x86 assembly (clang, -O0):
<chars_to_lower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%edi
call   1030 <chars_is_upper@plt>
cmp    $0x0,%rax
je     1140 <chars_to_lower+0x30>
movsbl -0x2(%rbp),%eax
add    $0x20,%eax
mov    %al,-0x1(%rbp)
jmp    1146 <chars_to_lower+0x36>
mov    -0x2(%rbp),%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chars_to_lower>:
push   %rbx
mov    %edi,%ebx
call   1030 <chars_is_upper@plt>
lea    0x20(%rbx),%ecx
test   %rax,%rax
movzbl %cl,%eax
cmove  %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define signext i8 @chars_to_lower(i8 signext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = call i64 @chars_is_upper(i8 signext %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = add nsw i32 %9, 32
%11 = trunc i32 %10 to i8
store i8 %11, i8* %2
br label %14
12: ; preds = %1
%13 = load i8, i8* %3
store i8 %13, i8* %2
br label %14
14: ; preds = %12, %7
%15 = load i8, i8* %2
ret i8 %15
}

LLVM IR (-O2):
define signext i8 @chars_to_lower(i8 signext %0) {
%2 = tail call i64 @chars_is_upper(i8 signext %0)
%3 = icmp eq i64 %2, 0
%4 = add i8 %0, 32
%5 = select i1 %3, i8 %0, i8 %4
ret i8 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage() { printf("usage: srchcut scbios.com\n"); }


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

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

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

LLVM IR (-O2):
@str = [26 x i8] c"usage: srchcut scbios.com\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
typedef int /*<<< orphan*/ *hptr;

/* Variables and functions */
int /*<<< orphan*/ assert(int);
int hExtractTag(int /*<<< orphan*/ *);
uint32_t unboxUnsigned(uint32_t *hptr) {
  assert(hExtractTag(hptr) == 0x00000000);
  return ((*((hptr) + 1)));
}


x86 assembly (clang, -O0):
<unboxUnsigned>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <hExtractTag@plt>
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unboxUnsigned>:
push   %rbx
mov    %rdi,%rbx
call   1040 <hExtractTag@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1030 <assert@plt>
mov    0x4(%rbx),%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @unboxUnsigned(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @hExtractTag(i32* %3)
%5 = icmp eq i32 %4, 0
%6 = zext i1 %5 to i32
%7 = call i32 @assert(i32 %6)
%8 = load i32*, i32** %2
%9 = getelementptr inbounds i32, i32* %8, i64 1
%10 = load i32, i32* %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @unboxUnsigned(i32* %0) {
%2 = tail call i32 @hExtractTag(i32* %0)
%3 = icmp eq i32 %2, 0
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = getelementptr inbounds i32, i32* %0, i64 1
%7 = load i32, i32* %6
ret i32 %7
}
/* Variables and functions */
scalar_t__ strchr(char const *, int);
unsigned char *cst_strchr(const unsigned char *s, int c) {
  return (unsigned char *)strchr((const char *)s, c);
}


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

x86 assembly (clang, -O2):
<cst_strchr>:
jmp    1030 <strchr@plt>

LLVM IR (-O0):
define i8* @cst_strchr(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 i64 @strchr(i8* %5, i32 %6)
%8 = inttoptr i64 %7 to i8*
ret i8* %8
}

LLVM IR (-O2):
define i8* @cst_strchr(i8* %0, i32 %1) {
%3 = tail call i64 @strchr(i8* %0, i32 %1)
%4 = inttoptr i64 %3 to i8*
ret i8* %4
}
void worker_init() {}


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

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

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

LLVM IR (-O2):
define void @worker_init() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ record_linux_param_description(char *, char *, char *);
void module_param_desc_use_bandwidth_switch(void) {
  record_linux_param_description("tcp_htcp.c", "use_bandwidth_switch",
                                 "turn on/off bandwidth switcher");
}


x86 assembly (clang, -O0):
<module_param_desc_use_bandwidth_switch>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xee9(%rip),%rsi
lea    0xef7(%rip),%rdx
call   1030 <record_linux_param_description@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<module_param_desc_use_bandwidth_switch>:
lea    0xee9(%rip),%rdi
lea    0xeed(%rip),%rsi
lea    0xefb(%rip),%rdx
jmp    1030 <record_linux_param_description@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"tcp_htcp.c\00"
@.str.1 = [21 x i8] c"use_bandwidth_switch\00"
@.str.2 = [31 x i8] c"turn on/off bandwidth switcher\00"
define void @module_param_desc_use_bandwidth_switch() {
%1 = call i32 @record_linux_param_description(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"tcp_htcp.c\00"
@.str.1 = [21 x i8] c"use_bandwidth_switch\00"
@.str.2 = [31 x i8] c"turn on/off bandwidth switcher\00"
define void @module_param_desc_use_bandwidth_switch() {
%1 = tail call i32 @record_linux_param_description(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0))
ret void
}
const char *db_current_trial_balance_entity_report_sql(void) {
  static const char *query =
      "SELECT `A/C No.`, Description, Balance FROM current_trial_balance"
      "  WHERE Entity = %s";
  return query;
}


x86 assembly (clang, -O0):
<db_current_trial_balance_entity_report_sql>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f15(%rip),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
@db_current_trial_balance_entity_report_sql.query = internal global i8* getelementptr inbounds ([85 x i8], [85 x i8]* @.str, i32 0, i32 0)
@.str = [85 x i8] c"SELECT `A/C No.`, Description, Balance FROM current_trial_balance WHERE Entity = %s\00"
define i8* @db_current_trial_balance_entity_report_sql() {
%1 = load i8*, i8** @db_current_trial_balance_entity_report_sql.query
ret i8* %1
}

LLVM IR (-O2):
@.str = [85 x i8] c"SELECT `A/C No.`, Description, Balance FROM current_trial_balance WHERE Entity = %s\00"
define i8* @db_current_trial_balance_entity_report_sql() {
ret i8* getelementptr inbounds ([85 x i8], [85 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int, int);
void Logging_log_callback(int id, int line, int par1, int par2) {
  printf("%d,%d,%d,%d\n", id, line, par1, par2);
}


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

x86 assembly (clang, -O2):
<Logging_log_callback>:
mov    %ecx,%r8d
mov    %edx,%ecx
mov    %esi,%edx
mov    %edi,%esi
lea    0xee0(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"%d,%d,%d,%d\0A\00"
define void @Logging_log_callback(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* %6
%11 = load i32, i32* %7
%12 = load i32, i32* %8
%13 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %9, i32 %10, i32 %11, i32 %12)
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"%d,%d,%d,%d\0A\00"
define void @Logging_log_callback(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1, i32 %2, i32 %3)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ u_int32_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fwrite(int /*<<< orphan*/ *, int, int, int /*<<< orphan*/ *);
void write_word(u_int32_t *w, FILE *f) { fwrite(w, 4, 1, f); }


x86 assembly (clang, -O0):
<write_word>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rcx
mov    $0x4,%esi
mov    $0x1,%edx
call   1030 <fwrite@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_word>:
mov    %rsi,%rcx
mov    $0x4,%esi
mov    $0x1,%edx
jmp    1030 <fwrite@plt>

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

LLVM IR (-O2):
define void @write_word(i32* nocapture %0, i32* nocapture %1) {
%3 = tail call i32 @fwrite(i32* %0, i32 4, i32 1, i32* %1)
ret void
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_mode;
};

/* Variables and functions */
int /*<<< orphan*/ EBADF;
int STDOUT_FILENO;
int /*<<< orphan*/ S_IFCHR;
int /*<<< orphan*/ errno;
int _fstat(int file, struct stat *st) {
  if (STDOUT_FILENO == file) {
    st->st_mode = S_IFCHR;
    return 0;
  } else {
    errno = EBADF;
    return -1;
  }
}


x86 assembly (clang, -O0):
<_fstat>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ede(%rip),%rax
mov    (%rax),%eax
cmp    -0x8(%rbp),%eax
jne    1138 <_fstat+0x38>
mov    0x2eb4(%rip),%rax
mov    (%rax),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
movl   $0x0,-0x4(%rbp)
jmp    1151 <_fstat+0x51>
mov    0x2e89(%rip),%rax
mov    (%rax),%ecx
mov    0x2e88(%rip),%rax
mov    %ecx,(%rax)
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_fstat>:
mov    0x2ee9(%rip),%rax
cmp    %edi,(%rax)
jne    1119 <_fstat+0x19>
mov    0x2ec6(%rip),%rax
mov    (%rax),%eax
mov    %eax,(%rsi)
xor    %eax,%eax
ret
mov    0x2ea8(%rip),%rax
mov    (%rax),%eax
mov    0x2ea7(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
@STDOUT_FILENO = global i32 0
@S_IFCHR = global i32 0
@EBADF = global i32 0
@errno = global i32 0
define i32 @_fstat(i32 %0, %struct.stat* %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca %struct.stat*
store i32 %0, i32* %4
store %struct.stat* %1, %struct.stat** %5
%6 = load i32, i32* @STDOUT_FILENO
%7 = load i32, i32* %4
%8 = icmp eq i32 %6, %7
br i1 %8, label %9, label %13
9: ; preds = %2
%10 = load i32, i32* @S_IFCHR
%11 = load %struct.stat*, %struct.stat** %5
%12 = getelementptr inbounds %struct.stat, %struct.stat* %11, i32 0, i32 0
store i32 %10, i32* %12
store i32 0, i32* %3
br label %15
13: ; preds = %2
%14 = load i32, i32* @EBADF
store i32 %14, i32* @errno
store i32 -1, i32* %3
br label %15
15: ; preds = %13, %9
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@STDOUT_FILENO = global i32 0
@S_IFCHR = global i32 0
@EBADF = global i32 0
@errno = global i32 0
define i32 @_fstat(i32 %0, %struct.stat* nocapture writeonly %1) {
%3 = load i32, i32* @STDOUT_FILENO
%4 = icmp eq i32 %3, %0
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = load i32, i32* @S_IFCHR
%7 = getelementptr inbounds %struct.stat, %struct.stat* %1, i64 0, i32 0
store i32 %6, i32* %7
br label %10
8: ; preds = %2
%9 = load i32, i32* @EBADF
store i32 %9, i32* @errno
br label %10
10: ; preds = %8, %5
%11 = phi i32 [ 0, %5 ], [ -1, %8 ]
ret i32 %11
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int ph_ssl_handle_packet(void *handler, const char *packet, ssize_t len) {
  return 0;
}


x86 assembly (clang, -O0):
<ph_ssl_handle_packet>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @ph_ssl_handle_packet(i8* nocapture readnone %0, i8* nocapture readnone %1, i32 %2) {
ret i32 0
}
int pc2snes(int ad) {
  return (((ad << 1) & 0x7f0000) | ((ad & 0x7fff) | 0x8000));
}


x86 assembly (clang, -O0):
<pc2snes>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
and    $0x7f0000,%eax
mov    -0x4(%rbp),%ecx
and    $0x7fff,%ecx
or     $0x8000,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pc2snes>:
movzwl %di,%eax
mov    %edi,%ecx
and    $0x3f8000,%ecx
lea    (%rax,%rcx,2),%eax
or     $0x8000,%eax
ret

LLVM IR (-O0):
define i32 @pc2snes(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = shl i32 %3, 1
%5 = and i32 %4, 8323072
%6 = load i32, i32* %2
%7 = and i32 %6, 32767
%8 = or i32 %7, 32768
%9 = or i32 %5, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @pc2snes(i32 %0) {
%2 = shl i32 %0, 1
%3 = and i32 %2, 8323072
%4 = and i32 %0, 32767
%5 = or i32 %4, %3
%6 = or i32 %5, 32768
ret i32 %6
}
void _VGUI_devcpy(void) {}


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

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

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

LLVM IR (-O2):
define void @_VGUI_devcpy() {
ret void
}
/* Type definitions */
struct epoll_tag {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ dbg(char *);
scalar_t__ netlink_event();
int /*<<< orphan*/ netstate_update();
void netlink_ready(struct epoll_tag *unused) {
  (void)unused;
  if (netlink_event()) {
    dbg("Netlink event\n");
    netstate_update();
  } else {
    dbg("Netlink false alarm\n");
  }
}


x86 assembly (clang, -O0):
<netlink_ready>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <netlink_event@plt>
cmp    $0x0,%rax
je     1165 <netlink_ready+0x35>
lea    0xeac(%rip),%rdi
call   1030 <dbg@plt>
mov    $0x0,%al
call   1050 <netstate_update@plt>
jmp    1171 <netlink_ready+0x41>
lea    0xea3(%rip),%rdi
call   1030 <dbg@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<netlink_ready>:
push   %rax
xor    %eax,%eax
call   1040 <netlink_event@plt>
test   %rax,%rax
je     1151 <netlink_ready+0x21>
lea    0xebc(%rip),%rdi
call   1030 <dbg@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <netstate_update@plt>
lea    0xeb7(%rip),%rdi
pop    %rax
jmp    1030 <dbg@plt>

LLVM IR (-O0):
%struct.epoll_tag = type { i32 }
@.str = [15 x i8] c"Netlink event\0A\00"
@.str.1 = [21 x i8] c"Netlink false alarm\0A\00"
define void @netlink_ready(%struct.epoll_tag* %0) {
%2 = alloca %struct.epoll_tag*
store %struct.epoll_tag* %0, %struct.epoll_tag** %2
%3 = load %struct.epoll_tag*, %struct.epoll_tag** %2
%4 = call i64 (...) @netlink_event()
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = call i32 @dbg(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%8 = call i32 (...) @netstate_update()
br label %11
9: ; preds = %1
%10 = call i32 @dbg(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
br label %11
11: ; preds = %9, %6
ret void
}

LLVM IR (-O2):
%struct.epoll_tag = type { i32 }
@.str = [15 x i8] c"Netlink event\0A\00"
@.str.1 = [21 x i8] c"Netlink false alarm\0A\00"
define void @netlink_ready(%struct.epoll_tag* nocapture readnone %0) {
%2 = tail call i64 (...) @netlink_event()
%3 = icmp eq i64 %2, 0
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = tail call i32 @dbg(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 (...) @netstate_update()
br label %9
7: ; preds = %1
%8 = tail call i32 @dbg(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
br label %9
9: ; preds = %7, %4
ret void
}
/* Variables and functions */
scalar_t__ bsR(unsigned int);
unsigned int bsGetIntVS(unsigned int numBits) {
  return (unsigned int)bsR(numBits);
}


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

x86 assembly (clang, -O2):
<bsGetIntVS>:
jmp    1030 <bsR@plt>

LLVM IR (-O0):
define i32 @bsGetIntVS(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @bsR(i32 %3)
%5 = trunc i64 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @bsGetIntVS(i32 %0) {
%2 = tail call i64 @bsR(i32 %0)
%3 = trunc i64 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ freopen(char *, char *, int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
int /*<<< orphan*/ stdout;
void init() {
  freopen("sword.in", "r", stdin);
  freopen("sword.out", "w+", stdout);
}


x86 assembly (clang, -O0):
<init>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edx
lea    0xedc(%rip),%rdi
lea    0xede(%rip),%rsi
call   1030 <freopen@plt>
mov    0x2ea1(%rip),%rax
mov    (%rax),%edx
lea    0xecb(%rip),%rdi
lea    0xece(%rip),%rsi
call   1030 <freopen@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edx
lea    0xedf(%rip),%rdi
lea    0xee1(%rip),%rsi
call   1030 <freopen@plt>
mov    0x2ea4(%rip),%rax
mov    (%rax),%edx
lea    0xece(%rip),%rdi
lea    0xed1(%rip),%rsi
pop    %rax
jmp    1030 <freopen@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"sword.in\00"
@.str.1 = [2 x i8] c"r\00"
@stdin = global i32 0
@.str.2 = [10 x i8] c"sword.out\00"
@.str.3 = [3 x i8] c"w+\00"
@stdout = global i32 0
define void @init() {
%1 = load i32, i32* @stdin
%2 = call i32 @freopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 %1)
%3 = load i32, i32* @stdout
%4 = call i32 @freopen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"sword.in\00"
@.str.1 = [2 x i8] c"r\00"
@stdin = global i32 0
@.str.2 = [10 x i8] c"sword.out\00"
@.str.3 = [3 x i8] c"w+\00"
@stdout = global i32 0
define void @init() {
%1 = load i32, i32* @stdin
%2 = tail call i32 @freopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 %1)
%3 = load i32, i32* @stdout
%4 = tail call i32 @freopen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 %3)
ret void
}
void _cc3_servo_int() {}


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

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

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

LLVM IR (-O2):
define void @_cc3_servo_int() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ glPointSize(float);
void PointSize(float s) { glPointSize(s); }


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

x86 assembly (clang, -O2):
<PointSize>:
jmp    1030 <glPointSize@plt>

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

LLVM IR (-O2):
define void @PointSize(float %0) {
%2 = tail call i32 @glPointSize(float %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, long);
void print(long x) { printf("%ld", x); }


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

x86 assembly (clang, -O2):
<print>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%ld\00"
define void @print(i64 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 %0)
ret void
}
/* Type definitions */
struct timeval {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
int time_diff(struct timeval *, struct timeval *);
int time_ago(struct timeval *tr) {
  struct timeval now;
  gettimeofday(&now, NULL);
  return time_diff(&now, tr);
}


x86 assembly (clang, -O0):
<time_ago>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
mov    -0x8(%rbp),%rsi
lea    -0x10(%rbp),%rdi
call   1040 <time_diff@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<time_ago>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    %rsp,%r14
mov    %r14,%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <time_diff@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.timeval = type { i32 }
define i32 @time_ago(%struct.timeval* %0) {
%2 = alloca %struct.timeval*
%3 = alloca %struct.timeval
store %struct.timeval* %0, %struct.timeval** %2
%4 = call i32 @gettimeofday(%struct.timeval* %3, i32* null)
%5 = load %struct.timeval*, %struct.timeval** %2
%6 = call i32 @time_diff(%struct.timeval* %3, %struct.timeval* %5)
ret i32 %6
}

LLVM IR (-O2):
%struct.timeval = type { i32 }
define i32 @time_ago(%struct.timeval* %0) {
%2 = alloca %struct.timeval
%3 = bitcast %struct.timeval* %2 to i8*
%4 = call i32 @gettimeofday(%struct.timeval* %2, i32* null)
%5 = call i32 @time_diff(%struct.timeval* %2, %struct.timeval* %0)
ret i32 %5
}
/* Variables and functions */
int yaffs_getxattr_reldir(int /*<<< orphan*/, char const *, char const *,
                          void *, int);
int yaffs_getxattr(const char *path, const char *name, void *data, int size) {
  return yaffs_getxattr_reldir((0), path, name, data, size);
}


x86 assembly (clang, -O0):
<yaffs_getxattr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x1c(%rbp),%r8d
xor    %edi,%edi
call   1030 <yaffs_getxattr_reldir@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<yaffs_getxattr>:
mov    %ecx,%r8d
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %rdi,%rsi
xor    %edi,%edi
jmp    1030 <yaffs_getxattr_reldir@plt>

LLVM IR (-O0):
define i32 @yaffs_getxattr(i8* %0, i8* %1, i8* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load i8*, i8** %5
%10 = load i8*, i8** %6
%11 = load i8*, i8** %7
%12 = load i32, i32* %8
%13 = call i32 @yaffs_getxattr_reldir(i32 0, i8* %9, i8* %10, i8* %11, i32 %12)
ret i32 %13
}

LLVM IR (-O2):
define i32 @yaffs_getxattr(i8* %0, i8* %1, i8* %2, i32 %3) {
%5 = tail call i32 @yaffs_getxattr_reldir(i32 0, i8* %0, i8* %1, i8* %2, i32 %3)
ret i32 %5
}
/* Variables and functions */
int hash(int);
int hash_with_scan(int key, int retry) { return ((hash(key) + retry) % 10); }


x86 assembly (clang, -O0):
<hash_with_scan>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <hash@plt>
add    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_with_scan>:
push   %rbx
mov    %esi,%ebx
call   1030 <hash@plt>
add    %ebx,%eax
cltq
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rcx
add    %edx,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @hash_with_scan(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 = call i32 @hash(i32 %5)
%7 = load i32, i32* %4
%8 = add nsw i32 %6, %7
%9 = srem i32 %8, 10
ret i32 %9
}

LLVM IR (-O2):
define i32 @hash_with_scan(i32 %0, i32 %1) {
%3 = tail call i32 @hash(i32 %0)
%4 = add nsw i32 %3, %1
%5 = srem i32 %4, 10
ret i32 %5
}