xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ nio_vram_pixel_puts(int const, int const, char const *,
                                       unsigned char const,
                                       unsigned char const);
void nio_vram_grid_puts(const int offset_x, const int offset_y, const int x,
                        const int y, const char *str,
                        const unsigned char bgColor,
                        const unsigned char textColor) {
  nio_vram_pixel_puts(offset_x + x * 6, offset_y + y * 8, str, bgColor,
                      textColor);
}


x86 assembly (clang, -O0):
<nio_vram_grid_puts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %r9b,%al
mov    0x10(%rbp),%r9b
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %al,-0x19(%rbp)
mov    -0x4(%rbp),%edi
imul   $0x6,-0xc(%rbp),%eax
add    %eax,%edi
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%eax
shl    $0x3,%eax
add    %eax,%esi
mov    -0x18(%rbp),%rdx
mov    -0x19(%rbp),%al
movzbl %al,%ecx
movzbl 0x10(%rbp),%r8d
call   1030 <nio_vram_pixel_puts@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nio_vram_grid_puts>:
mov    %r8,%rax
movzbl 0x8(%rsp),%r8d
lea    (%rdx,%rdx,2),%edx
lea    (%rdi,%rdx,2),%edi
lea    (%rsi,%rcx,8),%esi
mov    %rax,%rdx
mov    %r9d,%ecx
jmp    1030 <nio_vram_pixel_puts@plt>

LLVM IR (-O0):
define void @nio_vram_grid_puts(i32 %0, i32 %1, i32 %2, i32 %3, i8* %4, i8 zeroext %5, i8 zeroext %6) {
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i8*
%13 = alloca i8
%14 = alloca i8
store i32 %0, i32* %8
store i32 %1, i32* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i8* %4, i8** %12
store i8 %5, i8* %13
store i8 %6, i8* %14
%15 = load i32, i32* %8
%16 = load i32, i32* %10
%17 = mul nsw i32 %16, 6
%18 = add nsw i32 %15, %17
%19 = load i32, i32* %9
%20 = load i32, i32* %11
%21 = mul nsw i32 %20, 8
%22 = add nsw i32 %19, %21
%23 = load i8*, i8** %12
%24 = load i8, i8* %13
%25 = load i8, i8* %14
%26 = call i32 @nio_vram_pixel_puts(i32 %18, i32 %22, i8* %23, i8 zeroext %24, i8 zeroext %25)
ret void
}

LLVM IR (-O2):
define void @nio_vram_grid_puts(i32 %0, i32 %1, i32 %2, i32 %3, i8* %4, i8 zeroext %5, i8 zeroext %6) {
%8 = mul nsw i32 %2, 6
%9 = add nsw i32 %8, %0
%10 = shl nsw i32 %3, 3
%11 = add nsw i32 %10, %1
%12 = tail call i32 @nio_vram_pixel_puts(i32 %9, i32 %11, i8* %4, i8 zeroext %5, i8 zeroext %6)
ret void
}
/* Variables and functions */
unsigned int ft_strlen(char *);
int ft_argvlen(int argc, char **argv) {
  int i;
  unsigned int s;
  i = 1;
  s = 0;
  while (i < argc) {
    s = s + ft_strlen(argv[i]);
    i++;
  }
  return (s);
}


