xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/ *);
void usage(FILE *out) {
  fputs("Usage: huffcode [-i<input file>] [-o<output file>] [-d|-c]\n"
        "-i - input file (default is standard input)\n"
        "-o - output file (default is standard output)\n"
        "-d - decompress\n"
        "-c - compress (default)\n"
        "-m - read file into memory, compress, then write to file (not "
        "default)\n",
        out);
}


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 <fputs@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
mov    %rdi,%rcx
lea    0xee6(%rip),%rdi
mov    $0x104,%esi
mov    $0x1,%edx
jmp    1030 <fwrite@plt>

LLVM IR (-O0):
@.str = [261 x i8] c"Usage: huffcode [-i<input file>] [-o<output file>] [-d|-c]\0A-i - input file (default is standard input)\0A-o - output file (default is standard output)\0A-d - decompress\0A-c - compress (default)\0A-m - read file into memory, compress, then write to file (not default)\0A\00"
define void @usage(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @fputs(i8* getelementptr inbounds ([261 x i8], [261 x i8]* @.str, i64 0, i64 0), i32* %3)
ret void
}

LLVM IR (-O2):
@.str = [261 x i8] c"Usage: huffcode [-i<input file>] [-o<output file>] [-d|-c]\0A-i - input file (default is standard input)\0A-o - output file (default is standard output)\0A-d - decompress\0A-c - compress (default)\0A-m - read file into memory, compress, then write to file (not default)\0A\00"
define void @usage(i32* nocapture %0) {
%2 = tail call i64 @fwrite(i8* getelementptr inbounds ([261 x i8], [261 x i8]* @.str, i64 0, i64 0), i64 260, i64 1, i32* %0)
ret void
}
/* Type definitions */
typedef scalar_t__ pthread_t;
typedef int /*<<< orphan*/ name;

/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, int, char *, unsigned int);
char *_taskname(pthread_t tid) {
  static char name[16];
  snprintf(name, sizeof(name), "0x%08x", (unsigned int)tid);
  return (name);
}


x86 assembly (clang, -O0):
<_taskname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %eax,%ecx
lea    0x2f17(%rip),%rdi
mov    $0x10,%esi
lea    0xecb(%rip),%rdx
call   1030 <snprintf@plt>
lea    0x2eff(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_taskname>:
push   %rbx
mov    %rdi,%rcx
lea    0x2f25(%rip),%rbx
lea    0xede(%rip),%rdx
mov    %rbx,%rdi
mov    $0x10,%esi
call   1030 <snprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@_taskname.name = internal global [16 x i8] zeroinitializer
@.str = [7 x i8] c"0x%08x\00"
define i8* @_taskname(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
%5 = call i32 @snprintf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @_taskname.name, i64 0, i64 0), i32 16, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i8* getelementptr inbounds ([16 x i8], [16 x i8]* @_taskname.name, i64 0, i64 0)
}

