xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ SIGCHLD;
int /*<<< orphan*/ signal(int /*<<< orphan*/, void (*)(int));
int /*<<< orphan*/ wait(int *);
void sigchld(int sig) {
  int stat;
  wait(&stat);
  signal(SIGCHLD, sigchld);
}


x86 assembly (clang, -O0):
<sigchld>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x8(%rbp),%rdi
call   1040 <wait@plt>
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    0x2e8c(%rip),%rsi
call   1030 <signal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sigchld>:
push   %rax
lea    0x4(%rsp),%rdi
call   1040 <wait@plt>
mov    0x2eb6(%rip),%rax
mov    (%rax),%edi
mov    0x2e95(%rip),%rsi
call   1030 <signal@plt>
pop    %rax
ret

LLVM IR (-O0):
@SIGCHLD = global i32 0
define void @sigchld(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = call i32 @wait(i32* %3)
%5 = load i32, i32* @SIGCHLD
%6 = call i32 @signal(i32 %5, void (i32)* @sigchld)
ret void
}

LLVM IR (-O2):
@SIGCHLD = global i32 0
define void @sigchld(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @wait(i32* %2)
%5 = load i32, i32* @SIGCHLD
%6 = call i32 @signal(i32 %5, void (i32)* @sigchld)
ret void
}
/* Variables and functions */
double log(double);
double st_log2f(double x) { return log(x) * 1.442695040888963407359925; }


