xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ iscntrl(int);
void t_iscntrl_0x13() {
  Assert_real((iscntrl(19)),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_iscntrl.c",
              100, ("iscntrl should be 1 for 0x13"));
}


x86 assembly (clang, -O0):
<t_iscntrl_0x13>:
push   %rbp
mov    %rsp,%rbp
mov    $0x13,%edi
call   1030 <iscntrl@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0x64,%edx
lea    0xf65(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_iscntrl_0x13>:
push   %rax
mov    $0x13,%edi
call   1030 <iscntrl@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0x64,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_iscntrl.c\00"
@.str.1 = [29 x i8] c"iscntrl should be 1 for 0x13\00"
define void @t_iscntrl_0x13() {
%1 = call i32 @iscntrl(i32 19)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 100, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_iscntrl.c\00"
@.str.1 = [29 x i8] c"iscntrl should be 1 for 0x13\00"
define void @t_iscntrl_0x13() {
%1 = tail call i32 @iscntrl(i32 19)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 100, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
char getchar();
int /*<<< orphan*/ isalpha(char);
char toupper(char);
char get_input() {
  char input;
  while (!isalpha(input = getchar())) {
  }
  input = toupper(input);
  return (input);
}


x86 assembly (clang, -O0):
<get_input>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,-0x1(%rbp)
movsbl %al,%edi
call   1050 <isalpha@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    115f <get_input+0x2f>
jmp    1164 <get_input+0x34>
jmp    1138 <get_input+0x8>
movsbl -0x1(%rbp),%edi
call   1030 <toupper@plt>
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_input>:
push   %rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <getchar@plt>
movsbl %al,%ebx
mov    %ebx,%edi
call   1050 <isalpha@plt>
test   %eax,%eax
je     1140 <get_input+0x10>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <toupper@plt>

LLVM IR (-O0):
define signext i8 @get_input() {
%1 = alloca i8
br label %2
2: ; preds = %7, %0
%3 = call signext i8 (...) @getchar()
store i8 %3, i8* %1
%4 = call i32 @isalpha(i8 signext %3)
%5 = icmp ne i32 %4, 0
%6 = xor i1 %5, true
br i1 %6, label %7, label %8
7: ; preds = %2
br label %2
8: ; preds = %2
%9 = load i8, i8* %1
%10 = call signext i8 @toupper(i8 signext %9)
store i8 %10, i8* %1
%11 = load i8, i8* %1
ret i8 %11
}

LLVM IR (-O2):
define signext i8 @get_input() {
br label %1
1: ; preds = %1, %0
%2 = tail call signext i8 (...) @getchar()
%3 = tail call i32 @isalpha(i8 signext %2)
%4 = icmp eq i32 %3, 0
br i1 %4, label %1, label %5
5: ; preds = %1
%6 = tail call signext i8 @toupper(i8 signext %2)
ret i8 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int /*<<< orphan*/ vsprintf(char *, char *, int /*<<< orphan*/);
int xwrite(int, char *, int /*<<< orphan*/);
int xvdprintf(int d, char *f, va_list v) {
  static char buf[4096];
  return xwrite(d, buf, vsprintf(buf, f, v));
}


x86 assembly (clang, -O0):
<xvdprintf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
lea    0x2efa(%rip),%rdi
call   1040 <vsprintf@plt>
mov    -0x18(%rbp),%edi
mov    %eax,%edx
lea    0x2ee9(%rip),%rsi
call   1030 <xwrite@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xvdprintf>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
lea    0x2f13(%rip),%r14
mov    %r14,%rdi
call   1040 <vsprintf@plt>
mov    %ebx,%edi
mov    %r14,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <xwrite@plt>

LLVM IR (-O0):
@xvdprintf.buf = internal global [4096 x i8] zeroinitializer
define i32 @xvdprintf(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = call i32 @vsprintf(i8* getelementptr inbounds ([4096 x i8], [4096 x i8]* @xvdprintf.buf, i64 0, i64 0), i8* %8, i32 %9)
%11 = call i32 @xwrite(i32 %7, i8* getelementptr inbounds ([4096 x i8], [4096 x i8]* @xvdprintf.buf, i64 0, i64 0), i32 %10)
ret i32 %11
}

LLVM IR (-O2):
@xvdprintf.buf = internal global [4096 x i8] zeroinitializer
define i32 @xvdprintf(i32 %0, i8* nocapture %1, i32 %2) {
%4 = tail call i32 @vsprintf(i8* getelementptr inbounds ([4096 x i8], [4096 x i8]* @xvdprintf.buf, i64 0, i64 0), i8* %1, i32 %2)
%5 = tail call i32 @xwrite(i32 %0, i8* getelementptr inbounds ([4096 x i8], [4096 x i8]* @xvdprintf.buf, i64 0, i64 0), i32 %4)
ret i32 %5
}
/* Variables and functions */
int ZSTD_isError(size_t);
unsigned ZSTDv01_isError(size_t code) { return ZSTD_isError(code); }


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

x86 assembly (clang, -O2):
<ZSTDv01_isError>:
jmp    1030 <ZSTD_isError@plt>

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

LLVM IR (-O2):
define i32 @ZSTDv01_isError(i64 %0) {
%2 = tail call i32 @ZSTD_isError(i64 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, int);
int /*<<< orphan*/ stderr;
void c64_start_freq_cia_a_nmi(void) {
  fprintf(stderr, "Exit at %s: %d\n",
          "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
          "2022-01-22/02-19-57/repos/jgilje/reveller/refs/heads/master/"
          "sidstreamer/c64emu-support-serial.c",
          49);
  exit(1);
}


x86 assembly (clang, -O0):
<c64_start_freq_cia_a_nmi>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
lea    0xed5(%rip),%rdx
mov    $0x31,%ecx
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<c64_start_freq_cia_a_nmi>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
lea    0xed8(%rip),%rdx
mov    $0x31,%ecx
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [16 x i8] c"Exit at %s: %d\0A\00"
@.str.1 = [160 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/jgilje/reveller/refs/heads/master/sidstreamer/c64emu-support-serial.c\00"
define void @c64_start_freq_cia_a_nmi() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([160 x i8], [160 x i8]* @.str.1, i64 0, i64 0), i32 49)
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [16 x i8] c"Exit at %s: %d\0A\00"
@.str.1 = [160 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/jgilje/reveller/refs/heads/master/sidstreamer/c64emu-support-serial.c\00"
define void @c64_start_freq_cia_a_nmi() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([160 x i8], [160 x i8]* @.str.1, i64 0, i64 0), i32 49)
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ free(double *);
void free_double_line(double *line) {
  free(line);
  return;
}


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

x86 assembly (clang, -O2):
<free_double_line>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @free_double_line(double* nocapture %0) {
%2 = tail call i32 @free(double* %0)
ret void
}
/* Type definitions */
typedef int uint32_t;
typedef int int32_t;

/* Variables and functions */
int32_t complementBit_fun_int32_t(int32_t x, uint32_t i) { return x ^ 1 << i; }


x86 assembly (clang, -O0):
<complementBit_fun_int32_t>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
xor    %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @complementBit_fun_int32_t(i32 %0, i32 %1) {
%3 = shl nuw i32 1, %1
%4 = xor i32 %3, %0
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ MAP_HUGETLB;
int /*<<< orphan*/ mmap_chunks_higher(int, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void alloc_huge_above_hint(int chunks) {
  printf("Allocating hugepage chunks > 128TB \n");
  mmap_chunks_higher(chunks, MAP_HUGETLB);
}


x86 assembly (clang, -O0):
<alloc_huge_above_hint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%edi
mov    0x2eaf(%rip),%rax
mov    (%rax),%esi
call   1040 <mmap_chunks_higher@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<alloc_huge_above_hint>:
push   %rbx
mov    %edi,%ebx
lea    0xed6(%rip),%rdi
call   1030 <puts@plt>
mov    0x2eba(%rip),%rax
mov    (%rax),%esi
mov    %ebx,%edi
pop    %rbx
jmp    1040 <mmap_chunks_higher@plt>

LLVM IR (-O0):
@.str = [37 x i8] c"Allocating hugepage chunks > 128TB \0A\00"
@MAP_HUGETLB = global i32 0
define void @alloc_huge_above_hint(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* %2
%5 = load i32, i32* @MAP_HUGETLB
%6 = call i32 @mmap_chunks_higher(i32 %4, i32 %5)
ret void
}

LLVM IR (-O2):
@MAP_HUGETLB = global i32 0
@str = [36 x i8] c"Allocating hugepage chunks > 128TB \00"
define void @alloc_huge_above_hint(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str, i64 0, i64 0))
%3 = load i32, i32* @MAP_HUGETLB
%4 = tail call i32 @mmap_chunks_higher(i32 %0, i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int _usage(void) {
  fputs("Usage: "
        "uname"
        " [-snrvma]\n  -s	Operating system name\n  -n	Name of this "
        "node on the network\n  -r	Operating system release name\n  "
        "-v	Operating system version\n  -m	Hardware type\n  -a	All "
        "the options above\n",
        stderr);
  return 1;
}


x86 assembly (clang, -O0):
<_usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%esi
lea    0xedc(%rip),%rdi
call   1030 <fputs@plt>
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_usage>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%esi
lea    0xedf(%rip),%rdi
call   1030 <fputs@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [200 x i8] c"Usage: uname [-snrvma]\0A -s\09Operating system name\0A -n\09Name of this node on the network\0A -r\09Operating system release name\0A -v\09Operating system version\0A -m\09Hardware type\0A -a\09All the options above\0A\00"
@stderr = global i32 0
define i32 @_usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fputs(i8* getelementptr inbounds ([200 x i8], [200 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 1
}

LLVM IR (-O2):
@.str = [200 x i8] c"Usage: uname [-snrvma]\0A -s\09Operating system name\0A -n\09Name of this node on the network\0A -r\09Operating system release name\0A -v\09Operating system version\0A -m\09Hardware type\0A -a\09All the options above\0A\00"
@stderr = global i32 0
define i32 @_usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fputs(i8* getelementptr inbounds ([200 x i8], [200 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 1
}
void SobelRow_C() {}


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

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

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

LLVM IR (-O2):
define void @SobelRow_C() {
ret void
}
/* Type definitions */
typedef int pid_t;

/* Variables and functions */
pid_t octave_getpid_wrapper(void) { return -1; }


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

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

LLVM IR (-O0):
define i32 @octave_getpid_wrapper() {
ret i32 -1
}

LLVM IR (-O2):
define i32 @octave_getpid_wrapper() {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ crc16_b(unsigned int *, int /*<<< orphan*/);
unsigned int crc16_area(unsigned char *dbs, int size, unsigned int crc) {
  while (size--)
    crc16_b(&crc, *(dbs++));
  return crc;
}


x86 assembly (clang, -O0):
<crc16_area>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0xc(%rbp)
cmp    $0x0,%eax
je     1156 <crc16_area+0x46>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movzbl (%rax),%esi
lea    -0x10(%rbp),%rdi
call   1030 <crc16_b@plt>
jmp    1122 <crc16_area+0x12>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<crc16_area>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %edx,%eax
mov    %edx,0x4(%rsp)
test   %esi,%esi
je     114a <crc16_area+0x3a>
mov    %rdi,%r15
mov    %esi,%r12d
xor    %ebx,%ebx
lea    0x4(%rsp),%r14
nop
movzbl (%r15,%rbx,1),%esi
mov    %r14,%rdi
call   1030 <crc16_b@plt>
add    $0x1,%rbx
cmp    %ebx,%r12d
jne    1130 <crc16_area+0x20>
mov    0x4(%rsp),%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i32 @crc16_area(i8* nocapture %0, i32 %1, i32 %2) {
%4 = alloca i32
store i32 %2, i32* %4
%5 = icmp eq i32 %1, 0
br i1 %5, label %17, label %6
6: ; preds = %3, %6
%7 = phi i32 [ %9, %6 ], [ %1, %3 ]
%8 = phi i8* [ %10, %6 ], [ %0, %3 ]
%9 = add nsw i32 %7, -1
%10 = getelementptr inbounds i8, i8* %8, i64 1
%11 = load i8, i8* %8
%12 = zext i8 %11 to i32
%13 = call i32 @crc16_b(i32* %4, i32 %12)
%14 = icmp eq i32 %9, 0
br i1 %14, label %15, label %6
15: ; preds = %6
%16 = load i32, i32* %4
br label %17
17: ; preds = %15, %3
%18 = phi i32 [ %16, %15 ], [ %2, %3 ]
ret i32 %18
}
/* Type definitions */
struct cdb {
  int dummy;
};

/* Variables and functions */
void *cdb_get(struct cdb const *, unsigned int, unsigned int);
int /*<<< orphan*/ memcpy(void *, void const *, unsigned int);
int cdb_read(const struct cdb *cdbp, void *buf, unsigned len, unsigned pos) {
  const void *data = cdb_get(cdbp, len, pos);
  if (!data)
    return -1;
  memcpy(buf, data, len);
  return 0;
}


x86 assembly (clang, -O0):
<cdb_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    %ecx,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x1c(%rbp),%esi
mov    -0x20(%rbp),%edx
call   1040 <cdb_get@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
jne    1160 <cdb_read+0x40>
movl   $0xffffffff,-0x4(%rbp)
jmp    1177 <cdb_read+0x57>
mov    -0x18(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1030 <memcpy@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cdb_read>:
push   %r14
push   %rbx
push   %rax
mov    %edx,%ebx
mov    %rsi,%r14
mov    %edx,%esi
mov    %ecx,%edx
call   1040 <cdb_get@plt>
test   %rax,%rax
je     1148 <cdb_read+0x28>
mov    %r14,%rdi
mov    %rax,%rsi
mov    %ebx,%edx
call   1030 <memcpy@plt>
xor    %eax,%eax
jmp    114d <cdb_read+0x2d>
mov    $0xffffffff,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
%struct.cdb = type { i32 }
define i32 @cdb_read(%struct.cdb* %0, i8* %1, i32 %2, i32 %3) {
%5 = tail call i8* @cdb_get(%struct.cdb* %0, i32 %2, i32 %3)
%6 = icmp eq i8* %5, null
br i1 %6, label %9, label %7
7: ; preds = %4
%8 = tail call i32 @memcpy(i8* %1, i8* %5, i32 %2)
br label %9
9: ; preds = %4, %7
%10 = phi i32 [ 0, %7 ], [ -1, %4 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ foo(void *);
int iintplus(int x, int y) {
  x += 24;
  if (!x)
    foo((void *)0);
  return x;
}


x86 assembly (clang, -O0):
<iintplus>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x18,%eax
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    113a <iintplus+0x2a>
xor    %eax,%eax
mov    %eax,%edi
call   1030 <foo@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iintplus>:
push   %rbx
mov    %edi,%ebx
add    $0x18,%ebx
jne    111f <iintplus+0xf>
xor    %edi,%edi
call   1030 <foo@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @iintplus(i32 %0, i32 %1) {
%3 = add nsw i32 %0, 24
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @foo(i8* null)
br label %7
7: ; preds = %5, %2
ret i32 %3
}
int tolower(int c) {
  if (c >= 'A' && c <= 'Z')
    return (c + 32);
  else
    return c;
}


x86 assembly (clang, -O0):
<tolower>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x41,-0x8(%rbp)
jl     1129 <tolower+0x29>
cmpl   $0x5a,-0x8(%rbp)
jg     1129 <tolower+0x29>
mov    -0x8(%rbp),%eax
add    $0x20,%eax
mov    %eax,-0x4(%rbp)
jmp    112f <tolower+0x2f>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tolower>:
lea    -0x41(%rdi),%ecx
lea    0x20(%rdi),%eax
cmp    $0x1a,%ecx
cmovae %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @tolower(i32 %0) {
%2 = add i32 %0, -65
%3 = icmp ult i32 %2, 26
%4 = add nsw i32 %0, 32
%5 = select i1 %3, i32 %4, i32 %0
ret i32 %5
}
int test_imm_8Dint8_mem(signed char *val) {
  return ((*val) & (-0x8D << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_8Dint8_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edx
and    $0xffffff73,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_8Dint8_mem>:
movsbl (%rdi),%eax
test   $0xffffff73,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_8Dint8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = and i32 %5, -141
%7 = icmp ne i32 %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_8Dint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = sext i8 %2 to i32
%4 = and i32 %3, -141
%5 = icmp eq i32 %4, 0
%6 = select i1 %5, i32 -40, i32 -20
ret i32 %6
}
mlreply(prompt, buf, nbuf) char *prompt;
char *buf;
int nbuf;
{ return (nextarg(prompt, buf, nbuf, ctoec('\n'))); }


x86 assembly (clang, -O0):
<mlreply>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    $0xa,%edi
mov    $0x0,%al
call   1030 <ctoec@plt>
mov    -0x28(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x18(%rbp),%edx
mov    %eax,%ecx
mov    $0x0,%al
call   1040 <nextarg@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mlreply>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %rsi,%rbx
mov    %rdi,%rbp
mov    $0xa,%edi
xor    %eax,%eax
call   1030 <ctoec@plt>
mov    %rbp,%rdi
mov    %rbx,%rsi
mov    %r14d,%edx
mov    %eax,%ecx
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <nextarg@plt>

LLVM IR (-O0):
define i32 @mlreply(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = call i32 (i32, ...) bitcast (i32 (...)* @ctoec to i32 (i32, ...)*)(i32 10)
%11 = call i32 (i8*, i8*, i32, i32, ...) bitcast (i32 (...)* @nextarg to i32 (i8*, i8*, i32, i32, ...)*)(i8* %7, i8* %8, i32 %9, i32 %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @mlreply(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 (i32, ...) bitcast (i32 (...)* @ctoec to i32 (i32, ...)*)(i32 10)
%5 = tail call i32 (i8*, i8*, i32, i32, ...) bitcast (i32 (...)* @nextarg to i32 (i8*, i8*, i32, i32, ...)*)(i8* %0, i8* %1, i32 %2, i32 %4)
ret i32 %5
}
int test_imm_BDuint64_highword_mem(unsigned long long *val) {
  return ((*val >> 32) & (0xBD << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_BDuint64_highword_mem>:
testb  $0xbd,0x4(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_BDuint64_highword_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, 32
%6 = and i64 %5, 189
%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_BDuint64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 811748818944
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int test_imm_E0int64_lowword_reg(long long val) {
  return ((val) & (0xE0 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_E0int64_lowword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, 224
%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_E0int64_lowword_reg(i64 %0) {
%2 = and i64 %0, 224
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int convert_char_int(const char *arg) {}


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

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

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

LLVM IR (-O2):
define i32 @convert_char_int(i8* nocapture readnone %0) {
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ optval;

/* Variables and functions */
int /*<<< orphan*/ SOL_SOCKET;
int /*<<< orphan*/ SO_REUSEADDR;
int setsockopt(int, int /*<<< orphan*/, int /*<<< orphan*/, int *, int);
int setSocketReuseAddress(int socket) {
  int optval = 1;
  return setsockopt(socket, SOL_SOCKET, SO_REUSEADDR, &optval, sizeof(optval));
}


x86 assembly (clang, -O0):
<setSocketReuseAddress>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ebc(%rip),%rax
mov    (%rax),%esi
mov    0x2ea3(%rip),%rax
mov    (%rax),%edx
lea    -0x8(%rbp),%rcx
mov    $0x4,%r8d
call   1030 <setsockopt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setSocketReuseAddress>:
push   %rax
movl   $0x1,0x4(%rsp)
mov    0x2ec8(%rip),%rax
mov    (%rax),%esi
mov    0x2eaf(%rip),%rax
mov    (%rax),%edx
lea    0x4(%rsp),%rcx
mov    $0x4,%r8d
call   1030 <setsockopt@plt>
pop    %rcx
ret

LLVM IR (-O0):
@SOL_SOCKET = global i32 0
@SO_REUSEADDR = global i32 0
define i32 @setSocketReuseAddress(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 1, i32* %3
%4 = load i32, i32* %2
%5 = load i32, i32* @SOL_SOCKET
%6 = load i32, i32* @SO_REUSEADDR
%7 = call i32 @setsockopt(i32 %4, i32 %5, i32 %6, i32* %3, i32 4)
ret i32 %7
}

LLVM IR (-O2):
@SOL_SOCKET = global i32 0
@SO_REUSEADDR = global i32 0
define i32 @setSocketReuseAddress(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 1, i32* %2
%4 = load i32, i32* @SOL_SOCKET
%5 = load i32, i32* @SO_REUSEADDR
%6 = call i32 @setsockopt(i32 %0, i32 %4, i32 %5, i32* %2, i32 4)
ret i32 %6
}
unsigned int cpumask_check(unsigned int cpu) { return cpu; }


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

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

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

LLVM IR (-O2):
define i32 @cpumask_check(i32 returned %0) {
ret i32 %0
}
unsigned short SINT_TO_UINT(short var) {
  unsigned short newvar;
  if (var <= 0)
    newvar = 0;
  else
    newvar = (unsigned short)var;
  return newvar;
}


x86 assembly (clang, -O0):
<SINT_TO_UINT>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%eax
cmp    $0x0,%eax
jg     1123 <SINT_TO_UINT+0x23>
movw   $0x0,-0x4(%rbp)
jmp    112b <SINT_TO_UINT+0x2b>
mov    -0x2(%rbp),%ax
mov    %ax,-0x4(%rbp)
movzwl -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SINT_TO_UINT>:
xor    %eax,%eax
test   %di,%di
cmovns %edi,%eax
ret

LLVM IR (-O0):
define zeroext i16 @SINT_TO_UINT(i16 signext %0) {
%2 = alloca i16
%3 = alloca i16
store i16 %0, i16* %2
%4 = load i16, i16* %2
%5 = sext i16 %4 to i32
%6 = icmp sle i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i16 0, i16* %3
br label %10
8: ; preds = %1
%9 = load i16, i16* %2
store i16 %9, i16* %3
br label %10
10: ; preds = %8, %7
%11 = load i16, i16* %3
ret i16 %11
}

LLVM IR (-O2):
define zeroext i16 @SINT_TO_UINT(i16 signext %0) {
%2 = icmp sgt i16 %0, 0
%3 = select i1 %2, i16 %0, i16 0
ret i16 %3
}
int fun455() { return 455; }


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

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

LLVM IR (-O0):
define i32 @fun455() {
ret i32 455
}

LLVM IR (-O2):
define i32 @fun455() {
ret i32 455
}
/* Type definitions */
struct timespec {
  int dummy;
};
struct pollfd {
  int dummy;
};
typedef int /*<<< orphan*/ sigset_t;
typedef int /*<<< orphan*/ nfds_t;

/* Variables and functions */
int _NSIG;
int __ppoll(struct pollfd *, int /*<<< orphan*/, struct timespec const *,
            int /*<<< orphan*/ const *, int);
int ppoll(struct pollfd *fds, nfds_t nfds, const struct timespec *timeout,
          const sigset_t *sigmask) {
  return __ppoll(fds, nfds, timeout, sigmask, _NSIG / 8);
}


x86 assembly (clang, -O0):
<ppoll>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rcx
mov    0x2eaf(%rip),%rax
mov    (%rax),%eax
mov    $0x8,%r8d
cltd
idiv   %r8d
mov    -0x28(%rbp),%rdx
mov    %eax,%r8d
call   1030 <__ppoll@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ppoll>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%eax
lea    0x7(%rax),%r8d
test   %eax,%eax
cmovns %eax,%r8d
sar    $0x3,%r8d
jmp    1030 <__ppoll@plt>

LLVM IR (-O0):
%struct.pollfd = type { i32 }
%struct.timespec = type { i32 }
@_NSIG = global i32 0
define i32 @ppoll(%struct.pollfd* %0, i32 %1, %struct.timespec* %2, i32* %3) {
%5 = alloca %struct.pollfd*
%6 = alloca i32
%7 = alloca %struct.timespec*
%8 = alloca i32*
store %struct.pollfd* %0, %struct.pollfd** %5
store i32 %1, i32* %6
store %struct.timespec* %2, %struct.timespec** %7
store i32* %3, i32** %8
%9 = load %struct.pollfd*, %struct.pollfd** %5
%10 = load i32, i32* %6
%11 = load %struct.timespec*, %struct.timespec** %7
%12 = load i32*, i32** %8
%13 = load i32, i32* @_NSIG
%14 = sdiv i32 %13, 8
%15 = call i32 @__ppoll(%struct.pollfd* %9, i32 %10, %struct.timespec* %11, i32* %12, i32 %14)
ret i32 %15
}

LLVM IR (-O2):
%struct.pollfd = type { i32 }
%struct.timespec = type { i32 }
@_NSIG = global i32 0
define i32 @ppoll(%struct.pollfd* %0, i32 %1, %struct.timespec* %2, i32* %3) {
%5 = load i32, i32* @_NSIG
%6 = sdiv i32 %5, 8
%7 = tail call i32 @__ppoll(%struct.pollfd* %0, i32 %1, %struct.timespec* %2, i32* %3, i32 %6)
ret i32 %7
}
/* Variables and functions */
double log(int);
double log2(double num) { return log(num) / log(2); }


x86 assembly (clang, -O0):
<log2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
cvttsd2si -0x8(%rbp),%edi
call   1030 <log@plt>
movsd  %xmm0,-0x10(%rbp)
mov    $0x2,%edi
call   1030 <log@plt>
movaps %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
divsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log2>:
push   %rax
cvttsd2si %xmm0,%edi
call   1030 <log@plt>
movsd  %xmm0,(%rsp)
mov    $0x2,%edi
call   1030 <log@plt>
movsd  (%rsp),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @log2(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fptosi double %3 to i32
%5 = call double @log(i32 %4)
%6 = call double @log(i32 2)
%7 = fdiv double %5, %6
ret double %7
}

LLVM IR (-O2):
define double @log2(double %0) {
%2 = fptosi double %0 to i32
%3 = tail call double @log(i32 %2)
%4 = tail call double @log(i32 2)
%5 = fdiv double %3, %4
ret double %5
}
/* Variables and functions */
int EXIT_SUCCESS;
int main(int argc, char **argv) {
  unsigned short first = 52130;
  long long second = 8942492113;
  char third = -115;
  int fourth = 4825932;
  char fifth = 97;
  int sixth = -10000;
  unsigned long long seventh = -35982859328592389;
  return (EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movw   $0xcba2,-0x12(%rbp)
movabs $0x2150399d1,%rax
mov    %rax,-0x20(%rbp)
movb   $0x8d,-0x21(%rbp)
movl   $0x49a34c,-0x28(%rbp)
movb   $0x61,-0x29(%rbp)
movl   $0xffffd8f0,-0x30(%rbp)
movabs $0xff8029c7b3b765fb,%rax
29 80 ff
mov    %rax,-0x38(%rbp)
mov    0x2e8f(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i16
%7 = alloca i64
%8 = alloca i8
%9 = alloca i32
%10 = alloca i8
%11 = alloca i32
%12 = alloca i64
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i16 -13406, i16* %6
store i64 8942492113, i64* %7
store i8 -115, i8* %8
store i32 4825932, i32* %9
store i8 97, i8* %10
store i32 -10000, i32* %11
store i64 -35982859328592389, i64* %12
%13 = load i32, i32* @EXIT_SUCCESS
ret i32 %13
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @EXIT_SUCCESS
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ big32(int /*<<< orphan*/);
uint32_t big2host32(uint32_t n) { return big32(n); }


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

x86 assembly (clang, -O2):
<big2host32>:
jmp    1030 <big32@plt>

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

LLVM IR (-O2):
define i32 @big2host32(i32 %0) {
%2 = tail call i32 @big32(i32 %0)
ret i32 %2
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t tommy_inthash_u32(uint32_t key) {
  key -= key << 6;
  key ^= key >> 17;
  key -= key << 9;
  key ^= key << 4;
  key -= key << 3;
  key ^= key << 10;
  key ^= key >> 15;
  return key;
}


x86 assembly (clang, -O0):
<tommy_inthash_u32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
shl    $0x6,%ecx
mov    -0x4(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x11,%eax
xor    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
shl    $0x9,%ecx
mov    -0x4(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x4,%eax
xor    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
shl    $0x3,%ecx
mov    -0x4(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0xa,%eax
xor    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0xf,%eax
xor    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tommy_inthash_u32>:
mov    %edi,%eax
shl    $0x6,%eax
sub    %eax,%edi
mov    %edi,%ecx
sar    $0x11,%ecx
xor    %edi,%ecx
mov    %ecx,%eax
shl    $0x9,%eax
imul   $0xffffe010,%ecx,%edx
sub    %eax,%ecx
xor    %edx,%ecx
lea    0x0(,%rcx,8),%eax
imul   $0xffffe400,%ecx,%edx
sub    %eax,%ecx
xor    %edx,%ecx
mov    %ecx,%eax
sar    $0xf,%eax
xor    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @tommy_inthash_u32(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = shl i32 %3, 6
%5 = load i32, i32* %2
%6 = sub nsw i32 %5, %4
store i32 %6, i32* %2
%7 = load i32, i32* %2
%8 = ashr i32 %7, 17
%9 = load i32, i32* %2
%10 = xor i32 %9, %8
store i32 %10, i32* %2
%11 = load i32, i32* %2
%12 = shl i32 %11, 9
%13 = load i32, i32* %2
%14 = sub nsw i32 %13, %12
store i32 %14, i32* %2
%15 = load i32, i32* %2
%16 = shl i32 %15, 4
%17 = load i32, i32* %2
%18 = xor i32 %17, %16
store i32 %18, i32* %2
%19 = load i32, i32* %2
%20 = shl i32 %19, 3
%21 = load i32, i32* %2
%22 = sub nsw i32 %21, %20
store i32 %22, i32* %2
%23 = load i32, i32* %2
%24 = shl i32 %23, 10
%25 = load i32, i32* %2
%26 = xor i32 %25, %24
store i32 %26, i32* %2
%27 = load i32, i32* %2
%28 = ashr i32 %27, 15
%29 = load i32, i32* %2
%30 = xor i32 %29, %28
store i32 %30, i32* %2
%31 = load i32, i32* %2
ret i32 %31
}

LLVM IR (-O2):
define i32 @tommy_inthash_u32(i32 %0) {
%2 = mul i32 %0, -63
%3 = ashr i32 %2, 17
%4 = xor i32 %3, %2
%5 = mul i32 %4, -511
%6 = mul i32 %4, -8176
%7 = xor i32 %5, %6
%8 = mul i32 %7, -7
%9 = mul i32 %7, -7168
%10 = xor i32 %8, %9
%11 = ashr i32 %10, 15
%12 = xor i32 %11, %10
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void usage(char *prog) {
  printf("Usage: %s -k KEY -r ID:HOST:PORT [-r ID:HOST:PORT ...]\n", prog);
}


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

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

LLVM IR (-O0):
@.str = [56 x i8] c"Usage: %s -k KEY -r ID:HOST:PORT [-r ID:HOST:PORT ...]\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [56 x i8] c"Usage: %s -k KEY -r ID:HOST:PORT [-r ID:HOST:PORT ...]\0A\00"
define void @usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
typedef scalar_t__ int64_t;

/* Variables and functions */
int64_t min_s64(int64_t a, int64_t b) { return a < b ? a : b; }


x86 assembly (clang, -O0):
<min_s64>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jge    1127 <min_s64+0x27>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    112f <min_s64+0x2f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<min_s64>:
mov    %rsi,%rax
cmp    %rsi,%rdi
cmovl  %rdi,%rax
ret

LLVM IR (-O0):
define i64 @min_s64(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 slt i64 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i64, i64* %3
br label %12
10: ; preds = %2
%11 = load i64, i64* %4
br label %12
12: ; preds = %10, %8
%13 = phi i64 [ %9, %8 ], [ %11, %10 ]
ret i64 %13
}

LLVM IR (-O2):
define i64 @min_s64(i64 %0, i64 %1) {
%3 = icmp slt i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
ret i64 %4
}
/* Variables and functions */
char *memchr(char *, char, int);
int /*<<< orphan*/ printf(char *, char);
int main() {
  char *s = "apple";
  char c = 'l';
  char *p = memchr(s, c, 4);
  printf("%c\n", *p);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rax
mov    %rax,-0x10(%rbp)
movb   $0x6c,-0x11(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x11(%rbp),%al
movsbl %al,%esi
mov    $0x4,%edx
call   1040 <memchr@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
lea    0xea5(%rip),%rdi
movsbl (%rax),%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
mov    $0x6c,%esi
mov    $0x4,%edx
call   1040 <memchr@plt>
movsbl (%rax),%esi
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"apple\00"
@.str.1 = [4 x i8] c"%c\0A\00"
define i32 @main() {
%1 = tail call i8* @memchr(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8 signext 108, i32 4)
%2 = load i8, i8* %1
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8 signext %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ startTest();
int main(int argc, const char *argv[]) {
  startTest();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @startTest()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int _test_start(int argc, char **argv) {
  (void)argc;
  (void)argv;
  puts("START");
  return 0;
}


x86 assembly (clang, -O0):
<_test_start>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [6 x i8] c"START\00"
define i32 @_test_start(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int LOCK_EX;
int LOCK_NB;
int sw_flock(int, int);
int sw_nb_ex_flock(int fd) { return sw_flock(fd, LOCK_EX | LOCK_NB); }


x86 assembly (clang, -O0):
<sw_nb_ex_flock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ec3(%rip),%rax
mov    (%rax),%esi
mov    0x2ea2(%rip),%rax
or     (%rax),%esi
call   1030 <sw_flock@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sw_nb_ex_flock>:
mov    0x2ed1(%rip),%rax
mov    0x2eb2(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
jmp    1030 <sw_flock@plt>

LLVM IR (-O0):
@LOCK_EX = global i32 0
@LOCK_NB = global i32 0
define i32 @sw_nb_ex_flock(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @LOCK_EX
%5 = load i32, i32* @LOCK_NB
%6 = or i32 %4, %5
%7 = call i32 @sw_flock(i32 %3, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
@LOCK_EX = global i32 0
@LOCK_NB = global i32 0
define i32 @sw_nb_ex_flock(i32 %0) {
%2 = load i32, i32* @LOCK_EX
%3 = load i32, i32* @LOCK_NB
%4 = or i32 %3, %2
%5 = tail call i32 @sw_flock(i32 %0, i32 %4)
ret i32 %5
}
/* Variables and functions */
double atan(double);
double ml_atan(double x) { return atan(x); }


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

x86 assembly (clang, -O2):
<ml_atan>:
jmp    1030 <atan@plt>

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

LLVM IR (-O2):
define double @ml_atan(double %0) {
%2 = tail call double @atan(double %0)
ret double %2
}
void INT_P2(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_P2() {
ret void
}
void kasan_non_canonical_hook(unsigned long addr) {}


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

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

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

LLVM IR (-O2):
define void @kasan_non_canonical_hook(i64 %0) {
ret void
}