LLVM IR (-O2):
@_taskname.name = internal global [16 x i8] zeroinitializer
@.str = [7 x i8] c"0x%08x\00"
define i8* @_taskname(i64 %0) {
%2 = trunc i64 %0 to i32
%3 = tail call i32 @snprintf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @_taskname.name, i64 0, i64 0), i32 16, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i8* getelementptr inbounds ([16 x i8], [16 x i8]* @_taskname.name, i64 0, i64 0)
}
int test_imm_F9int8_mem(signed char *val) {
  return ((*val) & (-0xF9 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_F9int8_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, -249
%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_F9int8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = sext i8 %2 to i32
%4 = and i32 %3, -249
%5 = icmp eq i32 %4, 0
%6 = select i1 %5, i32 -40, i32 -20
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void assert(int res) {
  if (!res) {
    printf("error");
  }
}


x86 assembly (clang, -O0):
<assert>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1131 <assert+0x21>
lea    0xed4(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<assert>:
test   %edi,%edi
je     1115 <assert+0x5>
ret
lea    0xee4(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [6 x i8] c"error\00"
define void @assert(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %5
5: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalnum(int);
void t_isalnum_0xe8() {
  Assert_real((isalnum(232) == 0),
              "/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_isalnum.c",
              1165, ("isalnum should be 0 for 0xe8"));
}


x86 assembly (clang, -O0):
<t_isalnum_0xe8>:
push   %rbp
mov    %rsp,%rbp
mov    $0xe8,%edi
call   1030 <isalnum@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x48d,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isalnum_0xe8>:
push   %rax
mov    $0xe8,%edi
call   1030 <isalnum@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x48d,%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_isalnum.c\00"
@.str.1 = [29 x i8] c"isalnum should be 0 for 0xe8\00"
define void @t_isalnum_0xe8() {
%1 = call i64 @isalnum(i32 232)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1165, 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_isalnum.c\00"
@.str.1 = [29 x i8] c"isalnum should be 0 for 0xe8\00"
define void @t_isalnum_0xe8() {
%1 = tail call i64 @isalnum(i32 232)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1165, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
struct stack_impl {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int stack_impl_ops_top(struct stack_impl *stack_impl) {
  printf("stack_impl::top()\n");
  return 0;
}


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

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

LLVM IR (-O0):
%struct.stack_impl = type { i32 }
@.str = [19 x i8] c"stack_impl::top()\0A\00"
define i32 @stack_impl_ops_top(%struct.stack_impl* %0) {
%2 = alloca %struct.stack_impl*
store %struct.stack_impl* %0, %struct.stack_impl** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
%struct.stack_impl = type { i32 }
@str = [18 x i8] c"stack_impl::top()\00"
define i32 @stack_impl_ops_top(%struct.stack_impl* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
ret i32 0
}
long long r19(void *x) { return *(long long *)(x + 32749); }


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

x86 assembly (clang, -O2):
<r19>:
mov    0x7fed(%rdi),%rax
ret

LLVM IR (-O0):
define i64 @r19(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr i8, i8* %3, i64 32749
%5 = bitcast i8* %4 to i64*
%6 = load i64, i64* %5
ret i64 %6
}

LLVM IR (-O2):
define i64 @r19(i8* nocapture %0) {
%2 = getelementptr i8, i8* %0, i64 32749
%3 = bitcast i8* %2 to i64*
%4 = load i64, i64* %3
ret i64 %4
}
void SysExceptions_InitExceptionHandlers(void *indexf, void *range, void *casef,
                                         void *invalidloc, void *function,
                                         void *wholevalue, void *wholediv,
                                         void *realvalue, void *realdiv,
                                         void *complexvalue, void *complexdiv,
                                         void *protection, void *systemf,
                                         void *coroutine, void *exception) {}


x86 assembly (clang, -O0):
<SysExceptions_InitExceptionHandlers>:
push   %rbp
mov    %rsp,%rbp
mov    0x50(%rbp),%rax
mov    0x48(%rbp),%rax
mov    0x40(%rbp),%rax
mov    0x38(%rbp),%rax
mov    0x30(%rbp),%rax
mov    0x28(%rbp),%rax
mov    0x20(%rbp),%rax
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @SysExceptions_InitExceptionHandlers(i8* %0, i8* %1, i8* %2, i8* %3, i8* %4, i8* %5, i8* %6, i8* %7, i8* %8, i8* %9, i8* %10, i8* %11, i8* %12, i8* %13, i8* %14) {
%16 = alloca i8*
%17 = alloca i8*
%18 = alloca i8*
%19 = alloca i8*
%20 = alloca i8*
%21 = alloca i8*
%22 = alloca i8*
%23 = alloca i8*
%24 = alloca i8*
%25 = alloca i8*
%26 = alloca i8*
%27 = alloca i8*
%28 = alloca i8*
%29 = alloca i8*
%30 = alloca i8*
store i8* %0, i8** %16
store i8* %1, i8** %17
store i8* %2, i8** %18
store i8* %3, i8** %19
store i8* %4, i8** %20
store i8* %5, i8** %21
store i8* %6, i8** %22
store i8* %7, i8** %23
store i8* %8, i8** %24
store i8* %9, i8** %25
store i8* %10, i8** %26
store i8* %11, i8** %27
store i8* %12, i8** %28
store i8* %13, i8** %29
store i8* %14, i8** %30
ret void
}

LLVM IR (-O2):
define void @SysExceptions_InitExceptionHandlers(i8* nocapture %0, i8* nocapture %1, i8* nocapture %2, i8* nocapture %3, i8* nocapture %4, i8* nocapture %5, i8* nocapture %6, i8* nocapture %7, i8* nocapture %8, i8* nocapture %9, i8* nocapture %10, i8* nocapture %11, i8* nocapture %12, i8* nocapture %13, i8* nocapture %14) {
ret void
}
/* Variables and functions */
int rand();
int *mutate_chromosome(int *chromosome, int chromosome_size) {
  int new_val = rand() % 2;
  int rand_gen = rand() % chromosome_size;
  chromosome[rand_gen] = 1;
  return chromosome;
}


x86 assembly (clang, -O0):
<mutate_chromosome>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %edx,-0x10(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
cltd
idivl  -0xc(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movl   $0x1,(%rax,%rcx,4)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mutate_chromosome>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <rand@plt>
xor    %eax,%eax
call   1030 <rand@plt>
cltd
idiv   %ebp
movslq %edx,%rax
movl   $0x1,(%rbx,%rax,4)
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32* @mutate_chromosome(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%7 = call i32 (...) @rand()
%8 = srem i32 %7, 2
store i32 %8, i32* %5
%9 = call i32 (...) @rand()
%10 = load i32, i32* %4
%11 = srem i32 %9, %10
store i32 %11, i32* %6
%12 = load i32*, i32** %3
%13 = load i32, i32* %6
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i32, i32* %12, i64 %14
store i32 1, i32* %15
%16 = load i32*, i32** %3
ret i32* %16
}

LLVM IR (-O2):
define i32* @mutate_chromosome(i32* returned writeonly %0, i32 %1) {
%3 = tail call i32 (...) @rand()
%4 = tail call i32 (...) @rand()
%5 = srem i32 %4, %1
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds i32, i32* %0, i64 %6
store i32 1, i32* %7
ret i32* %0
}
union student {
  char name[10];
  int class;
  float age, weight;
} main() {
  union student var;
  printf("Addresses are\n");
  printf(" %p\n %p\n %p\n %p\n", &var.name, &var.class, &var.age, &var.weight);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
lea    0xee1(%rip),%rdi
xor    %eax,%eax
mov    %al,-0x31(%rbp)
call   1030 <printf@plt>
mov    -0x31(%rbp),%al
lea    0xedc(%rip),%rdi
lea    -0x20(%rbp),%r8
mov    %r8,%rsi
mov    %r8,%rdx
mov    %r8,%rcx
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
mov    -0x28(%rbp),%edx
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xee6(%rip),%rdi
call   1030 <puts@plt>
lea    0xec9(%rip),%rdi
lea    0x8(%rsp),%rcx
mov    %rcx,%rsi
mov    %rcx,%rdx
mov    %rcx,%r8
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%union.student = type { i32, [8 x i8] }
@.str = [15 x i8] c"Addresses are\0A\00"
@.str.1 = [17 x i8] c" %p\0A %p\0A %p\0A %p\0A\00"
define { i64, i32 } @main() {
%1 = alloca %union.student
%2 = alloca %union.student
%3 = alloca { i64, i32 }
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%5 = bitcast %union.student* %2 to [10 x i8]*
%6 = bitcast %union.student* %2 to i32*
%7 = bitcast %union.student* %2 to float*
%8 = bitcast %union.student* %2 to float*
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), [10 x i8]* %5, i32* %6, float* %7, float* %8)
%10 = bitcast { i64, i32 }* %3 to i8*
%11 = bitcast %union.student* %1 to i8*
%12 = load { i64, i32 }, { i64, i32 }* %3
ret { i64, i32 } %12
}

LLVM IR (-O2):
%union.student = type { i32, [8 x i8] }
@.str.1 = [17 x i8] c" %p\0A %p\0A %p\0A %p\0A\00"
@str = [14 x i8] c"Addresses are\00"
define { i64, i32 } @main() {
%1 = alloca %union.student
%2 = bitcast %union.student* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
%4 = getelementptr inbounds %union.student, %union.student* %1, i64 0, i32 0
%5 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), %union.student* %1, i32* %4, %union.student* %1, %union.student* %1)
ret { i64, i32 } undef
}
short htons_(short v) {
  __asm__("xchg %h0, %b0" : "+Q"(v));
  return (v);
}


x86 assembly (clang, -O0):
<htons_>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    -0x2(%rbp),%ax
xchg   %al,%ah
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<htons_>:
mov    %edi,%eax
xchg   %al,%ah
ret

LLVM IR (-O0):
define signext i16 @htons_(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = call i16 asm "xchg ${0:h}, ${0:b}", "=Q,0,~{dirflag},~{fpsr},~{flags}"(i16 %3)
store i16 %4, i16* %2
%5 = load i16, i16* %2
ret i16 %5
}

LLVM IR (-O2):
define signext i16 @htons_(i16 signext %0) {
%2 = tail call i16 asm "xchg ${0:h}, ${0:b}", "=Q,0,~{dirflag},~{fpsr},~{flags}"(i16 %0)
ret i16 %2
}
/* Variables and functions */
long syscall(int /*<<< orphan*/, int, void *, int);
long int read(int fd, void *buf, int cnt) { return syscall(0, fd, buf, cnt); }


x86 assembly (clang, -O0):
<read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
xor    %edi,%edi
call   1030 <syscall@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read>:
mov    %edx,%ecx
mov    %rsi,%rdx
mov    %edi,%esi
xor    %edi,%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
define i64 @read(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 i64 @syscall(i32 0, i32 %7, i8* %8, i32 %9)
ret i64 %10
}

LLVM IR (-O2):
define i64 @read(i32 %0, i8* %1, i32 %2) {
%4 = tail call i64 @syscall(i32 0, i32 %0, i8* %1, i32 %2)
ret i64 %4
}
int pldummy_plmeta() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @pldummy_plmeta() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void sq2_print_element(int *x) { printf("%d\n", *x); }


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

x86 assembly (clang, -O2):
<sq2_print_element>:
mov    (%rdi),%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define void @sq2_print_element(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @sq2_print_element(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %2)
ret void
}
/* Variables and functions */
int U_WMRCORENONE_get(char *);
int U_WMRA1_get(void) { return U_WMRCORENONE_get("U_WMRA1"); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"U_WMRA1\00"
define i32 @U_WMRA1_get() {
%1 = call i32 @U_WMRCORENONE_get(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}

LLVM IR (-O2):
@.str = [8 x i8] c"U_WMRA1\00"
define i32 @U_WMRA1_get() {
%1 = tail call i32 @U_WMRCORENONE_get(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
int starts_with(const char *bigstr, const char *smallstr) {
  while (*smallstr == *bigstr && *smallstr != '\0') {
    ++bigstr;
    ++smallstr;
  }
  return !*smallstr;
}


x86 assembly (clang, -O0):
<starts_with>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
mov    -0x8(%rbp),%rax
movsbl (%rax),%edx
xor    %eax,%eax
cmp    %edx,%ecx
mov    %al,-0x11(%rbp)
jne    1137 <starts_with+0x37>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1147 <starts_with+0x47>
jmp    1164 <starts_with+0x64>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    110c <starts_with+0xc>
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<starts_with>:
mov    (%rsi),%cl
test   %cl,%cl
sete   %r8b
je     1138 <starts_with+0x38>
cmp    (%rdi),%cl
jne    1138 <starts_with+0x38>
mov    $0x1,%ecx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movzbl (%rsi,%rcx,1),%edx
test   %dl,%dl
sete   %r8b
je     1138 <starts_with+0x38>
lea    0x1(%rcx),%rax
cmp    (%rdi,%rcx,1),%dl
mov    %rax,%rcx
je     1120 <starts_with+0x20>
movzbl %r8b,%eax
ret

LLVM IR (-O0):
define i32 @starts_with(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
br label %5
5: ; preds = %20, %2
%6 = load i8*, i8** %4
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = load i8*, i8** %3
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp eq i32 %8, %11
br i1 %12, label %13, label %18
13: ; preds = %5
%14 = load i8*, i8** %4
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = icmp ne i32 %16, 0
br label %18
18: ; preds = %13, %5
%19 = phi i1 [ false, %5 ], [ %17, %13 ]
br i1 %19, label %20, label %25
20: ; preds = %18
%21 = load i8*, i8** %3
%22 = getelementptr inbounds i8, i8* %21, i32 1
store i8* %22, i8** %3
%23 = load i8*, i8** %4
%24 = getelementptr inbounds i8, i8* %23, i32 1
store i8* %24, i8** %4
br label %5
25: ; preds = %18
%26 = load i8*, i8** %4
%27 = load i8, i8* %26
%28 = icmp ne i8 %27, 0
%29 = xor i1 %28, true
%30 = zext i1 %29 to i32
ret i32 %30
}

LLVM IR (-O2):
define i32 @starts_with(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = load i8, i8* %0
%5 = icmp ne i8 %3, %4
%6 = icmp eq i8 %3, 0
%7 = or i1 %6, %5
br i1 %7, label %18, label %8
8: ; preds = %2, %8
%9 = phi i8* [ %12, %8 ], [ %1, %2 ]
%10 = phi i8* [ %11, %8 ], [ %0, %2 ]
%11 = getelementptr inbounds i8, i8* %10, i64 1
%12 = getelementptr inbounds i8, i8* %9, i64 1
%13 = load i8, i8* %12
%14 = load i8, i8* %11
%15 = icmp ne i8 %13, %14
%16 = icmp eq i8 %13, 0
%17 = or i1 %16, %15
br i1 %17, label %18, label %8
18: ; preds = %8, %2
%19 = phi i1 [ %6, %2 ], [ %16, %8 ]
%20 = zext i1 %19 to i32
ret i32 %20
}
int fun1227() { return 1227; }


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

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

LLVM IR (-O0):
define i32 @fun1227() {
ret i32 1227
}

LLVM IR (-O2):
define i32 @fun1227() {
ret i32 1227
}
void posix_class_neg2NP_SPACE() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
void display_boolean(int32_t val) {
  printf("#%c", (val >> 7 == 1) ? 't' : 'f');
}


x86 assembly (clang, -O0):
<display_boolean>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
sar    $0x7,%edx
mov    $0x66,%eax
mov    $0x74,%ecx
cmp    $0x1,%edx
cmove  %ecx,%eax
lea    0xec8(%rip),%rdi
movsbl %al,%esi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<display_boolean>:
and    $0xffffff80,%edi
cmp    $0x80,%edi
mov    $0x74,%eax
mov    $0x66,%esi
cmove  %eax,%esi
lea    0xed3(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"#%c\00"
define void @display_boolean(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 7
%5 = icmp eq i32 %4, 1
%6 = zext i1 %5 to i64
%7 = select i1 %5, i32 116, i32 102
%8 = trunc i32 %7 to i8
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 signext %8)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"#%c\00"
define void @display_boolean(i32 %0) {
%2 = and i32 %0, -128
%3 = icmp eq i32 %2, 128
%4 = select i1 %3, i8 116, i8 102
%5 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 signext %4)
ret void
}
int Get_USB3_Port_Folder(const char *port_x) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @Get_USB3_Port_Folder(i8* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned int);
int main() {
  unsigned int a = 1, b = 1, i = 0, temp = 0;
  for (i = 0; i < 20; i++) {
    temp = a;
    a = b;
    b += temp;
  }
  printf("%d\n", a);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x14,-0x10(%rbp)
jae    116f <main+0x5f>
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x14(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1142 <main+0x32>
mov    -0x8(%rbp),%esi
lea    0xe87(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x2ac2,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 10946)
ret i32 0
}
/* Variables and functions */
int ASRT_Fail();
int /*<<< orphan*/ ASRT_Mark(char *, int, int /*<<< orphan*/ *);
int test_Fail() {
  do {
    ASRT_Mark("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/cohadar/c-learning/refs/heads/master/"
              "src/asrt_tests.c",
              35, NULL);
    return ASRT_Fail();
  } while (0);
}


x86 assembly (clang, -O0):
<test_Fail>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
jmp    112d <test_Fail+0xd>
lea    0xecc(%rip),%rdi
mov    $0x23,%esi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <ASRT_Mark@plt>
mov    $0x0,%al
call   1040 <ASRT_Fail@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_Fail>:
push   %rax
lea    0xed8(%rip),%rdi
mov    $0x23,%esi
xor    %edx,%edx
call   1030 <ASRT_Mark@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <ASRT_Fail@plt>

LLVM IR (-O0):
@.str = [144 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/cohadar/c-learning/refs/heads/master/src/asrt_tests.c\00"
define i32 @test_Fail() {
br label %1
1: ; preds = %0
%2 = call i32 @ASRT_Mark(i8* getelementptr inbounds ([144 x i8], [144 x i8]* @.str, i64 0, i64 0), i32 35, i32* null)
%3 = call i32 (...) @ASRT_Fail()
br label %4
4: ; preds = %1
ret i32 %3
}

LLVM IR (-O2):
@.str = [144 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/cohadar/c-learning/refs/heads/master/src/asrt_tests.c\00"
define i32 @test_Fail() {
%1 = tail call i32 @ASRT_Mark(i8* getelementptr inbounds ([144 x i8], [144 x i8]* @.str, i64 0, i64 0), i32 35, i32* null)
%2 = tail call i32 (...) @ASRT_Fail()
ret i32 %2
}
/* Variables and functions */
int vec3_cmpV(double const *, double const *, int);
int vec3_cmp(const double u[3], const double v[3]) {
  return vec3_cmpV(u, v, 1e-10);
}


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

x86 assembly (clang, -O2):
<vec3_cmp>:
xor    %edx,%edx
jmp    1030 <vec3_cmpV@plt>

LLVM IR (-O0):
define i32 @vec3_cmp(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
store double* %0, double** %3
store double* %1, double** %4
%5 = load double*, double** %3
%6 = load double*, double** %4
%7 = call i32 @vec3_cmpV(double* %5, double* %6, i32 0)
ret i32 %7
}

LLVM IR (-O2):
define i32 @vec3_cmp(double* %0, double* %1) {
%3 = tail call i32 @vec3_cmpV(double* %0, double* %1, i32 0)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ form();
int /*<<< orphan*/ getsym();
void programme(void) {
  getsym();
  form();
}


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

x86 assembly (clang, -O2):
<programme>:
push   %rax
xor    %eax,%eax
call   1040 <getsym@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <form@plt>

LLVM IR (-O0):
define void @programme() {
%1 = call i32 (...) @getsym()
%2 = call i32 (...) @form()
ret void
}

LLVM IR (-O2):
define void @programme() {
%1 = tail call i32 (...) @getsym()
%2 = tail call i32 (...) @form()
ret void
}
int wait_for_roaming_reconnect(void) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @wait_for_roaming_reconnect() {
ret i32 1
}
void rop3_48_0_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  stk2 = ~S;
  stk1 = T & stk2;
  *D = stk1;
}


x86 assembly (clang, -O0):
<rop3_48_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0x9(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xc(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0xc(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xb(%rbp)
mov    -0xb(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_48_0_0>:
not    %sil
and    %dl,%sil
mov    %sil,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_48_0_0(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%9 = load i8, i8* %5
%10 = zext i8 %9 to i32
%11 = xor i32 %10, -1
%12 = trunc i32 %11 to i8
store i8 %12, i8* %8
%13 = load i8, i8* %6
%14 = zext i8 %13 to i32
%15 = load i8, i8* %8
%16 = zext i8 %15 to i32
%17 = and i32 %14, %16
%18 = trunc i32 %17 to i8
store i8 %18, i8* %7
%19 = load i8, i8* %7
%20 = load i8*, i8** %4
store i8 %19, i8* %20
ret void
}

LLVM IR (-O2):
define void @rop3_48_0_0(i8* nocapture writeonly %0, i8 zeroext %1, i8 zeroext %2) {
%4 = xor i8 %1, -1
%5 = and i8 %4, %2
store i8 %5, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "usage: mkbootimage [-S <sector offset>] [-v] [-EB] [-EL] "
                  "inputfile outputfile\n");
  exit(1);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [79 x i8] c"usage: mkbootimage [-S <sector offset>] [-v] [-EB] [-EL] inputfile outputfile\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([79 x i8], [79 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [79 x i8] c"usage: mkbootimage [-S <sector offset>] [-v] [-EB] [-EL] inputfile outputfile\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([79 x i8], [79 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;
typedef int /*<<< orphan*/ int8_t;

/* Variables and functions */
int /*<<< orphan*/ readWords(int /*<<< orphan*/, int /*<<< orphan*/, int,
                             int /*<<< orphan*/ *);
int8_t readWord(uint8_t devAddr, uint8_t regAddr, uint16_t *data) {
  return readWords(devAddr, regAddr, 1, data);
}


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

x86 assembly (clang, -O2):
<readWord>:
mov    %rdx,%rcx
mov    $0x1,%edx
jmp    1030 <readWords@plt>

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

LLVM IR (-O2):
define i32 @readWord(i32 %0, i32 %1, i32* %2) {
%4 = tail call i32 @readWords(i32 %0, i32 %1, i32 1, i32* %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ setbuf(int /*<<< orphan*/, int /*<<< orphan*/ *);
int /*<<< orphan*/ stdout;
int main(void) {
  setbuf(stdout, NULL);
  printf("Braun\n\n\nNicolaj");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%edi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <setbuf@plt>
lea    0xeb8(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
xor    %esi,%esi
call   1030 <setbuf@plt>
lea    0xec8(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stdout = global i32 0
@.str = [16 x i8] c"Braun\0A\0A\0ANicolaj\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* @stdout
%3 = call i32 @setbuf(i32 %2, i32* null)
%4 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [16 x i8] c"Braun\0A\0A\0ANicolaj\00"
define i32 @main() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @setbuf(i32 %1, i32* null)
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
struct gfx_ds_data {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct gfx_ds_data *);
void img_destroy(struct gfx_ds_data *img) { free(img); }


x86 assembly (clang, -O0):
<img_destroy>:
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):
<img_destroy>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
%struct.gfx_ds_data = type { i32 }
define void @img_destroy(%struct.gfx_ds_data* nocapture %0) {
%2 = tail call i32 @free(%struct.gfx_ds_data* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ LOG_ERR;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void *realloc(void *, size_t);
int /*<<< orphan*/ syslog(int /*<<< orphan*/, char *, size_t);
void *xrealloc(void *p, size_t size) {
  p = realloc(p, size);
  if (p == NULL) {
    syslog(LOG_ERR, "realloc() failed to allocate %d bytes", size);
    exit(EXIT_FAILURE);
  }
  return p;
}


x86 assembly (clang, -O0):
<xrealloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <realloc@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1183 <xrealloc+0x53>
mov    0x2e6d(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
lea    0xe90(%rip),%rsi
call   1030 <syslog@plt>
mov    0x2e64(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrealloc>:
push   %rbx
mov    %rsi,%rbx
call   1040 <realloc@plt>
test   %rax,%rax
je     1140 <xrealloc+0x10>
pop    %rbx
ret
mov    0x2e89(%rip),%rax
mov    (%rax),%edi
lea    0xeb0(%rip),%rsi
mov    %rbx,%rdx
call   1030 <syslog@plt>
mov    0x2e81(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@LOG_ERR = global i32 0
@.str = [38 x i8] c"realloc() failed to allocate %d bytes\00"
@EXIT_FAILURE = global i32 0
define i8* @xrealloc(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = load i64, i64* %4
%7 = call i8* @realloc(i8* %5, i64 %6)
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = icmp eq i8* %8, null
br i1 %9, label %10, label %16
10: ; preds = %2
%11 = load i32, i32* @LOG_ERR
%12 = load i64, i64* %4
%13 = call i32 @syslog(i32 %11, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i64 %12)
%14 = load i32, i32* @EXIT_FAILURE
%15 = call i32 @exit(i32 %14)
unreachable
16: ; preds = %2
%17 = load i8*, i8** %3
ret i8* %17
}

LLVM IR (-O2):
@LOG_ERR = global i32 0
@.str = [38 x i8] c"realloc() failed to allocate %d bytes\00"
@EXIT_FAILURE = global i32 0
define noalias i8* @xrealloc(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %10
5: ; preds = %2
%6 = load i32, i32* @LOG_ERR
%7 = tail call i32 @syslog(i32 %6, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i64 %1)
%8 = load i32, i32* @EXIT_FAILURE
%9 = tail call i32 @exit(i32 %8)
unreachable
10: ; preds = %2
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
char *f(char *x) {
  int i;
  char *ptr;
  printf("Made it into f - returning now\n");
  return x;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [32 x i8] c"Made it into f - returning now\0A\00"
define i8* @f(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i8*
store i8* %0, i8** %2
%5 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%6 = load i8*, i8** %2
ret i8* %6
}

LLVM IR (-O2):
@str = [31 x i8] c"Made it into f - returning now\00"
define i8* @f(i8* readnone returned %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str, i64 0, i64 0))
ret i8* %0
}
/* Variables and functions */
int get_cols();
int get_max_cols(void) { return get_cols() - 2; }


x86 assembly (clang, -O0):
<get_max_cols>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <get_cols@plt>
sub    $0x2,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_max_cols>:
push   %rax
xor    %eax,%eax
call   1030 <get_cols@plt>
add    $0xfffffffe,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @get_max_cols() {
%1 = call i32 (...) @get_cols()
%2 = sub nsw i32 %1, 2
ret i32 %2
}

LLVM IR (-O2):
define i32 @get_max_cols() {
%1 = tail call i32 (...) @get_cols()
%2 = add nsw i32 %1, -2
ret i32 %2
}
/* Variables and functions */
void OPENSSL_fork_parent(void) {}


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

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

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

LLVM IR (-O2):
define void @OPENSSL_fork_parent() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ glFrustum(double, double, double, double, double, double);
void Frustum(double l, double r, double b, double t, double n, double f) {
  glFrustum(l, r, b, t, n, f);
}


x86 assembly (clang, -O0):
<Frustum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  %xmm4,-0x28(%rbp)
movsd  %xmm5,-0x30(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
movsd  -0x20(%rbp),%xmm3
movsd  -0x28(%rbp),%xmm4
movsd  -0x30(%rbp),%xmm5
call   1030 <glFrustum@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Frustum>:
jmp    1030 <glFrustum@plt>

LLVM IR (-O0):
define void @Frustum(double %0, double %1, double %2, double %3, double %4, double %5) {
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
store double %0, double* %7
store double %1, double* %8
store double %2, double* %9
store double %3, double* %10
store double %4, double* %11
store double %5, double* %12
%13 = load double, double* %7
%14 = load double, double* %8
%15 = load double, double* %9
%16 = load double, double* %10
%17 = load double, double* %11
%18 = load double, double* %12
%19 = call i32 @glFrustum(double %13, double %14, double %15, double %16, double %17, double %18)
ret void
}

LLVM IR (-O2):
define void @Frustum(double %0, double %1, double %2, double %3, double %4, double %5) {
%7 = tail call i32 @glFrustum(double %0, double %1, double %2, double %3, double %4, double %5)
ret void
}
void ps_print_chorus_line() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ pthread_sigmask(int, int /*<<< orphan*/ *,
                                   int /*<<< orphan*/);
int /*<<< orphan*/ sigaddset(int /*<<< orphan*/ *, int);
int /*<<< orphan*/ sigemptyset(int /*<<< orphan*/ *);
void block_or_unblock_signal(int how, int sig) {
  sigset_t signal_mask;
  sigemptyset(&signal_mask);
  sigaddset(&signal_mask, sig);
  pthread_sigmask(how, &signal_mask, 0);
}


x86 assembly (clang, -O0):
<block_or_unblock_signal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
lea    -0xc(%rbp),%rdi
call   1030 <sigemptyset@plt>
mov    -0x8(%rbp),%esi
lea    -0xc(%rbp),%rdi
call   1050 <sigaddset@plt>
mov    -0x4(%rbp),%edi
lea    -0xc(%rbp),%rsi
xor    %edx,%edx
call   1040 <pthread_sigmask@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<block_or_unblock_signal>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %esi,%ebx
mov    %edi,%r14d
lea    0xc(%rsp),%rbp
mov    %rbp,%rdi
call   1030 <sigemptyset@plt>
mov    %rbp,%rdi
mov    %ebx,%esi
call   1050 <sigaddset@plt>
mov    %r14d,%edi
mov    %rbp,%rsi
xor    %edx,%edx
call   1040 <pthread_sigmask@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @block_or_unblock_signal(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = call i32 @sigemptyset(i32* %5)
%7 = load i32, i32* %4
%8 = call i32 @sigaddset(i32* %5, i32 %7)
%9 = load i32, i32* %3
%10 = call i32 @pthread_sigmask(i32 %9, i32* %5, i32 0)
ret void
}

LLVM IR (-O2):
define void @block_or_unblock_signal(i32 %0, i32 %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call i32 @sigemptyset(i32* %3)
%6 = call i32 @sigaddset(i32* %3, i32 %1)
%7 = call i32 @pthread_sigmask(i32 %0, i32* %3, i32 0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;

/* Variables and functions */
int /*<<< orphan*/ mbstowcs(int /*<<< orphan*/ *, char *, size_t);
void uninitvar_mbstowcs(void) {
  wchar_t *ws;
  char *s;
  size_t n;
  (void)mbstowcs(ws, s, n);
}


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

x86 assembly (clang, -O2):
<uninitvar_mbstowcs>:
jmp    1030 <mbstowcs@plt>

LLVM IR (-O0):
define void @uninitvar_mbstowcs() {
%1 = alloca i32*
%2 = alloca i8*
%3 = alloca i64
%4 = load i32*, i32** %1
%5 = load i8*, i8** %2
%6 = load i64, i64* %3
%7 = call i32 @mbstowcs(i32* %4, i8* %5, i64 %6)
ret void
}

LLVM IR (-O2):
define void @uninitvar_mbstowcs() {
%1 = tail call i32 @mbstowcs(i32* undef, i8* undef, i64 undef)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ set_io_bit(int, int);
void TOSH_MAKE_RADIO_GIO1_OUTPUT() { set_io_bit(-3, 7); }


x86 assembly (clang, -O0):
<TOSH_MAKE_RADIO_GIO1_OUTPUT>:
push   %rbp
mov    %rsp,%rbp
mov    $0xfffffffd,%edi
mov    $0x7,%esi
call   1030 <set_io_bit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<TOSH_MAKE_RADIO_GIO1_OUTPUT>:
mov    $0xfffffffd,%edi
mov    $0x7,%esi
jmp    1030 <set_io_bit@plt>

LLVM IR (-O0):
define void @TOSH_MAKE_RADIO_GIO1_OUTPUT() {
%1 = call i32 @set_io_bit(i32 -3, i32 7)
ret void
}

LLVM IR (-O2):
define void @TOSH_MAKE_RADIO_GIO1_OUTPUT() {
%1 = tail call i32 @set_io_bit(i32 -3, i32 7)
ret void
}