xunge/DecIR huggingface dataset:
void get_options(void) { nsc_assert(0, __func__); }


x86 assembly (clang, -O0):
<get_options>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
lea    0xee3(%rip),%rsi
mov    $0x0,%al
call   1030 <nsc_assert@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_options>:
lea    0xee9(%rip),%rsi
xor    %edi,%edi
xor    %eax,%eax
jmp    1030 <nsc_assert@plt>

LLVM IR (-O0):
@__func__.get_options = [12 x i8] c"get_options\00"
define void @get_options() {
%1 = call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @__func__.get_options, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__func__.get_options = [12 x i8] c"get_options\00"
define void @get_options() {
%1 = tail call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @__func__.get_options, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ fd_set;

/* Variables and functions */
int /*<<< orphan*/ FD_SET(int, int /*<<< orphan*/ *);
int /*<<< orphan*/ FD_ZERO(int /*<<< orphan*/ *);
int select(int, int /*<<< orphan*/ *, int /*<<< orphan*/ *,
           int /*<<< orphan*/ *, int /*<<< orphan*/ *);
bool wait_connection(int fd) {
  fd_set fds;
  FD_ZERO(&fds);
  FD_SET(fd, &fds);
  return (select(fd + 1, &fds, NULL, NULL, NULL) == 1);
}


x86 assembly (clang, -O0):
<wait_connection>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x8(%rbp),%rdi
call   1030 <FD_ZERO@plt>
mov    -0x4(%rbp),%edi
lea    -0x8(%rbp),%rsi
call   1050 <FD_SET@plt>
mov    -0x4(%rbp),%edi
add    $0x1,%edi
lea    -0x8(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%r8d
mov    %r8,%rdx
mov    %r8,%rcx
call   1040 <select@plt>
cmp    $0x1,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wait_connection>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
lea    0x4(%rsp),%r14
mov    %r14,%rdi
call   1030 <FD_ZERO@plt>
mov    %ebx,%edi
mov    %r14,%rsi
call   1050 <FD_SET@plt>
add    $0x1,%ebx
mov    %ebx,%edi
mov    %r14,%rsi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
call   1040 <select@plt>
xor    %ecx,%ecx
cmp    $0x1,%eax
sete   %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @wait_connection(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = call i32 @FD_ZERO(i32* %3)
%5 = load i32, i32* %2
%6 = call i32 @FD_SET(i32 %5, i32* %3)
%7 = load i32, i32* %2
%8 = add nsw i32 %7, 1
%9 = call i32 @select(i32 %8, i32* %3, i32* null, i32* null, i32* null)
%10 = icmp eq i32 %9, 1
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @wait_connection(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @FD_ZERO(i32* %2)
%5 = call i32 @FD_SET(i32 %0, i32* %2)
%6 = add nsw i32 %0, 1
%7 = call i32 @select(i32 %6, i32* %2, i32* null, i32* null, i32* null)
%8 = icmp eq i32 %7, 1
%9 = zext i1 %8 to i32
ret i32 %9
}
int test_imm_F0uint64_midword_mem(unsigned long long *val) {
  return ((*val >> 16) & (0xF0 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_F0uint64_midword_mem>:
testb  $0xf0,0x2(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_F0uint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 15728640
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void tail_usage(void) { fprintf(stderr, "Usage: tail [ -n num] filename\n"); }


x86 assembly (clang, -O0):
<tail_usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<tail_usage>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [32 x i8] c"Usage: tail [ -n num] filename\0A\00"
define void @tail_usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [32 x i8] c"Usage: tail [ -n num] filename\0A\00"
define void @tail_usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
unsigned int sad_mx_n_c(unsigned char const *, int, unsigned char const *, int,
                        unsigned int, int, int);
unsigned int vp8_sad4x4_c(const unsigned char *src_ptr, int src_stride,
                          const unsigned char *ref_ptr, int ref_stride,
                          unsigned int max_sad) {
  return sad_mx_n_c(src_ptr, src_stride, ref_ptr, ref_stride, max_sad, 4, 4);
}


x86 assembly (clang, -O0):
<vp8_sad4x4_c>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8d,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
mov    -0x20(%rbp),%r8d
mov    $0x4,%r9d
movl   $0x4,(%rsp)
call   1030 <sad_mx_n_c@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vp8_sad4x4_c>:
push   %rax
movl   $0x4,(%rsp)
mov    $0x4,%r9d
call   1030 <sad_mx_n_c@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @vp8_sad4x4_c(i8* %0, i32 %1, i8* %2, i32 %3, i32 %4) {
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i32
store i8* %0, i8** %6
store i32 %1, i32* %7
store i8* %2, i8** %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = load i8*, i8** %6
%12 = load i32, i32* %7
%13 = load i8*, i8** %8
%14 = load i32, i32* %9
%15 = load i32, i32* %10
%16 = call i32 @sad_mx_n_c(i8* %11, i32 %12, i8* %13, i32 %14, i32 %15, i32 4, i32 4)
ret i32 %16
}

LLVM IR (-O2):
define i32 @vp8_sad4x4_c(i8* %0, i32 %1, i8* %2, i32 %3, i32 %4) {
%6 = tail call i32 @sad_mx_n_c(i8* %0, i32 %1, i8* %2, i32 %3, i32 %4, i32 4, i32 4)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ serial_debug_print(int, char *);
void log(char *buf) { serial_debug_print(4, buf); }


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

x86 assembly (clang, -O2):
<log>:
mov    %rdi,%rsi
mov    $0x4,%edi
jmp    1030 <serial_debug_print@plt>

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

LLVM IR (-O2):
define void @log(i8* %0) {
%2 = tail call i32 @serial_debug_print(i32 4, i8* %0)
ret void
}
void fme_eth_group_uinit(struct ifpga_feature *feature) { (void)(feature); }


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

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

LLVM IR (-O0):
%struct.ifpga_feature = type opaque
define void @fme_eth_group_uinit(%struct.ifpga_feature* %0) {
%2 = alloca %struct.ifpga_feature*
store %struct.ifpga_feature* %0, %struct.ifpga_feature** %2
%3 = load %struct.ifpga_feature*, %struct.ifpga_feature** %2
ret void
}

LLVM IR (-O2):
%struct.ifpga_feature = type opaque
define void @fme_eth_group_uinit(%struct.ifpga_feature* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("Hello from C");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%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
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [13 x i8] c"Hello from C\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ deinit();
int /*<<< orphan*/ init();
int /*<<< orphan*/ run();
int main() {
  init();
  run();
  deinit();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @init()
%2 = tail call i32 (...) @run()
%3 = tail call i32 (...) @deinit()
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ __u8;
typedef int /*<<< orphan*/ __u64;

/* Variables and functions */
int /*<<< orphan*/ __get_unaligned_le64(int /*<<< orphan*/ const *);
__u64 get_unaligned_le64(const void *p) {
  return __get_unaligned_le64((const __u8 *)p);
}


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

x86 assembly (clang, -O2):
<get_unaligned_le64>:
jmp    1030 <__get_unaligned_le64@plt>

LLVM IR (-O0):
define i32 @get_unaligned_le64(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to i32*
%5 = call i32 @__get_unaligned_le64(i32* %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @get_unaligned_le64(i8* %0) {
%2 = bitcast i8* %0 to i32*
%3 = tail call i32 @__get_unaligned_le64(i32* %2)
ret i32 %3
}
void swap_char(int a[], int pos1, int pos2) {
  int x;
  x = a[pos1];
  a[pos1] = a[pos2];
  a[pos2] = x;
}


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

x86 assembly (clang, -O2):
<swap_char>:
movslq %esi,%rax
mov    (%rdi,%rax,4),%ecx
movslq %edx,%rdx
mov    (%rdi,%rdx,4),%esi
mov    %esi,(%rdi,%rax,4)
mov    %ecx,(%rdi,%rdx,4)
ret

LLVM IR (-O0):
define void @swap_char(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 = load i32*, i32** %4
%9 = load i32, i32* %5
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i32, i32* %8, i64 %10
%12 = load i32, i32* %11
store i32 %12, i32* %7
%13 = load i32*, i32** %4
%14 = load i32, i32* %6
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i32, i32* %13, i64 %15
%17 = load i32, i32* %16
%18 = load i32*, i32** %4
%19 = load i32, i32* %5
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i32, i32* %18, i64 %20
store i32 %17, i32* %21
%22 = load i32, i32* %7
%23 = load i32*, i32** %4
%24 = load i32, i32* %6
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds i32, i32* %23, i64 %25
store i32 %22, i32* %26
ret void
}

LLVM IR (-O2):
define void @swap_char(i32* nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = load i32, i32* %5
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
store i32 %9, i32* %5
store i32 %6, i32* %8
ret void
}
int test_imm_FFuint64_highword_reg(unsigned long long val) {
  return ((val >> 32) & (0xFF << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_FFuint64_highword_reg>:
movabs $0xff00000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_FFuint64_highword_reg(i64 %0) {
%2 = and i64 %0, 1095216660480
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int test_func() { return 42; }


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

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

LLVM IR (-O0):
define i32 @test_func() {
ret i32 42
}

LLVM IR (-O2):
define i32 @test_func() {
ret i32 42
}
char *getPageOffset(char *segmentOff) {
  static char pageO[3] = {'\0'};
  int i;
  for (i = 0; i < 2; ++i) {
    pageO[i] = segmentOff[4 + i];
  }
  return pageO;
}


x86 assembly (clang, -O0):
<getPageOffset>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x2,-0xc(%rbp)
jge    1145 <getPageOffset+0x45>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    $0x4,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,1),%dl
movslq -0xc(%rbp),%rcx
lea    0x2eed(%rip),%rax
mov    %dl,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <getPageOffset+0xf>
lea    0x2ed5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getPageOffset>:
mov    0x4(%rdi),%al
mov    %al,0x2f18(%rip)
lea    0x2f11(%rip),%rax
mov    0x5(%rdi),%cl
mov    %cl,0x2f09(%rip)
ret

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

LLVM IR (-O2):
@getPageOffset.pageO = internal global [3 x i8] zeroinitializer
define i8* @getPageOffset(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 4
%3 = load i8, i8* %2
store i8 %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @getPageOffset.pageO, i64 0, i64 0)
%4 = getelementptr inbounds i8, i8* %0, i64 5
%5 = load i8, i8* %4
store i8 %5, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @getPageOffset.pageO, i64 0, i64 1)
ret i8* getelementptr inbounds ([3 x i8], [3 x i8]* @getPageOffset.pageO, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ EX_USAGE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void usage(const char *ident) {
  fprintf(stderr, "usage: %s [-qv]\n\t-q\tquiet\n\t-v\tverbose\n", ident);
  exit(EX_USAGE);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ea5(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rdx
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2ea8(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [39 x i8] c"usage: %s [-qv]\0A\09-q\09quiet\0A\09-v\09verbose\0A\00"
@EX_USAGE = global i32 0
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @EX_USAGE
%7 = call i32 @exit(i32 %6)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [39 x i8] c"usage: %s [-qv]\0A\09-q\09quiet\0A\09-v\09verbose\0A\00"
@EX_USAGE = global i32 0
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @EX_USAGE
%5 = tail call i32 @exit(i32 %4)
unreachable
}
XClipBox() {}


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

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

LLVM IR (-O0):
define i32 @XClipBox() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @XClipBox() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ test_basic_cb_comments();
int /*<<< orphan*/ test_basic_comment_entities();
int /*<<< orphan*/ test_basic_sb_comments();
void all_basic_tests() {
  test_basic_sb_comments();
  test_basic_cb_comments();
  test_basic_comment_entities();
}


x86 assembly (clang, -O0):
<all_basic_tests>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <test_basic_sb_comments@plt>
mov    $0x0,%al
call   1030 <test_basic_cb_comments@plt>
mov    $0x0,%al
call   1040 <test_basic_comment_entities@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<all_basic_tests>:
push   %rax
xor    %eax,%eax
call   1050 <test_basic_sb_comments@plt>
xor    %eax,%eax
call   1030 <test_basic_cb_comments@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <test_basic_comment_entities@plt>

LLVM IR (-O0):
define void @all_basic_tests() {
%1 = call i32 (...) @test_basic_sb_comments()
%2 = call i32 (...) @test_basic_cb_comments()
%3 = call i32 (...) @test_basic_comment_entities()
ret void
}

LLVM IR (-O2):
define void @all_basic_tests() {
%1 = tail call i32 (...) @test_basic_sb_comments()
%2 = tail call i32 (...) @test_basic_cb_comments()
%3 = tail call i32 (...) @test_basic_comment_entities()
ret void
}
/* Variables and functions */
void my_swap(void *a, void *b) {
  void *c;
  if (a == NULL || b == NULL)
    return;
  c = *(void **)a;
  *(void **)a = *(void **)b;
  *(void **)b = c;
}


x86 assembly (clang, -O0):
<my_swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1122 <my_swap+0x22>
cmpq   $0x0,-0x10(%rbp)
jne    1127 <my_swap+0x27>
jmp    114b <my_swap+0x4b>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x18(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_swap>:
test   %rdi,%rdi
je     1116 <my_swap+0x16>
test   %rsi,%rsi
je     1116 <my_swap+0x16>
mov    (%rdi),%rax
mov    (%rsi),%rcx
mov    %rcx,(%rdi)
mov    %rax,(%rsi)
ret

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

LLVM IR (-O2):
define void @my_swap(i8* %0, i8* %1) {
%3 = icmp eq i8* %0, null
%4 = icmp eq i8* %1, null
%5 = or i1 %3, %4
br i1 %5, label %11, label %6
6: ; preds = %2
%7 = bitcast i8* %0 to i8**
%8 = load i8*, i8** %7
%9 = bitcast i8* %1 to i8**
%10 = load i8*, i8** %9
store i8* %10, i8** %7
store i8* %8, i8** %9
br label %11
11: ; preds = %2, %6
ret void
}
/* Variables and functions */
int rand();
int main(int argc, char **argv) {
  int x, y;
  int r = rand();
  if (0 != r) {
    rand();
    y = rand();
    x = 42;
  } else {
    y = rand();
    x = 7;
  }
  return x;
}


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    $0x0,%al
call   1030 <rand@plt>
mov    %eax,-0x1c(%rbp)
xor    %eax,%eax
cmp    -0x1c(%rbp),%eax
je     1158 <main+0x48>
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0x0,%al
call   1030 <rand@plt>
mov    %eax,-0x18(%rbp)
movl   $0x2a,-0x14(%rbp)
jmp    1169 <main+0x59>
mov    $0x0,%al
call   1030 <rand@plt>
mov    %eax,-0x18(%rbp)
movl   $0x7,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1030 <rand@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <rand@plt>
test   %ebx,%ebx
je     1133 <main+0x23>
xor    %eax,%eax
call   1030 <rand@plt>
mov    $0x2a,%eax
pop    %rbx
ret
mov    $0x7,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @rand()
%4 = icmp eq i32 %3, 0
%5 = tail call i32 (...) @rand()
br i1 %4, label %8, label %6
6: ; preds = %2
%7 = tail call i32 (...) @rand()
br label %8
8: ; preds = %2, %6
%9 = phi i32 [ 42, %6 ], [ 7, %2 ]
ret i32 %9
}
/* Variables and functions */
char tolower(char);
void string_tolower(char *str) {
  for (int i = 0; str[i]; i++) {
    str[i] = tolower(str[i]);
  }
}


x86 assembly (clang, -O0):
<string_tolower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     1161 <string_tolower+0x51>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <tolower@plt>
mov    %al,%dl
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <string_tolower+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_tolower>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1136 <string_tolower+0x26>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <tolower@plt>
mov    %al,-0x1(%rbx)
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <string_tolower+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @string_tolower(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %5, %1
ret void
5: ; preds = %1, %5
%6 = phi i64 [ %10, %5 ], [ 0, %1 ]
%7 = phi i8 [ %12, %5 ], [ %2, %1 ]
%8 = phi i8* [ %11, %5 ], [ %0, %1 ]
%9 = tail call signext i8 @tolower(i8 signext %7)
store i8 %9, i8* %8
%10 = add nuw i64 %6, 1
%11 = getelementptr inbounds i8, i8* %0, i64 %10
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %4, label %5
}
/* Variables and functions */
int /*<<< orphan*/ outportb(int, int);
void remap_pic() {
  outportb(0x20, 0x11);
  outportb(0xA0, 0x11);
  outportb(0x21, 0x20);
  outportb(0xA1, 0x28);
  outportb(0x21, 0x04);
  outportb(0xA1, 0x02);
  outportb(0x21, 0x01);
  outportb(0xA1, 0x01);
  outportb(0x21, 0xfc);
  outportb(0xa1, 0xff);
}


x86 assembly (clang, -O0):
<remap_pic>:
push   %rbp
mov    %rsp,%rbp
mov    $0x20,%edi
mov    $0x11,%esi
call   1030 <outportb@plt>
mov    $0xa0,%edi
mov    $0x11,%esi
call   1030 <outportb@plt>
mov    $0x21,%edi
mov    $0x20,%esi
call   1030 <outportb@plt>
mov    $0xa1,%edi
mov    $0x28,%esi
call   1030 <outportb@plt>
mov    $0x21,%edi
mov    $0x4,%esi
call   1030 <outportb@plt>
mov    $0xa1,%edi
mov    $0x2,%esi
call   1030 <outportb@plt>
mov    $0x21,%edi
mov    $0x1,%esi
call   1030 <outportb@plt>
mov    $0xa1,%edi
mov    $0x1,%esi
call   1030 <outportb@plt>
mov    $0x21,%edi
mov    $0xfc,%esi
call   1030 <outportb@plt>
mov    $0xa1,%edi
mov    $0xff,%esi
call   1030 <outportb@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<remap_pic>:
push   %rax
mov    $0x20,%edi
mov    $0x11,%esi
call   1030 <outportb@plt>
mov    $0xa0,%edi
mov    $0x11,%esi
call   1030 <outportb@plt>
mov    $0x21,%edi
mov    $0x20,%esi
call   1030 <outportb@plt>
mov    $0xa1,%edi
mov    $0x28,%esi
call   1030 <outportb@plt>
mov    $0x21,%edi
mov    $0x4,%esi
call   1030 <outportb@plt>
mov    $0xa1,%edi
mov    $0x2,%esi
call   1030 <outportb@plt>
mov    $0x21,%edi
mov    $0x1,%esi
call   1030 <outportb@plt>
mov    $0xa1,%edi
mov    $0x1,%esi
call   1030 <outportb@plt>
mov    $0x21,%edi
mov    $0xfc,%esi
call   1030 <outportb@plt>
mov    $0xa1,%edi
mov    $0xff,%esi
pop    %rax
jmp    1030 <outportb@plt>

LLVM IR (-O0):
define void @remap_pic() {
%1 = call i32 @outportb(i32 32, i32 17)
%2 = call i32 @outportb(i32 160, i32 17)
%3 = call i32 @outportb(i32 33, i32 32)
%4 = call i32 @outportb(i32 161, i32 40)
%5 = call i32 @outportb(i32 33, i32 4)
%6 = call i32 @outportb(i32 161, i32 2)
%7 = call i32 @outportb(i32 33, i32 1)
%8 = call i32 @outportb(i32 161, i32 1)
%9 = call i32 @outportb(i32 33, i32 252)
%10 = call i32 @outportb(i32 161, i32 255)
ret void
}

LLVM IR (-O2):
define void @remap_pic() {
%1 = tail call i32 @outportb(i32 32, i32 17)
%2 = tail call i32 @outportb(i32 160, i32 17)
%3 = tail call i32 @outportb(i32 33, i32 32)
%4 = tail call i32 @outportb(i32 161, i32 40)
%5 = tail call i32 @outportb(i32 33, i32 4)
%6 = tail call i32 @outportb(i32 161, i32 2)
%7 = tail call i32 @outportb(i32 33, i32 1)
%8 = tail call i32 @outportb(i32 161, i32 1)
%9 = tail call i32 @outportb(i32 33, i32 252)
%10 = tail call i32 @outportb(i32 161, i32 255)
ret void
}
int agc2cpu2(int Input) {
  if (0 != (02000000000 & Input))
    return (-(01777777777 & ~Input));
  else
    return (01777777777 & Input);
}


x86 assembly (clang, -O0):
<agc2cpu2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
and    $0x10000000,%ecx
xor    %eax,%eax
cmp    %ecx,%eax
je     1132 <agc2cpu2+0x32>
mov    -0x8(%rbp),%ecx
xor    $0xffffffff,%ecx
and    $0xfffffff,%ecx
xor    %eax,%eax
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    113d <agc2cpu2+0x3d>
mov    -0x8(%rbp),%eax
and    $0xfffffff,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<agc2cpu2>:
mov    %edi,%ecx
or     $0xf0000000,%ecx
add    $0x1,%ecx
mov    %edi,%eax
and    $0xfffffff,%eax
test   $0x10000000,%edi
cmovne %ecx,%eax
ret

LLVM IR (-O0):
define i32 @agc2cpu2(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = and i32 268435456, %4
%6 = icmp ne i32 0, %5
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load i32, i32* %3
%9 = xor i32 %8, -1
%10 = and i32 268435455, %9
%11 = sub nsw i32 0, %10
store i32 %11, i32* %2
br label %15
12: ; preds = %1
%13 = load i32, i32* %3
%14 = and i32 268435455, %13
store i32 %14, i32* %2
br label %15
15: ; preds = %12, %7
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
define i32 @agc2cpu2(i32 %0) {
%2 = and i32 %0, 268435456
%3 = icmp eq i32 %2, 0
%4 = or i32 %0, -268435456
%5 = add nsw i32 %4, 1
%6 = and i32 %0, 268435455
%7 = select i1 %3, i32 %6, i32 %5
ret i32 %7
}
int fun703() { return 703; }


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

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

LLVM IR (-O0):
define i32 @fun703() {
ret i32 703
}

LLVM IR (-O2):
define i32 @fun703() {
ret i32 703
}
/* Variables and functions */
int /*<<< orphan*/ helper_double_3_recursive(double *, int);
void helper_double_3(double *buf) { helper_double_3_recursive(buf, 3); }


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

x86 assembly (clang, -O2):
<helper_double_3>:
mov    $0x3,%esi
jmp    1030 <helper_double_3_recursive@plt>

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

LLVM IR (-O2):
define void @helper_double_3(double* %0) {
%2 = tail call i32 @helper_double_3_recursive(double* %0, i32 3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ list_free_func(void *, int /*<<< orphan*/ *);
void list_free2(void *me) { list_free_func(me, NULL); }


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

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

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

LLVM IR (-O2):
define void @list_free2(i8* %0) {
%2 = tail call i32 @list_free_func(i8* %0, i32* null)
ret void
}
void ltopandsecond() {}


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

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

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

LLVM IR (-O2):
define void @ltopandsecond() {
ret void
}
void ble_evt_connection_raw_rx(
    const struct ble_msg_connection_raw_rx_evt_t *msg) {}


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

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

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

LLVM IR (-O2):
%struct.ble_msg_connection_raw_rx_evt_t = type opaque
define void @ble_evt_connection_raw_rx(%struct.ble_msg_connection_raw_rx_evt_t* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void explode_bomb(void) {
  printf("\nBOOM!!!\n");
  printf("The bomb has blown up.\n");
  exit(8);
}


x86 assembly (clang, -O0):
<explode_bomb>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
mov    $0x8,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<explode_bomb>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
lea    0xed5(%rip),%rdi
call   1030 <puts@plt>
mov    $0x8,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"\0ABOOM!!!\0A\00"
@.str.1 = [24 x i8] c"The bomb has blown up.\0A\00"
define void @explode_bomb() {
%1 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @exit(i32 8)
unreachable
}

LLVM IR (-O2):
@str = [9 x i8] c"\0ABOOM!!!\00"
@str.2 = [23 x i8] c"The bomb has blown up.\00"
define void @explode_bomb() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str.2, i64 0, i64 0))
%3 = tail call i32 @exit(i32 8)
unreachable
}
/* Variables and functions */
int atoi(char *);
int parseTime(char **buff, int len) {
  int result = 0;
  if (len >= 2) {
    result = atoi(buff[1]) * 10;
  }
  return result;
}


x86 assembly (clang, -O0):
<parseTime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x2,-0xc(%rbp)
jl     1143 <parseTime+0x33>
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <atoi@plt>
imul   $0xa,%eax,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parseTime>:
xor    %eax,%eax
cmp    $0x2,%esi
jl     112a <parseTime+0x1a>
push   %rax
mov    0x8(%rdi),%rdi
call   1030 <atoi@plt>
add    %eax,%eax
lea    (%rax,%rax,4),%eax
add    $0x8,%rsp
ret

LLVM IR (-O0):
define i32 @parseTime(i8** %0, i32 %1) {
%3 = alloca i8**
%4 = alloca i32
%5 = alloca i32
store i8** %0, i8*** %3
store i32 %1, i32* %4
store i32 0, i32* %5
%6 = load i32, i32* %4
%7 = icmp sge i32 %6, 2
br i1 %7, label %8, label %14
8: ; preds = %2
%9 = load i8**, i8*** %3
%10 = getelementptr inbounds i8*, i8** %9, i64 1
%11 = load i8*, i8** %10
%12 = call i32 @atoi(i8* %11)
%13 = mul nsw i32 %12, 10
store i32 %13, i32* %5
br label %14
14: ; preds = %8, %2
%15 = load i32, i32* %5
ret i32 %15
}

LLVM IR (-O2):
define i32 @parseTime(i8** nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 1
br i1 %3, label %4, label %9
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %0, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 @atoi(i8* %6)
%8 = mul nsw i32 %7, 10
br label %9
9: ; preds = %4, %2
%10 = phi i32 [ %8, %4 ], [ 0, %2 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ print(char *);
int /*<<< orphan*/ printid(char);
void main() {
  char b;
  b = 1 || 2 || 3 || 4;
  if (!b)
    print("b");
  print("b #");
  printid(b);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x1,-0x1(%rbp)
cmpb   $0x0,-0x1(%rbp)
jne    1142 <main+0x22>
lea    0xec3(%rip),%rdi
call   1030 <print@plt>
lea    0xeb9(%rip),%rdi
call   1030 <print@plt>
movsbl -0x1(%rbp),%edi
call   1040 <printid@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <print@plt>
mov    $0x1,%edi
pop    %rax
jmp    1040 <printid@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"b\00"
@.str.1 = [4 x i8] c"b #\00"
define void @main() {
%1 = alloca i8
store i8 1, i8* %1
%2 = load i8, i8* %1
%3 = icmp ne i8 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %0
%5 = call i32 @print(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %0
%7 = call i32 @print(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%8 = load i8, i8* %1
%9 = call i32 @printid(i8 signext %8)
ret void
}

LLVM IR (-O2):
@.str.1 = [4 x i8] c"b #\00"
define void @main() {
%1 = tail call i32 @print(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @printid(i8 signext 1)
ret void
}
double _and(const int numInputs, const double *inputs,
            const double *connectionWeights) {
  int i;
  for (i = 0; i < numInputs; i++) {
    if (inputs[i] == 0) {
      return 0;
    }
  }
  return 1;
}


x86 assembly (clang, -O0):
<_and>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1162 <_and+0x62>
mov    -0x18(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    114f <_and+0x4f>
jp     114f <_and+0x4f>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    116f <_and+0x6f>
jmp    1154 <_and+0x54>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1116 <_and+0x16>
movsd  0xe96(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<_and>:
movsd  0xef8(%rip),%xmm1
test   %edi,%edi
jle    1136 <_and+0x36>
mov    %edi,%eax
xor    %ecx,%ecx
xorpd  %xmm0,%xmm0
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsd  (%rsi,%rcx,8),%xmm2
ucomisd %xmm0,%xmm2
jne    112d <_and+0x2d>
jnp    113a <_and+0x3a>
add    $0x1,%rcx
cmp    %rcx,%rax
jne    1120 <_and+0x20>
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @_and(i32 %0, double* %1, double* %2) {
%4 = alloca double
%5 = alloca i32
%6 = alloca double*
%7 = alloca double*
%8 = alloca i32
store i32 %0, i32* %5
store double* %1, double** %6
store double* %2, double** %7
store i32 0, i32* %8
br label %9
9: ; preds = %22, %3
%10 = load i32, i32* %8
%11 = load i32, i32* %5
%12 = icmp slt i32 %10, %11
br i1 %12, label %13, label %25
13: ; preds = %9
%14 = load double*, double** %6
%15 = load i32, i32* %8
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds double, double* %14, i64 %16
%18 = load double, double* %17
%19 = fcmp oeq double %18, 0.000000e+00
br i1 %19, label %20, label %21
20: ; preds = %13
store double 0.000000e+00, double* %4
br label %26
21: ; preds = %13
br label %22
22: ; preds = %21
%23 = load i32, i32* %8
%24 = add nsw i32 %23, 1
store i32 %24, i32* %8
br label %9
25: ; preds = %9
store double 1.000000e+00, double* %4
br label %26
26: ; preds = %25, %20
%27 = load double, double* %4
ret double %27
}

LLVM IR (-O2):
define double @_and(i32 %0, double* nocapture %1, double* nocapture readnone %2) {
%4 = icmp sgt i32 %0, 0
br i1 %4, label %5, label %15
5: ; preds = %3
%6 = zext i32 %0 to i64
br label %9
7: ; preds = %9
%8 = icmp eq i64 %14, %6
br i1 %8, label %15, label %9
9: ; preds = %5, %7
%10 = phi i64 [ 0, %5 ], [ %14, %7 ]
%11 = getelementptr inbounds double, double* %1, i64 %10
%12 = load double, double* %11
%13 = fcmp oeq double %12, 0.000000e+00
%14 = add nuw nsw i64 %10, 1
br i1 %13, label %15, label %7
15: ; preds = %9, %7, %3
%16 = phi double [ 1.000000e+00, %3 ], [ 1.000000e+00, %7 ], [ 0.000000e+00, %9 ]
ret double %16
}
void nfs_fscache_install_vm_ops(struct inode *inode,
                                struct vm_area_struct *vma) {}


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

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

LLVM IR (-O0):
%struct.inode = type opaque
%struct.vm_area_struct = type opaque
define void @nfs_fscache_install_vm_ops(%struct.inode* %0, %struct.vm_area_struct* %1) {
%3 = alloca %struct.inode*
%4 = alloca %struct.vm_area_struct*
store %struct.inode* %0, %struct.inode** %3
store %struct.vm_area_struct* %1, %struct.vm_area_struct** %4
ret void
}

LLVM IR (-O2):
%struct.inode = type opaque
%struct.vm_area_struct = type opaque
define void @nfs_fscache_install_vm_ops(%struct.inode* nocapture %0, %struct.vm_area_struct* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ setZero();
void clear() { setZero(); }


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

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

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

LLVM IR (-O2):
define void @clear() {
%1 = tail call i32 (...) @setZero()
ret void
}
/* Variables and functions */
scalar_t__ M_PI_2;
float sinf(scalar_t__);
float cosf(float x) { return sinf(x + M_PI_2); }


x86 assembly (clang, -O0):
<cosf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
mov    0x2ebf(%rip),%rax
cvtsi2ssq (%rax),%xmm1
addss  %xmm1,%xmm0
cvttss2si %xmm0,%rdi
call   1030 <sinf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cosf>:
mov    0x2ed1(%rip),%rax
cvtsi2ssq (%rax),%xmm1
addss  %xmm0,%xmm1
cvttss2si %xmm1,%rdi
jmp    1030 <sinf@plt>

LLVM IR (-O0):
@M_PI_2 = global i64 0
define float @cosf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = load i64, i64* @M_PI_2
%5 = sitofp i64 %4 to float
%6 = fadd float %3, %5
%7 = fptosi float %6 to i64
%8 = call float @sinf(i64 %7)
ret float %8
}

LLVM IR (-O2):
@M_PI_2 = global i64 0
define float @cosf(float %0) {
%2 = load i64, i64* @M_PI_2
%3 = sitofp i64 %2 to float
%4 = fadd float %3, %0
%5 = fptosi float %4 to i64
%6 = tail call float @sinf(i64 %5)
ret float %6
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
void store_u16_little(void *mem, uint16_t val) {
  uint8_t *x = (uint8_t *)mem;
  x[0] = val & 0xff;
  val >>= 8;
  x[1] = val & 0xff;
}


x86 assembly (clang, -O0):
<store_u16_little>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%ecx
and    $0xff,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0xc(%rbp),%eax
sar    $0x8,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
and    $0xff,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,0x4(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<store_u16_little>:
mov    %esi,%eax
movzbl %al,%ecx
mov    %ecx,(%rdi)
movzbl %ah,%eax
mov    %eax,0x4(%rdi)
ret

LLVM IR (-O0):
define void @store_u16_little(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to i32*
store i32* %7, i32** %5
%8 = load i32, i32* %4
%9 = and i32 %8, 255
%10 = load i32*, i32** %5
%11 = getelementptr inbounds i32, i32* %10, i64 0
store i32 %9, i32* %11
%12 = load i32, i32* %4
%13 = ashr i32 %12, 8
store i32 %13, i32* %4
%14 = load i32, i32* %4
%15 = and i32 %14, 255
%16 = load i32*, i32** %5
%17 = getelementptr inbounds i32, i32* %16, i64 1
store i32 %15, i32* %17
ret void
}

LLVM IR (-O2):
define void @store_u16_little(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
%4 = and i32 %1, 255
store i32 %4, i32* %3
%5 = lshr i32 %1, 8
%6 = and i32 %5, 255
%7 = getelementptr inbounds i8, i8* %0, i64 4
%8 = bitcast i8* %7 to i32*
store i32 %6, i32* %8
ret void
}
double elevate(double x, int n) {
  int i;
  double number = 1.0;
  for (i = 0; i < n; i++) {
    number *= x;
  }
  return number;
}


x86 assembly (clang, -O0):
<elevate>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
movsd  0xeec(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1149 <elevate+0x49>
movsd  -0x8(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1120 <elevate+0x20>
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<elevate>:
test   %edi,%edi
jle    111b <elevate+0x1b>
lea    -0x1(%rdi),%ecx
mov    %edi,%eax
and    $0x7,%eax
cmp    $0x7,%ecx
jae    1124 <elevate+0x24>
movsd  0xee7(%rip),%xmm1
jmp    1155 <elevate+0x55>
movsd  0xedd(%rip),%xmm0
ret
and    $0xfffffff8,%edi
movsd  0xed1(%rip),%xmm1
nop
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
add    $0xfffffff8,%edi
jne    1130 <elevate+0x30>
test   %eax,%eax
je     1169 <elevate+0x69>
nopl   0x0(%rax)
mulsd  %xmm0,%xmm1
add    $0xffffffff,%eax
jne    1160 <elevate+0x60>
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @elevate(double %0, i32 %1) {
%3 = alloca double
%4 = alloca i32
%5 = alloca i32
%6 = alloca double
store double %0, double* %3
store i32 %1, i32* %4
store double 1.000000e+00, double* %6
store i32 0, i32* %5
br label %7
7: ; preds = %15, %2
%8 = load i32, i32* %5
%9 = load i32, i32* %4
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %18
11: ; preds = %7
%12 = load double, double* %3
%13 = load double, double* %6
%14 = fmul double %13, %12
store double %14, double* %6
br label %15
15: ; preds = %11
%16 = load i32, i32* %5
%17 = add nsw i32 %16, 1
store i32 %17, i32* %5
br label %7
18: ; preds = %7
%19 = load double, double* %6
ret double %19
}

LLVM IR (-O2):
define double @elevate(double %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %33
4: ; preds = %2
%5 = add i32 %1, -1
%6 = and i32 %1, 7
%7 = icmp ult i32 %5, 7
br i1 %7, label %23, label %8
8: ; preds = %4
%9 = and i32 %1, -8
br label %10
10: ; preds = %10, %8
%11 = phi double [ 1.000000e+00, %8 ], [ %20, %10 ]
%12 = phi i32 [ 0, %8 ], [ %21, %10 ]
%13 = fmul double %11, %0
%14 = fmul double %13, %0
%15 = fmul double %14, %0
%16 = fmul double %15, %0
%17 = fmul double %16, %0
%18 = fmul double %17, %0
%19 = fmul double %18, %0
%20 = fmul double %19, %0
%21 = add i32 %12, 8
%22 = icmp eq i32 %21, %9
br i1 %22, label %23, label %10
23: ; preds = %10, %4
%24 = phi double [ undef, %4 ], [ %20, %10 ]
%25 = phi double [ 1.000000e+00, %4 ], [ %20, %10 ]
%26 = icmp eq i32 %6, 0
br i1 %26, label %33, label %27
27: ; preds = %23, %27
%28 = phi double [ %30, %27 ], [ %25, %23 ]
%29 = phi i32 [ %31, %27 ], [ 0, %23 ]
%30 = fmul double %28, %0
%31 = add i32 %29, 1
%32 = icmp eq i32 %31, %6
br i1 %32, label %33, label %27
33: ; preds = %23, %27, %2
%34 = phi double [ 1.000000e+00, %2 ], [ %24, %23 ], [ %30, %27 ]
ret double %34
}
/* Variables and functions */
int /*<<< orphan*/ conio_init();
void caca_conio_textattr(int newattr) { conio_init(); }


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

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

LLVM IR (-O0):
define void @caca_conio_textattr(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @conio_init()
ret void
}

LLVM IR (-O2):
define void @caca_conio_textattr(i32 %0) {
%2 = tail call i32 (...) @conio_init()
ret void
}