xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char *argv[]) {
  (void)argc;
  printf("%s\n", argv[0]);
  return (0);
}


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    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xecc(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
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 = getelementptr inbounds i8*, i8** %7, i64 0
%9 = load i8*, i8** %8
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = load i8*, i8** %1
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void badparms(void) {
  fprintf(stderr, "usage:  fsplit [-e efile] ... [file]\n");
  exit(1);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [38 x i8] c"usage: fsplit [-e efile] ... [file]\0A\00"
define void @badparms() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [38 x i8] c"usage: fsplit [-e efile] ... [file]\0A\00"
define void @badparms() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
int usage(void) {
  printf("usage: yuv4toyuv <input movie> <output.yuv>\n");
  printf("	Write a YUV4 encoded movie as a planar YUV 4:2:0 file.\n");
  exit(1);
}


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

LLVM IR (-O0):
@.str = [45 x i8] c"usage: yuv4toyuv <input movie> <output.yuv>\0A\00"
@.str.1 = [57 x i8] c"\09Write a YUV4 encoded movie as a planar YUV 4:2:0 file.\0A\00"
define i32 @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@str = [44 x i8] c"usage: yuv4toyuv <input movie> <output.yuv>\00"
@str.2 = [56 x i8] c"\09Write a YUV4 encoded movie as a planar YUV 4:2:0 file.\00"
define i32 @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([56 x i8], [56 x i8]* @str.2, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
int do_268() { return 268; }


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

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

LLVM IR (-O0):
define i32 @do_268() {
ret i32 268
}

LLVM IR (-O2):
define i32 @do_268() {
ret i32 268
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
int /*<<< orphan*/ led_toggle(int /*<<< orphan*/);
void APP_ISR_1ms(void) {
  static uint16_t count_1s = 1000;
  count_1s--;
  if (!count_1s) {
    led_toggle(0);
    count_1s = 1000;
  }
}


x86 assembly (clang, -O0):
<APP_ISR_1ms>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f0e(%rip),%eax
add    $0xffffffff,%eax
mov    %eax,0x2f05(%rip)
cmpl   $0x0,0x2efe(%rip)
jne    1141 <APP_ISR_1ms+0x31>
xor    %edi,%edi
call   1030 <led_toggle@plt>
movl   $0x3e8,0x2ee7(%rip)
pop    %rbp
ret

x86 assembly (clang, -O2):
<APP_ISR_1ms>:
push   %rax
addl   $0xffffffff,0x2f10(%rip)
je     111c <APP_ISR_1ms+0xc>
pop    %rax
ret
xor    %edi,%edi
call   1030 <led_toggle@plt>
movl   $0x3e8,0x2efb(%rip)
pop    %rax
ret

LLVM IR (-O0):
@APP_ISR_1ms.count_1s = internal global i32 1000
define void @APP_ISR_1ms() {
%1 = load i32, i32* @APP_ISR_1ms.count_1s
%2 = add nsw i32 %1, -1
store i32 %2, i32* @APP_ISR_1ms.count_1s
%3 = load i32, i32* @APP_ISR_1ms.count_1s
%4 = icmp ne i32 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %0
%6 = call i32 @led_toggle(i32 0)
store i32 1000, i32* @APP_ISR_1ms.count_1s
br label %7
7: ; preds = %5, %0
ret void
}

LLVM IR (-O2):
@APP_ISR_1ms.count_1s = internal unnamed_addr global i32 1000
define void @APP_ISR_1ms() {
%1 = load i32, i32* @APP_ISR_1ms.count_1s
%2 = add nsw i32 %1, -1
store i32 %2, i32* @APP_ISR_1ms.count_1s
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = tail call i32 @led_toggle(i32 0)
store i32 1000, i32* @APP_ISR_1ms.count_1s
br label %6
6: ; preds = %4, %0
ret void
}
void __attribute__((no)) HEX00_strutilsInit(void) {}


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

x86 assembly (clang, -O2):
ret

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

LLVM IR (-O2):
define void @HEX00_strutilsInit() {
ret void
}
void buf_read(void *buf, int read_num) {
  asm volatile("xor %0, %0\n\t"
               "LOOP1:\n\t"
               "mov (%1),%1\n\t"
               "inc %0\n\t"
               "cmp %2,%0\n\t"
               "jb LOOP1\n\t"
               "STOP:\n\t" ::"b"(0),
               "d"(buf), "r"(read_num));
}


x86 assembly (clang, -O0):
<buf_read>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%eax
xor    %ebx,%ebx
xor    %ebx,%ebx

x86 assembly (clang, -O2):
<buf_read>:
push   %rbx
xor    %ebx,%ebx
mov    %rdi,%rdx
xor    %ebx,%ebx

LLVM IR (-O0):
define void @buf_read(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 i32, i32* %4
ret void
}

LLVM IR (-O2):
define void @buf_read(i8* %0, i32 %1) {
tail call void asm sideeffect "xor $0, $0\0A\09LOOP1:\0A\09mov ($1),$1\0A\09inc $0\0A\09cmp $2,$0\0A\09jb LOOP1\0A\09STOP:\0A\09", "{bx},{dx},r,~{dirflag},~{fpsr},~{flags}"(i32 0, i8* %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ k(int);
int /*<<< orphan*/ printf(char *, int);
void j(int x) {
  printf("j(%d)\n", x);
  if (x >= 2)
    k(x);
}


x86 assembly (clang, -O0):
<j>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
cmpl   $0x2,-0x4(%rbp)
jl     114c <j+0x2c>
mov    -0x4(%rbp),%edi
call   1040 <k@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<j>:
push   %rbx
mov    %edi,%ebx
lea    0xed6(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
cmp    $0x2,%ebx
jl     113e <j+0x1e>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <k@plt>
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c"j(%d)\0A\00"
define void @j(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %0)
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @k(i32 %0)
br label %6
6: ; preds = %4, %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ tfile_write_64(int /*<<< orphan*/);
void tfile_write_addr(char *addr) { tfile_write_64((uint64_t)(uintptr_t)addr); }


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

x86 assembly (clang, -O2):
<tfile_write_addr>:
jmp    1030 <tfile_write_64@plt>

LLVM IR (-O0):
define void @tfile_write_addr(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = ptrtoint i8* %3 to i64
%5 = trunc i64 %4 to i32
%6 = call i32 @tfile_write_64(i32 %5)
ret void
}

LLVM IR (-O2):
define void @tfile_write_addr(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = trunc i64 %2 to i32
%4 = tail call i32 @tfile_write_64(i32 %3)
ret void
}
/* Variables and functions */
double rand();
int osrand(int n) { return ((int)(rand() / 4294967296.0 * (double)n)); }


x86 assembly (clang, -O0):
<osrand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
movsd  0xed6(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsi2sdl -0x4(%rbp),%xmm1
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<osrand>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <rand@plt>
mulsd  0xede(%rip),%xmm0
cvtsi2sd %ebx,%xmm1
mulsd  %xmm0,%xmm1
cvttsd2si %xmm1,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @osrand(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call double (...) @rand()
%4 = fdiv double %3, 0x41F0000000000000
%5 = load i32, i32* %2
%6 = sitofp i32 %5 to double
%7 = fmul double %4, %6
%8 = fptosi double %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @osrand(i32 %0) {
%2 = tail call double (...) @rand()
%3 = fmul double %2, 0x3DF0000000000000
%4 = sitofp i32 %0 to double
%5 = fmul double %3, %4
%6 = fptosi double %5 to i32
ret i32 %6
}
void GB_MINUS_f_FP64(double *z, const double *x, const double *y) {
  (*z) = (*x) - (*y);
}


x86 assembly (clang, -O0):
<GB_MINUS_f_FP64>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x18(%rbp),%rax
subsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<GB_MINUS_f_FP64>:
movsd  (%rsi),%xmm0
subsd  (%rdx),%xmm0
movsd  %xmm0,(%rdi)
ret

LLVM IR (-O0):
define void @GB_MINUS_f_FP64(double* %0, double* %1, double* %2) {
%4 = alloca double*
%5 = alloca double*
%6 = alloca double*
store double* %0, double** %4
store double* %1, double** %5
store double* %2, double** %6
%7 = load double*, double** %5
%8 = load double, double* %7
%9 = load double*, double** %6
%10 = load double, double* %9
%11 = fsub double %8, %10
%12 = load double*, double** %4
store double %11, double* %12
ret void
}

LLVM IR (-O2):
define void @GB_MINUS_f_FP64(double* nocapture writeonly %0, double* nocapture %1, double* nocapture %2) {
%4 = load double, double* %1
%5 = load double, double* %2
%6 = fsub double %4, %5
store double %6, double* %0
ret void
}
unsigned joystickb_none_flags(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @joystickb_none_flags() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ native_restore_fl(unsigned long);
void raw_local_irq_restore(unsigned long flags) { native_restore_fl(flags); }


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

x86 assembly (clang, -O2):
<raw_local_irq_restore>:
jmp    1030 <native_restore_fl@plt>

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

LLVM IR (-O2):
define void @raw_local_irq_restore(i64 %0) {
%2 = tail call i32 @native_restore_fl(i64 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ warnx(char *);
void badformat() {
  warnx("illegal time format");
  (void)fprintf(stderr, "usage: pom [[[[[cc]yy]mm]dd]HH]\n");
  exit(1);
}


x86 assembly (clang, -O0):
<badformat>:
push   %rbp
mov    %rsp,%rbp
lea    0xec5(%rip),%rdi
call   1030 <warnx@plt>
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
lea    0xec4(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<badformat>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <warnx@plt>
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
lea    0xec7(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"illegal time format\00"
@stderr = global i32 0
@.str.1 = [33 x i8] c"usage: pom [[[[[cc]yy]mm]dd]HH]\0A\00"
define void @badformat() {
%1 = call i32 @warnx(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @stderr
%3 = call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [20 x i8] c"illegal time format\00"
@stderr = global i32 0
@.str.1 = [33 x i8] c"usage: pom [[[[[cc]yy]mm]dd]HH]\0A\00"
define void @badformat() {
%1 = tail call i32 @warnx(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @exit(i32 1)
unreachable
}
void swap(a, b) {
  a ^= b;
  b ^= a;
  a ^= b;
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
xor    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
xor    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
xor    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @swap(i32 %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __NR_move_pages;
long syscall(int /*<<< orphan*/, int, unsigned long, void **, int const *,
             int *, int);
long move_pages(int pid, unsigned long count, void **pages, const int *nodes,
                int *status, int flags) {
  return syscall(__NR_move_pages, pid, count, pages, nodes, status, flags);
}


x86 assembly (clang, -O0):
<move_pages>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9d,-0x2c(%rbp)
mov    0x2eb2(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%r8
mov    -0x28(%rbp),%r9
mov    -0x2c(%rbp),%eax
mov    %eax,(%rsp)
call   1030 <syscall@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<move_pages>:
push   %rax
mov    %r8,%rax
mov    %rcx,%r8
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %edi,%esi
mov    0x2ec2(%rip),%rdi
mov    (%rdi),%edi
mov    %r9d,(%rsp)
mov    %rax,%r9
call   1030 <syscall@plt>
pop    %rcx
ret

LLVM IR (-O0):
@__NR_move_pages = global i32 0
define i64 @move_pages(i32 %0, i64 %1, i8** %2, i32* %3, i32* %4, i32 %5) {
%7 = alloca i32
%8 = alloca i64
%9 = alloca i8**
%10 = alloca i32*
%11 = alloca i32*
%12 = alloca i32
store i32 %0, i32* %7
store i64 %1, i64* %8
store i8** %2, i8*** %9
store i32* %3, i32** %10
store i32* %4, i32** %11
store i32 %5, i32* %12
%13 = load i32, i32* @__NR_move_pages
%14 = load i32, i32* %7
%15 = load i64, i64* %8
%16 = load i8**, i8*** %9
%17 = load i32*, i32** %10
%18 = load i32*, i32** %11
%19 = load i32, i32* %12
%20 = call i64 @syscall(i32 %13, i32 %14, i64 %15, i8** %16, i32* %17, i32* %18, i32 %19)
ret i64 %20
}

LLVM IR (-O2):
@__NR_move_pages = global i32 0
define i64 @move_pages(i32 %0, i64 %1, i8** %2, i32* %3, i32* %4, i32 %5) {
%7 = load i32, i32* @__NR_move_pages
%8 = tail call i64 @syscall(i32 %7, i32 %0, i64 %1, i8** %2, i32* %3, i32* %4, i32 %5)
ret i64 %8
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
scalar_t__ atexit(void (*)());
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
void x_atexit(void (*function)(void)) {
  if (atexit(function) != 0) {
    perror("atexit failed");
    exit(EXIT_FAILURE);
  }
}


x86 assembly (clang, -O0):
<x_atexit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1170 <atexit>
cmp    $0x0,%rax
je     1169 <x_atexit+0x39>
lea    0xeaa(%rip),%rdi
call   1030 <perror@plt>
mov    0x2e7e(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret
nop

x86 assembly (clang, -O2):
<x_atexit>:
push   %rax
call   1160 <atexit>
test   %rax,%rax
jne    113d <x_atexit+0xd>
pop    %rax
ret
lea    0xebc(%rip),%rdi
call   1030 <perror@plt>
mov    0x2e90(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
nopw   0x0(%rax,%rax,1)

LLVM IR (-O0):
@.str = [14 x i8] c"atexit failed\00"
@EXIT_FAILURE = global i32 0
define void @x_atexit(void ()* %0) {
%2 = alloca void ()*
store void ()* %0, void ()** %2
%3 = load void ()*, void ()** %2
%4 = bitcast void ()* %3 to void (...)*
%5 = call i64 @atexit(void (...)* %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = call i32 @perror(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%9 = load i32, i32* @EXIT_FAILURE
%10 = call i32 @exit(i32 %9)
unreachable
11: ; preds = %1
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"atexit failed\00"
@EXIT_FAILURE = global i32 0
define void @x_atexit(void ()* %0) {
%2 = bitcast void ()* %0 to void (...)*
%3 = tail call i64 @atexit(void (...)* %2)
%4 = icmp eq i64 %3, 0
br i1 %4, label %9, label %5
5: ; preds = %1
%6 = tail call i32 @perror(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* @EXIT_FAILURE
%8 = tail call i32 @exit(i32 %7)
unreachable
9: ; preds = %1
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
uint16_t read_crc16(uint8_t *byteArr, uint16_t byteOffset) {
  uint16_t crc_temp = (byteArr[byteOffset + 1] << 8) | byteArr[byteOffset];
  return crc_temp;
}


x86 assembly (clang, -O0):
<read_crc16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
shl    $0x8,%eax
mov    -0x8(%rbp),%rcx
movslq -0xc(%rbp),%rdx
or     (%rcx,%rdx,4),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_crc16>:
movslq %esi,%rcx
mov    0x4(%rdi,%rcx,4),%eax
shl    $0x8,%eax
or     (%rdi,%rcx,4),%eax
ret

LLVM IR (-O0):
define i32 @read_crc16(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%6 = load i32*, i32** %3
%7 = load i32, i32* %4
%8 = add nsw i32 %7, 1
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i32, i32* %6, i64 %9
%11 = load i32, i32* %10
%12 = shl i32 %11, 8
%13 = load i32*, i32** %3
%14 = load i32, i32* %4
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i32, i32* %13, i64 %15
%17 = load i32, i32* %16
%18 = or i32 %12, %17
store i32 %18, i32* %5
%19 = load i32, i32* %5
ret i32 %19
}

LLVM IR (-O2):
define i32 @read_crc16(i32* nocapture %0, i32 %1) {
%3 = add nsw i32 %1, 1
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = load i32, i32* %5
%7 = shl i32 %6, 8
%8 = sext i32 %1 to i64
%9 = getelementptr inbounds i32, i32* %0, i64 %8
%10 = load i32, i32* %9
%11 = or i32 %7, %10
ret i32 %11
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int /*<<< orphan*/ safe_printf(char *);
int /*<<< orphan*/ safe_vprintf(char const *, int /*<<< orphan*/);
void tap_diag_va(const char *msg, va_list ap) {
  safe_printf("#");
  if (!msg) {
    goto out;
  }
  safe_printf(" ");
  safe_vprintf(msg, ap);
out:
  safe_printf("\n");
}


x86 assembly (clang, -O0):
<tap_diag_va>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <safe_printf@plt>
cmpq   $0x0,-0x8(%rbp)
jne    114b <tap_diag_va+0x2b>
jmp    1163 <tap_diag_va+0x43>
lea    0xeb0(%rip),%rdi
call   1030 <safe_printf@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <safe_vprintf@plt>
lea    0xe9a(%rip),%rdi
call   1030 <safe_printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tap_diag_va>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
lea    0xed1(%rip),%rdi
call   1030 <safe_printf@plt>
test   %rbx,%rbx
je     114f <tap_diag_va+0x2f>
lea    0xec2(%rip),%rdi
call   1030 <safe_printf@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
call   1040 <safe_vprintf@plt>
lea    0xeae(%rip),%rdi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <safe_printf@plt>

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

LLVM IR (-O2):
@.str = [2 x i8] c"#\00"
@.str.1 = [2 x i8] c" \00"
@.str.2 = [2 x i8] c"\0A\00"
define void @tap_diag_va(i8* %0, i32 %1) {
%3 = tail call i32 @safe_printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i8* %0, null
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = tail call i32 @safe_printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%7 = tail call i32 @safe_vprintf(i8* %0, i32 %1)
br label %8
8: ; preds = %2, %5
%9 = tail call i32 @safe_printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(int *);
void array_free(int *arr) {
  free(arr - 2);
  return;
}


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

x86 assembly (clang, -O2):
<array_free>:
add    $0xfffffffffffffff8,%rdi
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @array_free(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 -2
%5 = call i32 @free(i32* %4)
ret void
}

LLVM IR (-O2):
define void @array_free(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 -2
%3 = tail call i32 @free(i32* %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ a;

/* Variables and functions */
int min(int *, int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int a[] = {3, 10, 4, 1, 5, 9, 2, 6, 5};
  printf("min=%d\n", min(a, sizeof(a) / sizeof(*a)));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xeb6(%rip),%rsi
mov    $0x24,%edx
call   1050 <memcpy@plt>
lea    -0x30(%rbp),%rdi
mov    $0x9,%esi
call   1040 <min@plt>
mov    %eax,%esi
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
mov    0xef6(%rip),%eax
mov    %eax,0x20(%rsp)
movaps 0xedb(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xebf(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x9,%esi
call   1040 <min@plt>
lea    0xecb(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.a = [9 x i32] [i32 3, i32 10, i32 4, i32 1, i32 5, i32 9, i32 2, i32 6, i32 5]
@.str = [8 x i8] c"min=%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [9 x i32]
store i32 0, i32* %1
%3 = bitcast [9 x i32]* %2 to i8*
%4 = getelementptr inbounds [9 x i32], [9 x i32]* %2, i64 0, i64 0
%5 = call i32 @min(i32* %4, i32 9)
%6 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}

LLVM IR (-O2):
@__const.main.a = [9 x i32] [i32 3, i32 10, i32 4, i32 1, i32 5, i32 9, i32 2, i32 6, i32 5]
@.str = [8 x i8] c"min=%d\0A\00"
define i32 @main() {
%1 = alloca [9 x i32]
%2 = bitcast [9 x i32]* %1 to i8*
%3 = getelementptr inbounds [9 x i32], [9 x i32]* %1, i64 0, i64 0
%4 = call i32 @min(i32* %3, i32 9)
%5 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
extern void socket_cleanup() {}


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

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

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

LLVM IR (-O2):
define void @socket_cleanup() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void ft_memdel(void **ap) {
  if (ap && *ap) {
    free(*ap);
    *ap = NULL;
  }
}


x86 assembly (clang, -O0):
<ft_memdel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     114c <ft_memdel+0x3c>
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
je     114c <ft_memdel+0x3c>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rax
movq   $0x0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_memdel>:
push   %rbx
test   %rdi,%rdi
je     112d <ft_memdel+0x1d>
mov    %rdi,%rbx
mov    (%rdi),%rdi
test   %rdi,%rdi
je     112d <ft_memdel+0x1d>
call   1030 <free@plt>
movq   $0x0,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @ft_memdel(i8** %0) {
%2 = icmp eq i8** %0, null
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = load i8*, i8** %0
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i32 @free(i8* %4)
store i8* null, i8** %0
br label %8
8: ; preds = %6, %3, %1
ret void
}
int DIGIT(unsigned int *v, int i) {
  return (v[i / (sizeof(unsigned int) * 8)] >>
          (i % (sizeof(unsigned int) * 8))) %
         2;
}


x86 assembly (clang, -O0):
<DIGIT>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
shr    $0x5,%rcx
mov    (%rax,%rcx,4),%eax
movslq -0xc(%rbp),%rcx
and    $0x1f,%rcx
shr    %cl,%eax
and    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<DIGIT>:
movslq %esi,%rcx
mov    %rcx,%rax
shr    $0x5,%rax
mov    (%rdi,%rax,4),%eax
shr    %cl,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @DIGIT(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 = load i32, i32* %4
%7 = sext i32 %6 to i64
%8 = udiv i64 %7, 32
%9 = getelementptr inbounds i32, i32* %5, i64 %8
%10 = load i32, i32* %9
%11 = load i32, i32* %4
%12 = sext i32 %11 to i64
%13 = urem i64 %12, 32
%14 = trunc i64 %13 to i32
%15 = lshr i32 %10, %14
%16 = urem i32 %15, 2
ret i32 %16
}

LLVM IR (-O2):
define i32 @DIGIT(i32* nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = lshr i64 %3, 5
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = load i32, i32* %5
%7 = and i32 %1, 31
%8 = lshr i32 %6, %7
%9 = and i32 %8, 1
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ free(int *);
void free_int(void *_p) {
  if (_p == NULL)
    abort();
  free((int *)_p);
}


x86 assembly (clang, -O0):
<free_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    113e <free_int+0x1e>
mov    $0x0,%al
call   1040 <abort@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_int>:
test   %rdi,%rdi
je     112a <free_int+0xa>
jmp    1030 <free@plt>
push   %rax
xor    %eax,%eax
call   1040 <abort@plt>

LLVM IR (-O0):
define void @free_int(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 (...) @abort()
unreachable
7: ; preds = %1
%8 = load i8*, i8** %2
%9 = bitcast i8* %8 to i32*
%10 = call i32 @free(i32* %9)
ret void
}

LLVM IR (-O2):
define void @free_int(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %1
%6 = bitcast i8* %0 to i32*
%7 = tail call i32 @free(i32* %6)
ret void
}
int execute_pipe() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @execute_pipe() {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef scalar_t__ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ p16c8init(int /*<<< orphan*/ *, scalar_t__,
                             int /*<<< orphan*/ *, scalar_t__,
                             int /*<<< orphan*/ *, scalar_t__);
int /*<<< orphan*/ prg16setBank0(scalar_t__);
int /*<<< orphan*/ prg16setBank1(int /*<<< orphan*/);
void m97_init(uint8_t *prgROMin, uint32_t prgROMsizeIn, uint8_t *prgRAMin,
              uint32_t prgRAMsizeIn, uint8_t *chrROMin, uint32_t chrROMsizeIn) {
  p16c8init(prgROMin, prgROMsizeIn, prgRAMin, prgRAMsizeIn, chrROMin,
            chrROMsizeIn);
  prg16setBank0(prgROMsizeIn - 0x4000);
  prg16setBank1(0);
}


x86 assembly (clang, -O0):
<m97_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    -0x30(%rbp),%r9
call   1050 <p16c8init@plt>
mov    -0x10(%rbp),%rdi
sub    $0x4000,%rdi
call   1030 <prg16setBank0@plt>
xor    %edi,%edi
call   1040 <prg16setBank1@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<m97_init>:
push   %rbx
mov    %rsi,%rbx
call   1050 <p16c8init@plt>
add    $0xffffffffffffc000,%rbx
mov    %rbx,%rdi
call   1030 <prg16setBank0@plt>
xor    %edi,%edi
pop    %rbx
jmp    1040 <prg16setBank1@plt>

LLVM IR (-O0):
define void @m97_init(i32* %0, i64 %1, i32* %2, i64 %3, i32* %4, i64 %5) {
%7 = alloca i32*
%8 = alloca i64
%9 = alloca i32*
%10 = alloca i64
%11 = alloca i32*
%12 = alloca i64
store i32* %0, i32** %7
store i64 %1, i64* %8
store i32* %2, i32** %9
store i64 %3, i64* %10
store i32* %4, i32** %11
store i64 %5, i64* %12
%13 = load i32*, i32** %7
%14 = load i64, i64* %8
%15 = load i32*, i32** %9
%16 = load i64, i64* %10
%17 = load i32*, i32** %11
%18 = load i64, i64* %12
%19 = call i32 @p16c8init(i32* %13, i64 %14, i32* %15, i64 %16, i32* %17, i64 %18)
%20 = load i64, i64* %8
%21 = sub nsw i64 %20, 16384
%22 = call i32 @prg16setBank0(i64 %21)
%23 = call i32 @prg16setBank1(i32 0)
ret void
}

LLVM IR (-O2):
define void @m97_init(i32* %0, i64 %1, i32* %2, i64 %3, i32* %4, i64 %5) {
%7 = tail call i32 @p16c8init(i32* %0, i64 %1, i32* %2, i64 %3, i32* %4, i64 %5)
%8 = add nsw i64 %1, -16384
%9 = tail call i32 @prg16setBank0(i64 %8)
%10 = tail call i32 @prg16setBank1(i32 0)
ret void
}
int mdp4_overlay_dtv_unset(struct msm_fb_data_type *mfd,
                           struct mdp4_overlay_pipe *pipe) {
  return 0;
}


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

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

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

LLVM IR (-O2):
%struct.msm_fb_data_type = type opaque
%struct.mdp4_overlay_pipe = type opaque
define i32 @mdp4_overlay_dtv_unset(%struct.msm_fb_data_type* nocapture readnone %0, %struct.mdp4_overlay_pipe* nocapture readnone %1) {
ret i32 0
}
void SysCtlGPIOAHBEnable(unsigned long ulGPIOPeripheral) {

  ;
  (*((volatile unsigned long *)(0x400FE06C))) |= ulGPIOPeripheral & 0xFFFF;
}


x86 assembly (clang, -O0):
<SysCtlGPIOAHBEnable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
and    $0xffff,%rax
mov    $0x400fe06c,%ecx
mov    (%rcx),%rcx
or     %rax,%rcx
mov    $0x400fe06c,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<SysCtlGPIOAHBEnable>:
movzwl %di,%eax
or     %rax,0x400fe06c
40
ret

LLVM IR (-O0):
define void @SysCtlGPIOAHBEnable(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, 65535
%5 = load volatile i64, i64* inttoptr (i64 1074782316 to i64*)
%6 = or i64 %5, %4
store volatile i64 %6, i64* inttoptr (i64 1074782316 to i64*)
ret void
}

LLVM IR (-O2):
define void @SysCtlGPIOAHBEnable(i64 %0) {
%2 = and i64 %0, 65535
%3 = load volatile i64, i64* inttoptr (i64 1074782316 to i64*)
%4 = or i64 %3, %2
store volatile i64 %4, i64* inttoptr (i64 1074782316 to i64*)
ret void
}
/* Variables and functions */
int parse_action(char *, int /*<<< orphan*/);
int parse_action_nonverbose(char *s) { return parse_action(s, 0); }


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

x86 assembly (clang, -O2):
<parse_action_nonverbose>:
xor    %esi,%esi
jmp    1030 <parse_action@plt>

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

LLVM IR (-O2):
define i32 @parse_action_nonverbose(i8* %0) {
%2 = tail call i32 @parse_action(i8* %0, i32 0)
ret i32 %2
}
void _infix_operator_mult_u64_u64(unsigned long long lhs,
                                  unsigned long long rhs,
                                  unsigned long long *__rval_1) {
  *__rval_1 = lhs * rhs;
}


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

x86 assembly (clang, -O2):
<_infix_operator_mult_u64_u64>:
imul   %rsi,%rdi
mov    %rdi,(%rdx)
ret

LLVM IR (-O0):
define void @_infix_operator_mult_u64_u64(i64 %0, i64 %1, i64* %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64*
store i64 %0, i64* %4
store i64 %1, i64* %5
store i64* %2, i64** %6
%7 = load i64, i64* %4
%8 = load i64, i64* %5
%9 = mul i64 %7, %8
%10 = load i64*, i64** %6
store i64 %9, i64* %10
ret void
}

LLVM IR (-O2):
define void @_infix_operator_mult_u64_u64(i64 %0, i64 %1, i64* nocapture writeonly %2) {
%4 = mul i64 %1, %0
store i64 %4, i64* %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ t01();
int /*<<< orphan*/ t02();
int /*<<< orphan*/ t03();
int main(int argc, char *argv[]) {
  assert(t01());
  assert(t02());
  assert(t03());
  printf("ok\n");
  return 0;
}


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    $0x0,%al
call   1060 <t01@plt>
mov    %eax,%edi
call   1040 <assert@plt>
mov    $0x0,%al
call   1070 <t02@plt>
mov    %eax,%edi
call   1040 <assert@plt>
mov    $0x0,%al
call   1050 <t03@plt>
mov    %eax,%edi
call   1040 <assert@plt>
lea    0xe69(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1060 <t01@plt>
mov    %eax,%edi
call   1040 <assert@plt>
xor    %eax,%eax
call   1070 <t02@plt>
mov    %eax,%edi
call   1040 <assert@plt>
xor    %eax,%eax
call   1050 <t03@plt>
mov    %eax,%edi
call   1040 <assert@plt>
lea    0xe7e(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"ok\0A\00"
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 = call i32 (...) @t01()
%7 = call i32 @assert(i32 %6)
%8 = call i32 (...) @t02()
%9 = call i32 @assert(i32 %8)
%10 = call i32 (...) @t03()
%11 = call i32 @assert(i32 %10)
%12 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [3 x i8] c"ok\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @t01()
%4 = tail call i32 @assert(i32 %3)
%5 = tail call i32 (...) @t02()
%6 = tail call i32 @assert(i32 %5)
%7 = tail call i32 (...) @t03()
%8 = tail call i32 @assert(i32 %7)
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0))
ret i32 0
}
char *RCSid() {
  return RCSid("$Id: interpol.c,v 1.39.2.2 2012/08/23 21:42:26 sfeam Exp $");
}


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

x86 assembly (clang, -O2):
<RCSid>:
jmp    1100 <RCSid>

LLVM IR (-O0):
@.str = [59 x i8] c"$Id: interpol.c,v 1.39.2.2 2012/08/23 21:42:26 sfeam Exp $\00"
define i8* @RCSid() {
%1 = call i8* (i8*, ...) bitcast (i8* ()* @RCSid to i8* (i8*, ...)*)(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}

LLVM IR (-O2):
define noalias i8* @RCSid() {
br label %1
1: ; preds = %1, %0
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ read_and_encrypt_file(char const *);
int main(int argc, char *argv[]) {
  const char *file = NULL;
  if (2 <= argc) {
    file = argv[1];
  } else {
    file = "5.txt";
  }
  read_and_encrypt_file(file);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    $0x2,%eax
cmp    -0x8(%rbp),%eax
jg     114d <main+0x3d>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x18(%rbp)
jmp    1158 <main+0x48>
lea    0xeac(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <read_and_encrypt_file@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x2,%edi
jl     111c <main+0xc>
mov    0x8(%rsi),%rdi
jmp    1123 <main+0x13>
lea    0xedd(%rip),%rdi
call   1030 <read_and_encrypt_file@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"5.txt\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
br label %7
7: ; preds = %2, %4
%8 = phi i8* [ %6, %4 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), %2 ]
%9 = tail call i32 @read_and_encrypt_file(i8* %8)
ret i32 0
}
void nseel_asm_uplus_end(void) {}


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

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

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

LLVM IR (-O2):
define void @nseel_asm_uplus_end() {
ret void
}
int system(const char *command) { return command ? -1 : 0; }


x86 assembly (clang, -O0):
<system>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
xor    %eax,%eax
mov    $0xffffffff,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<system>:
neg    %rdi
sbb    %eax,%eax
ret

LLVM IR (-O0):
define i32 @system(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
%5 = zext i1 %4 to i64
%6 = select i1 %4, i32 -1, i32 0
ret i32 %6
}

LLVM IR (-O2):
define i32 @system(i8* readnone %0) {
%2 = icmp ne i8* %0, null
%3 = sext i1 %2 to i32
ret i32 %3
}
void INT_Excep_RSPI1_SPEI1(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_RSPI1_SPEI1() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
int s_hook_memory_remove(void *, char const *, int);
void s_free_(void *ptr, const char *file, int line) {
  int i;
  if (ptr == NULL)
    return;
  i = s_hook_memory_remove(ptr, file, line);
  if (i > 0)
    free(ptr);
}


x86 assembly (clang, -O0):
<s_free_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1143 <s_free_+0x23>
jmp    1169 <s_free_+0x49>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <s_hook_memory_remove@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jle    1169 <s_free_+0x49>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<s_free_>:
push   %rbx
test   %rdi,%rdi
je     113b <s_free_+0x1b>
mov    %rdi,%rbx
call   1040 <s_hook_memory_remove@plt>
test   %eax,%eax
jle    113b <s_free_+0x1b>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>
pop    %rbx
ret

LLVM IR (-O0):
define void @s_free_(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = load i8*, i8** %4
%9 = icmp eq i8* %8, null
br i1 %9, label %10, label %11
10: ; preds = %3
br label %21
11: ; preds = %3
%12 = load i8*, i8** %4
%13 = load i8*, i8** %5
%14 = load i32, i32* %6
%15 = call i32 @s_hook_memory_remove(i8* %12, i8* %13, i32 %14)
store i32 %15, i32* %7
%16 = load i32, i32* %7
%17 = icmp sgt i32 %16, 0
br i1 %17, label %18, label %21
18: ; preds = %11
%19 = load i8*, i8** %4
%20 = call i32 @free(i8* %19)
br label %21
21: ; preds = %10, %18, %11
ret void
}

LLVM IR (-O2):
define void @s_free_(i8* %0, i8* %1, i32 %2) {
%4 = icmp eq i8* %0, null
br i1 %4, label %10, label %5
5: ; preds = %3
%6 = tail call i32 @s_hook_memory_remove(i8* %0, i8* %1, i32 %2)
%7 = icmp sgt i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %5
%9 = tail call i32 @free(i8* %0)
br label %10
10: ; preds = %5, %8, %3
ret void
}
long Max(long a, long b) { return a > b ? a : b; }


x86 assembly (clang, -O0):
<Max>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jle    1127 <Max+0x27>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    112f <Max+0x2f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Max>:
mov    %rsi,%rax
cmp    %rsi,%rdi
cmovg  %rdi,%rax
ret

LLVM IR (-O0):
define i64 @Max(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = icmp sgt i64 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i64, i64* %3
br label %12
10: ; preds = %2
%11 = load i64, i64* %4
br label %12
12: ; preds = %10, %8
%13 = phi i64 [ %9, %8 ], [ %11, %10 ]
ret i64 %13
}

LLVM IR (-O2):
define i64 @Max(i64 %0, i64 %1) {
%3 = icmp sgt i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
ret i64 %4
}