xunge/DecIR huggingface dataset:
/* Variables and functions */
unsigned int arikkei_memcpy_str(unsigned char *, unsigned int,
                                unsigned char const *);
unsigned int arikkei_strncpy(unsigned char *d, unsigned int d_len,
                             const unsigned char *s) {
  unsigned int len = arikkei_memcpy_str(d, d_len, s);
  if ((len < d_len) && d)
    d[len] = 0;
  return len + 1;
}


x86 assembly (clang, -O0):
<arikkei_strncpy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
call   1030 <arikkei_memcpy_str@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0xc(%rbp),%eax
jae    1158 <arikkei_strncpy+0x48>
cmpq   $0x0,-0x8(%rbp)
je     1158 <arikkei_strncpy+0x48>
mov    -0x8(%rbp),%rax
mov    -0x1c(%rbp),%ecx
movb   $0x0,(%rax,%rcx,1)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<arikkei_strncpy>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1030 <arikkei_memcpy_str@plt>
test   %rbx,%rbx
je     112c <arikkei_strncpy+0x1c>
cmp    %ebp,%eax
jae    112c <arikkei_strncpy+0x1c>
mov    %eax,%ecx
movb   $0x0,(%rbx,%rcx,1)
add    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @arikkei_strncpy(i8* %0, i32 %1, i8* %2) {
%4 = tail call i32 @arikkei_memcpy_str(i8* %0, i32 %1, i8* %2)
%5 = icmp ult i32 %4, %1
%6 = icmp ne i8* %0, null
%7 = and i1 %6, %5
br i1 %7, label %8, label %11
8: ; preds = %3
%9 = zext i32 %4 to i64
%10 = getelementptr inbounds i8, i8* %0, i64 %9
store i8 0, i8* %10
br label %11
11: ; preds = %8, %3
%12 = add i32 %4, 1
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ c_function(int);
int /*<<< orphan*/ printf(char *, int);
int test_add(int, int);
int /*<<< orphan*/ test_function();
int main(void) {
  printf("2 + 4 = %d\n", test_add(2, 4));
  test_function();
  c_function(2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x2,%edi
mov    $0x4,%esi
call   1050 <test_add@plt>
mov    %eax,%esi
lea    0xe99(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1060 <test_function@plt>
mov    $0x2,%edi
call   1030 <c_function@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x2,%edi
mov    $0x4,%esi
call   1050 <test_add@plt>
lea    0xea9(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
call   1060 <test_function@plt>
mov    $0x2,%edi
call   1030 <c_function@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [12 x i8] c"2 + 4 = %d\0A\00"
define i32 @main() {
%1 = tail call i32 @test_add(i32 2, i32 4)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 (...) @test_function()
%4 = tail call i32 @c_function(i32 2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_make_fd_nonblock() {
  printf("NOT IMPLEMENTED:"
         "pa_make_fd_nonblock"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [37 x i8] c"NOT IMPLEMENTED:pa_make_fd_nonblock\0A\00"
define i32 @pa_make_fd_nonblock() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [36 x i8] c"NOT IMPLEMENTED:pa_make_fd_nonblock\00"
define i32 @pa_make_fd_nonblock() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
int isrune(c)
int c;
{ return (__sbistype(c, 0xFFFFFF00L)); }


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

x86 assembly (clang, -O2):
<isrune>:
mov    $0xffffff00,%esi
xor    %eax,%eax
jmp    1030 <__sbistype@plt>

LLVM IR (-O0):
define i32 @isrune(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 (i32, i64, ...) bitcast (i32 (...)* @__sbistype to i32 (i32, i64, ...)*)(i32 %3, i64 4294967040)
ret i32 %4
}

LLVM IR (-O2):
define i32 @isrune(i32 %0) {
%2 = tail call i32 (i32, i64, ...) bitcast (i32 (...)* @__sbistype to i32 (i32, i64, ...)*)(i32 %0, i64 4294967040)
ret i32 %2
}
/* Variables and functions */
char *__my_strchrnul(char const *, int);
char *my_strchr(const char *s, int c) {
  char *r = __my_strchrnul(s, c);
  return *(unsigned char *)r == (unsigned char)c ? r : 0;
}


x86 assembly (clang, -O0):
<my_strchr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <__my_strchrnul@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movzbl (%rax),%eax
mov    -0xc(%rbp),%ecx
movzbl %cl,%ecx
cmp    %ecx,%eax
jne    1151 <my_strchr+0x41>
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
jmp    115c <my_strchr+0x4c>
xor    %eax,%eax
mov    %rax,-0x20(%rbp)
jmp    115c <my_strchr+0x4c>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_strchr>:
push   %rbx
mov    %esi,%ebx
call   1030 <__my_strchrnul@plt>
xor    %ecx,%ecx
cmp    %bl,(%rax)
cmovne %rcx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @my_strchr(i8* %0, i32 %1) {
%3 = tail call i8* @__my_strchrnul(i8* %0, i32 %1)
%4 = load i8, i8* %3
%5 = trunc i32 %1 to i8
%6 = icmp eq i8 %4, %5
%7 = select i1 %6, i8* %3, i8* null
ret i8* %7
}
/* Variables and functions */
int /*<<< orphan*/ func1();
int /*<<< orphan*/ printf(char *, int);
int main() {
  int i = 3;
  printf("[in main] i = %d\n", i);
  func1();
  printf("[back in main] i = %d\n", i);
}


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

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

LLVM IR (-O0):
@.str = [18 x i8] c"[in main] i = %d\0A\00"
@.str.1 = [23 x i8] c"[back in main] i = %d\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 3, i32* %1
%2 = load i32, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = call i32 (...) @func1()
%5 = load i32, i32* %1
%6 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [18 x i8] c"[in main] i = %d\0A\00"
@.str.1 = [23 x i8] c"[back in main] i = %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 3)
%2 = tail call i32 (...) @func1()
%3 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i32 3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
void control_shutdown(int fd) { close(fd); }


x86 assembly (clang, -O0):
<control_shutdown>:
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):
<control_shutdown>:
jmp    1030 <close@plt>

LLVM IR (-O0):
define void @control_shutdown(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 @control_shutdown(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ ASSERT(int);
void USBHighSpeed(uint32_t ui32Base, bool bEnable) {
  ASSERT(ui32Base == 0x40050000);
  if (bEnable) {
    (*((volatile uint8_t *)(ui32Base + 0x00000001))) |= 0x00000020;
  } else {
    (*((volatile uint8_t *)(ui32Base + 0x00000001))) &= ~0x00000020;
  }
}


x86 assembly (clang, -O0):
<USBHighSpeed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x40050000,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <ASSERT@plt>
cmpl   $0x0,-0x8(%rbp)
je     1150 <USBHighSpeed+0x40>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
cltq
mov    (%rax),%ecx
or     $0x20,%ecx
mov    %ecx,(%rax)
jmp    115f <USBHighSpeed+0x4f>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
cltq
mov    (%rax),%ecx
and    $0xffffffdf,%ecx
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<USBHighSpeed>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
xor    %ebp,%ebp
test   %esi,%esi
setne  %bpl
xor    %edi,%edi
cmp    $0x40050000,%ebx
sete   %dil
call   1030 <ASSERT@plt>
movslq %ebx,%rax
mov    0x1(%rax),%ecx
and    $0xffffffdf,%ecx
shl    $0x5,%ebp
or     %ecx,%ebp
mov    %ebp,0x1(%rax)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @USBHighSpeed(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = icmp eq i32 %5, 1074069504
%7 = zext i1 %6 to i32
%8 = call i32 @ASSERT(i32 %7)
%9 = load i32, i32* %4
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %18
11: ; preds = %2
%12 = load i32, i32* %3
%13 = add nsw i32 %12, 1
%14 = sext i32 %13 to i64
%15 = inttoptr i64 %14 to i32*
%16 = load volatile i32, i32* %15
%17 = or i32 %16, 32
store volatile i32 %17, i32* %15
br label %25
18: ; preds = %2
%19 = load i32, i32* %3
%20 = add nsw i32 %19, 1
%21 = sext i32 %20 to i64
%22 = inttoptr i64 %21 to i32*
%23 = load volatile i32, i32* %22
%24 = and i32 %23, -33
store volatile i32 %24, i32* %22
br label %25
25: ; preds = %18, %11
ret void
}

LLVM IR (-O2):
define void @USBHighSpeed(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 1074069504
%4 = zext i1 %3 to i32
%5 = tail call i32 @ASSERT(i32 %4)
%6 = icmp eq i32 %1, 0
%7 = add nsw i32 %0, 1
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to i32*
%10 = load volatile i32, i32* %9
%11 = and i32 %10, -33
%12 = select i1 %6, i32 0, i32 32
%13 = or i32 %11, %12
store volatile i32 %13, i32* %9
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, ...);
int main() {
  long w = L'W';
  char *s = "W";
  int i;
  if (w != s[0]) {
    {
      printf("Error %d\n", (int)1);
      exit(1);
    };
  }
  {
    printf("Success\n");
    exit(0);
  };
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x57,-0x10(%rbp)
lea    0xec2(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
movsbq (%rcx),%rcx
cmp    %rcx,%rax
je     1174 <main+0x54>
lea    0xea4(%rip),%rdi
mov    $0x1,%esi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
lea    0xe91(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@.str = [2 x i8] c"W\00"
@.str.1 = [10 x i8] c"Error %d\0A\00"
@.str.2 = [9 x i8] c"Success\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i8*
%4 = alloca i32
store i32 0, i32* %1
store i64 87, i64* %2
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8** %3
%5 = load i64, i64* %2
%6 = load i8*, i8** %3
%7 = getelementptr inbounds i8, i8* %6, i64 0
%8 = load i8, i8* %7
%9 = sext i8 %8 to i64
%10 = icmp ne i64 %5, %9
br i1 %10, label %11, label %14
11: ; preds = %0
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 1)
%13 = call i32 @exit(i32 1)
unreachable
14: ; preds = %0
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
%16 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [8 x i8] c"Success\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 0)
unreachable
}
void drawItemScreen() {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @wrap_mgr() {
ret void
}
int qq(int x) { return x + 40; }


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

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

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

LLVM IR (-O2):
define i32 @qq(i32 %0) {
%2 = add nsw i32 %0, 40
ret i32 %2
}
long SPIDataPutNonBlocking(unsigned long ulBase, unsigned long ulData) {

  ;
  if ((*((volatile unsigned long *)(ulBase + 0x00000008))) & 0x00000002) {
    (*((volatile unsigned long *)(ulBase + 0x0000000C))) = ulData;
    return (1);
  } else {
    return (0);
  }
}


x86 assembly (clang, -O0):
<SPIDataPutNonBlocking>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
and    $0x2,%rax
cmp    $0x0,%rax
je     113b <SPIDataPutNonBlocking+0x3b>
mov    -0x18(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,0xc(%rax)
movq   $0x1,-0x8(%rbp)
jmp    1143 <SPIDataPutNonBlocking+0x43>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SPIDataPutNonBlocking>:
testq  $0x2,0x8(%rdi)
jne    110d <SPIDataPutNonBlocking+0xd>
xor    %eax,%eax
ret
mov    %rsi,0xc(%rdi)
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i64 @SPIDataPutNonBlocking(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* %4
%7 = add i64 %6, 8
%8 = inttoptr i64 %7 to i64*
%9 = load volatile i64, i64* %8
%10 = and i64 %9, 2
%11 = icmp ne i64 %10, 0
br i1 %11, label %12, label %17
12: ; preds = %2
%13 = load i64, i64* %5
%14 = load i64, i64* %4
%15 = add i64 %14, 12
%16 = inttoptr i64 %15 to i64*
store volatile i64 %13, i64* %16
store i64 1, i64* %3
br label %18
17: ; preds = %2
store i64 0, i64* %3
br label %18
18: ; preds = %17, %12
%19 = load i64, i64* %3
ret i64 %19
}

LLVM IR (-O2):
define i64 @SPIDataPutNonBlocking(i64 %0, i64 %1) {
%3 = add i64 %0, 8
%4 = inttoptr i64 %3 to i64*
%5 = load volatile i64, i64* %4
%6 = and i64 %5, 2
%7 = icmp eq i64 %6, 0
br i1 %7, label %11, label %8
8: ; preds = %2
%9 = add i64 %0, 12
%10 = inttoptr i64 %9 to i64*
store volatile i64 %1, i64* %10
br label %11
11: ; preds = %2, %8
%12 = phi i64 [ 1, %8 ], [ 0, %2 ]
ret i64 %12
}
/* Variables and functions */
int partition(int *, int, int);
void sort(int *nums, int low, int high) {
  if (low > high)
    return;
  int mid = partition(nums, low, high);
  sort(nums, low, mid - 1);
  sort(nums, mid + 1, high);
}


x86 assembly (clang, -O0):
<sort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    1143 <sort+0x23>
jmp    1179 <sort+0x59>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <partition@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
sub    $0x1,%edx
call   1040 <sort@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%edx
call   1040 <sort@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sort>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
cmp    %edx,%esi
jg     1164 <sort+0x44>
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,%r15
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r15,%rdi
mov    %ebp,%esi
mov    %r14d,%edx
call   1030 <partition@plt>
mov    %eax,%ebx
lea    -0x1(%rbx),%edx
mov    %r15,%rdi
mov    %ebp,%esi
call   1040 <sort@plt>
lea    0x1(%rbx),%ebp
cmp    %r14d,%ebx
jl     1140 <sort+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @sort(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = icmp sgt i32 %8, %9
br i1 %10, label %11, label %12
11: ; preds = %3
br label %25
12: ; preds = %3
%13 = load i32*, i32** %4
%14 = load i32, i32* %5
%15 = load i32, i32* %6
%16 = call i32 @partition(i32* %13, i32 %14, i32 %15)
store i32 %16, i32* %7
%17 = load i32*, i32** %4
%18 = load i32, i32* %5
%19 = load i32, i32* %7
%20 = sub nsw i32 %19, 1
%21 = load i32*, i32** %4
%22 = load i32, i32* %7
%23 = add nsw i32 %22, 1
%24 = load i32, i32* %6
br label %25
25: ; preds = %12, %11
ret void
}

LLVM IR (-O2):
define void @sort(i32* %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %1, %2
br i1 %4, label %11, label %5
5: ; preds = %3, %5
%6 = phi i32 [ %9, %5 ], [ %1, %3 ]
%7 = tail call i32 @partition(i32* %0, i32 %6, i32 %2)
%8 = add nsw i32 %7, -1
tail call void @sort(i32* %0, i32 %6, i32 %8)
%9 = add nsw i32 %7, 1
%10 = icmp slt i32 %7, %2
br i1 %10, label %5, label %11
11: ; preds = %5, %3
ret void
}
void gtk_update_type_get_type() {}


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

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

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

LLVM IR (-O2):
define void @gtk_update_type_get_type() {
ret void
}
/* Variables and functions */
int __builtin_mips_cabs_eq_s(float, float);
int test2(float a, float b) { return __builtin_mips_cabs_eq_s(a, b); }


x86 assembly (clang, -O0):
<test2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
call   1030 <__builtin_mips_cabs_eq_s@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test2>:
jmp    1030 <__builtin_mips_cabs_eq_s@plt>

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

LLVM IR (-O2):
define i32 @test2(float %0, float %1) {
%3 = tail call i32 @__builtin_mips_cabs_eq_s(float %0, float %1)
ret i32 %3
}
/* Variables and functions */
int builtin_errmsgn(char **, char *, int /*<<< orphan*/, char *);
int /*<<< orphan*/ str_len(char *);
int builtin_errmsg(char *argv[], char *s, char *msg) {
  return builtin_errmsgn(argv, s, str_len(s), msg);
}


x86 assembly (clang, -O0):
<builtin_errmsg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <str_len@plt>
mov    -0x28(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    %eax,%edx
mov    -0x18(%rbp),%rcx
call   1030 <builtin_errmsgn@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<builtin_errmsg>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %rdi,%r15
mov    %rsi,%rdi
call   1040 <str_len@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
mov    %r14,%rcx
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <builtin_errmsgn@plt>

LLVM IR (-O0):
define i32 @builtin_errmsg(i8** %0, i8* %1, i8* %2) {
%4 = alloca i8**
%5 = alloca i8*
%6 = alloca i8*
store i8** %0, i8*** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8**, i8*** %4
%8 = load i8*, i8** %5
%9 = load i8*, i8** %5
%10 = call i32 @str_len(i8* %9)
%11 = load i8*, i8** %6
%12 = call i32 @builtin_errmsgn(i8** %7, i8* %8, i32 %10, i8* %11)
ret i32 %12
}

LLVM IR (-O2):
define i32 @builtin_errmsg(i8** %0, i8* %1, i8* %2) {
%4 = tail call i32 @str_len(i8* %1)
%5 = tail call i32 @builtin_errmsgn(i8** %0, i8* %1, i32 %4, i8* %2)
ret i32 %5
}
/* Variables and functions */
char *hdate_string(int, int const, int const, int /*<<< orphan*/);
char *hdate_get_holyday_string(int const holiday, int const short_text) {
  return hdate_string(5, holiday, short_text, 0);
}


x86 assembly (clang, -O0):
<hdate_get_holyday_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    $0x5,%edi
xor    %ecx,%ecx
call   1030 <hdate_string@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hdate_get_holyday_string>:
mov    %esi,%edx
mov    %edi,%esi
mov    $0x5,%edi
xor    %ecx,%ecx
jmp    1030 <hdate_string@plt>

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

LLVM IR (-O2):
define i8* @hdate_get_holyday_string(i32 %0, i32 %1) {
%3 = tail call i8* @hdate_string(i32 5, i32 %0, i32 %1, i32 0)
ret i8* %3
}
/* Type definitions */
struct ath_hal {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ printk(char *);
void ath_hal_dump_map(struct ath_hal *ah) {
  printk("To use this feature you must enable CONFIG_KALLSYMS in your kernel.");
}


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

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

LLVM IR (-O0):
%struct.ath_hal = type { i32 }
@.str = [68 x i8] c"To use this feature you must enable CONFIG_KALLSYMS in your kernel.\00"
define void @ath_hal_dump_map(%struct.ath_hal* %0) {
%2 = alloca %struct.ath_hal*
store %struct.ath_hal* %0, %struct.ath_hal** %2
%3 = call i32 @printk(i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
%struct.ath_hal = type { i32 }
@.str = [68 x i8] c"To use this feature you must enable CONFIG_KALLSYMS in your kernel.\00"
define void @ath_hal_dump_map(%struct.ath_hal* nocapture readnone %0) {
%2 = tail call i32 @printk(i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int);
void print_exit(int sig) {
  printf("Got signal %d\n", sig);
  exit(0);
}


x86 assembly (clang, -O0):
<print_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<print_exit>:
push   %rax
mov    %edi,%esi
lea    0xed6(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"Got signal %d\0A\00"
define void @print_exit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [15 x i8] c"Got signal %d\0A\00"
define void @print_exit(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %0)
%3 = tail call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
struct fid_ep {
  int dummy;
};
struct fi_tx_attr {
  int dummy;
};

/* Variables and functions */
int gnix_tx_context(struct fid_ep *, int, struct fi_tx_attr *, struct fid_ep **,
                    void *);
int fi_tx_context(struct fid_ep *ep, int index, struct fi_tx_attr *attr,
                  struct fid_ep **tx_ep, void *context) {
  return gnix_tx_context(ep, index, attr, tx_ep, context);
}


x86 assembly (clang, -O0):
<fi_tx_context>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
call   1030 <gnix_tx_context@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fi_tx_context>:
jmp    1030 <gnix_tx_context@plt>

LLVM IR (-O0):
%struct.fid_ep = type { i32 }
%struct.fi_tx_attr = type { i32 }
define i32 @fi_tx_context(%struct.fid_ep* %0, i32 %1, %struct.fi_tx_attr* %2, %struct.fid_ep** %3, i8* %4) {
%6 = alloca %struct.fid_ep*
%7 = alloca i32
%8 = alloca %struct.fi_tx_attr*
%9 = alloca %struct.fid_ep**
%10 = alloca i8*
store %struct.fid_ep* %0, %struct.fid_ep** %6
store i32 %1, i32* %7
store %struct.fi_tx_attr* %2, %struct.fi_tx_attr** %8
store %struct.fid_ep** %3, %struct.fid_ep*** %9
store i8* %4, i8** %10
%11 = load %struct.fid_ep*, %struct.fid_ep** %6
%12 = load i32, i32* %7
%13 = load %struct.fi_tx_attr*, %struct.fi_tx_attr** %8
%14 = load %struct.fid_ep**, %struct.fid_ep*** %9
%15 = load i8*, i8** %10
%16 = call i32 @gnix_tx_context(%struct.fid_ep* %11, i32 %12, %struct.fi_tx_attr* %13, %struct.fid_ep** %14, i8* %15)
ret i32 %16
}

LLVM IR (-O2):
%struct.fid_ep = type { i32 }
%struct.fi_tx_attr = type { i32 }
define i32 @fi_tx_context(%struct.fid_ep* %0, i32 %1, %struct.fi_tx_attr* %2, %struct.fid_ep** %3, i8* %4) {
%6 = tail call i32 @gnix_tx_context(%struct.fid_ep* %0, i32 %1, %struct.fi_tx_attr* %2, %struct.fid_ep** %3, i8* %4)
ret i32 %6
}
double g(double z) { return z - 1.111111111112; }


x86 assembly (clang, -O0):
<g>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xeea(%rip),%xmm1
subsd  %xmm1,%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define double @g(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fsub double %3, 0x3FF1C71C71C72C15
ret double %4
}

LLVM IR (-O2):
define double @g(double %0) {
%2 = fadd double %0, 0xBFF1C71C71C72C15
ret double %2
}
void ActionInit() {}


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

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

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

LLVM IR (-O2):
define void @ActionInit() {
ret void
}
/* Type definitions */
struct list_head_t {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ INIT_LIST_HEAD(struct list_head_t *);
int /*<<< orphan*/ __list_splice(struct list_head_t *, struct list_head_t *);
int /*<<< orphan*/ list_empty(struct list_head_t *);
void list_splice_init(struct list_head_t *list, struct list_head_t *head) {
  if (!list_empty(list)) {
    __list_splice(list, head);
    INIT_LIST_HEAD(list);
  }
}


x86 assembly (clang, -O0):
<list_splice_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <list_empty@plt>
cmp    $0x0,%eax
jne    1168 <list_splice_init+0x38>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <__list_splice@plt>
mov    -0x8(%rbp),%rdi
call   1030 <INIT_LIST_HEAD@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<list_splice_init>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1050 <list_empty@plt>
test   %eax,%eax
je     114b <list_splice_init+0x1b>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <__list_splice@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <INIT_LIST_HEAD@plt>

LLVM IR (-O0):
%struct.list_head_t = type { i32 }
define void @list_splice_init(%struct.list_head_t* %0, %struct.list_head_t* %1) {
%3 = alloca %struct.list_head_t*
%4 = alloca %struct.list_head_t*
store %struct.list_head_t* %0, %struct.list_head_t** %3
store %struct.list_head_t* %1, %struct.list_head_t** %4
%5 = load %struct.list_head_t*, %struct.list_head_t** %3
%6 = call i32 @list_empty(%struct.list_head_t* %5)
%7 = icmp ne i32 %6, 0
br i1 %7, label %14, label %8
8: ; preds = %2
%9 = load %struct.list_head_t*, %struct.list_head_t** %3
%10 = load %struct.list_head_t*, %struct.list_head_t** %4
%11 = call i32 @__list_splice(%struct.list_head_t* %9, %struct.list_head_t* %10)
%12 = load %struct.list_head_t*, %struct.list_head_t** %3
%13 = call i32 @INIT_LIST_HEAD(%struct.list_head_t* %12)
br label %14
14: ; preds = %8, %2
ret void
}

LLVM IR (-O2):
%struct.list_head_t = type { i32 }
define void @list_splice_init(%struct.list_head_t* %0, %struct.list_head_t* %1) {
%3 = tail call i32 @list_empty(%struct.list_head_t* %0)
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = tail call i32 @__list_splice(%struct.list_head_t* %0, %struct.list_head_t* %1)
%7 = tail call i32 @INIT_LIST_HEAD(%struct.list_head_t* %0)
br label %8
8: ; preds = %5, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ UI_init();
void UI_execute_initialization() { UI_init(); }


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

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

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

LLVM IR (-O2):
define void @UI_execute_initialization() {
%1 = tail call i32 (...) @UI_init()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fwrite(char const *, size_t, int, int /*<<< orphan*/ *);
int dump_to_file(const char *buffer, size_t size, void *data) {
  FILE *dest = (FILE *)data;
  if (fwrite(buffer, size, 1, dest) != 1)
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<dump_to_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x28(%rbp),%rcx
mov    $0x1,%edx
call   1030 <fwrite@plt>
cmp    $0x1,%eax
je     1157 <dump_to_file+0x47>
movl   $0xffffffff,-0x4(%rbp)
jmp    115e <dump_to_file+0x4e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dump_to_file>:
push   %rax
mov    %rdx,%rcx
mov    $0x1,%edx
call   1030 <fwrite@plt>
xor    %ecx,%ecx
cmp    $0x1,%eax
setne  %cl
neg    %ecx
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @dump_to_file(i8* nocapture %0, i64 %1, i8* nocapture %2) {
%4 = bitcast i8* %2 to i32*
%5 = tail call i32 @fwrite(i8* %0, i64 %1, i32 1, i32* %4)
%6 = icmp ne i32 %5, 1
%7 = sext i1 %6 to i32
ret i32 %7
}
int fun1320() { return 1320; }


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

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

LLVM IR (-O0):
define i32 @fun1320() {
ret i32 1320
}

LLVM IR (-O2):
define i32 @fun1320() {
ret i32 1320
}
int f(double t, double y[], double f[], void *params) {
  f[0] = t * y[0];
  return 0;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    -0x10(%rbp),%rax
mulsd  (%rax),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
mulsd  (%rdi),%xmm0
movsd  %xmm0,(%rsi)
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @f(double %0, double* nocapture %1, double* nocapture writeonly %2, i8* nocapture readnone %3) {
%5 = load double, double* %1
%6 = fmul double %5, %0
store double %6, double* %2
ret i32 0
}
int isNum(char c) {
  switch (c) {
  case '-':
  case '+':
  case '.':
  case 'E':
  case 'e':
  case '0':
  case '1':
  case '2':
  case '3':
  case '4':
  case '5':
  case '6':
  case '7':
  case '8':
  case '9':
    return 1;
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<isNum>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x2b,%eax
je     1169 <isNum+0x69>
jmp    111f <isNum+0x1f>
mov    -0xc(%rbp),%eax
add    $0xffffffd3,%eax
sub    $0x2,%eax
jb     1169 <isNum+0x69>
jmp    1133 <isNum+0x33>
mov    -0xc(%rbp),%eax
add    $0xffffffd0,%eax
sub    $0xa,%eax
jb     1169 <isNum+0x69>
jmp    1147 <isNum+0x47>
mov    -0xc(%rbp),%eax
sub    $0x45,%eax
je     1169 <isNum+0x69>
jmp    1158 <isNum+0x58>
mov    -0xc(%rbp),%eax
sub    $0x65,%eax
jne    1175 <isNum+0x75>
jmp    1169 <isNum+0x69>
movl   $0x1,-0x4(%rbp)
jmp    117c <isNum+0x7c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isNum>:
add    $0xffffffd5,%edi
cmp    $0x3a,%edi
ja     111e <isNum+0x1e>
mov    $0x1,%eax
movabs $0x400000004007fed,%rcx
bt     %rdi,%rcx
jae    111e <isNum+0x1e>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @isNum(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
switch i32 %5, label %7 [
i32 45, label %6
i32 43, label %6
i32 46, label %6
i32 69, label %6
i32 101, label %6
i32 48, label %6
i32 49, label %6
i32 50, label %6
i32 51, label %6
i32 52, label %6
i32 53, label %6
i32 54, label %6
i32 55, label %6
i32 56, label %6
i32 57, label %6
]
6: ; preds = %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1
store i32 1, i32* %2
br label %8
7: ; preds = %1
store i32 0, i32* %2
br label %8
8: ; preds = %7, %6
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
define i32 @isNum(i8 signext %0) {
%2 = sext i8 %0 to i32
switch i32 %2, label %3 [
i32 45, label %4
i32 43, label %4
i32 46, label %4
i32 69, label %4
i32 101, label %4
i32 48, label %4
i32 49, label %4
i32 50, label %4
i32 51, label %4
i32 52, label %4
i32 53, label %4
i32 54, label %4
i32 55, label %4
i32 56, label %4
i32 57, label %4
]
3: ; preds = %1
br label %4
4: ; preds = %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %3
%5 = phi i32 [ 0, %3 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ no_tabs();
int main() { no_tabs(); }


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @no_tabs()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int *);
int main(int argc, char **argv) {
  int x;
  printf("hello world!!! x=%d &x=%p\n", x, &x);
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [27 x i8] c"hello world!!! x=%d &x=%p\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* %6
%8 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %7, i32* %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [27 x i8] c"hello world!!! x=%d &x=%p\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 undef, i32* %3)
ret i32 0
}
/* Variables and functions */
char const *vp_file_read(char *);
const char *vp_socket_read(char *args) { return vp_file_read(args); }


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

x86 assembly (clang, -O2):
<vp_socket_read>:
jmp    1030 <vp_file_read@plt>

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

LLVM IR (-O2):
define i8* @vp_socket_read(i8* %0) {
%2 = tail call i8* @vp_file_read(i8* %0)
ret i8* %2
}
void strcats(char *s, char *t) {
  while (*s++)
    ;
  s--;
  while (*s++ = *t++)
    ;
}


x86 assembly (clang, -O0):
<strcats>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
cmpb   $0x0,(%rax)
je     1129 <strcats+0x29>
jmp    110c <strcats+0xc>
mov    -0x8(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %al,(%rcx)
cmp    $0x0,%al
je     1164 <strcats+0x64>
jmp    1135 <strcats+0x35>
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcats>:
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1100 <strcats>
xor    %eax,%eax
nopl   0x0(%rax,%rax,1)
movzbl (%rsi,%rax,1),%ecx
mov    %cl,-0x1(%rdi,%rax,1)
add    $0x1,%rax
test   %cl,%cl
jne    1110 <strcats+0x10>
ret

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

LLVM IR (-O2):
define void @strcats(i8* nocapture %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %5, %3 ]
%5 = getelementptr inbounds i8, i8* %4, i64 1
%6 = load i8, i8* %4
%7 = icmp eq i8 %6, 0
br i1 %7, label %8, label %3
8: ; preds = %3, %8
%9 = phi i8* [ %13, %8 ], [ %4, %3 ]
%10 = phi i8* [ %11, %8 ], [ %1, %3 ]
%11 = getelementptr inbounds i8, i8* %10, i64 1
%12 = load i8, i8* %10
%13 = getelementptr inbounds i8, i8* %9, i64 1
store i8 %12, i8* %9
%14 = icmp eq i8 %12, 0
br i1 %14, label %15, label %8
15: ; preds = %8
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fread(unsigned char **, int, int, int /*<<< orphan*/ *);
unsigned int png_get_dword(FILE *fi) {
  unsigned int a;
  unsigned char b[4];
  fread(&b, 4, 1, fi);
  return b[0] << 24 | b[1] << 16 | b[2] << 8 | b[3];
}


x86 assembly (clang, -O0):
<png_get_dword>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rcx
mov    $0x4,%esi
mov    $0x1,%edx
call   1030 <fread@plt>
movzbl -0x10(%rbp),%eax
shl    $0x18,%eax
movzbl -0xf(%rbp),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
movzbl -0xe(%rbp),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
movzbl -0xd(%rbp),%ecx
or     %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<png_get_dword>:
push   %rax
mov    %rdi,%rcx
lea    0x4(%rsp),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
call   1030 <fread@plt>
mov    0x4(%rsp),%eax
bswap  %eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @png_get_dword(i32* nocapture %0) {
%2 = alloca [4 x i8]
%3 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 0
%4 = bitcast [4 x i8]* %2 to i8**
%5 = call i32 @fread(i8** %4, i32 4, i32 1, i32* %0)
%6 = load i8, i8* %3
%7 = zext i8 %6 to i32
%8 = shl nuw i32 %7, 24
%9 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 1
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = shl nuw nsw i32 %11, 16
%13 = or i32 %12, %8
%14 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 2
%15 = load i8, i8* %14
%16 = zext i8 %15 to i32
%17 = shl nuw nsw i32 %16, 8
%18 = or i32 %13, %17
%19 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 3
%20 = load i8, i8* %19
%21 = zext i8 %20 to i32
%22 = or i32 %18, %21
ret i32 %22
}
/* Type definitions */
typedef int /*<<< orphan*/ u_int64_t;

/* Variables and functions */
int /*<<< orphan*/ polymod(int /*<<< orphan*/, int /*<<< orphan*/,
                           int /*<<< orphan*/);
int /*<<< orphan*/ polymult(int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                            int /*<<< orphan*/, int /*<<< orphan*/);
u_int64_t polymmult(u_int64_t x, u_int64_t y, u_int64_t d) {
  u_int64_t h, l;
  polymult(&h, &l, x, y);
  return polymod(h, l, d);
}


x86 assembly (clang, -O0):
<polymmult>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%ecx
lea    -0x10(%rbp),%rdi
lea    -0x14(%rbp),%rsi
call   1030 <polymult@plt>
mov    -0x10(%rbp),%edi
mov    -0x14(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1040 <polymod@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<polymmult>:
push   %rbx
sub    $0x10,%rsp
mov    %edx,%ebx
mov    %esi,%ecx
mov    %edi,%edx
lea    0xc(%rsp),%rdi
lea    0x8(%rsp),%rsi
call   1030 <polymult@plt>
mov    0xc(%rsp),%edi
mov    0x8(%rsp),%esi
mov    %ebx,%edx
call   1040 <polymod@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @polymmult(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%9 = load i32, i32* %4
%10 = load i32, i32* %5
%11 = call i32 @polymult(i32* %7, i32* %8, i32 %9, i32 %10)
%12 = load i32, i32* %7
%13 = load i32, i32* %8
%14 = load i32, i32* %6
%15 = call i32 @polymod(i32 %12, i32 %13, i32 %14)
ret i32 %15
}

LLVM IR (-O2):
define i32 @polymmult(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = bitcast i32* %4 to i8*
%7 = bitcast i32* %5 to i8*
%8 = call i32 @polymult(i32* %4, i32* %5, i32 %0, i32 %1)
%9 = load i32, i32* %4
%10 = load i32, i32* %5
%11 = call i32 @polymod(i32 %9, i32 %10, i32 %2)
ret i32 %11
}