xunge/DecIR huggingface dataset:
double function(double distance) { return 1.0 / (distance + 1.0); }


x86 assembly (clang, -O0):
<function>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm1
addsd  -0x8(%rbp),%xmm1
movsd  0xee2(%rip),%xmm0
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<function>:
movsd  0xef8(%rip),%xmm1
addsd  %xmm1,%xmm0
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @function(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fadd double %3, 1.000000e+00
%5 = fdiv double 1.000000e+00, %4
ret double %5
}

LLVM IR (-O2):
define double @function(double %0) {
%2 = fadd double %0, 1.000000e+00
%3 = fdiv double 1.000000e+00, %2
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int main() {
  printf("This program is sponsored by the letter %c%c%c\n", '\'', 'P', '\'');
  printf("This program is sponsored by the letter 'P' \n");
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
mov    $0x27,%ecx
mov    $0x50,%edx
mov    %ecx,%esi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xef0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [48 x i8] c"This program is sponsored by the letter %c%c%c\0A\00"
@.str.1 = [46 x i8] c"This program is sponsored by the letter 'P' \0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), i32 39, i32 80, i32 39)
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [48 x i8] c"This program is sponsored by the letter %c%c%c\0A\00"
@str = [45 x i8] c"This program is sponsored by the letter 'P' \00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), i32 39, i32 80, i32 39)
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ type;
};
typedef TYPE_1__ XEnterWindowEvent;

/* Variables and functions */
int get_XEnterWindowEvent_type(void *_p) {
  return (int)((XEnterWindowEvent *)_p)->type;
}


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

x86 assembly (clang, -O2):
<get_XEnterWindowEvent_type>:
mov    (%rdi),%eax
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i32 @get_XEnterWindowEvent_type(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @get_XEnterWindowEvent_type(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
int dlclose(void *p) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @dlclose(i8* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ outplain(char *);
void outstat(char *tmp) {
  outplain("  =>  ");
  outplain(tmp);
  outplain("\n");
}


x86 assembly (clang, -O0):
<outstat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
call   1030 <outplain@plt>
mov    -0x8(%rbp),%rdi
call   1030 <outplain@plt>
lea    0xecf(%rip),%rdi
call   1030 <outplain@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<outstat>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
call   1030 <outplain@plt>
mov    %rbx,%rdi
call   1030 <outplain@plt>
lea    0xed8(%rip),%rdi
pop    %rbx
jmp    1030 <outplain@plt>

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

LLVM IR (-O2):
@.str = [7 x i8] c" => \00"
@.str.1 = [2 x i8] c"\0A\00"
define void @outstat(i8* %0) {
%2 = tail call i32 @outplain(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @outplain(i8* %0)
%4 = tail call i32 @outplain(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void swap(int *first_number, int *second_number) {
  int temp;
  if (*first_number > *second_number) {
    temp = *first_number;
    *first_number = *second_number;
    *first_number = temp;
  }
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
cmp    (%rcx),%eax
jle    113c <swap+0x3c>
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x14(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @swap(i32* nocapture %0, i32* nocapture %1) {
ret void
}
void imprimirListaCompleta() {}


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

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

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

LLVM IR (-O2):
define void @imprimirListaCompleta() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128;

/* Variables and functions */
int /*<<< orphan*/ _mm_cmpnge_ps(int /*<<< orphan*/, int /*<<< orphan*/);
__m128 test_mm_cmpnge_ps(__m128 __a, __m128 __b) {
  return _mm_cmpnge_ps(__a, __b);
}


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

x86 assembly (clang, -O2):
<test_mm_cmpnge_ps>:
jmp    1030 <_mm_cmpnge_ps@plt>

LLVM IR (-O0):
define i32 @test_mm_cmpnge_ps(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 @_mm_cmpnge_ps(i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @test_mm_cmpnge_ps(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_cmpnge_ps(i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int do_insmod(int, char **);
int main(int argc, char *argv[]) { return do_insmod(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 <do_insmod@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
jmp    1030 <do_insmod@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 @do_insmod(i32 %6, i8** %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @do_insmod(i32 %0, i8** %1)
ret i32 %3
}
int imax(const int a, const int b) { return (a > b) ? a : b; }


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

x86 assembly (clang, -O2):
<imax>:
mov    %esi,%eax
cmp    %esi,%edi
cmovg  %edi,%eax
ret

LLVM IR (-O0):
define i32 @imax(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 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @imax(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ dev_t;

/* Variables and functions */
int major(dev_t dev) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @major(i32 %0) {
ret i32 0
}
void _int_to_buffer_lendian(unsigned char *buf, unsigned int x) {
  buf[0] = x & 0xFF;
  buf[1] = (x >> 8) & 0xFF;
  buf[2] = (x >> 16) & 0xFF;
  buf[3] = (x >> 24) & 0xFF;
}


x86 assembly (clang, -O0):
<_int_to_buffer_lendian>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0xc(%rbp),%eax
shr    $0x8,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0xc(%rbp),%eax
shr    $0x10,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0xc(%rbp),%eax
shr    $0x18,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x3(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<_int_to_buffer_lendian>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
define void @_int_to_buffer_lendian(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = and i32 %5, 255
%7 = trunc i32 %6 to i8
%8 = load i8*, i8** %3
%9 = getelementptr inbounds i8, i8* %8, i64 0
store i8 %7, i8* %9
%10 = load i32, i32* %4
%11 = lshr i32 %10, 8
%12 = and i32 %11, 255
%13 = trunc i32 %12 to i8
%14 = load i8*, i8** %3
%15 = getelementptr inbounds i8, i8* %14, i64 1
store i8 %13, i8* %15
%16 = load i32, i32* %4
%17 = lshr i32 %16, 16
%18 = and i32 %17, 255
%19 = trunc i32 %18 to i8
%20 = load i8*, i8** %3
%21 = getelementptr inbounds i8, i8* %20, i64 2
store i8 %19, i8* %21
%22 = load i32, i32* %4
%23 = lshr i32 %22, 24
%24 = and i32 %23, 255
%25 = trunc i32 %24 to i8
%26 = load i8*, i8** %3
%27 = getelementptr inbounds i8, i8* %26, i64 3
store i8 %25, i8* %27
ret void
}

LLVM IR (-O2):
define void @_int_to_buffer_lendian(i8* nocapture writeonly %0, i32 %1) {
%3 = trunc i32 %1 to i8
store i8 %3, i8* %0
%4 = lshr i32 %1, 8
%5 = trunc i32 %4 to i8
%6 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %5, i8* %6
%7 = lshr i32 %1, 16
%8 = trunc i32 %7 to i8
%9 = getelementptr inbounds i8, i8* %0, i64 2
store i8 %8, i8* %9
%10 = lshr i32 %1, 24
%11 = trunc i32 %10 to i8
%12 = getelementptr inbounds i8, i8* %0, i64 3
store i8 %11, i8* %12
ret void
}
char int2Hex(unsigned i) {
  i &= 0xf;
  return (char)((i > 9) ? ((i - 10) + 'A') : (i + '0'));
}


x86 assembly (clang, -O0):
<int2Hex>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xf,%eax
mov    %eax,-0x4(%rbp)
cmpl   $0x9,-0x4(%rbp)
jbe    112b <int2Hex+0x2b>
mov    -0x4(%rbp),%eax
sub    $0xa,%eax
add    $0x41,%eax
mov    %eax,-0x8(%rbp)
jmp    1134 <int2Hex+0x34>
mov    -0x4(%rbp),%eax
add    $0x30,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<int2Hex>:
and    $0xf,%edi
lea    0x30(%rdi),%eax
lea    0x37(%rdi),%ecx
cmp    $0xa,%edi
movzbl %cl,%ecx
movzbl %al,%eax
cmovae %ecx,%eax
ret

LLVM IR (-O0):
define signext i8 @int2Hex(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 15
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = icmp ugt i32 %5, 9
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = load i32, i32* %2
%9 = sub i32 %8, 10
%10 = add i32 %9, 65
br label %14
11: ; preds = %1
%12 = load i32, i32* %2
%13 = add i32 %12, 48
br label %14
14: ; preds = %11, %7
%15 = phi i32 [ %10, %7 ], [ %13, %11 ]
%16 = trunc i32 %15 to i8
ret i8 %16
}

LLVM IR (-O2):
define signext i8 @int2Hex(i32 %0) {
%2 = and i32 %0, 15
%3 = icmp ugt i32 %2, 9
%4 = add nuw nsw i32 %2, 55
%5 = or i32 %2, 48
%6 = select i1 %3, i32 %4, i32 %5
%7 = trunc i32 %6 to i8
ret i8 %7
}
/* Variables and functions */
int /*<<< orphan*/ TEST(int, int);
int main(int argc, char **argv) {
  int a;
  TEST(0, 0);
  TEST(0, 1);
  TEST(1, 0);
  TEST(1, 1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %esi,%esi
mov    %esi,%edi
call   1030 <TEST@plt>
xor    %edi,%edi
mov    $0x1,%esi
call   1030 <TEST@plt>
mov    $0x1,%edi
xor    %esi,%esi
call   1030 <TEST@plt>
mov    $0x1,%esi
mov    %esi,%edi
call   1030 <TEST@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @TEST(i32 0, i32 0)
%4 = tail call i32 @TEST(i32 0, i32 1)
%5 = tail call i32 @TEST(i32 1, i32 0)
%6 = tail call i32 @TEST(i32 1, i32 1)
ret i32 0
}
int fa_bits_sideinfo_est(int chn_num) {
  int bits;
  bits = 64 / chn_num;
  return bits;
}


x86 assembly (clang, -O0):
<fa_bits_sideinfo_est>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x40,%eax
cltd
idivl  -0x4(%rbp)
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fa_bits_sideinfo_est>:
mov    $0x40,%eax
xor    %edx,%edx
idiv   %edi
ret

LLVM IR (-O0):
define i32 @fa_bits_sideinfo_est(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sdiv i32 64, %4
store i32 %5, i32* %3
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @fa_bits_sideinfo_est(i32 %0) {
%2 = sdiv i32 64, %0
ret i32 %2
}
float Sleef_tanf_u10(float x) { return __builtin_tanf(x); }


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

x86 assembly (clang, -O2):
<Sleef_tanf_u10>:
jmp    1030 <tanf@plt>

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

LLVM IR (-O2):
define float @Sleef_tanf_u10(float %0) {
%2 = tail call float @tanf(float %0)
ret float %2
}
/* Type definitions */
typedef int int16_t;

/* Variables and functions */
void ref_div_int16_t(int16_t arg1, int16_t arg2, int16_t *result) {
  *result = arg1 / arg2;
}


x86 assembly (clang, -O0):
<ref_div_int16_t>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<ref_div_int16_t>:
mov    %rdx,%rcx
mov    %edi,%eax
cltd
idiv   %esi
mov    %eax,(%rcx)
ret

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

LLVM IR (-O2):
define void @ref_div_int16_t(i32 %0, i32 %1, i32* nocapture writeonly %2) {
%4 = sdiv i32 %0, %1
store i32 %4, i32* %2
ret void
}
/* Variables and functions */
char *get_keyword(char *, char **);
int has_keyword(char *field) {
  char *ignored;
  return (get_keyword(field, &ignored) != ((char *)NULL));
}


x86 assembly (clang, -O0):
<has_keyword>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1030 <get_keyword@plt>
cmp    $0x0,%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<has_keyword>:
push   %rax
mov    %rsp,%rsi
call   1030 <get_keyword@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @has_keyword(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @get_keyword(i8* %4, i8** %3)
%6 = icmp ne i8* %5, null
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @has_keyword(i8* %0) {
%2 = alloca i8*
%3 = bitcast i8** %2 to i8*
%4 = call i8* @get_keyword(i8* %0, i8** %2)
%5 = icmp ne i8* %4, null
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
double acos_66(double);
double poly_acos(double x) { return acos_66(x); }


x86 assembly (clang, -O0):
<poly_acos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <acos_66@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<poly_acos>:
jmp    1030 <acos_66@plt>

LLVM IR (-O0):
define double @poly_acos(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @acos_66(double %3)
ret double %4
}

LLVM IR (-O2):
define double @poly_acos(double %0) {
%2 = tail call double @acos_66(double %0)
ret double %2
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ int16_t;

/* Variables and functions */
int /*<<< orphan*/ u16_to_le(int /*<<< orphan*/, int /*<<< orphan*/ *);
void i16_to_le(int16_t val, uint8_t *buf) { u16_to_le(val, buf); }


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

x86 assembly (clang, -O2):
<i16_to_le>:
jmp    1030 <u16_to_le@plt>

LLVM IR (-O0):
define void @i16_to_le(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 @u16_to_le(i32 %5, i32* %6)
ret void
}

LLVM IR (-O2):
define void @i16_to_le(i32 %0, i32* %1) {
%3 = tail call i32 @u16_to_le(i32 %0, i32* %1)
ret void
}
unsigned int cddb_sum(int n) {
  unsigned int ret;
  ret = 0;
  while (n > 0) {
    ret += (n % 10);
    n /= 10;
  }
  return ret;
}


x86 assembly (clang, -O0):
<cddb_sum>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    113c <cddb_sum+0x3c>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
add    -0x8(%rbp),%edx
mov    %edx,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
jmp    110e <cddb_sum+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cddb_sum>:
xor    %eax,%eax
test   %edi,%edi
jle    112d <cddb_sum+0x2d>
mov    $0xcccccccd,%r8d
nopl   0x0(%rax)
mov    %edi,%edx
imul   %r8,%rdx
shr    $0x23,%rdx
lea    (%rdx,%rdx,1),%esi
lea    (%rsi,%rsi,4),%esi
mov    %edi,%ecx
sub    %esi,%ecx
add    %ecx,%eax
cmp    $0x9,%edi
mov    %edx,%edi
ja     1110 <cddb_sum+0x10>
ret

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

LLVM IR (-O2):
define i32 @cddb_sum(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %10
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 0, %1 ]
%5 = phi i32 [ %8, %3 ], [ %0, %1 ]
%6 = urem i32 %5, 10
%7 = add i32 %4, %6
%8 = udiv i32 %5, 10
%9 = icmp ult i32 %5, 10
br i1 %9, label %10, label %3
10: ; preds = %3, %1
%11 = phi i32 [ 0, %1 ], [ %7, %3 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ f2(int /*<<< orphan*/);
void f3(void) { f2(0); }


x86 assembly (clang, -O0):
<f3>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <f2@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<f3>:
xor    %edi,%edi
jmp    1030 <f2@plt>

LLVM IR (-O0):
define void @f3() {
%1 = call i32 @f2(i32 0)
ret void
}

LLVM IR (-O2):
define void @f3() {
%1 = tail call i32 @f2(i32 0)
ret void
}
unsigned long long some_huge_uvalue() { return 1LL << 42; }


x86 assembly (clang, -O0):
<some_huge_uvalue>:
push   %rbp
mov    %rsp,%rbp
movabs $0x40000000000,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<some_huge_uvalue>:
movabs $0x40000000000,%rax
ret

LLVM IR (-O0):
define i64 @some_huge_uvalue() {
ret i64 4398046511104
}

LLVM IR (-O2):
define i64 @some_huge_uvalue() {
ret i64 4398046511104
}
/* Variables and functions */
int b(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @b() {
ret i32 0
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  int height;
};
struct TYPE_4__ {
  TYPE_1__ xresizerequest;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
void set_XEvent_xresizerequest_height(void *_p, int _v) {
  ((XEvent *)_p)->xresizerequest.height = (int)_v;
}


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

x86 assembly (clang, -O2):
<set_XEvent_xresizerequest_height>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i32 }
define void @set_XEvent_xresizerequest_height(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_4__*
%8 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %7, i32 0, i32 0
%9 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %8, i32 0, i32 0
store i32 %5, i32* %9
ret void
}

LLVM IR (-O2):
define void @set_XEvent_xresizerequest_height(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
/* Variables and functions */
int compared2(long const *, long const *);
int __gedf2(double a, double b) {
  return compared2(((const long *)&a), ((const long *)&b));
}


x86 assembly (clang, -O0):
<__gedf2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
lea    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1030 <compared2@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__gedf2>:
sub    $0x18,%rsp
movsd  %xmm0,0x10(%rsp)
movsd  %xmm1,0x8(%rsp)
lea    0x10(%rsp),%rdi
lea    0x8(%rsp),%rsi
call   1030 <compared2@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @__gedf2(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = bitcast double* %3 to i64*
%6 = bitcast double* %4 to i64*
%7 = call i32 @compared2(i64* %5, i64* %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @__gedf2(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = bitcast double* %3 to i64*
%6 = bitcast double* %4 to i64*
%7 = call i32 @compared2(i64* %5, i64* %6)
ret i32 %7
}
double fastScheduleAnnealing(double T, double alpha) { return T * alpha; }


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

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

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

LLVM IR (-O2):
define double @fastScheduleAnnealing(double %0, double %1) {
%3 = fmul double %0, %1
ret double %3
}
double sum5(double a, double b, double c, double d, double e) {
  return a + b + c + d + e;
}


x86 assembly (clang, -O0):
<sum5>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  %xmm4,-0x28(%rbp)
movsd  -0x8(%rbp),%xmm0
addsd  -0x10(%rbp),%xmm0
addsd  -0x18(%rbp),%xmm0
addsd  -0x20(%rbp),%xmm0
addsd  -0x28(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<sum5>:
addsd  %xmm1,%xmm0
addsd  %xmm2,%xmm0
addsd  %xmm3,%xmm0
addsd  %xmm4,%xmm0
ret

LLVM IR (-O0):
define double @sum5(double %0, double %1, double %2, double %3, double %4) {
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
store double %0, double* %6
store double %1, double* %7
store double %2, double* %8
store double %3, double* %9
store double %4, double* %10
%11 = load double, double* %6
%12 = load double, double* %7
%13 = fadd double %11, %12
%14 = load double, double* %8
%15 = fadd double %13, %14
%16 = load double, double* %9
%17 = fadd double %15, %16
%18 = load double, double* %10
%19 = fadd double %17, %18
ret double %19
}

LLVM IR (-O2):
define double @sum5(double %0, double %1, double %2, double %3, double %4) {
%6 = fadd double %0, %1
%7 = fadd double %6, %2
%8 = fadd double %7, %3
%9 = fadd double %8, %4
ret double %9
}
/* Type definitions */
struct queue {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ queue_lock_push(struct queue *);
void *queue_push_locked(struct queue *, void *);
int /*<<< orphan*/ queue_unlock_push(struct queue *);
void *queue_push(struct queue *q, void *elm) {
  void *ret;
  queue_lock_push(q);
  ret = queue_push_locked(q, elm);
  queue_unlock_push(q);
  return ret;
}


x86 assembly (clang, -O0):
<queue_push>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <queue_lock_push@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <queue_push_locked@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <queue_unlock_push@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<queue_push>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <queue_lock_push@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <queue_push_locked@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1050 <queue_unlock_push@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.queue = type { i32 }
define i8* @queue_push(%struct.queue* %0, i8* %1) {
%3 = alloca %struct.queue*
%4 = alloca i8*
%5 = alloca i8*
store %struct.queue* %0, %struct.queue** %3
store i8* %1, i8** %4
%6 = load %struct.queue*, %struct.queue** %3
%7 = call i32 @queue_lock_push(%struct.queue* %6)
%8 = load %struct.queue*, %struct.queue** %3
%9 = load i8*, i8** %4
%10 = call i8* @queue_push_locked(%struct.queue* %8, i8* %9)
store i8* %10, i8** %5
%11 = load %struct.queue*, %struct.queue** %3
%12 = call i32 @queue_unlock_push(%struct.queue* %11)
%13 = load i8*, i8** %5
ret i8* %13
}

LLVM IR (-O2):
%struct.queue = type { i32 }
define i8* @queue_push(%struct.queue* %0, i8* %1) {
%3 = tail call i32 @queue_lock_push(%struct.queue* %0)
%4 = tail call i8* @queue_push_locked(%struct.queue* %0, i8* %1)
%5 = tail call i32 @queue_unlock_push(%struct.queue* %0)
ret i8* %4
}
void Ctypes_hook_wr_sgn_u32(void) {}


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

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

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

LLVM IR (-O2):
define void @Ctypes_hook_wr_sgn_u32() {
ret void
}
void call_main(void (*func)(void)) {
  extern long __initial_sp;
  asm volatile("movq %0, %%rsp;"
               "jmpq *%1;"
               :
               : "r"(__initial_sp), "r"(func)
               : "memory");
}


x86 assembly (clang, -O0):
<call_main>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    0x2ed1(%rip),%rax
mov    (%rax),%rax
mov    -0x8(%rbp),%rcx
mov    %rax,%rsp
jmp    *%rcx
pop    %rbp
ret

x86 assembly (clang, -O2):
<call_main>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%rax
mov    %rax,%rsp
jmp    *%rdi
ret

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

LLVM IR (-O2):
@__initial_sp = external global i64
define void @call_main(void ()* %0) {
%2 = load i64, i64* @__initial_sp
tail call void asm sideeffect "movq $0, %rsp;jmpq *$1;", "r,r,~{memory},~{dirflag},~{fpsr},~{flags}"(i64 %2, void ()* %0)
ret void
}
int do_309() { return 309; }


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

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

LLVM IR (-O0):
define i32 @do_309() {
ret i32 309
}

LLVM IR (-O2):
define i32 @do_309() {
ret i32 309
}
int f(int x) {
  if (x) {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     111d <f+0x1d>
movl   $0x1,-0x4(%rbp)
jmp    1124 <f+0x24>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
xor    %eax,%eax
test   %edi,%edi
setne  %al
ret

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

LLVM IR (-O2):
define i32 @f(i32 %0) {
%2 = icmp ne i32 %0, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ pr_info(char *, int);
int sci_get_chip_id();
int soc_id_is_sc9820v0(void) {
  pr_info("chip id is %x\n", sci_get_chip_id());
  return ((sci_get_chip_id() & (0xFFFF0000)) == ((0x96320000) & (0xFFFF0000)));
}


x86 assembly (clang, -O0):
<soc_id_is_sc9820v0>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <sci_get_chip_id@plt>
mov    %eax,%esi
lea    0xecc(%rip),%rdi
call   1030 <pr_info@plt>
mov    $0x0,%al
call   1040 <sci_get_chip_id@plt>
and    $0xffff0000,%eax
cmp    $0x96320000,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<soc_id_is_sc9820v0>:
push   %rax
xor    %eax,%eax
call   1040 <sci_get_chip_id@plt>
lea    0xed1(%rip),%rdi
mov    %eax,%esi
call   1030 <pr_info@plt>
xor    %eax,%eax
call   1040 <sci_get_chip_id@plt>
and    $0xffff0000,%eax
xor    %ecx,%ecx
cmp    $0x96320000,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"chip id is %x\0A\00"
define i32 @soc_id_is_sc9820v0() {
%1 = call i32 (...) @sci_get_chip_id()
%2 = call i32 @pr_info(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = call i32 (...) @sci_get_chip_id()
%4 = and i32 %3, -65536
%5 = icmp eq i32 %4, -1775108096
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
@.str = [15 x i8] c"chip id is %x\0A\00"
define i32 @soc_id_is_sc9820v0() {
%1 = tail call i32 (...) @sci_get_chip_id()
%2 = tail call i32 @pr_info(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 (...) @sci_get_chip_id()
%4 = and i32 %3, -65536
%5 = icmp eq i32 %4, -1775108096
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int _pb_print_bits(unsigned int *, int);
int _pb_print_bits_ui(unsigned int value) {
  return _pb_print_bits(&value, sizeof(unsigned int));
}


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

x86 assembly (clang, -O2):
<_pb_print_bits_ui>:
push   %rax
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rdi
mov    $0x4,%esi
call   1030 <_pb_print_bits@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @_pb_print_bits_ui(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @_pb_print_bits(i32* %2, i32 4)
ret i32 %3
}
/* Variables and functions */
int func();
int main(int argc, char **argv) { return func() == 42 ? 0 : 1; }


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    $0x0,%al
call   1030 <func@plt>
mov    %eax,%edx
mov    $0x1,%eax
xor    %ecx,%ecx
cmp    $0x2a,%edx
cmove  %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <func@plt>
xor    %ecx,%ecx
cmp    $0x2a,%eax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

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 = call i32 (...) @func()
%7 = icmp eq i32 %6, 42
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 0, i32 1
ret i32 %9
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @func()
%4 = icmp ne i32 %3, 42
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ SA1Immediate16(int);
int /*<<< orphan*/ SBC16(int /*<<< orphan*/);
void OpE9M0(void) { SBC16(SA1Immediate16(1)); }


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

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

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

LLVM IR (-O2):
define void @OpE9M0() {
%1 = tail call i32 @SA1Immediate16(i32 1)
%2 = tail call i32 @SBC16(i32 %1)
ret void
}
int cairo_code_draw_envChannelLabel_get_width() { return 7; }


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

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

LLVM IR (-O0):
define i32 @cairo_code_draw_envChannelLabel_get_width() {
ret i32 7
}

LLVM IR (-O2):
define i32 @cairo_code_draw_envChannelLabel_get_width() {
ret i32 7
}
void I420Ssim() {}


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

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

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

LLVM IR (-O2):
define void @I420Ssim() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ actionJeux(int, int);
int afficherJeux(int);
int choixMenu(int, int);
void jeux(int modeDeJeux) {
  int nbJeux, choix;
  nbJeux = afficherJeux(modeDeJeux);
  choix = choixMenu(1, nbJeux);
  actionJeux(choix, modeDeJeux);
}


x86 assembly (clang, -O0):
<jeux>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1050 <afficherJeux@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
mov    $0x1,%edi
call   1030 <choixMenu@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x4(%rbp),%esi
call   1040 <actionJeux@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<jeux>:
push   %rbx
mov    %edi,%ebx
call   1050 <afficherJeux@plt>
mov    $0x1,%edi
mov    %eax,%esi
call   1030 <choixMenu@plt>
mov    %eax,%edi
mov    %ebx,%esi
pop    %rbx
jmp    1040 <actionJeux@plt>

LLVM IR (-O0):
define void @jeux(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = call i32 @afficherJeux(i32 %5)
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = call i32 @choixMenu(i32 1, i32 %7)
store i32 %8, i32* %4
%9 = load i32, i32* %4
%10 = load i32, i32* %2
%11 = call i32 @actionJeux(i32 %9, i32 %10)
ret void
}

LLVM IR (-O2):
define void @jeux(i32 %0) {
%2 = tail call i32 @afficherJeux(i32 %0)
%3 = tail call i32 @choixMenu(i32 1, i32 %2)
%4 = tail call i32 @actionJeux(i32 %3, i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ three1(int, int, int);
int /*<<< orphan*/ three2(int, int, int);
int /*<<< orphan*/ three3(int, int, int);
int /*<<< orphan*/ three4(int, int, int);
int /*<<< orphan*/ three5(int, int, int);
main() {
  three1(1, 2, 3);
  three2(1, 2, 3);
  three3(1, 2, 3);
  three4(1, 2, 3);
  three5(1, 2, 3);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x3,%edx
call   1060 <three1@plt>
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x3,%edx
call   1040 <three2@plt>
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x3,%edx
call   1050 <three3@plt>
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x3,%edx
call   1030 <three4@plt>
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x3,%edx
call   1070 <three5@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x3,%edx
call   1060 <three1@plt>
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x3,%edx
call   1040 <three2@plt>
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x3,%edx
call   1050 <three3@plt>
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x3,%edx
call   1030 <three4@plt>
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x3,%edx
call   1070 <three5@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 @three1(i32 1, i32 2, i32 3)
%2 = call i32 @three2(i32 1, i32 2, i32 3)
%3 = call i32 @three3(i32 1, i32 2, i32 3)
%4 = call i32 @three4(i32 1, i32 2, i32 3)
%5 = call i32 @three5(i32 1, i32 2, i32 3)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @three1(i32 1, i32 2, i32 3)
%2 = tail call i32 @three2(i32 1, i32 2, i32 3)
%3 = tail call i32 @three3(i32 1, i32 2, i32 3)
%4 = tail call i32 @three4(i32 1, i32 2, i32 3)
%5 = tail call i32 @three5(i32 1, i32 2, i32 3)
ret i32 0
}
/* Type definitions */
struct test {
  int dummy;
};

/* Variables and functions */
int priv_cred_setup(int asroot, int injail, struct test *test) { return (0); }


x86 assembly (clang, -O0):
<priv_cred_setup>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.test = type { i32 }
define i32 @priv_cred_setup(i32 %0, i32 %1, %struct.test* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca %struct.test*
store i32 %0, i32* %4
store i32 %1, i32* %5
store %struct.test* %2, %struct.test** %6
ret i32 0
}

LLVM IR (-O2):
%struct.test = type { i32 }
define i32 @priv_cred_setup(i32 %0, i32 %1, %struct.test* nocapture readnone %2) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ ReadWord(char *, int /*<<< orphan*/ *);
int SearchVocab(char *);
scalar_t__ feof(int /*<<< orphan*/ *);
int ReadAndStoreWordIndex(FILE *fin, char *word) {
  ReadWord(word, fin);
  if (feof(fin))
    return -1;
  return SearchVocab(word);
}


x86 assembly (clang, -O0):
<ReadAndStoreWordIndex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <ReadWord@plt>
mov    -0x10(%rbp),%rdi
call   1030 <feof@plt>
cmp    $0x0,%rax
je     116c <ReadAndStoreWordIndex+0x3c>
movl   $0xffffffff,-0x4(%rbp)
jmp    1178 <ReadAndStoreWordIndex+0x48>
mov    -0x18(%rbp),%rdi
call   1050 <SearchVocab@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ReadAndStoreWordIndex>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    %rsi,%rdi
mov    %rbx,%rsi
call   1040 <ReadWord@plt>
mov    %rbx,%rdi
call   1030 <feof@plt>
test   %rax,%rax
je     115f <ReadAndStoreWordIndex+0x2f>
mov    $0xffffffff,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1050 <SearchVocab@plt>

LLVM IR (-O0):
define i32 @ReadAndStoreWordIndex(i32* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i8*
store i32* %0, i32** %4
store i8* %1, i8** %5
%6 = load i8*, i8** %5
%7 = load i32*, i32** %4
%8 = call i32 @ReadWord(i8* %6, i32* %7)
%9 = load i32*, i32** %4
%10 = call i64 @feof(i32* %9)
%11 = icmp ne i64 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %2
store i32 -1, i32* %3
br label %16
13: ; preds = %2
%14 = load i8*, i8** %5
%15 = call i32 @SearchVocab(i8* %14)
store i32 %15, i32* %3
br label %16
16: ; preds = %13, %12
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
define i32 @ReadAndStoreWordIndex(i32* %0, i8* %1) {
%3 = tail call i32 @ReadWord(i8* %1, i32* %0)
%4 = tail call i64 @feof(i32* %0)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 @SearchVocab(i8* %1)
br label %8
8: ; preds = %2, %6
%9 = phi i32 [ %7, %6 ], [ -1, %2 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void call(void (*f)(int), int a) {
  printf("Doing stuff\n");
  printf("\ta   : %d\n", a);
  printf("Going to call back\n");
  f(a * 2);
}


x86 assembly (clang, -O0):
<call>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    0xeda(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%esi
lea    0xed6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%edi
shl    $0x1,%edi
call   *%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<call>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
lea    0xedb(%rip),%rdi
call   1030 <puts@plt>
lea    0xec4(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xecb(%rip),%rdi
call   1030 <puts@plt>
add    %ebx,%ebx
mov    %ebx,%edi
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    *%rax

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

LLVM IR (-O2):
@.str.1 = [11 x i8] c"\09a : %d\0A\00"
@str = [12 x i8] c"Doing stuff\00"
@str.3 = [19 x i8] c"Going to call back\00"
define void @call(void (i32)* nocapture %0, i32 %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 %1)
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str.3, i64 0, i64 0))
%6 = shl nsw i32 %1, 1
tail call void %0(i32 %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
void perror_exit(char *m) {
  perror(m);
  exit(1);
}


x86 assembly (clang, -O0):
<perror_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
define void @perror_exit(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @perror(i8* %3)
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @perror_exit(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int, int, int);
const char *cJSON_Version(void) {
  static char version[15];
  sprintf(version, "%i.%i.%i", 1, 7, 15);
  return version;
}


x86 assembly (clang, -O0):
<cJSON_Version>:
push   %rbp
mov    %rsp,%rbp
lea    0x2f0e(%rip),%rdi
lea    0xede(%rip),%rsi
mov    $0x1,%edx
mov    $0x7,%ecx
mov    $0xf,%r8d
call   1030 <sprintf@plt>
lea    0x2eeb(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cJSON_Version>:
push   %rbx
lea    0x2f11(%rip),%rbx
lea    0xee1(%rip),%rsi
mov    %rbx,%rdi
mov    $0x1,%edx
mov    $0x7,%ecx
mov    $0xf,%r8d
call   1030 <sprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@cJSON_Version.version = internal global [15 x i8] zeroinitializer
@.str = [9 x i8] c"%i.%i.%i\00"
define i8* @cJSON_Version() {
%1 = call i32 @sprintf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @cJSON_Version.version, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 1, i32 7, i32 15)
ret i8* getelementptr inbounds ([15 x i8], [15 x i8]* @cJSON_Version.version, i64 0, i64 0)
}

LLVM IR (-O2):
@cJSON_Version.version = internal global [15 x i8] zeroinitializer
@.str = [9 x i8] c"%i.%i.%i\00"
define i8* @cJSON_Version() {
%1 = tail call i32 @sprintf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @cJSON_Version.version, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 1, i32 7, i32 15)
ret i8* getelementptr inbounds ([15 x i8], [15 x i8]* @cJSON_Version.version, i64 0, i64 0)
}