xunge/DecIR huggingface dataset:
/* Type definitions */
struct inode {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ insert_inode_hash(struct inode *);
int insert_inode_locked(struct inode *ip) {
  insert_inode_hash(ip);
  return (0);
}


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

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

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

LLVM IR (-O2):
%struct.inode = type { i32 }
define i32 @insert_inode_locked(%struct.inode* %0) {
%2 = tail call i32 @insert_inode_hash(%struct.inode* %0)
ret i32 0
}
void INT_Excep_IWDT_IWUNI(void) {}


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

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

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

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

/* Variables and functions */
int connect(char const *, int, char **);
int connect_cmd(int argc, char **argv, struct command *command,
                struct plugin *plugin) {
  const char *desc = "Connect to NVMeoF subsystem";
  return connect(desc, argc, argv);
}


x86 assembly (clang, -O0):
<connect_cmd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
lea    0xed2(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
call   1030 <connect@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<connect_cmd>:
mov    %rsi,%rdx
mov    %edi,%esi
lea    0xee4(%rip),%rdi
jmp    1030 <connect@plt>

LLVM IR (-O0):
%struct.command = type { i32 }
%struct.plugin = type { i32 }
@.str = [28 x i8] c"Connect to NVMeoF subsystem\00"
define i32 @connect_cmd(i32 %0, i8** %1, %struct.command* %2, %struct.plugin* %3) {
%5 = alloca i32
%6 = alloca i8**
%7 = alloca %struct.command*
%8 = alloca %struct.plugin*
%9 = alloca i8*
store i32 %0, i32* %5
store i8** %1, i8*** %6
store %struct.command* %2, %struct.command** %7
store %struct.plugin* %3, %struct.plugin** %8
store i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8** %9
%10 = load i8*, i8** %9
%11 = load i32, i32* %5
%12 = load i8**, i8*** %6
%13 = call i32 @connect(i8* %10, i32 %11, i8** %12)
ret i32 %13
}

LLVM IR (-O2):
%struct.command = type { i32 }
%struct.plugin = type { i32 }
@.str = [28 x i8] c"Connect to NVMeoF subsystem\00"
define i32 @connect_cmd(i32 %0, i8** %1, %struct.command* nocapture readnone %2, %struct.plugin* nocapture readnone %3) {
%5 = tail call i32 @connect(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %0, i8** %1)
ret i32 %5
}
/* Type definitions */
typedef int pid_t;

/* Variables and functions */
int real_wait(int *);
int /*<<< orphan*/ reap_common(int);
pid_t wait(int *status) {
  pid_t ret;
  ret = real_wait(status);
  if (ret == -1) {
    return ret;
  }
  reap_common(ret);
  return ret;
}


x86 assembly (clang, -O0):
<wait>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <real_wait@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0xffffffff,-0x14(%rbp)
jne    114d <wait+0x2d>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    115b <wait+0x3b>
mov    -0x14(%rbp),%edi
call   1040 <reap_common@plt>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wait>:
push   %rbx
call   1030 <real_wait@plt>
mov    %eax,%ebx
cmp    $0xffffffff,%eax
je     1134 <wait+0x14>
mov    %ebx,%edi
call   1040 <reap_common@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @wait(i32* %0) {
%2 = alloca i32
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
%5 = load i32*, i32** %3
%6 = call i32 @real_wait(i32* %5)
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = icmp eq i32 %7, -1
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = load i32, i32* %4
store i32 %10, i32* %2
br label %15
11: ; preds = %1
%12 = load i32, i32* %4
%13 = call i32 @reap_common(i32 %12)
%14 = load i32, i32* %4
store i32 %14, i32* %2
br label %15
15: ; preds = %11, %9
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
define i32 @wait(i32* %0) {
%2 = tail call i32 @real_wait(i32* %0)
%3 = icmp eq i32 %2, -1
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @reap_common(i32 %2)
br label %6
6: ; preds = %1, %4
ret i32 %2
}
short int bar(int a, int b) {
  short int res;
  a = (short int)a;
  b = (short int)b;
  if (__builtin_mul_overflow(a, b, &res))
    res = 0x123;
  return res;
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cwtl
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
cwtl
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edx
imul   -0x8(%rbp),%edx
seto   %al
mov    %dx,%cx
movswl %cx,%esi
cmp    %esi,%edx
setne  %dl
or     %dl,%al
mov    %cx,-0xa(%rbp)
test   $0x1,%al
jne    1140 <bar+0x40>
jmp    1146 <bar+0x46>
movw   $0x123,-0xa(%rbp)
movswl -0xa(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
movswl %di,%eax
movswl %si,%ecx
imul   %eax,%ecx
movswl %cx,%eax
cmp    %ecx,%eax
mov    $0x123,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define signext i16 @bar(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i16
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = trunc i32 %6 to i16
%8 = sext i16 %7 to i32
store i32 %8, i32* %3
%9 = load i32, i32* %4
%10 = trunc i32 %9 to i16
%11 = sext i16 %10 to i32
store i32 %11, i32* %4
%12 = load i32, i32* %3
%13 = load i32, i32* %4
%14 = call { i32, i1 } @llvm.smul.with.overflow.i32(i32 %12, i32 %13)
%15 = extractvalue { i32, i1 } %14, 1
%16 = extractvalue { i32, i1 } %14, 0
%17 = trunc i32 %16 to i16
%18 = sext i16 %17 to i32
%19 = icmp ne i32 %16, %18
%20 = or i1 %15, %19
store i16 %17, i16* %5
br i1 %20, label %21, label %22
21: ; preds = %2
store i16 291, i16* %5
br label %22
22: ; preds = %21, %2
%23 = load i16, i16* %5
ret i16 %23
}

LLVM IR (-O2):
define signext i16 @bar(i32 %0, i32 %1) {
%3 = shl i32 %0, 16
%4 = ashr exact i32 %3, 16
%5 = shl i32 %1, 16
%6 = ashr exact i32 %5, 16
%7 = mul nsw i32 %6, %4
%8 = trunc i32 %7 to i16
%9 = add nsw i32 %7, -32768
%10 = icmp ult i32 %9, -65536
%11 = select i1 %10, i16 291, i16 %8
ret i16 %11
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ rewind(int /*<<< orphan*/ *);
void crash_rewind() {
  FILE *f;
  f = fopen("this_file_doesnt_exist", "r");
  rewind(f);
  fclose(f);
}


x86 assembly (clang, -O0):
<crash_rewind>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
lea    0xed1(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <rewind@plt>
mov    -0x8(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<crash_rewind>:
push   %rbx
lea    0xec8(%rip),%rdi
lea    0xed8(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <rewind@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <fclose@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"this_file_doesnt_exist\00"
@.str.1 = [2 x i8] c"r\00"
define void @crash_rewind() {
%1 = alloca i32*
%2 = call i32* @fopen(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %2, i32** %1
%3 = load i32*, i32** %1
%4 = call i32 @rewind(i32* %3)
%5 = load i32*, i32** %1
%6 = call i32 @fclose(i32* %5)
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"this_file_doesnt_exist\00"
@.str.1 = [2 x i8] c"r\00"
define void @crash_rewind() {
%1 = tail call i32* @fopen(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @rewind(i32* %1)
%3 = tail call i32 @fclose(i32* %1)
ret void
}
/* Variables and functions */
int partition(int *, int, int);
void quicksort(int *A, int p, int r) {
  int q;
  if (p < r) {
    q = partition(A, p, r);
    quicksort(A, p, q - 1);
    quicksort(A, q + 1, r);
  }
}


x86 assembly (clang, -O0):
<quicksort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1174 <quicksort+0x54>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <partition@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
sub    $0x1,%edx
call   1040 <quicksort@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%edx
call   1040 <quicksort@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quicksort>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
cmp    %edx,%esi
jge    1166 <quicksort+0x46>
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,%r15
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r15,%rdi
mov    %ebp,%esi
mov    %r14d,%edx
call   1030 <partition@plt>
mov    %eax,%ebx
lea    -0x1(%rbx),%edx
mov    %r15,%rdi
mov    %ebp,%esi
call   1040 <quicksort@plt>
add    $0x1,%ebx
mov    %ebx,%ebp
cmp    %r14d,%ebx
jl     1140 <quicksort+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @quicksort(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %24
11: ; preds = %3
%12 = load i32*, i32** %4
%13 = load i32, i32* %5
%14 = load i32, i32* %6
%15 = call i32 @partition(i32* %12, i32 %13, i32 %14)
store i32 %15, i32* %7
%16 = load i32*, i32** %4
%17 = load i32, i32* %5
%18 = load i32, i32* %7
%19 = sub nsw i32 %18, 1
%20 = load i32*, i32** %4
%21 = load i32, i32* %7
%22 = add nsw i32 %21, 1
%23 = load i32, i32* %6
br label %24
24: ; preds = %11, %3
ret void
}

LLVM IR (-O2):
define void @quicksort(i32* %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %2
br i1 %4, label %5, label %11
5: ; preds = %3, %5
%6 = phi i32 [ %9, %5 ], [ %1, %3 ]
%7 = tail call i32 @partition(i32* %0, i32 %6, i32 %2)
%8 = add nsw i32 %7, -1
tail call void @quicksort(i32* %0, i32 %6, i32 %8)
%9 = add nsw i32 %7, 1
%10 = icmp slt i32 %9, %2
br i1 %10, label %5, label %11
11: ; preds = %5, %3
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ writel(int /*<<< orphan*/, void *);
void write_pxmsk(unsigned port, uint32_t value) {
  writel(value, (void *)0xb0010000 + (port * 0x100) + (0x20));
}


x86 assembly (clang, -O0):
<write_pxmsk>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x4(%rbp),%eax
shl    $0x8,%eax
mov    %eax,%eax
mov    $0xb0010000,%esi
add    %rax,%rsi
add    $0x20,%rsi
call   1030 <writel@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_pxmsk>:
mov    %esi,%eax
shl    $0x8,%edi
mov    $0xb0010020,%esi
add    %rdi,%rsi
mov    %eax,%edi
jmp    1030 <writel@plt>

LLVM IR (-O0):
define void @write_pxmsk(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32, i32* %3
%7 = mul i32 %6, 256
%8 = zext i32 %7 to i64
%9 = getelementptr i8, i8* inttoptr (i64 2952855552 to i8*), i64 %8
%10 = getelementptr i8, i8* %9, i64 32
%11 = call i32 @writel(i32 %5, i8* %10)
ret void
}

LLVM IR (-O2):
define void @write_pxmsk(i32 %0, i32 %1) {
%3 = shl i32 %0, 8
%4 = zext i32 %3 to i64
%5 = getelementptr i8, i8* inttoptr (i64 2952855552 to i8*), i64 %4
%6 = getelementptr i8, i8* %5, i64 32
%7 = tail call i32 @writel(i32 %1, i8* %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ adainit();
int /*<<< orphan*/ og_initStates();
int main() {
  adainit();
  og_initStates();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @adainit()
%2 = tail call i32 (...) @og_initStates()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ assert(char const *);
int /*<<< orphan*/ strcpy(char *, char const *);
int trio_copy(char *target, const char *source) {
  assert(target);
  assert(source);
  (void)strcpy(target, source);
  return (!(1 == 0));
}


x86 assembly (clang, -O0):
<trio_copy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <assert@plt>
mov    -0x10(%rbp),%rdi
call   1040 <assert@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<trio_copy>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <assert@plt>
mov    %r14,%rdi
call   1040 <assert@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @trio_copy(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = call i32 @assert(i8* %5)
%7 = load i8*, i8** %4
%8 = call i32 @assert(i8* %7)
%9 = load i8*, i8** %3
%10 = load i8*, i8** %4
%11 = call i32 @strcpy(i8* %9, i8* %10)
ret i32 1
}

LLVM IR (-O2):
define i32 @trio_copy(i8* %0, i8* %1) {
%3 = tail call i32 @assert(i8* %0)
%4 = tail call i32 @assert(i8* %1)
%5 = tail call i32 @strcpy(i8* %0, i8* %1)
ret i32 1
}
int fun933() { return 933; }


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

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

LLVM IR (-O0):
define i32 @fun933() {
ret i32 933
}

LLVM IR (-O2):
define i32 @fun933() {
ret i32 933
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *, int, int);
void print_help(const char *prg) {
  printf("Usage: %s -i <input video> -o <output video> "
         "[ -x <output x resolution> ] "
         "[ -y <output y resolution> ] "
         "[ -s <random seed> ] "
         "[ -sp <salt and pepper %d-%d> ] "
         "\n",
         prg, 1, 100);
}


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

x86 assembly (clang, -O2):
<print_help>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
mov    $0x1,%edx
mov    $0x64,%ecx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [158 x i8] c"Usage: %s -i <input video> -o <output video> [ -x <output x resolution> ] [ -y <output y resolution> ] [ -s <random seed> ] [ -sp <salt and pepper %d-%d> ] \0A\00"
define void @print_help(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([158 x i8], [158 x i8]* @.str, i64 0, i64 0), i8* %3, i32 1, i32 100)
ret void
}

LLVM IR (-O2):
@.str = [158 x i8] c"Usage: %s -i <input video> -o <output video> [ -x <output x resolution> ] [ -y <output y resolution> ] [ -s <random seed> ] [ -sp <salt and pepper %d-%d> ] \0A\00"
define void @print_help(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([158 x i8], [158 x i8]* @.str, i64 0, i64 0), i8* %0, i32 1, i32 100)
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t colourcode(uint32_t r, uint32_t g, uint32_t b) {
  return ((r & 0x3ff) << 20) | ((g & 0x3ff) << 10) | (b & 0x3ff);
}


x86 assembly (clang, -O0):
<colourcode>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
and    $0x3ff,%eax
shl    $0x14,%eax
mov    -0x8(%rbp),%ecx
and    $0x3ff,%ecx
shl    $0xa,%ecx
or     %ecx,%eax
mov    -0xc(%rbp),%ecx
and    $0x3ff,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<colourcode>:
shl    $0x14,%edi
and    $0x3ff00000,%edi
shl    $0xa,%esi
and    $0xffc00,%esi
lea    (%rsi,%rdi,1),%eax
and    $0x3ff,%edx
or     %edx,%eax
ret

LLVM IR (-O0):
define i32 @colourcode(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 = and i32 %7, 1023
%9 = shl i32 %8, 20
%10 = load i32, i32* %5
%11 = and i32 %10, 1023
%12 = shl i32 %11, 10
%13 = or i32 %9, %12
%14 = load i32, i32* %6
%15 = and i32 %14, 1023
%16 = or i32 %13, %15
ret i32 %16
}

LLVM IR (-O2):
define i32 @colourcode(i32 %0, i32 %1, i32 %2) {
%4 = shl i32 %0, 20
%5 = and i32 %4, 1072693248
%6 = shl i32 %1, 10
%7 = and i32 %6, 1047552
%8 = or i32 %7, %5
%9 = and i32 %2, 1023
%10 = or i32 %8, %9
ret i32 %10
}
/* Variables and functions */
char *malloc(int);
int rand();
char *realloc(char *, int);
int /*<<< orphan*/ strcpy(char *, char *);
char *fn41() {
  char *result;
  result = malloc(20 + rand() % 20);
  result = realloc(result, 30 + rand() % 20);
  strcpy((char *)result, "fn41");
  return result;
}


x86 assembly (clang, -O0):
<fn41>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1060 <rand@plt>
mov    $0x14,%ecx
cltd
idiv   %ecx
mov    %edx,%edi
add    $0x14,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1060 <rand@plt>
mov    -0x10(%rbp),%rdi
mov    $0x14,%ecx
cltd
idiv   %ecx
mov    %edx,%esi
add    $0x1e,%esi
call   1050 <realloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xe67(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn41>:
push   %rbx
xor    %eax,%eax
call   1060 <rand@plt>
cltq
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x23,%rcx
add    %edx,%ecx
shl    $0x2,%ecx
lea    (%rcx,%rcx,4),%ecx
neg    %ecx
lea    (%rax,%rcx,1),%edi
add    $0x14,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1060 <rand@plt>
cltq
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x23,%rcx
add    %edx,%ecx
shl    $0x2,%ecx
lea    (%rcx,%rcx,4),%ecx
neg    %ecx
lea    (%rax,%rcx,1),%esi
add    $0x1e,%esi
mov    %rbx,%rdi
call   1050 <realloc@plt>
mov    %rax,%rbx
lea    0xe4f(%rip),%rsi
mov    %rax,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"fn41\00"
define i8* @fn41() {
%1 = alloca i8*
%2 = call i32 (...) @rand()
%3 = srem i32 %2, 20
%4 = add nsw i32 20, %3
%5 = call i8* @malloc(i32 %4)
store i8* %5, i8** %1
%6 = load i8*, i8** %1
%7 = call i32 (...) @rand()
%8 = srem i32 %7, 20
%9 = add nsw i32 30, %8
%10 = call i8* @realloc(i8* %6, i32 %9)
store i8* %10, i8** %1
%11 = load i8*, i8** %1
%12 = call i32 @strcpy(i8* %11, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%13 = load i8*, i8** %1
ret i8* %13
}

LLVM IR (-O2):
@.str = [5 x i8] c"fn41\00"
define i8* @fn41() {
%1 = tail call i32 (...) @rand()
%2 = srem i32 %1, 20
%3 = add nsw i32 %2, 20
%4 = tail call i8* @malloc(i32 %3)
%5 = tail call i32 (...) @rand()
%6 = srem i32 %5, 20
%7 = add nsw i32 %6, 30
%8 = tail call i8* @realloc(i8* %4, i32 %7)
%9 = tail call i32 @strcpy(i8* %8, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret i8* %8
}
/* Variables and functions */
unsigned char __builtin_rotateleft8(unsigned char, unsigned char);
unsigned char rotleft8(unsigned char x, unsigned char y) {
  return __builtin_rotateleft8(x, y);
}


x86 assembly (clang, -O0):
<rotleft8>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
mov    -0x1(%rbp),%al
mov    -0x2(%rbp),%cl
rol    %cl,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rotleft8>:
mov    %esi,%ecx
mov    %edi,%eax
rol    %cl,%al
ret

LLVM IR (-O0):
define zeroext i8 @rotleft8(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = load i8, i8* %3
%6 = load i8, i8* %4
%7 = call i8 @llvm.fshl.i8(i8 %5, i8 %5, i8 %6)
ret i8 %7
}

LLVM IR (-O2):
define zeroext i8 @rotleft8(i8 zeroext %0, i8 zeroext %1) {
%3 = tail call i8 @llvm.fshl.i8(i8 %0, i8 %0, i8 %1)
ret i8 %3
}
/* Type definitions */
struct mntent {
  int dummy;
};
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
struct mntent *getmntent(FILE *fp __attribute__((unused))) {
  return NULL;
}


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

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

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

LLVM IR (-O2):
%struct.mntent = type { i32 }
define noalias %struct.mntent* @getmntent(i32* nocapture readnone %0) {
ret %struct.mntent* null
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void usage() {
  printf("Usage: npag -f [config file] [-options]\n\n"
         "Options: \n"
         "\t-v verbose output\n"
         "\t-vv even more outout\n"
         "\t-o [filename] specifies an output filename. Raw packets are\n"
         "\t              printed into the file in HEX format\n"
         "\t-s faster random-function");
  exit(0);
}


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

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [231 x i8] c"Usage: npag -f [config file] [-options]\0A\0AOptions: \0A\09-v verbose output\0A\09-vv even more outout\0A\09-o [filename] specifies an output filename. Raw packets are\0A\09 printed into the file in HEX format\0A\09-s faster random-function\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([231 x i8], [231 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [231 x i8] c"Usage: npag -f [config file] [-options]\0A\0AOptions: \0A\09-v verbose output\0A\09-vv even more outout\0A\09-o [filename] specifies an output filename. Raw packets are\0A\09 printed into the file in HEX format\0A\09-s faster random-function\00"
define void @usage() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([231 x i8], [231 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 0)
unreachable
}
void lt_dlsym(void) {}


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

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

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

LLVM IR (-O2):
define void @lt_dlsym() {
ret void
}
void CFGMR3QueryType(void) {}


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

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

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

LLVM IR (-O2):
define void @CFGMR3QueryType() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ FIONREAD;
scalar_t__ ioctl(int, int /*<<< orphan*/, long *);
long bytesWaiting(int sd) {
  long available = 0;
  if (ioctl(sd, FIONREAD, &available) == 0)
    return available;
  else
    return -1;
}


x86 assembly (clang, -O0):
<bytesWaiting>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0xc(%rbp),%edi
mov    0x2ebb(%rip),%rax
mov    (%rax),%esi
lea    -0x18(%rbp),%rdx
call   1030 <ioctl@plt>
cmp    $0x0,%rax
jne    114f <bytesWaiting+0x3f>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1157 <bytesWaiting+0x47>
movq   $0xffffffffffffffff,-0x8(%rbp)
ff
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bytesWaiting>:
push   %rax
movq   $0x0,(%rsp)
mov    0x2ec8(%rip),%rax
mov    (%rax),%esi
mov    %rsp,%rdx
call   1030 <ioctl@plt>
neg    %rax
sbb    %rax,%rax
or     (%rsp),%rax
pop    %rcx
ret

LLVM IR (-O0):
@FIONREAD = global i32 0
define i64 @bytesWaiting(i32 %0) {
%2 = alloca i64
%3 = alloca i32
%4 = alloca i64
store i32 %0, i32* %3
store i64 0, i64* %4
%5 = load i32, i32* %3
%6 = load i32, i32* @FIONREAD
%7 = call i64 @ioctl(i32 %5, i32 %6, i64* %4)
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = load i64, i64* %4
store i64 %10, i64* %2
br label %12
11: ; preds = %1
store i64 -1, i64* %2
br label %12
12: ; preds = %11, %9
%13 = load i64, i64* %2
ret i64 %13
}

LLVM IR (-O2):
@FIONREAD = global i32 0
define i64 @bytesWaiting(i32 %0) {
%2 = alloca i64
%3 = bitcast i64* %2 to i8*
store i64 0, i64* %2
%4 = load i32, i32* @FIONREAD
%5 = call i64 @ioctl(i32 %0, i32 %4, i64* %2)
%6 = icmp eq i64 %5, 0
%7 = load i64, i64* %2
%8 = select i1 %6, i64 %7, i64 -1
ret i64 %8
}
void *memset10(void *s, int c) {
  return __builtin_memset((char *)s + 4000, c, 700);
}


x86 assembly (clang, -O0):
<memset10>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
add    $0xfa0,%rdi
mov    %rdi,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x2bc,%edx
movzbl %al,%esi
call   1030 <memset@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<memset10>:
add    $0xfa0,%rdi
mov    $0x2bc,%edx
jmp    1030 <memset@plt>

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

LLVM IR (-O2):
define i8* @memset10(i8* writeonly %0, i32 %1) {
%3 = getelementptr inbounds i8, i8* %0, i64 4000
%4 = trunc i32 %1 to i8
tail call void @llvm.memset.p0i8.i64(i8* align 1 dereferenceable(700) %3, i8 %4, i64 700, i1 false)
ret i8* %3
}
void av_mastering_display_metadata_create_side_data() {}


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

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

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

LLVM IR (-O2):
define void @av_mastering_display_metadata_create_side_data() {
ret void
}
int searchInsert(int *nums, int numsSize, int target) {
  int *cur = nums;
  while (cur - nums < numsSize) {
    if (*cur >= target)
      return cur - nums;
  }
  return numsSize - 1;
}


x86 assembly (clang, -O0):
<searchInsert>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    %rcx,%rax
sar    $0x2,%rax
movslq -0x14(%rbp),%rcx
cmp    %rcx,%rax
jge    115d <searchInsert+0x5d>
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
cmp    -0x18(%rbp),%eax
jl     1158 <searchInsert+0x58>
mov    -0x20(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    %rcx,%rax
sar    $0x2,%rax
mov    %eax,-0x4(%rbp)
jmp    1166 <searchInsert+0x66>
jmp    1116 <searchInsert+0x16>
mov    -0x14(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<searchInsert>:
test   %esi,%esi
jle    1112 <searchInsert+0x12>
xor    %esi,%esi
cmp    %edx,(%rdi)
jge    1115 <searchInsert+0x15>
nopw   0x0(%rax,%rax,1)
jmp    1110 <searchInsert+0x10>
add    $0xffffffff,%esi
mov    %esi,%eax
ret

LLVM IR (-O0):
define i32 @searchInsert(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32*
store i32* %0, i32** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
%9 = load i32*, i32** %5
store i32* %9, i32** %8
br label %10
10: ; preds = %33, %3
%11 = load i32*, i32** %8
%12 = load i32*, i32** %5
%13 = ptrtoint i32* %11 to i64
%14 = ptrtoint i32* %12 to i64
%15 = sub i64 %13, %14
%16 = sdiv exact i64 %15, 4
%17 = load i32, i32* %6
%18 = sext i32 %17 to i64
%19 = icmp slt i64 %16, %18
br i1 %19, label %20, label %34
20: ; preds = %10
%21 = load i32*, i32** %8
%22 = load i32, i32* %21
%23 = load i32, i32* %7
%24 = icmp sge i32 %22, %23
br i1 %24, label %25, label %33
25: ; preds = %20
%26 = load i32*, i32** %8
%27 = load i32*, i32** %5
%28 = ptrtoint i32* %26 to i64
%29 = ptrtoint i32* %27 to i64
%30 = sub i64 %28, %29
%31 = sdiv exact i64 %30, 4
%32 = trunc i64 %31 to i32
store i32 %32, i32* %4
br label %37
33: ; preds = %20
br label %10
34: ; preds = %10
%35 = load i32, i32* %6
%36 = sub nsw i32 %35, 1
store i32 %36, i32* %4
br label %37
37: ; preds = %34, %25
%38 = load i32, i32* %4
ret i32 %38
}

LLVM IR (-O2):
define i32 @searchInsert(i32* nocapture %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %9
5: ; preds = %3
%6 = load i32, i32* %0
%7 = icmp slt i32 %6, %2
br i1 %7, label %8, label %11
8: ; preds = %5, %8
br label %8
9: ; preds = %3
%10 = add nsw i32 %1, -1
br label %11
11: ; preds = %5, %9
%12 = phi i32 [ %10, %9 ], [ 0, %5 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ RegWriteA_LC898122AF(int, int);
void RamAccFixMod(unsigned char UcAccMod) {
  switch (UcAccMod) {
  case 0x00:
    RegWriteA_LC898122AF(0x018C, 0x00);
    break;
  case 0x01:
    RegWriteA_LC898122AF(0x018C, 0x31);
    break;
  }
}


x86 assembly (clang, -O0):
<RamAccFixMod>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
mov    %eax,-0x8(%rbp)
test   %eax,%eax
je     1143 <RamAccFixMod+0x33>
jmp    1132 <RamAccFixMod+0x22>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
je     1154 <RamAccFixMod+0x44>
jmp    1163 <RamAccFixMod+0x53>
mov    $0x18c,%edi
xor    %esi,%esi
call   1030 <RegWriteA_LC898122AF@plt>
jmp    1163 <RamAccFixMod+0x53>
mov    $0x18c,%edi
mov    $0x31,%esi
call   1030 <RegWriteA_LC898122AF@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RamAccFixMod>:
test   %edi,%edi
je     1129 <RamAccFixMod+0x19>
cmp    $0x1,%dil
jne    1135 <RamAccFixMod+0x25>
mov    $0x31,%esi
mov    $0x18c,%edi
jmp    1030 <RegWriteA_LC898122AF@plt>
xor    %esi,%esi
mov    $0x18c,%edi
jmp    1030 <RegWriteA_LC898122AF@plt>
ret

LLVM IR (-O0):
define void @RamAccFixMod(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
switch i32 %4, label %9 [
i32 0, label %5
i32 1, label %7
]
5: ; preds = %1
%6 = call i32 @RegWriteA_LC898122AF(i32 396, i32 0)
br label %9
7: ; preds = %1
%8 = call i32 @RegWriteA_LC898122AF(i32 396, i32 49)
br label %9
9: ; preds = %1, %7, %5
ret void
}

LLVM IR (-O2):
define void @RamAccFixMod(i8 zeroext %0) {
switch i8 %0, label %6 [
i8 0, label %3
i8 1, label %2
]
2: ; preds = %1
br label %3
3: ; preds = %1, %2
%4 = phi i32 [ 49, %2 ], [ 0, %1 ]
%5 = tail call i32 @RegWriteA_LC898122AF(i32 396, i32 %4)
br label %6
6: ; preds = %3, %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ WINDOW;

/* Variables and functions */
int /*<<< orphan*/ printGamesList(int /*<<< orphan*/ *);
int /*<<< orphan*/ wbrefresh(int /*<<< orphan*/ *);
int /*<<< orphan*/ wclear(int /*<<< orphan*/ *);
void update_games(WINDOW *win_games) {
  wclear(win_games);
  printGamesList(win_games);
  wbrefresh(win_games);
}


x86 assembly (clang, -O0):
<update_games>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <wclear@plt>
mov    -0x8(%rbp),%rdi
call   1050 <printGamesList@plt>
mov    -0x8(%rbp),%rdi
call   1030 <wbrefresh@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<update_games>:
push   %rbx
mov    %rdi,%rbx
call   1040 <wclear@plt>
mov    %rbx,%rdi
call   1050 <printGamesList@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <wbrefresh@plt>

LLVM IR (-O0):
define void @update_games(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @wclear(i32* %3)
%5 = load i32*, i32** %2
%6 = call i32 @printGamesList(i32* %5)
%7 = load i32*, i32** %2
%8 = call i32 @wbrefresh(i32* %7)
ret void
}

LLVM IR (-O2):
define void @update_games(i32* %0) {
%2 = tail call i32 @wclear(i32* %0)
%3 = tail call i32 @printGamesList(i32* %0)
%4 = tail call i32 @wbrefresh(i32* %0)
ret void
}
int voice_chat_playback_level(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @voice_chat_playback_level() {
ret i32 0
}
unsigned XXH_versionNumber(void) { return (0 * 100 * 100 + 8 * 100 + 0); }


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

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

LLVM IR (-O0):
define i32 @XXH_versionNumber() {
ret i32 800
}

LLVM IR (-O2):
define i32 @XXH_versionNumber() {
ret i32 800
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *);
void _Q_utoq(void) {
  printf("Unimplemented %s called, exiting\n", "_Q_utoq");
  exit(-1);
}


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

x86 assembly (clang, -O2):
<_Q_utoq>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xef3(%rip),%rsi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [34 x i8] c"Unimplemented %s called, exiting\0A\00"
@.str.1 = [8 x i8] c"_Q_utoq\00"
define void @_Q_utoq() {
%1 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@.str = [34 x i8] c"Unimplemented %s called, exiting\0A\00"
@.str.1 = [8 x i8] c"_Q_utoq\00"
define void @_Q_utoq() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @exit(i32 -1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int main() {
  char string[] = "STRING";
  printf("TEST %s", string);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xedb(%rip),%eax
mov    %eax,-0xb(%rbp)
mov    0xed5(%rip),%ax
mov    %ax,-0x7(%rbp)
mov    0xecd(%rip),%al
mov    %al,-0x5(%rbp)
lea    -0xb(%rbp),%rsi
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x474e49,0x3(%rsp)
movl   $0x49525453,(%rsp)
lea    0xee0(%rip),%rdi
mov    %rsp,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@__const.main.string = [7 x i8] c"STRING\00"
@.str = [8 x i8] c"TEST %s\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [7 x i8]
store i32 0, i32* %1
%3 = bitcast [7 x i8]* %2 to i8*
%4 = getelementptr inbounds [7 x i8], [7 x i8]* %2, i64 0, i64 0
%5 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %4)
ret i32 0
}

LLVM IR (-O2):
@__const.main.string = [7 x i8] c"STRING\00"
@.str = [8 x i8] c"TEST %s\00"
define i32 @main() {
%1 = alloca [7 x i8]
%2 = getelementptr inbounds [7 x i8], [7 x i8]* %1, i64 0, i64 0
%3 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 0
}
/* Type definitions */
struct list_item {
  int dummy;
};
struct list {
  int dummy;
};

/* Variables and functions */
struct list_item *list_add(struct list *, void *);
int /*<<< orphan*/ list_inspect(struct list *, void *, size_t);
struct list_item *list_add_one(struct list *target, void *data, size_t n) {
  if (!list_inspect(target, data, n))
    return list_add(target, data);
  return NULL;
}


x86 assembly (clang, -O0):
<list_add_one>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1030 <list_inspect@plt>
cmp    $0x0,%eax
jne    1164 <list_add_one+0x44>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <list_add@plt>
mov    %rax,-0x8(%rbp)
jmp    116c <list_add_one+0x4c>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<list_add_one>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <list_inspect@plt>
test   %eax,%eax
je     113d <list_add_one+0x1d>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <list_add@plt>

LLVM IR (-O0):
%struct.list_item = type { i32 }
%struct.list = type { i32 }
define %struct.list_item* @list_add_one(%struct.list* %0, i8* %1, i64 %2) {
%4 = alloca %struct.list_item*
%5 = alloca %struct.list*
%6 = alloca i8*
%7 = alloca i64
store %struct.list* %0, %struct.list** %5
store i8* %1, i8** %6
store i64 %2, i64* %7
%8 = load %struct.list*, %struct.list** %5
%9 = load i8*, i8** %6
%10 = load i64, i64* %7
%11 = call i32 @list_inspect(%struct.list* %8, i8* %9, i64 %10)
%12 = icmp ne i32 %11, 0
br i1 %12, label %17, label %13
13: ; preds = %3
%14 = load %struct.list*, %struct.list** %5
%15 = load i8*, i8** %6
%16 = call %struct.list_item* @list_add(%struct.list* %14, i8* %15)
store %struct.list_item* %16, %struct.list_item** %4
br label %18
17: ; preds = %3
store %struct.list_item* null, %struct.list_item** %4
br label %18
18: ; preds = %17, %13
%19 = load %struct.list_item*, %struct.list_item** %4
ret %struct.list_item* %19
}

LLVM IR (-O2):
%struct.list_item = type { i32 }
%struct.list = type { i32 }
define %struct.list_item* @list_add_one(%struct.list* %0, i8* %1, i64 %2) {
%4 = tail call i32 @list_inspect(%struct.list* %0, i8* %1, i64 %2)
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call %struct.list_item* @list_add(%struct.list* %0, i8* %1)
br label %8
8: ; preds = %3, %6
%9 = phi %struct.list_item* [ %7, %6 ], [ null, %3 ]
ret %struct.list_item* %9
}
/* Variables and functions */
int /*<<< orphan*/ io_config();
void init_io(void) { io_config(); }


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

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

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

LLVM IR (-O2):
define void @init_io() {
%1 = tail call i32 (...) @io_config()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ PKEY_USAGE_PERIOD;
typedef int /*<<< orphan*/ ASN1_VALUE;

/* Variables and functions */
int ASN1_item_i2d(int /*<<< orphan*/ *, unsigned char **, int /*<<< orphan*/ *);
int /*<<< orphan*/ PKEY_USAGE_PERIOD_it;
int i2d_PKEY_USAGE_PERIOD(PKEY_USAGE_PERIOD *a, unsigned char **out) {
  return ASN1_item_i2d((ASN1_VALUE *)a, out, &PKEY_USAGE_PERIOD_it);
}


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

x86 assembly (clang, -O2):
<i2d_PKEY_USAGE_PERIOD>:
mov    0x2ee1(%rip),%rdx
jmp    1030 <ASN1_item_i2d@plt>

LLVM IR (-O0):
@PKEY_USAGE_PERIOD_it = global i32 0
define i32 @i2d_PKEY_USAGE_PERIOD(i32* %0, i8** %1) {
%3 = alloca i32*
%4 = alloca i8**
store i32* %0, i32** %3
store i8** %1, i8*** %4
%5 = load i32*, i32** %3
%6 = load i8**, i8*** %4
%7 = call i32 @ASN1_item_i2d(i32* %5, i8** %6, i32* @PKEY_USAGE_PERIOD_it)
ret i32 %7
}

LLVM IR (-O2):
@PKEY_USAGE_PERIOD_it = global i32 0
define i32 @i2d_PKEY_USAGE_PERIOD(i32* %0, i8** %1) {
%3 = tail call i32 @ASN1_item_i2d(i32* %0, i8** %1, i32* @PKEY_USAGE_PERIOD_it)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ VIM_SIF_I2cReadByte(int, unsigned char *);
int /*<<< orphan*/ VIM_SIF_I2cWriteByte(int, unsigned char);
void SensorSetMirrorFlip_ET8EC3(unsigned char val) {
  unsigned char x;
  val = ~val;
  VIM_SIF_I2cReadByte(0x04, &x);
  VIM_SIF_I2cWriteByte(0x04, (unsigned char)(x & 0x3f) | ((val & 0x03) << 6));
}


x86 assembly (clang, -O0):
<SensorSetMirrorFlip_ET8EC3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0x1(%rbp)
mov    $0x4,%edi
lea    -0x2(%rbp),%rsi
call   1030 <VIM_SIF_I2cReadByte@plt>
movzbl -0x2(%rbp),%eax
and    $0x3f,%eax
movzbl %al,%eax
movzbl -0x1(%rbp),%ecx
and    $0x3,%ecx
shl    $0x6,%ecx
or     %ecx,%eax
mov    $0x4,%edi
movzbl %al,%esi
call   1040 <VIM_SIF_I2cWriteByte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SensorSetMirrorFlip_ET8EC3>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
lea    0xf(%rsp),%rsi
mov    $0x4,%edi
call   1030 <VIM_SIF_I2cReadByte@plt>
mov    0xf(%rsp),%al
and    $0x3f,%al
not    %bl
shl    $0x6,%bl
or     %al,%bl
movzbl %bl,%esi
mov    $0x4,%edi
call   1040 <VIM_SIF_I2cWriteByte@plt>
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define void @SensorSetMirrorFlip_ET8EC3(i8 zeroext %0) {
%2 = alloca i8
%3 = call i32 @VIM_SIF_I2cReadByte(i32 4, i8* %2)
%4 = load i8, i8* %2
%5 = and i8 %4, 63
%6 = xor i8 %0, -1
%7 = shl i8 %6, 6
%8 = or i8 %5, %7
%9 = call i32 @VIM_SIF_I2cWriteByte(i32 4, i8 zeroext %8)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "usage: mkstr [-] mesgfile prefix file ...\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 = [43 x i8] c"usage: mkstr [-] mesgfile prefix file ...\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [43 x i8] c"usage: mkstr [-] mesgfile prefix file ...\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ AbsoluteIndexedXX1(int);
int /*<<< orphan*/ DEC16(int /*<<< orphan*/, int);
void OpDEM0X1(void) { DEC16(AbsoluteIndexedXX1(3), 0xFFFFFF); }


x86 assembly (clang, -O0):
<OpDEM0X1>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3,%edi
call   1030 <AbsoluteIndexedXX1@plt>
mov    %eax,%edi
mov    $0xffffff,%esi
call   1040 <DEC16@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<OpDEM0X1>:
push   %rax
mov    $0x3,%edi
call   1030 <AbsoluteIndexedXX1@plt>
mov    %eax,%edi
mov    $0xffffff,%esi
pop    %rax
jmp    1040 <DEC16@plt>

LLVM IR (-O0):
define void @OpDEM0X1() {
%1 = call i32 @AbsoluteIndexedXX1(i32 3)
%2 = call i32 @DEC16(i32 %1, i32 16777215)
ret void
}

LLVM IR (-O2):
define void @OpDEM0X1() {
%1 = tail call i32 @AbsoluteIndexedXX1(i32 3)
%2 = tail call i32 @DEC16(i32 %1, i32 16777215)
ret void
}
/* Variables and functions */
int optind;
void reset_getopt(void) { optind = 1; }


x86 assembly (clang, -O0):
<reset_getopt>:
push   %rbp
mov    %rsp,%rbp
mov    0x2edd(%rip),%rax
movl   $0x1,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<reset_getopt>:
mov    0x2ee1(%rip),%rax
movl   $0x1,(%rax)
ret

LLVM IR (-O0):
@optind = global i32 0
define void @reset_getopt() {
store i32 1, i32* @optind
ret void
}

LLVM IR (-O2):
@optind = global i32 0
define void @reset_getopt() {
store i32 1, i32* @optind
ret void
}
int is_posix_like() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @is_posix_like() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void print_int(int *number) { printf("\tInt version: [%d]\n", *number); }


x86 assembly (clang, -O0):
<print_int>:
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):
<print_int>:
mov    (%rdi),%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"\09Int version: [%d]\0A\00"
define void @print_int(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 ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %4)
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"\09Int version: [%d]\0A\00"
define void @print_int(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %2)
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t mtob_d(const uint32_t in) {
  return (in & 0xFF000000 >> 24) + (in & 0x00FF0000 >> 8) +
         (in & 0x0000FF00 << 8) + (in & 0x000000FF << 24);
}


x86 assembly (clang, -O0):
<mtob_d>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff,%eax
mov    -0x4(%rbp),%ecx
and    $0xff00,%ecx
add    %ecx,%eax
mov    -0x4(%rbp),%ecx
and    $0xff0000,%ecx
add    %ecx,%eax
mov    -0x4(%rbp),%ecx
and    $0xff000000,%ecx
add    %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @mtob_d(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 255
%5 = load i32, i32* %2
%6 = and i32 %5, 65280
%7 = add i32 %4, %6
%8 = load i32, i32* %2
%9 = and i32 %8, 16711680
%10 = add i32 %7, %9
%11 = load i32, i32* %2
%12 = and i32 %11, -16777216
%13 = add i32 %10, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @mtob_d(i32 returned %0) {
ret i32 %0
}