xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void usage(int full, const char *arg0) {
  printf("%s - Version "
         "alpha 0.0"
         "\n"
         "Copyright (C) 2014 UTIX SAS \n"
         "\n",
         arg0);
  if (!full)
    return;
  printf("usage: %s [options] filename\n"
         "\n"
         "    filename       path to edf file\n"
         "\n"
         "Options:\n"
         "    -h             show this help\n"
         "    -V             show version\n",
         arg0);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xed6(%rip),%rdi
call   1030 <printf@plt>
cmpl   $0x0,-0x4(%rbp)
jne    113e <usage+0x2e>
jmp    114e <usage+0x3e>
mov    -0x10(%rbp),%rsi
lea    0xeed(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
test   %ebp,%ebp
je     113d <usage+0x2d>
lea    0xf07(%rip),%rdi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <printf@plt>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [54 x i8] c"%s - Version alpha 0.0\0ACopyright (C) 2014 UTIX SAS \0A\0A\00"
@.str.1 = [143 x i8] c"usage: %s [options] filename\0A\0A filename path to edf file\0A\0AOptions:\0A -h show this help\0A -V show version\0A\00"
define void @usage(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = load i32, i32* %3
%8 = icmp ne i32 %7, 0
br i1 %8, label %10, label %9
9: ; preds = %2
br label %13
10: ; preds = %2
%11 = load i8*, i8** %4
%12 = call i32 @printf(i8* getelementptr inbounds ([143 x i8], [143 x i8]* @.str.1, i64 0, i64 0), i8* %11)
br label %13
13: ; preds = %10, %9
ret void
}

LLVM IR (-O2):
@.str = [54 x i8] c"%s - Version alpha 0.0\0ACopyright (C) 2014 UTIX SAS \0A\0A\00"
@.str.1 = [143 x i8] c"usage: %s [options] filename\0A\0A filename path to edf file\0A\0AOptions:\0A -h show this help\0A -V show version\0A\00"
define void @usage(i32 %0, i8* %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0), i8* %1)
%4 = icmp eq i32 %0, 0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @printf(i8* getelementptr inbounds ([143 x i8], [143 x i8]* @.str.1, i64 0, i64 0), i8* %1)
br label %7
7: ; preds = %2, %5
ret void
}
/* Variables and functions */
int strlen(char *);
void canonicalise_path(char *path) {
  int len = strlen(path);
  if (len > 1 && path[len - 1] == '/')
    path[len - 1] = '\0';
}


