xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ EINTR;
scalar_t__ errno;
int read(int, void *, int);
int unix_read(int fd, void *buff, int len) {
  int ret;
  do {
    ret = read(fd, buff, len);
  } while (ret < 0 && errno == EINTR);
  return ret;
}


x86 assembly (clang, -O0):
<unix_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <read@plt>
mov    %eax,-0x18(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x18(%rbp)
mov    %al,-0x19(%rbp)
jge    115d <unix_read+0x4d>
mov    0x2e96(%rip),%rax
mov    (%rax),%rax
mov    0x2e84(%rip),%rcx
cmp    (%rcx),%rax
sete   %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    1122 <unix_read+0x12>
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unix_read>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %edx,%r14d
mov    %rsi,%rbx
mov    %edi,%ebp
mov    0x2eb9(%rip),%r15
mov    0x2eaa(%rip),%r12
xchg   %ax,%ax
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r14d,%edx
call   1030 <read@plt>
test   %eax,%eax
jns    114a <unix_read+0x3a>
mov    (%r12),%rcx
cmp    %rcx,(%r15)
je     1130 <unix_read+0x20>
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@errno = global i64 0
@EINTR = global i64 0
define i32 @unix_read(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
br label %8
8: ; preds = %20, %3
%9 = load i32, i32* %4
%10 = load i8*, i8** %5
%11 = load i32, i32* %6
%12 = call i32 @read(i32 %9, i8* %10, i32 %11)
store i32 %12, i32* %7
br label %13
13: ; preds = %8
%14 = load i32, i32* %7
%15 = icmp slt i32 %14, 0
br i1 %15, label %16, label %20
16: ; preds = %13
%17 = load i64, i64* @errno
%18 = load i64, i64* @EINTR
%19 = icmp eq i64 %17, %18
br label %20
20: ; preds = %16, %13
%21 = phi i1 [ false, %13 ], [ %19, %16 ]
br i1 %21, label %8, label %22
22: ; preds = %20
%23 = load i32, i32* %7
ret i32 %23
}

LLVM IR (-O2):
@errno = global i64 0
@EINTR = global i64 0
define i32 @unix_read(i32 %0, i8* nocapture %1, i32 %2) {
br label %4
4: ; preds = %4, %3
%5 = tail call i32 @read(i32 %0, i8* %1, i32 %2)
%6 = icmp slt i32 %5, 0
%7 = load i64, i64* @errno
%8 = load i64, i64* @EINTR
%9 = icmp eq i64 %7, %8
%10 = select i1 %6, i1 %9, i1 false
br i1 %10, label %4, label %11
11: ; preds = %4
ret i32 %5
}
/* Type definitions */
struct stat64 {
  int dummy;
};

/* Variables and functions */
int __lxstat64(int, char const *, struct stat64 *);
int ___lxstat64(int ver, const char *path, struct stat64 *sb) {
  return __lxstat64(ver, path, sb);
}


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

x86 assembly (clang, -O2):
<___lxstat64>:
jmp    1030 <__lxstat64@plt>

LLVM IR (-O0):
%struct.stat64 = type { i32 }
define i32 @___lxstat64(i32 %0, i8* %1, %struct.stat64* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca %struct.stat64*
store i32 %0, i32* %4
store i8* %1, i8** %5
store %struct.stat64* %2, %struct.stat64** %6
%7 = load i32, i32* %4
%8 = load i8*, i8** %5
%9 = load %struct.stat64*, %struct.stat64** %6
%10 = call i32 @__lxstat64(i32 %7, i8* %8, %struct.stat64* %9)
ret i32 %10
}

LLVM IR (-O2):
%struct.stat64 = type { i32 }
define i32 @___lxstat64(i32 %0, i8* %1, %struct.stat64* %2) {
%4 = tail call i32 @__lxstat64(i32 %0, i8* %1, %struct.stat64* %2)
ret i32 %4
}
/* Variables and functions */
int output_main(int, char **);
int main(int argc, char *argv[]) { return (output_main(argc, argv)); }


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

x86 assembly (clang, -O2):
<main>:
jmp    1030 <output_main@plt>

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @output_main(i32 %0, i8** %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stdout;
char *wait_result();
char *run_command(char *command) {
  fprintf(stdout, "%s\n", command);
  return wait_result();
}


x86 assembly (clang, -O0):
<run_command>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x0,%al
call   1040 <wait_result@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<run_command>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <wait_result@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define i8* @run_command(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stdout
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i8* (...) @wait_result()
ret i8* %6
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define i8* @run_command(i8* %0) {
%2 = load i32, i32* @stdout
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i8* (...) @wait_result()
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ single_decay(float, float, float);
int main() {
  float Lambda = 1.0 / 2.0;
  float N_0 = 100.0;
  float Dt = 0.001;
  single_decay(N_0, Lambda, Dt);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movss  0xee1(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  0xed0(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  0xebf(%rip),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0xc(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
movss  -0x10(%rbp),%xmm2
call   1030 <single_decay@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movss  0xee7(%rip),%xmm0
movss  0xee3(%rip),%xmm1
movss  0xedf(%rip),%xmm2
call   1030 <single_decay@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
%4 = alloca float
store i32 0, i32* %1
store float 5.000000e-01, float* %2
store float 1.000000e+02, float* %3
store float 0x3F50624DE0000000, float* %4
%5 = load float, float* %3
%6 = load float, float* %2
%7 = load float, float* %4
%8 = call i32 @single_decay(float %5, float %6, float %7)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @single_decay(float 1.000000e+02, float 5.000000e-01, float 0x3F50624DE0000000)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ term_reset();
void logger_log(char *message) {
  printf("  ");
  term_reset();
  puts(message);
}


x86 assembly (clang, -O0):
<logger_log>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xebd(%rip),%rdi
call   1050 <printf@plt>
mov    $0x0,%al
call   1030 <term_reset@plt>
mov    -0x8(%rbp),%rdi
call   1040 <puts@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<logger_log>:
push   %rbx
mov    %rdi,%rbx
lea    0xec5(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
call   1030 <term_reset@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <puts@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c" \00"
define void @logger_log(i8* nocapture %0) {
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @term_reset()
%4 = tail call i32 @puts(i8* dereferenceable(1) %0)
ret void
}
void f_acc_data(void) {
  unsigned int i;
#pragma acc data
  {
#pragma acc loop
    for (i = 0; i < 2; ++i)
      ;
#pragma acc data
    {
#pragma acc loop
      for (i = 0; i < 2; ++i)
        ;
    }
  }
}


x86 assembly (clang, -O0):
<f_acc_data>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0x2,-0x4(%rbp)
jae    1128 <f_acc_data+0x28>
jmp    111a <f_acc_data+0x1a>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110b <f_acc_data+0xb>
movl   $0x0,-0x4(%rbp)
cmpl   $0x2,-0x4(%rbp)
jae    114c <f_acc_data+0x4c>
jmp    113e <f_acc_data+0x3e>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    112f <f_acc_data+0x2f>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @f_acc_data() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ set_mode(int);
int f_v98(int mode, unsigned char **sec, float *data, unsigned int ndata,
          char *inv_out, void **local) {
  set_mode(98);
  return 0;
}


x86 assembly (clang, -O0):
<f_v98>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    $0x62,%edi
call   1030 <set_mode@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_v98>:
push   %rax
mov    $0x62,%edi
call   1030 <set_mode@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @f_v98(i32 %0, i8** %1, float* %2, i32 %3, i8* %4, i8** %5) {
%7 = alloca i32
%8 = alloca i8**
%9 = alloca float*
%10 = alloca i32
%11 = alloca i8*
%12 = alloca i8**
store i32 %0, i32* %7
store i8** %1, i8*** %8
store float* %2, float** %9
store i32 %3, i32* %10
store i8* %4, i8** %11
store i8** %5, i8*** %12
%13 = call i32 @set_mode(i32 98)
ret i32 0
}

LLVM IR (-O2):
define i32 @f_v98(i32 %0, i8** nocapture readnone %1, float* nocapture readnone %2, i32 %3, i8* nocapture readnone %4, i8** nocapture readnone %5) {
%7 = tail call i32 @set_mode(i32 98)
ret i32 0
}
/* Variables and functions */
int day_of_year(int, int, int);
int /*<<< orphan*/ month_day(int, int, int *, int *);
int /*<<< orphan*/ printf(char *, int, ...);
int main(void) {
  int day, dat, mon;
  day = day_of_year(1981, 10, 2);
  printf("%d\n", day);
  month_day(1981, 252, &mon, &dat);
  printf("%d,%d", mon, dat);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x7bd,%edi
mov    $0xa,%esi
mov    $0x2,%edx
call   1050 <day_of_year@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xea0(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x7bd,%edi
mov    $0xfc,%esi
lea    -0x10(%rbp),%rdx
lea    -0xc(%rbp),%rcx
call   1030 <month_day@plt>
mov    -0x10(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xe79(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x7bd,%edi
mov    $0xa,%esi
mov    $0x2,%edx
call   1050 <day_of_year@plt>
lea    0xeb4(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rsp,%rdx
lea    0x4(%rsp),%rcx
mov    $0x7bd,%edi
mov    $0xfc,%esi
call   1030 <month_day@plt>
mov    (%rsp),%esi
mov    0x4(%rsp),%edx
lea    0xe8a(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [6 x i8] c"%d,%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = tail call i32 @day_of_year(i32 1981, i32 10, i32 2)
%6 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = call i32 @month_day(i32 1981, i32 252, i32* %2, i32* %1)
%8 = load i32, i32* %2
%9 = load i32, i32* %1
%10 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 %8, i32 %9)
ret i32 0
}
/* Variables and functions */
scalar_t__ ceil(unsigned long);
unsigned long compressBound(unsigned long sourceLen) {
  return (((int)ceil(sourceLen * 1.001)) + 12);
}


x86 assembly (clang, -O0):
<compressBound>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movaps 0xedd(%rip),%xmm1
movq   -0x8(%rbp),%xmm0
punpckldq %xmm1,%xmm0
movapd 0xedc(%rip),%xmm1
subpd  %xmm1,%xmm0
movaps %xmm0,%xmm1
unpckhpd %xmm0,%xmm0
addsd  %xmm1,%xmm0
movsd  0xed5(%rip),%xmm1
mulsd  %xmm1,%xmm0
movaps %xmm0,%xmm1
cvttsd2si %xmm1,%rdi
mov    %rdi,%rcx
sar    $0x3f,%rcx
movsd  0xec2(%rip),%xmm1
subsd  %xmm1,%xmm0
cvttsd2si %xmm0,%rax
and    %rcx,%rax
or     %rax,%rdi
call   1030 <ceil@plt>
add    $0xc,%eax
cltq
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<compressBound>:
push   %rax
movq   %rdi,%xmm0
punpckldq 0xee2(%rip),%xmm0
subpd  0xeea(%rip),%xmm0
movapd %xmm0,%xmm1
unpckhpd %xmm0,%xmm1
addsd  %xmm0,%xmm1
mulsd  0xee6(%rip),%xmm1
cvttsd2si %xmm1,%rax
mov    %rax,%rcx
sar    $0x3f,%rcx
subsd  0xeda(%rip),%xmm1
cvttsd2si %xmm1,%rdi
and    %rcx,%rdi
or     %rax,%rdi
call   1030 <ceil@plt>
add    $0xc,%eax
cltq
pop    %rcx
ret

LLVM IR (-O0):
define i64 @compressBound(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = uitofp i64 %3 to double
%5 = fmul double %4, 1.001000e+00
%6 = fptoui double %5 to i64
%7 = call i64 @ceil(i64 %6)
%8 = trunc i64 %7 to i32
%9 = add nsw i32 %8, 12
%10 = sext i32 %9 to i64
ret i64 %10
}

LLVM IR (-O2):
define i64 @compressBound(i64 %0) {
%2 = uitofp i64 %0 to double
%3 = fmul double %2, 1.001000e+00
%4 = fptoui double %3 to i64
%5 = tail call i64 @ceil(i64 %4)
%6 = shl i64 %5, 32
%7 = add i64 %6, 51539607552
%8 = ashr exact i64 %7, 32
ret i64 %8
}
/* Variables and functions */
int get_fsel_bank_no(int);
int mmio_read(int);
int /*<<< orphan*/ mmio_write(int, int);
void gpioSetInput(int no) {
  int pinno = no % 10;
  int bankno = get_fsel_bank_no(pinno);
  int ireg = mmio_read(bankno);
  ireg &= ~(1 << (pinno * 3));
  mmio_write(bankno, ireg);
}


x86 assembly (clang, -O0):
<gpioSetInput>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <get_fsel_bank_no@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1040 <mmio_read@plt>
mov    %eax,-0x10(%rbp)
imul   $0x3,-0x8(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
xor    $0xffffffff,%eax
and    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
call   1050 <mmio_write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gpioSetInput>:
push   %rbp
push   %rbx
push   %rax
movslq %edi,%rbx
imul   $0x66666667,%rbx,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x22,%rax
add    %ecx,%eax
add    %eax,%eax
lea    (%rax,%rax,4),%eax
sub    %eax,%ebx
mov    %ebx,%edi
call   1030 <get_fsel_bank_no@plt>
mov    %eax,%ebp
mov    %eax,%edi
call   1040 <mmio_read@plt>
lea    (%rbx,%rbx,2),%ecx
btr    %ecx,%eax
mov    %ebp,%edi
mov    %eax,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <mmio_write@plt>

LLVM IR (-O0):
define void @gpioSetInput(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %2
%6 = load i32, i32* %2
%7 = srem i32 %6, 10
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = call i32 @get_fsel_bank_no(i32 %8)
store i32 %9, i32* %4
%10 = load i32, i32* %4
%11 = call i32 @mmio_read(i32 %10)
store i32 %11, i32* %5
%12 = load i32, i32* %3
%13 = mul nsw i32 %12, 3
%14 = shl i32 1, %13
%15 = xor i32 %14, -1
%16 = load i32, i32* %5
%17 = and i32 %16, %15
store i32 %17, i32* %5
%18 = load i32, i32* %4
%19 = load i32, i32* %5
%20 = call i32 @mmio_write(i32 %18, i32 %19)
ret void
}

LLVM IR (-O2):
define void @gpioSetInput(i32 %0) {
%2 = srem i32 %0, 10
%3 = tail call i32 @get_fsel_bank_no(i32 %2)
%4 = tail call i32 @mmio_read(i32 %3)
%5 = mul nsw i32 %2, 3
%6 = shl nuw nsw i32 1, %5
%7 = xor i32 %6, -1
%8 = and i32 %4, %7
%9 = tail call i32 @mmio_write(i32 %3, i32 %8)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
scalar_t__ EOF;
scalar_t__ fputc(unsigned int, int /*<<< orphan*/ *);
int write_short(FILE *out, unsigned int n) {
  if (fputc((n & 255), out) == EOF)
    return -1;
  if (fputc(((n >> 8) & 255), out) == EOF)
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<write_short>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x14(%rbp),%edi
and    $0xff,%edi
mov    -0x10(%rbp),%rsi
call   1030 <fputc@plt>
mov    0x2eb0(%rip),%rcx
cmp    (%rcx),%rax
jne    114d <write_short+0x3d>
movl   $0xffffffff,-0x4(%rbp)
jmp    1185 <write_short+0x75>
mov    -0x14(%rbp),%edi
shr    $0x8,%edi
and    $0xff,%edi
mov    -0x10(%rbp),%rsi
call   1030 <fputc@plt>
mov    0x2e7f(%rip),%rcx
cmp    (%rcx),%rax
jne    117e <write_short+0x6e>
movl   $0xffffffff,-0x4(%rbp)
jmp    1185 <write_short+0x75>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_short>:
push   %r15
push   %r14
push   %rbx
mov    %esi,%ebx
mov    %rdi,%r14
movzbl %bl,%edi
mov    %r14,%rsi
call   1030 <fputc@plt>
mov    %rax,%rcx
mov    0x2eb9(%rip),%r15
mov    $0xffffffff,%eax
cmp    (%r15),%rcx
je     1151 <write_short+0x41>
movzbl %bh,%edi
mov    %r14,%rsi
call   1030 <fputc@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    (%r15),%rcx
sete   %al
neg    %eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@EOF = global i64 0
define i32 @write_short(i32* %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
%6 = load i32, i32* %5
%7 = and i32 %6, 255
%8 = load i32*, i32** %4
%9 = call i64 @fputc(i32 %7, i32* %8)
%10 = load i64, i64* @EOF
%11 = icmp eq i64 %9, %10
br i1 %11, label %12, label %13
12: ; preds = %2
store i32 -1, i32* %3
br label %23
13: ; preds = %2
%14 = load i32, i32* %5
%15 = lshr i32 %14, 8
%16 = and i32 %15, 255
%17 = load i32*, i32** %4
%18 = call i64 @fputc(i32 %16, i32* %17)
%19 = load i64, i64* @EOF
%20 = icmp eq i64 %18, %19
br i1 %20, label %21, label %22
21: ; preds = %13
store i32 -1, i32* %3
br label %23
22: ; preds = %13
store i32 0, i32* %3
br label %23
23: ; preds = %22, %21, %12
%24 = load i32, i32* %3
ret i32 %24
}

LLVM IR (-O2):
@EOF = global i64 0
define i32 @write_short(i32* nocapture %0, i32 %1) {
%3 = and i32 %1, 255
%4 = tail call i64 @fputc(i32 %3, i32* %0)
%5 = load i64, i64* @EOF
%6 = icmp eq i64 %4, %5
br i1 %6, label %14, label %7
7: ; preds = %2
%8 = lshr i32 %1, 8
%9 = and i32 %8, 255
%10 = tail call i64 @fputc(i32 %9, i32* %0)
%11 = load i64, i64* @EOF
%12 = icmp eq i64 %10, %11
%13 = sext i1 %12 to i32
br label %14
14: ; preds = %7, %2
%15 = phi i32 [ -1, %2 ], [ %13, %7 ]
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void usage(void) {
  printf("Usage: extract_fw <firmware file> <output file>\n");
  exit(1);
}


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

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

LLVM IR (-O0):
@.str = [49 x i8] c"Usage: extract_fw <firmware file> <output file>\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@str = [48 x i8] c"Usage: extract_fw <firmware file> <output file>\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 1)
unreachable
}
void x400pconf_del(int argc, char *argv[]) {}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
ret

LLVM IR (-O0):
define void @x400pconf_del(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
ret void
}

LLVM IR (-O2):
define void @x400pconf_del(i32 %0, i8** nocapture %1) {
ret void
}
char **cdio_get_devices_osx(void) { return ((void *)0); }


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

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

LLVM IR (-O0):
define i8** @cdio_get_devices_osx() {
ret i8** null
}

LLVM IR (-O2):
define noalias i8** @cdio_get_devices_osx() {
ret i8** null
}
void rl_initialize() {}


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

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

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

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

/* Variables and functions */
void ip_set_flag_reserved(uint8_t *p_ip, uint8_t flag) {
  p_ip[6] &= ~0x80;
  p_ip[6] |= (flag & 1) << 7;
}


x86 assembly (clang, -O0):
<ip_set_flag_reserved>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    0x18(%rax),%ecx
and    $0xffffff7f,%ecx
mov    %ecx,0x18(%rax)
mov    -0xc(%rbp),%ecx
and    $0x1,%ecx
shl    $0x7,%ecx
mov    -0x8(%rbp),%rax
or     0x18(%rax),%ecx
mov    %ecx,0x18(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<ip_set_flag_reserved>:
mov    $0xffffff7f,%eax
and    0x18(%rdi),%eax
shl    $0x7,%esi
movzbl %sil,%ecx
or     %eax,%ecx
mov    %ecx,0x18(%rdi)
ret

LLVM IR (-O0):
define void @ip_set_flag_reserved(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32*, i32** %3
%6 = getelementptr inbounds i32, i32* %5, i64 6
%7 = load i32, i32* %6
%8 = and i32 %7, -129
store i32 %8, i32* %6
%9 = load i32, i32* %4
%10 = and i32 %9, 1
%11 = shl i32 %10, 7
%12 = load i32*, i32** %3
%13 = getelementptr inbounds i32, i32* %12, i64 6
%14 = load i32, i32* %13
%15 = or i32 %14, %11
store i32 %15, i32* %13
ret void
}

LLVM IR (-O2):
define void @ip_set_flag_reserved(i32* nocapture %0, i32 %1) {
%3 = getelementptr inbounds i32, i32* %0, i64 6
%4 = load i32, i32* %3
%5 = and i32 %4, -129
%6 = shl i32 %1, 7
%7 = and i32 %6, 128
%8 = or i32 %5, %7
store i32 %8, i32* %3
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ bzero(unsigned char *, int /*<<< orphan*/);
int stun_attr_add_str(unsigned char *, size_t *, int, unsigned char *,
                      int /*<<< orphan*/);
int stun_attr_add_padding_str(unsigned char *buf, size_t *len,
                              uint16_t padding_len) {
  unsigned char avalue[0xFFFF];
  bzero((avalue), (padding_len));
  return stun_attr_add_str(buf, len, (0x0026), avalue, padding_len);
}


x86 assembly (clang, -O0):
<stun_attr_add_padding_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10020,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
lea    -0x10020(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1040 <bzero@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
lea    -0x10020(%rbp),%rcx
mov    -0x14(%rbp),%r8d
mov    $0x26,%edx
call   1030 <stun_attr_add_str@plt>
add    $0x10020,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stun_attr_add_padding_str>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x10008,%rsp
mov    %edx,%ebx
mov    %rsi,%r14
mov    %rdi,%r15
mov    %rsp,%r12
mov    %r12,%rdi
mov    %edx,%esi
call   1040 <bzero@plt>
mov    %r15,%rdi
mov    %r14,%rsi
mov    $0x26,%edx
mov    %r12,%rcx
mov    %ebx,%r8d
call   1030 <stun_attr_add_str@plt>
add    $0x10008,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32 @stun_attr_add_padding_str(i8* %0, i64* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i64*
%6 = alloca i32
%7 = alloca [65535 x i8]
store i8* %0, i8** %4
store i64* %1, i64** %5
store i32 %2, i32* %6
%8 = getelementptr inbounds [65535 x i8], [65535 x i8]* %7, i64 0, i64 0
%9 = load i32, i32* %6
%10 = call i32 @bzero(i8* %8, i32 %9)
%11 = load i8*, i8** %4
%12 = load i64*, i64** %5
%13 = getelementptr inbounds [65535 x i8], [65535 x i8]* %7, i64 0, i64 0
%14 = load i32, i32* %6
%15 = call i32 @stun_attr_add_str(i8* %11, i64* %12, i32 38, i8* %13, i32 %14)
ret i32 %15
}

LLVM IR (-O2):
define i32 @stun_attr_add_padding_str(i8* %0, i64* %1, i32 %2) {
%4 = alloca [65535 x i8]
%5 = getelementptr inbounds [65535 x i8], [65535 x i8]* %4, i64 0, i64 0
%6 = call i32 @bzero(i8* %5, i32 %2)
%7 = call i32 @stun_attr_add_str(i8* %0, i64* %1, i32 38, i8* %5, i32 %2)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void usage(char *name) {
  printf("usage %s [options] \n"
         "-h\t\tthis text you see right here\n"
         "-K <key>\tAnonymize IP addressses using CryptoPAn with key <key>.\n"
         "-r\t\tread input from file\n"
         "-M <expr>\tRead input from multiple directories.\n"
         "-R <expr>\tRead input from sequence of files.\n"
         "-w <file>\tName of output file. Defaults to input file.\n",
         name);
}


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

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

LLVM IR (-O0):
@.str = [292 x i8] c"usage %s [options] \0A-h\09\09this text you see right here\0A-K <key>\09Anonymize IP addressses using CryptoPAn with key <key>.\0A-r\09\09read input from file\0A-M <expr>\09Read input from multiple directories.\0A-R <expr>\09Read input from sequence of files.\0A-w <file>\09Name of output file. Defaults to input file.\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([292 x i8], [292 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [292 x i8] c"usage %s [options] \0A-h\09\09this text you see right here\0A-K <key>\09Anonymize IP addressses using CryptoPAn with key <key>.\0A-r\09\09read input from file\0A-M <expr>\09Read input from multiple directories.\0A-R <expr>\09Read input from sequence of files.\0A-w <file>\09Name of output file. Defaults to input file.\0A\00"
define void @usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([292 x i8], [292 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ p;
typedef int /*<<< orphan*/ buf;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, ...);
void arrayPoint() {
  int buf[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
  int *p = buf + 5;
  printf("p = %d\n", *p);
  printf("size p = %lu  buf = %lu\n", sizeof(p), sizeof(buf));
}


x86 assembly (clang, -O0):
<arrayPoint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
lea    -0x30(%rbp),%rdi
lea    0xecd(%rip),%rsi
mov    $0x28,%edx
call   1040 <memcpy@plt>
lea    -0x30(%rbp),%rax
add    $0x14,%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rax
mov    (%rax),%esi
lea    0xed2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xecc(%rip),%rdi
mov    $0x8,%esi
mov    $0x28,%edx
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<arrayPoint>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x6,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xedd(%rip),%rdi
mov    $0x28,%edx
mov    $0x8,%esi
xor    %eax,%eax
pop    %rcx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@__const.arrayPoint.buf = [10 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10]
@.str = [8 x i8] c"p = %d\0A\00"
@.str.1 = [25 x i8] c"size p = %lu buf = %lu\0A\00"
define void @arrayPoint() {
%1 = alloca [10 x i32]
%2 = alloca i32*
%3 = bitcast [10 x i32]* %1 to i8*
%4 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%5 = getelementptr inbounds i32, i32* %4, i64 5
store i32* %5, i32** %2
%6 = load i32*, i32** %2
%7 = load i32, i32* %6
%8 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i32 8, i64 40)
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"p = %d\0A\00"
@.str.1 = [25 x i8] c"size p = %lu buf = %lu\0A\00"
define void @arrayPoint() {
%1 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 6)
%2 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i32 8, i64 40)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ eFree(char *);
char *popString();
int /*<<< orphan*/ pushStringCopy(char *);
char *trim(char *);
void basTrim() {
  char *string;
  char *dest;
  string = popString();
  dest = trim(string);
  pushStringCopy(dest);
  eFree(string);
}


x86 assembly (clang, -O0):
<basTrim>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <popString@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <trim@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1060 <pushStringCopy@plt>
mov    -0x8(%rbp),%rdi
call   1030 <eFree@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<basTrim>:
push   %rbx
xor    %eax,%eax
call   1050 <popString@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <trim@plt>
mov    %rax,%rdi
call   1060 <pushStringCopy@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <eFree@plt>

LLVM IR (-O0):
define void @basTrim() {
%1 = alloca i8*
%2 = alloca i8*
%3 = call i8* (...) @popString()
store i8* %3, i8** %1
%4 = load i8*, i8** %1
%5 = call i8* @trim(i8* %4)
store i8* %5, i8** %2
%6 = load i8*, i8** %2
%7 = call i32 @pushStringCopy(i8* %6)
%8 = load i8*, i8** %1
%9 = call i32 @eFree(i8* %8)
ret void
}

LLVM IR (-O2):
define void @basTrim() {
%1 = tail call i8* (...) @popString()
%2 = tail call i8* @trim(i8* %1)
%3 = tail call i32 @pushStringCopy(i8* %2)
%4 = tail call i32 @eFree(i8* %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;
typedef int /*<<< orphan*/ va_list;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ vfwprintf(int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                             int /*<<< orphan*/);
void uninitar_vfwprintf(FILE *s, wchar_t *f, va_list a) {
  FILE *stream;
  wchar_t *format;
  va_list arg;
  (void)vfwprintf(stream, format, arg);
  (void)vfwprintf(s, format, a);
  (void)vfwprintf(stream, f, a);
  (void)vfwprintf(s, f, a);
}


x86 assembly (clang, -O0):
<uninitar_vfwprintf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    -0x2c(%rbp),%edx
call   1030 <vfwprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <vfwprintf@plt>
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <vfwprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <vfwprintf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uninitar_vfwprintf>:
push   %r15
push   %r14
push   %rbx
mov    %edx,%ebx
mov    %rsi,%r14
mov    %rdi,%r15
call   1030 <vfwprintf@plt>
mov    %r15,%rdi
mov    %ebx,%edx
call   1030 <vfwprintf@plt>
mov    %r14,%rsi
mov    %ebx,%edx
call   1030 <vfwprintf@plt>
mov    %r15,%rdi
mov    %r14,%rsi
mov    %ebx,%edx
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <vfwprintf@plt>

LLVM IR (-O0):
define void @uninitar_vfwprintf(i32* %0, i32* %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i32
store i32* %0, i32** %4
store i32* %1, i32** %5
store i32 %2, i32* %6
%10 = load i32*, i32** %7
%11 = load i32*, i32** %8
%12 = load i32, i32* %9
%13 = call i32 @vfwprintf(i32* %10, i32* %11, i32 %12)
%14 = load i32*, i32** %4
%15 = load i32*, i32** %8
%16 = load i32, i32* %6
%17 = call i32 @vfwprintf(i32* %14, i32* %15, i32 %16)
%18 = load i32*, i32** %7
%19 = load i32*, i32** %5
%20 = load i32, i32* %6
%21 = call i32 @vfwprintf(i32* %18, i32* %19, i32 %20)
%22 = load i32*, i32** %4
%23 = load i32*, i32** %5
%24 = load i32, i32* %6
%25 = call i32 @vfwprintf(i32* %22, i32* %23, i32 %24)
ret void
}

LLVM IR (-O2):
define void @uninitar_vfwprintf(i32* %0, i32* %1, i32 %2) {
%4 = tail call i32 @vfwprintf(i32* undef, i32* undef, i32 undef)
%5 = tail call i32 @vfwprintf(i32* %0, i32* undef, i32 %2)
%6 = tail call i32 @vfwprintf(i32* undef, i32* %1, i32 %2)
%7 = tail call i32 @vfwprintf(i32* %0, i32* %1, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ stdout;
void print_integer(int i) {
  printf("%d", i);
  fflush(stdout);
}


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

x86 assembly (clang, -O2):
<print_integer>:
push   %rax
mov    %edi,%esi
lea    0xed6(%rip),%rdi
call   1030 <printf@plt>
mov    0x2eaa(%rip),%rax
mov    (%rax),%edi
pop    %rax
jmp    1040 <fflush@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@stdout = global i32 0
define void @print_integer(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %0)
%3 = load i32, i32* @stdout
%4 = tail call i32 @fflush(i32 %3)
ret void
}
int parent_index(int index) { return (index - 1) / 2; }


x86 assembly (clang, -O0):
<parent_index>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
pop    %rbp
ret

x86 assembly (clang, -O2):
<parent_index>:
mov    %edi,%eax
add    $0xffffffff,%eax
shr    $0x1f,%eax
add    %edi,%eax
add    $0xffffffff,%eax
sar    %eax
ret

LLVM IR (-O0):
define i32 @parent_index(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sub nsw i32 %3, 1
%5 = sdiv i32 %4, 2
ret i32 %5
}

LLVM IR (-O2):
define i32 @parent_index(i32 %0) {
%2 = add nsw i32 %0, -1
%3 = sdiv i32 %2, 2
ret i32 %3
}
/* Type definitions */
typedef int u_int32_t;

/* Variables and functions */
int cpuid(int, int);
int running_in_virtual_machine(void) {
  u_int32_t eax = 1U, ecx = 0U;
  ecx = cpuid(eax, ecx);
  if (ecx & 0x80000000U)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<running_in_virtual_machine>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <cpuid@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
and    $0x80000000,%eax
cmp    $0x0,%eax
je     1151 <running_in_virtual_machine+0x41>
movl   $0x1,-0x4(%rbp)
jmp    1158 <running_in_virtual_machine+0x48>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @running_in_virtual_machine() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 1, i32* %2
store i32 0, i32* %3
%4 = load i32, i32* %2
%5 = load i32, i32* %3
%6 = call i32 @cpuid(i32 %4, i32 %5)
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = and i32 %7, -2147483648
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %0
store i32 1, i32* %1
br label %12
11: ; preds = %0
store i32 0, i32* %1
br label %12
12: ; preds = %11, %10
%13 = load i32, i32* %1
ret i32 %13
}

LLVM IR (-O2):
define i32 @running_in_virtual_machine() {
%1 = tail call i32 @cpuid(i32 1, i32 0)
%2 = lshr i32 %1, 31
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ buf;

/* Variables and functions */
int /*<<< orphan*/ PATH_MAX;
char *getcwd(char *, int);
int /*<<< orphan*/ printf(char *, char *);
int do_pwd(int argc, char **argv) {
  char buf[PATH_MAX + 1];
  printf("%s\n", getcwd(buf, sizeof(buf)));
  return 0;
}


x86 assembly (clang, -O0):
<do_pwd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eba(%rip),%rax
mov    (%rax),%eax
add    $0x1,%eax
mov    %rsp,%rcx
mov    %rcx,-0x18(%rbp)
mov    %rax,%rcx
add    $0xf,%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rdi
sub    %rcx,%rdi
mov    %rdi,%rsp
mov    %rax,-0x20(%rbp)
mov    %eax,%esi
call   1040 <getcwd@plt>
mov    %rax,%rsi
lea    0xe95(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%rax
mov    %rax,%rsp
xor    %eax,%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_pwd>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%esi
add    $0x1,%esi
mov    %rsp,%rdi
lea    0xf(%rsi),%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rdi
mov    %rdi,%rsp
call   1040 <getcwd@plt>
lea    0xeb3(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
mov    %rbp,%rsp
pop    %rbp
ret

LLVM IR (-O0):
@PATH_MAX = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define i32 @do_pwd(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i8*
%6 = alloca i64
store i32 %0, i32* %3
store i8** %1, i8*** %4
%7 = load i32, i32* @PATH_MAX
%8 = add nsw i32 %7, 1
%9 = zext i32 %8 to i64
%10 = call i8* @llvm.stacksave()
store i8* %10, i8** %5
%11 = alloca i8, i64 %9
store i64 %9, i64* %6
%12 = trunc i64 %9 to i32
%13 = call i8* @getcwd(i8* %11, i32 %12)
%14 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %13)
%15 = load i8*, i8** %5
ret i32 0
}

LLVM IR (-O2):
@PATH_MAX = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define i32 @do_pwd(i32 %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @PATH_MAX
%4 = add nsw i32 %3, 1
%5 = zext i32 %4 to i64
%6 = alloca i8, i64 %5
%7 = call i8* @getcwd(i8* %6, i32 %4)
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %7)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Scheme_Pause();
void WSQ_Pause() { Scheme_Pause(); }


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

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

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

LLVM IR (-O2):
define void @WSQ_Pause() {
%1 = tail call i32 (...) @Scheme_Pause()
ret void
}
void bacct_add_tsk(struct user_namespace *user_ns, struct pid_namespace *pid_ns,
                   struct taskstats *stats, struct task_struct *tsk) {}


x86 assembly (clang, -O0):
<bacct_add_tsk>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.user_namespace = type opaque
%struct.pid_namespace = type opaque
%struct.taskstats = type opaque
%struct.task_struct = type opaque
define void @bacct_add_tsk(%struct.user_namespace* %0, %struct.pid_namespace* %1, %struct.taskstats* %2, %struct.task_struct* %3) {
%5 = alloca %struct.user_namespace*
%6 = alloca %struct.pid_namespace*
%7 = alloca %struct.taskstats*
%8 = alloca %struct.task_struct*
store %struct.user_namespace* %0, %struct.user_namespace** %5
store %struct.pid_namespace* %1, %struct.pid_namespace** %6
store %struct.taskstats* %2, %struct.taskstats** %7
store %struct.task_struct* %3, %struct.task_struct** %8
ret void
}

LLVM IR (-O2):
%struct.user_namespace = type opaque
%struct.pid_namespace = type opaque
%struct.taskstats = type opaque
%struct.task_struct = type opaque
define void @bacct_add_tsk(%struct.user_namespace* nocapture %0, %struct.pid_namespace* nocapture %1, %struct.taskstats* nocapture %2, %struct.task_struct* nocapture %3) {
ret void
}
void addu(char *filename, int drive, int user) {}


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

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

LLVM IR (-O0):
define void @addu(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
ret void
}

LLVM IR (-O2):
define void @addu(i8* nocapture %0, i32 %1, i32 %2) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ _wait(int *);
pid_t wait(int *stat_loc) { return _wait(stat_loc); }


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

x86 assembly (clang, -O2):
<wait>:
jmp    1030 <_wait@plt>

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

LLVM IR (-O2):
define i32 @wait(i32* %0) {
%2 = tail call i32 @_wait(i32* %0)
ret i32 %2
}
/* Variables and functions */
double _sin_cos_special(double, char *);
double _sin_special(double x) { return _sin_cos_special(x, "sin"); }


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

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

LLVM IR (-O0):
@.str = [4 x i8] c"sin\00"
define double @_sin_special(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @_sin_cos_special(double %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret double %4
}

LLVM IR (-O2):
@.str = [4 x i8] c"sin\00"
define double @_sin_special(double %0) {
%2 = tail call double @_sin_cos_special(double %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret double %2
}
void glEndList(void) { return; }


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

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

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

LLVM IR (-O2):
define void @glEndList() {
ret void
}
unsigned int hash_direct_hash(void *key) { return (unsigned int)key; }


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

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

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

LLVM IR (-O2):
define i32 @hash_direct_hash(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = trunc i64 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ new_free();
int /*<<< orphan*/ stderr;
int main(void) {
  fputs("\n\x1b[34m# [chunk] "
        "new_free"
        "\x1b[0m\n",
        stderr);
  new_free();
  ;
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [30 x i8] c"\0A\1B[34m# [chunk] new_free\1B[0m\0A\00"
@stderr = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* @stderr
%3 = call i32 @fputs(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = call i32 (...) @new_free()
ret i32 0
}

LLVM IR (-O2):
@.str = [30 x i8] c"\0A\1B[34m# [chunk] new_free\1B[0m\0A\00"
@stderr = global i32 0
define i32 @main() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fputs(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 (...) @new_free()
ret i32 0
}