xunge/DecIR huggingface dataset:
int do_848() { return 848; }


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

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

LLVM IR (-O0):
define i32 @do_848() {
ret i32 848
}

LLVM IR (-O2):
define i32 @do_848() {
ret i32 848
}
/* Type definitions */
struct nlattr {
  int dummy;
};
struct nla_policy {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ nla_data(struct nlattr *);
int /*<<< orphan*/ nla_len(struct nlattr *);
int nla_validate(int /*<<< orphan*/, int /*<<< orphan*/, int,
                 struct nla_policy *);
int nla_validate_nested(struct nlattr *start, int maxtype,
                        struct nla_policy *policy) {
  return nla_validate(nla_data(start), nla_len(start), maxtype, policy);
}


x86 assembly (clang, -O0):
<nla_validate_nested>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <nla_data@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <nla_len@plt>
mov    -0x1c(%rbp),%edi
mov    %eax,%esi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%rcx
call   1050 <nla_validate@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nla_validate_nested>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %esi,%r15d
mov    %rdi,%rbx
call   1040 <nla_data@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <nla_len@plt>
mov    %ebp,%edi
mov    %eax,%esi
mov    %r15d,%edx
mov    %r14,%rcx
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1050 <nla_validate@plt>

LLVM IR (-O0):
%struct.nlattr = type { i32 }
%struct.nla_policy = type { i32 }
define i32 @nla_validate_nested(%struct.nlattr* %0, i32 %1, %struct.nla_policy* %2) {
%4 = alloca %struct.nlattr*
%5 = alloca i32
%6 = alloca %struct.nla_policy*
store %struct.nlattr* %0, %struct.nlattr** %4
store i32 %1, i32* %5
store %struct.nla_policy* %2, %struct.nla_policy** %6
%7 = load %struct.nlattr*, %struct.nlattr** %4
%8 = call i32 @nla_data(%struct.nlattr* %7)
%9 = load %struct.nlattr*, %struct.nlattr** %4
%10 = call i32 @nla_len(%struct.nlattr* %9)
%11 = load i32, i32* %5
%12 = load %struct.nla_policy*, %struct.nla_policy** %6
%13 = call i32 @nla_validate(i32 %8, i32 %10, i32 %11, %struct.nla_policy* %12)
ret i32 %13
}

LLVM IR (-O2):
%struct.nlattr = type { i32 }
%struct.nla_policy = type { i32 }
define i32 @nla_validate_nested(%struct.nlattr* %0, i32 %1, %struct.nla_policy* %2) {
%4 = tail call i32 @nla_data(%struct.nlattr* %0)
%5 = tail call i32 @nla_len(%struct.nlattr* %0)
%6 = tail call i32 @nla_validate(i32 %4, i32 %5, i32 %1, %struct.nla_policy* %2)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void arg_err(void) {
  printf("\nusage:\ntrans <-d > language_in language_out file_name(s)\n");
  exit(1);
}


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

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

LLVM IR (-O0):
@.str = [59 x i8] c"\0Ausage:\0Atrans <-d > language_in language_out file_name(s)\0A\00"
define void @arg_err() {
%1 = call i32 @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@str = [58 x i8] c"\0Ausage:\0Atrans <-d > language_in language_out file_name(s)\00"
define void @arg_err() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([58 x i8], [58 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t galois_x4_1(uint8_t a) {
  int i;
  for (i = 7; i >= 0; i--) {
    if (a >> i & 0x1) {
      a ^= 0x11 << (i - 4);
    }
  }
  return a;
}


x86 assembly (clang, -O0):
<galois_x4_1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x7,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     1152 <galois_x4_1+0x52>
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
sar    %cl,%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     113f <galois_x4_1+0x3f>
mov    -0x8(%rbp),%ecx
sub    $0x4,%ecx
mov    $0x11,%eax
shl    %cl,%eax
xor    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1144 <galois_x4_1+0x44>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <galois_x4_1+0xe>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<galois_x4_1>:
movd   %edi,%xmm0
pshufd $0x0,%xmm0,%xmm0
movdqa 0xeef(%rip),%xmm1
pand   %xmm1,%xmm0
pcmpeqd %xmm1,%xmm0
pand   0xeef(%rip),%xmm0
pshufd $0xee,%xmm0,%xmm1
pxor   %xmm0,%xmm1
pshufd $0x55,%xmm1,%xmm0
por    %xmm1,%xmm0
movd   %xmm0,%eax
xor    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @galois_x4_1(i32 %0) {
%2 = insertelement <4 x i32> poison, i32 %0, i64 0
%3 = shufflevector <4 x i32> %2, <4 x i32> poison, <4 x i32> zeroinitializer
%4 = and <4 x i32> %3, <i32 16, i32 32, i32 64, i32 128>
%5 = icmp eq <4 x i32> %4, zeroinitializer
%6 = select <4 x i1> %5, <4 x i32> zeroinitializer, <4 x i32> <i32 17, i32 34, i32 68, i32 136>
%7 = call i32 @llvm.vector.reduce.xor.v4i32(<4 x i32> %6)
%8 = xor i32 %7, %0
ret i32 %8
}
void neon_i18n_init(void) {}


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

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

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

LLVM IR (-O2):
define void @neon_i18n_init() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ STA8(int /*<<< orphan*/);
int /*<<< orphan*/ StackRelative(int);
void Op83M1(void) { STA8(StackRelative(2)); }


x86 assembly (clang, -O0):
<Op83M1>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%edi
call   1040 <StackRelative@plt>
mov    %eax,%edi
call   1030 <STA8@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Op83M1>:
push   %rax
mov    $0x2,%edi
call   1040 <StackRelative@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <STA8@plt>

LLVM IR (-O0):
define void @Op83M1() {
%1 = call i32 @StackRelative(i32 2)
%2 = call i32 @STA8(i32 %1)
ret void
}

LLVM IR (-O2):
define void @Op83M1() {
%1 = tail call i32 @StackRelative(i32 2)
%2 = tail call i32 @STA8(i32 %1)
ret void
}
void log_print_direct_(int level, void *reserved, const char *msg, ...) {}


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

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

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

LLVM IR (-O2):
define void @log_print_direct_(i32 %0, i8* nocapture %1, i8* nocapture %2, ...) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _PROCEDURE_LINKAGE_TABLE_();
void gettimeofday() {
  _PROCEDURE_LINKAGE_TABLE_();
  return;
}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, int, char *, int);
int /*<<< orphan*/ system(char *);
void set_led(int v) {
  char cmd[512];
  snprintf(cmd, sizeof(cmd),
           "for i in 22 23 24; do"
           " echo %d >/sys/class/gpio/gpio$i/value; done",
           v);
  system(cmd);
}


x86 assembly (clang, -O0):
<set_led>:
push   %rbp
mov    %rsp,%rbp
sub    $0x210,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x210(%rbp),%rdi
mov    -0x4(%rbp),%ecx
mov    $0x200,%esi
lea    0xebc(%rip),%rdx
call   1040 <snprintf@plt>
lea    -0x210(%rbp),%rdi
call   1030 <system@plt>
add    $0x210,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_led>:
push   %rbx
sub    $0x200,%rsp
mov    %edi,%ecx
lea    0xecf(%rip),%rdx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x200,%esi
call   1040 <snprintf@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
add    $0x200,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [66 x i8] c"for i in 22 23 24; do echo %d >/sys/class/gpio/gpio$i/value; done\00"
define void @set_led(i32 %0) {
%2 = alloca i32
%3 = alloca [512 x i8]
store i32 %0, i32* %2
%4 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 0
%5 = load i32, i32* %2
%6 = call i32 @snprintf(i8* %4, i32 512, i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 0
%8 = call i32 @system(i8* %7)
ret void
}

LLVM IR (-O2):
@.str = [66 x i8] c"for i in 22 23 24; do echo %d >/sys/class/gpio/gpio$i/value; done\00"
define void @set_led(i32 %0) {
%2 = alloca [512 x i8]
%3 = getelementptr inbounds [512 x i8], [512 x i8]* %2, i64 0, i64 0
%4 = call i32 @snprintf(i8* %3, i32 512, i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str, i64 0, i64 0), i32 %0)
%5 = call i32 @system(i8* %3)
ret void
}
void avio_enum_protocols() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ UINT32_MAX;
uint32_t nrf_raal_timeslot_us_left_get(void) { return UINT32_MAX; }


x86 assembly (clang, -O0):
<nrf_raal_timeslot_us_left_get>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eed(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nrf_raal_timeslot_us_left_get>:
mov    0x2ef1(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
@UINT32_MAX = global i32 0
define i32 @nrf_raal_timeslot_us_left_get() {
%1 = load i32, i32* @UINT32_MAX
ret i32 %1
}

LLVM IR (-O2):
@UINT32_MAX = global i32 0
define i32 @nrf_raal_timeslot_us_left_get() {
%1 = load i32, i32* @UINT32_MAX
ret i32 %1
}
int my_sqrt(int x) {
  int y = 1;
  int n = x;
  while (n > y) {
    n = y + (n - y) / 2;
    y = x / n;
  }
  return n;
}


x86 assembly (clang, -O0):
<my_sqrt>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    114d <my_sqrt+0x4d>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
sub    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %eax,-0x8(%rbp)
jmp    1114 <my_sqrt+0x14>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_sqrt>:
cmp    $0x2,%edi
jl     112b <my_sqrt+0x2b>
mov    $0x1,%eax
mov    %edi,%edx
nopl   0x0(%rax)
sub    %eax,%edx
mov    %edx,%ecx
shr    $0x1f,%ecx
add    %edx,%ecx
sar    %ecx
add    %eax,%ecx
mov    %edi,%eax
cltd
idiv   %ecx
mov    %ecx,%edx
cmp    %eax,%ecx
jg     1110 <my_sqrt+0x10>
mov    %ecx,%eax
ret
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @my_sqrt(i32 %0) {
%2 = icmp sgt i32 %0, 1
br i1 %2, label %3, label %11
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ %0, %1 ]
%5 = phi i32 [ %9, %3 ], [ 1, %1 ]
%6 = sub nsw i32 %4, %5
%7 = sdiv i32 %6, 2
%8 = add nsw i32 %7, %5
%9 = sdiv i32 %0, %8
%10 = icmp sgt i32 %8, %9
br i1 %10, label %3, label %11
11: ; preds = %3, %1
%12 = phi i32 [ %0, %1 ], [ %8, %3 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, char *, char *, char *);
int /*<<< orphan*/ system(char *);
void make_plain_archive(char *user_name) {
  char make_tar[200];
  sprintf(make_tar, "tar -c %s > %s.tar; rm -Rf %s", user_name, user_name,
          user_name);
  system(make_tar);
}


x86 assembly (clang, -O0):
<make_plain_archive>:
push   %rbp
mov    %rsp,%rbp
sub    $0xd0,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0xd0(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    -0x8(%rbp),%rcx
mov    -0x8(%rbp),%r8
lea    0xeb7(%rip),%rsi
call   1040 <sprintf@plt>
lea    -0xd0(%rbp),%rdi
call   1030 <system@plt>
add    $0xd0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<make_plain_archive>:
push   %rbx
sub    $0xd0,%rsp
mov    %rdi,%rcx
lea    0xece(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    %rcx,%rdx
mov    %rcx,%r8
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
add    $0xd0,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [30 x i8] c"tar -c %s > %s.tar; rm -Rf %s\00"
define void @make_plain_archive(i8* %0) {
%2 = alloca i8*
%3 = alloca [200 x i8]
store i8* %0, i8** %2
%4 = getelementptr inbounds [200 x i8], [200 x i8]* %3, i64 0, i64 0
%5 = load i8*, i8** %2
%6 = load i8*, i8** %2
%7 = load i8*, i8** %2
%8 = call i32 @sprintf(i8* %4, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %5, i8* %6, i8* %7)
%9 = getelementptr inbounds [200 x i8], [200 x i8]* %3, i64 0, i64 0
%10 = call i32 @system(i8* %9)
ret void
}

LLVM IR (-O2):
@.str = [30 x i8] c"tar -c %s > %s.tar; rm -Rf %s\00"
define void @make_plain_archive(i8* %0) {
%2 = alloca [200 x i8]
%3 = getelementptr inbounds [200 x i8], [200 x i8]* %2, i64 0, i64 0
%4 = call i32 @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %0, i8* %0)
%5 = call i32 @system(i8* %3)
ret void
}
/* Variables and functions */
float pow(int, float);
float convertDBtoFloat(float dbValue) { return pow(10, dbValue / 20); }


x86 assembly (clang, -O0):
<convertDBtoFloat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  0xed6(%rip),%xmm1
divss  %xmm1,%xmm0
mov    $0xa,%edi
call   1030 <pow@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<convertDBtoFloat>:
divss  0xee8(%rip),%xmm0
mov    $0xa,%edi
jmp    1030 <pow@plt>

LLVM IR (-O0):
define float @convertDBtoFloat(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fdiv float %3, 2.000000e+01
%5 = call float @pow(i32 10, float %4)
ret float %5
}

LLVM IR (-O2):
define float @convertDBtoFloat(float %0) {
%2 = fdiv float %0, 2.000000e+01
%3 = tail call float @pow(i32 10, float %2)
ret float %3
}
/* Variables and functions */
int /*<<< orphan*/ hal_exception_panic(char *, int, int, char *);
void reserved_hndlr() {
  hal_exception_panic(
      "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
      "2022-01-22/02-19-57/repos/darknightghost/sandnix/refs/heads/master/src/"
      "sandnix/kernel/hal/io/interrupt/arch/arm/armv7/cortex-a9/interrupt.c",
      203, (134), ("Reserved interrupt called."));
  ;
  return;
}


x86 assembly (clang, -O0):
<reserved_hndlr>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0xcb,%esi
mov    $0x86,%edx
lea    0xfa0(%rip),%rcx
call   1030 <hal_exception_panic@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<reserved_hndlr>:
lea    0xee9(%rip),%rdi
lea    0xfae(%rip),%rcx
mov    $0xcb,%esi
mov    $0x86,%edx
jmp    1030 <hal_exception_panic@plt>

LLVM IR (-O0):
@.str = [204 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/darknightghost/sandnix/refs/heads/master/src/sandnix/kernel/hal/io/interrupt/arch/arm/armv7/cortex-a9/interrupt.c\00"
@.str.1 = [27 x i8] c"Reserved interrupt called.\00"
define void @reserved_hndlr() {
%1 = call i32 @hal_exception_panic(i8* getelementptr inbounds ([204 x i8], [204 x i8]* @.str, i64 0, i64 0), i32 203, i32 134, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [204 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/darknightghost/sandnix/refs/heads/master/src/sandnix/kernel/hal/io/interrupt/arch/arm/armv7/cortex-a9/interrupt.c\00"
@.str.1 = [27 x i8] c"Reserved interrupt called.\00"
define void @reserved_hndlr() {
%1 = tail call i32 @hal_exception_panic(i8* getelementptr inbounds ([204 x i8], [204 x i8]* @.str, i64 0, i64 0), i32 203, i32 134, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}
extern void str_chrrepl(char *s, char from, char to) {
  while (*s) {
    *s = (*s == from ? to : *s);
    s++;
  }
}


x86 assembly (clang, -O0):
<str_chrrepl>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1165 <str_chrrepl+0x65>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x9(%rbp),%ecx
cmp    %ecx,%eax
jne    113f <str_chrrepl+0x3f>
movsbl -0xa(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1149 <str_chrrepl+0x49>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1113 <str_chrrepl+0x13>
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_chrrepl>:
mov    (%rdi),%al
test   %al,%al
je     1127 <str_chrrepl+0x27>
add    $0x1,%rdi
movzbl %dl,%ecx
nopl   (%rax)
cmp    %sil,%al
movzbl %al,%eax
cmove  %ecx,%eax
mov    %al,-0x1(%rdi)
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
jne    1110 <str_chrrepl+0x10>
ret

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

LLVM IR (-O2):
define void @str_chrrepl(i8* nocapture %0, i8 signext %1, i8 signext %2) {
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %14, label %6
6: ; preds = %3, %6
%7 = phi i8 [ %12, %6 ], [ %4, %3 ]
%8 = phi i8* [ %11, %6 ], [ %0, %3 ]
%9 = icmp eq i8 %7, %1
%10 = select i1 %9, i8 %2, i8 %7
store i8 %10, i8* %8
%11 = getelementptr inbounds i8, i8* %8, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %6
14: ; preds = %6, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ MIPS_CLEAR_BIT(int, int);
void xburst_cgm_ungate_gpu() { MIPS_CLEAR_BIT((0xB0000000 + 0x28), 4); }


x86 assembly (clang, -O0):
<xburst_cgm_ungate_gpu>:
push   %rbp
mov    %rsp,%rbp
mov    $0xb0000028,%edi
mov    $0x4,%esi
call   1030 <MIPS_CLEAR_BIT@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<xburst_cgm_ungate_gpu>:
mov    $0xb0000028,%edi
mov    $0x4,%esi
jmp    1030 <MIPS_CLEAR_BIT@plt>

LLVM IR (-O0):
define void @xburst_cgm_ungate_gpu() {
%1 = call i32 @MIPS_CLEAR_BIT(i32 -1342177240, i32 4)
ret void
}

LLVM IR (-O2):
define void @xburst_cgm_ungate_gpu() {
%1 = tail call i32 @MIPS_CLEAR_BIT(i32 -1342177240, i32 4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_fprem_cases();
int /*<<< orphan*/ test_fprem_pairs();
int main(int argc, char **argv) {
  test_fprem_cases();
  test_fprem_pairs();
  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   1040 <test_fprem_cases@plt>
mov    $0x0,%al
call   1030 <test_fprem_pairs@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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 = call i32 (...) @test_fprem_cases()
%7 = call i32 (...) @test_fprem_pairs()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @test_fprem_cases()
%4 = tail call i32 (...) @test_fprem_pairs()
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fread(unsigned char *, int, int, int /*<<< orphan*/ *);
int read_lsb_int(FILE *f) {
  unsigned char buf[4];
  fread(buf, 4, 1, f);
  return (buf[3] << 24) | (buf[2] << 16) | (buf[1] << 8) | (buf[0]);
}


x86 assembly (clang, -O0):
<read_lsb_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0xc(%rbp),%rdi
mov    -0x8(%rbp),%rcx
mov    $0x4,%esi
mov    $0x1,%edx
call   1030 <fread@plt>
movzbl -0x9(%rbp),%eax
shl    $0x18,%eax
movzbl -0xa(%rbp),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
movzbl -0xb(%rbp),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
movzbl -0xc(%rbp),%ecx
or     %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_lsb_int>:
push   %rax
mov    %rdi,%rcx
lea    0x4(%rsp),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
call   1030 <fread@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @read_lsb_int(i32* %0) {
%2 = alloca i32*
%3 = alloca [4 x i8]
store i32* %0, i32** %2
%4 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
%5 = load i32*, i32** %2
%6 = call i32 @fread(i8* %4, i32 4, i32 1, i32* %5)
%7 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 3
%8 = load i8, i8* %7
%9 = zext i8 %8 to i32
%10 = shl i32 %9, 24
%11 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 2
%12 = load i8, i8* %11
%13 = zext i8 %12 to i32
%14 = shl i32 %13, 16
%15 = or i32 %10, %14
%16 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 1
%17 = load i8, i8* %16
%18 = zext i8 %17 to i32
%19 = shl i32 %18, 8
%20 = or i32 %15, %19
%21 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
%22 = load i8, i8* %21
%23 = zext i8 %22 to i32
%24 = or i32 %20, %23
ret i32 %24
}

LLVM IR (-O2):
define i32 @read_lsb_int(i32* nocapture %0) {
%2 = alloca [4 x i8]
%3 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 0
%4 = call i32 @fread(i8* %3, i32 4, i32 1, i32* %0)
%5 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 3
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = shl nuw i32 %7, 24
%9 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 2
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = shl nuw nsw i32 %11, 16
%13 = or i32 %12, %8
%14 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 1
%15 = load i8, i8* %14
%16 = zext i8 %15 to i32
%17 = shl nuw nsw i32 %16, 8
%18 = or i32 %13, %17
%19 = load i8, i8* %3
%20 = zext i8 %19 to i32
%21 = or i32 %18, %20
ret i32 %21
}
/* Variables and functions */
int /*<<< orphan*/ syscall1(int, int);
void exit(int errorCode) {
  syscall1(1, errorCode);
  while (1)
    ;
}


x86 assembly (clang, -O0):
<exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
mov    $0x1,%edi
call   1030 <syscall1@plt>
jmp    1128 <exit+0x18>

x86 assembly (clang, -O2):
<exit>:
push   %rax
mov    %edi,%esi
mov    $0x1,%edi
call   1030 <syscall1@plt>
nopl   (%rax)
jmp    1120 <exit+0x10>

LLVM IR (-O0):
define void @exit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @syscall1(i32 1, i32 %3)
br label %5
5: ; preds = %1, %5
br label %5
}

LLVM IR (-O2):
define void @exit(i32 %0) {
%2 = tail call i32 @syscall1(i32 1, i32 %0)
br label %3
3: ; preds = %1, %3
br label %3
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
scalar_t__ wf_next_argument(char *, size_t, int /*<<< orphan*/ *);
int wf_parse_mtlname(char *buffer, size_t n, FILE *fp) {
  return wf_next_argument(buffer, n, fp) == 0 ? -1 : 0;
}


x86 assembly (clang, -O0):
<wf_parse_mtlname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <wf_next_argument@plt>
mov    %rax,%rdx
xor    %eax,%eax
mov    $0xffffffff,%ecx
cmp    $0x0,%rdx
cmove  %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wf_parse_mtlname>:
push   %rax
call   1030 <wf_next_argument@plt>
cmp    $0x1,%rax
sbb    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @wf_parse_mtlname(i8* %0, i64 %1, i32* %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i32*
store i8* %0, i8** %4
store i64 %1, i64* %5
store i32* %2, i32** %6
%7 = load i8*, i8** %4
%8 = load i64, i64* %5
%9 = load i32*, i32** %6
%10 = call i64 @wf_next_argument(i8* %7, i64 %8, i32* %9)
%11 = icmp eq i64 %10, 0
%12 = zext i1 %11 to i64
%13 = select i1 %11, i32 -1, i32 0
ret i32 %13
}

LLVM IR (-O2):
define i32 @wf_parse_mtlname(i8* %0, i64 %1, i32* %2) {
%4 = tail call i64 @wf_next_argument(i8* %0, i64 %1, i32* %2)
%5 = icmp eq i64 %4, 0
%6 = sext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ assert(void *);
int /*<<< orphan*/ free(void *);
void lfree(void *ptr) {
  assert(ptr);
  free(ptr);
}


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

x86 assembly (clang, -O2):
<lfree>:
push   %rbx
mov    %rdi,%rbx
call   1040 <assert@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @lfree(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @assert(i8* %3)
%5 = load i8*, i8** %2
%6 = call i32 @free(i8* %5)
ret void
}

LLVM IR (-O2):
define void @lfree(i8* %0) {
%2 = tail call i32 @assert(i8* %0)
%3 = tail call i32 @free(i8* %0)
ret void
}
int mdp4_mddi_overlay_blt_offset(struct msm_fb_data_type *mfd,
                                 struct msmfb_overlay_blt *req) {
  return 0;
}


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

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

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

LLVM IR (-O2):
%struct.msm_fb_data_type = type opaque
%struct.msmfb_overlay_blt = type opaque
define i32 @mdp4_mddi_overlay_blt_offset(%struct.msm_fb_data_type* nocapture readnone %0, %struct.msmfb_overlay_blt* nocapture readnone %1) {
ret i32 0
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
int const factorial(int const);
uint64_t _fac(const uint64_t a) { return a < 2 ? 1 : a * factorial(a - 1); }


x86 assembly (clang, -O0):
<_fac>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x2,-0x4(%rbp)
jge    1132 <_fac+0x22>
mov    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    114e <_fac+0x3e>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
sub    $0x1,%edi
call   1030 <factorial@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
imul   %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_fac>:
mov    $0x1,%eax
cmp    $0x2,%edi
jl     1129 <_fac+0x19>
push   %rbx
mov    %edi,%ebx
lea    -0x1(%rbx),%edi
call   1030 <factorial@plt>
imul   %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @_fac(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 %3, 2
br i1 %4, label %5, label %6
5: ; preds = %1
br label %12
6: ; preds = %1
%7 = load i32, i32* %2
%8 = load i32, i32* %2
%9 = sub nsw i32 %8, 1
%10 = call i32 @factorial(i32 %9)
%11 = mul nsw i32 %7, %10
br label %12
12: ; preds = %6, %5
%13 = phi i32 [ 1, %5 ], [ %11, %6 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @_fac(i32 %0) {
%2 = icmp slt i32 %0, 2
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = add nsw i32 %0, -1
%5 = tail call i32 @factorial(i32 %4)
%6 = mul nsw i32 %5, %0
br label %7
7: ; preds = %1, %3
%8 = phi i32 [ %6, %3 ], [ 1, %1 ]
ret i32 %8
}
int tpl_cpu_bigendian(void) {
  unsigned i = 1;
  char *c;
  c = (char *)&i;
  return (c[0] == 1 ? 0 : 1);
}


x86 assembly (clang, -O0):
<tpl_cpu_bigendian>:
push   %rbp
mov    %rsp,%rbp
movl   $0x1,-0x4(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%edx
mov    $0x1,%eax
xor    %ecx,%ecx
cmp    $0x1,%edx
cmove  %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @tpl_cpu_bigendian() {
%1 = alloca i32
%2 = alloca i8*
store i32 1, i32* %1
%3 = bitcast i32* %1 to i8*
store i8* %3, i8** %2
%4 = load i8*, i8** %2
%5 = getelementptr inbounds i8, i8* %4, i64 0
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = icmp eq i32 %7, 1
%9 = zext i1 %8 to i64
%10 = select i1 %8, i32 0, i32 1
ret i32 %10
}

LLVM IR (-O2):
define i32 @tpl_cpu_bigendian() {
ret i32 0
}
/* Variables and functions */
void init(int argc, char *argv[]) {
  {
    extern void input_init(int, char *[]);
    input_init(argc, argv);
  }
  {
    extern void main_init(int, char *[]);
    main_init(argc, argv);
  }
  {
    extern void prof_init(int, char *[]);
    prof_init(argc, argv);
  }
  {
    extern void trace_init(int, char *[]);
    trace_init(argc, argv);
  }
  {
    extern void type_init(int, char *[]);
    type_init(argc, argv);
  }
  {
    extern void x86linux_init(int, char *[]);
    x86linux_init(argc, argv);
  }
}


x86 assembly (clang, -O0):
<init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1070 <input_init@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <main_init@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1040 <prof_init@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1060 <trace_init@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1050 <type_init@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1080 <x86linux_init@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<init>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
call   1070 <input_init@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
call   1030 <main_init@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
call   1040 <prof_init@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
call   1060 <trace_init@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
call   1050 <type_init@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1080 <x86linux_init@plt>

LLVM IR (-O0):
define void @init(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i32, i32* %3
%6 = load i8**, i8*** %4
%7 = load i32, i32* %3
%8 = load i8**, i8*** %4
%9 = load i32, i32* %3
%10 = load i8**, i8*** %4
%11 = load i32, i32* %3
%12 = load i8**, i8*** %4
%13 = load i32, i32* %3
%14 = load i8**, i8*** %4
%15 = load i32, i32* %3
%16 = load i8**, i8*** %4
ret void
}

LLVM IR (-O2):
define void @init(i32 %0, i8** %1) {
tail call void @input_init(i32 %0, i8** %1)
tail call void @main_init(i32 %0, i8** %1)
tail call void @prof_init(i32 %0, i8** %1)
tail call void @trace_init(i32 %0, i8** %1)
tail call void @type_init(i32 %0, i8** %1)
tail call void @x86linux_init(i32 %0, i8** %1)
ret void
}
/* Variables and functions */
scalar_t__ strncmp(char *, char *, int);
int endPIR(char *s, int *addend) {
  *addend = 0;
  if ((strncmp(s, "///", 3) == 0) || (strncmp(s, "ENTRY", 5) == 0))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<endPIR>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x10(%rbp),%rdi
lea    0xecb(%rip),%rsi
mov    $0x3,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
je     1168 <endPIR+0x58>
mov    -0x10(%rbp),%rdi
lea    0xeb0(%rip),%rsi
mov    $0x5,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    1174 <endPIR+0x64>
movl   $0x1,-0x4(%rbp)
jmp    117b <endPIR+0x6b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<endPIR>:
push   %rbx
mov    %rdi,%rbx
movl   $0x0,(%rsi)
lea    0xedf(%rip),%rsi
mov    $0x3,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
je     1151 <endPIR+0x41>
lea    0xecd(%rip),%rsi
mov    %rbx,%rdi
mov    $0x5,%edx
call   1030 <strncmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
sete   %al
pop    %rbx
ret
mov    $0x1,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"///\00"
@.str.1 = [6 x i8] c"ENTRY\00"
define i32 @endPIR(i8* %0, i32* nocapture writeonly %1) {
store i32 0, i32* %1
%3 = tail call i64 @strncmp(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 3)
%4 = icmp eq i64 %3, 0
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = tail call i64 @strncmp(i8* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 5)
%7 = icmp eq i64 %6, 0
%8 = zext i1 %7 to i32
br label %9
9: ; preds = %5, %2
%10 = phi i32 [ 1, %2 ], [ %8, %5 ]
ret i32 %10
}
/* Variables and functions */
void *paged_mem_pool_malloc(void *, size_t);
void *virtual_machine_resource_pool_page_malloc(void *pool_ptr, size_t size) {
  return paged_mem_pool_malloc(pool_ptr, size);
}


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

x86 assembly (clang, -O2):
<virtual_machine_resource_pool_page_malloc>:
jmp    1030 <paged_mem_pool_malloc@plt>

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

LLVM IR (-O2):
define i8* @virtual_machine_resource_pool_page_malloc(i8* %0, i64 %1) {
%3 = tail call i8* @paged_mem_pool_malloc(i8* %0, i64 %1)
ret i8* %3
}
void terminal_get_size2(int *rows, int *cols, int *px_width, int *px_height) {}


x86 assembly (clang, -O0):
<terminal_get_size2>:
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):
<terminal_get_size2>:
ret

LLVM IR (-O0):
define void @terminal_get_size2(i32* %0, i32* %1, i32* %2, i32* %3) {
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32*
store i32* %0, i32** %5
store i32* %1, i32** %6
store i32* %2, i32** %7
store i32* %3, i32** %8
ret void
}

LLVM IR (-O2):
define void @terminal_get_size2(i32* nocapture %0, i32* nocapture %1, i32* nocapture %2, i32* nocapture %3) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/
UpnpResponse_MediaServer_ContentDirectory_GetSearchCapabilities(void *, char *);
int /*<<< orphan*/ printf(char *);
void UpnpMediaServer_ContentDirectory_GetSearchCapabilities(void *upnptoken) {
  printf(
      "Invoke: UpnpMediaServer_ContentDirectory_GetSearchCapabilities();\r\n");
  UpnpResponse_MediaServer_ContentDirectory_GetSearchCapabilities(
      upnptoken, "Sample String");
}


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

x86 assembly (clang, -O2):
<UpnpMediaServer_ContentDirectory_GetSearchCapabilities>:
push   %rbx
mov    %rdi,%rbx
lea    0xee3(%rip),%rdi
call   1030 <puts@plt>
lea    0xec9(%rip),%rsi
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <UpnpResponse_MediaServer_ContentDirectory_GetSearchCapabilities@plt>

LLVM IR (-O0):
@.str = [68 x i8] c"Invoke: UpnpMediaServer_ContentDirectory_GetSearchCapabilities();\0D\0A\00"
@.str.1 = [14 x i8] c"Sample String\00"
define void @UpnpMediaServer_ContentDirectory_GetSearchCapabilities(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 @UpnpResponse_MediaServer_ContentDirectory_GetSearchCapabilities(i8* %4, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str.1 = [14 x i8] c"Sample String\00"
@str = [67 x i8] c"Invoke: UpnpMediaServer_ContentDirectory_GetSearchCapabilities();\0D\00"
define void @UpnpMediaServer_ContentDirectory_GetSearchCapabilities(i8* %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([67 x i8], [67 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @UpnpResponse_MediaServer_ContentDirectory_GetSearchCapabilities(i8* %0, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
scalar_t__ log2(double);
long double log2l(long double x) { return (long double)log2((double)x); }


x86 assembly (clang, -O0):
<log2l>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
fstpl  -0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
call   1030 <log2@plt>
mov    %rax,-0x18(%rbp)
fildll -0x18(%rbp)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log2l>:
sub    $0x18,%rsp
fldt   0x20(%rsp)
fstpl  0x8(%rsp)
movsd  0x8(%rsp),%xmm0
call   1030 <log2@plt>
mov    %rax,0x10(%rsp)
fildll 0x10(%rsp)
add    $0x18,%rsp
ret

LLVM IR (-O0):
define x86_fp80 @log2l(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = fptrunc x86_fp80 %3 to double
%5 = call i64 @log2(double %4)
%6 = sitofp i64 %5 to x86_fp80
ret x86_fp80 %6
}

LLVM IR (-O2):
define x86_fp80 @log2l(x86_fp80 %0) {
%2 = fptrunc x86_fp80 %0 to double
%3 = tail call i64 @log2(double %2)
%4 = sitofp i64 %3 to x86_fp80
ret x86_fp80 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ u_int;
typedef int /*<<< orphan*/ u_char;
typedef int /*<<< orphan*/ bool_t;
typedef int /*<<< orphan*/ XDR;

/* Variables and functions */
int /*<<< orphan*/ FALSE;
int /*<<< orphan*/ TRUE;
int /*<<< orphan*/ xdr_u_int(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
bool_t xdr_u_char(XDR *xdrs, u_char *cp) {
  u_int u;
  u = (*cp);
  if (!xdr_u_int(xdrs, &u)) {
    return FALSE;
  }
  *cp = u;
  return TRUE;
}


x86 assembly (clang, -O0):
<xdr_u_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x1c(%rbp),%rsi
call   1030 <xdr_u_int@plt>
cmp    $0x0,%eax
jne    1150 <xdr_u_char+0x40>
mov    0x2e92(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1165 <xdr_u_char+0x55>
mov    -0x1c(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    0x2e88(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xdr_u_char>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
mov    (%rsi),%eax
mov    %eax,0xc(%rsp)
lea    0xc(%rsp),%rsi
call   1030 <xdr_u_int@plt>
test   %eax,%eax
je     113b <xdr_u_char+0x2b>
mov    0xc(%rsp),%eax
mov    %eax,(%rbx)
mov    0x2eaf(%rip),%rax
jmp    1142 <xdr_u_char+0x32>
mov    0x2e96(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@FALSE = global i32 0
@TRUE = global i32 0
define i32 @xdr_u_char(i32* %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32
store i32* %0, i32** %4
store i32* %1, i32** %5
%7 = load i32*, i32** %5
%8 = load i32, i32* %7
store i32 %8, i32* %6
%9 = load i32*, i32** %4
%10 = call i32 @xdr_u_int(i32* %9, i32* %6)
%11 = icmp ne i32 %10, 0
br i1 %11, label %14, label %12
12: ; preds = %2
%13 = load i32, i32* @FALSE
store i32 %13, i32* %3
br label %18
14: ; preds = %2
%15 = load i32, i32* %6
%16 = load i32*, i32** %5
store i32 %15, i32* %16
%17 = load i32, i32* @TRUE
store i32 %17, i32* %3
br label %18
18: ; preds = %14, %12
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
@FALSE = global i32 0
@TRUE = global i32 0
define i32 @xdr_u_char(i32* %0, i32* nocapture %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = load i32, i32* %1
store i32 %5, i32* %3
%6 = call i32 @xdr_u_int(i32* %0, i32* %3)
%7 = icmp eq i32 %6, 0
br i1 %7, label %10, label %8
8: ; preds = %2
%9 = load i32, i32* %3
store i32 %9, i32* %1
br label %10
10: ; preds = %2, %8
%11 = phi i32* [ @TRUE, %8 ], [ @FALSE, %2 ]
%12 = load i32, i32* %11
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ ft_putstr(char *);
int /*<<< orphan*/ ft_recput(unsigned long long);
void ft_putulnbr(unsigned long long n) {
  if (n > 18446744073709551614ul) {
    ft_putstr("18446744073709551615");
    return;
  }
  ft_recput(n);
}


x86 assembly (clang, -O0):
<ft_putulnbr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0xfffffffffffffffe,-0x8(%rbp)
jbe    1148 <ft_putulnbr+0x28>
lea    0xec2(%rip),%rdi
call   1040 <ft_putstr@plt>
jmp    1151 <ft_putulnbr+0x31>
mov    -0x8(%rbp),%rdi
call   1030 <ft_recput@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_putulnbr>:
cmp    $0xffffffffffffffff,%rdi
je     112b <ft_putulnbr+0xb>
jmp    1030 <ft_recput@plt>
lea    0xece(%rip),%rdi
jmp    1040 <ft_putstr@plt>

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

LLVM IR (-O2):
@.str = [21 x i8] c"18446744073709551615\00"
define void @ft_putulnbr(i64 %0) {
%2 = icmp eq i64 %0, -1
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @ft_putstr(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
br label %7
5: ; preds = %1
%6 = tail call i32 @ft_recput(i64 %0)
br label %7
7: ; preds = %5, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ RET();
int /*<<< orphan*/ hardwareTick();
scalar_t__ testFlag(int);
void RET_NZ(void) {
  hardwareTick();
  if (testFlag(7) == 0) {
    RET();
  }
}


x86 assembly (clang, -O0):
<RET_NZ>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <hardwareTick@plt>
mov    $0x7,%edi
call   1050 <testFlag@plt>
cmp    $0x0,%rax
jne    1156 <RET_NZ+0x26>
mov    $0x0,%al
call   1030 <RET@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<RET_NZ>:
push   %rax
xor    %eax,%eax
call   1040 <hardwareTick@plt>
mov    $0x7,%edi
call   1050 <testFlag@plt>
test   %rax,%rax
je     1149 <RET_NZ+0x19>
pop    %rax
ret
xor    %eax,%eax
pop    %rcx
jmp    1030 <RET@plt>

LLVM IR (-O0):
define void @RET_NZ() {
%1 = call i32 (...) @hardwareTick()
%2 = call i64 @testFlag(i32 7)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 (...) @RET()
br label %6
6: ; preds = %4, %0
ret void
}

LLVM IR (-O2):
define void @RET_NZ() {
%1 = tail call i32 (...) @hardwareTick()
%2 = tail call i64 @testFlag(i32 7)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = tail call i32 (...) @RET()
br label %6
6: ; preds = %4, %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ hb_vmQuit();
void hb_service_threadCancel(void) {
  hb_vmQuit();
  exit(0);
}


x86 assembly (clang, -O0):
<hb_service_threadCancel>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <hb_vmQuit@plt>
xor    %edi,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<hb_service_threadCancel>:
push   %rax
xor    %eax,%eax
call   1040 <hb_vmQuit@plt>
xor    %edi,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @hb_service_threadCancel() {
%1 = call i32 (...) @hb_vmQuit()
%2 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @hb_service_threadCancel() {
%1 = tail call i32 (...) @hb_vmQuit()
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
double M_PI_2;
double asin(double);
double acos(double x) { return (M_PI_2 - asin(x)); }


x86 assembly (clang, -O0):
<acos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    0x2ec4(%rip),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <asin@plt>
movaps %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
subsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<acos>:
push   %rax
mov    0x2ed0(%rip),%rax
movsd  (%rax),%xmm1
movsd  %xmm1,(%rsp)
call   1030 <asin@plt>
movsd  (%rsp),%xmm1
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
@M_PI_2 = global double 0.000000e+00
define double @acos(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* @M_PI_2
%4 = load double, double* %2
%5 = call double @asin(double %4)
%6 = fsub double %3, %5
ret double %6
}

LLVM IR (-O2):
@M_PI_2 = global double 0.000000e+00
define double @acos(double %0) {
%2 = load double, double* @M_PI_2
%3 = tail call double @asin(double %0)
%4 = fsub double %2, %3
ret double %4
}