xunge/DecIR huggingface dataset:
int fib(int n) {
  if (n < 2) {
    return n;
  } else {
    return fib(n - 1) + fib(n - 2);
  }
}


x86 assembly (clang, -O0):
<fib>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    1130 <fib+0x20>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1153 <fib+0x43>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <fib@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x2,%edi
call   1030 <fib@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fib>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
xor    %ebp,%ebp
cmp    $0x2,%edi
jge    1120 <fib+0x10>
mov    %ebx,%ecx
jmp    1144 <fib+0x34>
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
lea    -0x1(%rbx),%edi
call   1030 <fib@plt>
lea    -0x2(%rbx),%ecx
add    %eax,%ebp
cmp    $0x3,%ebx
mov    %ecx,%ebx
ja     1130 <fib+0x20>
add    %ecx,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @fib(i32 %0) {
%2 = icmp slt i32 %0, 2
br i1 %2, label %11, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ %0, %1 ]
%5 = phi i32 [ %9, %3 ], [ 0, %1 ]
%6 = add nsw i32 %4, -1
%7 = tail call i32 @fib(i32 %6)
%8 = add nsw i32 %4, -2
%9 = add nsw i32 %7, %5
%10 = icmp ult i32 %4, 4
br i1 %10, label %11, label %3
11: ; preds = %3, %1
%12 = phi i32 [ 0, %1 ], [ %9, %3 ]
%13 = phi i32 [ %0, %1 ], [ %8, %3 ]
%14 = add nsw i32 %13, %12
ret i32 %14
}
void dbg_dump_budget_req(const struct ubifs_budget_req *req) { return; }


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

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

LLVM IR (-O0):
%struct.ubifs_budget_req = type opaque
define void @dbg_dump_budget_req(%struct.ubifs_budget_req* %0) {
%2 = alloca %struct.ubifs_budget_req*
store %struct.ubifs_budget_req* %0, %struct.ubifs_budget_req** %2
ret void
}

LLVM IR (-O2):
%struct.ubifs_budget_req = type opaque
define void @dbg_dump_budget_req(%struct.ubifs_budget_req* nocapture %0) {
ret void
}
int internal_eol(char p) { return (p == '\r' || p == '\n' || p == '\0'); }


