xunge/DecIR huggingface dataset:
const char *basename(const char *filename) {
  const char *result = filename;
  for (; *filename; filename++) {
    if (*filename == '/')
      result = filename;
  }
  if (*result == '/')
    result++;
  return result;
}


x86 assembly (clang, -O0):
<basename>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     114b <basename+0x4b>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2f,%eax
jne    1135 <basename+0x35>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    113a <basename+0x3a>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1110 <basename+0x10>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2f,%eax
jne    1167 <basename+0x67>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<basename>:
mov    %rdi,%rcx
jmp    1117 <basename+0x17>
cs nopw 0x0(%rax,%rax,1)
nop
mov    %rdi,%rcx
add    $0x1,%rdi
movzbl (%rdi),%eax
cmp    $0x2f,%al
je     1110 <basename+0x10>
test   %al,%al
jne    1113 <basename+0x13>
xor    %eax,%eax
cmpb   $0x2f,(%rcx)
sete   %al
add    %rcx,%rax
ret

LLVM IR (-O0):
define i8* @basename(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 = %17, %1
%6 = load i8*, i8** %2
%7 = load i8, i8* %6
%8 = icmp ne i8 %7, 0
br i1 %8, label %9, label %20
9: ; preds = %5
%10 = load i8*, i8** %2
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 47
br i1 %13, label %14, label %16
14: ; preds = %9
%15 = load i8*, i8** %2
store i8* %15, i8** %3
br label %16
16: ; preds = %14, %9
br label %17
17: ; preds = %16
%18 = load i8*, i8** %2
%19 = getelementptr inbounds i8, i8* %18, i32 1
store i8* %19, i8** %2
br label %5
20: ; preds = %5
%21 = load i8*, i8** %3
%22 = load i8, i8* %21
%23 = sext i8 %22 to i32
%24 = icmp eq i32 %23, 47
br i1 %24, label %25, label %28
25: ; preds = %20
%26 = load i8*, i8** %3
%27 = getelementptr inbounds i8, i8* %26, i32 1
store i8* %27, i8** %3
br label %28
28: ; preds = %25, %20
%29 = load i8*, i8** %3
ret i8* %29
}

LLVM IR (-O2):
define i8* @basename(i8* %0) {
br label %2
2: ; preds = %7, %1
%3 = phi i8* [ %0, %1 ], [ %9, %7 ]
%4 = phi i8* [ %0, %1 ], [ %8, %7 ]
%5 = load i8, i8* %3
switch i8 %5, label %7 [
i8 0, label %10
i8 47, label %6
]
6: ; preds = %2
br label %7
7: ; preds = %2, %6
%8 = phi i8* [ %3, %6 ], [ %4, %2 ]
%9 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
10: ; preds = %2
%11 = load i8, i8* %4
%12 = icmp eq i8 %11, 47
%13 = zext i1 %12 to i64
%14 = getelementptr i8, i8* %4, i64 %13
ret i8* %14
}
/* Variables and functions */
int /*<<< orphan*/ absolutex();
int /*<<< orphan*/ readmemw65816(int /*<<< orphan*/);
int /*<<< orphan*/ sbc16(int /*<<< orphan*/);
void sbcAbsx16(void) { sbc16(readmemw65816(absolutex())); }


x86 assembly (clang, -O0):
<sbcAbsx16>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <absolutex@plt>
mov    %eax,%edi
call   1030 <readmemw65816@plt>
mov    %eax,%edi
call   1050 <sbc16@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<sbcAbsx16>:
push   %rax
xor    %eax,%eax
call   1040 <absolutex@plt>
mov    %eax,%edi
call   1030 <readmemw65816@plt>
mov    %eax,%edi
pop    %rax
jmp    1050 <sbc16@plt>

LLVM IR (-O0):
define void @sbcAbsx16() {
%1 = call i32 (...) @absolutex()
%2 = call i32 @readmemw65816(i32 %1)
%3 = call i32 @sbc16(i32 %2)
ret void
}

LLVM IR (-O2):
define void @sbcAbsx16() {
%1 = tail call i32 (...) @absolutex()
%2 = tail call i32 @readmemw65816(i32 %1)
%3 = tail call i32 @sbc16(i32 %2)
ret void
}
void g_ptr_array_new() {}


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

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

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

LLVM IR (-O2):
define void @g_ptr_array_new() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ FaultSettingsHandle();
int /*<<< orphan*/ UAVObjLogging(int /*<<< orphan*/);
void FaultSettingsLogging() { UAVObjLogging(FaultSettingsHandle()); }


