xunge/DecIR huggingface dataset:
void INT_Excep_IRQ15(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_IRQ15() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcmp(void const *, void const *, size_t);
bool cutils_cdar_DynamicArray_char_compare(const void *p1, const void *p2,
                                           size_t s) {
  return !memcmp(p1, p2, s);
}


x86 assembly (clang, -O0):
<cutils_cdar_DynamicArray_char_compare>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <memcmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cutils_cdar_DynamicArray_char_compare>:
push   %rax
call   1030 <bcmp@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @cutils_cdar_DynamicArray_char_compare(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
%10 = call i32 @memcmp(i8* %7, i8* %8, i64 %9)
%11 = icmp ne i32 %10, 0
%12 = xor i1 %11, true
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
define i32 @cutils_cdar_DynamicArray_char_compare(i8* nocapture %0, i8* nocapture %1, i64 %2) {
%4 = tail call i32 @bcmp(i8* %0, i8* %1, i64 %2)
%5 = icmp eq i32 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
char *_map_file(char const *, int /*<<< orphan*/);
char *map_file_read(char const *filename) { return _map_file(filename, 0); }


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

x86 assembly (clang, -O2):
<map_file_read>:
xor    %esi,%esi
jmp    1030 <_map_file@plt>

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

LLVM IR (-O2):
define i8* @map_file_read(i8* %0) {
%2 = tail call i8* @_map_file(i8* %0, i32 0)
ret i8* %2
}
const char *__malidrv_build_info(void) {
  return "malidrv:  CONFIG=ux500 USING_OS_MEMORY=1 API_VERSION=10 REPO_URL= "
         "REVISION= CHANGED_REVISION= CHANGE_DATE= BUILD_DATE=Tue Sep  4 "
         "14:28:36 EEST 2012 BUILD=DEBUG CPU=ux500 USING_UMP=1 USING_HWMEM=1 "
         "USING_PMM=1 USING_MALI200=0 USING_MALI400=3 USING_MALI400_L2_CACHE=1 "
         "USING_GP2=0 KDIR= MALI_PLATFORM_FILE=platform/ux500/mali_platform.c "
         "OS_MEMORY_KERNEL_BUFFER_SIZE_IN_MB=6 USING_PROFILING=0 "
         "USING_GPU_UTILIZATION=1 USING_MALI_RUN_TIME_PM=0";
}


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

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

LLVM IR (-O0):
@.str = [437 x i8] c"malidrv: CONFIG=ux500 USING_OS_MEMORY=1 API_VERSION=10 REPO_URL= REVISION= CHANGED_REVISION= CHANGE_DATE= BUILD_DATE=Tue Sep 4 14:28:36 EEST 2012 BUILD=DEBUG CPU=ux500 USING_UMP=1 USING_HWMEM=1 USING_PMM=1 USING_MALI200=0 USING_MALI400=3 USING_MALI400_L2_CACHE=1 USING_GP2=0 KDIR= MALI_PLATFORM_FILE=platform/ux500/mali_platform.c OS_MEMORY_KERNEL_BUFFER_SIZE_IN_MB=6 USING_PROFILING=0 USING_GPU_UTILIZATION=1 USING_MALI_RUN_TIME_PM=0\00"
define i8* @__malidrv_build_info() {
ret i8* getelementptr inbounds ([437 x i8], [437 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [437 x i8] c"malidrv: CONFIG=ux500 USING_OS_MEMORY=1 API_VERSION=10 REPO_URL= REVISION= CHANGED_REVISION= CHANGE_DATE= BUILD_DATE=Tue Sep 4 14:28:36 EEST 2012 BUILD=DEBUG CPU=ux500 USING_UMP=1 USING_HWMEM=1 USING_PMM=1 USING_MALI200=0 USING_MALI400=3 USING_MALI400_L2_CACHE=1 USING_GP2=0 KDIR= MALI_PLATFORM_FILE=platform/ux500/mali_platform.c OS_MEMORY_KERNEL_BUFFER_SIZE_IN_MB=6 USING_PROFILING=0 USING_GPU_UTILIZATION=1 USING_MALI_RUN_TIME_PM=0\00"
define i8* @__malidrv_build_info() {
ret i8* getelementptr inbounds ([437 x i8], [437 x i8]* @.str, i64 0, i64 0)
}
int md_write_mbr(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @md_write_mbr() {
ret i32 0
}
/* Type definitions */
struct iam_leaf {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ assert_corr(int /*<<< orphan*/);
int /*<<< orphan*/ iam_leaf_is_locked(struct iam_leaf const *);
scalar_t__ n_cur(struct iam_leaf const *);
scalar_t__ n_end(struct iam_leaf const *);
int lvar_at_end(const struct iam_leaf *folio) {
  assert_corr(iam_leaf_is_locked(folio));
  return n_cur(folio) == n_end(folio);
}


x86 assembly (clang, -O0):
<lvar_at_end>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <iam_leaf_is_locked@plt>
mov    %eax,%edi
call   1060 <assert_corr@plt>
mov    -0x8(%rbp),%rdi
call   1030 <n_cur@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <n_end@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lvar_at_end>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1050 <iam_leaf_is_locked@plt>
mov    %eax,%edi
call   1060 <assert_corr@plt>
mov    %rbx,%rdi
call   1030 <n_cur@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1040 <n_end@plt>
xor    %ecx,%ecx
cmp    %rax,%r14
sete   %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.iam_leaf = type { i32 }
define i32 @lvar_at_end(%struct.iam_leaf* %0) {
%2 = alloca %struct.iam_leaf*
store %struct.iam_leaf* %0, %struct.iam_leaf** %2
%3 = load %struct.iam_leaf*, %struct.iam_leaf** %2
%4 = call i32 @iam_leaf_is_locked(%struct.iam_leaf* %3)
%5 = call i32 @assert_corr(i32 %4)
%6 = load %struct.iam_leaf*, %struct.iam_leaf** %2
%7 = call i64 @n_cur(%struct.iam_leaf* %6)
%8 = load %struct.iam_leaf*, %struct.iam_leaf** %2
%9 = call i64 @n_end(%struct.iam_leaf* %8)
%10 = icmp eq i64 %7, %9
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
%struct.iam_leaf = type { i32 }
define i32 @lvar_at_end(%struct.iam_leaf* %0) {
%2 = tail call i32 @iam_leaf_is_locked(%struct.iam_leaf* %0)
%3 = tail call i32 @assert_corr(i32 %2)
%4 = tail call i64 @n_cur(%struct.iam_leaf* %0)
%5 = tail call i64 @n_end(%struct.iam_leaf* %0)
%6 = icmp eq i64 %4, %5
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int retry();
int simdone();
int /*<<< orphan*/ siminit(char *);
int main() {
  siminit("teamjoe.log");
  printf("Collatz conjecture at 500 satisfied after step %d\n", retry());
  return simdone();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
call   1030 <siminit@plt>
mov    $0x0,%al
call   1040 <retry@plt>
mov    %eax,%esi
lea    0xea1(%rip),%rdi
call   1050 <printf@plt>
mov    $0x0,%al
call   1060 <simdone@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xeb8(%rip),%rdi
call   1030 <siminit@plt>
xor    %eax,%eax
call   1040 <retry@plt>
lea    0xeb1(%rip),%rdi
mov    %eax,%esi
call   1050 <printf@plt>
xor    %eax,%eax
pop    %rcx
jmp    1060 <simdone@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"teamjoe.log\00"
@.str.1 = [51 x i8] c"Collatz conjecture at 500 satisfied after step %d\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @siminit(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @retry()
%4 = call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.1, i64 0, i64 0), i32 %3)
%5 = call i32 (...) @simdone()
ret i32 %5
}

LLVM IR (-O2):
@.str = [12 x i8] c"teamjoe.log\00"
@.str.1 = [51 x i8] c"Collatz conjecture at 500 satisfied after step %d\0A\00"
define i32 @main() {
%1 = tail call i32 @siminit(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @retry()
%3 = tail call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.1, i64 0, i64 0), i32 %2)
%4 = tail call i32 (...) @simdone()
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_client_conf_set_cookie() {
  printf("NOT IMPLEMENTED:"
         "pa_client_conf_set_cookie"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [43 x i8] c"NOT IMPLEMENTED:pa_client_conf_set_cookie\0A\00"
define i32 @pa_client_conf_set_cookie() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [42 x i8] c"NOT IMPLEMENTED:pa_client_conf_set_cookie\00"
define i32 @pa_client_conf_set_cookie() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int floor(float);
int rnd(float x) { return floor((x * 10 + 4) / 10.00); }


x86 assembly (clang, -O0):
<rnd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  0xede(%rip),%xmm1
mulss  %xmm1,%xmm0
movss  0xed6(%rip),%xmm1
addss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xeba(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
call   1030 <floor@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rnd>:
movss  0xee8(%rip),%xmm1
mulss  %xmm1,%xmm0
addss  0xee0(%rip),%xmm0
divss  %xmm1,%xmm0
jmp    1030 <floor@plt>

LLVM IR (-O0):
define i32 @rnd(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @llvm.fmuladd.f32(float %3, float 1.000000e+01, float 4.000000e+00)
%5 = fpext float %4 to double
%6 = fdiv double %5, 1.000000e+01
%7 = fptrunc double %6 to float
%8 = call i32 @floor(float %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @rnd(float %0) {
%2 = tail call float @llvm.fmuladd.f32(float %0, float 1.000000e+01, float 4.000000e+00)
%3 = fdiv float %2, 1.000000e+01
%4 = tail call i32 @floor(float %3)
ret i32 %4
}
unsigned long long h(unsigned long long a) { return a & 0xfffffffffull; }


x86 assembly (clang, -O0):
<h>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movabs $0xfffffffff,%rax
and    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<h>:
movabs $0xfffffffff,%rax
and    %rdi,%rax
ret

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

LLVM IR (-O2):
define i64 @h(i64 %0) {
%2 = and i64 %0, 68719476735
ret i64 %2
}
/* Variables and functions */
unsigned long WaitMouse269();
unsigned long waitmouse() { return WaitMouse269(); }


x86 assembly (clang, -O0):
<waitmouse>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <WaitMouse269@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<waitmouse>:
xor    %eax,%eax
jmp    1030 <WaitMouse269@plt>

LLVM IR (-O0):
define i64 @waitmouse() {
%1 = call i64 (...) @WaitMouse269()
ret i64 %1
}

LLVM IR (-O2):
define i64 @waitmouse() {
%1 = tail call i64 (...) @WaitMouse269()
ret i64 %1
}
char *num2sjis(int num) {
  static char suji[][3] = {
      0x82, 0x4f, 0x00, 0x82, 0x50, 0x00, 0x82, 0x51, 0x00, 0x82, 0x52,
      0x00, 0x82, 0x53, 0x00, 0x82, 0x54, 0x00, 0x82, 0x55, 0x00, 0x82,
      0x56, 0x00, 0x82, 0x57, 0x00, 0x82, 0x58, 0x00, 0x81, 0x40, 0x00,
  };
  return suji[num];
}


x86 assembly (clang, -O0):
<num2sjis>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rcx
lea    0x2f1e(%rip),%rax
imul   $0x3,%rcx,%rcx
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<num2sjis>:
movslq %edi,%rax
lea    (%rax,%rax,2),%rcx
lea    0x2f22(%rip),%rax
add    %rcx,%rax
ret

LLVM IR (-O0):
@num2sjis.suji = internal global [11 x [3 x i8]] [[3 x i8] c"\82O\00", [3 x i8] c"\82P\00", [3 x i8] c"\82Q\00", [3 x i8] c"\82R\00", [3 x i8] c"\82S\00", [3 x i8] c"\82T\00", [3 x i8] c"\82U\00", [3 x i8] c"\82V\00", [3 x i8] c"\82W\00", [3 x i8] c"\82X\00", [3 x i8] c"\81@\00"]
define i8* @num2sjis(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds [11 x [3 x i8]], [11 x [3 x i8]]* @num2sjis.suji, i64 0, i64 %4
%6 = getelementptr inbounds [3 x i8], [3 x i8]* %5, i64 0, i64 0
ret i8* %6
}

LLVM IR (-O2):
@num2sjis.suji = internal global [11 x [3 x i8]] [[3 x i8] c"\82O\00", [3 x i8] c"\82P\00", [3 x i8] c"\82Q\00", [3 x i8] c"\82R\00", [3 x i8] c"\82S\00", [3 x i8] c"\82T\00", [3 x i8] c"\82U\00", [3 x i8] c"\82V\00", [3 x i8] c"\82W\00", [3 x i8] c"\82X\00", [3 x i8] c"\81@\00"]
define i8* @num2sjis(i32 %0) {
%2 = sext i32 %0 to i64
%3 = getelementptr inbounds [11 x [3 x i8]], [11 x [3 x i8]]* @num2sjis.suji, i64 0, i64 %2, i64 0
ret i8* %3
}
void RasterDmaMasterPrioritySet(unsigned int baseAddr, unsigned int flag) {
  (*((volatile unsigned int *)(baseAddr + (0x40)))) = flag;
}


x86 assembly (clang, -O0):
<RasterDmaMasterPrioritySet>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
mov    -0x4(%rbp),%eax
add    $0x40,%eax
mov    %eax,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<RasterDmaMasterPrioritySet>:
add    $0x40,%edi
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
define void @RasterDmaMasterPrioritySet(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32, i32* %3
%7 = add i32 %6, 64
%8 = zext i32 %7 to i64
%9 = inttoptr i64 %8 to i32*
store volatile i32 %5, i32* %9
ret void
}

LLVM IR (-O2):
define void @RasterDmaMasterPrioritySet(i32 %0, i32 %1) {
%3 = add i32 %0, 64
%4 = zext i32 %3 to i64
%5 = inttoptr i64 %4 to i32*
store volatile i32 %1, i32* %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int main(void) {
  int b, d;
  d = 16777215;
  b = (((d) >> (32 - ((12) + 1))) & 1);
  printf("12th bit of %d = %d\n", d, b);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xffffff,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sar    $0x13,%eax
and    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xec1(%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    $0xffffff,%esi
mov    $0x1,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [21 x i8] c"12th bit of %d = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 16777215, i32* %3
%4 = load i32, i32* %3
%5 = ashr i32 %4, 19
%6 = and i32 %5, 1
store i32 %6, i32* %2
%7 = load i32, i32* %3
%8 = load i32, i32* %2
%9 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [21 x i8] c"12th bit of %d = %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 16777215, i32 1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ bar(int);
int /*<<< orphan*/ foo(int);
int main() {
  foo(0x123456789abcde0fUL);
  bar(0x12345678);
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @foo(i32 -1698898417)
%3 = call i32 @bar(i32 305419896)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @foo(i32 -1698898417)
%2 = tail call i32 @bar(i32 305419896)
ret i32 0
}
/* Variables and functions */
int _strmatch_patmat(char *, char *, int);
int strmatch_filename(char *pattern, char *string, int options) {
  if (string == 0 || pattern == 0)
    return 0;
  return _strmatch_patmat(pattern, string, options);
}


x86 assembly (clang, -O0):
<strmatch_filename>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1139 <strmatch_filename+0x29>
cmpq   $0x0,-0x10(%rbp)
jne    1145 <strmatch_filename+0x35>
movl   $0x0,-0x4(%rbp)
jmp    1158 <strmatch_filename+0x48>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1030 <_strmatch_patmat@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strmatch_filename>:
test   %rdi,%rdi
je     111f <strmatch_filename+0xf>
test   %rsi,%rsi
je     111f <strmatch_filename+0xf>
jmp    1030 <_strmatch_patmat@plt>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @strmatch_filename(i8* %0, i8* %1, i32 %2) {
%4 = icmp eq i8* %1, null
%5 = icmp eq i8* %0, null
%6 = or i1 %5, %4
br i1 %6, label %9, label %7
7: ; preds = %3
%8 = tail call i32 @_strmatch_patmat(i8* %0, i8* %1, i32 %2)
br label %9
9: ; preds = %3, %7
%10 = phi i32 [ %8, %7 ], [ 0, %3 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ PyRun_SimpleString(char *);
void X11_StartQtStuff(void) {
  PyRun_SimpleString("import X11_Qtstuff");
  PyRun_SimpleString("X11_Qtstuff.GFX_StartQtstuff()");
}


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

x86 assembly (clang, -O2):
<X11_StartQtStuff>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <PyRun_SimpleString@plt>
lea    0xeef(%rip),%rdi
pop    %rax
jmp    1030 <PyRun_SimpleString@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"import X11_Qtstuff\00"
@.str.1 = [31 x i8] c"X11_Qtstuff.GFX_StartQtstuff()\00"
define void @X11_StartQtStuff() {
%1 = call i32 @PyRun_SimpleString(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @PyRun_SimpleString(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"import X11_Qtstuff\00"
@.str.1 = [31 x i8] c"X11_Qtstuff.GFX_StartQtstuff()\00"
define void @X11_StartQtStuff() {
%1 = tail call i32 @PyRun_SimpleString(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @PyRun_SimpleString(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sys_vgui(char *, void *, void *, char, int, int, int, int);
void move_object(void *cv, void *o, char c, int x, int y, int w, int h) {
  sys_vgui(".x%x.c coords %x%c %d %d %d %d\n", cv, o, c, x, y, x + w, y + h);
}


x86 assembly (clang, -O0):
<move_object>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %dl,%al
mov    0x10(%rbp),%edx
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    %r9d,-0x20(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x11(%rbp),%cl
mov    -0x18(%rbp),%r8d
mov    -0x1c(%rbp),%r9d
mov    -0x18(%rbp),%r10d
add    -0x20(%rbp),%r10d
mov    -0x1c(%rbp),%eax
add    0x10(%rbp),%eax
lea    0xea5(%rip),%rdi
movsbl %cl,%ecx
mov    %r10d,(%rsp)
mov    %eax,0x8(%rsp)
call   1030 <sys_vgui@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<move_object>:
push   %rax
mov    %r9d,%r10d
mov    %r8d,%r9d
mov    %ecx,%r8d
mov    %edx,%ecx
mov    %rsi,%rdx
mov    %rdi,%rsi
add    %r8d,%r10d
mov    0x10(%rsp),%eax
add    %r9d,%eax
lea    0xecd(%rip),%rdi
push   %rax
push   %r10
call   1030 <sys_vgui@plt>
add    $0x10,%rsp
pop    %rax
ret

LLVM IR (-O0):
@.str = [32 x i8] c".x%x.c coords %x%c %d %d %d %d\0A\00"
define void @move_object(i8* %0, i8* %1, i8 signext %2, i32 %3, i32 %4, i32 %5, i32 %6) {
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
store i8* %0, i8** %8
store i8* %1, i8** %9
store i8 %2, i8* %10
store i32 %3, i32* %11
store i32 %4, i32* %12
store i32 %5, i32* %13
store i32 %6, i32* %14
%15 = load i8*, i8** %8
%16 = load i8*, i8** %9
%17 = load i8, i8* %10
%18 = load i32, i32* %11
%19 = load i32, i32* %12
%20 = load i32, i32* %11
%21 = load i32, i32* %13
%22 = add nsw i32 %20, %21
%23 = load i32, i32* %12
%24 = load i32, i32* %14
%25 = add nsw i32 %23, %24
%26 = call i32 @sys_vgui(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* %15, i8* %16, i8 signext %17, i32 %18, i32 %19, i32 %22, i32 %25)
ret void
}

LLVM IR (-O2):
@.str = [32 x i8] c".x%x.c coords %x%c %d %d %d %d\0A\00"
define void @move_object(i8* %0, i8* %1, i8 signext %2, i32 %3, i32 %4, i32 %5, i32 %6) {
%8 = add nsw i32 %5, %3
%9 = add nsw i32 %6, %4
%10 = tail call i32 @sys_vgui(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1, i8 signext %2, i32 %3, i32 %4, i32 %8, i32 %9)
ret void
}
int hputra(hstring, keyword, ra)
char *hstring;
char *keyword;
double ra;
{
  char value[30];
  ra2str(value, 30, ra, 3);
  return (hputs(hstring, keyword, value));
}


x86 assembly (clang, -O0):
<hputra>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movsd  %xmm0,-0x18(%rbp)
lea    -0x40(%rbp),%rdi
movsd  -0x18(%rbp),%xmm0
mov    $0x1e,%esi
mov    $0x3,%edx
mov    $0x1,%al
call   1030 <ra2str@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
lea    -0x40(%rbp),%rdx
mov    $0x0,%al
call   1040 <hputs@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hputra>:
push   %r15
push   %r14
push   %rbx
sub    $0x20,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
mov    %rsp,%r15
mov    %r15,%rdi
mov    $0x1e,%esi
mov    $0x3,%edx
mov    $0x1,%al
call   1030 <ra2str@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
xor    %eax,%eax
call   1040 <hputs@plt>
add    $0x20,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32 @hputra(i8* %0, i8* %1, double %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca double
%7 = alloca [30 x i8]
store i8* %0, i8** %4
store i8* %1, i8** %5
store double %2, double* %6
%8 = getelementptr inbounds [30 x i8], [30 x i8]* %7, i64 0, i64 0
%9 = load double, double* %6
%10 = call i32 (i8*, i32, double, i32, ...) bitcast (i32 (...)* @ra2str to i32 (i8*, i32, double, i32, ...)*)(i8* %8, i32 30, double %9, i32 3)
%11 = load i8*, i8** %4
%12 = load i8*, i8** %5
%13 = getelementptr inbounds [30 x i8], [30 x i8]* %7, i64 0, i64 0
%14 = call i32 (i8*, i8*, i8*, ...) bitcast (i32 (...)* @hputs to i32 (i8*, i8*, i8*, ...)*)(i8* %11, i8* %12, i8* %13)
ret i32 %14
}

LLVM IR (-O2):
define i32 @hputra(i8* %0, i8* %1, double %2) {
%4 = alloca [30 x i8]
%5 = getelementptr inbounds [30 x i8], [30 x i8]* %4, i64 0, i64 0
%6 = call i32 (i8*, i32, double, i32, ...) bitcast (i32 (...)* @ra2str to i32 (i8*, i32, double, i32, ...)*)(i8* %5, i32 30, double %2, i32 3)
%7 = call i32 (i8*, i8*, i8*, ...) bitcast (i32 (...)* @hputs to i32 (i8*, i8*, i8*, ...)*)(i8* %0, i8* %1, i8* %5)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ op_write1(int);
void op_enc_ld_a_dep(void) { op_write1(0x1a); }


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

x86 assembly (clang, -O2):
<op_enc_ld_a_dep>:
mov    $0x1a,%edi
jmp    1030 <op_write1@plt>

LLVM IR (-O0):
define void @op_enc_ld_a_dep() {
%1 = call i32 @op_write1(i32 26)
ret void
}

LLVM IR (-O2):
define void @op_enc_ld_a_dep() {
%1 = tail call i32 @op_write1(i32 26)
ret void
}
int rt_task(struct task_struct *p) { return 0; }


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

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

LLVM IR (-O0):
%struct.task_struct = type opaque
define i32 @rt_task(%struct.task_struct* %0) {
%2 = alloca %struct.task_struct*
store %struct.task_struct* %0, %struct.task_struct** %2
ret i32 0
}

LLVM IR (-O2):
%struct.task_struct = type opaque
define i32 @rt_task(%struct.task_struct* nocapture readnone %0) {
ret i32 0
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
void WatchdogIntClear(uint32_t ui32Base) {
  ;
  (*((volatile unsigned long *)(ui32Base + 0x0000000C))) = 0x00000001;
}


x86 assembly (clang, -O0):
<WatchdogIntClear>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movq   $0x1,0xc(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<WatchdogIntClear>:
movq   $0x1,0xc(%rdi)
ret

LLVM IR (-O0):
define void @WatchdogIntClear(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add nsw i64 %3, 12
%5 = inttoptr i64 %4 to i64*
store volatile i64 1, i64* %5
ret void
}

LLVM IR (-O2):
define void @WatchdogIntClear(i64 %0) {
%2 = add nsw i64 %0, 12
%3 = inttoptr i64 %2 to i64*
store volatile i64 1, i64* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
int stat64(const char *file, void *buf) {
  errno = ENOSYS;
  return -1;
}


x86 assembly (clang, -O0):
<stat64>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ed5(%rip),%rax
mov    (%rax),%ecx
mov    0x2ebc(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<stat64>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @stat64(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i32, i32* @ENOSYS
store i32 %5, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @stat64(i8* nocapture readnone %0, i8* nocapture readnone %1) {
%3 = load i32, i32* @ENOSYS
store i32 %3, i32* @errno
ret i32 -1
}
int LZ4_compressBound(int isize) { return (isize / 8) + isize + 16; }


x86 assembly (clang, -O0):
<LZ4_compressBound>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
add    -0x4(%rbp),%eax
add    $0x10,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<LZ4_compressBound>:
lea    0x7(%rdi),%eax
test   %edi,%edi
cmovns %edi,%eax
sar    $0x3,%eax
add    %edi,%eax
add    $0x10,%eax
ret

LLVM IR (-O0):
define i32 @LZ4_compressBound(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sdiv i32 %3, 8
%5 = load i32, i32* %2
%6 = add nsw i32 %4, %5
%7 = add nsw i32 %6, 16
ret i32 %7
}

LLVM IR (-O2):
define i32 @LZ4_compressBound(i32 %0) {
%2 = sdiv i32 %0, 8
%3 = add i32 %0, 16
%4 = add i32 %3, %2
ret i32 %4
}
float R2_logDepthPrepareEyeZ(const float z) { return 1.0 + (-z); }


x86 assembly (clang, -O0):
<R2_logDepthPrepareEyeZ>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xed9(%rip),%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<R2_logDepthPrepareEyeZ>:
movss  0xef8(%rip),%xmm1
subss  %xmm0,%xmm1
movaps %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @R2_logDepthPrepareEyeZ(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fneg float %3
%5 = fpext float %4 to double
%6 = fadd double 1.000000e+00, %5
%7 = fptrunc double %6 to float
ret float %7
}

LLVM IR (-O2):
define float @R2_logDepthPrepareEyeZ(float %0) {
%2 = fsub float 1.000000e+00, %0
ret float %2
}
/* Variables and functions */
int /*<<< orphan*/ sleep(int);
void *thread_function(void *arg) {
  while (1)
    sleep(100);
  return NULL;
}


x86 assembly (clang, -O0):
<thread_function>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x64,%edi
call   1030 <sleep@plt>
jmp    111c <thread_function+0xc>

x86 assembly (clang, -O2):
<thread_function>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0x64,%edi
call   1030 <sleep@plt>
jmp    1120 <thread_function+0x10>

LLVM IR (-O0):
define i8* @thread_function(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %1, %3
%4 = call i32 @sleep(i32 100)
br label %3
}

LLVM IR (-O2):
define noalias i8* @thread_function(i8* nocapture readnone %0) {
br label %2
2: ; preds = %1, %2
%3 = tail call i32 @sleep(i32 100)
br label %2
}
/* Variables and functions */
double current_time(int const);
double get_time(const int which) { return current_time(which); }


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

x86 assembly (clang, -O2):
<get_time>:
jmp    1030 <current_time@plt>

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

LLVM IR (-O2):
define double @get_time(i32 %0) {
%2 = tail call double @current_time(i32 %0)
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void *realloc(void *, size_t);
void *lbs_simplealloc(void *ud, void *ptr, size_t osize, size_t nsize) {
  (void)ud;
  (void)osize;
  if (nsize == 0) {
    free(ptr);
    return NULL;
  } else {
    return realloc(ptr, nsize);
  }
}


x86 assembly (clang, -O0):
<lbs_simplealloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
jne    1159 <lbs_simplealloc+0x39>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
movq   $0x0,-0x8(%rbp)
jmp    116a <lbs_simplealloc+0x4a>
mov    -0x18(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1040 <realloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lbs_simplealloc>:
mov    %rsi,%rdi
test   %rcx,%rcx
je     1130 <lbs_simplealloc+0x10>
mov    %rcx,%rsi
jmp    1040 <realloc@plt>
push   %rax
call   1030 <free@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define noalias i8* @lbs_simplealloc(i8* nocapture readnone %0, i8* nocapture %1, i64 %2, i64 %3) {
%5 = icmp eq i64 %3, 0
br i1 %5, label %6, label %8
6: ; preds = %4
%7 = tail call i32 @free(i8* %1)
br label %10
8: ; preds = %4
%9 = tail call i8* @realloc(i8* %1, i64 %3)
br label %10
10: ; preds = %8, %6
%11 = phi i8* [ null, %6 ], [ %9, %8 ]
ret i8* %11
}
/* Type definitions */
struct timeval {
  scalar_t__ tv_usec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/);
long pt_time_usec() {
  struct timeval tv;
  gettimeofday(&tv, 0);
  return (long)tv.tv_sec * 1000000l + (long)tv.tv_usec;
}


x86 assembly (clang, -O0):
<pt_time_usec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
imul   $0xf4240,-0x8(%rbp),%rax
add    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pt_time_usec>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
imul   $0xf4240,0x10(%rsp),%rax
add    0x8(%rsp),%rax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define i64 @pt_time_usec() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32 0)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%4 = load i64, i64* %3
%5 = mul nsw i64 %4, 1000000
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%7 = load i64, i64* %6
%8 = add nsw i64 %5, %7
ret i64 %8
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
define i64 @pt_time_usec() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32 0)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%5 = load i64, i64* %4
%6 = mul nsw i64 %5, 1000000
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%8 = load i64, i64* %7
%9 = add nsw i64 %6, %8
ret i64 %9
}
float inv_wrap_angle(float ang) {
  if (ang > 3.14159265358979)
    return ang - 2 * (float)3.14159265358979;
  else if (ang <= -(float)3.14159265358979)
    return ang + 2 * (float)3.14159265358979;
  else
    return ang;
}


x86 assembly (clang, -O0):
<inv_wrap_angle>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xee6(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    113f <inv_wrap_angle+0x3f>
movss  -0x8(%rbp),%xmm0
movss  0xedb(%rip),%xmm1
subss  %xmm1,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1172 <inv_wrap_angle+0x72>
movss  0xec1(%rip),%xmm0
ucomiss -0x8(%rbp),%xmm0
jb     1168 <inv_wrap_angle+0x68>
movss  0xeb3(%rip),%xmm0
addss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1172 <inv_wrap_angle+0x72>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<inv_wrap_angle>:
cvtss2sd %xmm0,%xmm1
ucomisd 0xef4(%rip),%xmm1
jbe    1117 <inv_wrap_angle+0x17>
addss  0xefa(%rip),%xmm0
ret
movss  0xee9(%rip),%xmm1
ucomiss %xmm0,%xmm1
jb     112c <inv_wrap_angle+0x2c>
addss  0xee0(%rip),%xmm0
ret

LLVM IR (-O0):
define float @inv_wrap_angle(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %3
%4 = load float, float* %3
%5 = fpext float %4 to double
%6 = fcmp ogt double %5, 0x400921FB54442D11
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load float, float* %3
%9 = fsub float %8, 0x401921FB60000000
store float %9, float* %2
br label %18
10: ; preds = %1
%11 = load float, float* %3
%12 = fcmp ole float %11, 0xC00921FB60000000
br i1 %12, label %13, label %16
13: ; preds = %10
%14 = load float, float* %3
%15 = fadd float %14, 0x401921FB60000000
store float %15, float* %2
br label %18
16: ; preds = %10
%17 = load float, float* %3
store float %17, float* %2
br label %18
18: ; preds = %16, %13, %7
%19 = load float, float* %2
ret float %19
}

LLVM IR (-O2):
define float @inv_wrap_angle(float %0) {
%2 = fpext float %0 to double
%3 = fcmp ogt double %2, 0x400921FB54442D11
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = fadd float %0, 0xC01921FB60000000
br label %10
6: ; preds = %1
%7 = fcmp ugt float %0, 0xC00921FB60000000
br i1 %7, label %10, label %8
8: ; preds = %6
%9 = fadd float %0, 0x401921FB60000000
br label %10
10: ; preds = %6, %8, %4
%11 = phi float [ %5, %4 ], [ %9, %8 ], [ %0, %6 ]
ret float %11
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int uint64_t;

/* Variables and functions */
int resp_read_media_serial(uint8_t *sno, uint8_t *buf, uint8_t *sam_stat) {
  uint64_t size = 0L;
  ;
  return size;
}


x86 assembly (clang, -O0):
<resp_read_media_serial>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @resp_read_media_serial(i32* nocapture readnone %0, i32* nocapture readnone %1, i32* nocapture readnone %2) {
ret i32 0
}
void vesa_store_edid(void) {}


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

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

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

LLVM IR (-O2):
define void @vesa_store_edid() {
ret void
}
/* Variables and functions */
scalar_t__ isupper(int);
int tolower(int c) {
  if (isupper(c))
    return c + 32;
  return c;
}


x86 assembly (clang, -O0):
<tolower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <isupper@plt>
cmp    $0x0,%rax
je     113b <tolower+0x2b>
mov    -0x8(%rbp),%eax
add    $0x20,%eax
mov    %eax,-0x4(%rbp)
jmp    1141 <tolower+0x31>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @tolower(i32 %0) {
%2 = tail call i64 @isupper(i32 %0)
%3 = icmp eq i64 %2, 0
%4 = add nsw i32 %0, 32
%5 = select i1 %3, i32 %0, i32 %4
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ wd_write(int /*<<< orphan*/, int /*<<< orphan*/, void *,
                            int);
void wd_writeb(uint16_t addr, uint8_t val, void *priv) {
  wd_write(addr, val, priv, 1);
}


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

x86 assembly (clang, -O2):
<wd_writeb>:
mov    $0x1,%ecx
jmp    1030 <wd_write@plt>

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

LLVM IR (-O2):
define void @wd_writeb(i32 %0, i32 %1, i8* %2) {
%4 = tail call i32 @wd_write(i32 %0, i32 %1, i8* %2, i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ atof(char *);
void uninitvar_atof(void) {
  char *c;
  (void)atof(c);
}


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

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

LLVM IR (-O0):
define void @uninitvar_atof() {
%1 = alloca i8*
%2 = load i8*, i8** %1
%3 = call i32 @atof(i8* %2)
ret void
}

LLVM IR (-O2):
define void @uninitvar_atof() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int uint32_t;
typedef int /*<<< orphan*/ tmp;
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ ivory_serialize_pack_prim_4_be(int /*<<< orphan*/ *,
                                                  int /*<<< orphan*/ *);
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ **, int /*<<< orphan*/ const *,
                          int);
void ivory_serialize_pack_int32_be(uint8_t *dst, uint32_t offs,
                                   const int32_t *src) {
  uint8_t tmp[4] = {0};
  memcpy(&tmp, src, sizeof(tmp));
  ivory_serialize_pack_prim_4_be(dst + offs, tmp);
}


x86 assembly (clang, -O0):
<ivory_serialize_pack_int32_be>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
lea    -0x30(%rbp),%rdi
xor    %esi,%esi
mov    $0x10,%edx
call   1030 <memset@plt>
lea    -0x30(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    $0x10,%edx
call   1050 <memcpy@plt>
mov    -0x8(%rbp),%rdi
movslq -0xc(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdi
lea    -0x30(%rbp),%rsi
call   1040 <ivory_serialize_pack_prim_4_be@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ivory_serialize_pack_int32_be>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %esi,%ebx
mov    %rdi,%r14
xorps  %xmm0,%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%r15
mov    %r15,%rdi
mov    %rdx,%rsi
mov    $0x10,%edx
call   1040 <memcpy@plt>
movslq %ebx,%rax
lea    (%r14,%rax,4),%rdi
mov    %r15,%rsi
call   1030 <ivory_serialize_pack_prim_4_be@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @ivory_serialize_pack_int32_be(i32* %0, i32 %1, i32* %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32*
%7 = alloca [4 x i32]
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32* %2, i32** %6
%8 = bitcast [4 x i32]* %7 to i8*
%9 = bitcast [4 x i32]* %7 to i32**
%10 = load i32*, i32** %6
%11 = call i32 @memcpy(i32** %9, i32* %10, i32 16)
%12 = load i32*, i32** %4
%13 = load i32, i32* %5
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i32, i32* %12, i64 %14
%16 = getelementptr inbounds [4 x i32], [4 x i32]* %7, i64 0, i64 0
%17 = call i32 @ivory_serialize_pack_prim_4_be(i32* %15, i32* %16)
ret void
}

LLVM IR (-O2):
define void @ivory_serialize_pack_int32_be(i32* %0, i32 %1, i32* %2) {
%4 = alloca [4 x i32]
%5 = bitcast [4 x i32]* %4 to i8*
%6 = bitcast [4 x i32]* %4 to i32**
%7 = call i32 @memcpy(i32** %6, i32* %2, i32 16)
%8 = sext i32 %1 to i64
%9 = getelementptr inbounds i32, i32* %0, i64 %8
%10 = getelementptr inbounds [4 x i32], [4 x i32]* %4, i64 0, i64 0
%11 = call i32 @ivory_serialize_pack_prim_4_be(i32* %9, i32* %10)
ret void
}
/* Type definitions */
struct b6_splay {
  int dummy;
};
struct b6_dref {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ b6_splay_del(struct b6_splay *);
int /*<<< orphan*/ do_search(struct b6_splay *, int *, struct b6_dref *);
int do_del(struct b6_splay *splay, struct b6_dref *ref) {
  int dir, ret;
  if ((ret = !do_search(splay, &dir, ref)))
    b6_splay_del(splay);
  return ret;
}


x86 assembly (clang, -O0):
<do_del>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    -0x14(%rbp),%rsi
call   1040 <do_search@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
mov    %al,%cl
and    $0x1,%cl
movzbl %cl,%ecx
mov    %ecx,-0x18(%rbp)
test   $0x1,%al
jne    1161 <do_del+0x41>
jmp    116a <do_del+0x4a>
mov    -0x8(%rbp),%rdi
call   1030 <b6_splay_del@plt>
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_del>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rdx
mov    %rdi,%rbx
lea    0x4(%rsp),%rsi
call   1040 <do_search@plt>
mov    %eax,%ebp
test   %eax,%eax
jne    1141 <do_del+0x21>
mov    %rbx,%rdi
call   1030 <b6_splay_del@plt>
xor    %eax,%eax
test   %ebp,%ebp
sete   %al
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.b6_splay = type { i32 }
%struct.b6_dref = type { i32 }
define i32 @do_del(%struct.b6_splay* %0, %struct.b6_dref* %1) {
%3 = alloca %struct.b6_splay*
%4 = alloca %struct.b6_dref*
%5 = alloca i32
%6 = alloca i32
store %struct.b6_splay* %0, %struct.b6_splay** %3
store %struct.b6_dref* %1, %struct.b6_dref** %4
%7 = load %struct.b6_splay*, %struct.b6_splay** %3
%8 = load %struct.b6_dref*, %struct.b6_dref** %4
%9 = call i32 @do_search(%struct.b6_splay* %7, i32* %5, %struct.b6_dref* %8)
%10 = icmp ne i32 %9, 0
%11 = xor i1 %10, true
%12 = zext i1 %11 to i32
store i32 %12, i32* %6
br i1 %11, label %13, label %16
13: ; preds = %2
%14 = load %struct.b6_splay*, %struct.b6_splay** %3
%15 = call i32 @b6_splay_del(%struct.b6_splay* %14)
br label %16
16: ; preds = %13, %2
%17 = load i32, i32* %6
ret i32 %17
}

LLVM IR (-O2):
%struct.b6_splay = type { i32 }
%struct.b6_dref = type { i32 }
define i32 @do_del(%struct.b6_splay* %0, %struct.b6_dref* %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call i32 @do_search(%struct.b6_splay* %0, i32* %3, %struct.b6_dref* %1)
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = call i32 @b6_splay_del(%struct.b6_splay* %0)
br label %9
9: ; preds = %7, %2
%10 = zext i1 %6 to i32
ret i32 %10
}
/* Variables and functions */
int daylight;
int dummyfcn(void) {
  int dummy;
  dummy = daylight;
  return 0;
}


x86 assembly (clang, -O0):
<dummyfcn>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@daylight = global i32 0
define i32 @dummyfcn() {
%1 = alloca i32
%2 = load i32, i32* @daylight
store i32 %2, i32* %1
ret i32 0
}

LLVM IR (-O2):
@daylight = global i32 0
define i32 @dummyfcn() {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ __m64;

/* Variables and functions */
int /*<<< orphan*/ _mm_cmpgt_pi16(int /*<<< orphan*/, int /*<<< orphan*/);
__m64 test88(__m64 a, __m64 b) { return _mm_cmpgt_pi16(a, b); }


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

x86 assembly (clang, -O2):
<test88>:
jmp    1030 <_mm_cmpgt_pi16@plt>

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

LLVM IR (-O2):
define i32 @test88(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_cmpgt_pi16(i32 %0, i32 %1)
ret i32 %3
}