x86 assembly (clang, -O0):
<ft_argvlen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1168 <ft_argvlen+0x58>
mov    -0x18(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <ft_strlen@plt>
mov    %eax,%ecx
mov    -0x1c(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112d <ft_argvlen+0x1d>
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_argvlen>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
xor    %ebp,%ebp
cmp    $0x2,%edi
jl     1144 <ft_argvlen+0x34>
mov    %rsi,%r14
mov    %edi,%r15d
xor    %ebp,%ebp
mov    $0x1,%ebx
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdi
call   1030 <ft_strlen@plt>
add    %eax,%ebp
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <ft_argvlen+0x20>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @ft_argvlen(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %15
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 1, %4 ], [ %13, %6 ]
%8 = phi i32 [ 0, %4 ], [ %12, %6 ]
%9 = getelementptr inbounds i8*, i8** %1, i64 %7
%10 = load i8*, i8** %9
%11 = tail call i32 @ft_strlen(i8* %10)
%12 = add i32 %11, %8
%13 = add nuw nsw i64 %7, 1
%14 = icmp eq i64 %13, %5
br i1 %14, label %15, label %6
15: ; preds = %6, %2
%16 = phi i32 [ 0, %2 ], [ %12, %6 ]
ret i32 %16
}
int isInf(double d, int sign) {
  union {
    double d;
    long x[2];
  } a;
  a.d = d;
  if (a.x[0] != 0)
    return 0;
  if (a.x[1] == (2047 << 20))
    return sign >= 0;
  if (a.x[1] == ((2047 << 20) | (1 << 31)))
    return sign <= 0;
  return 0;
}


x86 assembly (clang, -O0):
<isInf>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
mov    %edi,-0x14(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
je     112d <isInf+0x2d>
movl   $0x0,-0x4(%rbp)
jmp    1178 <isInf+0x78>
cmpq   $0x7ff00000,-0x20(%rbp)
7f
jne    114f <isInf+0x4f>
cmpl   $0x0,-0x14(%rbp)
setge  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
jmp    1178 <isInf+0x78>
cmpq   $0xfffffffffff00000,-0x20(%rbp)
ff
jne    1171 <isInf+0x71>
cmpl   $0x0,-0x14(%rbp)
setle  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
jmp    1178 <isInf+0x78>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%union.anon = type { [2 x i64] }
define i32 @isInf(double %0, i32 %1) {
%3 = alloca i32
%4 = alloca double
%5 = alloca i32
%6 = alloca %union.anon
store double %0, double* %4
store i32 %1, i32* %5
%7 = load double, double* %4
%8 = bitcast %union.anon* %6 to double*
store double %7, double* %8
%9 = bitcast %union.anon* %6 to [2 x i64]*
%10 = getelementptr inbounds [2 x i64], [2 x i64]* %9, i64 0, i64 0
%11 = load i64, i64* %10
%12 = icmp ne i64 %11, 0
br i1 %12, label %13, label %14
13: ; preds = %2
store i32 0, i32* %3
br label %33
14: ; preds = %2
%15 = bitcast %union.anon* %6 to [2 x i64]*
%16 = getelementptr inbounds [2 x i64], [2 x i64]* %15, i64 0, i64 1
%17 = load i64, i64* %16
%18 = icmp eq i64 %17, 2146435072
br i1 %18, label %19, label %23
19: ; preds = %14
%20 = load i32, i32* %5
%21 = icmp sge i32 %20, 0
%22 = zext i1 %21 to i32
store i32 %22, i32* %3
br label %33
23: ; preds = %14
%24 = bitcast %union.anon* %6 to [2 x i64]*
%25 = getelementptr inbounds [2 x i64], [2 x i64]* %24, i64 0, i64 1
%26 = load i64, i64* %25
%27 = icmp eq i64 %26, -1048576
br i1 %27, label %28, label %32
28: ; preds = %23
%29 = load i32, i32* %5
%30 = icmp sle i32 %29, 0
%31 = zext i1 %30 to i32
store i32 %31, i32* %3
br label %33
32: ; preds = %23
store i32 0, i32* %3
br label %33
33: ; preds = %32, %28, %19, %13
%34 = load i32, i32* %3
ret i32 %34
}

LLVM IR (-O2):
define i32 @isInf(double %0, i32 %1) {
ret i32 0
}
int igsy_csr_busy_signal_set(unsigned int dev_id,
                             union igsy_csr_busy_signal_u *value) {
  return 1;
}


x86 assembly (clang, -O0):
<igsy_csr_busy_signal_set>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x1,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%union.igsy_csr_busy_signal_u = type opaque
define i32 @igsy_csr_busy_signal_set(i32 %0, %union.igsy_csr_busy_signal_u* %1) {
%3 = alloca i32
%4 = alloca %union.igsy_csr_busy_signal_u*
store i32 %0, i32* %3
store %union.igsy_csr_busy_signal_u* %1, %union.igsy_csr_busy_signal_u** %4
ret i32 1
}

LLVM IR (-O2):
%union.igsy_csr_busy_signal_u = type opaque
define i32 @igsy_csr_busy_signal_set(i32 %0, %union.igsy_csr_busy_signal_u* nocapture readnone %1) {
ret i32 1
}
int numBuckets(int numElements) { return 26 * 26 * 26; }


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

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

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

LLVM IR (-O2):
define i32 @numBuckets(i32 %0) {
ret i32 17576
}
/* Variables and functions */
size_t strlen(char const *);
int /*<<< orphan*/ terminal_putchar(char const);
void terminal_writestring(const char *data) {
  size_t datalen = strlen(data);
  for (size_t i = 0; i < datalen; i++) {
    terminal_putchar(data[i]);
  }
}


x86 assembly (clang, -O0):
<terminal_writestring>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1171 <terminal_writestring+0x51>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1040 <terminal_putchar@plt>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1141 <terminal_writestring+0x21>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<terminal_writestring>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
call   1030 <strlen@plt>
test   %rax,%rax
je     1153 <terminal_writestring+0x33>
mov    %rax,%r15
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
movsbl (%r14,%rbx,1),%edi
call   1040 <terminal_putchar@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1140 <terminal_writestring+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @terminal_writestring(i8* nocapture %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %5, %1
ret void
5: ; preds = %1, %5
%6 = phi i64 [ %10, %5 ], [ 0, %1 ]
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = load i8, i8* %7
%9 = tail call i32 @terminal_putchar(i8 signext %8)
%10 = add nuw i64 %6, 1
%11 = icmp eq i64 %10, %2
br i1 %11, label %4, label %5
}
/* Variables and functions */
int /*<<< orphan*/ atoi(char *);
int /*<<< orphan*/ operand(char *);
int operation(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  printf("%d\n", operation(atoi(argv[1]), operand(argv[2]), atoi(argv[3])));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1050 <atoi@plt>
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1060 <operand@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
call   1050 <atoi@plt>
mov    -0x18(%rbp),%edi
mov    -0x14(%rbp),%esi
mov    %eax,%edx
call   1040 <operation@plt>
mov    %eax,%esi
lea    0xe67(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    0x8(%rsi),%rdi
call   1050 <atoi@plt>
mov    %eax,%r14d
mov    0x10(%rbx),%rdi
call   1060 <operand@plt>
mov    %eax,%ebp
mov    0x18(%rbx),%rdi
call   1050 <atoi@plt>
mov    %r14d,%edi
mov    %ebp,%esi
mov    %eax,%edx
call   1040 <operation@plt>
lea    0xe86(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i8**, i8*** %5
%7 = getelementptr inbounds i8*, i8** %6, i64 1
%8 = load i8*, i8** %7
%9 = call i32 @atoi(i8* %8)
%10 = load i8**, i8*** %5
%11 = getelementptr inbounds i8*, i8** %10, i64 2
%12 = load i8*, i8** %11
%13 = call i32 @operand(i8* %12)
%14 = load i8**, i8*** %5
%15 = getelementptr inbounds i8*, i8** %14, i64 3
%16 = load i8*, i8** %15
%17 = call i32 @atoi(i8* %16)
%18 = call i32 @operation(i32 %9, i32 %13, i32 %17)
%19 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %18)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 @atoi(i8* %4)
%6 = getelementptr inbounds i8*, i8** %1, i64 2
%7 = load i8*, i8** %6
%8 = tail call i32 @operand(i8* %7)
%9 = getelementptr inbounds i8*, i8** %1, i64 3
%10 = load i8*, i8** %9
%11 = tail call i32 @atoi(i8* %10)
%12 = tail call i32 @operation(i32 %5, i32 %8, i32 %11)
%13 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %12)
ret i32 0
}
int main() {
  int c = 0;
  if (c == 1) {
  } else {
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    1121 <main+0x21>
jmp    1126 <main+0x26>
jmp    1126 <main+0x26>
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Type definitions */
struct tcb {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ CDE_end_fchdir(struct tcb *);
void CDE_end_chdir(struct tcb *tcp) { CDE_end_fchdir(tcp); }


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

x86 assembly (clang, -O2):
<CDE_end_chdir>:
jmp    1030 <CDE_end_fchdir@plt>

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

LLVM IR (-O2):
%struct.tcb = type { i32 }
define void @CDE_end_chdir(%struct.tcb* %0) {
%2 = tail call i32 @CDE_end_fchdir(%struct.tcb* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ SEEK_END;
int /*<<< orphan*/ SEEK_SET;
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *const, int /*<<< orphan*/,
                         int /*<<< orphan*/);
size_t ftell(int /*<<< orphan*/ *const);
size_t get_filesize(FILE *const __restrict fp) {
  fseek(fp, 0, SEEK_END);
  const size_t size = ftell(fp);
  fseek(fp, 0, SEEK_SET);
  return size;
}


x86 assembly (clang, -O0):
<get_filesize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2eb1(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1040 <fseek@plt>
mov    -0x8(%rbp),%rdi
call   1030 <ftell@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2e80(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1040 <fseek@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_filesize>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2eba(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1040 <fseek@plt>
mov    %rbx,%rdi
call   1030 <ftell@plt>
mov    %rax,%r14
mov    0x2e8f(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   1040 <fseek@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@SEEK_END = global i32 0
@SEEK_SET = global i32 0
define i64 @get_filesize(i32* noalias %0) {
%2 = alloca i32*
%3 = alloca i64
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = load i32, i32* @SEEK_END
%6 = call i32 @fseek(i32* %4, i32 0, i32 %5)
%7 = load i32*, i32** %2
%8 = call i64 @ftell(i32* %7)
store i64 %8, i64* %3
%9 = load i32*, i32** %2
%10 = load i32, i32* @SEEK_SET
%11 = call i32 @fseek(i32* %9, i32 0, i32 %10)
%12 = load i64, i64* %3
ret i64 %12
}

LLVM IR (-O2):
@SEEK_END = global i32 0
@SEEK_SET = global i32 0
define i64 @get_filesize(i32* noalias nocapture %0) {
%2 = load i32, i32* @SEEK_END
%3 = tail call i32 @fseek(i32* %0, i32 0, i32 %2)
%4 = tail call i64 @ftell(i32* %0)
%5 = load i32, i32* @SEEK_SET
%6 = tail call i32 @fseek(i32* %0, i32 0, i32 %5)
ret i64 %4
}
void VDP_setHorizontalScroll(unsigned short plan, short value) {
  volatile unsigned short *pw;
  volatile unsigned long *pl;
  unsigned short addr;
  pw = (unsigned short *)0xC00000;
  pl = (unsigned long *)0xC00004;
  addr = 0xB800;
  if (plan == 0xC000)
    addr += 2;
  *pl = ((0x4000 + ((addr)&0x3FFF)) << 16) + (((addr) >> 14) | 0x00);
  *pw = value;
}


x86 assembly (clang, -O0):
<VDP_setHorizontalScroll>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
mov    $0xc00000,%eax
mov    %rax,-0x10(%rbp)
mov    $0xc00004,%eax
mov    %rax,-0x18(%rbp)
movw   $0xb800,-0x1a(%rbp)
movzwl -0x2(%rbp),%eax
cmp    $0xc000,%eax
jne    1144 <VDP_setHorizontalScroll+0x44>
movzwl -0x1a(%rbp),%eax
add    $0x2,%eax
mov    %ax,-0x1a(%rbp)
movzwl -0x1a(%rbp),%eax
and    $0x3fff,%eax
add    $0x4000,%eax
shl    $0x10,%eax
movzwl -0x1a(%rbp),%ecx
sar    $0xe,%ecx
or     $0x0,%ecx
add    %ecx,%eax
movslq %eax,%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x4(%rbp),%cx
mov    -0x10(%rbp),%rax
mov    %cx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<VDP_setHorizontalScroll>:
xor    %eax,%eax
cmp    $0xc000,%edi
sete   %al
shl    $0x11,%rax
or     $0x78000002,%rax
mov    %rax,0xc00004
mov    %si,0xc00000
ret

LLVM IR (-O0):
define void @VDP_setHorizontalScroll(i16 zeroext %0, i16 signext %1) {
%3 = alloca i16
%4 = alloca i16
%5 = alloca i16*
%6 = alloca i64*
%7 = alloca i16
store i16 %0, i16* %3
store i16 %1, i16* %4
store i16* inttoptr (i64 12582912 to i16*), i16** %5
store i64* inttoptr (i64 12582916 to i64*), i64** %6
store i16 -18432, i16* %7
%8 = load i16, i16* %3
%9 = zext i16 %8 to i32
%10 = icmp eq i32 %9, 49152
br i1 %10, label %11, label %16
11: ; preds = %2
%12 = load i16, i16* %7
%13 = zext i16 %12 to i32
%14 = add nsw i32 %13, 2
%15 = trunc i32 %14 to i16
store i16 %15, i16* %7
br label %16
16: ; preds = %11, %2
%17 = load i16, i16* %7
%18 = zext i16 %17 to i32
%19 = and i32 %18, 16383
%20 = add nsw i32 16384, %19
%21 = shl i32 %20, 16
%22 = load i16, i16* %7
%23 = zext i16 %22 to i32
%24 = ashr i32 %23, 14
%25 = or i32 %24, 0
%26 = add nsw i32 %21, %25
%27 = sext i32 %26 to i64
%28 = load i64*, i64** %6
store volatile i64 %27, i64* %28
%29 = load i16, i16* %4
%30 = load i16*, i16** %5
store volatile i16 %29, i16* %30
ret void
}

LLVM IR (-O2):
define void @VDP_setHorizontalScroll(i16 zeroext %0, i16 signext %1) {
%3 = icmp eq i16 %0, -16384
%4 = select i1 %3, i64 2013396994, i64 2013265922
store volatile i64 %4, i64* inttoptr (i64 12582916 to i64*)
store volatile i16 %1, i16* inttoptr (i64 12582912 to i16*)
ret void
}
/* Type definitions */
struct __test_metadata {
  int dummy;
};
struct __fixture_variant_metadata {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ binderfs_test_privileged(struct __test_metadata *);
void wrapper_binderfs_test_privileged(
    struct __test_metadata *_metadata,
    struct __fixture_variant_metadata *variant) {
  binderfs_test_privileged(_metadata);
}


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

x86 assembly (clang, -O2):
<wrapper_binderfs_test_privileged>:
jmp    1030 <binderfs_test_privileged@plt>

LLVM IR (-O0):
%struct.__test_metadata = type { i32 }
%struct.__fixture_variant_metadata = type { i32 }
define void @wrapper_binderfs_test_privileged(%struct.__test_metadata* %0, %struct.__fixture_variant_metadata* %1) {
%3 = alloca %struct.__test_metadata*
%4 = alloca %struct.__fixture_variant_metadata*
store %struct.__test_metadata* %0, %struct.__test_metadata** %3
store %struct.__fixture_variant_metadata* %1, %struct.__fixture_variant_metadata** %4
%5 = load %struct.__test_metadata*, %struct.__test_metadata** %3
%6 = call i32 @binderfs_test_privileged(%struct.__test_metadata* %5)
ret void
}

LLVM IR (-O2):
%struct.__test_metadata = type { i32 }
%struct.__fixture_variant_metadata = type { i32 }
define void @wrapper_binderfs_test_privileged(%struct.__test_metadata* %0, %struct.__fixture_variant_metadata* nocapture readnone %1) {
%3 = tail call i32 @binderfs_test_privileged(%struct.__test_metadata* %0)
ret void
}
/* Variables and functions */
int putchar(int);
int putchar_unlocked(int c) { return putchar(c); }


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

x86 assembly (clang, -O2):
<putchar_unlocked>:
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
define i32 @putchar_unlocked(i32 %0) {
%2 = tail call i32 @putchar(i32 %0)
ret i32 %2
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ nscount;
};

/* Variables and functions */
int /*<<< orphan*/ __dns_readstartfiles();
TYPE_1__ _res;
int res_init(void) {
  _res.nscount = 0;
  __dns_readstartfiles();
  return 0;
}


x86 assembly (clang, -O0):
<res_init>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
movq   $0x0,(%rax)
mov    $0x0,%al
call   1030 <__dns_readstartfiles@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<res_init>:
push   %rax
mov    0x2ed0(%rip),%rax
movq   $0x0,(%rax)
xor    %eax,%eax
call   1030 <__dns_readstartfiles@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
@_res = global %struct.TYPE_2__ zeroinitializer
define i32 @res_init() {
store i64 0, i64* getelementptr inbounds (%struct.TYPE_2__, %struct.TYPE_2__* @_res, i32 0, i32 0)
%1 = call i32 (...) @__dns_readstartfiles()
ret i32 0
}

LLVM IR (-O2):
%struct.TYPE_2__ = type { i64 }
@_res = global %struct.TYPE_2__ zeroinitializer
define i32 @res_init() {
store i64 0, i64* getelementptr inbounds (%struct.TYPE_2__, %struct.TYPE_2__* @_res, i64 0, i32 0)
%1 = tail call i32 (...) @__dns_readstartfiles()
ret i32 0
}
/* Variables and functions */
size_t add(size_t, size_t);
int /*<<< orphan*/ printf(char *, size_t);
int main() {
  size_t total = 0;
  for (size_t i = 0; i < 1000; i++) {
    total = add(total, i);
  }
  printf("total=%lu\n", total);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
cmpq   $0x3e8,-0x18(%rbp)
jae    116f <main+0x4f>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <add@plt>
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    113f <main+0x1f>
mov    -0x10(%rbp),%rsi
lea    0xe86(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %ebx,%ebx
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nop
mov    %rax,%rdi
mov    %rbx,%rsi
call   1030 <add@plt>
add    $0x1,%rbx
cmp    $0x3e8,%rbx
jne    1130 <main+0x10>
lea    0xeb1(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [11 x i8] c"total=%lu\0A\00"
define i32 @main() {
br label %3
1: ; preds = %3
%2 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i64 %6)
ret i32 0
3: ; preds = %0, %3
%4 = phi i64 [ 0, %0 ], [ %7, %3 ]
%5 = phi i64 [ 0, %0 ], [ %6, %3 ]
%6 = tail call i64 @add(i64 %5, i64 %4)
%7 = add nuw nsw i64 %4, 1
%8 = icmp eq i64 %7, 1000
br i1 %8, label %1, label %3
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ O_RDONLY;
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int open(char *, int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
int open_input(char *File) {
  int inputFd = open(File, O_RDONLY);
  if (inputFd == -1) {
    perror(File);
    close(inputFd);
    exit(EXIT_FAILURE);
  } else
    return inputFd;
}


x86 assembly (clang, -O0):
<open_input>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2e91(%rip),%rax
mov    (%rax),%esi
call   1040 <open@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0xffffffff,-0xc(%rbp)
jne    118a <open_input+0x4a>
mov    -0x8(%rbp),%rdi
call   1050 <perror@plt>
mov    -0xc(%rbp),%edi
call   1030 <close@plt>
mov    0x2e55(%rip),%rax
mov    (%rax),%edi
call   1060 <exit@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<open_input>:
push   %rbx
mov    %rdi,%rbx
mov    0x2e9d(%rip),%rax
mov    (%rax),%esi
call   1040 <open@plt>
cmp    $0xffffffff,%eax
je     1159 <open_input+0x19>
pop    %rbx
ret
mov    %rbx,%rdi
call   1050 <perror@plt>
mov    $0xffffffff,%edi
call   1030 <close@plt>
mov    0x2e66(%rip),%rax
mov    (%rax),%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@O_RDONLY = global i32 0
@EXIT_FAILURE = global i32 0
define i32 @open_input(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = load i32, i32* @O_RDONLY
%6 = call i32 @open(i8* %4, i32 %5)
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = icmp eq i32 %7, -1
br i1 %8, label %9, label %16
9: ; preds = %1
%10 = load i8*, i8** %2
%11 = call i32 @perror(i8* %10)
%12 = load i32, i32* %3
%13 = call i32 @close(i32 %12)
%14 = load i32, i32* @EXIT_FAILURE
%15 = call i32 @exit(i32 %14)
unreachable
16: ; preds = %1
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
@O_RDONLY = global i32 0
@EXIT_FAILURE = global i32 0
define i32 @open_input(i8* nocapture %0) {
%2 = load i32, i32* @O_RDONLY
%3 = tail call i32 @open(i8* %0, i32 %2)
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %10
5: ; preds = %1
%6 = tail call i32 @perror(i8* %0)
%7 = tail call i32 @close(i32 -1)
%8 = load i32, i32* @EXIT_FAILURE
%9 = tail call i32 @exit(i32 %8)
unreachable
10: ; preds = %1
ret i32 %3
}
int g(int x) { return g(x + 1); }


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

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

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

LLVM IR (-O2):
define i32 @g(i32 %0) {
br label %2
2: ; preds = %2, %1
br label %2
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void wrFree(void *ptr) { free(ptr); }


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

x86 assembly (clang, -O2):
<wrFree>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @wrFree(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ std_err(char *);
usage() {
  std_err("Usage: mount special name [-r]\n");
  exit(1);
}


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

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

LLVM IR (-O0):
@.str = [32 x i8] c"Usage: mount special name [-r]\0A\00"
define i32 @usage() {
%1 = call i32 @std_err(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [32 x i8] c"Usage: mount special name [-r]\0A\00"
define i32 @usage() {
%1 = tail call i32 @std_err(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 1)
unreachable
}
char *quitcmd(void) { return 0; }


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

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

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

LLVM IR (-O2):
define noalias i8* @quitcmd() {
ret i8* null
}
int testfunc_02(int a, int b, int c, int d) {
  return (a == b && a == d) ? b : c;
}


x86 assembly (clang, -O0):
<testfunc_02>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jne    1133 <testfunc_02+0x33>
mov    -0x4(%rbp),%eax
cmp    -0x10(%rbp),%eax
jne    1133 <testfunc_02+0x33>
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    1139 <testfunc_02+0x39>
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<testfunc_02>:
mov    %edx,%eax
xor    %edi,%ecx
xor    %esi,%edi
or     %edi,%ecx
cmove  %esi,%eax
ret

LLVM IR (-O0):
define i32 @testfunc_02(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
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = icmp eq i32 %9, %10
br i1 %11, label %12, label %18
12: ; preds = %4
%13 = load i32, i32* %5
%14 = load i32, i32* %8
%15 = icmp eq i32 %13, %14
br i1 %15, label %16, label %18
16: ; preds = %12
%17 = load i32, i32* %6
br label %20
18: ; preds = %12, %4
%19 = load i32, i32* %7
br label %20
20: ; preds = %18, %16
%21 = phi i32 [ %17, %16 ], [ %19, %18 ]
ret i32 %21
}

LLVM IR (-O2):
define i32 @testfunc_02(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = icmp eq i32 %0, %1
%6 = icmp eq i32 %0, %3
%7 = and i1 %5, %6
%8 = select i1 %7, i32 %1, i32 %2
ret i32 %8
}
/* Type definitions */
struct ext3_cur_sdirent {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ _drop_sdirent(struct ext3_cur_sdirent *);
void drop_sdirent(struct ext3_cur_sdirent *cur, int live_tx) {
  if (live_tx) {
    _drop_sdirent(cur);
  }
}


x86 assembly (clang, -O0):
<drop_sdirent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1132 <drop_sdirent+0x22>
mov    -0x8(%rbp),%rdi
call   1030 <_drop_sdirent@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<drop_sdirent>:
test   %esi,%esi
je     1119 <drop_sdirent+0x9>
jmp    1030 <_drop_sdirent@plt>
ret

LLVM IR (-O0):
%struct.ext3_cur_sdirent = type { i32 }
define void @drop_sdirent(%struct.ext3_cur_sdirent* %0, i32 %1) {
%3 = alloca %struct.ext3_cur_sdirent*
%4 = alloca i32
store %struct.ext3_cur_sdirent* %0, %struct.ext3_cur_sdirent** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load %struct.ext3_cur_sdirent*, %struct.ext3_cur_sdirent** %3
%9 = call i32 @_drop_sdirent(%struct.ext3_cur_sdirent* %8)
br label %10
10: ; preds = %7, %2
ret void
}

LLVM IR (-O2):
%struct.ext3_cur_sdirent = type { i32 }
define void @drop_sdirent(%struct.ext3_cur_sdirent* %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @_drop_sdirent(%struct.ext3_cur_sdirent* %0)
br label %6
6: ; preds = %4, %2
ret void
}
unsigned if_nametoindex(const char *ifname) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @if_nametoindex(i8* nocapture readnone %0) {
ret i32 0
}
/* Type definitions */
struct em8051 {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *);
int disasm_reti(struct em8051 *aCPU, int aPosition, char *aBuffer) {
  sprintf(aBuffer, "RETI");
  return 1;
}


x86 assembly (clang, -O0):
<disasm_reti>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
lea    0xed2(%rip),%rsi
call   1030 <sprintf@plt>
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<disasm_reti>:
movb   $0x0,0x4(%rdx)
movl   $0x49544552,(%rdx)
mov    $0x1,%eax
ret

LLVM IR (-O0):
%struct.em8051 = type { i32 }
@.str = [5 x i8] c"RETI\00"
define i32 @disasm_reti(%struct.em8051* %0, i32 %1, i8* %2) {
%4 = alloca %struct.em8051*
%5 = alloca i32
%6 = alloca i8*
store %struct.em8051* %0, %struct.em8051** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i8*, i8** %6
%8 = call i32 @sprintf(i8* %7, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret i32 1
}

LLVM IR (-O2):
%struct.em8051 = type { i32 }
@.str = [5 x i8] c"RETI\00"
define i32 @disasm_reti(%struct.em8051* nocapture readnone %0, i32 %1, i8* nocapture writeonly %2) {
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 dereferenceable(5) %2, i8* align 1 dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 5, i1 false)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ barrier();
void putc(char c) {
  while (!(((volatile unsigned long *)0x40700000)[5] & 0x20))
    barrier();
  ((volatile unsigned long *)0x40700000)[0] = c;
}


x86 assembly (clang, -O0):
<putc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x40700000,%eax
mov    0x28(%rax),%rax
and    $0x20,%rax
cmp    $0x0,%rax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1141 <putc+0x31>
jmp    114d <putc+0x3d>
mov    $0x0,%al
call   1030 <barrier@plt>
jmp    111e <putc+0xe>
movsbq -0x1(%rbp),%rcx
mov    $0x40700000,%eax
mov    %rcx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putc>:
push   %rbx
mov    %edi,%ebx
testq  $0x20,0x40700028
jne    1145 <putc+0x35>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <barrier@plt>
testq  $0x20,0x40700028
je     1130 <putc+0x20>
movsbq %bl,%rax
mov    %rax,0x40700000
40
pop    %rbx
ret

LLVM IR (-O0):
define void @putc(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
br label %3
3: ; preds = %8, %1
%4 = load volatile i64, i64* getelementptr inbounds (i64, i64* inttoptr (i64 1081081856 to i64*), i64 5)
%5 = and i64 %4, 32
%6 = icmp ne i64 %5, 0
%7 = xor i1 %6, true
br i1 %7, label %8, label %10
8: ; preds = %3
%9 = call i32 (...) @barrier()
br label %3
10: ; preds = %3
%11 = load i8, i8* %2
%12 = sext i8 %11 to i64
store volatile i64 %12, i64* inttoptr (i64 1081081856 to i64*)
ret void
}

LLVM IR (-O2):
define void @putc(i8 signext %0) {
%2 = load volatile i64, i64* inttoptr (i64 1081081896 to i64*)
%3 = and i64 %2, 32
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %10
5: ; preds = %1, %5
%6 = tail call i32 (...) @barrier()
%7 = load volatile i64, i64* inttoptr (i64 1081081896 to i64*)
%8 = and i64 %7, 32
%9 = icmp eq i64 %8, 0
br i1 %9, label %5, label %10
10: ; preds = %5, %1
%11 = sext i8 %0 to i64
store volatile i64 %11, i64* inttoptr (i64 1081081856 to i64*)
ret void
}
int get_args_required(const char *str) {
  int i, count = 0;
  for (i = 0; str[i] != '\0'; i++) {
    if (str[i] == ',') {
      count++;
    }
  }
  return ++count;
}


x86 assembly (clang, -O0):
<get_args_required>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     115c <get_args_required+0x5c>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x2c,%eax
jne    1149 <get_args_required+0x49>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    114e <get_args_required+0x4e>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1116 <get_args_required+0x16>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_args_required>:
xor    %eax,%eax
jmp    1117 <get_args_required+0x17>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    $0x1,%eax
add    $0x1,%rdi
movzbl (%rdi),%ecx
cmp    $0x2c,%cl
je     1110 <get_args_required+0x10>
test   %cl,%cl
jne    1113 <get_args_required+0x13>
add    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @get_args_required(i8* nocapture %0) {
br label %2
2: ; preds = %9, %1
%3 = phi i64 [ %11, %9 ], [ 0, %1 ]
%4 = phi i32 [ %10, %9 ], [ 0, %1 ]
%5 = getelementptr inbounds i8, i8* %0, i64 %3
%6 = load i8, i8* %5
switch i8 %6, label %9 [
i8 0, label %12
i8 44, label %7
]
7: ; preds = %2
%8 = add nsw i32 %4, 1
br label %9
9: ; preds = %2, %7
%10 = phi i32 [ %8, %7 ], [ %4, %2 ]
%11 = add nuw i64 %3, 1
br label %2
12: ; preds = %2
%13 = add nsw i32 %4, 1
ret i32 %13
}
int lm_ex_disable_gl_sanlock(struct lockspace *ls) { return -1; }


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

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

LLVM IR (-O0):
%struct.lockspace = type opaque
define i32 @lm_ex_disable_gl_sanlock(%struct.lockspace* %0) {
%2 = alloca %struct.lockspace*
store %struct.lockspace* %0, %struct.lockspace** %2
ret i32 -1
}

LLVM IR (-O2):
%struct.lockspace = type opaque
define i32 @lm_ex_disable_gl_sanlock(%struct.lockspace* nocapture readnone %0) {
ret i32 -1
}
/* Variables and functions */
scalar_t__ __builtin_j0(double);
int /*<<< orphan*/ link_failure_builtin_j0();
void test_builtin_j0(double d) {
  if (__builtin_j0(d) != __builtin_j0(d))
    link_failure_builtin_j0();
}


x86 assembly (clang, -O0):
<test_builtin_j0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <__builtin_j0@plt>
mov    %rax,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <__builtin_j0@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
cmp    %rcx,%rax
je     115c <test_builtin_j0+0x3c>
mov    $0x0,%al
call   1030 <link_failure_builtin_j0@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_builtin_j0>:
push   %rbx
sub    $0x10,%rsp
movsd  %xmm0,0x8(%rsp)
call   1040 <__builtin_j0@plt>
mov    %rax,%rbx
movsd  0x8(%rsp),%xmm0
call   1040 <__builtin_j0@plt>
cmp    %rax,%rbx
jne    1149 <test_builtin_j0+0x29>
add    $0x10,%rsp
pop    %rbx
ret
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
jmp    1030 <link_failure_builtin_j0@plt>

LLVM IR (-O0):
define void @test_builtin_j0(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i64 @__builtin_j0(double %3)
%5 = load double, double* %2
%6 = call i64 @__builtin_j0(double %5)
%7 = icmp ne i64 %4, %6
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 (...) @link_failure_builtin_j0()
br label %10
10: ; preds = %8, %1
ret void
}

LLVM IR (-O2):
define void @test_builtin_j0(double %0) {
%2 = tail call i64 @__builtin_j0(double %0)
%3 = tail call i64 @__builtin_j0(double %0)
%4 = icmp eq i64 %2, %3
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 (...) @link_failure_builtin_j0()
br label %7
7: ; preds = %5, %1
ret void
}
void i2d_PrivateKey_bio(void) {}


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

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

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

LLVM IR (-O2):
define void @i2d_PrivateKey_bio() {
ret void
}
/* Variables and functions */
int BUFSIZ;
int read(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ write(int, char *, int);
main() {
  char buf[BUFSIZ];
  int n;
  while ((n = read(0, buf, BUFSIZ)) > 0)
    write(1, buf, n);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%eax
mov    %rsp,%rcx
mov    %rcx,-0x10(%rbp)
mov    %rax,%rdx
add    $0xf,%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x28(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x18(%rbp)
mov    -0x28(%rbp),%rsi
mov    0x2e7a(%rip),%rax
mov    (%rax),%edx
xor    %edi,%edi
call   1040 <read@plt>
mov    %eax,-0x1c(%rbp)
cmp    $0x0,%eax
jle    1191 <main+0x71>
mov    -0x28(%rbp),%rsi
mov    -0x1c(%rbp),%edx
mov    $0x1,%edi
call   1030 <write@plt>
jmp    115b <main+0x3b>
movl   $0x0,-0x4(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %r14
push   %rbx
mov    0x2eb2(%rip),%r14
mov    (%r14),%edx
mov    %rsp,%rbx
mov    %rdx,%rax
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rbx
mov    %rbx,%rsp
xor    %edi,%edi
mov    %rbx,%rsi
nopw   0x0(%rax,%rax,1)
call   1040 <read@plt>
test   %eax,%eax
jle    1172 <main+0x52>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <write@plt>
mov    (%r14),%edx
xor    %edi,%edi
mov    %rbx,%rsi
jmp    1150 <main+0x30>
xor    %eax,%eax
lea    -0x10(%rbp),%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@BUFSIZ = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i32
store i32 0, i32* %1
%5 = load i32, i32* @BUFSIZ
%6 = zext i32 %5 to i64
%7 = call i8* @llvm.stacksave()
store i8* %7, i8** %2
%8 = alloca i8, i64 %6
store i64 %6, i64* %3
br label %9
9: ; preds = %13, %0
%10 = load i32, i32* @BUFSIZ
%11 = call i32 @read(i32 0, i8* %8, i32 %10)
store i32 %11, i32* %4
%12 = icmp sgt i32 %11, 0
br i1 %12, label %13, label %16
13: ; preds = %9
%14 = load i32, i32* %4
%15 = call i32 @write(i32 1, i8* %8, i32 %14)
br label %9
16: ; preds = %9
store i32 0, i32* %1
%17 = load i8*, i8** %2
%18 = load i32, i32* %1
ret i32 %18
}

LLVM IR (-O2):
@BUFSIZ = global i32 0
define i32 @main() {
%1 = load i32, i32* @BUFSIZ
%2 = zext i32 %1 to i64
%3 = alloca i8, i64 %2
%4 = call i32 @read(i32 0, i8* %3, i32 %1)
%5 = icmp sgt i32 %4, 0
br i1 %5, label %6, label %12
6: ; preds = %0, %6
%7 = phi i32 [ %10, %6 ], [ %4, %0 ]
%8 = call i32 @write(i32 1, i8* %3, i32 %7)
%9 = load i32, i32* @BUFSIZ
%10 = call i32 @read(i32 0, i8* %3, i32 %9)
%11 = icmp sgt i32 %10, 0
br i1 %11, label %6, label %12
12: ; preds = %6, %0
ret i32 0
}
unsigned long int system_get_memory_total() { return 0; }


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

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

LLVM IR (-O0):
define i64 @system_get_memory_total() {
ret i64 0
}

LLVM IR (-O2):
define i64 @system_get_memory_total() {
ret i64 0
}
float deposit_acctotal(float fncAmount, float fncTotal) {
  fncTotal = fncTotal + fncAmount;
  return (fncTotal);
}


x86 assembly (clang, -O0):
<deposit_acctotal>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
addss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<deposit_acctotal>:
addss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @deposit_acctotal(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %4
%6 = load float, float* %3
%7 = fadd float %5, %6
store float %7, float* %4
%8 = load float, float* %4
ret float %8
}

LLVM IR (-O2):
define float @deposit_acctotal(float %0, float %1) {
%3 = fadd float %0, %1
ret float %3
}
/* Variables and functions */
int /*<<< orphan*/ debug(char *, ...);
int M668_f(char *s) {
  debug("M668_f(const char *s) is not yet implemented!\n");
  debug("%s\n", s);
  return 1;
}


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

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

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

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