x86 assembly (clang, -O0):
<canonicalise_path>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
jle    115d <canonicalise_path+0x4d>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x2f,%eax
jne    115d <canonicalise_path+0x4d>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<canonicalise_path>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
cmp    $0x2,%eax
jl     112b <canonicalise_path+0x1b>
add    $0xffffffff,%eax
cmpb   $0x2f,(%rbx,%rax,1)
jne    112b <canonicalise_path+0x1b>
movb   $0x0,(%rbx,%rax,1)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @canonicalise_path(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp sgt i32 %2, 1
br i1 %3, label %4, label %11
4: ; preds = %1
%5 = add nsw i32 %2, -1
%6 = zext i32 %5 to i64
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = load i8, i8* %7
%9 = icmp eq i8 %8, 47
br i1 %9, label %10, label %11
10: ; preds = %4
store i8 0, i8* %7
br label %11
11: ; preds = %10, %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
int write(int, char *, int);
void write_two(int file, char target, char value) {
  char buf[2];
  buf[0] = target;
  buf[1] = value;
  if (write(file, buf, 2) != 2) {
    printf("error: failed to write\n");
    exit(1);
  }
}


x86 assembly (clang, -O0):
<write_two>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dl,%al
mov    %sil,%cl
mov    %edi,-0x4(%rbp)
mov    %cl,-0x5(%rbp)
mov    %al,-0x6(%rbp)
mov    -0x5(%rbp),%al
mov    %al,-0x8(%rbp)
mov    -0x6(%rbp),%al
mov    %al,-0x7(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x8(%rbp),%rsi
mov    $0x2,%edx
call   1030 <write@plt>
cmp    $0x2,%eax
je     1182 <write_two+0x52>
lea    0xe8d(%rip),%rdi
call   1040 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_two>:
push   %rax
mov    %sil,0x6(%rsp)
mov    %dl,0x7(%rsp)
lea    0x6(%rsp),%rsi
mov    $0x2,%edx
call   1040 <write@plt>
cmp    $0x2,%eax
jne    1150 <write_two+0x20>
pop    %rax
ret
lea    0xea9(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"error: failed to write\0A\00"
define void @write_two(i32 %0, i8 signext %1, i8 signext %2) {
%4 = alloca i32
%5 = alloca i8
%6 = alloca i8
%7 = alloca [2 x i8]
store i32 %0, i32* %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%8 = load i8, i8* %5
%9 = getelementptr inbounds [2 x i8], [2 x i8]* %7, i64 0, i64 0
store i8 %8, i8* %9
%10 = load i8, i8* %6
%11 = getelementptr inbounds [2 x i8], [2 x i8]* %7, i64 0, i64 1
store i8 %10, i8* %11
%12 = load i32, i32* %4
%13 = getelementptr inbounds [2 x i8], [2 x i8]* %7, i64 0, i64 0
%14 = call i32 @write(i32 %12, i8* %13, i32 2)
%15 = icmp ne i32 %14, 2
br i1 %15, label %16, label %19
16: ; preds = %3
%17 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%18 = call i32 @exit(i32 1)
unreachable
19: ; preds = %3
ret void
}

LLVM IR (-O2):
@str = [23 x i8] c"error: failed to write\00"
define void @write_two(i32 %0, i8 signext %1, i8 signext %2) {
%4 = alloca [2 x i8]
%5 = getelementptr inbounds [2 x i8], [2 x i8]* %4, i64 0, i64 0
store i8 %1, i8* %5
%6 = getelementptr inbounds [2 x i8], [2 x i8]* %4, i64 0, i64 1
store i8 %2, i8* %6
%7 = call i32 @write(i32 %0, i8* %5, i32 2)
%8 = icmp eq i32 %7, 2
br i1 %8, label %12, label %9
9: ; preds = %3
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
%11 = tail call i32 @exit(i32 1)
unreachable
12: ; preds = %3
ret void
}
void RTTarFileWriteAt(void) {}


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

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

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

LLVM IR (-O2):
define void @RTTarFileWriteAt() {
ret void
}
void gtk_ui_manager_set_add_tearoffs() {}


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

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

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

LLVM IR (-O2):
define void @gtk_ui_manager_set_add_tearoffs() {
ret void
}
long long __aeabi_ldiv0(long long r) { return r; }


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

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

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

LLVM IR (-O2):
define i64 @__aeabi_ldiv0(i64 returned %0) {
ret i64 %0
}
/* Variables and functions */
int forward_azimuth2D(double, double, double, double);
double get_angle(double x1, double y1, double x2, double y2) {
  return 90 -
         forward_azimuth2D(x1, y1, x2, y2) * (180 / 3.14159265358979323846);
}


x86 assembly (clang, -O0):
<get_angle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
movsd  -0x20(%rbp),%xmm3
call   1030 <forward_azimuth2D@plt>
cvtsi2sd %eax,%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  0xe98(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe94(%rip),%xmm1
addsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_angle>:
push   %rax
call   1030 <forward_azimuth2D@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0xedb(%rip),%xmm0
addsd  0xedb(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @get_angle(double %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%9 = load double, double* %5
%10 = load double, double* %6
%11 = load double, double* %7
%12 = load double, double* %8
%13 = call i32 @forward_azimuth2D(double %9, double %10, double %11, double %12)
%14 = sitofp i32 %13 to double
%15 = fneg double %14
%16 = call double @llvm.fmuladd.f64(double %15, double 0x404CA5DC1A63C1F8, double 9.000000e+01)
ret double %16
}

LLVM IR (-O2):
define double @get_angle(double %0, double %1, double %2, double %3) {
%5 = tail call i32 @forward_azimuth2D(double %0, double %1, double %2, double %3)
%6 = sitofp i32 %5 to double
%7 = fneg double %6
%8 = tail call double @llvm.fmuladd.f64(double %7, double 0x404CA5DC1A63C1F8, double 9.000000e+01)
ret double %8
}
/* Variables and functions */
int /*<<< orphan*/ debug(char *, ...);
int G93_f(char *s) {
  debug("G93_f(const char *s) is not yet implemented!\n");
  debug("%s\n", s);
  return 1;
}


x86 assembly (clang, -O0):
<G93_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    -0x8(%rbp),%rsi
lea    0xef9(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<G93_f>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <debug@plt>
lea    0xf05(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <debug@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [46 x i8] c"G93_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @G93_f(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 1
}

LLVM IR (-O2):
@.str = [46 x i8] c"G93_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @G93_f(i8* %0) {
%2 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret i32 1
}
int intCompare(const void *p1, const void *p2) {
  int *rc1 = (int *)p1;
  int *rc2 = (int *)p2;
  int i = *rc1;
  int j = *rc2;
  if (i > j)
    return (1);
  if (i < j)
    return (-1);
  return (0);
}


x86 assembly (clang, -O0):
<intCompare>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x28(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x30(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x30(%rbp),%eax
jle    1146 <intCompare+0x46>
movl   $0x1,-0x4(%rbp)
jmp    1165 <intCompare+0x65>
mov    -0x2c(%rbp),%eax
cmp    -0x30(%rbp),%eax
jge    115e <intCompare+0x5e>
movl   $0xffffffff,-0x4(%rbp)
jmp    1165 <intCompare+0x65>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<intCompare>:
mov    (%rdi),%eax
mov    (%rsi),%ecx
xor    %edx,%edx
cmp    %ecx,%eax
setl   %dl
neg    %edx
cmp    %ecx,%eax
mov    $0x1,%eax
cmovle %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @intCompare(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = bitcast i8* %1 to i32*
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = icmp sgt i32 %5, %6
%8 = icmp slt i32 %5, %6
%9 = sext i1 %8 to i32
%10 = select i1 %7, i32 1, i32 %9
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ check(unsigned int, unsigned int, unsigned int,
                         unsigned int);
float *p(float *in, unsigned x, unsigned y, unsigned w, unsigned h) {
  check(x, y, w, h);
  return &in[(size_t)y * w + x];
}


x86 assembly (clang, -O0):
<p>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
call   1030 <check@plt>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
mov    -0x14(%rbp),%edx
imul   %rdx,%rcx
mov    -0xc(%rbp),%edx
add    %rdx,%rcx
shl    $0x2,%rcx
add    %rcx,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<p>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %ecx,%ebx
mov    %edx,%ebp
mov    %esi,%r14d
mov    %rdi,%r15
mov    %esi,%edi
mov    %edx,%esi
mov    %ecx,%edx
mov    %r8d,%ecx
call   1030 <check@plt>
mov    %ebp,%eax
mov    %ebx,%ecx
imul   %rax,%rcx
mov    %r14d,%eax
add    %rcx,%rax
lea    (%r15,%rax,4),%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define float* @p(float* %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca float*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store float* %0, float** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = load i32, i32* %7
%12 = load i32, i32* %8
%13 = load i32, i32* %9
%14 = load i32, i32* %10
%15 = call i32 @check(i32 %11, i32 %12, i32 %13, i32 %14)
%16 = load float*, float** %6
%17 = load i32, i32* %8
%18 = zext i32 %17 to i64
%19 = load i32, i32* %9
%20 = zext i32 %19 to i64
%21 = mul i64 %18, %20
%22 = load i32, i32* %7
%23 = zext i32 %22 to i64
%24 = add i64 %21, %23
%25 = getelementptr inbounds float, float* %16, i64 %24
ret float* %25
}

LLVM IR (-O2):
define float* @p(float* readnone %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = tail call i32 @check(i32 %1, i32 %2, i32 %3, i32 %4)
%7 = zext i32 %2 to i64
%8 = zext i32 %3 to i64
%9 = mul nuw i64 %8, %7
%10 = zext i32 %1 to i64
%11 = add nuw i64 %9, %10
%12 = getelementptr inbounds float, float* %0, i64 %11
ret float* %12
}
/* Type definitions */
struct pci_ops {
  int dummy;
};
struct pci_bus {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ pci_bus_add_devices(struct pci_bus *);
struct pci_bus *pci_scan_bus_parented(void *, int, struct pci_ops *, void *);
__attribute__((always_)) struct pci_bus *
pci_scan_bus(int bus, struct pci_ops *ops, void *sysdata) {
  struct pci_bus *root_bus;
  root_bus = pci_scan_bus_parented(((void *)0), bus, ops, sysdata);
  if (root_bus)
    pci_bus_add_devices(root_bus);
  return root_bus;
}


x86 assembly (clang, -O0):
<pci_scan_bus>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
xor    %eax,%eax
mov    %eax,%edi
call   1030 <pci_scan_bus_parented@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     115f <pci_scan_bus+0x3f>
mov    -0x20(%rbp),%rdi
call   1040 <pci_bus_add_devices@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pci_scan_bus>:
push   %rbx
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %edi,%esi
xor    %edi,%edi
call   1030 <pci_scan_bus_parented@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1140 <pci_scan_bus+0x20>
mov    %rbx,%rdi
call   1040 <pci_bus_add_devices@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
%struct.pci_bus = type { i32 }
%struct.pci_ops = type { i32 }
define %struct.pci_bus* @pci_scan_bus(i32 %0, %struct.pci_ops* %1, i8* %2) {
%4 = tail call %struct.pci_bus* @pci_scan_bus_parented(i8* null, i32 %0, %struct.pci_ops* %1, i8* %2)
%5 = icmp eq %struct.pci_bus* %4, null
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i32 @pci_bus_add_devices(%struct.pci_bus* %4)
br label %8
8: ; preds = %6, %3
ret %struct.pci_bus* %4
}
int f(int a, int b) {
  a %= b;
  return a % b;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
mov    -0x4(%rbp),%eax
cltd
idiv   %ecx
mov    %edx,-0x4(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
mov    %edi,%eax
cltd
idiv   %esi
mov    %edx,%eax
ret

LLVM IR (-O0):
define i32 @f(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 = srem i32 %6, %5
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = srem i32 %8, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @f(i32 %0, i32 %1) {
%3 = srem i32 %0, %1
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void *realloc(void *, size_t);
int /*<<< orphan*/ writestr(int, char *);
void *sizeset(void *p, size_t size) {
  void *ret;
  if ((ret = realloc(p, size)) == 0) {
    writestr(2, "libhutils: Can't alloc\n");
    exit(1);
  }
  return ret;
}


x86 assembly (clang, -O0):
<sizeset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <realloc@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    1176 <sizeset+0x46>
mov    $0x2,%edi
lea    0xe99(%rip),%rsi
call   1030 <writestr@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sizeset>:
push   %rax
call   1040 <realloc@plt>
test   %rax,%rax
je     113d <sizeset+0xd>
pop    %rcx
ret
lea    0xebc(%rip),%rsi
mov    $0x2,%edi
call   1030 <writestr@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"libhutils: Can't alloc\0A\00"
define i8* @sizeset(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i8*, i8** %3
%7 = load i64, i64* %4
%8 = call i8* @realloc(i8* %6, i64 %7)
store i8* %8, i8** %5
%9 = icmp eq i8* %8, null
br i1 %9, label %10, label %13
10: ; preds = %2
%11 = call i32 @writestr(i32 2, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%12 = call i32 @exit(i32 1)
unreachable
13: ; preds = %2
%14 = load i8*, i8** %5
ret i8* %14
}

LLVM IR (-O2):
@.str = [24 x i8] c"libhutils: Can't alloc\0A\00"
define noalias i8* @sizeset(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 %8
5: ; preds = %2
%6 = tail call i32 @writestr(i32 2, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %2
ret i8* %3
}
/* Variables and functions */
int gob_encode_end_struct(char *buf, size_t buf_size) {
  if (buf_size > 0)
    *buf = '\0';
  return 1;
}


x86 assembly (clang, -O0):
<gob_encode_end_struct>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jbe    111e <gob_encode_end_struct+0x1e>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gob_encode_end_struct>:
test   %rsi,%rsi
je     1108 <gob_encode_end_struct+0x8>
movb   $0x0,(%rdi)
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @gob_encode_end_struct(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = icmp ugt i64 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = load i8*, i8** %3
store i8 0, i8* %8
br label %9
9: ; preds = %7, %2
ret i32 1
}

LLVM IR (-O2):
define i32 @gob_encode_end_struct(i8* nocapture writeonly %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %5, label %4
4: ; preds = %2
store i8 0, i8* %0
br label %5
5: ; preds = %4, %2
ret i32 1
}
/* Type definitions */
struct S {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ hip3(struct S *);
__attribute__((flatten)) void hiphip3(struct S *p) { hip3(p); }


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

x86 assembly (clang, -O2):
<hiphip3>:
jmp    1030 <hip3@plt>

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

LLVM IR (-O2):
%struct.S = type { i32 }
define void @hiphip3(%struct.S* %0) {
%2 = tail call i32 @hip3(%struct.S* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Printf(char *, int);
void ydhi(int x) { Printf("You don't have item %c!", x); }


x86 assembly (clang, -O0):
<ydhi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xedb(%rip),%rdi
call   1030 <Printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [24 x i8] c"You don't have item %c!\00"
define void @ydhi(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @Printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [24 x i8] c"You don't have item %c!\00"
define void @ydhi(i32 %0) {
%2 = tail call i32 @Printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void show_hex(const unsigned char *array, int len) {
  while (len--) {
    printf("%.02x", *array++);
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<show_hex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0xc(%rbp)
cmp    $0x0,%eax
je     1158 <show_hex+0x48>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movzbl (%rax),%esi
lea    0xeb4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    111f <show_hex+0xf>
lea    0xea7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<show_hex>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
je     1158 <show_hex+0x38>
mov    %rdi,%r15
mov    %esi,%r12d
lea    0xec7(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
movzbl (%r15,%rbx,1),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %ebx,%r12d
jne    1140 <show_hex+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@.str = [6 x i8] c"%.02x\00"
define void @show_hex(i8* nocapture %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %13, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ %1, %2 ]
%6 = phi i8* [ %8, %4 ], [ %0, %2 ]
%7 = add nsw i32 %5, -1
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %6
%10 = zext i8 %9 to i32
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = icmp eq i32 %7, 0
br i1 %12, label %13, label %4
13: ; preds = %4, %2
%14 = tail call i32 @putchar(i32 10)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ hash_bytes(char const *, int /*<<< orphan*/,
                              int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char const *);
uint32_t hash_string(const char *s, uint32_t basis) {
  return hash_bytes(s, strlen(s), basis);
}


x86 assembly (clang, -O0):
<hash_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%esi
mov    -0xc(%rbp),%edx
call   1040 <hash_bytes@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_string>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
mov    %ebp,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <hash_bytes@plt>

LLVM IR (-O0):
define i32 @hash_string(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 = load i8*, i8** %3
%7 = call i32 @strlen(i8* %6)
%8 = load i32, i32* %4
%9 = call i32 @hash_bytes(i8* %5, i32 %7, i32 %8)
ret i32 %9
}

LLVM IR (-O2):
define i32 @hash_string(i8* %0, i32 %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = tail call i32 @hash_bytes(i8* %0, i32 %3, i32 %1)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
char *getprogname();
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "usage: %s keypath\n", getprogname());
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ea1(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getprogname@plt>
mov    -0x4(%rbp),%edi
mov    %rax,%rdx
lea    0xea8(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    0x2ea8(%rip),%rax
mov    (%rax),%ebx
xor    %eax,%eax
call   1030 <getprogname@plt>
lea    0xeb8(%rip),%rsi
mov    %ebx,%edi
mov    %rax,%rdx
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [19 x i8] c"usage: %s keypath\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i8* (...) @getprogname()
%3 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [19 x i8] c"usage: %s keypath\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i8* (...) @getprogname()
%3 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = tail call i32 @exit(i32 1)
unreachable
}
void p2p_register_cmds(void) {}


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

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

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

LLVM IR (-O2):
define void @p2p_register_cmds() {
ret void
}
int foo(int *p, int n) {
  int i, j, k = 0;
  for (i = 0; i < 2; ++i, p += n)
    for (j = 0; j < 2; ++j)
      k += p[j];
  return k;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x2,-0x10(%rbp)
jge    117b <foo+0x7b>
movl   $0x0,-0x14(%rbp)
cmpl   $0x2,-0x14(%rbp)
jge    1153 <foo+0x53>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
add    -0x18(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112a <foo+0x2a>
jmp    1158 <foo+0x58>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
movslq %ecx,%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
jmp    1119 <foo+0x19>
mov    -0x18(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
movslq %esi,%rcx
mov    0x4(%rdi),%eax
add    (%rdi),%eax
add    (%rdi,%rcx,4),%eax
add    0x4(%rdi,%rcx,4),%eax
ret

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

LLVM IR (-O2):
define i32 @foo(i32* nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = load i32, i32* %0
%5 = getelementptr inbounds i32, i32* %0, i64 1
%6 = load i32, i32* %5
%7 = add nsw i32 %6, %4
%8 = getelementptr inbounds i32, i32* %0, i64 %3
%9 = load i32, i32* %8
%10 = add nsw i32 %9, %7
%11 = getelementptr inbounds i32, i32* %8, i64 1
%12 = load i32, i32* %11
%13 = add nsw i32 %12, %10
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int setbits(int, int, int, int);
int main() {
  printf("%d\n", setbits(60, 4, 3, 80));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x3c,%edi
mov    $0x4,%esi
mov    $0x3,%edx
mov    $0x50,%ecx
call   1040 <setbits@plt>
mov    %eax,%esi
lea    0xeaf(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x3c,%edi
mov    $0x4,%esi
mov    $0x3,%edx
mov    $0x50,%ecx
call   1040 <setbits@plt>
lea    0xebf(%rip),%rdi
mov    %eax,%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
store i32 0, i32* %1
%2 = call i32 @setbits(i32 60, i32 4, i32 3, i32 80)
%3 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @setbits(i32 60, i32 4, i32 3, i32 80)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ _IONBF;
int /*<<< orphan*/ setvbuf(int /*<<< orphan*/, int /*<<< orphan*/ *,
                           int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
int /*<<< orphan*/ test_friend_request();
int main(void) {
  setvbuf(stdout, NULL, _IONBF, 0);
  test_friend_request();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
mov    0x2ea9(%rip),%rax
mov    (%rax),%edx
xor    %eax,%eax
mov    %eax,%esi
xor    %ecx,%ecx
call   1030 <setvbuf@plt>
mov    $0x0,%al
call   1040 <test_friend_request@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
mov    0x2eb7(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
xor    %ecx,%ecx
call   1030 <setvbuf@plt>
xor    %eax,%eax
call   1040 <test_friend_request@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stdout = global i32 0
@_IONBF = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* @stdout
%3 = load i32, i32* @_IONBF
%4 = call i32 @setvbuf(i32 %2, i32* null, i32 %3, i32 0)
%5 = call i32 (...) @test_friend_request()
ret i32 0
}

LLVM IR (-O2):
@stdout = global i32 0
@_IONBF = global i32 0
define i32 @main() {
%1 = load i32, i32* @stdout
%2 = load i32, i32* @_IONBF
%3 = tail call i32 @setvbuf(i32 %1, i32* null, i32 %2, i32 0)
%4 = tail call i32 (...) @test_friend_request()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ sum(int, int);
int main(void) { sum(1, 2); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
mov    $0x2,%esi
call   1030 <sum@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
mov    $0x2,%esi
call   1030 <sum@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 @sum(i32 1, i32 2)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @sum(i32 1, i32 2)
ret i32 0
}
void outl(short port, int data) {
  __asm__("outl %%eax,%%dx" ::"a"(data), "d"(port));
}


x86 assembly (clang, -O0):
<outl>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x2(%rbp),%dx
out    %eax,(%dx)
pop    %rbp
ret

x86 assembly (clang, -O2):
<outl>:
mov    %esi,%eax
mov    %edi,%edx
out    %eax,(%dx)
ret

LLVM IR (-O0):
define void @outl(i16 signext %0, i32 %1) {
%3 = alloca i16
%4 = alloca i32
store i16 %0, i16* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i16, i16* %3
ret void
}

LLVM IR (-O2):
define void @outl(i16 signext %0, i32 %1) {
tail call void asm sideeffect "outl %eax,%dx", "{ax},{dx},~{dirflag},~{fpsr},~{flags}"(i32 %1, i16 %0)
ret void
}
char *XLocaleOfOM() {}


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

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

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

LLVM IR (-O2):
define noalias i8* @XLocaleOfOM() {
ret i8* undef
}
void helper_function(void) {
  long i, j;
  __asm__("");
}


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

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

LLVM IR (-O0):
define void @helper_function() {
%1 = alloca i64
%2 = alloca i64
ret void
}

LLVM IR (-O2):
define void @helper_function() {
tail call void asm sideeffect "", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void bar() { printf("in bar\n"); }


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

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

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

LLVM IR (-O2):
@str = [7 x i8] c"in bar\00"
define void @bar() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
ret void
}
long long ruleTwo(long long x) {
  x = 3 * x + 1;
  return x;
}


x86 assembly (clang, -O0):
<ruleTwo>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
imul   $0x3,-0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ruleTwo>:
lea    (%rdi,%rdi,2),%rax
add    $0x1,%rax
ret

LLVM IR (-O0):
define i64 @ruleTwo(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = mul nsw i64 3, %3
%5 = add nsw i64 %4, 1
store i64 %5, i64* %2
%6 = load i64, i64* %2
ret i64 %6
}

LLVM IR (-O2):
define i64 @ruleTwo(i64 %0) {
%2 = mul nsw i64 %0, 3
%3 = add nsw i64 %2, 1
ret i64 %3
}
void wifi_evt_sme_wifi_is_off(
    const struct wifi_msg_sme_wifi_is_off_evt_t *msg) {}


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

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

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

LLVM IR (-O2):
%struct.wifi_msg_sme_wifi_is_off_evt_t = type opaque
define void @wifi_evt_sme_wifi_is_off(%struct.wifi_msg_sme_wifi_is_off_evt_t* nocapture %0) {
ret void
}
void csv_log_setup(struct _nlTestSuite *inSuite, int inResult, int inWidth) {
  printf("'#2:','%-*s','%s'\n", inWidth, "Setup",
         inResult == -1 ? "FAILED" : "PASSED");
}


x86 assembly (clang, -O0):
<csv_log_setup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x10(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xef1(%rip),%rcx
lea    0xee3(%rip),%rax
cmp    $0xffffffff,%edx
cmove  %rax,%rcx
lea    0xebc(%rip),%rdi
lea    0xec8(%rip),%rdx
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<csv_log_setup>:
cmp    $0xffffffff,%esi
lea    0xeff(%rip),%rax
lea    0xeff(%rip),%rcx
cmove  %rax,%rcx
lea    0xed4(%rip),%rdi
lea    0xee0(%rip),%rax
mov    %edx,%esi
mov    %rax,%rdx
xor    %eax,%eax
jmp    1030 <printf@plt>

LLVM IR (-O0):
%struct._nlTestSuite = type opaque
@.str = [19 x i8] c"':','%-*s','%s'\0A\00"
@.str.1 = [6 x i8] c"Setup\00"
@.str.2 = [7 x i8] c"FAILED\00"
@.str.3 = [7 x i8] c"PASSED\00"
define void @csv_log_setup(%struct._nlTestSuite* %0, i32 %1, i32 %2) {
%4 = alloca %struct._nlTestSuite*
%5 = alloca i32
%6 = alloca i32
store %struct._nlTestSuite* %0, %struct._nlTestSuite** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %6
%8 = load i32, i32* %5
%9 = icmp eq i32 %8, -1
%10 = zext i1 %9 to i64
%11 = select i1 %9, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0)
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %7, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* %11)
ret void
}

LLVM IR (-O2):
%struct._nlTestSuite = type opaque
@.str = [19 x i8] c"':','%-*s','%s'\0A\00"
@.str.1 = [6 x i8] c"Setup\00"
@.str.2 = [7 x i8] c"FAILED\00"
@.str.3 = [7 x i8] c"PASSED\00"
define void @csv_log_setup(%struct._nlTestSuite* nocapture readnone %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %1, -1
%5 = select i1 %4, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0)
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* %5)
ret void
}
/* Variables and functions */
unsigned int list_set(int /*<<< orphan*/ *, int /*<<< orphan*/,
                      int /*<<< orphan*/ *);
bool test_list_set_null_params(void) {
  bool pass = false;
  unsigned int res = list_set(NULL, 0, NULL);
  if (res == 1) {
    pass = true;
  }
  return pass;
}


x86 assembly (clang, -O0):
<test_list_set_null_params>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,%edx
xor    %esi,%esi
mov    %rdx,%rdi
call   1030 <list_set@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    1141 <test_list_set_null_params+0x31>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_list_set_null_params>:
push   %rax
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
call   1030 <list_set@plt>
xor    %ecx,%ecx
cmp    $0x1,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @test_list_set_null_params() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @list_set(i32* null, i32 0, i32* null)
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = icmp eq i32 %4, 1
br i1 %5, label %6, label %7
6: ; preds = %0
store i32 1, i32* %1
br label %7
7: ; preds = %6, %0
%8 = load i32, i32* %1
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_list_set_null_params() {
%1 = tail call i32 @list_set(i32* null, i32 0, i32* null)
%2 = icmp eq i32 %1, 1
%3 = zext i1 %2 to i32
ret i32 %3
}
void ExttRegistrarAuxTable(void) {}


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

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

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

LLVM IR (-O2):
define void @ExttRegistrarAuxTable() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ push(int /*<<< orphan*/);
int /*<<< orphan*/ top();
void duplicate_top(void) { push(top()); }


x86 assembly (clang, -O0):
<duplicate_top>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <top@plt>
mov    %eax,%edi
call   1040 <push@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<duplicate_top>:
push   %rax
xor    %eax,%eax
call   1030 <top@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <push@plt>

LLVM IR (-O0):
define void @duplicate_top() {
%1 = call i32 (...) @top()
%2 = call i32 @push(i32 %1)
ret void
}

LLVM IR (-O2):
define void @duplicate_top() {
%1 = tail call i32 (...) @top()
%2 = tail call i32 @push(i32 %1)
ret void
}
/* Variables and functions */
bool timeout_reached(void) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @timeout_reached() {
ret i32 0
}
/* Variables and functions */
void *n2(size_t);
void *o(size_t n) { return n2(n); }


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

x86 assembly (clang, -O2):
<o>:
jmp    1030 <n2@plt>

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

LLVM IR (-O2):
define i8* @o(i64 %0) {
%2 = tail call i8* @n2(i64 %0)
ret i8* %2
}
void BootConfigWrite(void) {}


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

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

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

LLVM IR (-O2):
define void @BootConfigWrite() {
ret void
}
int input_update() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @input_update() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ __free_cf(void *);
void CGPDFStreamRelease(void *item) { __free_cf(item); }


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

x86 assembly (clang, -O2):
<CGPDFStreamRelease>:
jmp    1030 <__free_cf@plt>

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

LLVM IR (-O2):
define void @CGPDFStreamRelease(i8* %0) {
%2 = tail call i32 @__free_cf(i8* %0)
ret void
}
void foo580(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo580(i32 %0) {
ret void
}