xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ close(int);
int /*<<< orphan*/ perror_exit(char *);
void xclose(int fd) {
  if (close(fd) < 0)
    perror_exit("close");
}


x86 assembly (clang, -O0):
<xclose>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <close@plt>
cmp    $0x0,%rax
jge    1149 <xclose+0x29>
lea    0xebc(%rip),%rdi
call   1040 <perror_exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xclose>:
push   %rax
call   1030 <close@plt>
test   %rax,%rax
js     112d <xclose+0xd>
pop    %rax
ret
lea    0xecc(%rip),%rdi
pop    %rax
jmp    1040 <perror_exit@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"close\00"
define void @xclose(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @close(i32 %3)
%5 = icmp slt i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @perror_exit(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %1
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"close\00"
define void @xclose(i32 %0) {
%2 = tail call i64 @close(i32 %0)
%3 = icmp slt i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @perror_exit(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret void
}
void SSL_CTX_use_PrivateKey_file(void) {}


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

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

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

LLVM IR (-O2):
define void @SSL_CTX_use_PrivateKey_file() {
ret void
}
/* Variables and functions */
float __nv_hypotf(float, float);
float hypotf(float __a, float __b) { return __nv_hypotf(__a, __b); }


x86 assembly (clang, -O0):
<hypotf>:
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 <__nv_hypotf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hypotf>:
jmp    1030 <__nv_hypotf@plt>

LLVM IR (-O0):
define float @hypotf(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 float @__nv_hypotf(float %5, float %6)
ret float %7
}

LLVM IR (-O2):
define float @hypotf(float %0, float %1) {
%3 = tail call float @__nv_hypotf(float %0, float %1)
ret float %3
}
/* Variables and functions */
int open(char const *, int, int);
int phptrace_file_open(const char *file, int flags, int mode) {
  int fd;
  if (file == NULL) {
    return -1;
  }
  fd = open(file, flags, mode);
  return fd;
}


x86 assembly (clang, -O0):
<phptrace_file_open>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1139 <phptrace_file_open+0x29>
movl   $0xffffffff,-0x4(%rbp)
jmp    1151 <phptrace_file_open+0x41>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
call   1030 <open@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<phptrace_file_open>:
test   %rdi,%rdi
je     111a <phptrace_file_open+0xa>
jmp    1030 <open@plt>
mov    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
define i32 @phptrace_file_open(i8* %0, i32 %1, i32 %2) {
%4 = icmp eq i8* %0, null
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = tail call i32 @open(i8* %0, i32 %1, i32 %2)
br label %7
7: ; preds = %3, %5
%8 = phi i32 [ %6, %5 ], [ -1, %3 ]
ret i32 %8
}
/* Variables and functions */
size_t ht_hash(const char *key) {
  size_t hv;
  for (hv = 5381; *key != '\0'; ++key)
    hv = ((hv << 5) + hv) + *key;
  return hv;
}


x86 assembly (clang, -O0):
<ht_hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x1505,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     114c <ht_hash+0x4c>
mov    -0x10(%rbp),%rax
shl    $0x5,%rax
add    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
movsbq (%rcx),%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1110 <ht_hash+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ht_hash>:
mov    (%rdi),%cl
test   %cl,%cl
je     112d <ht_hash+0x2d>
add    $0x1,%rdi
mov    $0x1505,%eax
nop
mov    %rax,%rdx
shl    $0x5,%rdx
add    %rax,%rdx
movsbq %cl,%rax
add    %rdx,%rax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <ht_hash+0x10>
ret
mov    $0x1505,%eax
ret

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

LLVM IR (-O2):
define i64 @ht_hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i64 [ %10, %4 ], [ 5381, %1 ]
%7 = phi i8* [ %11, %4 ], [ %0, %1 ]
%8 = mul i64 %6, 33
%9 = sext i8 %5 to i64
%10 = add i64 %8, %9
%11 = getelementptr inbounds i8, i8* %7, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i64 [ 5381, %1 ], [ %10, %4 ]
ret i64 %15
}
/* Variables and functions */
int /*<<< orphan*/ PlayGame();
int /*<<< orphan*/ endwin();
int /*<<< orphan*/ initscr();
int /*<<< orphan*/ noecho();
int main() {
  initscr();
  noecho();
  PlayGame();
  endwin();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <initscr@plt>
mov    $0x0,%al
call   1060 <noecho@plt>
mov    $0x0,%al
call   1040 <PlayGame@plt>
mov    $0x0,%al
call   1050 <endwin@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <initscr@plt>
xor    %eax,%eax
call   1060 <noecho@plt>
xor    %eax,%eax
call   1040 <PlayGame@plt>
xor    %eax,%eax
call   1050 <endwin@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @initscr()
%2 = call i32 (...) @noecho()
%3 = call i32 (...) @PlayGame()
%4 = call i32 (...) @endwin()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @initscr()
%2 = tail call i32 (...) @noecho()
%3 = tail call i32 (...) @PlayGame()
%4 = tail call i32 (...) @endwin()
ret i32 0
}
void on_escape_press(union ui_state *state) {}


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

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

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

LLVM IR (-O2):
%union.ui_state = type opaque
define void @on_escape_press(%union.ui_state* nocapture %0) {
ret void
}
int remap_x(int x) {
  if (x == 1) {
    return 1;
  } else if (x == 2) {
    return 6;
  } else {
    return 11;
  }
}


x86 assembly (clang, -O0):
<remap_x>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    111d <remap_x+0x1d>
movl   $0x1,-0x4(%rbp)
jmp    113a <remap_x+0x3a>
cmpl   $0x2,-0x8(%rbp)
jne    1133 <remap_x+0x33>
movl   $0x6,-0x4(%rbp)
jmp    113a <remap_x+0x3a>
movl   $0xb,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<remap_x>:
xor    %eax,%eax
cmp    $0x2,%edi
setne  %al
lea    (%rax,%rax,4),%eax
add    $0x6,%eax
cmp    $0x1,%edi
cmove  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @remap_x(i32 %0) {
%2 = icmp eq i32 %0, 2
%3 = select i1 %2, i32 6, i32 11
%4 = icmp eq i32 %0, 1
%5 = select i1 %4, i32 1, i32 %3
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int a = 10;
  int *p = &a;
  a = a + 1;
  printf("Value is:%d", *p);
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [12 x i8] c"Value is:%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32*
store i32 0, i32* %1
store i32 10, i32* %2
store i32* %2, i32** %3
%4 = load i32, i32* %2
%5 = add nsw i32 %4, 1
store i32 %5, i32* %2
%6 = load i32*, i32** %3
%7 = load i32, i32* %6
%8 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %7)
ret i32 0
}

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


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_bi_epel_v12_12_sse4() {
ret void
}
/* Variables and functions */
long long partition(long long *, long long, long long);
void quickSort(long long arr[], long long low, long long high) {
  if (low < high) {
    long long pi = partition(arr, low, high);
    quickSort(arr, low, pi - 1);
    quickSort(arr, pi + 1, high);
  }
}


x86 assembly (clang, -O0):
<quickSort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jge    1181 <quickSort+0x61>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <partition@plt>
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x20(%rbp),%rdx
sub    $0x1,%rdx
call   1040 <quickSort@plt>
mov    -0x8(%rbp),%rdi
mov    -0x20(%rbp),%rsi
add    $0x1,%rsi
mov    -0x18(%rbp),%rdx
call   1040 <quickSort@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quickSort>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
cmp    %rdx,%rsi
jge    116c <quickSort+0x4c>
mov    %rdx,%r14
mov    %rsi,%r12
mov    %rdi,%r15
cs nopw 0x0(%rax,%rax,1)
mov    %r15,%rdi
mov    %r12,%rsi
mov    %r14,%rdx
call   1030 <partition@plt>
mov    %rax,%rbx
lea    -0x1(%rax),%rdx
mov    %r15,%rdi
mov    %r12,%rsi
call   1040 <quickSort@plt>
add    $0x1,%rbx
mov    %rbx,%r12
cmp    %r14,%rbx
jl     1140 <quickSort+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @quickSort(i64* %0, i64 %1, i64 %2) {
%4 = icmp slt i64 %1, %2
br i1 %4, label %5, label %11
5: ; preds = %3, %5
%6 = phi i64 [ %9, %5 ], [ %1, %3 ]
%7 = tail call i64 @partition(i64* %0, i64 %6, i64 %2)
%8 = add nsw i64 %7, -1
tail call void @quickSort(i64* %0, i64 %6, i64 %8)
%9 = add nsw i64 %7, 1
%10 = icmp slt i64 %9, %2
br i1 %10, label %5, label %11
11: ; preds = %5, %3
ret void
}
int str_len(char a[100]) {
  int i = 0;
  while (a[i] != '\0') {
    i++;
  }
  return i;
}


x86 assembly (clang, -O0):
<str_len>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1132 <str_len+0x32>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <str_len+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_len>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <str_len+0x10>
ret

LLVM IR (-O0):
define i32 @str_len(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %12, %1
%5 = load i8*, i8** %2
%6 = load i32, i32* %3
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %5, i64 %7
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %15
12: ; preds = %4
%13 = load i32, i32* %3
%14 = add nsw i32 %13, 1
store i32 %14, i32* %3
br label %4
15: ; preds = %4
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
define i32 @str_len(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
/* Variables and functions */
int etp_poll();
int eio_poll(void) { return etp_poll(); }


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

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

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

LLVM IR (-O2):
define i32 @eio_poll() {
%1 = tail call i32 (...) @etp_poll()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *);
void printError(char *str_err) {
  printf("%s\n", str_err);
  exit(1);
}


x86 assembly (clang, -O0):
<printError>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @printError(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
void save_config(void) {}


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

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

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

LLVM IR (-O2):
define void @save_config() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ implicit_conversion();
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  printf("Hello, world!\n");
  implicit_conversion();
  return 0;
}


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    0xec3(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <implicit_conversion@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1040 <implicit_conversion@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@str = [14 x i8] c"Hello, world!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 (...) @implicit_conversion()
ret i32 0
}
/* Variables and functions */
sigsetmask() {}


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

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

LLVM IR (-O0):
define i32 @sigsetmask() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @sigsetmask() {
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ z;

/* Variables and functions */
int /*<<< orphan*/ memset(long double *, int /*<<< orphan*/, int);
int /*<<< orphan*/ printfp(char *, long double *);
int main(void) {
  long double x = 3.141592653589793238462643383279502884L;
  long double y = 2.718281828459045235360287471352662498L;
  long double z;
  memset(&z, 0, sizeof(z));
  z = x / y;
  printfp("result", &z);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
fldt   0xecb(%rip)
fstpt  -0x20(%rbp)
fldt   0xed2(%rip)
fstpt  -0x30(%rbp)
lea    -0x40(%rbp),%rdi
xor    %esi,%esi
mov    $0x10,%edx
call   1040 <memset@plt>
fldt   -0x20(%rbp)
fldt   -0x30(%rbp)
fdivrp %st,%st(1)
fstpt  -0x40(%rbp)
lea    0xebd(%rip),%rdi
lea    -0x40(%rbp),%rsi
call   1030 <printfp@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x10,%edx
call   1040 <memset@plt>
fldt   0xec3(%rip)
fstpt  (%rsp)
lea    0xec9(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printfp@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"result\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca x86_fp80
%3 = alloca x86_fp80
%4 = alloca x86_fp80
store i32 0, i32* %1
store x86_fp80 0xK4000C90FDAA22168C235, x86_fp80* %2
store x86_fp80 0xK4000ADF85458A2BB4A9B, x86_fp80* %3
%5 = call i32 @memset(x86_fp80* %4, i32 0, i32 16)
%6 = load x86_fp80, x86_fp80* %2
%7 = load x86_fp80, x86_fp80* %3
%8 = fdiv x86_fp80 %6, %7
store x86_fp80 %8, x86_fp80* %4
%9 = call i32 @printfp(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), x86_fp80* %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"result\00"
define i32 @main() {
%1 = alloca x86_fp80
%2 = bitcast x86_fp80* %1 to i8*
%3 = call i32 @memset(x86_fp80* %1, i32 0, i32 16)
store x86_fp80 0xK3FFF93EEDFB138EDEF7F, x86_fp80* %1
%4 = call i32 @printfp(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), x86_fp80* %1)
ret i32 0
}
/* Variables and functions */
char *strrchr(const char *s, char c) {
  const char *r = NULL;
  while (*s++)
    if (*s == c)
      r = s;
  return (char *)r;
}


x86 assembly (clang, -O0):
<strrchr>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
cmpb   $0x0,(%rax)
je     114e <strrchr+0x4e>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x9(%rbp),%ecx
cmp    %ecx,%eax
jne    1149 <strrchr+0x49>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    1116 <strrchr+0x16>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strrchr>:
cmpb   $0x0,(%rdi)
je     1123 <strrchr+0x23>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax,%rax,1)
movzbl (%rdi),%ecx
cmp    %sil,%cl
cmove  %rdi,%rax
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <strrchr+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @strrchr(i8* %0, i8 signext %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2, %5
%6 = phi i8* [ %8, %5 ], [ %0, %2 ]
%7 = phi i8* [ %11, %5 ], [ null, %2 ]
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, %1
%11 = select i1 %10, i8* %8, i8* %7
%12 = icmp eq i8 %9, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %2
%14 = phi i8* [ null, %2 ], [ %11, %5 ]
ret i8* %14
}
unsigned char lash_getQuadrantFromCartesian(const int dx, const int dy) {
  if (dx > 0) {
    if (dy > 0) {
      return 1;
    } else {
      return 4;
    }
  } else {
    if (dy > 0) {
      return 2;
    } else {
      return 3;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<lash_getQuadrantFromCartesian>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    1130 <lash_getQuadrantFromCartesian+0x30>
cmpl   $0x0,-0xc(%rbp)
jle    1127 <lash_getQuadrantFromCartesian+0x27>
movb   $0x1,-0x1(%rbp)
jmp    1147 <lash_getQuadrantFromCartesian+0x47>
movb   $0x4,-0x1(%rbp)
jmp    1147 <lash_getQuadrantFromCartesian+0x47>
cmpl   $0x0,-0xc(%rbp)
jle    1143 <lash_getQuadrantFromCartesian+0x43>
movb   $0x2,-0x1(%rbp)
jmp    1147 <lash_getQuadrantFromCartesian+0x47>
movb   $0x3,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lash_getQuadrantFromCartesian>:
xor    %eax,%eax
test   %esi,%esi
setg   %cl
setle  %al
xor    $0x3,%cl
test   %edi,%edi
lea    0x1(%rax,%rax,2),%edx
movzbl %cl,%eax
cmovg  %edx,%eax
ret

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

LLVM IR (-O2):
define zeroext i8 @lash_getQuadrantFromCartesian(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, 0
%4 = icmp sgt i32 %1, 0
%5 = select i1 %4, i8 1, i8 4
%6 = select i1 %4, i8 2, i8 3
%7 = select i1 %3, i8 %5, i8 %6
ret i8 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ puts(char *);
void crash(int *p) {
  puts("Will segfault.");
  int i = *p;
  printf("Result: %d\n", i);
}


x86 assembly (clang, -O0):
<crash>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
call   1030 <puts@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xec4(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<crash>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
call   1030 <puts@plt>
mov    (%rbx),%esi
lea    0xed6(%rip),%rdi
pop    %rbx
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"Will segfault.\00"
@.str.1 = [12 x i8] c"Result: %d\0A\00"
define void @crash(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = call i32 @puts(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%5 = load i32*, i32** %2
%6 = load i32, i32* %5
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 %7)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"Will segfault.\00"
@.str.1 = [12 x i8] c"Result: %d\0A\00"
define void @crash(i32* nocapture %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %0
%4 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 %3)
ret void
}
int foo5() { return 5; }


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

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

LLVM IR (-O0):
define i32 @foo5() {
ret i32 5
}

LLVM IR (-O2):
define i32 @foo5() {
ret i32 5
}
void newblock() {}


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

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

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

LLVM IR (-O2):
define void @newblock() {
ret void
}
/* Variables and functions */
int japi_sound(char *);
int j_sound(char *arg0) { return (japi_sound(arg0)); }


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

x86 assembly (clang, -O2):
<j_sound>:
jmp    1030 <japi_sound@plt>

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

LLVM IR (-O2):
define i32 @j_sound(i8* %0) {
%2 = tail call i32 @japi_sound(i8* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, ...);
void enoughtParametersCheck(char *cmd, short argc) {
  if (argc > 2)
    return;
  printf("Helios v4.1g -----------------------------------------------\n");
  printf("   Usage: %s <flags> <query> <engine1> [... <engineN>]\n", cmd);
  exit(-1);
}


x86 assembly (clang, -O0):
<enoughtParametersCheck>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
movswl -0xa(%rbp),%eax
cmp    $0x2,%eax
jle    1146 <enoughtParametersCheck+0x26>
add    $0x10,%rsp
pop    %rbp
ret
lea    0xeb3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xedf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<enoughtParametersCheck>:
cmp    $0x3,%si
jl     1137 <enoughtParametersCheck+0x7>
ret
push   %rbx
mov    %rdi,%rbx
lea    0xef6(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb2(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [62 x i8] c"Helios v4.1g -----------------------------------------------\0A\00"
@.str.1 = [56 x i8] c" Usage: %s <flags> <query> <engine1> [... <engineN>]\0A\00"
define void @enoughtParametersCheck(i8* %0, i16 signext %1) {
%3 = alloca i8*
%4 = alloca i16
store i8* %0, i8** %3
store i16 %1, i16* %4
%5 = load i16, i16* %4
%6 = sext i16 %5 to i32
%7 = icmp sgt i32 %6, 2
br i1 %7, label %8, label %9
8: ; preds = %2
ret void
9: ; preds = %2
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str, i64 0, i64 0))
%11 = load i8*, i8** %3
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.1, i64 0, i64 0), i8* %11)
%13 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@.str.1 = [56 x i8] c" Usage: %s <flags> <query> <engine1> [... <engineN>]\0A\00"
@str = [61 x i8] c"Helios v4.1g -----------------------------------------------\00"
define void @enoughtParametersCheck(i8* %0, i16 signext %1) {
%3 = icmp sgt i16 %1, 2
br i1 %3, label %4, label %5
4: ; preds = %2
ret void
5: ; preds = %2
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([61 x i8], [61 x i8]* @str, i64 0, i64 0))
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([56 x i8], [56 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%8 = tail call i32 @exit(i32 -1)
unreachable
}
void the_task_cpu(int foo, float bar[foo]) {}


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

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

LLVM IR (-O0):
define void @the_task_cpu(i32 %0, float* %1) {
%3 = alloca i32
%4 = alloca float*
store i32 %0, i32* %3
store float* %1, float** %4
%5 = load i32, i32* %3
%6 = zext i32 %5 to i64
ret void
}

LLVM IR (-O2):
define void @the_task_cpu(i32 %0, float* nocapture %1) {
ret void
}
/* Variables and functions */
int lst_get(void *lst, size_t pos, int *v) {}


x86 assembly (clang, -O0):
<lst_get>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @lst_get(i8* nocapture readnone %0, i64 %1, i32* nocapture readnone %2) {
ret i32 undef
}
int foo() {
  int a = -100;
  int b = -10;
  while (a)
    a++;
  while (b)
    b++;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
movl   $0xffffff9c,-0x8(%rbp)
movl   $0xfffffff6,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     112a <foo+0x2a>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1112 <foo+0x12>
jmp    112f <foo+0x2f>
cmpl   $0x0,-0xc(%rbp)
je     1147 <foo+0x47>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    112f <foo+0x2f>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @foo() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ line(int, int, int, int);
void caja_rellena(int x, int y, int an, int al) {
  do {
    line(x, y, x + an - 1, y);
    y++;
  } while (--al);
}


x86 assembly (clang, -O0):
<caja_rellena>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x4(%rbp),%edx
add    -0xc(%rbp),%edx
sub    $0x1,%edx
mov    -0x8(%rbp),%ecx
call   1030 <line@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
cmp    $0x0,%eax
jne    1124 <caja_rellena+0x14>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<caja_rellena>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %ecx,%ebx
mov    %esi,%ebp
mov    %edi,%r14d
lea    (%r14,%rdx,1),%r15d
add    $0xffffffff,%r15d
cs nopw 0x0(%rax,%rax,1)
mov    %r14d,%edi
mov    %ebp,%esi
mov    %r15d,%edx
mov    %ebp,%ecx
call   1030 <line@plt>
add    $0x1,%ebp
add    $0xffffffff,%ebx
jne    1130 <caja_rellena+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @caja_rellena(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = add i32 %0, -1
%6 = add i32 %5, %2
br label %7
7: ; preds = %7, %4
%8 = phi i32 [ %1, %4 ], [ %11, %7 ]
%9 = phi i32 [ %3, %4 ], [ %12, %7 ]
%10 = tail call i32 @line(i32 %0, i32 %8, i32 %6, i32 %8)
%11 = add nsw i32 %8, 1
%12 = add nsw i32 %9, -1
%13 = icmp eq i32 %12, 0
br i1 %13, label %14, label %7
14: ; preds = %7
ret void
}
int hash_function(int data) { return (data & ((1 << 16) - 1)); }


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

x86 assembly (clang, -O2):
<hash_function>:
movzwl %di,%eax
ret

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

LLVM IR (-O2):
define i32 @hash_function(i32 %0) {
%2 = and i32 %0, 65535
ret i32 %2
}
char *getOptionInputOutput(int bool_input, int bool_multiple) {
  char *str_result;
  if (bool_input) {
    if (bool_multiple)
      str_result = "-li";
    else
      str_result = "-i";
  } else {
    if (bool_multiple)
      str_result = "-lo";
    else
      str_result = "-o";
  }
  return str_result;
}


x86 assembly (clang, -O0):
<getOptionInputOutput>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     113e <getOptionInputOutput+0x3e>
cmpl   $0x0,-0x8(%rbp)
je     112e <getOptionInputOutput+0x2e>
lea    0xedb(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    1139 <getOptionInputOutput+0x39>
lea    0xecf(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    1168 <getOptionInputOutput+0x68>
cmpl   $0x0,-0x8(%rbp)
je     1158 <getOptionInputOutput+0x58>
lea    0xeb8(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    1163 <getOptionInputOutput+0x63>
lea    0xeac(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    1168 <getOptionInputOutput+0x68>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getOptionInputOutput>:
test   %esi,%esi
lea    0xefb(%rip),%rax
lea    0xef0(%rip),%rcx
cmove  %rax,%rcx
lea    0xef0(%rip),%rdx
lea    0xee5(%rip),%rax
cmove  %rdx,%rax
test   %edi,%edi
cmovne %rcx,%rax
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"-li\00"
@.str.1 = [3 x i8] c"-i\00"
@.str.2 = [4 x i8] c"-lo\00"
@.str.3 = [3 x i8] c"-o\00"
define i8* @getOptionInputOutput(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 0
%4 = icmp eq i32 %1, 0
%5 = select i1 %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0)
%6 = select i1 %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0)
%7 = select i1 %3, i8* %6, i8* %5
ret i8* %7
}
int bitmap_update_sb(struct bitmap *bitmap) {
  int a;
  return a;
}


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

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

LLVM IR (-O0):
%struct.bitmap = type opaque
define i32 @bitmap_update_sb(%struct.bitmap* %0) {
%2 = alloca %struct.bitmap*
%3 = alloca i32
store %struct.bitmap* %0, %struct.bitmap** %2
%4 = load i32, i32* %3
ret i32 %4
}

LLVM IR (-O2):
%struct.bitmap = type opaque
define i32 @bitmap_update_sb(%struct.bitmap* nocapture readnone %0) {
ret i32 undef
}
long main() {
  {
    {
      {
        {}
      }
    }
  }
}


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

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

LLVM IR (-O0):
define i64 @main() {
%1 = alloca i64
%2 = load i64, i64* %1
ret i64 %2
}

LLVM IR (-O2):
define i64 @main() {
ret i64 undef
}
/* Variables and functions */
int /*<<< orphan*/ command_helpall();
int /*<<< orphan*/ printf(char *);
void help() {
  printf("commands:\n");
  command_helpall();
}


x86 assembly (clang, -O0):
<help>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <command_helpall@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<help>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <command_helpall@plt>

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

LLVM IR (-O2):
@str = [10 x i8] c"commands:\00"
define void @help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @command_helpall()
ret void
}
unsigned int getHID() { return ~*(unsigned int *)0x10146000; }


x86 assembly (clang, -O0):
<getHID>:
push   %rbp
mov    %rsp,%rbp
mov    $0x10146000,%eax
mov    (%rax),%eax
xor    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getHID>:
mov    0x10146000,%eax
not    %eax
ret

LLVM IR (-O0):
define i32 @getHID() {
%1 = load i32, i32* inttoptr (i64 269770752 to i32*)
%2 = xor i32 %1, -1
ret i32 %2
}

LLVM IR (-O2):
define i32 @getHID() {
%1 = load i32, i32* inttoptr (i64 269770752 to i32*)
%2 = xor i32 %1, -1
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ enable_interrupts();
void irqrestore(unsigned long flags) {
  if (flags & (1ul << (9)))
    enable_interrupts();
}


x86 assembly (clang, -O0):
<irqrestore>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
and    $0x200,%rax
cmp    $0x0,%rax
je     1137 <irqrestore+0x27>
mov    $0x0,%al
call   1030 <enable_interrupts@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<irqrestore>:
test   $0x200,%edi
jne    1119 <irqrestore+0x9>
ret
xor    %eax,%eax
jmp    1030 <enable_interrupts@plt>

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

LLVM IR (-O2):
define void @irqrestore(i64 %0) {
%2 = and i64 %0, 512
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 (...) @enable_interrupts()
br label %6
6: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ omp_set_dynamic(int /*<<< orphan*/);
int /*<<< orphan*/ omp_set_nested(int);
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  omp_set_nested(1);
  omp_set_dynamic(0);
#pragma omp parallel num_threads(2)
  {
    printf("Outer Level - You will see this twice.\n");
#pragma omp parallel num_threads(2)
    { printf("Inner Level - You will see this four times!\n"); }
  }
  return 0;
}


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)
mov    $0x1,%edi
call   1050 <omp_set_nested@plt>
xor    %edi,%edi
call   1040 <omp_set_dynamic@plt>
lea    0xea2(%rip),%rdi
call   1030 <printf@plt>
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1050 <omp_set_nested@plt>
xor    %edi,%edi
call   1040 <omp_set_dynamic@plt>
lea    0xeb7(%rip),%rdi
call   1030 <puts@plt>
lea    0xed2(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [40 x i8] c"Outer Level - You will see this twice.\0A\00"
@.str.1 = [45 x i8] c"Inner Level - You will see this four times!\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @omp_set_nested(i32 1)
%7 = call i32 @omp_set_dynamic(i32 0)
%8 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
%9 = call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [39 x i8] c"Outer Level - You will see this twice.\00"
@str.2 = [44 x i8] c"Inner Level - You will see this four times!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @omp_set_nested(i32 1)
%4 = tail call i32 @omp_set_dynamic(i32 0)
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str, i64 0, i64 0))
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @str.2, i64 0, i64 0))
ret i32 0
}
int count_args(p)
char *p;
{
  int n = 0;
  while (*p != '\0') {
    n++;
    do {
      ++p;
      if (*p == ' ') {
        p++;
        break;
      }
    } while (*p != '\0');
  }
  return n;
}


x86 assembly (clang, -O0):
<count_args>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     116f <count_args+0x6f>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
jne    1155 <count_args+0x55>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    116a <count_args+0x6a>
jmp    115a <count_args+0x5a>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1128 <count_args+0x28>
jmp    110f <count_args+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<count_args>:
cmpb   $0x0,(%rdi)
je     1126 <count_args+0x26>
xor    %eax,%eax
add    $0x1,%eax
add    $0x1,%rdi
xchg   %ax,%ax
movzbl (%rdi),%ecx
test   %cl,%cl
je     1125 <count_args+0x25>
add    $0x1,%rdi
cmp    $0x20,%cl
jne    1110 <count_args+0x10>
cmpb   $0x0,(%rdi)
jne    1107 <count_args+0x7>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @count_args(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %16, label %4
4: ; preds = %1, %12
%5 = phi i32 [ %7, %12 ], [ 0, %1 ]
%6 = phi i8* [ %13, %12 ], [ %0, %1 ]
%7 = add nuw nsw i32 %5, 1
br label %8
8: ; preds = %8, %4
%9 = phi i8* [ %6, %4 ], [ %10, %8 ]
%10 = getelementptr inbounds i8, i8* %9, i64 1
%11 = load i8, i8* %10
switch i8 %11, label %8 [
i8 32, label %12
i8 0, label %16
]
12: ; preds = %8
%13 = getelementptr inbounds i8, i8* %9, i64 2
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %4
16: ; preds = %12, %8, %1
%17 = phi i32 [ 0, %1 ], [ %7, %8 ], [ %7, %12 ]
ret i32 %17
}