x86 assembly (clang, -O0):
<FaultSettingsLogging>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <FaultSettingsHandle@plt>
mov    %eax,%edi
call   1030 <UAVObjLogging@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<FaultSettingsLogging>:
push   %rax
xor    %eax,%eax
call   1040 <FaultSettingsHandle@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <UAVObjLogging@plt>

LLVM IR (-O0):
define void @FaultSettingsLogging() {
%1 = call i32 (...) @FaultSettingsHandle()
%2 = call i32 @UAVObjLogging(i32 %1)
ret void
}

LLVM IR (-O2):
define void @FaultSettingsLogging() {
%1 = tail call i32 (...) @FaultSettingsHandle()
%2 = tail call i32 @UAVObjLogging(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void error() {
  printf("sorry something bad append :\\ \n");
  exit(1);
}


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

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

LLVM IR (-O0):
@.str = [32 x i8] c"sorry something bad append :\\ \0A\00"
define void @error() {
%1 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@str = [31 x i8] c"sorry something bad append :\\ \00"
define void @error() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ gets(char *);
int /*<<< orphan*/ printf(char *);
int sscanf(char *, char *, int *);
int get_integer(void) {
  int val;
  int valid_input;
  char inbuf[133];
  while (valid_input < 1) {
    printf("Enter an integer: ");
    gets(inbuf);
    valid_input = sscanf(inbuf, "%d", &val);
  }
  return val;
}


x86 assembly (clang, -O0):
<get_integer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
cmpl   $0x1,-0x8(%rbp)
jge    117c <get_integer+0x4c>
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
lea    -0x90(%rbp),%rdi
call   1040 <gets@plt>
lea    -0x90(%rbp),%rdi
lea    0xea8(%rip),%rsi
lea    -0x4(%rbp),%rdx
call   1050 <sscanf@plt>
mov    %eax,-0x8(%rbp)
jmp    113b <get_integer+0xb>
mov    -0x4(%rbp),%eax
add    $0x90,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [19 x i8] c"Enter an integer: \00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @get_integer() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [133 x i8]
br label %4
4: ; preds = %7, %0
%5 = load i32, i32* %2
%6 = icmp slt i32 %5, 1
br i1 %6, label %7, label %13
7: ; preds = %4
%8 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%9 = getelementptr inbounds [133 x i8], [133 x i8]* %3, i64 0, i64 0
%10 = call i32 @gets(i8* %9)
%11 = getelementptr inbounds [133 x i8], [133 x i8]* %3, i64 0, i64 0
%12 = call i32 @sscanf(i8* %11, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
store i32 %12, i32* %2
br label %4
13: ; preds = %4
%14 = load i32, i32* %1
ret i32 %14
}

LLVM IR (-O2):
define i32 @get_integer() {
ret i32 undef
}
void crashlog_init_mem(struct bootmem_data *bdata) {}


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

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

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

LLVM IR (-O2):
%struct.bootmem_data = type opaque
define void @crashlog_init_mem(%struct.bootmem_data* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void printArray(int A[], int n) {
  int i;
  for (i = 0; i < n; i++) {
    printf("%d ", A[i]);
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<printArray>:
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
jge    1159 <printArray+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 <printArray+0x16>
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printArray>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1157 <printArray+0x37>
mov    %rdi,%r15
mov    %esi,%r12d
lea    0xec7(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <printArray+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 @printArray(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 slt 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 @printArray(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
%14 = tail call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
unsigned int __ticks_per_usec();
unsigned clock_to_usecs(unsigned x) { return ((x) / __ticks_per_usec()); }


x86 assembly (clang, -O0):
<clock_to_usecs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <__ticks_per_usec@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
xor    %edx,%edx
div    %ecx
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clock_to_usecs>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <__ticks_per_usec@plt>
mov    %eax,%ecx
mov    %ebx,%eax
xor    %edx,%edx
div    %ecx
pop    %rbx
ret

LLVM IR (-O0):
define i32 @clock_to_usecs(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 (...) @__ticks_per_usec()
%5 = udiv i32 %3, %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @clock_to_usecs(i32 %0) {
%2 = tail call i32 (...) @__ticks_per_usec()
%3 = udiv i32 %0, %2
ret i32 %3
}
/* Variables and functions */
scalar_t__ errno;
int /*<<< orphan*/ fatal(char *, char const *);
long strtol(char const *, int /*<<< orphan*/ *, int);
long safe_cstring_to_long(const char *text) {
  errno = 0;
  long result = strtol(text, NULL, 10);
  if (errno != 0)
    fatal("safe_cstring_to_long: conversion of \"%s\" to long failed.", text);
  return result;
}


x86 assembly (clang, -O0):
<safe_cstring_to_long>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
movq   $0x0,(%rax)
mov    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0xa,%edx
call   1030 <strtol@plt>
mov    %rax,-0x10(%rbp)
mov    0x2e89(%rip),%rax
cmpq   $0x0,(%rax)
je     1171 <safe_cstring_to_long+0x51>
mov    -0x8(%rbp),%rsi
lea    0xe94(%rip),%rdi
call   1040 <fatal@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<safe_cstring_to_long>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%rbx
mov    0x2eb1(%rip),%r15
movq   $0x0,(%r15)
xor    %esi,%esi
mov    $0xa,%edx
call   1030 <strtol@plt>
mov    %rax,%r14
cmpq   $0x0,(%r15)
je     115a <safe_cstring_to_long+0x3a>
lea    0xeae(%rip),%rdi
mov    %rbx,%rsi
call   1040 <fatal@plt>
mov    %r14,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@errno = global i64 0
@.str = [57 x i8] c"safe_cstring_to_long: conversion of \22%s\22 to long failed.\00"
define i64 @safe_cstring_to_long(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
store i8* %0, i8** %2
store i64 0, i64* @errno
%4 = load i8*, i8** %2
%5 = call i64 @strtol(i8* %4, i32* null, i32 10)
store i64 %5, i64* %3
%6 = load i64, i64* @errno
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load i8*, i8** %2
%10 = call i32 @fatal(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0), i8* %9)
br label %11
11: ; preds = %8, %1
%12 = load i64, i64* %3
ret i64 %12
}

LLVM IR (-O2):
@errno = global i64 0
@.str = [57 x i8] c"safe_cstring_to_long: conversion of \22%s\22 to long failed.\00"
define i64 @safe_cstring_to_long(i8* %0) {
store i64 0, i64* @errno
%2 = tail call i64 @strtol(i8* nocapture %0, i32* null, i32 10)
%3 = load i64, i64* @errno
%4 = icmp eq i64 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 @fatal(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %7
7: ; preds = %5, %1
ret i64 %2
}
void slow_copy_page(void *to, void *from) {
  int d0, d1, d2;
  __asm__ __volatile__("cld\n\t"
                       "rep ; movsl"
                       : "=&c"(d0), "=&D"(d1), "=&S"(d2)
                       : "0"(1024), "1"((long)to), "2"((long)from)
                       : "memory");
}


x86 assembly (clang, -O0):
<slow_copy_page>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x400,%ecx
cld
rep movsl %ds:(%rsi),%es:(%rdi)
mov    %ecx,-0x14(%rbp)
mov    %edi,%eax
mov    %eax,-0x18(%rbp)
mov    %esi,%eax
mov    %eax,-0x1c(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<slow_copy_page>:
mov    $0x400,%ecx
cld
rep movsl %ds:(%rsi),%es:(%rdi)
ret

LLVM IR (-O0):
define void @slow_copy_page(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%8 = load i8*, i8** %3
%9 = ptrtoint i8* %8 to i64
%10 = load i8*, i8** %4
%11 = ptrtoint i8* %10 to i64
%12 = call { i32, i64, i64 } asm sideeffect "cld\0A\09rep ; movsl", "=&{cx},=&{di},=&{si},0,1,2,~{memory},~{dirflag},~{fpsr},~{flags}"(i32 1024, i64 %9, i64 %11)
%13 = extractvalue { i32, i64, i64 } %12, 0
%14 = extractvalue { i32, i64, i64 } %12, 1
%15 = extractvalue { i32, i64, i64 } %12, 2
store i32 %13, i32* %5
%16 = trunc i64 %14 to i32
store i32 %16, i32* %6
%17 = trunc i64 %15 to i32
store i32 %17, i32* %7
ret void
}

LLVM IR (-O2):
define void @slow_copy_page(i8* %0, i8* %1) {
%3 = ptrtoint i8* %0 to i64
%4 = ptrtoint i8* %1 to i64
%5 = tail call { i32, i64, i64 } asm sideeffect "cld\0A\09rep ; movsl", "=&{cx},=&{di},=&{si},0,1,2,~{memory},~{dirflag},~{fpsr},~{flags}"(i32 1024, i64 %3, i64 %4)
ret void
}
void synchronize_rcu(void) {}


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

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

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

LLVM IR (-O2):
define void @synchronize_rcu() {
ret void
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  printf("Enter a number: ");
  return EXIT_SUCCESS;
}


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

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

LLVM IR (-O0):
@.str = [17 x i8] c"Enter a number: \00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* @EXIT_SUCCESS
ret i32 %7
}

LLVM IR (-O2):
@.str = [17 x i8] c"Enter a number: \00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @EXIT_SUCCESS
ret i32 %4
}
void EVP_PKEY_new(void) {}


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

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

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

LLVM IR (-O2):
define void @EVP_PKEY_new() {
ret void
}
int __syscall1(int call, unsigned long arg0) {
  int rc;
  __asm__ volatile("movl %[call], %%eax	\n"
                   "movl %[arg0], %%ebx	\n"
                   "int  %[xnum]		\n"
                   "movl %%eax, %[rc]	\n"
                   : [rc] "=g"(rc)
                   : [call] "g"(call), [arg0] "g"(arg0), [xnum] "i"(0x80)
                   : "%eax", "%ebx", "memory");
  return rc;
}


x86 assembly (clang, -O0):
<__syscall1>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %edi,-0xc(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,-0x20(%rbp)
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%eax
mov    -0x28(%rbp),%ebx
int    $0x80
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
LLVM IR (-O0):
define i32 @__syscall1(i32 %0, i64 %1) {
%3 = alloca i32
%4 = alloca i64
%5 = alloca i32
store i32 %0, i32* %3
store i64 %1, i64* %4
%6 = load i32, i32* %3
%7 = load i64, i64* %4
%8 = load i32, i32* %5
ret i32 %8
}

LLVM IR (-O2):
__attribute__((pure)) _Complex long double foo_ldouble_t(int x) {
  _Complex long double r;
  __real r = x + 1;
  __imag r = x - 1;
  return r;
}


x86 assembly (clang, -O0):
<foo_ldouble_t>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x24(%rbp)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x58(%rbp)
fildl  -0x58(%rbp)
fstpt  -0x50(%rbp)
mov    -0x24(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x54(%rbp)
fildl  -0x54(%rbp)
fstpt  -0x40(%rbp)
fldt   -0x50(%rbp)
fldt   -0x40(%rbp)
fxch   %st(1)
fstpt  -0x20(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
fldt   -0x20(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo_ldouble_t>:
lea    0x1(%rdi),%eax
mov    %eax,-0x4(%rsp)
fildl  -0x4(%rsp)
add    $0xffffffff,%edi
mov    %edi,-0x8(%rsp)
fildl  -0x8(%rsp)
fxch   %st(1)
ret

LLVM IR (-O0):
define { x86_fp80, x86_fp80 } @foo_ldouble_t(i32 %0) {
%2 = alloca { x86_fp80, x86_fp80 }
%3 = alloca i32
%4 = alloca { x86_fp80, x86_fp80 }
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = add nsw i32 %5, 1
%7 = sitofp i32 %6 to x86_fp80
%8 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %4, i32 0, i32 0
store x86_fp80 %7, x86_fp80* %8
%9 = load i32, i32* %3
%10 = sub nsw i32 %9, 1
%11 = sitofp i32 %10 to x86_fp80
%12 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %4, i32 0, i32 1
store x86_fp80 %11, x86_fp80* %12
%13 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %4, i32 0, i32 0
%14 = load x86_fp80, x86_fp80* %13
%15 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %4, i32 0, i32 1
%16 = load x86_fp80, x86_fp80* %15
%17 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %2, i32 0, i32 0
%18 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %2, i32 0, i32 1
store x86_fp80 %14, x86_fp80* %17
store x86_fp80 %16, x86_fp80* %18
%19 = load { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %2
ret { x86_fp80, x86_fp80 } %19
}

LLVM IR (-O2):
define { x86_fp80, x86_fp80 } @foo_ldouble_t(i32 %0) {
%2 = add nsw i32 %0, 1
%3 = sitofp i32 %2 to x86_fp80
%4 = add nsw i32 %0, -1
%5 = sitofp i32 %4 to x86_fp80
%6 = insertvalue { x86_fp80, x86_fp80 } poison, x86_fp80 %3, 0
%7 = insertvalue { x86_fp80, x86_fp80 } %6, x86_fp80 %5, 1
ret { x86_fp80, x86_fp80 } %7
}
void foo555() {}


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

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

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

LLVM IR (-O2):
define void @foo555() {
ret void
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
int spiTransfer(int, int);
uint16_t spiVTransfer(int fd, int port) {
  uint16_t retVal;
  retVal = spiTransfer(fd, port);
  return (retVal * 64);
}


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

x86 assembly (clang, -O2):
<spiVTransfer>:
push   %rax
call   1030 <spiTransfer@plt>
shl    $0x6,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @spiVTransfer(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = call i32 @spiTransfer(i32 %6, i32 %7)
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = mul nsw i32 %9, 64
ret i32 %10
}

LLVM IR (-O2):
define i32 @spiVTransfer(i32 %0, i32 %1) {
%3 = tail call i32 @spiTransfer(i32 %0, i32 %1)
%4 = shl nsw i32 %3, 6
ret i32 %4
}
unsigned int bam_swap_endian_4(unsigned int v) {
  v = ((v & 0x0000FFFFU) << 16) | (v >> 16);
  return ((v & 0x00FF00FFU) << 8) | ((v & 0xFF00FF00U) >> 8);
}


x86 assembly (clang, -O0):
<bam_swap_endian_4>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xffff,%eax
shl    $0x10,%eax
mov    -0x4(%rbp),%ecx
shr    $0x10,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff00ff,%eax
shl    $0x8,%eax
mov    -0x4(%rbp),%ecx
and    $0xff00ff00,%ecx
shr    $0x8,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bam_swap_endian_4>:
mov    %edi,%eax
bswap  %eax
ret

LLVM IR (-O0):
define i32 @bam_swap_endian_4(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 65535
%5 = shl i32 %4, 16
%6 = load i32, i32* %2
%7 = lshr i32 %6, 16
%8 = or i32 %5, %7
store i32 %8, i32* %2
%9 = load i32, i32* %2
%10 = and i32 %9, 16711935
%11 = shl i32 %10, 8
%12 = load i32, i32* %2
%13 = and i32 %12, -16711936
%14 = lshr i32 %13, 8
%15 = or i32 %11, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @bam_swap_endian_4(i32 %0) {
%2 = tail call i32 @llvm.bswap.i32(i32 %0)
ret i32 %2
}
char *strcat(char *dest, char const *src) {
  char *x;
  return x;
}


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

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

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

LLVM IR (-O2):
define noalias i8* @strcat(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i8* undef
}
/* Variables and functions */
int /*<<< orphan*/ addFoncT(char *, void (*)(), int /*<<< orphan*/, int);
void addFonD(char *l, void (*f)(void)) { addFoncT(l, f, 0, 16); }


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

x86 assembly (clang, -O2):
<addFonD>:
xor    %edx,%edx
mov    $0x10,%ecx
jmp    1030 <addFoncT@plt>

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

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


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

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

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

LLVM IR (-O2):
@str = [3 x i8] c"\0A}\00"
define void @doc_end() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0))
ret void
}
char *tgoto(char *cstring, int hpos, int vpos) { return ""; }


x86 assembly (clang, -O0):
<tgoto>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
lea    0xeeb(%rip),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i8* @tgoto(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
ret i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i8* @tgoto(i8* nocapture readnone %0, i32 %1, i32 %2) {
ret i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0)
}
int main() {
  double a = -1;
  double b = 1;
  double X[30 + 1];
  double Fx[30 + 1];
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x190,%rsp
movsd  0xef5(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  0xee0(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
xor    %eax,%eax
add    $0x190,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca double
%2 = alloca double
%3 = alloca [31 x double]
%4 = alloca [31 x double]
store double -1.000000e+00, double* %1
store double 1.000000e+00, double* %2
ret i32 0
}

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

/* Variables and functions */
int /*<<< orphan*/ RLIMIT_STACK;
int /*<<< orphan*/ getrlimit(int /*<<< orphan*/, struct rlimit *);
int /*<<< orphan*/ setrlimit(int /*<<< orphan*/, struct rlimit *);
main() {
  struct rlimit rip;
  getrlimit(RLIMIT_STACK, &rip);
  setrlimit(RLIMIT_STACK, &rip);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2eb1(%rip),%rax
mov    (%rax),%edi
lea    -0x8(%rbp),%rsi
call   1040 <getrlimit@plt>
mov    0x2e9f(%rip),%rax
mov    (%rax),%edi
lea    -0x8(%rbp),%rsi
call   1030 <setrlimit@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    0x2eb5(%rip),%r14
mov    (%r14),%edi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1040 <getrlimit@plt>
mov    (%r14),%edi
mov    %rbx,%rsi
call   1030 <setrlimit@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.rlimit = type { i32 }
@RLIMIT_STACK = global i32 0
define i32 @main() {
%1 = alloca %struct.rlimit
%2 = load i32, i32* @RLIMIT_STACK
%3 = call i32 @getrlimit(i32 %2, %struct.rlimit* %1)
%4 = load i32, i32* @RLIMIT_STACK
%5 = call i32 @setrlimit(i32 %4, %struct.rlimit* %1)
ret i32 0
}

LLVM IR (-O2):
%struct.rlimit = type { i32 }
@RLIMIT_STACK = global i32 0
define i32 @main() {
%1 = alloca %struct.rlimit
%2 = bitcast %struct.rlimit* %1 to i8*
%3 = load i32, i32* @RLIMIT_STACK
%4 = call i32 @getrlimit(i32 %3, %struct.rlimit* %1)
%5 = load i32, i32* @RLIMIT_STACK
%6 = call i32 @setrlimit(i32 %5, %struct.rlimit* %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fputc(char, int /*<<< orphan*/);
int /*<<< orphan*/ putstr(char const *);
int /*<<< orphan*/ stdout;
void diag(const char *msg) {
  fputc(('#'), stdout);
  fputc((' '), stdout);
  putstr(msg);
  fputc(('\n'), stdout);
}


x86 assembly (clang, -O0):
<diag>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%esi
mov    $0x23,%edi
call   1030 <fputc@plt>
mov    0x2e9a(%rip),%rax
mov    (%rax),%esi
mov    $0x20,%edi
call   1030 <fputc@plt>
mov    -0x8(%rbp),%rdi
call   1040 <putstr@plt>
mov    0x2e7e(%rip),%rax
mov    (%rax),%esi
mov    $0xa,%edi
call   1030 <fputc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<diag>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2eb2(%rip),%r14
mov    (%r14),%esi
mov    $0x23,%edi
call   1030 <fputc@plt>
mov    (%r14),%esi
mov    $0x20,%edi
call   1030 <fputc@plt>
mov    %rbx,%rdi
call   1040 <putstr@plt>
mov    (%r14),%esi
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <fputc@plt>

LLVM IR (-O0):
@stdout = global i32 0
define void @diag(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stdout
%4 = call i32 @fputc(i8 signext 35, i32 %3)
%5 = load i32, i32* @stdout
%6 = call i32 @fputc(i8 signext 32, i32 %5)
%7 = load i8*, i8** %2
%8 = call i32 @putstr(i8* %7)
%9 = load i32, i32* @stdout
%10 = call i32 @fputc(i8 signext 10, i32 %9)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
define void @diag(i8* %0) {
%2 = load i32, i32* @stdout
%3 = tail call i32 @fputc(i8 signext 35, i32 %2)
%4 = load i32, i32* @stdout
%5 = tail call i32 @fputc(i8 signext 32, i32 %4)
%6 = tail call i32 @putstr(i8* %0)
%7 = load i32, i32* @stdout
%8 = tail call i32 @fputc(i8 signext 10, i32 %7)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ EDIPARTYNAME;

/* Variables and functions */
scalar_t__ ASN1_item_new(int /*<<< orphan*/ *);
int /*<<< orphan*/ EDIPARTYNAME_it;
EDIPARTYNAME *EDIPARTYNAME_new(void) {
  return (EDIPARTYNAME *)ASN1_item_new(&EDIPARTYNAME_it);
}


x86 assembly (clang, -O0):
<EDIPARTYNAME_new>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rdi
call   1030 <ASN1_item_new@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<EDIPARTYNAME_new>:
mov    0x2ec9(%rip),%rdi
jmp    1030 <ASN1_item_new@plt>

LLVM IR (-O0):
@EDIPARTYNAME_it = global i32 0
define i32* @EDIPARTYNAME_new() {
%1 = call i64 @ASN1_item_new(i32* @EDIPARTYNAME_it)
%2 = inttoptr i64 %1 to i32*
ret i32* %2
}

LLVM IR (-O2):
@EDIPARTYNAME_it = global i32 0
define i32* @EDIPARTYNAME_new() {
%1 = tail call i64 @ASN1_item_new(i32* @EDIPARTYNAME_it)
%2 = inttoptr i64 %1 to i32*
ret i32* %2
}
int main(int argc, char *argv[]) {
  const int n = argc;
  typedef double *matrix_t[n];
  matrix_t AH[n];
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0x14(%rbp),%ecx
mov    %rsp,%rdx
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %rax,-0x30(%rbp)
movl   $0x0,-0x4(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i64
%9 = alloca i64
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%10 = load i32, i32* %4
store i32 %10, i32* %6
%11 = load i32, i32* %6
%12 = zext i32 %11 to i64
%13 = load i32, i32* %6
%14 = zext i32 %13 to i64
%15 = call i8* @llvm.stacksave()
store i8* %15, i8** %7
%16 = mul nuw i64 %14, %12
%17 = alloca double*, i64 %16
store i64 %14, i64* %8
store i64 %12, i64* %9
store i32 0, i32* %3
%18 = load i8*, i8** %7
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int eaplogin(char const *, char const *);
int eaprefresh(char const *uname, char const *pwd) {
  return eaplogin(uname, pwd);
}


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

x86 assembly (clang, -O2):
<eaprefresh>:
jmp    1030 <eaplogin@plt>

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

LLVM IR (-O2):
define i32 @eaprefresh(i8* %0, i8* %1) {
%3 = tail call i32 @eaplogin(i8* %0, i8* %1)
ret i32 %3
}
/* Variables and functions */
scalar_t__ isalnum(char);
int iskey(char c) { return (isalnum(c) || c == '_'); }


x86 assembly (clang, -O0):
<iskey>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <isalnum@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x2(%rbp)
jne    1146 <iskey+0x36>
movsbl -0x1(%rbp),%eax
cmp    $0x5f,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iskey>:
push   %rbx
mov    %edi,%ebx
call   1030 <isalnum@plt>
test   %rax,%rax
setne  %al
cmp    $0x5f,%bl
sete   %cl
or     %al,%cl
movzbl %cl,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @iskey(i8 signext %0) {
%2 = tail call i64 @isalnum(i8 signext %0)
%3 = icmp ne i64 %2, 0
%4 = icmp eq i8 %0, 95
%5 = or i1 %4, %3
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
char *hello();
int /*<<< orphan*/ printf(char *, char *);
int main() {
  printf("Hello %s\n", hello());
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <hello@plt>
lea    0xed1(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [10 x i8] c"Hello %s\0A\00"
define i32 @main() {
%1 = tail call i8* (...) @hello()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %1)
ret i32 0
}
int tolower(int ch) {
  if (ch >= 'A' && ch <= 'Z') {
    return ch + ('a' - 'A');
  }
  return ch;
}


x86 assembly (clang, -O0):
<tolower>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x41,-0x8(%rbp)
jl     1129 <tolower+0x29>
cmpl   $0x5a,-0x8(%rbp)
jg     1129 <tolower+0x29>
mov    -0x8(%rbp),%eax
add    $0x20,%eax
mov    %eax,-0x4(%rbp)
jmp    112f <tolower+0x2f>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tolower>:
lea    -0x41(%rdi),%ecx
lea    0x20(%rdi),%eax
cmp    $0x1a,%ecx
cmovae %edi,%eax
ret

LLVM IR (-O0):
define i32 @tolower(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sge i32 %4, 65
br i1 %5, label %6, label %12
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp sle i32 %7, 90
br i1 %8, label %9, label %12
9: ; preds = %6
%10 = load i32, i32* %3
%11 = add nsw i32 %10, 32
store i32 %11, i32* %2
br label %14
12: ; preds = %6, %1
%13 = load i32, i32* %3
store i32 %13, i32* %2
br label %14
14: ; preds = %12, %9
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
define i32 @tolower(i32 %0) {
%2 = add i32 %0, -65
%3 = icmp ult i32 %2, 26
%4 = add nsw i32 %0, 32
%5 = select i1 %3, i32 %4, i32 %0
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fileno(int /*<<< orphan*/ *);
int elhash_fileno(FILE *f) { return fileno(f); }


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

x86 assembly (clang, -O2):
<elhash_fileno>:
jmp    1030 <fileno@plt>

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

LLVM IR (-O2):
define i32 @elhash_fileno(i32* nocapture %0) {
%2 = tail call i32 @fileno(i32* %0)
ret i32 %2
}
/* Variables and functions */
int yywrap(void) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @yywrap() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ init_grpci();
int /*<<< orphan*/ pci_allocate_resources();
void init_pci() {
  init_grpci();
  pci_allocate_resources();
}


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

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

LLVM IR (-O0):
define void @init_pci() {
%1 = call i32 (...) @init_grpci()
%2 = call i32 (...) @pci_allocate_resources()
ret void
}

LLVM IR (-O2):
define void @init_pci() {
%1 = tail call i32 (...) @init_grpci()
%2 = tail call i32 (...) @pci_allocate_resources()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void dg_panic(const char *msg) {
  fprintf(stderr, "[dungen] %s\n", msg);
  exit(1);
}


x86 assembly (clang, -O0):
<dg_panic>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<dg_panic>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [13 x i8] c"[dungen] %s\0A\00"
define void @dg_panic(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [13 x i8] c"[dungen] %s\0A\00"
define void @dg_panic(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int SIGUSR1;
int SIGUSR2;
int /*<<< orphan*/ printf(char *);
void sig_usr(int signo) {
  if (signo == SIGUSR1) {
    printf("caughted SIGUSR1\n");
  }
  if (signo == SIGUSR2) {
    printf("CAUGHTED SIGUSR2\n");
  }
}


x86 assembly (clang, -O0):
<sig_usr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    0x2ec3(%rip),%rcx
cmp    (%rcx),%eax
jne    1139 <sig_usr+0x29>
lea    0xecc(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
mov    0x2e95(%rip),%rcx
cmp    (%rcx),%eax
jne    1157 <sig_usr+0x47>
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sig_usr>:
push   %rbx
mov    %edi,%ebx
mov    0x2ece(%rip),%rax
cmp    %edi,(%rax)
jne    112a <sig_usr+0x1a>
lea    0xeec(%rip),%rdi
call   1030 <puts@plt>
mov    0x2ea7(%rip),%rax
cmp    %ebx,(%rax)
jne    1142 <sig_usr+0x32>
lea    0xec4(%rip),%rdi
pop    %rbx
jmp    1030 <puts@plt>
pop    %rbx
ret

LLVM IR (-O0):
@SIGUSR1 = global i32 0
@.str = [18 x i8] c"caughted SIGUSR1\0A\00"
@SIGUSR2 = global i32 0
@.str.1 = [18 x i8] c"CAUGHTED SIGUSR2\0A\00"
define void @sig_usr(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @SIGUSR1
%5 = icmp eq i32 %3, %4
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %1
%9 = load i32, i32* %2
%10 = load i32, i32* @SIGUSR2
%11 = icmp eq i32 %9, %10
br i1 %11, label %12, label %14
12: ; preds = %8
%13 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
br label %14
14: ; preds = %12, %8
ret void
}

LLVM IR (-O2):
@SIGUSR1 = global i32 0
@SIGUSR2 = global i32 0
@str = [17 x i8] c"CAUGHTED SIGUSR2\00"
@str.2 = [17 x i8] c"caughted SIGUSR1\00"
define void @sig_usr(i32 %0) {
%2 = load i32, i32* @SIGUSR1
%3 = icmp eq i32 %2, %0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.2, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
%7 = load i32, i32* @SIGUSR2
%8 = icmp eq i32 %7, %0
br i1 %8, label %9, label %11
9: ; preds = %6
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
br label %11
11: ; preds = %9, %6
ret void
}
/* Variables and functions */
int /*<<< orphan*/ f(int);
int /*<<< orphan*/ printf(char *, int);
void g(int x) {
  printf("g(%d)\n", x);
  if (x > 1)
    f(x - 1);
}


x86 assembly (clang, -O0):
<g>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xecb(%rip),%rdi
call   1040 <printf@plt>
cmpl   $0x1,-0x4(%rbp)
jle    114f <g+0x2f>
mov    -0x4(%rbp),%edi
sub    $0x1,%edi
call   1030 <f@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<g>:
push   %rbx
mov    %edi,%ebx
lea    0xed6(%rip),%rdi
mov    %ebx,%esi
call   1040 <printf@plt>
cmp    $0x2,%ebx
jl     1141 <g+0x21>
add    $0xffffffff,%ebx
mov    %ebx,%edi
pop    %rbx
jmp    1030 <f@plt>
pop    %rbx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"g(%d)\0A\00"
define void @g(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = load i32, i32* %2
%6 = icmp sgt i32 %5, 1
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = load i32, i32* %2
%9 = sub nsw i32 %8, 1
%10 = call i32 @f(i32 %9)
br label %11
11: ; preds = %7, %1
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"g(%d)\0A\00"
define void @g(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %0)
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = add nsw i32 %0, -1
%6 = tail call i32 @f(i32 %5)
br label %7
7: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void internalerror() {
  printf("  Please report this bug to jrs@cs.cmu.edu\n");
  printf("  Include the message above, your input data set, and the exact\n");
  printf("    command line you used to run Triangle.\n");
  exit(1);
}


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

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

LLVM IR (-O0):
@.str = [44 x i8] c" Please report this bug to jrs@cs.cmu.edu\0A\00"
@.str.1 = [65 x i8] c" Include the message above, your input data set, and the exact\0A\00"
@.str.2 = [44 x i8] c" command line you used to run Triangle.\0A\00"
define void @internalerror() {
%1 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@str = [43 x i8] c" Please report this bug to jrs@cs.cmu.edu\00"
@str.3 = [64 x i8] c" Include the message above, your input data set, and the exact\00"
@str.4 = [43 x i8] c" command line you used to run Triangle.\00"
define void @internalerror() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([64 x i8], [64 x i8]* @str.3, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @str.4, i64 0, i64 0))
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ DCP_DriverIRQHandler();
__attribute__((weak)) void DCP_IRQHandler(void) { DCP_DriverIRQHandler(); }


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

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

LLVM IR (-O0):
define weak void @DCP_IRQHandler() {
%1 = call i32 (...) @DCP_DriverIRQHandler()
ret void
}

LLVM IR (-O2):
define weak void @DCP_IRQHandler() {
%1 = tail call i32 (...) @DCP_DriverIRQHandler()
ret void
}