xunge/DecIR huggingface dataset:
/* Variables and functions */
double const sin(double const);
double metric_jacobian(const double x[3]) { return x[0] * x[0] * sin(x[2]); }


x86 assembly (clang, -O0):
<metric_jacobian>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
mulsd  (%rax),%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm0
call   1030 <sin@plt>
movaps %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
mulsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<metric_jacobian>:
push   %rax
movsd  (%rdi),%xmm1
movsd  0x10(%rdi),%xmm0
mulsd  %xmm1,%xmm1
movsd  %xmm1,(%rsp)
call   1030 <sin@plt>
mulsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @metric_jacobian(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load double*, double** %2
%4 = getelementptr inbounds double, double* %3, i64 0
%5 = load double, double* %4
%6 = load double*, double** %2
%7 = getelementptr inbounds double, double* %6, i64 0
%8 = load double, double* %7
%9 = fmul double %5, %8
%10 = load double*, double** %2
%11 = getelementptr inbounds double, double* %10, i64 2
%12 = load double, double* %11
%13 = call double @sin(double %12)
%14 = fmul double %9, %13
ret double %14
}

LLVM IR (-O2):
define double @metric_jacobian(double* nocapture %0) {
%2 = load double, double* %0
%3 = fmul double %2, %2
%4 = getelementptr inbounds double, double* %0, i64 2
%5 = load double, double* %4
%6 = tail call double @sin(double %5)
%7 = fmul double %3, %6
ret double %7
}
/* Variables and functions */
int /*<<< orphan*/ second(char *, char *);
int main() {
  char method[] = "helos";
  char stuff[] = "asfk";
  second(method, stuff);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xedb(%rip),%eax
mov    %eax,-0xa(%rbp)
mov    0xed5(%rip),%ax
mov    %ax,-0x6(%rbp)
mov    0xecd(%rip),%eax
mov    %eax,-0xf(%rbp)
mov    0xec8(%rip),%al
mov    %al,-0xb(%rbp)
lea    -0xa(%rbp),%rdi
lea    -0xf(%rbp),%rsi
call   1030 <second@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movw   $0x73,0x14(%rsp)
movl   $0x6f6c6568,0x10(%rsp)
6f
movb   $0x0,0xc(%rsp)
movl   $0x6b667361,0x8(%rsp)
6b
lea    0x10(%rsp),%rdi
lea    0x8(%rsp),%rsi
call   1030 <second@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.method = [6 x i8] c"helos\00"
@__const.main.stuff = [5 x i8] c"asfk\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [6 x i8]
%3 = alloca [5 x i8]
store i32 0, i32* %1
%4 = bitcast [6 x i8]* %2 to i8*
%5 = bitcast [5 x i8]* %3 to i8*
%6 = getelementptr inbounds [6 x i8], [6 x i8]* %2, i64 0, i64 0
%7 = getelementptr inbounds [5 x i8], [5 x i8]* %3, i64 0, i64 0
%8 = call i32 @second(i8* %6, i8* %7)
ret i32 0
}

LLVM IR (-O2):
@__const.main.method = [6 x i8] c"helos\00"
@__const.main.stuff = [5 x i8] c"asfk\00"
define i32 @main() {
%1 = alloca [6 x i8]
%2 = alloca [5 x i8]
%3 = getelementptr inbounds [6 x i8], [6 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [5 x i8], [5 x i8]* %2, i64 0, i64 0
%5 = call i32 @second(i8* %3, i8* %4)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ ptrdiff_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  switch (sizeof(ptrdiff_t)) {
  case 4:
    printf("%1d", 4);
    break;
  case 8:
    printf("%1d", 8);
    break;
  default:
    return 1;
  }
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%1d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 4)
ret i32 0
}
void jumped(void) { ; }


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @foo_with_used_attribute() {
ret void
}
/* Variables and functions */
int GET32(int);
unsigned int uart_check(void) {
  if (GET32(0x20215054) & 0x01) {
    return (1);
  }
  return (0);
}


