xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage(void) {
  printf("Demultiplex RADSeq runs.\n"
         "\nOptions:\n"
         "    [-h | --help] This help screen.\n"
         "    [-a | --one] FASTQ R1.\n"
         "    [-b | --two] FASTQ R2.\n"
         "    [-c | --index] FASTQ index read.\n"
         "    [-m | --mismatches] Number of allowed mismatches (default 1).\n"
         "    [-p | --output_prefix] Output filename prefix.\n"
         "    [-s | --p2_size] Size of P2 adaptor read (default 7).\n"
         "    [-v | --verbose] Verbose output.\n"
         "    [-z | --clip_psti] Clip PstI sequence too.\n"
         "    [-1 | --p1] p1 Adaptor file.\n"
         "    [-2 | --p2] p2 Adaptor file.\n"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [489 x i8] c"Demultiplex RADSeq runs.\0A\0AOptions:\0A [-h | --help] This help screen.\0A [-a | --one] FASTQ R1.\0A [-b | --two] FASTQ R2.\0A [-c | --index] FASTQ index read.\0A [-m | --mismatches] Number of allowed mismatches (default 1).\0A [-p | --output_prefix] Output filename prefix.\0A [-s | --p2_size] Size of P2 adaptor read (default 7).\0A [-v | --verbose] Verbose output.\0A [-z | --clip_psti] Clip PstI sequence too.\0A [-1 | --p1] p1 Adaptor file.\0A [-2 | --p2] p2 Adaptor file.\0A\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([489 x i8], [489 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [488 x i8] c"Demultiplex RADSeq runs.\0A\0AOptions:\0A [-h | --help] This help screen.\0A [-a | --one] FASTQ R1.\0A [-b | --two] FASTQ R2.\0A [-c | --index] FASTQ index read.\0A [-m | --mismatches] Number of allowed mismatches (default 1).\0A [-p | --output_prefix] Output filename prefix.\0A [-s | --p2_size] Size of P2 adaptor read (default 7).\0A [-v | --verbose] Verbose output.\0A [-z | --clip_psti] Clip PstI sequence too.\0A [-1 | --p1] p1 Adaptor file.\0A [-2 | --p2] p2 Adaptor file.\0A\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([488 x i8], [488 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
unsigned int etp_nreqs();
unsigned int eio_nreqs(void) { return etp_nreqs(); }


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

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

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

LLVM IR (-O2):
define i32 @eio_nreqs() {
%1 = tail call i32 (...) @etp_nreqs()
ret i32 %1
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char **argv) {
  int num = 1;
  while (num <= 100) {
    printf("%d\n", num);
    num = num + 1;
  }
  return (EXIT_SUCCESS);
}


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)
movl   $0x1,-0x14(%rbp)
cmpl   $0x64,-0x14(%rbp)
jg     1154 <main+0x44>
mov    -0x14(%rbp),%esi
lea    0xebf(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112d <main+0x1d>
mov    0x2e85(%rip),%rax
mov    (%rax),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0x1,%ebx
lea    0xee0(%rip),%r14
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0x1,%ebx
cmp    $0x65,%ebx
jne    1120 <main+0x10>
mov    0x2ea7(%rip),%rax
mov    (%rax),%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 1, i32* %6
br label %7
7: ; preds = %10, %2
%8 = load i32, i32* %6
%9 = icmp sle i32 %8, 100
br i1 %9, label %10, label %15
10: ; preds = %7
%11 = load i32, i32* %6
%12 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %11)
%13 = load i32, i32* %6
%14 = add nsw i32 %13, 1
store i32 %14, i32* %6
br label %7
15: ; preds = %7
%16 = load i32, i32* @EXIT_SUCCESS
ret i32 %16
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
br label %3
3: ; preds = %2, %3
%4 = phi i32 [ 1, %2 ], [ %6, %3 ]
%5 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = add nuw nsw i32 %4, 1
%7 = icmp eq i32 %6, 101
br i1 %7, label %8, label %3
8: ; preds = %3
%9 = load i32, i32* @EXIT_SUCCESS
ret i32 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
char *calloc(int, int);
size_t fread(char *, int, int, int /*<<< orphan*/ *);
char *load_file(FILE *file) {
  char *source = calloc(1024, 1);
  size_t bytes_read = fread(source, 1, 1024 - 1, file);
  source[bytes_read] = 0;
  return source;
}


x86 assembly (clang, -O0):
<load_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x400,%edi
mov    $0x1,%esi
call   1040 <calloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rcx
mov    $0x1,%esi
mov    $0x3ff,%edx
call   1030 <fread@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<load_file>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    $0x400,%edi
mov    $0x1,%esi
call   1040 <calloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    $0x1,%esi
mov    $0x3ff,%edx
mov    %r14,%rcx
call   1030 <fread@plt>
movb   $0x0,(%rbx,%rax,1)
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @load_file(i32* %0) {
%2 = alloca i32*
%3 = alloca i8*
%4 = alloca i64
store i32* %0, i32** %2
%5 = call i8* @calloc(i32 1024, i32 1)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = load i32*, i32** %2
%8 = call i64 @fread(i8* %6, i32 1, i32 1023, i32* %7)
store i64 %8, i64* %4
%9 = load i8*, i8** %3
%10 = load i64, i64* %4
%11 = getelementptr inbounds i8, i8* %9, i64 %10
store i8 0, i8* %11
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
define noalias i8* @load_file(i32* nocapture %0) {
%2 = tail call dereferenceable_or_null(1024) i8* @calloc(i32 1024, i32 1)
%3 = tail call i64 @fread(i8* %2, i32 1, i32 1023, i32* %0)
%4 = getelementptr inbounds i8, i8* %2, i64 %3
store i8 0, i8* %4
ret i8* %2
}
void p7_mpisupport_DoAbsolutelyNothing(void) { return; }


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

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

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

LLVM IR (-O2):
define void @p7_mpisupport_DoAbsolutelyNothing() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ findTheMaxProfit(int *, int);
int main() {
  int stock_prices[] = {10, 7, 5, 8, 11, 9};
  findTheMaxProfit(stock_prices, 6);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0xee1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xede(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xedb(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    -0x20(%rbp),%rdi
mov    $0x6,%esi
call   1030 <findTheMaxProfit@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
mov    0xef5(%rip),%rax
mov    %rax,0x10(%rsp)
movaps 0xed9(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x6,%esi
call   1030 <findTheMaxProfit@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.stock_prices = [6 x i32] [i32 10, i32 7, i32 5, i32 8, i32 11, i32 9]
define i32 @main() {
%1 = alloca [6 x i32]
%2 = bitcast [6 x i32]* %1 to i8*
%3 = getelementptr inbounds [6 x i32], [6 x i32]* %1, i64 0, i64 0
%4 = call i32 @findTheMaxProfit(i32* %3, i32 6)
ret i32 0
}

LLVM IR (-O2):
@__const.main.stock_prices = [6 x i32] [i32 10, i32 7, i32 5, i32 8, i32 11, i32 9]
define i32 @main() {
%1 = alloca [6 x i32]
%2 = bitcast [6 x i32]* %1 to i8*
%3 = getelementptr inbounds [6 x i32], [6 x i32]* %1, i64 0, i64 0
%4 = call i32 @findTheMaxProfit(i32* %3, i32 6)
ret i32 0
}
void stub_tx_flush(void) {}


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

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

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

LLVM IR (-O2):
define void @stub_tx_flush() {
ret void
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_mode;
};

/* Variables and functions */
scalar_t__ S_ISDIR(int /*<<< orphan*/);
scalar_t__ stat(char const *, struct stat *);
bool is_valid_dir(const char *dir) {
  struct stat s;
  return stat(dir, &s) == 0 && S_ISDIR(s.st_mode);
}


x86 assembly (clang, -O0):
<is_valid_dir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <stat@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x11(%rbp)
jne    115d <is_valid_dir+0x3d>
mov    -0x10(%rbp),%edi
call   1030 <S_ISDIR@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_valid_dir>:
push   %rax
mov    %rsp,%rsi
call   1040 <stat@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
je     1135 <is_valid_dir+0x15>
pop    %rcx
ret
mov    (%rsp),%edi
call   1030 <S_ISDIR@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @is_valid_dir(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.stat
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @stat(i8* %4, %struct.stat* %3)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = getelementptr inbounds %struct.stat, %struct.stat* %3, i32 0, i32 0
%9 = load i32, i32* %8
%10 = call i64 @S_ISDIR(i32 %9)
%11 = icmp ne i64 %10, 0
br label %12
12: ; preds = %7, %1
%13 = phi i1 [ false, %1 ], [ %11, %7 ]
%14 = zext i1 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @is_valid_dir(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %12
6: ; preds = %1
%7 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%8 = load i32, i32* %7
%9 = call i64 @S_ISDIR(i32 %8)
%10 = icmp ne i64 %9, 0
%11 = zext i1 %10 to i32
br label %12
12: ; preds = %6, %1
%13 = phi i32 [ 0, %1 ], [ %11, %6 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ exit(char);
int /*<<< orphan*/ printf(char *, char const *const, char const *const,
                          unsigned int);
void assertion(char const *const expr, char const *const file,
               unsigned int line) {
  printf("Assertion failed: %s, file %s, line %u", expr, file, line);
  exit('fail');
}


x86 assembly (clang, -O0):
<assertion>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
mov    $0x6c,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<assertion>:
push   %rax
mov    %edx,%ecx
mov    %rsi,%rdx
mov    %rdi,%rsi
lea    0xed0(%rip),%rdi
call   1030 <printf@plt>
mov    $0x6c,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [39 x i8] c"Assertion failed: %s, file %s, line %u\00"
define void @assertion(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 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i8* %7, i8* %8, i32 %9)
%11 = call i32 @exit(i8 signext 108)
unreachable
}

LLVM IR (-O2):
@.str = [39 x i8] c"Assertion failed: %s, file %s, line %u\00"
define void @assertion(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1, i32 %2)
%5 = tail call i32 @exit(i8 signext 108)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ CATCH_EINTR(int);
int errno;
int fchmod(int, int);
int os_mode_fd(int fd, int mode) {
  int err;
  CATCH_EINTR(err = fchmod(fd, mode));
  if (err < 0)
    return -errno;
  return 0;
}


x86 assembly (clang, -O0):
<os_mode_fd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <fchmod@plt>
mov    %eax,%edi
mov    %edi,-0x10(%rbp)
call   1040 <CATCH_EINTR@plt>
cmpl   $0x0,-0x10(%rbp)
jge    1160 <os_mode_fd+0x40>
xor    %eax,%eax
mov    0x2e8a(%rip),%rcx
sub    (%rcx),%eax
mov    %eax,-0x4(%rbp)
jmp    1167 <os_mode_fd+0x47>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<os_mode_fd>:
push   %rbx
call   1030 <fchmod@plt>
mov    %eax,%ebx
mov    %eax,%edi
call   1040 <CATCH_EINTR@plt>
mov    0x2eaa(%rip),%rax
xor    %ecx,%ecx
sub    (%rax),%ecx
sar    $0x1f,%ebx
and    %ecx,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@errno = global i32 0
define i32 @os_mode_fd(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = call i32 @fchmod(i32 %7, i32 %8)
store i32 %9, i32* %6
%10 = call i32 @CATCH_EINTR(i32 %9)
%11 = load i32, i32* %6
%12 = icmp slt i32 %11, 0
br i1 %12, label %13, label %16
13: ; preds = %2
%14 = load i32, i32* @errno
%15 = sub nsw i32 0, %14
store i32 %15, i32* %3
br label %17
16: ; preds = %2
store i32 0, i32* %3
br label %17
17: ; preds = %16, %13
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
@errno = global i32 0
define i32 @os_mode_fd(i32 %0, i32 %1) {
%3 = tail call i32 @fchmod(i32 %0, i32 %1)
%4 = tail call i32 @CATCH_EINTR(i32 %3)
%5 = icmp slt i32 %3, 0
%6 = load i32, i32* @errno
%7 = sub nsw i32 0, %6
%8 = select i1 %5, i32 %7, i32 0
ret i32 %8
}
void pimote_setup(void) {}


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

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

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

LLVM IR (-O2):
define void @pimote_setup() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ console_char(char);
int /*<<< orphan*/ print_uint32_base10(long);
void printInteger(long n) {
  if (n < 0) {
    console_char('-');
    n = -n;
  }
  print_uint32_base10(n);
}


x86 assembly (clang, -O0):
<printInteger>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jge    114b <printInteger+0x2b>
mov    $0x2d,%edi
call   1040 <console_char@plt>
xor    %eax,%eax
sub    -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <print_uint32_base10@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printInteger>:
push   %rbx
mov    %rdi,%rbx
test   %rdi,%rdi
jns    1136 <printInteger+0x16>
mov    $0x2d,%edi
call   1040 <console_char@plt>
neg    %rbx
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <print_uint32_base10@plt>

LLVM IR (-O0):
define void @printInteger(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp slt i64 %3, 0
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = call i32 @console_char(i8 signext 45)
%7 = load i64, i64* %2
%8 = sub nsw i64 0, %7
store i64 %8, i64* %2
br label %9
9: ; preds = %5, %1
%10 = load i64, i64* %2
%11 = call i32 @print_uint32_base10(i64 %10)
ret void
}

LLVM IR (-O2):
define void @printInteger(i64 %0) {
%2 = icmp slt i64 %0, 0
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = tail call i32 @console_char(i8 signext 45)
%5 = sub nsw i64 0, %0
br label %6
6: ; preds = %3, %1
%7 = phi i64 [ %5, %3 ], [ %0, %1 ]
%8 = tail call i32 @print_uint32_base10(i64 %7)
ret void
}
void pcp_print_net_eicmp6_stats(struct activity *a, int curr) {}


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

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

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

LLVM IR (-O2):
%struct.activity = type opaque
define void @pcp_print_net_eicmp6_stats(%struct.activity* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ glColor4f(float, float, float, int);
void glColor3f(float x, float y, float z) { glColor4f(x, y, z, 1); }


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

x86 assembly (clang, -O2):
<glColor3f>:
mov    $0x1,%edi
jmp    1030 <glColor4f@plt>

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

LLVM IR (-O2):
define void @glColor3f(float %0, float %1, float %2) {
%4 = tail call i32 @glColor4f(float %0, float %1, float %2, i32 1)
ret void
}
void g_type_class_add_private() {}


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

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

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

LLVM IR (-O2):
define void @g_type_class_add_private() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ I2C_SLAVE;
int /*<<< orphan*/ i2c_smbus_write_byte_data(int, int, int);
int /*<<< orphan*/ ioctl(int, int /*<<< orphan*/, char);
void pca9557_init(int fd, char addr) {
  ioctl(fd, I2C_SLAVE, addr);
  i2c_smbus_write_byte_data(fd, 0x02, 0x00);
}


x86 assembly (clang, -O0):
<pca9557_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %edi,-0x4(%rbp)
mov    %al,-0x5(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ead(%rip),%rax
mov    (%rax),%esi
movsbl -0x5(%rbp),%edx
call   1030 <ioctl@plt>
mov    -0x4(%rbp),%edi
mov    $0x2,%esi
xor    %edx,%edx
call   1040 <i2c_smbus_write_byte_data@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pca9557_init>:
push   %rbx
mov    %esi,%edx
mov    %edi,%ebx
mov    0x2ebc(%rip),%rax
mov    (%rax),%esi
call   1030 <ioctl@plt>
mov    %ebx,%edi
mov    $0x2,%esi
xor    %edx,%edx
pop    %rbx
jmp    1040 <i2c_smbus_write_byte_data@plt>

LLVM IR (-O0):
@I2C_SLAVE = global i32 0
define void @pca9557_init(i32 %0, i8 signext %1) {
%3 = alloca i32
%4 = alloca i8
store i32 %0, i32* %3
store i8 %1, i8* %4
%5 = load i32, i32* %3
%6 = load i32, i32* @I2C_SLAVE
%7 = load i8, i8* %4
%8 = call i32 @ioctl(i32 %5, i32 %6, i8 signext %7)
%9 = load i32, i32* %3
%10 = call i32 @i2c_smbus_write_byte_data(i32 %9, i32 2, i32 0)
ret void
}

LLVM IR (-O2):
@I2C_SLAVE = global i32 0
define void @pca9557_init(i32 %0, i8 signext %1) {
%3 = load i32, i32* @I2C_SLAVE
%4 = tail call i32 @ioctl(i32 %0, i32 %3, i8 signext %1)
%5 = tail call i32 @i2c_smbus_write_byte_data(i32 %0, i32 2, i32 0)
ret void
}
int test_imm_81int8_mem(signed char *val) {
  return ((*val) & (0x81 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_81int8_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, 129
%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_81int8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -127
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
async_write() {
  printf("Your system does not support async I/O\n");
  exit(171);
}


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

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

LLVM IR (-O0):
@.str = [40 x i8] c"Your system does not support async I/O\0A\00"
define i32 @async_write() {
%1 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 171)
unreachable
}

LLVM IR (-O2):
@str = [39 x i8] c"Your system does not support async I/O\00"
define i32 @async_write() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 171)
unreachable
}
void *test_anti_range_61(int n) {
  extern void *alloc_anti_range_61(int) __attribute__((alloc_size(1)));
  if (1 <= n && n <= 0x7fffffff)
    n = 1 - 1;
  return alloc_anti_range_61(n);
}


x86 assembly (clang, -O0):
<test_anti_range_61>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x1,%eax
cmp    -0x4(%rbp),%eax
jg     113d <test_anti_range_61+0x2d>
cmpl   $0x7fffffff,-0x4(%rbp)
jg     113d <test_anti_range_61+0x2d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <alloc_anti_range_61@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_anti_range_61>:
mov    %edi,%eax
sar    $0x1f,%eax
and    %eax,%edi
jmp    1030 <alloc_anti_range_61@plt>

LLVM IR (-O0):
define i8* @test_anti_range_61(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sle i32 1, %3
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 2147483647
br i1 %7, label %8, label %9
8: ; preds = %5
store i32 0, i32* %2
br label %9
9: ; preds = %8, %5, %1
%10 = load i32, i32* %2
%11 = call i8* @alloc_anti_range_61(i32 %10)
ret i8* %11
}

LLVM IR (-O2):
define i8* @test_anti_range_61(i32 %0) {
%2 = icmp slt i32 %0, 0
%3 = select i1 %2, i32 %0, i32 0
%4 = tail call i8* @alloc_anti_range_61(i32 %3)
ret i8* %4
}
int test_imm_FAint64_midword_reg(long long val) {
  return ((val >> 16) & (0xFA << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_FAint64_midword_reg>:
test   $0xfa0000,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_FAint64_midword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = ashr i64 %3, 16
%5 = and i64 %4, 250
%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_FAint64_midword_reg(i64 %0) {
%2 = and i64 %0, 16384000
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
signed char signedchar_ignoring_longint(signed char x, long int y) { return x; }


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

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

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

LLVM IR (-O2):
define signext i8 @signedchar_ignoring_longint(i8 returned signext %0, i64 %1) {
ret i8 %0
}
/* Variables and functions */
int /*<<< orphan*/ test_array();
int /*<<< orphan*/ test_buffer();
int /*<<< orphan*/ test_error();
int /*<<< orphan*/ test_graph();
int /*<<< orphan*/ test_hashes();
int /*<<< orphan*/ test_random();
int /*<<< orphan*/ test_skiplist();
int /*<<< orphan*/ test_string();
int /*<<< orphan*/ test_varint();
int main(int argv, char **argc) {
  test_buffer();
  test_array();
  test_string();
  test_graph();
  test_skiplist();
  test_error();
  test_random();
  test_hashes();
  test_varint();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1060 <test_buffer@plt>
mov    $0x0,%al
call   1090 <test_array@plt>
mov    $0x0,%al
call   1080 <test_string@plt>
mov    $0x0,%al
call   1070 <test_graph@plt>
mov    $0x0,%al
call   1050 <test_skiplist@plt>
mov    $0x0,%al
call   10a0 <test_error@plt>
mov    $0x0,%al
call   1030 <test_random@plt>
mov    $0x0,%al
call   10b0 <test_hashes@plt>
mov    $0x0,%al
call   1040 <test_varint@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1060 <test_buffer@plt>
xor    %eax,%eax
call   1090 <test_array@plt>
xor    %eax,%eax
call   1080 <test_string@plt>
xor    %eax,%eax
call   1070 <test_graph@plt>
xor    %eax,%eax
call   1050 <test_skiplist@plt>
xor    %eax,%eax
call   10a0 <test_error@plt>
xor    %eax,%eax
call   1030 <test_random@plt>
xor    %eax,%eax
call   10b0 <test_hashes@plt>
xor    %eax,%eax
call   1040 <test_varint@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 (...) @test_buffer()
%6 = call i32 (...) @test_array()
%7 = call i32 (...) @test_string()
%8 = call i32 (...) @test_graph()
%9 = call i32 (...) @test_skiplist()
%10 = call i32 (...) @test_error()
%11 = call i32 (...) @test_random()
%12 = call i32 (...) @test_hashes()
%13 = call i32 (...) @test_varint()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @test_buffer()
%4 = tail call i32 (...) @test_array()
%5 = tail call i32 (...) @test_string()
%6 = tail call i32 (...) @test_graph()
%7 = tail call i32 (...) @test_skiplist()
%8 = tail call i32 (...) @test_error()
%9 = tail call i32 (...) @test_random()
%10 = tail call i32 (...) @test_hashes()
%11 = tail call i32 (...) @test_varint()
ret i32 0
}
__attribute__((always_)) void exit_rcu(void) {}


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

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

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

LLVM IR (-O2):
define void @exit_rcu() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ panic(char *);
void __attribute__((noreturn)) __stack_chk_fail() {
  panic("Stack was smashed!");
}


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

x86 assembly (clang, -O2):
<__stack_chk_fail>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <panic@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"Stack was smashed!\00"
define void @__stack_chk_fail() {
%1 = call i32 @panic(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
unreachable
}

LLVM IR (-O2):
@.str = [19 x i8] c"Stack was smashed!\00"
define void @__stack_chk_fail() {
%1 = tail call i32 @panic(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ set_seg_desc(int, unsigned long, unsigned long, int, int,
                                int);
void set_code_seg(int no, unsigned long addr, unsigned long limit, int dpl) {
  set_seg_desc(no, addr, limit, 0x9A, 0x40, dpl);
}


x86 assembly (clang, -O0):
<set_code_seg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%r9d
mov    $0x9a,%ecx
mov    $0x40,%r8d
call   1030 <set_seg_desc@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_code_seg>:
mov    %ecx,%r9d
mov    $0x9a,%ecx
mov    $0x40,%r8d
jmp    1030 <set_seg_desc@plt>

LLVM IR (-O0):
define void @set_code_seg(i32 %0, i64 %1, i64 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i64
%7 = alloca i64
%8 = alloca i32
store i32 %0, i32* %5
store i64 %1, i64* %6
store i64 %2, i64* %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load i64, i64* %6
%11 = load i64, i64* %7
%12 = load i32, i32* %8
%13 = call i32 @set_seg_desc(i32 %9, i64 %10, i64 %11, i32 154, i32 64, i32 %12)
ret void
}

LLVM IR (-O2):
define void @set_code_seg(i32 %0, i64 %1, i64 %2, i32 %3) {
%5 = tail call i32 @set_seg_desc(i32 %0, i64 %1, i64 %2, i32 154, i32 64, i32 %3)
ret void
}
/* Variables and functions */
scalar_t__ memory_free(void *, char *, int);
int /*<<< orphan*/ slist_clear(void *, int /*<<< orphan*/ *);
void slist_release(void **L) {
  slist_clear(*L, NULL);
  ((void)(memory_free((void *)(*L),
                      "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                      "outputs/2022-01-22/02-19-57/repos/ASMlover/libc/refs/"
                      "heads/master/src/slist.c",
                      72),
          (*L) = 0));
}


x86 assembly (clang, -O0):
<slist_release>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1040 <slist_clear@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
lea    0xeb6(%rip),%rsi
mov    $0x48,%edx
call   1030 <memory_free@plt>
mov    -0x8(%rbp),%rax
movq   $0x0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<slist_release>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
xor    %esi,%esi
call   1040 <slist_clear@plt>
mov    (%rbx),%rdi
lea    0xec8(%rip),%rsi
mov    $0x48,%edx
call   1030 <memory_free@plt>
movq   $0x0,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
@.str = [134 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/ASMlover/libc/refs/heads/master/src/slist.c\00"
define void @slist_release(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i8**, i8*** %2
%4 = load i8*, i8** %3
%5 = call i32 @slist_clear(i8* %4, i32* null)
%6 = load i8**, i8*** %2
%7 = load i8*, i8** %6
%8 = call i64 @memory_free(i8* %7, i8* getelementptr inbounds ([134 x i8], [134 x i8]* @.str, i64 0, i64 0), i32 72)
%9 = load i8**, i8*** %2
store i8* null, i8** %9
ret void
}

LLVM IR (-O2):
@.str = [134 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/ASMlover/libc/refs/heads/master/src/slist.c\00"
define void @slist_release(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = tail call i32 @slist_clear(i8* %2, i32* null)
%4 = load i8*, i8** %0
%5 = tail call i64 @memory_free(i8* %4, i8* getelementptr inbounds ([134 x i8], [134 x i8]* @.str, i64 0, i64 0), i32 72)
store i8* null, i8** %0
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *support_retrieve_file(int);
FILE *fdopen(int fd, const char *mode) { return support_retrieve_file(fd); }


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

x86 assembly (clang, -O2):
<fdopen>:
jmp    1030 <support_retrieve_file@plt>

LLVM IR (-O0):
define i32* @fdopen(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 = call i32* @support_retrieve_file(i32 %5)
ret i32* %6
}

LLVM IR (-O2):
define i32* @fdopen(i32 %0, i8* nocapture readnone %1) {
%3 = tail call i32* @support_retrieve_file(i32 %0)
ret i32* %3
}
void html_reset_color(void) {}


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

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

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

LLVM IR (-O2):
define void @html_reset_color() {
ret void
}
void autonomous() {}


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

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

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

LLVM IR (-O2):
define void @autonomous() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ PCM_Reset(void *);
void device_reset_rf5c164(void *chip) { PCM_Reset(chip); }


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

x86 assembly (clang, -O2):
<device_reset_rf5c164>:
jmp    1030 <PCM_Reset@plt>

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

LLVM IR (-O2):
define void @device_reset_rf5c164(i8* %0) {
%2 = tail call i32 @PCM_Reset(i8* %0)
ret void
}
/* Type definitions */
struct s_map {
  int dummy;
};

/* Variables and functions */
void *mapGetKeyByID(struct s_map *, int const);
int memcmp(void *, void const *, int const);
int mapComparePrefixExt(struct s_map *map, const int id, const void *prefix,
                        const int prefixlen) {
  void *skey = mapGetKeyByID(map, id);
  return memcmp(skey, prefix, prefixlen);
}


x86 assembly (clang, -O0):
<mapComparePrefixExt>:
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    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <mapGetKeyByID@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1030 <memcmp@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mapComparePrefixExt>:
push   %rbp
push   %rbx
push   %rax
mov    %ecx,%ebp
mov    %rdx,%rbx
call   1040 <mapGetKeyByID@plt>
mov    %rax,%rdi
mov    %rbx,%rsi
mov    %ebp,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <memcmp@plt>

LLVM IR (-O0):
%struct.s_map = type { i32 }
define i32 @mapComparePrefixExt(%struct.s_map* %0, i32 %1, i8* %2, i32 %3) {
%5 = alloca %struct.s_map*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i8*
store %struct.s_map* %0, %struct.s_map** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%10 = load %struct.s_map*, %struct.s_map** %5
%11 = load i32, i32* %6
%12 = call i8* @mapGetKeyByID(%struct.s_map* %10, i32 %11)
store i8* %12, i8** %9
%13 = load i8*, i8** %9
%14 = load i8*, i8** %7
%15 = load i32, i32* %8
%16 = call i32 @memcmp(i8* %13, i8* %14, i32 %15)
ret i32 %16
}

LLVM IR (-O2):
%struct.s_map = type { i32 }
define i32 @mapComparePrefixExt(%struct.s_map* %0, i32 %1, i8* %2, i32 %3) {
%5 = tail call i8* @mapGetKeyByID(%struct.s_map* %0, i32 %1)
%6 = tail call i32 @memcmp(i8* %5, i8* %2, i32 %3)
ret i32 %6
}
char *rindex(const char *s, int c) {
  char *it = 0;
  while (1) {
    if (*s == c)
      it = (char *)s;
    if (*s == 0)
      return it;
    s++;
  }
}


x86 assembly (clang, -O0):
<rindex>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    -0xc(%rbp),%eax
jne    112b <rindex+0x2b>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1141 <rindex+0x41>
mov    -0x18(%rbp),%rax
pop    %rbp
ret
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1113 <rindex+0x13>

x86 assembly (clang, -O2):
<rindex>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsbl (%rdi),%ecx
cmp    %esi,%ecx
cmove  %rdi,%rax
add    $0x1,%rdi
test   %ecx,%ecx
jne    1110 <rindex+0x10>
ret

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

LLVM IR (-O2):
define i8* @rindex(i8* %0, i32 %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %11, %3 ]
%5 = phi i8* [ null, %2 ], [ %9, %3 ]
%6 = load i8, i8* %4
%7 = sext i8 %6 to i32
%8 = icmp eq i32 %7, %1
%9 = select i1 %8, i8* %4, i8* %5
%10 = icmp eq i8 %6, 0
%11 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %10, label %12, label %3
12: ; preds = %3
ret i8* %9
}
void invitation(struct battle_char *origin, struct battle_char *target) {}


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

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

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

LLVM IR (-O2):
%struct.battle_char = type opaque
define void @invitation(%struct.battle_char* nocapture %0, %struct.battle_char* nocapture %1) {
ret void
}
void WT_FULL_BARRIER(void) { return; }


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

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

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

LLVM IR (-O2):
define void @WT_FULL_BARRIER() {
ret void
}
/* Type definitions */
struct hlist_node {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ hlist_del_init(struct hlist_node *);
void hash_del(struct hlist_node *node) { hlist_del_init(node); }


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

x86 assembly (clang, -O2):
<hash_del>:
jmp    1030 <hlist_del_init@plt>

LLVM IR (-O0):
%struct.hlist_node = type { i32 }
define void @hash_del(%struct.hlist_node* %0) {
%2 = alloca %struct.hlist_node*
store %struct.hlist_node* %0, %struct.hlist_node** %2
%3 = load %struct.hlist_node*, %struct.hlist_node** %2
%4 = call i32 @hlist_del_init(%struct.hlist_node* %3)
ret void
}

LLVM IR (-O2):
%struct.hlist_node = type { i32 }
define void @hash_del(%struct.hlist_node* %0) {
%2 = tail call i32 @hlist_del_init(%struct.hlist_node* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;
typedef int /*<<< orphan*/ int32_t;
typedef scalar_t__ int16_t;

/* Variables and functions */
int /*<<< orphan*/ WriteUint16Le(int /*<<< orphan*/, void *);
int32_t WriteInt16Le(int16_t value, void *out) {
  return WriteUint16Le((uint16_t)value, out);
}


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

x86 assembly (clang, -O2):
<WriteInt16Le>:
jmp    1030 <WriteUint16Le@plt>

LLVM IR (-O0):
define i32 @WriteInt16Le(i64 %0, i8* %1) {
%3 = alloca i64
%4 = alloca i8*
store i64 %0, i64* %3
store i8* %1, i8** %4
%5 = load i64, i64* %3
%6 = trunc i64 %5 to i32
%7 = load i8*, i8** %4
%8 = call i32 @WriteUint16Le(i32 %6, i8* %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @WriteInt16Le(i64 %0, i8* %1) {
%3 = trunc i64 %0 to i32
%4 = tail call i32 @WriteUint16Le(i32 %3, i8* %1)
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ EXTENDED_KEY_USAGE;

/* Variables and functions */
int sk_ASN1_OBJECT_num(int /*<<< orphan*/ *);
int GetX509EkuFieldCount(EXTENDED_KEY_USAGE *eku) {
  return sk_ASN1_OBJECT_num(eku);
}


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

x86 assembly (clang, -O2):
<GetX509EkuFieldCount>:
jmp    1030 <sk_ASN1_OBJECT_num@plt>

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

LLVM IR (-O2):
define i32 @GetX509EkuFieldCount(i32* %0) {
%2 = tail call i32 @sk_ASN1_OBJECT_num(i32* %0)
ret i32 %2
}
/* Type definitions */
struct timespec {
  unsigned int tv_sec;
  scalar_t__ tv_nsec;
};

/* Variables and functions */
int /*<<< orphan*/ nanosleep(struct timespec *, struct timespec *);
unsigned int sleep(unsigned int secs) {
  struct timespec t;
  t.tv_sec = secs;
  t.tv_nsec = 0;
  nanosleep(&t, &t);
  return secs - t.tv_sec;
}


x86 assembly (clang, -O0):
<sleep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x18(%rbp)
movq   $0x0,-0x10(%rbp)
lea    -0x18(%rbp),%rsi
mov    %rsi,%rdi
call   1030 <nanosleep@plt>
mov    -0x4(%rbp),%eax
sub    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sleep>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
mov    %edi,(%rsp)
movq   $0x0,0x8(%rsp)
mov    %rsp,%rdi
mov    %rdi,%rsi
call   1030 <nanosleep@plt>
sub    (%rsp),%ebx
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.timespec = type { i32, i64 }
define i32 @sleep(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.timespec
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 0
store i32 %4, i32* %5
%6 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 1
store i64 0, i64* %6
%7 = call i32 @nanosleep(%struct.timespec* %3, %struct.timespec* %3)
%8 = load i32, i32* %2
%9 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 0
%10 = load i32, i32* %9
%11 = sub i32 %8, %10
ret i32 %11
}

LLVM IR (-O2):
%struct.timespec = type { i32, i64 }
define i32 @sleep(i32 %0) {
%2 = alloca %struct.timespec
%3 = bitcast %struct.timespec* %2 to i8*
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 0
store i32 %0, i32* %4
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 1
store i64 0, i64* %5
%6 = call i32 @nanosleep(%struct.timespec* %2, %struct.timespec* %2)
%7 = load i32, i32* %4
%8 = sub i32 %0, %7
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ source_location(int /*<<< orphan*/, char const *);
int /*<<< orphan*/ stderr;
int source_error(char const *location, char const *message) {
  source_location(stderr, location);
  fprintf(stderr, "%s\n", message);
  return 0;
}


x86 assembly (clang, -O0):
<source_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
call   1030 <source_location@plt>
mov    0x2e97(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
lea    0xeaa(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<source_error>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%rsi
mov    0x2eaf(%rip),%r14
mov    (%r14),%edi
call   1030 <source_location@plt>
mov    (%r14),%edi
lea    0xebd(%rip),%rsi
mov    %rbx,%rdx
call   1040 <fprintf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define i32 @source_error(i8* %0, i8* %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @source_location(i32 %3, i8* %0)
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void free_matrix(float **m, long nrl, long ncl) {
  free((char *)(m[nrl] + ncl - 1));
  free((char *)(m + nrl - 1));
}


x86 assembly (clang, -O0):
<free_matrix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
mov    -0x18(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdi
add    $0xfffffffffffffffc,%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rdi
add    $0xfffffffffffffff8,%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_matrix>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    (%rdi,%rsi,8),%rax
lea    (%rax,%rdx,4),%rdi
add    $0xfffffffffffffffc,%rdi
call   1030 <free@plt>
lea    (%rbx,%r14,8),%rdi
add    $0xfffffffffffffff8,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @free_matrix(float** %0, i64 %1, i64 %2) {
%4 = alloca float**
%5 = alloca i64
%6 = alloca i64
store float** %0, float*** %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%7 = load float**, float*** %4
%8 = load i64, i64* %5
%9 = getelementptr inbounds float*, float** %7, i64 %8
%10 = load float*, float** %9
%11 = load i64, i64* %6
%12 = getelementptr inbounds float, float* %10, i64 %11
%13 = getelementptr inbounds float, float* %12, i64 -1
%14 = bitcast float* %13 to i8*
%15 = call i32 @free(i8* %14)
%16 = load float**, float*** %4
%17 = load i64, i64* %5
%18 = getelementptr inbounds float*, float** %16, i64 %17
%19 = getelementptr inbounds float*, float** %18, i64 -1
%20 = bitcast float** %19 to i8*
%21 = call i32 @free(i8* %20)
ret void
}

LLVM IR (-O2):
define void @free_matrix(float** nocapture %0, i64 %1, i64 %2) {
%4 = getelementptr inbounds float*, float** %0, i64 %1
%5 = load float*, float** %4
%6 = getelementptr inbounds float, float* %5, i64 %2
%7 = getelementptr inbounds float, float* %6, i64 -1
%8 = bitcast float* %7 to i8*
%9 = tail call i32 @free(i8* %8)
%10 = getelementptr inbounds float*, float** %4, i64 -1
%11 = bitcast float** %10 to i8*
%12 = tail call i32 @free(i8* %11)
ret void
}