x86 assembly (clang, -O0):
<internal_eol>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0xd,%ecx
mov    %al,-0x2(%rbp)
je     113b <internal_eol+0x3b>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0xa,%ecx
mov    %al,-0x2(%rbp)
je     113b <internal_eol+0x3b>
movsbl -0x1(%rbp),%eax
cmp    $0x0,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<internal_eol>:
mov    $0x1,%eax
cmp    $0xa,%dil
je     1111 <internal_eol+0x11>
cmp    $0xd,%dil
jne    1112 <internal_eol+0x12>
ret
xor    %eax,%eax
test   %dil,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @internal_eol(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 13
br i1 %5, label %14, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 10
br i1 %9, label %14, label %10
10: ; preds = %6
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 0
br label %14
14: ; preds = %10, %6, %1
%15 = phi i1 [ true, %6 ], [ true, %1 ], [ %13, %10 ]
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @internal_eol(i8 signext %0) {
switch i8 %0, label %2 [
i8 13, label %5
i8 10, label %5
]
2: ; preds = %1
%3 = icmp eq i8 %0, 0
%4 = zext i1 %3 to i32
br label %5
5: ; preds = %1, %1, %2
%6 = phi i32 [ 1, %1 ], [ %4, %2 ], [ 1, %1 ]
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char const *);
void die(const char *str) {
  perror(str);
  exit(1);
}


x86 assembly (clang, -O0):
<die>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<die>:
push   %rax
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @die(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @perror(i8* %3)
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @die(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
int do_452() { return 452; }


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

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

LLVM IR (-O0):
define i32 @do_452() {
ret i32 452
}

LLVM IR (-O2):
define i32 @do_452() {
ret i32 452
}
/* Variables and functions */
int /*<<< orphan*/ pA(char *);
int /*<<< orphan*/ read_mem(char const *, char *);
void pop_callstack(const char *register_name) {
  pA("callstack_head--;");
  read_mem(register_name, "callstack_head");
}


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

x86 assembly (clang, -O2):
<pop_callstack>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
call   1030 <pA@plt>
lea    0xedb(%rip),%rsi
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <read_mem@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"callstack_head--;\00"
@.str.1 = [15 x i8] c"callstack_head\00"
define void @pop_callstack(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @pA(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 @read_mem(i8* %4, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"callstack_head--;\00"
@.str.1 = [15 x i8] c"callstack_head\00"
define void @pop_callstack(i8* %0) {
%2 = tail call i32 @pA(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @read_mem(i8* %0, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ serial_init();
uint8_t serial_mouse_init(void) {
  serial_init();
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @serial_mouse_init() {
%1 = call i32 (...) @serial_init()
ret i32 0
}

LLVM IR (-O2):
define i32 @serial_mouse_init() {
%1 = tail call i32 (...) @serial_init()
ret i32 0
}
int acpi_ioapic_remove(struct acpi_pci_root *root) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.acpi_pci_root = type opaque
define i32 @acpi_ioapic_remove(%struct.acpi_pci_root* nocapture readnone %0) {
ret i32 0
}
/* Type definitions */
typedef unsigned long volatile uint32_t;

/* Variables and functions */
uint32_t WatchdogIntStatus(void) {
  return ((*((volatile unsigned long *)(0x40080000 + 0x00000010))));
}


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

x86 assembly (clang, -O2):
<WatchdogIntStatus>:
mov    0x40080010,%rax
40
ret

LLVM IR (-O0):
define i64 @WatchdogIntStatus() {
%1 = load volatile i64, i64* inttoptr (i64 1074266128 to i64*)
ret i64 %1
}

LLVM IR (-O2):
define i64 @WatchdogIntStatus() {
%1 = load volatile i64, i64* inttoptr (i64 1074266128 to i64*)
ret i64 %1
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ ntohs(int /*<<< orphan*/);
uint16_t NtoHS(uint16_t netshort) { return ntohs(netshort); }


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

x86 assembly (clang, -O2):
<NtoHS>:
jmp    1030 <ntohs@plt>

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

LLVM IR (-O2):
define i32 @NtoHS(i32 %0) {
%2 = tail call i32 @ntohs(i32 %0)
ret i32 %2
}
int insidepixel(int x, int y, int pixx, int pixy, int sx, int sy) {
  return ((x > pixx - sx) && (x < pixx + (((41) * 8) - 8)) && (y > pixy - sy) &&
          (y < pixy + (((23) * 8) - 8)));
}


x86 assembly (clang, -O0):
<insidepixel>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    %r9d,-0x18(%rbp)
mov    -0x4(%rbp),%ecx
mov    -0xc(%rbp),%edx
sub    -0x14(%rbp),%edx
xor    %eax,%eax
cmp    %edx,%ecx
mov    %al,-0x19(%rbp)
jle    1171 <insidepixel+0x71>
mov    -0x4(%rbp),%ecx
mov    -0xc(%rbp),%edx
add    $0x140,%edx
xor    %eax,%eax
cmp    %edx,%ecx
mov    %al,-0x19(%rbp)
jge    1171 <insidepixel+0x71>
mov    -0x8(%rbp),%ecx
mov    -0x10(%rbp),%edx
sub    -0x18(%rbp),%edx
xor    %eax,%eax
cmp    %edx,%ecx
mov    %al,-0x19(%rbp)
jle    1171 <insidepixel+0x71>
mov    -0x8(%rbp),%eax
mov    -0x10(%rbp),%ecx
add    $0xb0,%ecx
cmp    %ecx,%eax
setl   %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<insidepixel>:
mov    %edx,%eax
sub    %r8d,%eax
cmp    %edi,%eax
setl   %al
add    $0x140,%edx
cmp    %edi,%edx
setg   %dl
and    %al,%dl
mov    %ecx,%eax
sub    %r9d,%eax
cmp    %esi,%eax
setl   %al
add    $0xb0,%ecx
cmp    %esi,%ecx
setg   %cl
and    %al,%cl
and    %dl,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @insidepixel(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
store i32 %0, i32* %7
store i32 %1, i32* %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store i32 %4, i32* %11
store i32 %5, i32* %12
%13 = load i32, i32* %7
%14 = load i32, i32* %9
%15 = load i32, i32* %11
%16 = sub nsw i32 %14, %15
%17 = icmp sgt i32 %13, %16
br i1 %17, label %18, label %34
18: ; preds = %6
%19 = load i32, i32* %7
%20 = load i32, i32* %9
%21 = add nsw i32 %20, 320
%22 = icmp slt i32 %19, %21
br i1 %22, label %23, label %34
23: ; preds = %18
%24 = load i32, i32* %8
%25 = load i32, i32* %10
%26 = load i32, i32* %12
%27 = sub nsw i32 %25, %26
%28 = icmp sgt i32 %24, %27
br i1 %28, label %29, label %34
29: ; preds = %23
%30 = load i32, i32* %8
%31 = load i32, i32* %10
%32 = add nsw i32 %31, 176
%33 = icmp slt i32 %30, %32
br label %34
34: ; preds = %29, %23, %18, %6
%35 = phi i1 [ false, %23 ], [ false, %18 ], [ false, %6 ], [ %33, %29 ]
%36 = zext i1 %35 to i32
ret i32 %36
}

LLVM IR (-O2):
define i32 @insidepixel(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = sub nsw i32 %2, %4
%8 = icmp slt i32 %7, %0
%9 = add nsw i32 %2, 320
%10 = icmp sgt i32 %9, %0
%11 = select i1 %8, i1 %10, i1 false
%12 = sub nsw i32 %3, %5
%13 = icmp slt i32 %12, %1
%14 = select i1 %11, i1 %13, i1 false
%15 = add nsw i32 %3, 176
%16 = icmp sgt i32 %15, %1
%17 = select i1 %14, i1 %16, i1 false
%18 = zext i1 %17 to i32
ret i32 %18
}
int cealtesthook_output_check() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @cealtesthook_output_check() {
ret i32 0
}
/* Variables and functions */
scalar_t__ malloc(scalar_t__);
int /*<<< orphan*/ sprintf(char *, char *, double);
int /*<<< orphan*/ strcpy(char *, char *);
scalar_t__ strlen(char *);
char *Ftoa(double f) {
  char tmp[100];
  char *copy;
  sprintf(tmp, "%g", f);
  copy = (char *)malloc(strlen(tmp) + 1);
  strcpy(copy, tmp);
  return copy;
}


x86 assembly (clang, -O0):
<Ftoa>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movsd  %xmm0,-0x8(%rbp)
lea    -0x70(%rbp),%rdi
movsd  -0x8(%rbp),%xmm0
lea    0xea0(%rip),%rsi
call   1060 <sprintf@plt>
lea    -0x70(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x78(%rbp)
mov    -0x78(%rbp),%rdi
lea    -0x70(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x78(%rbp),%rax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Ftoa>:
push   %r14
push   %rbx
sub    $0x68,%rsp
lea    0xeb2(%rip),%rsi
mov    %rsp,%r14
mov    %r14,%rdi
call   1060 <sprintf@plt>
mov    %r14,%rdi
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x68,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%g\00"
define i8* @Ftoa(double %0) {
%2 = alloca double
%3 = alloca [100 x i8]
%4 = alloca i8*
store double %0, double* %2
%5 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%6 = load double, double* %2
%7 = call i32 @sprintf(i8* %5, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), double %6)
%8 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%9 = call i64 @strlen(i8* %8)
%10 = add nsw i64 %9, 1
%11 = call i64 @malloc(i64 %10)
%12 = inttoptr i64 %11 to i8*
store i8* %12, i8** %4
%13 = load i8*, i8** %4
%14 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%15 = call i32 @strcpy(i8* %13, i8* %14)
%16 = load i8*, i8** %4
ret i8* %16
}

LLVM IR (-O2):
@.str = [3 x i8] c"%g\00"
define i8* @Ftoa(double %0) {
%2 = alloca [100 x i8]
%3 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%4 = call i32 @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), double %0)
%5 = call i64 @strlen(i8* %3)
%6 = add nsw i64 %5, 1
%7 = tail call i64 @malloc(i64 %6)
%8 = inttoptr i64 %7 to i8*
%9 = call i32 @strcpy(i8* %8, i8* %3)
ret i8* %8
}
/* Type definitions */
struct cstate {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ die(struct cstate *, char *);
int dec(struct cstate *g, int c) {
  if (c >= '0' && c <= '9')
    return c - '0';
  die(g, "invalid quantifier");
  return 0;
}


x86 assembly (clang, -O0):
<dec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
cmpl   $0x30,-0x14(%rbp)
jl     1141 <dec+0x31>
cmpl   $0x39,-0x14(%rbp)
jg     1141 <dec+0x31>
mov    -0x14(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0x4(%rbp)
jmp    1158 <dec+0x48>
mov    -0x10(%rbp),%rdi
lea    0xeb4(%rip),%rsi
call   1030 <die@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dec>:
mov    %esi,%eax
add    $0xffffffd0,%eax
cmp    $0xa,%eax
jb     112d <dec+0x1d>
push   %rax
lea    0xede(%rip),%rsi
call   1030 <die@plt>
xor    %eax,%eax
add    $0x8,%rsp
ret

LLVM IR (-O0):
%struct.cstate = type { i32 }
@.str = [19 x i8] c"invalid quantifier\00"
define i32 @dec(%struct.cstate* %0, i32 %1) {
%3 = alloca i32
%4 = alloca %struct.cstate*
%5 = alloca i32
store %struct.cstate* %0, %struct.cstate** %4
store i32 %1, i32* %5
%6 = load i32, i32* %5
%7 = icmp sge i32 %6, 48
br i1 %7, label %8, label %14
8: ; preds = %2
%9 = load i32, i32* %5
%10 = icmp sle i32 %9, 57
br i1 %10, label %11, label %14
11: ; preds = %8
%12 = load i32, i32* %5
%13 = sub nsw i32 %12, 48
store i32 %13, i32* %3
br label %17
14: ; preds = %8, %2
%15 = load %struct.cstate*, %struct.cstate** %4
%16 = call i32 @die(%struct.cstate* %15, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %3
br label %17
17: ; preds = %14, %11
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
%struct.cstate = type { i32 }
@.str = [19 x i8] c"invalid quantifier\00"
define i32 @dec(%struct.cstate* %0, i32 %1) {
%3 = add i32 %1, -48
%4 = icmp ult i32 %3, 10
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @die(%struct.cstate* %0, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %2, %5
%8 = phi i32 [ 0, %5 ], [ %3, %2 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ sleep(int);
void delay_us(int foo) { sleep(foo / 1000000); }


x86 assembly (clang, -O0):
<delay_us>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xf4240,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
call   1030 <sleep@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<delay_us>:
movslq %edi,%rax
imul   $0x431bde83,%rax,%rdi
mov    %rdi,%rax
shr    $0x3f,%rax
sar    $0x32,%rdi
add    %eax,%edi
jmp    1030 <sleep@plt>

LLVM IR (-O0):
define void @delay_us(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sdiv i32 %3, 1000000
%5 = call i32 @sleep(i32 %4)
ret void
}

LLVM IR (-O2):
define void @delay_us(i32 %0) {
%2 = sdiv i32 %0, 1000000
%3 = tail call i32 @sleep(i32 %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ BigEndianReadU32(int /*<<< orphan*/ const *);
int32_t BigEndianReadS32(const uint8_t *bytes) {
  union {
    int32_t s32;
    uint32_t u32;
  } u;
  u.u32 = BigEndianReadU32(bytes);
  return u.s32;
}


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

x86 assembly (clang, -O2):
<BigEndianReadS32>:
jmp    1030 <BigEndianReadU32@plt>

LLVM IR (-O0):
%union.anon = type { i32 }
define i32 @BigEndianReadS32(i32* %0) {
%2 = alloca i32*
%3 = alloca %union.anon
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @BigEndianReadU32(i32* %4)
%6 = bitcast %union.anon* %3 to i32*
store i32 %5, i32* %6
%7 = bitcast %union.anon* %3 to i32*
%8 = load i32, i32* %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @BigEndianReadS32(i32* %0) {
%2 = tail call i32 @BigEndianReadU32(i32* %0)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ u_char;
struct sshbuf {
  int dummy;
};

/* Variables and functions */
int sshbuf_reserve(struct sshbuf *, int, int /*<<< orphan*/ **);
int sshbuf_put_u8(struct sshbuf *buf, u_char val) {
  u_char *p;
  int r;
  if ((r = sshbuf_reserve(buf, 1, &p)) < 0)
    return r;
  p[0] = val;
  return 0;
}


x86 assembly (clang, -O0):
<sshbuf_put_u8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x1,%esi
lea    -0x20(%rbp),%rdx
call   1030 <sshbuf_reserve@plt>
mov    %eax,-0x24(%rbp)
cmp    $0x0,%eax
jge    1148 <sshbuf_put_u8+0x38>
mov    -0x24(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1158 <sshbuf_put_u8+0x48>
mov    -0x14(%rbp),%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sshbuf_put_u8>:
push   %rbx
sub    $0x10,%rsp
mov    %esi,%ebx
lea    0x8(%rsp),%rdx
mov    $0x1,%esi
call   1030 <sshbuf_reserve@plt>
test   %eax,%eax
js     1133 <sshbuf_put_u8+0x23>
mov    0x8(%rsp),%rax
mov    %ebx,(%rax)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.sshbuf = type { i32 }
define i32 @sshbuf_put_u8(%struct.sshbuf* %0, i32 %1) {
%3 = alloca i32
%4 = alloca %struct.sshbuf*
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i32
store %struct.sshbuf* %0, %struct.sshbuf** %4
store i32 %1, i32* %5
%8 = load %struct.sshbuf*, %struct.sshbuf** %4
%9 = call i32 @sshbuf_reserve(%struct.sshbuf* %8, i32 1, i32** %6)
store i32 %9, i32* %7
%10 = icmp slt i32 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = load i32, i32* %7
store i32 %12, i32* %3
br label %17
13: ; preds = %2
%14 = load i32, i32* %5
%15 = load i32*, i32** %6
%16 = getelementptr inbounds i32, i32* %15, i64 0
store i32 %14, i32* %16
store i32 0, i32* %3
br label %17
17: ; preds = %13, %11
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
%struct.sshbuf = type { i32 }
define i32 @sshbuf_put_u8(%struct.sshbuf* %0, i32 %1) {
%3 = alloca i32*
%4 = bitcast i32** %3 to i8*
%5 = call i32 @sshbuf_reserve(%struct.sshbuf* %0, i32 1, i32** %3)
%6 = icmp slt i32 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %2
%8 = load i32*, i32** %3
store i32 %1, i32* %8
br label %9
9: ; preds = %2, %7
%10 = phi i32 [ 0, %7 ], [ %5, %2 ]
ret i32 %10
}
/* Type definitions */
struct t_relay_dogechat_nicklist {
  int dummy;
};
struct t_hashtable {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/
relay_dogechat_nicklist_free(struct t_relay_dogechat_nicklist *);
void relay_dogechat_free_buffers_nicklist(struct t_hashtable *hashtable,
                                          const void *key, void *value) {
  (void)hashtable;
  (void)key;
  relay_dogechat_nicklist_free((struct t_relay_dogechat_nicklist *)value);
}


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

x86 assembly (clang, -O2):
<relay_dogechat_free_buffers_nicklist>:
mov    %rdx,%rdi
jmp    1030 <relay_dogechat_nicklist_free@plt>

LLVM IR (-O0):
%struct.t_hashtable = type { i32 }
%struct.t_relay_dogechat_nicklist = type { i32 }
define void @relay_dogechat_free_buffers_nicklist(%struct.t_hashtable* %0, i8* %1, i8* %2) {
%4 = alloca %struct.t_hashtable*
%5 = alloca i8*
%6 = alloca i8*
store %struct.t_hashtable* %0, %struct.t_hashtable** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load %struct.t_hashtable*, %struct.t_hashtable** %4
%8 = load i8*, i8** %5
%9 = load i8*, i8** %6
%10 = bitcast i8* %9 to %struct.t_relay_dogechat_nicklist*
%11 = call i32 @relay_dogechat_nicklist_free(%struct.t_relay_dogechat_nicklist* %10)
ret void
}

LLVM IR (-O2):
%struct.t_hashtable = type { i32 }
%struct.t_relay_dogechat_nicklist = type { i32 }
define void @relay_dogechat_free_buffers_nicklist(%struct.t_hashtable* nocapture readnone %0, i8* nocapture readnone %1, i8* %2) {
%4 = bitcast i8* %2 to %struct.t_relay_dogechat_nicklist*
%5 = tail call i32 @relay_dogechat_nicklist_free(%struct.t_relay_dogechat_nicklist* %4)
ret void
}
/* Variables and functions */
int OK;
int PDC_get_scrn_mode(void) { return (OK); }


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

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

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

LLVM IR (-O2):
@OK = global i32 0
define i32 @PDC_get_scrn_mode() {
%1 = load i32, i32* @OK
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ __uClibc_main(unsigned int, char **, char **);
void _start(unsigned int first_arg) {
  unsigned int argc;
  char **argv, **envp;
  unsigned long *stack;
  stack = (unsigned long *)&first_arg;
  argc = *(stack - 1);
  argv = (char **)stack;
  envp = (char **)stack + argc + 1;
  __uClibc_main(argc, argv, envp);
}


x86 assembly (clang, -O0):
<_start>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x8(%rax),%rax
mov    %eax,-0x8(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x8(%rbp),%ecx
shl    $0x3,%rcx
add    %rcx,%rax
add    $0x8,%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <__uClibc_main@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_start>:
push   %rax
mov    %edi,0x4(%rsp)
lea    0xc(%rsp),%rdx
lea    0x4(%rsp),%rsi
call   1030 <__uClibc_main@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @_start(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i8**
%6 = alloca i64*
store i32 %0, i32* %2
%7 = bitcast i32* %2 to i64*
store i64* %7, i64** %6
%8 = load i64*, i64** %6
%9 = getelementptr inbounds i64, i64* %8, i64 -1
%10 = load i64, i64* %9
%11 = trunc i64 %10 to i32
store i32 %11, i32* %3
%12 = load i64*, i64** %6
%13 = bitcast i64* %12 to i8**
store i8** %13, i8*** %4
%14 = load i64*, i64** %6
%15 = bitcast i64* %14 to i8**
%16 = load i32, i32* %3
%17 = zext i32 %16 to i64
%18 = getelementptr inbounds i8*, i8** %15, i64 %17
%19 = getelementptr inbounds i8*, i8** %18, i64 1
store i8** %19, i8*** %5
%20 = load i32, i32* %3
%21 = load i8**, i8*** %4
%22 = load i8**, i8*** %5
%23 = call i32 @__uClibc_main(i32 %20, i8** %21, i8** %22)
ret void
}

LLVM IR (-O2):
define void @_start(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = bitcast i32* %2 to i8**
%4 = getelementptr inbounds i32, i32* %2, i64 2
%5 = bitcast i32* %4 to i8**
%6 = call i32 @__uClibc_main(i32 undef, i8** %3, i8** %5)
ret void
}
char character_encoding(char plaintext_character) {
  char encoded_character = '\0';
  encoded_character = plaintext_character + 4;
  return encoded_character;
}


x86 assembly (clang, -O0):
<character_encoding>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movb   $0x0,-0x2(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x4,%eax
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<character_encoding>:
lea    0x4(%rdi),%eax
ret

LLVM IR (-O0):
define signext i8 @character_encoding(i8 signext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %2
store i8 0, i8* %3
%4 = load i8, i8* %2
%5 = sext i8 %4 to i32
%6 = add nsw i32 %5, 4
%7 = trunc i32 %6 to i8
store i8 %7, i8* %3
%8 = load i8, i8* %3
ret i8 %8
}

LLVM IR (-O2):
define signext i8 @character_encoding(i8 signext %0) {
%2 = add i8 %0, 4
ret i8 %2
}
int get1() { return 1; }


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

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

LLVM IR (-O0):
define i32 @get1() {
ret i32 1
}

LLVM IR (-O2):
define i32 @get1() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ sectioning_underscore(char *);
void cm_majorheading(void) { sectioning_underscore("majorheading"); }


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

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

LLVM IR (-O0):
@.str = [13 x i8] c"majorheading\00"
define void @cm_majorheading() {
%1 = call i32 @sectioning_underscore(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"majorheading\00"
define void @cm_majorheading() {
%1 = tail call i32 @sectioning_underscore(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ execlp(char *, char *, char *, int /*<<< orphan*/ *);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Running ps with execlp\n");
  getchar();
  execlp("ps", "ps", "ax", NULL);
  printf("Done.\n");
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
lea    0xeaf(%rip),%rsi
lea    0xeab(%rip),%rdx
xor    %eax,%eax
mov    %eax,%ecx
mov    %rsi,%rdi
call   1060 <execlp@plt>
lea    0xe9b(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xebe(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
lea    0xea5(%rip),%rdi
lea    0xea1(%rip),%rdx
mov    %rdi,%rsi
xor    %ecx,%ecx
call   1060 <execlp@plt>
lea    0xeaa(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"Running ps with execlp\0A\00"
@.str.1 = [3 x i8] c"ps\00"
@.str.2 = [3 x i8] c"ax\00"
@.str.3 = [7 x i8] c"Done.\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @getchar()
%4 = call i32 @execlp(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* null)
%5 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
%6 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"ps\00"
@.str.2 = [3 x i8] c"ax\00"
@str = [23 x i8] c"Running ps with execlp\00"
@str.4 = [6 x i8] c"Done.\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @getchar()
%3 = tail call i32 @execlp(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* null)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str.4, i64 0, i64 0))
%5 = tail call i32 @exit(i32 0)
unreachable
}
unsigned int deref_uintptr(unsigned int *p) { return *p; }


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

x86 assembly (clang, -O2):
<deref_uintptr>:
mov    (%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @deref_uintptr(i32* nocapture %0) {
%2 = load i32, i32* %0
ret i32 %2
}
int f8(int a, int b) { return a == 9 && b == 0; }


x86 assembly (clang, -O0):
<f8>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
xor    %eax,%eax
cmpl   $0x9,-0x4(%rbp)
mov    %al,-0x9(%rbp)
jne    1123 <f8+0x23>
cmpl   $0x0,-0x8(%rbp)
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f8>:
xor    $0x9,%edi
xor    %eax,%eax
or     %esi,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @f8(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 = icmp eq i32 %5, 9
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i32, i32* %4
%9 = icmp eq i32 %8, 0
br label %10
10: ; preds = %7, %2
%11 = phi i1 [ false, %2 ], [ %9, %7 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @f8(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 9
%4 = icmp eq i32 %1, 0
%5 = and i1 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
void settings(void) {}


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

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

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

LLVM IR (-O2):
define void @settings() {
ret void
}
/* Variables and functions */
float sqrt(float);
float vectorlength(float *vec) {
  return (sqrt(vec[0] * vec[0] + vec[1] * vec[1] + vec[2] * vec[2]));
}


x86 assembly (clang, -O0):
<vectorlength>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm1
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm2
mov    -0x8(%rbp),%rax
movss  0x4(%rax),%xmm0
mov    -0x8(%rbp),%rax
mulss  0x4(%rax),%xmm0
mulss  %xmm2,%xmm1
addss  %xmm0,%xmm1
mov    -0x8(%rbp),%rax
movss  0x8(%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  0x8(%rax),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
call   1030 <sqrt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vectorlength>:
movss  (%rdi),%xmm1
movss  0x4(%rdi),%xmm0
mulss  %xmm0,%xmm0
mulss  %xmm1,%xmm1
addss  %xmm0,%xmm1
movss  0x8(%rdi),%xmm0
mulss  %xmm0,%xmm0
addss  %xmm1,%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jb     113f <vectorlength+0x2f>
sqrtss %xmm0,%xmm0
ret
jmp    1030 <sqrt@plt>

LLVM IR (-O0):
define float @vectorlength(float* %0) {
%2 = alloca float*
store float* %0, float** %2
%3 = load float*, float** %2
%4 = getelementptr inbounds float, float* %3, i64 0
%5 = load float, float* %4
%6 = load float*, float** %2
%7 = getelementptr inbounds float, float* %6, i64 0
%8 = load float, float* %7
%9 = load float*, float** %2
%10 = getelementptr inbounds float, float* %9, i64 1
%11 = load float, float* %10
%12 = load float*, float** %2
%13 = getelementptr inbounds float, float* %12, i64 1
%14 = load float, float* %13
%15 = fmul float %11, %14
%16 = call float @llvm.fmuladd.f32(float %5, float %8, float %15)
%17 = load float*, float** %2
%18 = getelementptr inbounds float, float* %17, i64 2
%19 = load float, float* %18
%20 = load float*, float** %2
%21 = getelementptr inbounds float, float* %20, i64 2
%22 = load float, float* %21
%23 = call float @llvm.fmuladd.f32(float %19, float %22, float %16)
%24 = call float @sqrt(float %23)
ret float %24
}

LLVM IR (-O2):
define float @vectorlength(float* nocapture %0) {
%2 = load float, float* %0
%3 = getelementptr inbounds float, float* %0, i64 1
%4 = load float, float* %3
%5 = fmul float %4, %4
%6 = tail call float @llvm.fmuladd.f32(float %2, float %2, float %5)
%7 = getelementptr inbounds float, float* %0, i64 2
%8 = load float, float* %7
%9 = tail call float @llvm.fmuladd.f32(float %8, float %8, float %6)
%10 = tail call float @sqrt(float %9)
ret float %10
}
void screen_update_colors(void) {}


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

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

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

LLVM IR (-O2):
define void @screen_update_colors() {
ret void
}
void mesa_highpc(void) {}


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

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

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

LLVM IR (-O2):
define void @mesa_highpc() {
ret void
}
float foo(float x, float y) { return !__builtin_isunordered(x, y) ? x : y; }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
ucomiss -0x8(%rbp),%xmm0
jp     112c <foo+0x2c>
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
jmp    1136 <foo+0x36>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
movaps %xmm0,%xmm2
cmpordss %xmm1,%xmm2
andps  %xmm2,%xmm0
andnps %xmm1,%xmm2
orps   %xmm2,%xmm0
ret

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

LLVM IR (-O2):
define float @foo(float %0, float %1) {
%3 = fcmp ord float %0, %1
%4 = select i1 %3, float %0, float %1
ret float %4
}
/* Variables and functions */
int fconf_istoken(char const, char);
int fconf_istoken_null(const char str) { return fconf_istoken(str, '\0'); }


x86 assembly (clang, -O0):
<fconf_istoken_null>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
xor    %esi,%esi
movsbl -0x1(%rbp),%edi
call   1030 <fconf_istoken@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @fconf_istoken_null(i8 signext %0) {
%2 = tail call i32 @fconf_istoken(i8 signext %0, i8 signext 0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void xfree(void *p) {
  if (p != NULL) {
    free(p);
  }
}


x86 assembly (clang, -O0):
<xfree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <xfree+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xfree>:
test   %rdi,%rdi
je     111a <xfree+0xa>
jmp    1030 <free@plt>
ret

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

LLVM IR (-O2):
define void @xfree(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i8* %0)
br label %5
5: ; preds = %3, %1
ret void
}
const struct exception_table_entry *search_module_extables(unsigned long addr) {
  return ((void *)0);
}


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

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

LLVM IR (-O0):
%struct.exception_table_entry = type opaque
define %struct.exception_table_entry* @search_module_extables(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
ret %struct.exception_table_entry* null
}

LLVM IR (-O2):
%struct.exception_table_entry = type opaque
define noalias %struct.exception_table_entry* @search_module_extables(i64 %0) {
ret %struct.exception_table_entry* null
}
/* Type definitions */
typedef int /*<<< orphan*/ X509_CRL_INFO;
typedef int /*<<< orphan*/ ASN1_VALUE;

/* Variables and functions */
scalar_t__ ASN1_item_d2i(int /*<<< orphan*/ **, unsigned char const **, long,
                         int /*<<< orphan*/ *);
int /*<<< orphan*/ X509_CRL_INFO_it;
X509_CRL_INFO *d2i_X509_CRL_INFO(X509_CRL_INFO **a, const unsigned char **in,
                                 long len) {
  return (X509_CRL_INFO *)ASN1_item_d2i((ASN1_VALUE **)a, in, len,
                                        &X509_CRL_INFO_it);
}


x86 assembly (clang, -O0):
<d2i_X509_CRL_INFO>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    0x2eb1(%rip),%rcx
call   1030 <ASN1_item_d2i@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<d2i_X509_CRL_INFO>:
mov    0x2ed1(%rip),%rcx
jmp    1030 <ASN1_item_d2i@plt>

LLVM IR (-O0):
@X509_CRL_INFO_it = global i32 0
define i32* @d2i_X509_CRL_INFO(i32** %0, i8** %1, i64 %2) {
%4 = alloca i32**
%5 = alloca i8**
%6 = alloca i64
store i32** %0, i32*** %4
store i8** %1, i8*** %5
store i64 %2, i64* %6
%7 = load i32**, i32*** %4
%8 = load i8**, i8*** %5
%9 = load i64, i64* %6
%10 = call i64 @ASN1_item_d2i(i32** %7, i8** %8, i64 %9, i32* @X509_CRL_INFO_it)
%11 = inttoptr i64 %10 to i32*
ret i32* %11
}

LLVM IR (-O2):
@X509_CRL_INFO_it = global i32 0
define i32* @d2i_X509_CRL_INFO(i32** %0, i8** %1, i64 %2) {
%4 = tail call i64 @ASN1_item_d2i(i32** %0, i8** %1, i64 %2, i32* @X509_CRL_INFO_it)
%5 = inttoptr i64 %4 to i32*
ret i32* %5
}
/* Variables and functions */
int fic(int);
int fib(int n) {
  if (n < 3)
    return 1;
  else
    return fib(n - 1) + fic(n - 2);
}


x86 assembly (clang, -O0):
<fib>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x3,-0x8(%rbp)
jge    1141 <fib+0x21>
movl   $0x1,-0x4(%rbp)
jmp    1164 <fib+0x44>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1040 <fib@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x2,%edi
call   1030 <fic@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fib>:
mov    $0x1,%eax
cmp    $0x2,%edi
jle    114b <fib+0x2b>
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
lea    -0x1(%rbx),%edi
call   1040 <fib@plt>
mov    %eax,%ebp
add    $0xfffffffe,%ebx
mov    %ebx,%edi
call   1030 <fic@plt>
add    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @fib(i32 %0) {
%2 = icmp slt i32 %0, 3
br i1 %2, label %3, label %5
3: ; preds = %1, %5
%4 = phi i32 [ %10, %5 ], [ 1, %1 ]
ret i32 %4
5: ; preds = %1
%6 = add nsw i32 %0, -1
%7 = tail call i32 @fib(i32 %6)
%8 = add nsw i32 %0, -2
%9 = tail call i32 @fic(i32 %8)
%10 = add nsw i32 %9, %7
br label %3
}
/* Variables and functions */
int musmidi_stop();
int mus_midi_stop(void) { return musmidi_stop(); }


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

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

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

LLVM IR (-O2):
define i32 @mus_midi_stop() {
%1 = tail call i32 (...) @musmidi_stop()
ret i32 %1
}
int mkostemp(template, flags)
char *template;
int flags;
{ return __gen_tempname(template, flags, 0); }


x86 assembly (clang, -O0):
<mkostemp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
xor    %edx,%edx
mov    $0x0,%al
call   1030 <__gen_tempname@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mkostemp>:
xor    %edx,%edx
xor    %eax,%eax
jmp    1030 <__gen_tempname@plt>

LLVM IR (-O0):
define i32 @mkostemp(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = call i32 (i8*, i32, i32, ...) bitcast (i32 (...)* @__gen_tempname to i32 (i8*, i32, i32, ...)*)(i8* %5, i32 %6, i32 0)
ret i32 %7
}

LLVM IR (-O2):
define i32 @mkostemp(i8* %0, i32 %1) {
%3 = tail call i32 (i8*, i32, i32, ...) bitcast (i32 (...)* @__gen_tempname to i32 (i8*, i32, i32, ...)*)(i8* %0, i32 %1, i32 0)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_break() { printf("-----\n"); }


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

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

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

LLVM IR (-O2):
@str = [6 x i8] c"-----\00"
define void @print_break() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
print_write_timeout() { printf("Write request timed out\n"); }


x86 assembly (clang, -O0):
<print_write_timeout>:
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):
<print_write_timeout>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"Write request timed out\0A\00"
define i32 @print_write_timeout() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [24 x i8] c"Write request timed out\00"
define i32 @print_write_timeout() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
void *u_mremap(void *addr, size_t old_len, size_t new_len, int flags, ...) {
  return NULL;
}


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

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

LLVM IR (-O0):
define i8* @u_mremap(i8* %0, i64 %1, i64 %2, i32 %3, ...) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i64
%8 = alloca i32
store i8* %0, i8** %5
store i64 %1, i64* %6
store i64 %2, i64* %7
store i32 %3, i32* %8
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @u_mremap(i8* nocapture readnone %0, i64 %1, i64 %2, i32 %3, ...) {
ret i8* null
}
void nada() {}


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

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

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

LLVM IR (-O2):
define void @nada() {
ret void
}