x86 assembly (clang, -O0):
<uart_check>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x20215054,%edi
call   1030 <GET32@plt>
and    $0x1,%eax
cmp    $0x0,%eax
je     113a <uart_check+0x2a>
movl   $0x1,-0x4(%rbp)
jmp    1141 <uart_check+0x31>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uart_check>:
push   %rax
mov    $0x20215054,%edi
call   1030 <GET32@plt>
and    $0x1,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @uart_check() {
%1 = tail call i32 @GET32(i32 539054164)
%2 = and i32 %1, 1
ret i32 %2
}
int test_imm_88int8_reg(signed char val) {
  return ((val) & (-0x88 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_88int8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
and    $0xffffff78,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_88int8_reg(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = and i32 %2, -136
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
struct genlist_link {
  int dummy;
};
struct genlist {
  int dummy;
};
struct entry_list_link {
  int dummy;
};
struct entry_list {
  int dummy;
};
struct entry {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ genlist_insert_after(struct genlist *, struct entry *,
                                        struct genlist_link *);
void entry_list_insert_after(struct entry_list *tthis, struct entry *pfoo,
                             struct entry_list_link *plink) {
  genlist_insert_after((struct genlist *)tthis, pfoo,
                       (struct genlist_link *)plink);
}


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

x86 assembly (clang, -O2):
<entry_list_insert_after>:
jmp    1030 <genlist_insert_after@plt>

LLVM IR (-O0):
%struct.entry_list = type { i32 }
%struct.entry = type { i32 }
%struct.entry_list_link = type { i32 }
%struct.genlist = type { i32 }
%struct.genlist_link = type { i32 }
define void @entry_list_insert_after(%struct.entry_list* %0, %struct.entry* %1, %struct.entry_list_link* %2) {
%4 = alloca %struct.entry_list*
%5 = alloca %struct.entry*
%6 = alloca %struct.entry_list_link*
store %struct.entry_list* %0, %struct.entry_list** %4
store %struct.entry* %1, %struct.entry** %5
store %struct.entry_list_link* %2, %struct.entry_list_link** %6
%7 = load %struct.entry_list*, %struct.entry_list** %4
%8 = bitcast %struct.entry_list* %7 to %struct.genlist*
%9 = load %struct.entry*, %struct.entry** %5
%10 = load %struct.entry_list_link*, %struct.entry_list_link** %6
%11 = bitcast %struct.entry_list_link* %10 to %struct.genlist_link*
%12 = call i32 @genlist_insert_after(%struct.genlist* %8, %struct.entry* %9, %struct.genlist_link* %11)
ret void
}

LLVM IR (-O2):
%struct.entry_list = type { i32 }
%struct.entry = type { i32 }
%struct.entry_list_link = type { i32 }
%struct.genlist = type { i32 }
%struct.genlist_link = type { i32 }
define void @entry_list_insert_after(%struct.entry_list* %0, %struct.entry* %1, %struct.entry_list_link* %2) {
%4 = bitcast %struct.entry_list* %0 to %struct.genlist*
%5 = bitcast %struct.entry_list_link* %2 to %struct.genlist_link*
%6 = tail call i32 @genlist_insert_after(%struct.genlist* %4, %struct.entry* %1, %struct.genlist_link* %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
void netlink_close(int fd) { close(fd); }


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

x86 assembly (clang, -O2):
<netlink_close>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define void @netlink_close(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void display(int a[], int length) {
  int i = 0;
  for (; i <= length; i++)
    printf("%d ", a[i]);
  printf("\n");
}


x86 assembly (clang, -O0):
<display>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     1159 <display+0x49>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <display+0x16>
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<display>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
js     1157 <display+0x37>
mov    %esi,%r12d
mov    %rdi,%r14
add    $0x1,%r12d
lea    0xec3(%rip),%r15
xor    %ebx,%ebx
nop
mov    (%r14,%rbx,4),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <display+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%d \00"
@.str.1 = [2 x i8] c"\0A\00"
define void @display(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %17, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp sle i32 %7, %8
br i1 %9, label %10, label %20
10: ; preds = %6
%11 = load i32*, i32** %3
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i32, i32* %11, i64 %13
%15 = load i32, i32* %14
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %15)
br label %17
17: ; preds = %10
%18 = load i32, i32* %5
%19 = add nsw i32 %18, 1
store i32 %19, i32* %5
br label %6
20: ; preds = %6
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @display(i32* nocapture %0, i32 %1) {
%3 = icmp slt i32 %1, 0
br i1 %3, label %14, label %4
4: ; preds = %2
%5 = add nuw i32 %1, 1
%6 = zext i32 %5 to i64
br label %7
7: ; preds = %4, %7
%8 = phi i64 [ 0, %4 ], [ %12, %7 ]
%9 = getelementptr inbounds i32, i32* %0, i64 %8
%10 = load i32, i32* %9
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = add nuw nsw i64 %8, 1
%13 = icmp eq i64 %12, %6
br i1 %13, label %14, label %7
14: ; preds = %7, %2
%15 = tail call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ output_line(char *);
void gen_put_indirect(char typeobj) {
  output_line("puls x");
  if (typeobj & (1 << 2)) {
    output_line("stb ,x");
  } else {
    output_line("std ,x");
  }
}


x86 assembly (clang, -O0):
<gen_put_indirect>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
lea    0xedb(%rip),%rdi
call   1030 <output_line@plt>
movsbl -0x1(%rbp),%eax
and    $0x4,%eax
cmp    $0x0,%eax
je     114b <gen_put_indirect+0x3b>
lea    0xec6(%rip),%rdi
call   1030 <output_line@plt>
jmp    1157 <gen_put_indirect+0x47>
lea    0xebc(%rip),%rdi
call   1030 <output_line@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gen_put_indirect>:
push   %rbx
mov    %edi,%ebx
lea    0xee6(%rip),%rdi
call   1030 <output_line@plt>
test   $0x4,%bl
lea    0xee5(%rip),%rax
lea    0xed7(%rip),%rdi
cmove  %rax,%rdi
pop    %rbx
jmp    1030 <output_line@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"puls x\00"
@.str.1 = [7 x i8] c"stb ,x\00"
@.str.2 = [7 x i8] c"std ,x\00"
define void @gen_put_indirect(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = call i32 @output_line(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%4 = load i8, i8* %2
%5 = sext i8 %4 to i32
%6 = and i32 %5, 4
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 @output_line(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
br label %12
10: ; preds = %1
%11 = call i32 @output_line(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
br label %12
12: ; preds = %10, %8
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"puls x\00"
@.str.1 = [7 x i8] c"stb ,x\00"
@.str.2 = [7 x i8] c"std ,x\00"
define void @gen_put_indirect(i8 signext %0) {
%2 = tail call i32 @output_line(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%3 = and i8 %0, 4
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0)
%6 = tail call i32 @output_line(i8* %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ BootComCanInit();
int /*<<< orphan*/ BootComUartInit();
void BootComInit(void) {
  BootComUartInit();
  BootComCanInit();
}


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

x86 assembly (clang, -O2):
<BootComInit>:
push   %rax
xor    %eax,%eax
call   1030 <BootComUartInit@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <BootComCanInit@plt>

LLVM IR (-O0):
define void @BootComInit() {
%1 = call i32 (...) @BootComUartInit()
%2 = call i32 (...) @BootComCanInit()
ret void
}

LLVM IR (-O2):
define void @BootComInit() {
%1 = tail call i32 (...) @BootComUartInit()
%2 = tail call i32 (...) @BootComCanInit()
ret void
}
/* Variables and functions */
int strcmp(char const *, char const *);
int reverse_sort_callback(const void *pa, const void *pb) {
  const char **a = (const char **)pa;
  const char **b = (const char **)pb;
  return strcmp(*b, *a);
}


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

x86 assembly (clang, -O2):
<reverse_sort_callback>:
mov    (%rsi),%rax
mov    (%rdi),%rsi
mov    %rax,%rdi
jmp    1030 <strcmp@plt>

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

LLVM IR (-O2):
define i32 @reverse_sort_callback(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = bitcast i8* %1 to i8**
%5 = load i8*, i8** %4
%6 = load i8*, i8** %3
%7 = tail call i32 @strcmp(i8* dereferenceable(1) %5, i8* dereferenceable(1) %6)
ret i32 %7
}
/* Variables and functions */
int _convert_crlf_to_lf();
int main(int argc, char **argv, char **envp) { return _convert_crlf_to_lf(); }


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    %rdx,-0x18(%rbp)
mov    $0x0,%al
call   1030 <_convert_crlf_to_lf@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1, i8** %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8**
%7 = alloca i8**
store i32 0, i32* %4
store i32 %0, i32* %5
store i8** %1, i8*** %6
store i8** %2, i8*** %7
%8 = call i32 (...) @_convert_crlf_to_lf()
ret i32 %8
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1, i8** nocapture readnone %2) {
%4 = tail call i32 (...) @_convert_crlf_to_lf()
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int mod_init(void) {
  fprintf(stderr, "print - initializing\n");
  return 0;
}


x86 assembly (clang, -O0):
<mod_init>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mod_init>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [22 x i8] c"print - initializing\0A\00"
define i32 @mod_init() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [22 x i8] c"print - initializing\0A\00"
define i32 @mod_init() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
void ctl_reset(void) {}


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

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

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

LLVM IR (-O2):
define void @ctl_reset() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ die(char const *, int);
void die1(const char *message) { die(message, 1); }


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

x86 assembly (clang, -O2):
<die1>:
mov    $0x1,%esi
jmp    1030 <die@plt>

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

LLVM IR (-O2):
define void @die1(i8* %0) {
%2 = tail call i32 @die(i8* %0, i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void show_help(void) {
  printf("Usage: %s [OPTION]... [FILE]...\n Concatenate FILE(s), or standard "
         "input to standard output.\n\n Options:\n    -n, --number\tnumber "
         "lines\n    -u, --unbuffered\tsets stdout to be unbuffered\n    -h, "
         "--help\t\tdisplay this help\n    -V, --version\tdisplay version "
         "information\n\n Report bugs to <bulliver@gmail.com>\n",
         "cat");
}


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

x86 assembly (clang, -O2):
<show_help>:
lea    0xee9(%rip),%rdi
lea    0x1010(%rip),%rsi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [302 x i8] c"Usage: %s [OPTION]... [FILE]...\0A Concatenate FILE(s), or standard input to standard output.\0A\0A Options:\0A -n, --number\09number lines\0A -u, --unbuffered\09sets stdout to be unbuffered\0A -h, --help\09\09display this help\0A -V, --version\09display version information\0A\0A Report bugs to <bulliver@gmail.com>\0A\00"
@.str.1 = [4 x i8] c"cat\00"
define void @show_help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([302 x i8], [302 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [302 x i8] c"Usage: %s [OPTION]... [FILE]...\0A Concatenate FILE(s), or standard input to standard output.\0A\0A Options:\0A -n, --number\09number lines\0A -u, --unbuffered\09sets stdout to be unbuffered\0A -h, --help\09\09display this help\0A -V, --version\09display version information\0A\0A Report bugs to <bulliver@gmail.com>\0A\00"
@.str.1 = [4 x i8] c"cat\00"
define void @show_help() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([302 x i8], [302 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void usage() {
  printf("usage: lcs file_a file_b [ OPTIONS ]\n"
         "\t-o file3\n"
         "\t--size1 l\n"
         "\t--size2 l\n"
         "\t-s|--size l\n"
         "\t-d| --distance l\n");
  exit(0);
}


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

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

LLVM IR (-O0):
@.str = [101 x i8] c"usage: lcs file_a file_b [ OPTIONS ]\0A\09-o file3\0A\09--size1 l\0A\09--size2 l\0A\09-s|--size l\0A\09-d| --distance l\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([101 x i8], [101 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [100 x i8] c"usage: lcs file_a file_b [ OPTIONS ]\0A\09-o file3\0A\09--size1 l\0A\09--size2 l\0A\09-s|--size l\0A\09-d| --distance l\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([100 x i8], [100 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
void unsleep(void *p) { assert(0); }


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

x86 assembly (clang, -O2):
<unsleep>:
xor    %edi,%edi
jmp    1030 <assert@plt>

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

LLVM IR (-O2):
define void @unsleep(i8* nocapture readnone %0) {
%2 = tail call i32 @assert(i32 0)
ret void
}
void arm_mem_config_parse_entry(struct config_t *config, char *section) {}


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

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

LLVM IR (-O0):
%struct.config_t = type opaque
define void @arm_mem_config_parse_entry(%struct.config_t* %0, i8* %1) {
%3 = alloca %struct.config_t*
%4 = alloca i8*
store %struct.config_t* %0, %struct.config_t** %3
store i8* %1, i8** %4
ret void
}

LLVM IR (-O2):
%struct.config_t = type opaque
define void @arm_mem_config_parse_entry(%struct.config_t* nocapture %0, i8* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ trap_R_RegisterShaderNoMip(char *);
void TeamMain_Cache(void) {
  trap_R_RegisterShaderNoMip("menu/"
                             "art_blueish"
                             "/cut_frame");
}


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

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

LLVM IR (-O0):
@.str = [27 x i8] c"menu/art_blueish/cut_frame\00"
define void @TeamMain_Cache() {
%1 = call i32 @trap_R_RegisterShaderNoMip(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [27 x i8] c"menu/art_blueish/cut_frame\00"
define void @TeamMain_Cache() {
%1 = tail call i32 @trap_R_RegisterShaderNoMip(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
char xor_b(char *, char *);
signed char intr_wrap_532(signed char p1, signed char p2) {
  return xor_b(&p1, &p2);
}


x86 assembly (clang, -O0):
<intr_wrap_532>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
lea    -0x1(%rbp),%rdi
lea    -0x2(%rbp),%rsi
call   1030 <xor_b@plt>
movsbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<intr_wrap_532>:
push   %rax
mov    %dil,0x7(%rsp)
mov    %sil,0x6(%rsp)
lea    0x7(%rsp),%rdi
lea    0x6(%rsp),%rsi
call   1030 <xor_b@plt>
pop    %rcx
ret

LLVM IR (-O0):
define signext i8 @intr_wrap_532(i8 signext %0, i8 signext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = call signext i8 @xor_b(i8* %3, i8* %4)
ret i8 %5
}

LLVM IR (-O2):
define signext i8 @intr_wrap_532(i8 signext %0, i8 signext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = call signext i8 @xor_b(i8* %3, i8* %4)
ret i8 %5
}
int do_479() { return 479; }


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

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

LLVM IR (-O0):
define i32 @do_479() {
ret i32 479
}

LLVM IR (-O2):
define i32 @do_479() {
ret i32 479
}
unsigned long mhs_diff_time(unsigned long now, unsigned long stamp) {
  if (stamp > now)
    return ((0xFFFFFFFF - stamp) + now + 1);
  else
    return (now - stamp);
}


x86 assembly (clang, -O0):
<mhs_diff_time>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jbe    1134 <mhs_diff_time+0x34>
mov    $0xffffffff,%eax
sub    -0x18(%rbp),%rax
add    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1140 <mhs_diff_time+0x40>
mov    -0x10(%rbp),%rax
sub    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mhs_diff_time>:
movabs $0x100000000,%rax
add    %rdi,%rax
cmp    %rsi,%rdi
cmovae %rdi,%rax
sub    %rsi,%rax
ret

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

LLVM IR (-O2):
define i64 @mhs_diff_time(i64 %0, i64 %1) {
%3 = icmp ult i64 %0, %1
%4 = add i64 %0, 4294967296
%5 = select i1 %3, i64 %4, i64 %0
%6 = sub i64 %5, %1
ret i64 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char **argv) {
  int age = 10;
  int height = 72;
  printf("I am %d years old.\n", age);
  printf("I am %d inches tall.\n", height);
  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)
movl   $0xa,-0x14(%rbp)
movl   $0x48,-0x18(%rbp)
mov    -0x14(%rbp),%esi
lea    0xec2(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%esi
lea    0xec7(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [20 x i8] c"I am %d years old.\0A\00"
@.str.1 = [22 x i8] c"I am %d inches tall.\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 10, i32* %6
store i32 72, i32* %7
%8 = load i32, i32* %6
%9 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = load i32, i32* %7
%11 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [20 x i8] c"I am %d years old.\0A\00"
@.str.1 = [22 x i8] c"I am %d inches tall.\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 10)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 72)
ret i32 0
}
/* Variables and functions */
int try_parse_int_imp(char *, void *, int, int);
bool try_parse_ulong(char *str, unsigned long *value_ptr) {
  return try_parse_int_imp(str, (void *)value_ptr, sizeof(unsigned long),
                           false);
}


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

x86 assembly (clang, -O2):
<try_parse_ulong>:
mov    $0x8,%edx
xor    %ecx,%ecx
jmp    1030 <try_parse_int_imp@plt>

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

LLVM IR (-O2):
define i32 @try_parse_ulong(i8* %0, i64* %1) {
%3 = bitcast i64* %1 to i8*
%4 = tail call i32 @try_parse_int_imp(i8* %0, i8* %3, i32 8, i32 0)
ret i32 %4
}
unsigned long long f3(unsigned long long x) {
  if (x >= 0x7fffffffffffffffULL)
    x = 0x7fffffffffffffffULL;
  return x;
}


x86 assembly (clang, -O0):
<f3>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movabs $0x7fffffffffffffff,%rax
ff ff 7f
cmp    %rax,-0x8(%rbp)
jb     112a <f3+0x2a>
movabs $0x7fffffffffffffff,%rax
ff ff 7f
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f3>:
movabs $0x7fffffffffffffff,%rax
ff ff 7f
cmp    %rax,%rdi
cmovb  %rdi,%rax
ret

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

LLVM IR (-O2):
define i64 @f3(i64 %0) {
%2 = icmp ult i64 %0, 9223372036854775807
%3 = select i1 %2, i64 %0, i64 9223372036854775807
ret i64 %3
}
void WaitMs(unsigned int ms) {
  int i;
  while (ms-- > 0) {
    for (i = 0; i < 3276; ++i)
      asm("nop");
  }
}


x86 assembly (clang, -O0):
<WaitMs>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x4(%rbp)
cmp    $0x0,%eax
jbe    1143 <WaitMs+0x43>
movl   $0x0,-0x8(%rbp)
cmpl   $0xccc,-0x8(%rbp)
jge    113e <WaitMs+0x3e>
nop
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <WaitMs+0x22>
jmp    1107 <WaitMs+0x7>
pop    %rbp
ret

x86 assembly (clang, -O2):
<WaitMs>:
test   %edi,%edi
je     112b <WaitMs+0x2b>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    $0xccc,%eax
cs nopw 0x0(%rax,%rax,1)
nop
nop
add    $0xffffffff,%eax
jne    1120 <WaitMs+0x20>
add    $0xffffffff,%edi
jne    1110 <WaitMs+0x10>
ret

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

LLVM IR (-O2):
define void @WaitMs(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %12, label %6
3: ; preds = %8
%4 = add i32 %7, -1
%5 = icmp eq i32 %4, 0
br i1 %5, label %12, label %6
6: ; preds = %1, %3
%7 = phi i32 [ %4, %3 ], [ %0, %1 ]
br label %8
8: ; preds = %6, %8
%9 = phi i32 [ 0, %6 ], [ %10, %8 ]
tail call void asm sideeffect "nop", "~{dirflag},~{fpsr},~{flags}"()
%10 = add nuw nsw i32 %9, 1
%11 = icmp eq i32 %10, 3276
br i1 %11, label %3, label %8
12: ; preds = %3, %1
ret void
}
OP(fd, c8) { op_c8(); }


x86 assembly (clang, -O0):
<OP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x0,%al
call   1030 <op_c8@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @op_c8()
ret i32 undef
}
void f_object_all(void) {
  printf("%s(%d)\n", __func__, 38);
  ;
}


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

x86 assembly (clang, -O2):
<f_object_all>:
lea    0xee9(%rip),%rdi
lea    0xeea(%rip),%rsi
mov    $0x26,%edx
xor    %eax,%eax
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [8 x i8] c"%s(%d)\0A\00"
@__func__.f_object_all = [13 x i8] c"f_object_all\00"
define void @f_object_all() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @__func__.f_object_all, i64 0, i64 0), i32 38)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ SYS_write;
int /*<<< orphan*/ syscall(int /*<<< orphan*/, int, void const *, size_t);
ssize_t gotcha_write(int fd, const void *buf, size_t count) {
  return syscall(SYS_write, fd, buf, count);
}


x86 assembly (clang, -O0):
<gotcha_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0x2ebe(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
call   1030 <syscall@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gotcha_write>:
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %edi,%esi
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
@SYS_write = global i32 0
define i32 @gotcha_write(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* @SYS_write
%8 = load i32, i32* %4
%9 = load i8*, i8** %5
%10 = load i64, i64* %6
%11 = call i32 @syscall(i32 %7, i32 %8, i8* %9, i64 %10)
ret i32 %11
}

LLVM IR (-O2):
@SYS_write = global i32 0
define i32 @gotcha_write(i32 %0, i8* %1, i64 %2) {
%4 = load i32, i32* @SYS_write
%5 = tail call i32 @syscall(i32 %4, i32 %0, i8* %1, i64 %2)
ret i32 %5
}
/* Variables and functions */
char const *strerror(int);
const char *xs_err_strerror(int errnum) {
  switch (errnum) {
  case (156384712 + 53):
    return "XS library was terminated";
  default:
    return strerror(errnum);
  }
}


x86 assembly (clang, -O0):
<xs_err_strerror>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sub    $0x9523dfd,%eax
jne    113e <xs_err_strerror+0x2e>
jmp    112e <xs_err_strerror+0x1e>
lea    0xecb(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    114a <xs_err_strerror+0x3a>
mov    -0xc(%rbp),%edi
call   1030 <strerror@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xs_err_strerror>:
cmp    $0x9523dfd,%edi
jne    1120 <xs_err_strerror+0x10>
lea    0xee1(%rip),%rax
ret
jmp    1030 <strerror@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"XS library was terminated\00"
define i8* @xs_err_strerror(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %6 [
i32 156384765, label %5
]
5: ; preds = %1
store i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8** %2
br label %9
6: ; preds = %1
%7 = load i32, i32* %3
%8 = call i8* @strerror(i32 %7)
store i8* %8, i8** %2
br label %9
9: ; preds = %6, %5
%10 = load i8*, i8** %2
ret i8* %10
}

LLVM IR (-O2):
@.str = [26 x i8] c"XS library was terminated\00"
define i8* @xs_err_strerror(i32 %0) {
%2 = icmp eq i32 %0, 156384765
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i8* @strerror(i32 %0)
br label %5
5: ; preds = %1, %3
%6 = phi i8* [ %4, %3 ], [ getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), %1 ]
ret i8* %6
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ fgets(char *, size_t, int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char const *, char *);
void read_value_str(const char *path, char *str, size_t len) {
  FILE *file = fopen(path, "r");
  if (file != NULL) {
    fgets(str, len, file);
    fclose(file);
  }
}


x86 assembly (clang, -O0):
<read_value_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xeb1(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     117d <read_value_str+0x4d>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1040 <fgets@plt>
mov    -0x20(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_value_str>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%r15
lea    0xebe(%rip),%rsi
call   1050 <fopen@plt>
test   %rax,%rax
je     116a <read_value_str+0x3a>
mov    %rax,%rbx
mov    %r15,%rdi
mov    %r14,%rsi
mov    %rax,%rdx
call   1040 <fgets@plt>
mov    %rbx,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <fclose@plt>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
define void @read_value_str(i8* nocapture %0, i8* %1, i64 %2) {
%4 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%5 = icmp eq i32* %4, null
br i1 %5, label %9, label %6
6: ; preds = %3
%7 = tail call i32 @fgets(i8* %1, i64 %2, i32* %4)
%8 = tail call i32 @fclose(i32* %4)
br label %9
9: ; preds = %6, %3
ret void
}
int numwidth(unsigned long n) {
  int width = 0;
  do {
    width++;
  } while ((n /= 10) > 0);
  return width;
}


x86 assembly (clang, -O0):
<numwidth>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    $0xa,%ecx
xor    %edx,%edx
div    %rcx
mov    %rax,-0x8(%rbp)
cmp    $0x0,%rax
ja     110f <numwidth+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<numwidth>:
xor    %ecx,%ecx
movabs $0xcccccccccccccccd,%rsi
cc cc cc
nopl   0x0(%rax)
add    $0x1,%ecx
mov    %rdi,%rax
mul    %rsi
shr    $0x3,%rdx
cmp    $0x9,%rdi
mov    %rdx,%rdi
ja     1110 <numwidth+0x10>
mov    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @numwidth(i64 %0) {
%2 = alloca i64
%3 = alloca i32
store i64 %0, i64* %2
store i32 0, i32* %3
br label %4
4: ; preds = %7, %1
%5 = load i32, i32* %3
%6 = add nsw i32 %5, 1
store i32 %6, i32* %3
br label %7
7: ; preds = %4
%8 = load i64, i64* %2
%9 = udiv i64 %8, 10
store i64 %9, i64* %2
%10 = icmp ugt i64 %9, 0
br i1 %10, label %4, label %11
11: ; preds = %7
%12 = load i32, i32* %3
ret i32 %12
}

LLVM IR (-O2):
define i32 @numwidth(i64 %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %0, %1 ], [ %6, %2 ]
%4 = phi i32 [ 0, %1 ], [ %5, %2 ]
%5 = add nuw nsw i32 %4, 1
%6 = udiv i64 %3, 10
%7 = icmp ult i64 %3, 10
br i1 %7, label %8, label %2
8: ; preds = %2
ret i32 %5
}
/* Variables and functions */
char *MPIU_Strdup(char *);
void utarray_str_cpy(void *dst, const void *src) {
  char **_src = (char **)src, **_dst = (char **)dst;
  *_dst = (*_src == NULL) ? NULL : MPIU_Strdup(*_src);
}


x86 assembly (clang, -O0):
<utarray_str_cpy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
cmpq   $0x0,(%rax)
jne    1149 <utarray_str_cpy+0x39>
xor    %eax,%eax
mov    %rax,-0x28(%rbp)
jmp    1159 <utarray_str_cpy+0x49>
mov    -0x18(%rbp),%rax
mov    (%rax),%rdi
call   1030 <MPIU_Strdup@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,(%rax)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<utarray_str_cpy>:
push   %rbx
mov    %rdi,%rbx
mov    (%rsi),%rdi
test   %rdi,%rdi
je     1123 <utarray_str_cpy+0x13>
call   1030 <MPIU_Strdup@plt>
jmp    1125 <utarray_str_cpy+0x15>
xor    %eax,%eax
mov    %rax,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @utarray_str_cpy(i8* nocapture writeonly %0, i8* nocapture %1) {
%3 = bitcast i8* %1 to i8**
%4 = load i8*, i8** %3
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i8* @MPIU_Strdup(i8* %4)
br label %8
8: ; preds = %2, %6
%9 = phi i8* [ %7, %6 ], [ null, %2 ]
%10 = bitcast i8* %0 to i8**
store i8* %9, i8** %10
ret void
}
int __attribute__((target("arch=ivybridge"))) prev_no_target(void) { return 2; }


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

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

LLVM IR (-O0):
define i32 @prev_no_target() {
ret i32 2
}

LLVM IR (-O2):
define i32 @prev_no_target() {
ret i32 2
}
void ge_helper_print_vdo_framebuf(void *vfb) { (void)(vfb); }


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

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

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

LLVM IR (-O2):
define void @ge_helper_print_vdo_framebuf(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
void comms_disconnect(int socketfd) { close(socketfd); }


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

x86 assembly (clang, -O2):
<comms_disconnect>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define void @comms_disconnect(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret void
}
char *fixslash(char *pszFilename) {
  char *psz = pszFilename;
  while ((psz = strchr(psz, '\\')) != ((void *)0))
    *psz++ = '/';
  return pszFilename;
}


x86 assembly (clang, -O0):
<fixslash>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x5c,%esi
call   1030 <strchr@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
je     1157 <fixslash+0x47>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movb   $0x2f,(%rax)
jmp    1124 <fixslash+0x14>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fixslash>:
push   %rbx
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    $0x5c,%esi
call   1030 <strchr@plt>
test   %rax,%rax
je     113b <fixslash+0x2b>
movb   $0x2f,(%rax)
add    $0x1,%rax
mov    %rax,%rdi
jmp    1120 <fixslash+0x10>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @fixslash(i8* returned %0) {
%2 = tail call i8* @strchr(i8* dereferenceable(1) %0, i32 92)
%3 = icmp eq i8* %2, null
br i1 %3, label %9, label %4
4: ; preds = %1, %4
%5 = phi i8* [ %7, %4 ], [ %2, %1 ]
%6 = getelementptr inbounds i8, i8* %5, i64 1
store i8 47, i8* %5
%7 = tail call i8* @strchr(i8* dereferenceable(1) %6, i32 92)
%8 = icmp eq i8* %7, null
br i1 %8, label %9, label %4
9: ; preds = %4, %1
ret i8* %0
}