x86 assembly (clang, -O0):
<st_log2f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <log@plt>
movsd  0xed1(%rip),%xmm1
mulsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<st_log2f>:
push   %rax
call   1030 <log@plt>
mulsd  0xee2(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @st_log2f(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @log(double %3)
%5 = fmul double %4, 0x3FF71547652B82FE
ret double %5
}

LLVM IR (-O2):
define double @st_log2f(double %0) {
%2 = tail call double @log(double %0)
%3 = fmul double %2, 0x3FF71547652B82FE
ret double %3
}
void ff_hevc_put_hevc_bi_epel_h4_12_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_bi_epel_h4_12_sse4() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ usage_helper(char *);
void usage(void) {
  usage_helper("-?      -> Show this help message");
  usage_helper("-v      -> Produce verbose output during disassembly");
  fprintf(stderr, "\n");
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <usage_helper@plt>
lea    0xeeb(%rip),%rdi
call   1030 <usage_helper@plt>
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
lea    0xf0b(%rip),%rsi
call   1040 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <usage_helper@plt>
lea    0xeee(%rip),%rdi
call   1030 <usage_helper@plt>
mov    0x2ea0(%rip),%rax
mov    (%rax),%edi
lea    0xf0e(%rip),%rsi
pop    %rax
jmp    1040 <fprintf@plt>

LLVM IR (-O0):
@.str = [34 x i8] c"-? -> Show this help message\00"
@.str.1 = [53 x i8] c"-v -> Produce verbose output during disassembly\00"
@stderr = global i32 0
@.str.2 = [2 x i8] c"\0A\00"
define void @usage() {
%1 = call i32 @usage_helper(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @usage_helper(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.1, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [34 x i8] c"-? -> Show this help message\00"
@.str.1 = [53 x i8] c"-v -> Produce verbose output during disassembly\00"
@stderr = global i32 0
@.str.2 = [2 x i8] c"\0A\00"
define void @usage() {
%1 = tail call i32 @usage_helper(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @usage_helper(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.1, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
ret void
}
int dns_v_abi(void) { return 0x20120806; }


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

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

LLVM IR (-O0):
define i32 @dns_v_abi() {
ret i32 538052614
}

LLVM IR (-O2):
define i32 @dns_v_abi() {
ret i32 538052614
}
int count_digits(int x, int ndigits) {
  int i;
  if (x < 10) {
    return ndigits + 1;
  }
  return count_digits(x / 10, ndigits + 1);
}


x86 assembly (clang, -O0):
<count_digits>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    1136 <count_digits+0x26>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1151 <count_digits+0x41>
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
mov    -0xc(%rbp),%esi
add    $0x1,%esi
call   1030 <count_digits@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<count_digits>:
mov    %esi,%eax
cmp    $0xa,%edi
jl     1124 <count_digits+0x24>
mov    $0xcccccccd,%ecx
nopl   0x0(%rax)
mov    %edi,%edx
imul   %rcx,%rdx
shr    $0x23,%rdx
add    $0x1,%eax
cmp    $0x64,%edi
mov    %edx,%edi
jae    1110 <count_digits+0x10>
add    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @count_digits(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* %4
%8 = icmp slt i32 %7, 10
br i1 %8, label %9, label %12
9: ; preds = %2
%10 = load i32, i32* %5
%11 = add nsw i32 %10, 1
store i32 %11, i32* %3
br label %18
12: ; preds = %2
%13 = load i32, i32* %4
%14 = sdiv i32 %13, 10
%15 = load i32, i32* %5
%16 = add nsw i32 %15, 1
%17 = call i32 @count_digits(i32 %14, i32 %16)
store i32 %17, i32* %3
br label %18
18: ; preds = %12, %9
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
define i32 @count_digits(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, 10
br i1 %3, label %4, label %7
4: ; preds = %7, %2
%5 = phi i32 [ %1, %2 ], [ %11, %7 ]
%6 = add nsw i32 %5, 1
ret i32 %6
7: ; preds = %2, %7
%8 = phi i32 [ %11, %7 ], [ %1, %2 ]
%9 = phi i32 [ %10, %7 ], [ %0, %2 ]
%10 = udiv i32 %9, 10
%11 = add nsw i32 %8, 1
%12 = icmp ult i32 %9, 100
br i1 %12, label %4, label %7
}
/* Variables and functions */
int /*<<< orphan*/ is_blank_char(char const);
int is_blank_str(const char *str) {
  while (*str != '\0') {
    if (!is_blank_char(*str)) {
      return 0;
    }
    str++;
  }
  return 1;
}


x86 assembly (clang, -O0):
<is_blank_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     115e <is_blank_str+0x4e>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <is_blank_char@plt>
cmp    $0x0,%eax
jne    114d <is_blank_str+0x3d>
movl   $0x0,-0x4(%rbp)
jmp    1165 <is_blank_str+0x55>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    111c <is_blank_str+0xc>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_blank_str>:
push   %rbp
push   %rbx
push   %rax
mov    (%rdi),%al
mov    $0x1,%ebp
test   %al,%al
je     114b <is_blank_str+0x3b>
mov    %rdi,%rbx
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
nop
movsbl %al,%edi
call   1030 <is_blank_char@plt>
test   %eax,%eax
je     1149 <is_blank_str+0x39>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <is_blank_str+0x20>
jmp    114b <is_blank_str+0x3b>
xor    %ebp,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @is_blank_str(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
br label %4
4: ; preds = %15, %1
%5 = load i8*, i8** %3
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %18
9: ; preds = %4
%10 = load i8*, i8** %3
%11 = load i8, i8* %10
%12 = call i32 @is_blank_char(i8 signext %11)
%13 = icmp ne i32 %12, 0
br i1 %13, label %15, label %14
14: ; preds = %9
store i32 0, i32* %2
br label %19
15: ; preds = %9
%16 = load i8*, i8** %3
%17 = getelementptr inbounds i8, i8* %16, i32 1
store i8* %17, i8** %3
br label %4
18: ; preds = %4
store i32 1, i32* %2
br label %19
19: ; preds = %18, %14
%20 = load i32, i32* %2
ret i32 %20
}

LLVM IR (-O2):
define i32 @is_blank_str(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %7
4: ; preds = %7
%5 = load i8, i8* %12
%6 = icmp eq i8 %5, 0
br i1 %6, label %13, label %7
7: ; preds = %1, %4
%8 = phi i8 [ %5, %4 ], [ %2, %1 ]
%9 = phi i8* [ %12, %4 ], [ %0, %1 ]
%10 = tail call i32 @is_blank_char(i8 signext %8)
%11 = icmp eq i32 %10, 0
%12 = getelementptr inbounds i8, i8* %9, i64 1
br i1 %11, label %13, label %4
13: ; preds = %7, %4, %1
%14 = phi i32 [ 1, %1 ], [ 1, %4 ], [ 0, %7 ]
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ csolve_assert(int /*<<< orphan*/);
int bar(int y) {
  csolve_assert(0);
  return 0;
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
xor    %edi,%edi
call   1030 <csolve_assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @bar(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @csolve_assert(i32 0)
ret i32 0
}

LLVM IR (-O2):
define i32 @bar(i32 %0) {
%2 = tail call i32 @csolve_assert(i32 0)
ret i32 0
}
char __ocl_convert_char_long(long src) { return (char)src; }


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

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

LLVM IR (-O0):
define signext i8 @__ocl_convert_char_long(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i8
ret i8 %4
}

LLVM IR (-O2):
define signext i8 @__ocl_convert_char_long(i64 %0) {
%2 = trunc i64 %0 to i8
ret i8 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("%d\n", 1000 + 2 + 1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
mov    $0x3eb,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 1003)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 1003)
ret i32 0
}
void modify_label(label) char *label;
{
  char *p;
  for (p = label; *p != '\0'; p++) {
    if (*p == '-' || *p == '=') {
      *p = '\0';
      break;
    }
  }
}


x86 assembly (clang, -O0):
<modify_label>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1162 <modify_label+0x62>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
je     1140 <modify_label+0x40>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x3d,%eax
jne    114c <modify_label+0x4c>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
jmp    1162 <modify_label+0x62>
jmp    1151 <modify_label+0x51>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <modify_label+0x10>
pop    %rbp
ret

x86 assembly (clang, -O2):
<modify_label>:
movzbl (%rdi),%eax
test   %al,%al
je     1118 <modify_label+0x18>
cmp    $0x3d,%al
je     1115 <modify_label+0x15>
cmp    $0x2d,%al
je     1115 <modify_label+0x15>
add    $0x1,%rdi
jmp    1100 <modify_label>
movb   $0x0,(%rdi)
ret

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

LLVM IR (-O2):
define void @modify_label(i8* nocapture %0) {
br label %2
2: ; preds = %6, %1
%3 = phi i8* [ %0, %1 ], [ %7, %6 ]
%4 = load i8, i8* %3
switch i8 %4, label %6 [
i8 0, label %8
i8 45, label %5
i8 61, label %5
]
5: ; preds = %2, %2
store i8 0, i8* %3
br label %8
6: ; preds = %2
%7 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
8: ; preds = %2, %5
ret void
}
void SDL_imageFilterAlignStack(void) {}


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

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

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

LLVM IR (-O2):
define void @SDL_imageFilterAlignStack() {
ret void
}
/* Variables and functions */
int device_getOutputDeviceCount();
int SSP_GetOutputDeviceCount() { return device_getOutputDeviceCount(); }


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

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

LLVM IR (-O0):
define i32 @SSP_GetOutputDeviceCount() {
%1 = call i32 (...) @device_getOutputDeviceCount()
ret i32 %1
}

LLVM IR (-O2):
define i32 @SSP_GetOutputDeviceCount() {
%1 = tail call i32 (...) @device_getOutputDeviceCount()
ret i32 %1
}
float ex_squared(float v) { return v * v; }


x86 assembly (clang, -O0):
<ex_squared>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
mulss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<ex_squared>:
mulss  %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @ex_squared(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = load float, float* %2
%5 = fmul float %3, %4
ret float %5
}

LLVM IR (-O2):
define float @ex_squared(float %0) {
%2 = fmul float %0, %0
ret float %2
}
int rcv_navail() {
  return (*(volatile unsigned long *)((void *)0xfffc4000 + 0x14) & 0x01) != 0;
}


x86 assembly (clang, -O0):
<rcv_navail>:
push   %rbp
mov    %rsp,%rbp
mov    $0xfffc4000,%eax
mov    0x14(%rax),%rax
and    $0x1,%rax
cmp    $0x0,%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rcv_navail>:
mov    $0xfffc4014,%eax
mov    (%rax),%rax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @rcv_navail() {
%1 = load volatile i64, i64* bitcast (i8* getelementptr (i8, i8* inttoptr (i64 4294721536 to i8*), i64 20) to i64*)
%2 = and i64 %1, 1
%3 = icmp ne i64 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}

LLVM IR (-O2):
define i32 @rcv_navail() {
%1 = load volatile i64, i64* inttoptr (i64 4294721556 to i64*)
%2 = trunc i64 %1 to i32
%3 = and i32 %2, 1
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ relocrecord(int /*<<< orphan*/, int, int /*<<< orphan*/);
void relocate_common(uint16_t addr, uint8_t *p) { relocrecord(addr, 2, *p); }


x86 assembly (clang, -O0):
<relocate_common>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%edx
mov    $0x2,%esi
call   1030 <relocrecord@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<relocate_common>:
mov    (%rsi),%edx
mov    $0x2,%esi
jmp    1030 <relocrecord@plt>

LLVM IR (-O0):
define void @relocate_common(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 = load i32, i32* %6
%8 = call i32 @relocrecord(i32 %5, i32 2, i32 %7)
ret void
}

LLVM IR (-O2):
define void @relocate_common(i32 %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = tail call i32 @relocrecord(i32 %0, i32 2, i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ empty_8042();
int /*<<< orphan*/ outb(int, int);
void enable_a20_kbc(void) {
  empty_8042();
  outb(0xd1, 0x64);
  empty_8042();
  outb(0xdf, 0x60);
  empty_8042();
}


x86 assembly (clang, -O0):
<enable_a20_kbc>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <empty_8042@plt>
mov    $0xd1,%edi
mov    $0x64,%esi
call   1030 <outb@plt>
mov    $0x0,%al
call   1040 <empty_8042@plt>
mov    $0xdf,%edi
mov    $0x60,%esi
call   1030 <outb@plt>
mov    $0x0,%al
call   1040 <empty_8042@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<enable_a20_kbc>:
push   %rax
xor    %eax,%eax
call   1040 <empty_8042@plt>
mov    $0xd1,%edi
mov    $0x64,%esi
call   1030 <outb@plt>
xor    %eax,%eax
call   1040 <empty_8042@plt>
mov    $0xdf,%edi
mov    $0x60,%esi
call   1030 <outb@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <empty_8042@plt>

LLVM IR (-O0):
define void @enable_a20_kbc() {
%1 = call i32 (...) @empty_8042()
%2 = call i32 @outb(i32 209, i32 100)
%3 = call i32 (...) @empty_8042()
%4 = call i32 @outb(i32 223, i32 96)
%5 = call i32 (...) @empty_8042()
ret void
}

LLVM IR (-O2):
define void @enable_a20_kbc() {
%1 = tail call i32 (...) @empty_8042()
%2 = tail call i32 @outb(i32 209, i32 100)
%3 = tail call i32 (...) @empty_8042()
%4 = tail call i32 @outb(i32 223, i32 96)
%5 = tail call i32 (...) @empty_8042()
ret void
}
/* Variables and functions */
int getchar();
int /*<<< orphan*/ putchar(int);
main() {
  register int c;
  while ((c = getchar()) != -1)
    putchar(c);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x8(%rbp)
cmp    $0xffffffff,%eax
je     114f <main+0x2f>
mov    -0x8(%rbp),%edi
call   1030 <putchar@plt>
jmp    112f <main+0xf>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    $0xffffffff,%eax
je     1145 <main+0x25>
mov    %eax,%edi
call   1030 <putchar@plt>
jmp    1130 <main+0x10>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
br label %3
3: ; preds = %6, %0
%4 = call i32 (...) @getchar()
store i32 %4, i32* %2
%5 = icmp ne i32 %4, -1
br i1 %5, label %6, label %9
6: ; preds = %3
%7 = load i32, i32* %2
%8 = call i32 @putchar(i32 %7)
br label %3
9: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @getchar()
%2 = icmp eq i32 %1, -1
br i1 %2, label %8, label %3
3: ; preds = %0, %3
%4 = phi i32 [ %6, %3 ], [ %1, %0 ]
%5 = tail call i32 @putchar(i32 %4)
%6 = tail call i32 (...) @getchar()
%7 = icmp eq i32 %6, -1
br i1 %7, label %8, label %3
8: ; preds = %3, %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ RESET_COUNTERS_RestoreConfig();
void RESET_COUNTERS_Wakeup(void) { RESET_COUNTERS_RestoreConfig(); }


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

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

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

LLVM IR (-O2):
define void @RESET_COUNTERS_Wakeup() {
%1 = tail call i32 (...) @RESET_COUNTERS_RestoreConfig()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int printrowend() { printf("</tr>\n"); }


x86 assembly (clang, -O0):
<printrowend>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [7 x i8] c"</tr>\0A\00"
define i32 @printrowend() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [6 x i8] c"</tr>\00"
define i32 @printrowend() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
int test_imm_1Aint64_midword_reg(long long val) {
  return ((val >> 16) & (0x1A << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_1Aint64_midword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
sar    $0x10,%rdx
and    $0x1a,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_1Aint64_midword_reg>:
test   $0x1a0000,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_1Aint64_midword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = ashr i64 %3, 16
%5 = and i64 %4, 26
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_1Aint64_midword_reg(i64 %0) {
%2 = and i64 %0, 1703936
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ strncat(char *, char *, int);
int main() {
  char string1[50] = "Hello, world! ";
  char string2[] = "Bye now!";
  strncat(string1, string2, 3);
  printf("%s\n", string1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x40(%rbp),%rdi
lea    0xeb6(%rip),%rsi
mov    $0x32,%edx
call   1050 <memcpy@plt>
mov    0xed7(%rip),%rax
mov    %rax,-0x49(%rbp)
mov    0xed5(%rip),%al
mov    %al,-0x41(%rbp)
lea    -0x40(%rbp),%rdi
lea    -0x49(%rbp),%rsi
mov    $0x3,%edx
call   1040 <strncat@plt>
lea    -0x40(%rbp),%rsi
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x50,%rsp
movaps 0xef4(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xed8(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xebc(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movw   $0x0,0x40(%rsp)
movabs $0x21776f6e20657942,%rax
6f 77 21
mov    %rax,(%rsp)
movb   $0x0,0x8(%rsp)
lea    0x10(%rsp),%rbx
mov    %rsp,%rsi
mov    %rbx,%rdi
mov    $0x3,%edx
call   1040 <strncat@plt>
lea    0xebc(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.string1 = [50 x i8] c"Hello, world! \00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@__const.main.string2 = [9 x i8] c"Bye now!\00"
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [50 x i8]
%3 = alloca [9 x i8]
store i32 0, i32* %1
%4 = bitcast [50 x i8]* %2 to i8*
%5 = bitcast [9 x i8]* %3 to i8*
%6 = getelementptr inbounds [50 x i8], [50 x i8]* %2, i64 0, i64 0
%7 = getelementptr inbounds [9 x i8], [9 x i8]* %3, i64 0, i64 0
%8 = call i32 @strncat(i8* %6, i8* %7, i32 3)
%9 = getelementptr inbounds [50 x i8], [50 x i8]* %2, i64 0, i64 0
%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):
@__const.main.string1 = [50 x i8] c"Hello, world! \00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@__const.main.string2 = [9 x i8] c"Bye now!\00"
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [50 x i8]
%2 = alloca [9 x i8]
%3 = getelementptr inbounds [50 x i8], [50 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [9 x i8], [9 x i8]* %2, i64 0, i64 0
%5 = call i32 @strncat(i8* %3, i8* %4, i32 3)
%6 = 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 */
bool nrf53_errata_20(void) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @nrf53_errata_20() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ GL_CULL_FACE;
int /*<<< orphan*/ GL_DEPTH_TEST;
int /*<<< orphan*/ GL_MODELVIEW;
int /*<<< orphan*/ glClearColor(double, double, double, double);
int /*<<< orphan*/ glEnable(int /*<<< orphan*/);
int /*<<< orphan*/ glMatrixMode(int /*<<< orphan*/);
int /*<<< orphan*/ init_light();
int /*<<< orphan*/ init_material();
void init() {
  glClearColor(0.0, 0.0, 0.0, 0.0);
  glEnable(GL_DEPTH_TEST);
  glEnable(GL_CULL_FACE);
  glMatrixMode(GL_MODELVIEW);
  init_light();
  init_material();
}


x86 assembly (clang, -O0):
<init>:
push   %rbp
mov    %rsp,%rbp
xorps  %xmm3,%xmm3
movaps %xmm3,%xmm0
movaps %xmm3,%xmm1
movaps %xmm3,%xmm2
call   1060 <glClearColor@plt>
mov    0x2e64(%rip),%rax
mov    (%rax),%edi
call   1050 <glEnable@plt>
mov    0x2e5e(%rip),%rax
mov    (%rax),%edi
call   1050 <glEnable@plt>
mov    0x2e60(%rip),%rax
mov    (%rax),%edi
call   1040 <glMatrixMode@plt>
mov    $0x0,%al
call   1030 <init_light@plt>
mov    $0x0,%al
call   1070 <init_material@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init>:
push   %rax
xorps  %xmm0,%xmm0
xorps  %xmm1,%xmm1
xorps  %xmm2,%xmm2
xorps  %xmm3,%xmm3
call   1060 <glClearColor@plt>
mov    0x2e67(%rip),%rax
mov    (%rax),%edi
call   1050 <glEnable@plt>
mov    0x2e61(%rip),%rax
mov    (%rax),%edi
call   1050 <glEnable@plt>
mov    0x2e63(%rip),%rax
mov    (%rax),%edi
call   1040 <glMatrixMode@plt>
xor    %eax,%eax
call   1030 <init_light@plt>
xor    %eax,%eax
pop    %rcx
jmp    1070 <init_material@plt>

LLVM IR (-O0):
@GL_DEPTH_TEST = global i32 0
@GL_CULL_FACE = global i32 0
@GL_MODELVIEW = global i32 0
define void @init() {
%1 = call i32 @glClearColor(double 0.000000e+00, double 0.000000e+00, double 0.000000e+00, double 0.000000e+00)
%2 = load i32, i32* @GL_DEPTH_TEST
%3 = call i32 @glEnable(i32 %2)
%4 = load i32, i32* @GL_CULL_FACE
%5 = call i32 @glEnable(i32 %4)
%6 = load i32, i32* @GL_MODELVIEW
%7 = call i32 @glMatrixMode(i32 %6)
%8 = call i32 (...) @init_light()
%9 = call i32 (...) @init_material()
ret void
}

LLVM IR (-O2):
@GL_DEPTH_TEST = global i32 0
@GL_CULL_FACE = global i32 0
@GL_MODELVIEW = global i32 0
define void @init() {
%1 = tail call i32 @glClearColor(double 0.000000e+00, double 0.000000e+00, double 0.000000e+00, double 0.000000e+00)
%2 = load i32, i32* @GL_DEPTH_TEST
%3 = tail call i32 @glEnable(i32 %2)
%4 = load i32, i32* @GL_CULL_FACE
%5 = tail call i32 @glEnable(i32 %4)
%6 = load i32, i32* @GL_MODELVIEW
%7 = tail call i32 @glMatrixMode(i32 %6)
%8 = tail call i32 (...) @init_light()
%9 = tail call i32 (...) @init_material()
ret void
}
const char *hex_to_base64(const char *input) {
  const char *output = "hex_to_base64\n";
  return output;
}


x86 assembly (clang, -O0):
<hex_to_base64>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
lea    0xef1(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hex_to_base64>:
lea    0xef9(%rip),%rax
ret

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

LLVM IR (-O2):
@.str = [15 x i8] c"hex_to_base64\0A\00"
define i8* @hex_to_base64(i8* nocapture readnone %0) {
ret i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0)
}
float ffi_test_4(void) { return 1.5; }


x86 assembly (clang, -O0):
<ffi_test_4>:
push   %rbp
mov    %rsp,%rbp
movss  0xef4(%rip),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<ffi_test_4>:
movss  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define float @ffi_test_4() {
ret float 1.500000e+00
}

LLVM IR (-O2):
define float @ffi_test_4() {
ret float 1.500000e+00
}
/* Variables and functions */
int /*<<< orphan*/ console_tx_char(unsigned char);
void print_info_char(unsigned char byte) { console_tx_char(byte); }


x86 assembly (clang, -O0):
<print_info_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edi
call   1030 <console_tx_char@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_info_char>:
jmp    1030 <console_tx_char@plt>

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

LLVM IR (-O2):
define void @print_info_char(i8 zeroext %0) {
%2 = tail call i32 @console_tx_char(i8 zeroext %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void ModelSpeak(void) { printf("Model is speaking.\n"); }


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

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

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

LLVM IR (-O2):
@str = [19 x i8] c"Model is speaking.\00"
define void @ModelSpeak() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
ret void
}
unsigned xrop3_71_0_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  stk3 = D ^ T;
  stk2 = S & stk3;
  stk1 = T ^ stk2;
  stk1 = ~stk1;
  return stk1;
}


x86 assembly (clang, -O0):
<xrop3_71_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
xor    -0x10(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0xc(%rbp),%eax
and    -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
xor    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_71_0_0>:
mov    %edi,%ecx
shl    $0x8,%ecx
or     %edi,%ecx
mov    %esi,%edx
shl    $0x8,%edx
or     %esi,%edx
mov    %edx,%eax
xor    $0xff,%eax
and    %ecx,%eax
xor    %edx,%eax
not    %eax
ret

LLVM IR (-O0):
define i32 @xrop3_71_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%11 = load i8, i8* %3
%12 = zext i8 %11 to i32
%13 = shl i32 %12, 8
%14 = load i8, i8* %3
%15 = zext i8 %14 to i32
%16 = or i32 %13, %15
store i32 %16, i32* %6
%17 = load i8, i8* %4
%18 = zext i8 %17 to i32
%19 = shl i32 %18, 8
%20 = load i8, i8* %4
%21 = zext i8 %20 to i32
%22 = or i32 %19, %21
store i32 %22, i32* %7
%23 = load i32, i32* %5
%24 = load i32, i32* %7
%25 = xor i32 %23, %24
store i32 %25, i32* %10
%26 = load i32, i32* %6
%27 = load i32, i32* %10
%28 = and i32 %26, %27
store i32 %28, i32* %9
%29 = load i32, i32* %7
%30 = load i32, i32* %9
%31 = xor i32 %29, %30
store i32 %31, i32* %8
%32 = load i32, i32* %8
%33 = xor i32 %32, -1
store i32 %33, i32* %8
%34 = load i32, i32* %8
ret i32 %34
}

LLVM IR (-O2):
define i32 @xrop3_71_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = mul nuw nsw i32 %5, 257
%7 = xor i32 %6, 255
%8 = and i32 %7, %4
%9 = xor i32 %6, %8
%10 = xor i32 %9, -1
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ fnMaxHeapify(int *, int, int);
void fnBuildMaxHeap(int a[], int n) {
  int i;
  for (i = n / 2; i >= 1; i--)
    fnMaxHeapify(a, i, n);
}


x86 assembly (clang, -O0):
<fnBuildMaxHeap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x10(%rbp)
cmpl   $0x1,-0x10(%rbp)
jl     1154 <fnBuildMaxHeap+0x44>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1030 <fnMaxHeapify@plt>
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
jmp    112d <fnBuildMaxHeap+0x1d>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fnBuildMaxHeap>:
push   %rbp
push   %r14
push   %rbx
cmp    $0x2,%esi
jl     1146 <fnBuildMaxHeap+0x36>
mov    %esi,%ebp
mov    %rdi,%r14
mov    %esi,%ebx
shr    %ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r14,%rdi
mov    %ebx,%esi
mov    %ebp,%edx
call   1030 <fnMaxHeapify@plt>
lea    -0x1(%rbx),%eax
cmp    $0x1,%ebx
mov    %eax,%ebx
ja     1130 <fnBuildMaxHeap+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @fnBuildMaxHeap(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* %4
%7 = sdiv i32 %6, 2
store i32 %7, i32* %5
br label %8
8: ; preds = %16, %2
%9 = load i32, i32* %5
%10 = icmp sge i32 %9, 1
br i1 %10, label %11, label %19
11: ; preds = %8
%12 = load i32*, i32** %3
%13 = load i32, i32* %5
%14 = load i32, i32* %4
%15 = call i32 @fnMaxHeapify(i32* %12, i32 %13, i32 %14)
br label %16
16: ; preds = %11
%17 = load i32, i32* %5
%18 = add nsw i32 %17, -1
store i32 %18, i32* %5
br label %8
19: ; preds = %8
ret void
}

LLVM IR (-O2):
define void @fnBuildMaxHeap(i32* %0, i32 %1) {
%3 = icmp sgt i32 %1, 1
br i1 %3, label %4, label %11
4: ; preds = %2
%5 = lshr i32 %1, 1
br label %6
6: ; preds = %4, %6
%7 = phi i32 [ %9, %6 ], [ %5, %4 ]
%8 = tail call i32 @fnMaxHeapify(i32* %0, i32 %7, i32 %1)
%9 = add nsw i32 %7, -1
%10 = icmp ugt i32 %7, 1
br i1 %10, label %6, label %11
11: ; preds = %6, %2
ret void
}
/* Variables and functions */
scalar_t__ random_rand();
double random_unit_uniform(void) {
  return ((((double)random_rand()) / (double)(unsigned int)0xFFFFFFFF));
}


x86 assembly (clang, -O0):
<random_unit_uniform>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <random_rand@plt>
cvtsi2sd %rax,%xmm0
movsd  0xed8(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<random_unit_uniform>:
push   %rax
xor    %eax,%eax
call   1030 <random_rand@plt>
cvtsi2sd %rax,%xmm0
divsd  0xedb(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @random_unit_uniform() {
%1 = call i64 (...) @random_rand()
%2 = sitofp i64 %1 to double
%3 = fdiv double %2, 0x41EFFFFFFFE00000
ret double %3
}

LLVM IR (-O2):
define double @random_unit_uniform() {
%1 = tail call i64 (...) @random_rand()
%2 = sitofp i64 %1 to double
%3 = fdiv double %2, 0x41EFFFFFFFE00000
ret double %3
}
double jac_chain_nm3_sign(double x) { return x < 0 ? -1 : x > 0 ? 1 : x; }


x86 assembly (clang, -O0):
<jac_chain_nm3_sign>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    1129 <jac_chain_nm3_sign+0x29>
movsd  0xee9(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    1161 <jac_chain_nm3_sign+0x61>
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    114d <jac_chain_nm3_sign+0x4d>
movsd  0xebd(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    1157 <jac_chain_nm3_sign+0x57>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<jac_chain_nm3_sign>:
xorpd  %xmm1,%xmm1
xorpd  %xmm2,%xmm2
cmpltsd %xmm0,%xmm2
movsd  0xeeb(%rip),%xmm3
andpd  %xmm2,%xmm3
andnpd %xmm0,%xmm2
orpd   %xmm3,%xmm2
cmpltsd %xmm1,%xmm0
movapd %xmm0,%xmm1
andnpd %xmm2,%xmm1
movsd  0xed2(%rip),%xmm2
andpd  %xmm2,%xmm0
orpd   %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @jac_chain_nm3_sign(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp olt double %3, 0.000000e+00
br i1 %4, label %5, label %6
5: ; preds = %1
br label %14
6: ; preds = %1
%7 = load double, double* %2
%8 = fcmp ogt double %7, 0.000000e+00
br i1 %8, label %9, label %10
9: ; preds = %6
br label %12
10: ; preds = %6
%11 = load double, double* %2
br label %12
12: ; preds = %10, %9
%13 = phi double [ 1.000000e+00, %9 ], [ %11, %10 ]
br label %14
14: ; preds = %12, %5
%15 = phi double [ -1.000000e+00, %5 ], [ %13, %12 ]
ret double %15
}

LLVM IR (-O2):
define double @jac_chain_nm3_sign(double %0) {
%2 = fcmp olt double %0, 0.000000e+00
%3 = fcmp ogt double %0, 0.000000e+00
%4 = select i1 %3, double 1.000000e+00, double %0
%5 = select i1 %2, double -1.000000e+00, double %4
ret double %5
}
/* Variables and functions */
float abs(float x) {
  if (x < 0)
    return (x - x) - (x);
  else
    return x;
}


x86 assembly (clang, -O0):
<abs>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    112f <abs+0x2f>
movss  -0x8(%rbp),%xmm0
subss  -0x8(%rbp),%xmm0
subss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1139 <abs+0x39>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<abs>:
movaps %xmm0,%xmm2
subss  %xmm0,%xmm2
subss  %xmm0,%xmm2
xorps  %xmm3,%xmm3
movaps %xmm0,%xmm1
cmpltss %xmm3,%xmm1
andps  %xmm1,%xmm2
andnps %xmm0,%xmm1
orps   %xmm2,%xmm1
movaps %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @abs(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %3
%4 = load float, float* %3
%5 = fcmp olt float %4, 0.000000e+00
br i1 %5, label %6, label %12
6: ; preds = %1
%7 = load float, float* %3
%8 = load float, float* %3
%9 = fsub float %7, %8
%10 = load float, float* %3
%11 = fsub float %9, %10
store float %11, float* %2
br label %14
12: ; preds = %1
%13 = load float, float* %3
store float %13, float* %2
br label %14
14: ; preds = %12, %6
%15 = load float, float* %2
ret float %15
}

LLVM IR (-O2):
define float @abs(float %0) {
%2 = fcmp olt float %0, 0.000000e+00
%3 = fsub float %0, %0
%4 = fsub float %3, %0
%5 = select i1 %2, float %4, float %0
ret float %5
}
void g_mem_chunk_new() {}


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

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

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

LLVM IR (-O2):
define void @g_mem_chunk_new() {
ret void
}
_Noreturn void exit(int code) {
  __wasm_call_dtors();
  _Exit(code);
}


x86 assembly (clang, -O0):
<exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__wasm_call_dtors@plt>
mov    -0x4(%rbp),%edi
call   1040 <_Exit@plt>

x86 assembly (clang, -O2):
<exit>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <__wasm_call_dtors@plt>
mov    %ebx,%edi
call   1040 <_Exit@plt>

LLVM IR (-O0):
define void @exit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @__wasm_call_dtors()
%4 = load i32, i32* %2
unreachable
}

LLVM IR (-O2):
define void @exit(i32 %0) {
%2 = tail call i32 (...) @__wasm_call_dtors()
tail call void @_Exit(i32 %0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ islower(int);
void t_islower_0xe7() {
  Assert_real((islower(231) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_islower.c",
              1160, ("islower should be 0 for 0xe7"));
}


x86 assembly (clang, -O0):
<t_islower_0xe7>:
push   %rbp
mov    %rsp,%rbp
mov    $0xe7,%edi
call   1030 <islower@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x488,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_islower_0xe7>:
push   %rax
mov    $0xe7,%edi
call   1030 <islower@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x488,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_islower.c\00"
@.str.1 = [29 x i8] c"islower should be 0 for 0xe7\00"
define void @t_islower_0xe7() {
%1 = call i64 @islower(i32 231)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1160, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_islower.c\00"
@.str.1 = [29 x i8] c"islower should be 0 for 0xe7\00"
define void @t_islower_0xe7() {
%1 = tail call i64 @islower(i32 231)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1160, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ testAssignment();
int /*<<< orphan*/ testEval();
int /*<<< orphan*/ testOpEval();
int main() {
  testAssignment();
  testEval();
  testOpEval();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @testAssignment()
%2 = tail call i32 (...) @testEval()
%3 = tail call i32 (...) @testOpEval()
ret i32 0
}
/* Type definitions */
struct iovec {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int writev(int, struct iovec const *, int);
void vwrite(int fd, const struct iovec *iov, int cnt) {
  int ret = 0;
  ret = writev(fd, iov, cnt);
  if (ret <= 0)
    printf("write nond %d\n", ret);
}


x86 assembly (clang, -O0):
<vwrite>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <writev@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jg     1164 <vwrite+0x44>
mov    -0x18(%rbp),%esi
lea    0xea1(%rip),%rdi
call   1040 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vwrite>:
push   %rax
call   1030 <writev@plt>
test   %eax,%eax
jle    112c <vwrite+0xc>
pop    %rax
ret
lea    0xecd(%rip),%rdi
mov    %eax,%esi
pop    %rax
jmp    1040 <printf@plt>

LLVM IR (-O0):
%struct.iovec = type { i32 }
@.str = [15 x i8] c"write nond %d\0A\00"
define void @vwrite(i32 %0, %struct.iovec* %1, i32 %2) {
%4 = alloca i32
%5 = alloca %struct.iovec*
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store %struct.iovec* %1, %struct.iovec** %5
store i32 %2, i32* %6
store i32 0, i32* %7
%8 = load i32, i32* %4
%9 = load %struct.iovec*, %struct.iovec** %5
%10 = load i32, i32* %6
%11 = call i32 @writev(i32 %8, %struct.iovec* %9, i32 %10)
store i32 %11, i32* %7
%12 = load i32, i32* %7
%13 = icmp sle i32 %12, 0
br i1 %13, label %14, label %17
14: ; preds = %3
%15 = load i32, i32* %7
%16 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %15)
br label %17
17: ; preds = %14, %3
ret void
}

LLVM IR (-O2):
%struct.iovec = type { i32 }
@.str = [15 x i8] c"write nond %d\0A\00"
define void @vwrite(i32 %0, %struct.iovec* %1, i32 %2) {
%4 = tail call i32 @writev(i32 %0, %struct.iovec* %1, i32 %2)
%5 = icmp slt i32 %4, 1
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %4)
br label %8
8: ; preds = %6, %3
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;
typedef int /*<<< orphan*/ buf;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *, char *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ vsnprintf(char *, int, char const *, int /*<<< orphan*/);
void write_out(const char *prefix, const char *msg, va_list params) {
  char buf[1024];
  vsnprintf(buf, sizeof(buf), msg, params);
  fprintf(stderr, "%s%s\n", prefix, buf);
}


x86 assembly (clang, -O0):
<write_out>:
push   %rbp
mov    %rsp,%rbp
sub    $0x420,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
lea    -0x420(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    $0x400,%esi
call   1030 <vsnprintf@plt>
mov    0x2e8b(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    -0x420(%rbp),%rcx
lea    0xe97(%rip),%rsi
call   1040 <fprintf@plt>
add    $0x420,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_out>:
push   %r14
push   %rbx
sub    $0x408,%rsp
mov    %edx,%ecx
mov    %rsi,%rdx
mov    %rdi,%rbx
mov    %rsp,%r14
mov    %r14,%rdi
mov    $0x400,%esi
call   1030 <vsnprintf@plt>
mov    0x2e97(%rip),%rax
mov    (%rax),%edi
lea    0xeae(%rip),%rsi
mov    %rbx,%rdx
mov    %r14,%rcx
call   1040 <fprintf@plt>
add    $0x408,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [6 x i8] c"%s%s\0A\00"
define void @write_out(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca [1024 x i8]
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = getelementptr inbounds [1024 x i8], [1024 x i8]* %7, i64 0, i64 0
%9 = load i8*, i8** %5
%10 = load i32, i32* %6
%11 = call i32 @vsnprintf(i8* %8, i32 1024, i8* %9, i32 %10)
%12 = load i32, i32* @stderr
%13 = load i8*, i8** %4
%14 = getelementptr inbounds [1024 x i8], [1024 x i8]* %7, i64 0, i64 0
%15 = call i32 @fprintf(i32 %12, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %13, i8* %14)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [6 x i8] c"%s%s\0A\00"
define void @write_out(i8* %0, i8* nocapture %1, i32 %2) {
%4 = alloca [1024 x i8]
%5 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 0
%6 = call i32 @vsnprintf(i8* %5, i32 1024, i8* %1, i32 %2)
%7 = load i32, i32* @stderr
%8 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %5)
ret void
}