xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
char *strstr(char *, char *);
void strstr_repeated() {
  char *string = "TestTest";
  Assert_real((strstr(string, "Test") == string),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/string/strstr.c",
              35, ("String should be found at first occurrence"));
}


x86 assembly (clang, -O0):
<strstr_repeated>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec6(%rip),%rsi
call   1040 <strstr@plt>
cmp    -0x8(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xeb3(%rip),%rsi
mov    $0x23,%edx
lea    0xf4a(%rip),%rcx
call   1030 <Assert_real@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strstr_repeated>:
lea    0xee9(%rip),%rsi
lea    0xf85(%rip),%rcx
mov    $0x1,%edi
mov    $0x23,%edx
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"TestTest\00"
@.str.1 = [5 x i8] c"Test\00"
@.str.2 = [163 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/string/strstr.c\00"
@.str.3 = [43 x i8] c"String should be found at first occurrence\00"
define void @strstr_repeated() {
%1 = alloca i8*
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8** %1
%2 = load i8*, i8** %1
%3 = call i8* @strstr(i8* %2, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%4 = load i8*, i8** %1
%5 = icmp eq i8* %3, %4
%6 = zext i1 %5 to i32
%7 = call i32 @Assert_real(i32 %6, i8* getelementptr inbounds ([163 x i8], [163 x i8]* @.str.2, i64 0, i64 0), i32 35, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str.2 = [163 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/string/strstr.c\00"
@.str.3 = [43 x i8] c"String should be found at first occurrence\00"
define void @strstr_repeated() {
%1 = tail call i32 @Assert_real(i32 1, i8* getelementptr inbounds ([163 x i8], [163 x i8]* @.str.2, i64 0, i64 0), i32 35, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.3, i64 0, i64 0))
ret void
}
int SC68toupper(int c) { return (c < 'a' || c > 'z') ? c : (c - 'a' + 'A'); }


x86 assembly (clang, -O0):
<SC68toupper>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x61,-0x4(%rbp)
jl     111b <SC68toupper+0x1b>
cmpl   $0x7a,-0x4(%rbp)
jle    1126 <SC68toupper+0x26>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1132 <SC68toupper+0x32>
mov    -0x4(%rbp),%eax
sub    $0x61,%eax
add    $0x41,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SC68toupper>:
lea    -0x7b(%rdi),%ecx
lea    -0x20(%rdi),%eax
cmp    $0xffffffe6,%ecx
cmovb  %edi,%eax
ret

LLVM IR (-O0):
define i32 @SC68toupper(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 %3, 97
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sgt i32 %6, 122
br i1 %7, label %8, label %10
8: ; preds = %5, %1
%9 = load i32, i32* %2
br label %14
10: ; preds = %5
%11 = load i32, i32* %2
%12 = sub nsw i32 %11, 97
%13 = add nsw i32 %12, 65
br label %14
14: ; preds = %10, %8
%15 = phi i32 [ %9, %8 ], [ %13, %10 ]
ret i32 %15
}

LLVM IR (-O2):
define i32 @SC68toupper(i32 %0) {
%2 = add i32 %0, -123
%3 = icmp ult i32 %2, -26
%4 = add nsw i32 %0, -32
%5 = select i1 %3, i32 %0, i32 %4
ret i32 %5
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_1__;

/* Type definitions */
struct TYPE_4__ {
  int /*<<< orphan*/ fts_name;
};
typedef TYPE_1__ FTSENT;

/* Variables and functions */
int strcmp(int /*<<< orphan*/, int /*<<< orphan*/);
int ftsent_compare(const FTSENT **a, const FTSENT **b) {
  return strcmp((*a)->fts_name, (*b)->fts_name);
}


x86 assembly (clang, -O0):
<ftsent_compare>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%esi
call   1030 <strcmp@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ftsent_compare>:
mov    (%rdi),%rax
mov    (%rax),%edi
mov    (%rsi),%rax
mov    (%rax),%esi
jmp    1030 <strcmp@plt>

LLVM IR (-O0):
%struct.TYPE_4__ = type { i32 }
define i32 @ftsent_compare(%struct.TYPE_4__** %0, %struct.TYPE_4__** %1) {
%3 = alloca %struct.TYPE_4__**
%4 = alloca %struct.TYPE_4__**
store %struct.TYPE_4__** %0, %struct.TYPE_4__*** %3
store %struct.TYPE_4__** %1, %struct.TYPE_4__*** %4
%5 = load %struct.TYPE_4__**, %struct.TYPE_4__*** %3
%6 = load %struct.TYPE_4__*, %struct.TYPE_4__** %5
%7 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %6, i32 0, i32 0
%8 = load i32, i32* %7
%9 = load %struct.TYPE_4__**, %struct.TYPE_4__*** %4
%10 = load %struct.TYPE_4__*, %struct.TYPE_4__** %9
%11 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %10, i32 0, i32 0
%12 = load i32, i32* %11
%13 = call i32 @strcmp(i32 %8, i32 %12)
ret i32 %13
}

LLVM IR (-O2):
%struct.TYPE_4__ = type { i32 }
define i32 @ftsent_compare(%struct.TYPE_4__** nocapture %0, %struct.TYPE_4__** nocapture %1) {
%3 = load %struct.TYPE_4__*, %struct.TYPE_4__** %0
%4 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %3, i64 0, i32 0
%5 = load i32, i32* %4
%6 = load %struct.TYPE_4__*, %struct.TYPE_4__** %1
%7 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %6, i64 0, i32 0
%8 = load i32, i32* %7
%9 = tail call i32 @strcmp(i32 %5, i32 %8)
ret i32 %9
}
float radToDegree(float rad) { return (int)((rad * 180) / 3.141593f); }


x86 assembly (clang, -O0):
<radToDegree>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  0xef3(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
movss  0xee2(%rip),%xmm1
divss  %xmm1,%xmm0
cvttss2si %xmm0,%eax
cvtsi2ss %eax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<radToDegree>:
mulss  0xef8(%rip),%xmm0
divss  0xef4(%rip),%xmm0
cvttps2dq %xmm0,%xmm0
cvtdq2ps %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @radToDegree(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fmul float %3, 1.800000e+02
%5 = fdiv float %4, 0x400921FB80000000
%6 = fptosi float %5 to i32
%7 = sitofp i32 %6 to float
ret float %7
}

LLVM IR (-O2):
define float @radToDegree(float %0) {
%2 = fmul float %0, 1.800000e+02
%3 = fdiv float %2, 0x400921FB80000000
%4 = fptosi float %3 to i32
%5 = sitofp i32 %4 to float
ret float %5
}
/* Variables and functions */
int julian_get_year_number(double);
double julian_increment_year(double current) {
  int year_number;
  year_number = julian_get_year_number(current);
  while (year_number == julian_get_year_number(current))
    current++;
  return current;
}


x86 assembly (clang, -O0):
<julian_increment_year>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <julian_get_year_number@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <julian_get_year_number@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
cmp    %ecx,%eax
jne    115e <julian_increment_year+0x4e>
movsd  0xeb1(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    112a <julian_increment_year+0x1a>
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<julian_increment_year>:
push   %rbx
sub    $0x10,%rsp
movsd  %xmm0,0x8(%rsp)
call   1030 <julian_get_year_number@plt>
mov    %eax,%ebx
movsd  0x8(%rsp),%xmm0
call   1030 <julian_get_year_number@plt>
cmp    %eax,%ebx
jne    1165 <julian_increment_year+0x55>
movsd  0x8(%rsp),%xmm0
nopw   0x0(%rax,%rax,1)
addsd  0xeb8(%rip),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0x8(%rsp),%xmm0
call   1030 <julian_get_year_number@plt>
movsd  0x8(%rsp),%xmm0
cmp    %eax,%ebx
je     1140 <julian_increment_year+0x30>
jmp    116b <julian_increment_year+0x5b>
movsd  0x8(%rsp),%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define double @julian_increment_year(double %0) {
%2 = alloca double
%3 = alloca i32
store double %0, double* %2
%4 = load double, double* %2
%5 = call i32 @julian_get_year_number(double %4)
store i32 %5, i32* %3
br label %6
6: ; preds = %11, %1
%7 = load i32, i32* %3
%8 = load double, double* %2
%9 = call i32 @julian_get_year_number(double %8)
%10 = icmp eq i32 %7, %9
br i1 %10, label %11, label %14
11: ; preds = %6
%12 = load double, double* %2
%13 = fadd double %12, 1.000000e+00
store double %13, double* %2
br label %6
14: ; preds = %6
%15 = load double, double* %2
ret double %15
}

LLVM IR (-O2):
define double @julian_increment_year(double %0) {
%2 = tail call i32 @julian_get_year_number(double %0)
%3 = tail call i32 @julian_get_year_number(double %0)
%4 = icmp eq i32 %2, %3
br i1 %4, label %5, label %10
5: ; preds = %1, %5
%6 = phi double [ %7, %5 ], [ %0, %1 ]
%7 = fadd double %6, 1.000000e+00
%8 = tail call i32 @julian_get_year_number(double %7)
%9 = icmp eq i32 %2, %8
br i1 %9, label %5, label %10
10: ; preds = %5, %1
%11 = phi double [ %0, %1 ], [ %7, %5 ]
ret double %11
}
/* Variables and functions */
int invert(int, int, int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("invert(5, 1, 1) -> %u\n", invert(5, 1, 1));
  printf("invert(5, 4, 1) -> %u\n", invert(5, 4, 1));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x5,%edi
mov    $0x1,%edx
mov    %edx,%esi
call   1030 <invert@plt>
mov    %eax,%esi
lea    0xec2(%rip),%rdi
call   1040 <printf@plt>
mov    $0x5,%edi
mov    $0x4,%esi
mov    $0x1,%edx
call   1030 <invert@plt>
mov    %eax,%esi
lea    0xeb7(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x5,%edi
mov    $0x1,%esi
mov    $0x1,%edx
call   1030 <invert@plt>
lea    0xec4(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    $0x5,%edi
mov    $0x4,%esi
mov    $0x1,%edx
call   1030 <invert@plt>
lea    0xeb9(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"invert(5, 1, 1) -> %u\0A\00"
@.str.1 = [23 x i8] c"invert(5, 4, 1) -> %u\0A\00"
define i32 @main() {
%1 = call i32 @invert(i32 5, i32 1, i32 1)
%2 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = call i32 @invert(i32 5, i32 4, i32 1)
%4 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i32 %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [23 x i8] c"invert(5, 1, 1) -> %u\0A\00"
@.str.1 = [23 x i8] c"invert(5, 4, 1) -> %u\0A\00"
define i32 @main() {
%1 = tail call i32 @invert(i32 5, i32 1, i32 1)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @invert(i32 5, i32 4, i32 1)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i32 %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("coucou %d\n", 3);
  return 3;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x3,%esi
call   1030 <printf@plt>
mov    $0x3,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [11 x i8] c"coucou %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 3)
ret i32 3
}
void wo5_node_close() {}


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

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

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

LLVM IR (-O2):
define void @wo5_node_close() {
ret void
}
TR_CLASSVARS_DECL(TR_LoggerSyslog) {}


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

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

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

LLVM IR (-O2):
define i32 @TR_CLASSVARS_DECL(i32 %0) {
ret i32 undef
}
/* Variables and functions */
int INT_MIN;
int test3(int x) { return ~(x - INT_MIN); }


x86 assembly (clang, -O0):
<test3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    0x2ed7(%rip),%rcx
sub    (%rcx),%eax
xor    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test3>:
mov    %edi,%eax
mov    0x2edf(%rip),%rcx
not    %eax
add    (%rcx),%eax
ret

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

LLVM IR (-O2):
@INT_MIN = global i32 0
define i32 @test3(i32 %0) {
%2 = load i32, i32* @INT_MIN
%3 = xor i32 %0, -1
%4 = add i32 %2, %3
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void fn_AA(void) { printf("A=>A\n"); }


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

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

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

LLVM IR (-O2):
@str = [5 x i8] c"A=>A\00"
define void @fn_AA() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
float __nv_fadd_ru(float, float);
float __fadd_ru(float __a, float __b) { return __nv_fadd_ru(__a, __b); }


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

x86 assembly (clang, -O2):
<__fadd_ru>:
jmp    1030 <__nv_fadd_ru@plt>

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

LLVM IR (-O2):
define float @__fadd_ru(float %0, float %1) {
%3 = tail call float @__nv_fadd_ru(float %0, float %1)
ret float %3
}
void pcx_startup_init(void) {}


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

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

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

LLVM IR (-O2):
define void @pcx_startup_init() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(int /*<<< orphan*/ *);
int main() {
  puts(NULL);
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @puts(i32* null)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @puts(i32* dereferenceable(1) null)
ret i32 0
}
void _write_cr4(unsigned long _cr4) {
  asm volatile("mov %0,%%cr4" : : "r"(_cr4));
}


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

x86 assembly (clang, -O2):
<_write_cr4>:
mov    %rdi,%cr4
ret

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

LLVM IR (-O2):
define void @_write_cr4(i64 %0) {
tail call void asm sideeffect "mov $0,%cr4", "r,~{dirflag},~{fpsr},~{flags}"(i64 %0)
ret void
}
int absolute(int value) { return value < 0 ? (-1) * value : value; }


x86 assembly (clang, -O0):
<absolute>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    1120 <absolute+0x20>
imul   $0xffffffff,-0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <absolute+0x26>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @absolute(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = mul nsw i32 -1, %6
br label %10
8: ; preds = %1
%9 = load i32, i32* %2
br label %10
10: ; preds = %8, %5
%11 = phi i32 [ %7, %5 ], [ %9, %8 ]
ret i32 %11
}

LLVM IR (-O2):
define i32 @absolute(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ puts(char const *);
void speak(const char *str) { puts(str); }


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

x86 assembly (clang, -O2):
<speak>:
jmp    1030 <puts@plt>

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

LLVM IR (-O2):
define void @speak(i8* nocapture %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) %0)
ret void
}
/* Variables and functions */
double floor(double);
int checkInteger(double d) {
  if (floor(d) == d)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<checkInteger>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1030 <floor@plt>
ucomisd -0x10(%rbp),%xmm0
jne    1144 <checkInteger+0x34>
jp     1144 <checkInteger+0x34>
movl   $0x1,-0x4(%rbp)
jmp    114b <checkInteger+0x3b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkInteger>:
push   %rax
movsd  %xmm0,(%rsp)
call   1030 <floor@plt>
cmpeqsd (%rsp),%xmm0
movq   %xmm0,%rax
and    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @checkInteger(double %0) {
%2 = alloca i32
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = call double @llvm.floor.f64(double %4)
%6 = load double, double* %3
%7 = fcmp oeq double %5, %6
br i1 %7, label %8, label %9
8: ; preds = %1
store i32 1, i32* %2
br label %10
9: ; preds = %1
store i32 0, i32* %2
br label %10
10: ; preds = %9, %8
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
define i32 @checkInteger(double %0) {
%2 = tail call double @llvm.floor.f64(double %0)
%3 = fcmp oeq double %2, %0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ partition(int *, int /*<<< orphan*/, int);
int merge_sort(int *arr, int size) { partition(arr, 0, size - 1); }


x86 assembly (clang, -O0):
<merge_sort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%edx
sub    $0x1,%edx
xor    %esi,%esi
call   1030 <partition@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<merge_sort>:
lea    -0x1(%rsi),%edx
xor    %esi,%esi
jmp    1030 <partition@plt>

LLVM IR (-O0):
define i32 @merge_sort(i32* %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
%6 = load i32*, i32** %4
%7 = load i32, i32* %5
%8 = sub nsw i32 %7, 1
%9 = call i32 @partition(i32* %6, i32 0, i32 %8)
%10 = load i32, i32* %3
ret i32 %10
}

LLVM IR (-O2):
define i32 @merge_sort(i32* %0, i32 %1) {
%3 = add nsw i32 %1, -1
%4 = tail call i32 @partition(i32* %0, i32 0, i32 %3)
ret i32 undef
}
/* Variables and functions */
int posix_memalign(void **, int, size_t);
void *(tlsfGetMem)(size_t bytes) {
  int error;
  void *ptr;
  size_t size;
  size = (bytes + (4096 - 1)) & ~(4096 - 1);
  error = posix_memalign(&ptr, 4096, size);
  if (error) {
    return NULL;
  }
  return ptr;
}


x86 assembly (clang, -O0):
<tlsfGetMem>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0xfff,%rax
and    $0xfffffffffffff000,%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdx
lea    -0x20(%rbp),%rdi
mov    $0x1000,%esi
call   1030 <posix_memalign@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     115c <tlsfGetMem+0x4c>
movq   $0x0,-0x8(%rbp)
jmp    1164 <tlsfGetMem+0x54>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tlsfGetMem>:
push   %rax
lea    0xfff(%rdi),%rdx
and    $0xfffffffffffff000,%rdx
mov    %rsp,%rdi
mov    $0x1000,%esi
call   1030 <posix_memalign@plt>
test   %eax,%eax
jne    1136 <tlsfGetMem+0x26>
mov    (%rsp),%rax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i8* @tlsfGetMem(i64 %0) {
%2 = alloca i8*
%3 = bitcast i8** %2 to i8*
%4 = add i64 %0, 4095
%5 = and i64 %4, -4096
%6 = call i32 @posix_memalign(i8** %2, i32 4096, i64 %5)
%7 = icmp eq i32 %6, 0
%8 = load i8*, i8** %2
%9 = select i1 %7, i8* %8, i8* null
ret i8* %9
}
/* Variables and functions */
int /*<<< orphan*/ testfp1(double, double);
int /*<<< orphan*/ testfp2(double, double, double);
int /*<<< orphan*/ testfp3(double, double, double);
int /*<<< orphan*/ testfp4(double, double, double);
void main(void) {
  testfp1(1.2, 0.4);
  testfp2(0.1, 0.2, 0.3);
  testfp3(0.1, 0.2, 0.3);
  testfp4(0.1, 0.2, 0.3);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movsd  0xecc(%rip),%xmm0
movsd  0xecc(%rip),%xmm1
call   1040 <testfp1@plt>
movsd  0xe9f(%rip),%xmm0
movsd  0xe9f(%rip),%xmm1
movsd  0xe9f(%rip),%xmm2
call   1050 <testfp2@plt>
movsd  0xe82(%rip),%xmm0
movsd  0xe82(%rip),%xmm1
movsd  0xe82(%rip),%xmm2
call   1030 <testfp3@plt>
movsd  0xe65(%rip),%xmm0
movsd  0xe65(%rip),%xmm1
movsd  0xe65(%rip),%xmm2
call   1060 <testfp4@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movsd  0xeb7(%rip),%xmm0
movsd  0xeb7(%rip),%xmm1
call   1040 <testfp1@plt>
movsd  0xeb2(%rip),%xmm0
movsd  0xeb2(%rip),%xmm1
movsd  0xeb2(%rip),%xmm2
call   1050 <testfp2@plt>
movsd  0xe95(%rip),%xmm0
movsd  0xe95(%rip),%xmm1
movsd  0xe95(%rip),%xmm2
call   1030 <testfp3@plt>
movsd  0xe78(%rip),%xmm0
movsd  0xe78(%rip),%xmm1
movsd  0xe78(%rip),%xmm2
pop    %rax
jmp    1060 <testfp4@plt>

LLVM IR (-O0):
define void @main() {
%1 = call i32 @testfp1(double 1.200000e+00, double 4.000000e-01)
%2 = call i32 @testfp2(double 1.000000e-01, double 2.000000e-01, double 3.000000e-01)
%3 = call i32 @testfp3(double 1.000000e-01, double 2.000000e-01, double 3.000000e-01)
%4 = call i32 @testfp4(double 1.000000e-01, double 2.000000e-01, double 3.000000e-01)
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 @testfp1(double 1.200000e+00, double 4.000000e-01)
%2 = tail call i32 @testfp2(double 1.000000e-01, double 2.000000e-01, double 3.000000e-01)
%3 = tail call i32 @testfp3(double 1.000000e-01, double 2.000000e-01, double 3.000000e-01)
%4 = tail call i32 @testfp4(double 1.000000e-01, double 2.000000e-01, double 3.000000e-01)
ret void
}
/* Variables and functions */
unsigned int read_bits(unsigned char *, int, int *);
unsigned int u_n(unsigned char bytes[], int n_bits, int *bit_offset) {
  return read_bits(bytes, n_bits, bit_offset);
}


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

x86 assembly (clang, -O2):
<u_n>:
jmp    1030 <read_bits@plt>

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

LLVM IR (-O2):
define i32 @u_n(i8* %0, i32 %1, i32* %2) {
%4 = tail call i32 @read_bits(i8* %0, i32 %1, i32* %2)
ret i32 %4
}
void RTStrDupTag(void) {}


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

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

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

LLVM IR (-O2):
define void @RTStrDupTag() {
ret void
}
/* Variables and functions */
size_t strnlen(const char *s, size_t maxlen) {
  size_t len;
  for (len = 0; len < maxlen; len++, s++) {
    if (!*s)
      break;
  }
  return (len);
}


x86 assembly (clang, -O0):
<strnlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1156 <strnlen+0x56>
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
jne    1134 <strnlen+0x34>
jmp    1156 <strnlen+0x56>
jmp    1139 <strnlen+0x39>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1114 <strnlen+0x14>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strnlen>:
xor    %eax,%eax
test   %rsi,%rsi
je     1122 <strnlen+0x22>
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,(%rdi,%rax,1)
je     1122 <strnlen+0x22>
add    $0x1,%rax
cmp    %rax,%rsi
jne    1110 <strnlen+0x10>
mov    %rsi,%rax
ret

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

LLVM IR (-O2):
define i64 @strnlen(i8* nocapture %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %13, label %4
4: ; preds = %2, %9
%5 = phi i64 [ %10, %9 ], [ 0, %2 ]
%6 = phi i8* [ %11, %9 ], [ %0, %2 ]
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 0
br i1 %8, label %13, label %9
9: ; preds = %4
%10 = add nuw i64 %5, 1
%11 = getelementptr inbounds i8, i8* %6, i64 1
%12 = icmp eq i64 %10, %1
br i1 %12, label %13, label %4
13: ; preds = %9, %4, %2
%14 = phi i64 [ 0, %2 ], [ %5, %4 ], [ %1, %9 ]
ret i64 %14
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void fb_End(int errlevel) { exit(errlevel); }


x86 assembly (clang, -O0):
<fb_End>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<fb_End>:
push   %rax
call   1030 <exit@plt>

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

LLVM IR (-O2):
define void @fb_End(i32 %0) {
%2 = tail call i32 @exit(i32 %0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
main() { printf("\033[0;31m Hello World! \n"); }


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

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

LLVM IR (-O0):
@.str = [23 x i8] c"\1B[0;31m Hello World! \0A\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [22 x i8] c"\1B[0;31m Hello World! \00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ r;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ fread(unsigned int *, int, int, int /*<<< orphan*/ *);
unsigned int time(int /*<<< orphan*/ *);
unsigned int read_random() {
  FILE *fp = NULL;
  unsigned int r;
  if (fp != NULL) {
    fread(&r, 1, sizeof(r), fp);
    fclose(fp);
  } else {
    r = time(NULL);
  }
  return r;
}


x86 assembly (clang, -O0):
<read_random>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x0,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1170 <read_random+0x40>
mov    -0x8(%rbp),%rcx
lea    -0xc(%rbp),%rdi
mov    $0x1,%esi
mov    $0x4,%edx
call   1030 <fread@plt>
mov    -0x8(%rbp),%rdi
call   1040 <fclose@plt>
jmp    117c <read_random+0x4c>
xor    %eax,%eax
mov    %eax,%edi
call   1050 <time@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @read_random() {
%1 = tail call i32 @time(i32* null)
ret i32 %1
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
char fgetc(int /*<<< orphan*/ *);
int fgetw(FILE *fp) {
  int i, *p;
  char a[2];
  p = (int *)a;
  for (i = 0; i < 2; i++)
    a[i] = fgetc(fp);
  return *p;
}


x86 assembly (clang, -O0):
<fgetw>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x1a(%rbp),%rax
mov    %rax,-0x18(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x2,-0xc(%rbp)
jge    1156 <fgetw+0x46>
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
mov    %al,%cl
movslq -0xc(%rbp),%rax
mov    %cl,-0x1a(%rbp,%rax,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    112b <fgetw+0x1b>
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fgetw>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <fgetc@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <fgetc@plt>
movzbl %al,%ecx
shl    $0x8,%ecx
movzbl %bpl,%eax
or     %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @fgetw(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32*
%5 = alloca [2 x i8]
store i32* %0, i32** %2
%6 = getelementptr inbounds [2 x i8], [2 x i8]* %5, i64 0, i64 0
%7 = bitcast i8* %6 to i32*
store i32* %7, i32** %4
store i32 0, i32* %3
br label %8
8: ; preds = %17, %1
%9 = load i32, i32* %3
%10 = icmp slt i32 %9, 2
br i1 %10, label %11, label %20
11: ; preds = %8
%12 = load i32*, i32** %2
%13 = call signext i8 @fgetc(i32* %12)
%14 = load i32, i32* %3
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds [2 x i8], [2 x i8]* %5, i64 0, i64 %15
store i8 %13, i8* %16
br label %17
17: ; preds = %11
%18 = load i32, i32* %3
%19 = add nsw i32 %18, 1
store i32 %19, i32* %3
br label %8
20: ; preds = %8
%21 = load i32*, i32** %4
%22 = load i32, i32* %21
ret i32 %22
}

LLVM IR (-O2):
define i32 @fgetw(i32* nocapture %0) {
%2 = tail call signext i8 @fgetc(i32* %0)
%3 = tail call signext i8 @fgetc(i32* %0)
%4 = zext i8 %3 to i32
%5 = shl nuw nsw i32 %4, 8
%6 = zext i8 %2 to i32
%7 = or i32 %5, %6
ret i32 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128d;

/* Variables and functions */
int _mm_ucomige_sd(int /*<<< orphan*/, int /*<<< orphan*/);
int test_mm_ucomige_sd(__m128d A, __m128d B) { return _mm_ucomige_sd(A, B); }


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

x86 assembly (clang, -O2):
<test_mm_ucomige_sd>:
jmp    1030 <_mm_ucomige_sd@plt>

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

LLVM IR (-O2):
define i32 @test_mm_ucomige_sd(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_ucomige_sd(i32 %0, i32 %1)
ret i32 %3
}
void foo085(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo085(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char const *, size_t);
size_t strnlen(char const *, size_t);
char *xmalloc(size_t);
char *xstrdupn(const char *str, size_t len) {
  char *res = 0;
  if (str != 0) {
    size_t cnt = strnlen(str, len);
    res = xmalloc(cnt + 1);
    memcpy(res, str, cnt);
    res[cnt] = 0;
  }
  return res;
}


x86 assembly (clang, -O0):
<xstrdupn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1192 <xstrdupn+0x62>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strnlen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
add    $0x1,%rdi
call   1040 <xmalloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1050 <memcpy@plt>
mov    -0x18(%rbp),%rax
mov    -0x20(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xstrdupn>:
push   %r15
push   %r14
push   %rbx
test   %rdi,%rdi
je     1166 <xstrdupn+0x36>
mov    %rdi,%r14
call   1030 <strnlen@plt>
mov    %rax,%r15
lea    0x1(%rax),%rdi
call   1040 <xmalloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1050 <memcpy@plt>
movb   $0x0,(%rbx,%r15,1)
jmp    1168 <xstrdupn+0x38>
xor    %ebx,%ebx
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8* @xstrdupn(i8* %0, i64 %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %10, label %4
4: ; preds = %2
%5 = tail call i64 @strnlen(i8* %0, i64 %1)
%6 = add i64 %5, 1
%7 = tail call i8* @xmalloc(i64 %6)
%8 = tail call i32 @memcpy(i8* %7, i8* %0, i64 %5)
%9 = getelementptr inbounds i8, i8* %7, i64 %5
store i8 0, i8* %9
br label %10
10: ; preds = %4, %2
%11 = phi i8* [ %7, %4 ], [ null, %2 ]
ret i8* %11
}
void *ERR_CAST(const void *ptr) { return (void *)ptr; }


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

x86 assembly (clang, -O2):
<ERR_CAST>:
mov    %rdi,%rax
ret

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

LLVM IR (-O2):
define i8* @ERR_CAST(i8* readnone returned %0) {
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int a;
  int b;
  int comma;
  comma = (a = 5, b = 6, a + b);
  printf("%d", comma);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x5,-0x4(%rbp)
movl   $0x6,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xec7(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 11)
ret i32 0
}
float gps_get_lon() { return 34.5; }


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

x86 assembly (clang, -O2):
<gps_get_lon>:
movss  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define float @gps_get_lon() {
ret float 3.450000e+01
}

LLVM IR (-O2):
define float @gps_get_lon() {
ret float 3.450000e+01
}
int dx_list_destroyer_default(void *p) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @dx_list_destroyer_default(i8* nocapture readnone %0) {
ret i32 0
}
int register_usblog_proc(void) { return 0; }


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

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

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

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


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%edx
mov    %edx,%esi
imul   %edx,%esi
imul   %esi,%edx
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [7 x i8] c"%d\0A%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = mul nsw i32 %4, %4
%6 = mul nsw i32 %5, %4
%7 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %5, i32 %6)
ret i32 0
}
write(buffer, blocknr) char *buffer;
unsigned int blocknr;
{ common(buffer, blocknr, 1); }


x86 assembly (clang, -O0):
<write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    $0x1,%edx
mov    $0x0,%al
call   1030 <common@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write>:
mov    $0x1,%edx
xor    %eax,%eax
jmp    1030 <common@plt>

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

LLVM IR (-O2):
define i32 @write(i8* %0, i32 %1) {
%3 = tail call i32 (i8*, i32, i32, ...) bitcast (i32 (...)* @common to i32 (i8*, i32, i32, ...)*)(i8* %0, i32 %1, i32 1)
ret i32 undef
}
unsigned xrop3_22_0_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  unsigned stk4;
  stk4 = T & S;
  stk4 = ~stk4;
  stk3 = D & stk4;
  stk2 = S ^ stk3;
  stk1 = T ^ stk2;
  return stk1;
}


x86 assembly (clang, -O0):
<xrop3_22_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
and    -0xc(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x20(%rbp)
mov    -0x8(%rbp),%eax
and    -0x20(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0xc(%rbp),%eax
xor    -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
xor    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_22_0_0>:
mov    %edi,%eax
shl    $0x8,%eax
or     %edi,%eax
mov    %esi,%ecx
shl    $0x8,%ecx
or     %esi,%ecx
xor    %eax,%ecx
and    %edi,%esi
not    %sil
movzbl %sil,%eax
xor    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_22_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%12 = load i8, i8* %3
%13 = zext i8 %12 to i32
%14 = shl i32 %13, 8
%15 = load i8, i8* %3
%16 = zext i8 %15 to i32
%17 = or i32 %14, %16
store i32 %17, i32* %6
%18 = load i8, i8* %4
%19 = zext i8 %18 to i32
%20 = shl i32 %19, 8
%21 = load i8, i8* %4
%22 = zext i8 %21 to i32
%23 = or i32 %20, %22
store i32 %23, i32* %7
%24 = load i32, i32* %7
%25 = load i32, i32* %6
%26 = and i32 %24, %25
store i32 %26, i32* %11
%27 = load i32, i32* %11
%28 = xor i32 %27, -1
store i32 %28, i32* %11
%29 = load i32, i32* %5
%30 = load i32, i32* %11
%31 = and i32 %29, %30
store i32 %31, i32* %10
%32 = load i32, i32* %6
%33 = load i32, i32* %10
%34 = xor i32 %32, %33
store i32 %34, i32* %9
%35 = load i32, i32* %7
%36 = load i32, i32* %9
%37 = xor i32 %35, %36
store i32 %37, i32* %8
%38 = load i32, i32* %8
ret i32 %38
}

LLVM IR (-O2):
define i32 @xrop3_22_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = mul nuw nsw i32 %5, 257
%7 = and i8 %1, %0
%8 = xor i8 %7, -1
%9 = zext i8 %8 to i32
%10 = xor i32 %4, %9
%11 = xor i32 %10, %6
ret i32 %11
}
/* Type definitions */
typedef size_t uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
void SetPaletteObj(uint8_t entry, uint16_t colour) {
  ((volatile uint16_t *)(0x5000200))[entry] = colour;
}


x86 assembly (clang, -O0):
<SetPaletteObj>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edx
mov    -0x8(%rbp),%rcx
mov    $0x5000200,%eax
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<SetPaletteObj>:
mov    %esi,0x5000200(,%rdi,4)
ret

LLVM IR (-O0):
define void @SetPaletteObj(i64 %0, i32 %1) {
%3 = alloca i64
%4 = alloca i32
store i64 %0, i64* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i64, i64* %3
%7 = getelementptr inbounds i32, i32* inttoptr (i64 83886592 to i32*), i64 %6
store volatile i32 %5, i32* %7
ret void
}

LLVM IR (-O2):
define void @SetPaletteObj(i64 %0, i32 %1) {
%3 = getelementptr inbounds i32, i32* inttoptr (i64 83886592 to i32*), i64 %0
store volatile i32 %1, i32* %3
ret void
}
void string_init_ch(char *string) {}


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

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

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

LLVM IR (-O2):
define void @string_init_ch(i8* nocapture %0) {
ret void
}
/* Variables and functions */
scalar_t__ isprint(unsigned char);
char tochar(unsigned char c) { return isprint(c) ? (char)c : '.'; }


x86 assembly (clang, -O0):
<tochar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edi
call   1030 <isprint@plt>
cmp    $0x0,%rax
je     113d <tochar+0x2d>
movsbl -0x1(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    114a <tochar+0x3a>
mov    $0x2e,%eax
mov    %eax,-0x8(%rbp)
jmp    114a <tochar+0x3a>
mov    -0x8(%rbp),%eax
movsbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tochar>:
push   %rbx
mov    %edi,%ebx
call   1030 <isprint@plt>
test   %rax,%rax
mov    $0x2e,%eax
cmovne %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define signext i8 @tochar(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i64 @isprint(i8 zeroext %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
br label %10
9: ; preds = %1
br label %10
10: ; preds = %9, %6
%11 = phi i32 [ %8, %6 ], [ 46, %9 ]
%12 = trunc i32 %11 to i8
ret i8 %12
}

LLVM IR (-O2):
define signext i8 @tochar(i8 zeroext %0) {
%2 = tail call i64 @isprint(i8 zeroext %0)
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i8 46, i8 %0
ret i8 %4
}