xunge/DecIR huggingface dataset:
/* Variables and functions */
int foo_static();
int baz() { return foo_static(); }


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

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

LLVM IR (-O0):
define i32 @baz() {
%1 = call i32 (...) @foo_static()
ret i32 %1
}

LLVM IR (-O2):
define i32 @baz() {
%1 = tail call i32 (...) @foo_static()
ret i32 %1
}
long cube(long x) { return (x * x * x); }


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

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

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

LLVM IR (-O2):
define i64 @cube(i64 %0) {
%2 = mul nsw i64 %0, %0
%3 = mul nsw i64 %2, %0
ret i64 %3
}
void gdk_display_get_default() {}


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

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

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

LLVM IR (-O2):
define void @gdk_display_get_default() {
ret void
}
long long_abs(long l) { return (l < 0 ? -1l * l : l); }


x86 assembly (clang, -O0):
<long_abs>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jge    1121 <long_abs+0x21>
imul   $0xffffffffffffffff,-0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    1129 <long_abs+0x29>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i64 @long_abs(i64 %0) {
%2 = tail call i64 @llvm.abs.i64(i64 %0, i1 true)
ret i64 %2
}
/* Type definitions */
typedef scalar_t__ uint64_t;

/* Variables and functions */
int cmp_uint64_t(const void *a, const void *b) {
  uint64_t a2 = *((uint64_t *)a);
  uint64_t b2 = *((uint64_t *)b);
  if (a2 < b2) {
    return -1;
  }
  if (a2 > b2) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<cmp_uint64_t>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x28(%rbp),%rax
jge    113c <cmp_uint64_t+0x3c>
movl   $0xffffffff,-0x4(%rbp)
jmp    115d <cmp_uint64_t+0x5d>
mov    -0x20(%rbp),%rax
cmp    -0x28(%rbp),%rax
jle    1156 <cmp_uint64_t+0x56>
movl   $0x1,-0x4(%rbp)
jmp    115d <cmp_uint64_t+0x5d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp_uint64_t>:
mov    (%rdi),%rax
xor    %ecx,%ecx
cmp    (%rsi),%rax
setg   %cl
mov    $0xffffffff,%eax
cmovge %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @cmp_uint64_t(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i64*
%4 = load i64, i64* %3
%5 = bitcast i8* %1 to i64*
%6 = load i64, i64* %5
%7 = icmp slt i64 %4, %6
%8 = icmp sgt i64 %4, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ Ansi2Ucs2(char *);
int AtomTypeW(int /*<<< orphan*/);
int AtomTypeA(char *lpString) { return AtomTypeW(Ansi2Ucs2(lpString)); }


x86 assembly (clang, -O0):
<AtomTypeA>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <Ansi2Ucs2@plt>
mov    %eax,%edi
call   1040 <AtomTypeW@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<AtomTypeA>:
push   %rax
call   1030 <Ansi2Ucs2@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <AtomTypeW@plt>

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

LLVM IR (-O2):
define i32 @AtomTypeA(i8* %0) {
%2 = tail call i32 @Ansi2Ucs2(i8* %0)
%3 = tail call i32 @AtomTypeW(i32 %2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ subcycle1();
void subcycle2(void) { subcycle1(); }


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

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

LLVM IR (-O0):
define void @subcycle2() {
%1 = call i32 (...) @subcycle1()
ret void
}

LLVM IR (-O2):
define void @subcycle2() {
%1 = tail call i32 (...) @subcycle1()
ret void
}
unsigned long sysfs_get_transition_latency(unsigned int cpu) { return 0; }


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

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

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

LLVM IR (-O2):
define i64 @sysfs_get_transition_latency(i32 %0) {
ret i64 0
}
/* Variables and functions */
int /*<<< orphan*/ gets(char *);
int /*<<< orphan*/ printf(char const *);
int strlen(char *);
int selectUserStr(const char *msg, char *user_input) {
  printf("\n\n");
  printf(msg);
  gets(user_input);
  return strlen(user_input);
}


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

x86 assembly (clang, -O2):
<selectUserStr>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
lea    0xeaf(%rip),%rdi
call   1030 <puts@plt>
mov    %r14,%rdi
call   1050 <printf@plt>
mov    %rbx,%rdi
call   1060 <gets@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <strlen@plt>

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

LLVM IR (-O2):
@str = [2 x i8] c"\0A\00"
define i32 @selectUserStr(i8* nocapture %0, i8* %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @printf(i8* dereferenceable(1) %0)
%5 = tail call i32 @gets(i8* %1)
%6 = tail call i32 @strlen(i8* %1)
ret i32 %6
}
int test_imm_F5uint32_reg(unsigned int val) {
  return ((val) & (0xF5 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_F5uint32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0xf5,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_F5uint32_reg(i32 %0) {
%2 = and i32 %0, 245
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ cfg_get(char *);
int file_exists_in_dir(int /*<<< orphan*/, char const *);
int file_exists_in_include_dir(const char *fname) {
  return file_exists_in_dir(cfg_get("include-dirname"), fname);
}


x86 assembly (clang, -O0):
<file_exists_in_include_dir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
call   1040 <cfg_get@plt>
mov    %eax,%edi
mov    -0x8(%rbp),%rsi
call   1030 <file_exists_in_dir@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_exists_in_include_dir>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
call   1040 <cfg_get@plt>
mov    %eax,%edi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <file_exists_in_dir@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"include-dirname\00"
define i32 @file_exists_in_include_dir(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @cfg_get(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 @file_exists_in_dir(i32 %3, i8* %4)
ret i32 %5
}

LLVM IR (-O2):
@.str = [16 x i8] c"include-dirname\00"
define i32 @file_exists_in_include_dir(i8* %0) {
%2 = tail call i32 @cfg_get(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @file_exists_in_dir(i32 %2, i8* %0)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, void const *, void const *);
void ASRT_PrintFailPtr(const void *expected, const void *actual) {
  printf("\n  Expected: %p, Actual: %p", expected, actual);
}


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

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

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

LLVM IR (-O2):
@.str = [28 x i8] c"\0A Expected: %p, Actual: %p\00"
define void @ASRT_PrintFailPtr(i8* %0, i8* %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ HEAP_INCREASE_KEY(int *, int, int);
void MAX_HEAP_INSERT(int A[], int *heap_size, int key) {
  *heap_size = *heap_size + 1;
  A[*heap_size] = -9999999;
  HEAP_INCREASE_KEY(A, *heap_size - 1, key);
}


x86 assembly (clang, -O0):
<MAX_HEAP_INSERT>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
movslq (%rcx),%rcx
movl   $0xff676981,(%rax,%rcx,4)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
sub    $0x1,%esi
mov    -0x14(%rbp),%edx
call   1030 <HEAP_INCREASE_KEY@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MAX_HEAP_INSERT>:
movslq (%rsi),%rax
lea    0x1(%rax),%rcx
mov    %ecx,(%rsi)
movl   $0xff676981,0x4(%rdi,%rax,4)
ff
mov    (%rsi),%esi
add    $0xffffffff,%esi
jmp    1030 <HEAP_INCREASE_KEY@plt>

LLVM IR (-O0):
define void @MAX_HEAP_INSERT(i32* %0, i32* %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32
store i32* %0, i32** %4
store i32* %1, i32** %5
store i32 %2, i32* %6
%7 = load i32*, i32** %5
%8 = load i32, i32* %7
%9 = add nsw i32 %8, 1
%10 = load i32*, i32** %5
store i32 %9, i32* %10
%11 = load i32*, i32** %4
%12 = load i32*, i32** %5
%13 = load i32, i32* %12
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i32, i32* %11, i64 %14
store i32 -9999999, i32* %15
%16 = load i32*, i32** %4
%17 = load i32*, i32** %5
%18 = load i32, i32* %17
%19 = sub nsw i32 %18, 1
%20 = load i32, i32* %6
%21 = call i32 @HEAP_INCREASE_KEY(i32* %16, i32 %19, i32 %20)
ret void
}

LLVM IR (-O2):
define void @MAX_HEAP_INSERT(i32* %0, i32* nocapture %1, i32 %2) {
%4 = load i32, i32* %1
%5 = add nsw i32 %4, 1
store i32 %5, i32* %1
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds i32, i32* %0, i64 %6
store i32 -9999999, i32* %7
%8 = load i32, i32* %1
%9 = add nsw i32 %8, -1
%10 = tail call i32 @HEAP_INCREASE_KEY(i32* %0, i32 %9, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ armRaiseInstant(int);
int /*<<< orphan*/ armRaiseSafe(int);
int /*<<< orphan*/ handOpen();
void catapult() {
  armRaiseSafe(170);
  armRaiseInstant(75);
  handOpen();
}


x86 assembly (clang, -O0):
<catapult>:
push   %rbp
mov    %rsp,%rbp
mov    $0xaa,%edi
call   1050 <armRaiseSafe@plt>
mov    $0x4b,%edi
call   1030 <armRaiseInstant@plt>
mov    $0x0,%al
call   1040 <handOpen@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<catapult>:
push   %rax
mov    $0xaa,%edi
call   1050 <armRaiseSafe@plt>
mov    $0x4b,%edi
call   1030 <armRaiseInstant@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <handOpen@plt>

LLVM IR (-O0):
define void @catapult() {
%1 = call i32 @armRaiseSafe(i32 170)
%2 = call i32 @armRaiseInstant(i32 75)
%3 = call i32 (...) @handOpen()
ret void
}

LLVM IR (-O2):
define void @catapult() {
%1 = tail call i32 @armRaiseSafe(i32 170)
%2 = tail call i32 @armRaiseInstant(i32 75)
%3 = tail call i32 (...) @handOpen()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ clock_t;

/* Variables and functions */
int clock();
void grt_get_times(int *wall, int *user, int *sys) {
  clock_t res;
  *wall = clock();
  *user = 0;
  *sys = 0;
}


x86 assembly (clang, -O0):
<grt_get_times>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0x0,%al
call   1030 <clock@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x18(%rbp),%rax
movl   $0x0,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<grt_get_times>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <clock@plt>
mov    %eax,(%rbx)
movl   $0x0,(%r15)
movl   $0x0,(%r14)
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @grt_get_times(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
%8 = call i32 (...) @clock()
%9 = load i32*, i32** %4
store i32 %8, i32* %9
%10 = load i32*, i32** %5
store i32 0, i32* %10
%11 = load i32*, i32** %6
store i32 0, i32* %11
ret void
}

LLVM IR (-O2):
define void @grt_get_times(i32* nocapture writeonly %0, i32* nocapture writeonly %1, i32* nocapture writeonly %2) {
%4 = tail call i32 (...) @clock()
store i32 %4, i32* %0
store i32 0, i32* %1
store i32 0, i32* %2
ret void
}
int qpnp_misc_irqs_available(struct device *consumer_dev) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.device = type opaque
define i32 @qpnp_misc_irqs_available(%struct.device* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
char *build_date();
char *build_time();
int /*<<< orphan*/ printf(char *, char *, char *);
void print_build_time() {
  printf("SO Build Time: "
         "%s %s\n",
         build_date(), build_time());
}


x86 assembly (clang, -O0):
<print_build_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <build_date@plt>
mov    %rax,-0x8(%rbp)
mov    $0x0,%al
call   1040 <build_time@plt>
mov    -0x8(%rbp),%rsi
mov    %rax,%rdx
lea    0xea8(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_build_time>:
push   %rbx
xor    %eax,%eax
call   1050 <build_date@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1040 <build_time@plt>
lea    0xeb7(%rip),%rdi
mov    %rbx,%rsi
mov    %rax,%rdx
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"SO Build Time: %s %s\0A\00"
define void @print_build_time() {
%1 = call i8* (...) @build_date()
%2 = call i8* (...) @build_time()
%3 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %2)
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c"SO Build Time: %s %s\0A\00"
define void @print_build_time() {
%1 = tail call i8* (...) @build_date()
%2 = tail call i8* (...) @build_time()
%3 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void free_allocated_memory(void *pointer_to_free) {
  if (pointer_to_free)
    free(pointer_to_free);
}


x86 assembly (clang, -O0):
<free_allocated_memory>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <free_allocated_memory+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_allocated_memory>:
test   %rdi,%rdi
je     111a <free_allocated_memory+0xa>
jmp    1030 <free@plt>
ret

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

LLVM IR (-O2):
define void @free_allocated_memory(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i8* %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Variables and functions */
char *peek_param(int, char **);
char *next_param(int *argc, char ***argv) {
  char *param = peek_param(*argc, *argv);
  (*argc)--;
  (*argv)++;
  return param;
}


x86 assembly (clang, -O0):
<next_param>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
call   1030 <peek_param@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
add    $0xffffffff,%ecx
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%rcx
add    $0x8,%rcx
mov    %rcx,(%rax)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<next_param>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    (%rdi),%edi
mov    (%rsi),%rsi
call   1030 <peek_param@plt>
addl   $0xffffffff,(%rbx)
addq   $0x8,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @next_param(i32* %0, i8*** %1) {
%3 = alloca i32*
%4 = alloca i8***
%5 = alloca i8*
store i32* %0, i32** %3
store i8*** %1, i8**** %4
%6 = load i32*, i32** %3
%7 = load i32, i32* %6
%8 = load i8***, i8**** %4
%9 = load i8**, i8*** %8
%10 = call i8* @peek_param(i32 %7, i8** %9)
store i8* %10, i8** %5
%11 = load i32*, i32** %3
%12 = load i32, i32* %11
%13 = add nsw i32 %12, -1
store i32 %13, i32* %11
%14 = load i8***, i8**** %4
%15 = load i8**, i8*** %14
%16 = getelementptr inbounds i8*, i8** %15, i32 1
store i8** %16, i8*** %14
%17 = load i8*, i8** %5
ret i8* %17
}

LLVM IR (-O2):
define i8* @next_param(i32* nocapture %0, i8*** nocapture %1) {
%3 = load i32, i32* %0
%4 = load i8**, i8*** %1
%5 = tail call i8* @peek_param(i32 %3, i8** %4)
%6 = load i32, i32* %0
%7 = add nsw i32 %6, -1
store i32 %7, i32* %0
%8 = load i8**, i8*** %1
%9 = getelementptr inbounds i8*, i8** %8, i64 1
store i8** %9, i8*** %1
ret i8* %5
}
int get_DecScale(unsigned char *pds) {
  return (int)(((1 - (int)((unsigned)(pds[26] & 0x80) >> 6)) *
                (int)(((pds[26] & 0x7f) << 8) + pds[27])));
}


x86 assembly (clang, -O0):
<get_DecScale>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x1a(%rax),%ecx
and    $0x80,%ecx
shr    $0x6,%ecx
mov    $0x1,%eax
sub    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x1a(%rcx),%ecx
and    $0x7f,%ecx
shl    $0x8,%ecx
mov    -0x8(%rbp),%rdx
movzbl 0x1b(%rdx),%edx
add    %edx,%ecx
imul   %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_DecScale>:
movzbl 0x1a(%rdi),%ecx
mov    %ecx,%eax
shr    $0x6,%eax
and    $0xfffffffe,%eax
mov    $0x1,%edx
sub    %eax,%edx
and    $0x7f,%ecx
shl    $0x8,%ecx
movzbl 0x1b(%rdi),%eax
or     %ecx,%eax
imul   %edx,%eax
ret

LLVM IR (-O0):
define i32 @get_DecScale(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 26
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = and i32 %6, 128
%8 = lshr i32 %7, 6
%9 = sub nsw i32 1, %8
%10 = load i8*, i8** %2
%11 = getelementptr inbounds i8, i8* %10, i64 26
%12 = load i8, i8* %11
%13 = zext i8 %12 to i32
%14 = and i32 %13, 127
%15 = shl i32 %14, 8
%16 = load i8*, i8** %2
%17 = getelementptr inbounds i8, i8* %16, i64 27
%18 = load i8, i8* %17
%19 = zext i8 %18 to i32
%20 = add nsw i32 %15, %19
%21 = mul nsw i32 %9, %20
ret i32 %21
}

LLVM IR (-O2):
define i32 @get_DecScale(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 26
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = lshr i32 %4, 6
%6 = and i32 %5, 2
%7 = sub nsw i32 1, %6
%8 = shl nuw nsw i32 %4, 8
%9 = and i32 %8, 32512
%10 = getelementptr inbounds i8, i8* %0, i64 27
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = or i32 %9, %12
%14 = mul nsw i32 %7, %13
ret i32 %14
}
void init1() {
  long long A = 1LL << 60;
  short X = A;
}


x86 assembly (clang, -O0):
<init1>:
push   %rbp
mov    %rsp,%rbp
movabs $0x1000000000000000,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %ax,-0xa(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @init1() {
%1 = alloca i64
%2 = alloca i16
store i64 1152921504606846976, i64* %1
%3 = load i64, i64* %1
%4 = trunc i64 %3 to i16
store i16 %4, i16* %2
ret void
}

LLVM IR (-O2):
define void @init1() {
ret void
}
void break2() {}


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

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

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

LLVM IR (-O2):
define void @break2() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *, char *);
int /*<<< orphan*/ print_warning();
int /*<<< orphan*/ stderr;
void pbc_assert(int expr, char *msg, const char *func) {
  print_warning();
  if (!expr) {
    fprintf(stderr, "PBC assert failed: %s(): %s\n", func, msg);
    abort();
  }
}


x86 assembly (clang, -O0):
<pbc_assert>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0x0,%al
call   1040 <print_warning@plt>
cmpl   $0x0,-0x4(%rbp)
jne    1178 <pbc_assert+0x48>
mov    0x2e85(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    0xe94(%rip),%rsi
call   1050 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pbc_assert>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %edi,%ebp
xor    %eax,%eax
call   1040 <print_warning@plt>
test   %ebp,%ebp
je     114c <pbc_assert+0x1c>
pop    %rbx
pop    %r14
pop    %rbp
ret
mov    0x2e8d(%rip),%rax
mov    (%rax),%edi
lea    0xea4(%rip),%rsi
mov    %r14,%rdx
mov    %rbx,%rcx
call   1050 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [29 x i8] c"PBC assert failed: %s(): %s\0A\00"
define void @pbc_assert(i32 %0, i8* %1, i8* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
store i32 %0, i32* %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = call i32 (...) @print_warning()
%8 = load i32, i32* %4
%9 = icmp ne i32 %8, 0
br i1 %9, label %16, label %10
10: ; preds = %3
%11 = load i32, i32* @stderr
%12 = load i8*, i8** %6
%13 = load i8*, i8** %5
%14 = call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* %12, i8* %13)
%15 = call i32 (...) @abort()
unreachable
16: ; preds = %3
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [29 x i8] c"PBC assert failed: %s(): %s\0A\00"
define void @pbc_assert(i32 %0, i8* %1, i8* %2) {
%4 = tail call i32 (...) @print_warning()
%5 = icmp eq i32 %0, 0
br i1 %5, label %6, label %10
6: ; preds = %3
%7 = load i32, i32* @stderr
%8 = tail call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* %2, i8* %1)
%9 = tail call i32 (...) @abort()
unreachable
10: ; preds = %3
ret void
}
/* Variables and functions */
int errno;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *, int);
int /*<<< orphan*/ stderr;
void print_errno(char const *error_msg) {
  int errsv = errno;
  fprintf(stderr, "%s ERRONO: %i\n", error_msg, errsv);
}


x86 assembly (clang, -O0):
<print_errno>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2eb5(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    0x2eb1(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0xc(%rbp),%ecx
lea    0xec1(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_errno>:
mov    %rdi,%rdx
mov    0x2ebe(%rip),%rax
mov    (%rax),%ecx
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
lea    0xed4(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@errno = global i32 0
@stderr = global i32 0
@.str = [15 x i8] c"%s ERRONO: %i\0A\00"
define void @print_errno(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i32, i32* @errno
store i32 %4, i32* %3
%5 = load i32, i32* @stderr
%6 = load i8*, i8** %2
%7 = load i32, i32* %3
%8 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %6, i32 %7)
ret void
}

LLVM IR (-O2):
@errno = global i32 0
@stderr = global i32 0
@.str = [15 x i8] c"%s ERRONO: %i\0A\00"
define void @print_errno(i8* %0) {
%2 = load i32, i32* @errno
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %2)
ret void
}
void av_get_random_seed() {}


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

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

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

LLVM IR (-O2):
define void @av_get_random_seed() {
ret void
}
/* Variables and functions */
scalar_t__ atoi(char *);
int main(int argc, char const *argv[]) {
  char str[] = "a12";
  if (atoi(str) != 0) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xed4(%rip),%eax
mov    %eax,-0x14(%rbp)
lea    -0x14(%rbp),%rdi
call   1030 <atoi@plt>
cmp    $0x0,%rax
je     114e <main+0x3e>
movl   $0x1,-0x4(%rbp)
jmp    1155 <main+0x45>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@__const.main.str = [4 x i8] c"a12\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [4 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = bitcast [4 x i8]* %6 to i8*
%8 = getelementptr inbounds [4 x i8], [4 x i8]* %6, i64 0, i64 0
%9 = call i64 @atoi(i8* %8)
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %2
store i32 1, i32* %3
br label %13
12: ; preds = %2
store i32 0, i32* %3
br label %13
13: ; preds = %12, %11
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
@__const.main.str = [4 x i8] c"a12\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i64 @atoi(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @__const.main.str, i64 0, i64 0))
%4 = icmp ne i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ checkoutBranch(char const *);
int /*<<< orphan*/ mergeBranch(char const *, char const *, char const *);
int /*<<< orphan*/ pushToOrigin(char const *);
void mergeIntoAndPush(const char *from, const char *into, const char *type) {
  checkoutBranch(into);
  mergeBranch(from, type, into);
  pushToOrigin(into);
}


x86 assembly (clang, -O0):
<mergeIntoAndPush>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <checkoutBranch@plt>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1050 <mergeBranch@plt>
mov    -0x10(%rbp),%rdi
call   1040 <pushToOrigin@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mergeIntoAndPush>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %rdi,%r15
mov    %rsi,%rdi
call   1030 <checkoutBranch@plt>
mov    %r15,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1050 <mergeBranch@plt>
mov    %rbx,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <pushToOrigin@plt>

LLVM IR (-O0):
define void @mergeIntoAndPush(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %5
%8 = call i32 @checkoutBranch(i8* %7)
%9 = load i8*, i8** %4
%10 = load i8*, i8** %6
%11 = load i8*, i8** %5
%12 = call i32 @mergeBranch(i8* %9, i8* %10, i8* %11)
%13 = load i8*, i8** %5
%14 = call i32 @pushToOrigin(i8* %13)
ret void
}

LLVM IR (-O2):
define void @mergeIntoAndPush(i8* %0, i8* %1, i8* %2) {
%4 = tail call i32 @checkoutBranch(i8* %1)
%5 = tail call i32 @mergeBranch(i8* %0, i8* %2, i8* %1)
%6 = tail call i32 @pushToOrigin(i8* %1)
ret void
}
void swap_u_int_4(unsigned int *tni4) {
  *tni4 = (((*tni4 >> 24) & 0xff) | ((*tni4 & 0xff) << 24) |
           ((*tni4 >> 8) & 0xff00) | ((*tni4 & 0xff00) << 8));
}


x86 assembly (clang, -O0):
<swap_u_int_4>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
shr    $0x18,%ecx
and    $0xff,%ecx
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
and    $0xff,%eax
shl    $0x18,%eax
or     %eax,%ecx
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
shr    $0x8,%eax
and    $0xff00,%eax
or     %eax,%ecx
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
and    $0xff00,%eax
shl    $0x8,%eax
or     %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @swap_u_int_4(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = lshr i32 %4, 24
%6 = and i32 %5, 255
%7 = load i32*, i32** %2
%8 = load i32, i32* %7
%9 = and i32 %8, 255
%10 = shl i32 %9, 24
%11 = or i32 %6, %10
%12 = load i32*, i32** %2
%13 = load i32, i32* %12
%14 = lshr i32 %13, 8
%15 = and i32 %14, 65280
%16 = or i32 %11, %15
%17 = load i32*, i32** %2
%18 = load i32, i32* %17
%19 = and i32 %18, 65280
%20 = shl i32 %19, 8
%21 = or i32 %16, %20
%22 = load i32*, i32** %2
store i32 %21, i32* %22
ret void
}

LLVM IR (-O2):
define void @swap_u_int_4(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 @llvm.bswap.i32(i32 %2)
store i32 %3, i32* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Proc0();
int main() {
  Proc0();
  return (0);
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @Proc0()
ret i32 0
}
/* Type definitions */
struct sockaddr {
  int dummy;
};
typedef int /*<<< orphan*/ socklen_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
char *sock_ntop(struct sockaddr const *, int /*<<< orphan*/);
char *Sock_ntop(const struct sockaddr *sa, socklen_t salen) {
  char *ptr;
  if ((ptr = sock_ntop(sa, salen)) == NULL)
    printf("sock_ntop error\n");
  return (ptr);
}


x86 assembly (clang, -O0):
<Sock_ntop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <sock_ntop@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    1155 <Sock_ntop+0x35>
lea    0xeb0(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Sock_ntop>:
push   %rbx
call   1040 <sock_ntop@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113a <Sock_ntop+0x1a>
lea    0xecb(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.sockaddr = type { i32 }
@.str = [17 x i8] c"sock_ntop error\0A\00"
define i8* @Sock_ntop(%struct.sockaddr* %0, i32 %1) {
%3 = alloca %struct.sockaddr*
%4 = alloca i32
%5 = alloca i8*
store %struct.sockaddr* %0, %struct.sockaddr** %3
store i32 %1, i32* %4
%6 = load %struct.sockaddr*, %struct.sockaddr** %3
%7 = load i32, i32* %4
%8 = call i8* @sock_ntop(%struct.sockaddr* %6, i32 %7)
store i8* %8, i8** %5
%9 = icmp eq i8* %8, null
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
br label %12
12: ; preds = %10, %2
%13 = load i8*, i8** %5
ret i8* %13
}

LLVM IR (-O2):
%struct.sockaddr = type { i32 }
@str = [16 x i8] c"sock_ntop error\00"
define i8* @Sock_ntop(%struct.sockaddr* %0, i32 %1) {
%3 = tail call i8* @sock_ntop(%struct.sockaddr* %0, i32 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
br label %7
7: ; preds = %5, %2
ret i8* %3
}
double test_acos(double x) { return __builtin_acos(x); }


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

x86 assembly (clang, -O2):
<test_acos>:
jmp    1030 <acos@plt>

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

LLVM IR (-O2):
define double @test_acos(double %0) {
%2 = tail call double @acos(double %0)
ret double %2
}
char t(char n) {
  if (n == 'c' || n == 'f' || n == 's') {
    return n;
  } else {
    return 'v';
  }
}


x86 assembly (clang, -O0):
<t>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
cmp    $0x63,%eax
je     1131 <t+0x31>
movsbl -0x2(%rbp),%eax
cmp    $0x66,%eax
je     1131 <t+0x31>
movsbl -0x2(%rbp),%eax
cmp    $0x73,%eax
jne    113c <t+0x3c>
mov    -0x2(%rbp),%al
mov    %al,-0x1(%rbp)
jmp    1140 <t+0x40>
movb   $0x76,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<t>:
mov    %edi,%eax
lea    -0x63(%rax),%ecx
cmp    $0x10,%cl
ja     1119 <t+0x19>
movzbl %cl,%ecx
mov    $0x10009,%edx
bt     %rcx,%rdx
jae    1119 <t+0x19>
ret
mov    $0x76,%al
ret

LLVM IR (-O0):
define signext i8 @t(i8 signext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp eq i32 %5, 99
br i1 %6, label %15, label %7
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp eq i32 %9, 102
br i1 %10, label %15, label %11
11: ; preds = %7
%12 = load i8, i8* %3
%13 = sext i8 %12 to i32
%14 = icmp eq i32 %13, 115
br i1 %14, label %15, label %17
15: ; preds = %11, %7, %1
%16 = load i8, i8* %3
store i8 %16, i8* %2
br label %18
17: ; preds = %11
store i8 118, i8* %2
br label %18
18: ; preds = %17, %15
%19 = load i8, i8* %2
ret i8 %19
}

LLVM IR (-O2):
define signext i8 @t(i8 signext %0) {
switch i8 %0, label %2 [
i8 115, label %3
i8 102, label %3
i8 99, label %3
]
2: ; preds = %1
br label %3
3: ; preds = %1, %1, %1, %2
%4 = phi i8 [ 118, %2 ], [ %0, %1 ], [ %0, %1 ], [ %0, %1 ]
ret i8 %4
}
int test_imm_73uint64_lowword_reg(unsigned long long val) {
  return ((val) & (0x73 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_73uint64_lowword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
and    $0x73,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_73uint64_lowword_reg(i64 %0) {
%2 = and i64 %0, 115
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ GLint;
typedef int /*<<< orphan*/ GLenum;

/* Variables and functions */
int /*<<< orphan*/ __glGetMaterialfv_size(int /*<<< orphan*/);
GLint __glGetMaterialiv_size(GLenum pname) {
  return __glGetMaterialfv_size(pname);
}


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

x86 assembly (clang, -O2):
<__glGetMaterialiv_size>:
jmp    1030 <__glGetMaterialfv_size@plt>

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

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


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ SEEK_SET;
int /*<<< orphan*/ clearerr(int /*<<< orphan*/ *);
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, long, int /*<<< orphan*/);
void rewind(FILE *stream) {
  clearerr(stream);
  (void)fseek(stream, 0L, SEEK_SET);
  clearerr(stream);
}


x86 assembly (clang, -O0):
<rewind>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <clearerr@plt>
mov    -0x8(%rbp),%rdi
mov    0x2ea0(%rip),%rax
mov    (%rax),%edx
xor    %eax,%eax
mov    %eax,%esi
call   1040 <fseek@plt>
mov    -0x8(%rbp),%rdi
call   1030 <clearerr@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rewind>:
push   %rbx
mov    %rdi,%rbx
call   1030 <clearerr@plt>
mov    0x2eb0(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   1040 <fseek@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <clearerr@plt>

LLVM IR (-O0):
@SEEK_SET = global i32 0
define void @rewind(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @clearerr(i32* %3)
%5 = load i32*, i32** %2
%6 = load i32, i32* @SEEK_SET
%7 = call i32 @fseek(i32* %5, i64 0, i32 %6)
%8 = load i32*, i32** %2
%9 = call i32 @clearerr(i32* %8)
ret void
}

LLVM IR (-O2):
@SEEK_SET = global i32 0
define void @rewind(i32* nocapture %0) {
%2 = tail call i32 @clearerr(i32* %0)
%3 = load i32, i32* @SEEK_SET
%4 = tail call i32 @fseek(i32* %0, i64 0, i32 %3)
%5 = tail call i32 @clearerr(i32* %0)
ret void
}
int __nedf2(long long a1, long long a2) {
  return *(long long *)&a1 != *(long long *)&a2;
}


x86 assembly (clang, -O0):
<__nedf2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__nedf2>:
xor    %eax,%eax
cmp    %rsi,%rdi
setne  %al
ret

LLVM IR (-O0):
define i32 @__nedf2(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = icmp ne i64 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @__nedf2(i64 %0, i64 %1) {
%3 = icmp ne i64 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int uint64_t;

/* Variables and functions */
void enumerate_string(int indent, uint8_t *data) {
  if ((*(uint64_t *)data) & 0x8000000000000000) {
  } else {
  }
}


x86 assembly (clang, -O0):
<enumerate_string>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movslq (%rax),%rax
movabs $0x8000000000000000,%rcx
and    %rcx,%rax
cmp    $0x0,%rax
je     112e <enumerate_string+0x2e>
jmp    1133 <enumerate_string+0x33>
jmp    1133 <enumerate_string+0x33>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @enumerate_string(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* %5
%7 = sext i32 %6 to i64
%8 = and i64 %7, -9223372036854775808
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %2
br label %12
11: ; preds = %2
br label %12
12: ; preds = %11, %10
ret void
}

LLVM IR (-O2):
define void @enumerate_string(i32 %0, i32* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ perror(char const *);
void erreur(const char *err) {
  perror(err);
  exit(EXIT_FAILURE);
}


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

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

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

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
define void @erreur(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
%3 = load i32, i32* @EXIT_FAILURE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
float gb_floor(float x) {
  return (float)((x >= 0.0f) ? (int)x : (int)(x - 0.9999999999999999f));
}


x86 assembly (clang, -O0):
<gb_floor>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jb     1127 <gb_floor+0x27>
cvttss2si -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    113f <gb_floor+0x3f>
movss  -0x4(%rbp),%xmm0
movss  0xecc(%rip),%xmm1
subss  %xmm1,%xmm0
cvttss2si %xmm0,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cvtsi2ss %eax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<gb_floor>:
movss  0xef8(%rip),%xmm1
addss  %xmm0,%xmm1
xorps  %xmm2,%xmm2
cmpnless %xmm0,%xmm2
andps  %xmm2,%xmm1
andnps %xmm0,%xmm2
orps   %xmm1,%xmm2
cvttps2dq %xmm2,%xmm0
cvtdq2ps %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @gb_floor(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fcmp oge float %3, 0.000000e+00
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load float, float* %2
%7 = fptosi float %6 to i32
br label %12
8: ; preds = %1
%9 = load float, float* %2
%10 = fsub float %9, 1.000000e+00
%11 = fptosi float %10 to i32
br label %12
12: ; preds = %8, %5
%13 = phi i32 [ %7, %5 ], [ %11, %8 ]
%14 = sitofp i32 %13 to float
ret float %14
}

LLVM IR (-O2):
define float @gb_floor(float %0) {
%2 = fcmp ult float %0, 0.000000e+00
%3 = fadd float %0, -1.000000e+00
%4 = select i1 %2, float %3, float %0
%5 = fptosi float %4 to i32
%6 = sitofp i32 %5 to float
ret float %6
}
unsigned char unsignedchar_ignoring_longlongint(unsigned char x,
                                                long long int y) {
  return x;
}


x86 assembly (clang, -O0):
<unsignedchar_ignoring_longlongint>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
movzbl -0x1(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define zeroext i8 @unsignedchar_ignoring_longlongint(i8 zeroext %0, i64 %1) {
%3 = alloca i8
%4 = alloca i64
store i8 %0, i8* %3
store i64 %1, i64* %4
%5 = load i8, i8* %3
ret i8 %5
}

LLVM IR (-O2):
define zeroext i8 @unsignedchar_ignoring_longlongint(i8 returned zeroext %0, i64 %1) {
ret i8 %0
}
/* Type definitions */
struct statvfs {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
int statvfs(const char *path, struct statvfs *buf) {
  errno = ENOSYS;
  return -1;
}


x86 assembly (clang, -O0):
<statvfs>:
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):
<statvfs>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
%struct.statvfs = type { i32 }
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @statvfs(i8* nocapture readnone %0, %struct.statvfs* nocapture readnone %1) {
%3 = load i32, i32* @ENOSYS
store i32 %3, i32* @errno
ret i32 -1
}