xunge/DecIR huggingface dataset:
/* Forward declarations */
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
typedef int /*<<< orphan*/ sigset_t;
struct TYPE_3__ {
  int si_signo;
};
typedef TYPE_1__ siginfo_t;

/* Variables and functions */
scalar_t__ sigtimedwait(int /*<<< orphan*/ const *, TYPE_1__ *,
                        int /*<<< orphan*/ *);
int sigwait(const sigset_t *mask, int *sig) {
  siginfo_t si;
  if (sigtimedwait(mask, &si, NULL) < 0)
    return -1;
  *sig = si.si_signo;
  return 0;
}


x86 assembly (clang, -O0):
<sigwait>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x20(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <sigtimedwait@plt>
cmp    $0x0,%rax
jge    1147 <sigwait+0x37>
movl   $0xffffffff,-0x4(%rbp)
jmp    1157 <sigwait+0x47>
mov    -0x20(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sigwait>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
xor    %ebx,%ebx
mov    %rsp,%rsi
xor    %edx,%edx
call   1030 <sigtimedwait@plt>
test   %rax,%rax
js     1130 <sigwait+0x20>
mov    (%rsp),%eax
mov    %eax,(%r14)
jmp    1135 <sigwait+0x25>
mov    $0xffffffff,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
%struct.TYPE_3__ = type { i32 }
define i32 @sigwait(i32* %0, i32* nocapture writeonly %1) {
%3 = alloca %struct.TYPE_3__
%4 = bitcast %struct.TYPE_3__* %3 to i8*
%5 = call i64 @sigtimedwait(i32* %0, %struct.TYPE_3__* %3, i32* null)
%6 = icmp slt i64 %5, 0
br i1 %6, label %10, label %7
7: ; preds = %2
%8 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %3, i64 0, i32 0
%9 = load i32, i32* %8
store i32 %9, i32* %1
br label %10
10: ; preds = %2, %7
%11 = phi i32 [ 0, %7 ], [ -1, %2 ]
ret i32 %11
}
/* Variables and functions */
int syscall(int, int);
int unshare(int flags) { return syscall(337, flags); }


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

x86 assembly (clang, -O2):
<unshare>:
mov    %edi,%esi
mov    $0x151,%edi
jmp    1030 <syscall@plt>

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

LLVM IR (-O2):
define i32 @unshare(i32 %0) {
%2 = tail call i32 @syscall(i32 337, i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int is_pandigital(int, int);
void is_pandigital_test(void) {
  assert(is_pandigital(728456139, 9));
  assert(is_pandigital(12345, 5));
  assert(!is_pandigital(7284561391L, 9));
  assert(!is_pandigital(12345, 6));
}


x86 assembly (clang, -O0):
<is_pandigital_test>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2b6b5bcb,%edi
mov    $0x9,%esi
call   1040 <is_pandigital@plt>
mov    %eax,%edi
call   1030 <assert@plt>
mov    $0x3039,%edi
mov    $0x5,%esi
call   1040 <is_pandigital@plt>
mov    %eax,%edi
call   1030 <assert@plt>
mov    $0xb23195ef,%edi
mov    $0x9,%esi
call   1040 <is_pandigital@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    $0x3039,%edi
mov    $0x6,%esi
call   1040 <is_pandigital@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_pandigital_test>:
push   %rax
mov    $0x2b6b5bcb,%edi
mov    $0x9,%esi
call   1040 <is_pandigital@plt>
mov    %eax,%edi
call   1030 <assert@plt>
mov    $0x3039,%edi
mov    $0x5,%esi
call   1040 <is_pandigital@plt>
mov    %eax,%edi
call   1030 <assert@plt>
mov    $0xb23195ef,%edi
mov    $0x9,%esi
call   1040 <is_pandigital@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1030 <assert@plt>
mov    $0x3039,%edi
mov    $0x6,%esi
call   1040 <is_pandigital@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
pop    %rax
jmp    1030 <assert@plt>

LLVM IR (-O0):
define void @is_pandigital_test() {
%1 = call i32 @is_pandigital(i32 728456139, i32 9)
%2 = call i32 @assert(i32 %1)
%3 = call i32 @is_pandigital(i32 12345, i32 5)
%4 = call i32 @assert(i32 %3)
%5 = call i32 @is_pandigital(i32 -1305373201, i32 9)
%6 = icmp ne i32 %5, 0
%7 = xor i1 %6, true
%8 = zext i1 %7 to i32
%9 = call i32 @assert(i32 %8)
%10 = call i32 @is_pandigital(i32 12345, i32 6)
%11 = icmp ne i32 %10, 0
%12 = xor i1 %11, true
%13 = zext i1 %12 to i32
%14 = call i32 @assert(i32 %13)
ret void
}

LLVM IR (-O2):
define void @is_pandigital_test() {
%1 = tail call i32 @is_pandigital(i32 728456139, i32 9)
%2 = tail call i32 @assert(i32 %1)
%3 = tail call i32 @is_pandigital(i32 12345, i32 5)
%4 = tail call i32 @assert(i32 %3)
%5 = tail call i32 @is_pandigital(i32 -1305373201, i32 9)
%6 = icmp eq i32 %5, 0
%7 = zext i1 %6 to i32
%8 = tail call i32 @assert(i32 %7)
%9 = tail call i32 @is_pandigital(i32 12345, i32 6)
%10 = icmp eq i32 %9, 0
%11 = zext i1 %10 to i32
%12 = tail call i32 @assert(i32 %11)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cput_hex_byte(int);
void cput_hex_word(int n) {
  cput_hex_byte(n >> 8);
  cput_hex_byte(n);
}


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

x86 assembly (clang, -O2):
<cput_hex_word>:
push   %rbx
mov    %edi,%ebx
sar    $0x8,%edi
call   1030 <cput_hex_byte@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <cput_hex_byte@plt>

LLVM IR (-O0):
define void @cput_hex_word(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 8
%5 = call i32 @cput_hex_byte(i32 %4)
%6 = load i32, i32* %2
%7 = call i32 @cput_hex_byte(i32 %6)
ret void
}

LLVM IR (-O2):
define void @cput_hex_word(i32 %0) {
%2 = ashr i32 %0, 8
%3 = tail call i32 @cput_hex_byte(i32 %2)
%4 = tail call i32 @cput_hex_byte(i32 %0)
ret void
}
char *index(s, c)
char *s;
int c;
{ return strchr(s, c); }


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

x86 assembly (clang, -O2):
<index>:
jmp    1030 <strchr@plt>

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

LLVM IR (-O2):
define i8* @index(i8* %0, i32 %1) {
%3 = tail call i8* @strchr(i8* dereferenceable(1) %0, i32 %1)
ret i8* %3
}
double kronecker_delta(double i, double j) {
  if (i == j) {
    return 1.0;
  }
  return 0.0;
}


x86 assembly (clang, -O0):
<kronecker_delta>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
ucomisd -0x18(%rbp),%xmm0
jne    1136 <kronecker_delta+0x36>
jp     1136 <kronecker_delta+0x36>
movsd  0xed4(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    113e <kronecker_delta+0x3e>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<kronecker_delta>:
cmpeqsd %xmm1,%xmm0
movsd  0xef3(%rip),%xmm1
andpd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @kronecker_delta(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %4
store double %1, double* %5
%6 = load double, double* %4
%7 = load double, double* %5
%8 = fcmp oeq double %6, %7
br i1 %8, label %9, label %10
9: ; preds = %2
store double 1.000000e+00, double* %3
br label %11
10: ; preds = %2
store double 0.000000e+00, double* %3
br label %11
11: ; preds = %10, %9
%12 = load double, double* %3
ret double %12
}

LLVM IR (-O2):
define double @kronecker_delta(double %0, double %1) {
%3 = fcmp oeq double %0, %1
%4 = select i1 %3, double 1.000000e+00, double 0.000000e+00
ret double %4
}
/* Type definitions */
struct robust_list_head {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ __NR_set_robust_list;
long syscall(int /*<<< orphan*/, struct robust_list_head *, size_t);
long __set_robust_list(struct robust_list_head *lhp, size_t len) {
  return syscall(__NR_set_robust_list, lhp, len);
}


x86 assembly (clang, -O0):
<__set_robust_list>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eb9(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1030 <syscall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__set_robust_list>:
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    0x2ec3(%rip),%rax
mov    (%rax),%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
%struct.robust_list_head = type { i32 }
@__NR_set_robust_list = global i32 0
define i64 @__set_robust_list(%struct.robust_list_head* %0, i64 %1) {
%3 = alloca %struct.robust_list_head*
%4 = alloca i64
store %struct.robust_list_head* %0, %struct.robust_list_head** %3
store i64 %1, i64* %4
%5 = load i32, i32* @__NR_set_robust_list
%6 = load %struct.robust_list_head*, %struct.robust_list_head** %3
%7 = load i64, i64* %4
%8 = call i64 @syscall(i32 %5, %struct.robust_list_head* %6, i64 %7)
ret i64 %8
}

LLVM IR (-O2):
%struct.robust_list_head = type { i32 }
@__NR_set_robust_list = global i32 0
define i64 @__set_robust_list(%struct.robust_list_head* %0, i64 %1) {
%3 = load i32, i32* @__NR_set_robust_list
%4 = tail call i64 @syscall(i32 %3, %struct.robust_list_head* %0, i64 %1)
ret i64 %4
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ binary_search();
int /*<<< orphan*/ linear_search(int, int *, int);
int main() {
  int array[5] = {1, 3, 2, 7, 6};
  linear_search(5, array, 7);
  binary_search();
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xec5(%rip),%eax
mov    %eax,-0x10(%rbp)
lea    -0x20(%rbp),%rsi
mov    $0x5,%edi
mov    $0x7,%edx
call   1030 <linear_search@plt>
mov    $0x0,%al
call   1040 <binary_search@plt>
mov    0x2e71(%rip),%rax
mov    (%rax),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
mov    0xee6(%rip),%eax
mov    %eax,0x10(%rsp)
movaps 0xecb(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rsi
mov    $0x5,%edi
mov    $0x7,%edx
call   1030 <linear_search@plt>
xor    %eax,%eax
call   1040 <binary_search@plt>
mov    0x2e87(%rip),%rax
mov    (%rax),%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.array = [5 x i32] [i32 1, i32 3, i32 2, i32 7, i32 6]
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca [5 x i32]
store i32 0, i32* %1
%3 = bitcast [5 x i32]* %2 to i8*
%4 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
%5 = call i32 @linear_search(i32 5, i32* %4, i32 7)
%6 = call i32 (...) @binary_search()
%7 = load i32, i32* @EXIT_SUCCESS
ret i32 %7
}

LLVM IR (-O2):
@__const.main.array = [5 x i32] [i32 1, i32 3, i32 2, i32 7, i32 6]
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca [5 x i32]
%2 = bitcast [5 x i32]* %1 to i8*
%3 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
%4 = call i32 @linear_search(i32 5, i32* %3, i32 7)
%5 = call i32 (...) @binary_search()
%6 = load i32, i32* @EXIT_SUCCESS
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void badusage(void) {
  fprintf(stderr, "Usage: \n");
  fprintf(stderr, "gpcomp [-ip d/s[dr]] [-op d/s] [-silent] [-v] [-l/-h] [-f] "
                  "inf1 inf2 outf.\n");
  exit(1);
}


x86 assembly (clang, -O0):
<badusage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2ea0(%rip),%rax
mov    (%rax),%edi
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<badusage>:
push   %rbx
mov    0x2eb8(%rip),%rbx
mov    (%rbx),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xeca(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [9 x i8] c"Usage: \0A\00"
@.str.1 = [76 x i8] c"gpcomp [-ip d/s[dr]] [-op d/s] [-silent] [-v] [-l/-h] [-f] inf1 inf2 outf.\0A\00"
define void @badusage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [9 x i8] c"Usage: \0A\00"
@.str.1 = [76 x i8] c"gpcomp [-ip d/s[dr]] [-op d/s] [-silent] [-v] [-l/-h] [-f] inf1 inf2 outf.\0A\00"
define void @badusage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ rdar8405222_aux(int);
void rdar8405222() {
  const int show = 0;
  int i = 0;
  if (show)
    i = 5;
  if (show)
    rdar8405222_aux(i);
}


x86 assembly (clang, -O0):
<rdar8405222>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @rdar8405222() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
ret void
}

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


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

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

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

LLVM IR (-O2):
define void @run_monopole_corr_p3m() {
ret void
}
int dev_add_bb_dev(char *filename, const char *name) { return 0; }


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

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

LLVM IR (-O0):
define i32 @dev_add_bb_dev(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
ret i32 0
}

LLVM IR (-O2):
define i32 @dev_add_bb_dev(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(int status) {
  fprintf(stderr, "Usage: lock-crasher [-t threadcount] [-w] pathname\n");
  exit(status);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
lea    0xec5(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x4(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    %edi,%ebx
mov    0x2eb6(%rip),%rax
mov    (%rax),%edi
lea    0xecd(%rip),%rsi
call   1030 <fprintf@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [52 x i8] c"Usage: lock-crasher [-t threadcount] [-w] pathname\0A\00"
define void @usage(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* %2
%6 = call i32 @exit(i32 %5)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [52 x i8] c"Usage: lock-crasher [-t threadcount] [-w] pathname\0A\00"
define void @usage(i32 %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @exit(i32 %0)
unreachable
}
/* Variables and functions */
void free(void *);
void align_free(void *ptr) { return free(ptr); }


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

x86 assembly (clang, -O2):
<align_free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @align_free(i8* nocapture %0) {
tail call void @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ xor_decode_uint(unsigned int *, unsigned int const *, size_t,
                                   unsigned int *, int);
void caesar_decode_uint(unsigned int *dec, const unsigned int *enc, size_t len,
                        unsigned int key) {
  xor_decode_uint(dec, enc, len, &key, 1);
}


x86 assembly (clang, -O0):
<caesar_decode_uint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
lea    -0x1c(%rbp),%rcx
mov    $0x1,%r8d
call   1030 <xor_decode_uint@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<caesar_decode_uint>:
push   %rax
mov    %ecx,0x4(%rsp)
lea    0x4(%rsp),%rcx
mov    $0x1,%r8d
call   1030 <xor_decode_uint@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @caesar_decode_uint(i32* %0, i32* %1, i64 %2, i32 %3) {
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i64
%8 = alloca i32
store i32* %0, i32** %5
store i32* %1, i32** %6
store i64 %2, i64* %7
store i32 %3, i32* %8
%9 = load i32*, i32** %5
%10 = load i32*, i32** %6
%11 = load i64, i64* %7
%12 = call i32 @xor_decode_uint(i32* %9, i32* %10, i64 %11, i32* %8, i32 1)
ret void
}

LLVM IR (-O2):
define void @caesar_decode_uint(i32* %0, i32* %1, i64 %2, i32 %3) {
%5 = alloca i32
store i32 %3, i32* %5
%6 = call i32 @xor_decode_uint(i32* %0, i32* %1, i64 %2, i32* %5, i32 1)
ret void
}
void foo_2_2_1_1_2_2_2_2_2() {}


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

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

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

LLVM IR (-O2):
define void @foo_2_2_1_1_2_2_2_2_2() {
ret void
}
/* Type definitions */
struct tms {
  scalar_t__ tms_stime;
  scalar_t__ tms_utime;
};
typedef scalar_t__ clock_t;

/* Variables and functions */
int /*<<< orphan*/ times(struct tms *);
clock_t clock(void) {
  struct tms buf;
  times(&buf);
  return (unsigned long)buf.tms_utime + buf.tms_stime;
}


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

x86 assembly (clang, -O2):
<clock>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
call   1030 <times@plt>
mov    0x8(%rsp),%rax
add    0x10(%rsp),%rax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.tms = type { i64, i64 }
define i64 @clock() {
%1 = alloca %struct.tms
%2 = call i32 @times(%struct.tms* %1)
%3 = getelementptr inbounds %struct.tms, %struct.tms* %1, i32 0, i32 1
%4 = load i64, i64* %3
%5 = getelementptr inbounds %struct.tms, %struct.tms* %1, i32 0, i32 0
%6 = load i64, i64* %5
%7 = add i64 %4, %6
ret i64 %7
}

LLVM IR (-O2):
%struct.tms = type { i64, i64 }
define i64 @clock() {
%1 = alloca %struct.tms
%2 = bitcast %struct.tms* %1 to i8*
%3 = call i32 @times(%struct.tms* %1)
%4 = getelementptr inbounds %struct.tms, %struct.tms* %1, i64 0, i32 1
%5 = load i64, i64* %4
%6 = getelementptr inbounds %struct.tms, %struct.tms* %1, i64 0, i32 0
%7 = load i64, i64* %6
%8 = add i64 %7, %5
ret i64 %8
}
void diag_dtc_init(void) {}


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

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

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

LLVM IR (-O2):
define void @diag_dtc_init() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
int main() {
  char c = (char)((unsigned char)~0 >> 1);
  printf("signed char max: %d\n", c);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [21 x i8] c"signed char max: %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8 signext 127)
ret i32 0
}
float average(float x, float y, float z) { return (x + y + z) / 3; }


x86 assembly (clang, -O0):
<average>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
addss  -0x8(%rbp),%xmm0
addss  -0xc(%rbp),%xmm0
movss  0xed6(%rip),%xmm1
divss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<average>:
addss  %xmm1,%xmm0
addss  %xmm2,%xmm0
divss  0xef0(%rip),%xmm0
ret

LLVM IR (-O0):
define float @average(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%7 = load float, float* %4
%8 = load float, float* %5
%9 = fadd float %7, %8
%10 = load float, float* %6
%11 = fadd float %9, %10
%12 = fdiv float %11, 3.000000e+00
ret float %12
}

LLVM IR (-O2):
define float @average(float %0, float %1, float %2) {
%4 = fadd float %0, %1
%5 = fadd float %4, %2
%6 = fdiv float %5, 3.000000e+00
ret float %6
}
/* Type definitions */
typedef int /*<<< orphan*/ sigset_t;

/* Variables and functions */
int /*<<< orphan*/ SIG_SETMASK;
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sigfillset(int /*<<< orphan*/ *);
int /*<<< orphan*/ sigprocmask(int /*<<< orphan*/, int /*<<< orphan*/ *,
                               int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
int main() {
  sigset_t mask;
  sigfillset(&mask);
  sigprocmask(SIG_SETMASK, &mask, 0);
  printf("Signals are blocked\n");
  fflush(stdout);
  for (;;)
    ;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x8(%rbp),%rdi
call   1050 <sigfillset@plt>
mov    0x2e89(%rip),%rax
mov    (%rax),%edi
lea    -0x8(%rbp),%rsi
xor    %edx,%edx
call   1030 <sigprocmask@plt>
lea    0xe8d(%rip),%rdi
call   1040 <printf@plt>
mov    0x2e59(%rip),%rax
mov    (%rax),%edi
call   1060 <fflush@plt>
jmp    1186 <main+0x46>

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
call   1050 <sigfillset@plt>
mov    0x2e8f(%rip),%rax
mov    (%rax),%edi
mov    %rbx,%rsi
xor    %edx,%edx
call   1030 <sigprocmask@plt>
lea    0xe94(%rip),%rdi
call   1040 <puts@plt>
mov    0x2e60(%rip),%rax
mov    (%rax),%edi
call   1060 <fflush@plt>
nop
jmp    1180 <main+0x40>

LLVM IR (-O0):
@SIG_SETMASK = global i32 0
@.str = [21 x i8] c"Signals are blocked\0A\00"
@stdout = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @sigfillset(i32* %2)
%4 = load i32, i32* @SIG_SETMASK
%5 = call i32 @sigprocmask(i32 %4, i32* %2, i32 0)
%6 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* @stdout
%8 = call i32 @fflush(i32 %7)
br label %9
9: ; preds = %9, %0
br label %9
}

LLVM IR (-O2):
@SIG_SETMASK = global i32 0
@stdout = global i32 0
@str = [20 x i8] c"Signals are blocked\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @sigfillset(i32* %1)
%4 = load i32, i32* @SIG_SETMASK
%5 = call i32 @sigprocmask(i32 %4, i32* %1, i32 0)
%6 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
%7 = load i32, i32* @stdout
%8 = call i32 @fflush(i32 %7)
br label %9
9: ; preds = %9, %0
br label %9
}
/* Variables and functions */
int pci_conf_read(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/,
                  int, int, unsigned long *);
int pci_sanity_check(void) {
  unsigned long value;
  int result;
  result = pci_conf_read(0, 0, 0, 0x0a, 2, &value);
  if (result == 0) {
    result = -1;
    if (value == 0x0600) {
      result = 0;
    }
  }
  return result;
}


x86 assembly (clang, -O0):
<pci_sanity_check>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %edx,%edx
mov    $0xa,%ecx
mov    $0x2,%r8d
lea    -0x8(%rbp),%r9
mov    %edx,%edi
mov    %edx,%esi
call   1030 <pci_conf_read@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1160 <pci_sanity_check+0x50>
movl   $0xffffffff,-0xc(%rbp)
cmpq   $0x600,-0x8(%rbp)
jne    115b <pci_sanity_check+0x4b>
movl   $0x0,-0xc(%rbp)
jmp    1160 <pci_sanity_check+0x50>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pci_sanity_check>:
push   %rax
mov    %rsp,%r9
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
mov    $0xa,%ecx
mov    $0x2,%r8d
call   1030 <pci_conf_read@plt>
xor    %ecx,%ecx
cmpq   $0x600,(%rsp)
setne  %cl
neg    %ecx
test   %eax,%eax
cmove  %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @pci_sanity_check() {
%1 = alloca i64
%2 = bitcast i64* %1 to i8*
%3 = call i32 @pci_conf_read(i32 0, i32 0, i32 0, i32 10, i32 2, i64* %1)
%4 = icmp eq i32 %3, 0
%5 = load i64, i64* %1
%6 = icmp ne i64 %5, 1536
%7 = sext i1 %6 to i32
%8 = select i1 %4, i32 %7, i32 %3
ret i32 %8
}
/* Variables and functions */
int smp_call_function(void (*)(void *), void *, int, int);
__attribute__((always_)) int on_each_cpu(void (*func)(void *info), void *info,
                                         int retry, int wait) {
  int ret = 0;
  do {
  } while (0);
  ret = smp_call_function(func, info, retry, wait);
  func(info);
  do {
  } while (0);
  return ret;
}


x86 assembly (clang, -O0):
<on_each_cpu>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
jmp    1132 <on_each_cpu+0x22>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
call   1030 <smp_call_function@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rdi
call   *%rax
jmp    1157 <on_each_cpu+0x47>
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<on_each_cpu>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%r14
call   1030 <smp_call_function@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   *%r14
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @on_each_cpu(void (i8*)* %0, i8* %1, i32 %2, i32 %3) {
%5 = tail call i32 @smp_call_function(void (i8*)* %0, i8* %1, i32 %2, i32 %3)
tail call void %0(i8* %1)
ret i32 %5
}
/* Variables and functions */
scalar_t__ distance(int, int);
int responsability(int predi, int i, int k) {
  if (distance(k, i) < distance(k, predi))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<responsability>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x10(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <distance@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <distance@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
cmp    %rcx,%rax
jge    1157 <responsability+0x47>
movl   $0x1,-0x4(%rbp)
jmp    115e <responsability+0x4e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<responsability>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebx
mov    %edi,%r14d
mov    %edx,%edi
call   1030 <distance@plt>
mov    %rax,%rbp
mov    %ebx,%edi
mov    %r14d,%esi
call   1030 <distance@plt>
xor    %ecx,%ecx
cmp    %rax,%rbp
setl   %cl
mov    %ecx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @responsability(i32 %0, i32 %1, i32 %2) {
%4 = tail call i64 @distance(i32 %2, i32 %1)
%5 = tail call i64 @distance(i32 %2, i32 %0)
%6 = icmp slt i64 %4, %5
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ busy_wait();
scalar_t__ used_empty();
void poll_used(void) {
  while (used_empty())
    busy_wait();
}


x86 assembly (clang, -O0):
<poll_used>:
push   %rbp
mov    %rsp,%rbp
jmp    1129 <poll_used+0x9>
mov    $0x0,%al
call   1040 <used_empty@plt>
cmp    $0x0,%rax
je     1146 <poll_used+0x26>
mov    $0x0,%al
call   1030 <busy_wait@plt>
jmp    1129 <poll_used+0x9>
pop    %rbp
ret

x86 assembly (clang, -O2):
<poll_used>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <used_empty@plt>
test   %rax,%rax
je     1145 <poll_used+0x25>
xor    %eax,%eax
call   1030 <busy_wait@plt>
jmp    1130 <poll_used+0x10>
pop    %rax
ret

LLVM IR (-O0):
define void @poll_used() {
br label %1
1: ; preds = %4, %0
%2 = call i64 (...) @used_empty()
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = call i32 (...) @busy_wait()
br label %1
6: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @poll_used() {
%1 = tail call i64 (...) @used_empty()
%2 = icmp eq i64 %1, 0
br i1 %2, label %7, label %3
3: ; preds = %0, %3
%4 = tail call i32 (...) @busy_wait()
%5 = tail call i64 (...) @used_empty()
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %3
7: ; preds = %3, %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gets(char *);
int /*<<< orphan*/ kfork(char *);
int /*<<< orphan*/ printf(char *);
int do_kforkcustom() {
  char filename[64];
  printf("Filename? ");
  gets(filename);
  kfork(filename);
}


x86 assembly (clang, -O0):
<do_kforkcustom>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
lea    -0x50(%rbp),%rdi
call   1050 <gets@plt>
lea    -0x50(%rbp),%rdi
call   1040 <kfork@plt>
mov    -0x4(%rbp),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_kforkcustom>:
push   %rbx
sub    $0x40,%rsp
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1050 <gets@plt>
mov    %rbx,%rdi
call   1040 <kfork@plt>
add    $0x40,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"Filename? \00"
define i32 @do_kforkcustom() {
%1 = alloca i32
%2 = alloca [64 x i8]
%3 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%4 = getelementptr inbounds [64 x i8], [64 x i8]* %2, i64 0, i64 0
%5 = call i32 @gets(i8* %4)
%6 = getelementptr inbounds [64 x i8], [64 x i8]* %2, i64 0, i64 0
%7 = call i32 @kfork(i8* %6)
%8 = load i32, i32* %1
ret i32 %8
}

LLVM IR (-O2):
@.str = [11 x i8] c"Filename? \00"
define i32 @do_kforkcustom() {
%1 = alloca [64 x i8]
%2 = getelementptr inbounds [64 x i8], [64 x i8]* %1, i64 0, i64 0
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @gets(i8* %2)
%5 = call i32 @kfork(i8* %2)
ret i32 undef
}
/* Variables and functions */
scalar_t__ strcmp(char const *, char *);
int start_line(const char *line) {
  if (strcmp(line + 10, " _start\n") == 0)
    return 1;
  else if (strcmp(line + 18, " _start\n") == 0)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<start_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
add    $0xa,%rdi
lea    0xed5(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    1146 <start_line+0x36>
movl   $0x1,-0x4(%rbp)
jmp    117c <start_line+0x6c>
mov    -0x10(%rbp),%rdi
add    $0x12,%rdi
lea    0xeab(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    1170 <start_line+0x60>
movl   $0x1,-0x4(%rbp)
jmp    117c <start_line+0x6c>
jmp    1175 <start_line+0x65>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<start_line>:
push   %rbx
mov    %rdi,%rbx
add    $0xa,%rdi
lea    0xee1(%rip),%rsi
call   1030 <strcmp@plt>
test   %rax,%rax
je     1149 <start_line+0x39>
add    $0x12,%rbx
lea    0xecc(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
sete   %al
pop    %rbx
ret
mov    $0x1,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [9 x i8] c" _start\0A\00"
define i32 @start_line(i8* %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 10
%3 = tail call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i64 %3, 0
br i1 %4, label %10, label %5
5: ; preds = %1
%6 = getelementptr inbounds i8, i8* %0, i64 18
%7 = tail call i64 @strcmp(i8* %6, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%8 = icmp eq i64 %7, 0
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %5, %1
%11 = phi i32 [ 1, %1 ], [ %9, %5 ]
ret i32 %11
}
int bar(volatile int a) { return (short)a; }


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

x86 assembly (clang, -O2):
<bar>:
mov    %edi,-0x4(%rsp)
mov    -0x4(%rsp),%eax
cwtl
ret

LLVM IR (-O0):
define i32 @bar(i32 %0) {
%2 = alloca i32
store volatile i32 %0, i32* %2
%3 = load volatile i32, i32* %2
%4 = trunc i32 %3 to i16
%5 = sext i16 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @bar(i32 %0) {
%2 = alloca i32
store volatile i32 %0, i32* %2
%3 = load volatile i32, i32* %2
%4 = shl i32 %3, 16
%5 = ashr exact i32 %4, 16
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ Msg(char *);
int /*<<< orphan*/ initialize();
int /*<<< orphan*/ play();
int pl_main(void) {
  initialize();
  Msg("Aye aye, Sir");
  play();
  return 0;
}


x86 assembly (clang, -O0):
<pl_main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <initialize@plt>
lea    0xebe(%rip),%rdi
call   1030 <Msg@plt>
mov    $0x0,%al
call   1050 <play@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pl_main>:
push   %rax
xor    %eax,%eax
call   1040 <initialize@plt>
lea    0xec1(%rip),%rdi
call   1030 <Msg@plt>
xor    %eax,%eax
call   1050 <play@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"Aye aye, Sir\00"
define i32 @pl_main() {
%1 = call i32 (...) @initialize()
%2 = call i32 @Msg(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @play()
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"Aye aye, Sir\00"
define i32 @pl_main() {
%1 = tail call i32 (...) @initialize()
%2 = tail call i32 @Msg(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @play()
ret i32 0
}
double Abs(double a) { return a > 0 ? a : -a; }


x86 assembly (clang, -O0):
<Abs>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    112a <Abs+0x2a>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    114b <Abs+0x4b>
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<Abs>:
movapd 0xef8(%rip),%xmm1
xorpd  %xmm0,%xmm1
xorpd  %xmm2,%xmm2
cmpltsd %xmm0,%xmm2
andpd  %xmm2,%xmm0
andnpd %xmm1,%xmm2
orpd   %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @Abs(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp ogt double %3, 0.000000e+00
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = load double, double* %2
br label %10
7: ; preds = %1
%8 = load double, double* %2
%9 = fneg double %8
br label %10
10: ; preds = %7, %5
%11 = phi double [ %6, %5 ], [ %9, %7 ]
ret double %11
}

LLVM IR (-O2):
define double @Abs(double %0) {
%2 = fcmp ogt double %0, 0.000000e+00
%3 = fneg double %0
%4 = select i1 %2, double %0, double %3
ret double %4
}
unsigned char min(unsigned char x) { return 0; }


x86 assembly (clang, -O0):
<min>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
xor    %eax,%eax
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define zeroext i8 @min(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
ret i8 0
}

LLVM IR (-O2):
define zeroext i8 @min(i8 zeroext %0) {
ret i8 0
}
/* Variables and functions */
scalar_t__ llist_nrItems();
char llist_excist() {
  if (llist_nrItems() != 0) {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<llist_excist>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <llist_nrItems@plt>
cmp    $0x0,%rax
je     1132 <llist_excist+0x22>
movb   $0x1,-0x1(%rbp)
jmp    1136 <llist_excist+0x26>
movb   $0x0,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<llist_excist>:
push   %rax
xor    %eax,%eax
call   1030 <llist_nrItems@plt>
test   %rax,%rax
setne  %al
pop    %rcx
ret

LLVM IR (-O0):
define signext i8 @llist_excist() {
%1 = alloca i8
%2 = call i64 (...) @llist_nrItems()
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %0
store i8 1, i8* %1
br label %6
5: ; preds = %0
store i8 0, i8* %1
br label %6
6: ; preds = %5, %4
%7 = load i8, i8* %1
ret i8 %7
}

LLVM IR (-O2):
define signext i8 @llist_excist() {
%1 = tail call i64 (...) @llist_nrItems()
%2 = icmp ne i64 %1, 0
%3 = zext i1 %2 to i8
ret i8 %3
}
/* Type definitions */
typedef int uint8_t;
typedef int int32_t;

/* Variables and functions */
int32_t get_int32(uint8_t *buf) {
  int32_t res;
  res = buf[0] << 24 | buf[1] << 16 | buf[2] << 8 | buf[3];
  return res;
}


x86 assembly (clang, -O0):
<get_int32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
shl    $0x18,%eax
mov    -0x8(%rbp),%rcx
mov    0x4(%rcx),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    0x8(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
or     0xc(%rcx),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_int32>:
mov    (%rdi),%eax
mov    0x4(%rdi),%ecx
shl    $0x18,%eax
shl    $0x10,%ecx
or     %eax,%ecx
mov    0x8(%rdi),%eax
shl    $0x8,%eax
or     %ecx,%eax
or     0xc(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @get_int32(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = getelementptr inbounds i32, i32* %4, i64 0
%6 = load i32, i32* %5
%7 = shl i32 %6, 24
%8 = load i32*, i32** %2
%9 = getelementptr inbounds i32, i32* %8, i64 1
%10 = load i32, i32* %9
%11 = shl i32 %10, 16
%12 = or i32 %7, %11
%13 = load i32*, i32** %2
%14 = getelementptr inbounds i32, i32* %13, i64 2
%15 = load i32, i32* %14
%16 = shl i32 %15, 8
%17 = or i32 %12, %16
%18 = load i32*, i32** %2
%19 = getelementptr inbounds i32, i32* %18, i64 3
%20 = load i32, i32* %19
%21 = or i32 %17, %20
store i32 %21, i32* %3
%22 = load i32, i32* %3
ret i32 %22
}

LLVM IR (-O2):
define i32 @get_int32(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = shl i32 %2, 24
%4 = getelementptr inbounds i32, i32* %0, i64 1
%5 = load i32, i32* %4
%6 = shl i32 %5, 16
%7 = or i32 %6, %3
%8 = getelementptr inbounds i32, i32* %0, i64 2
%9 = load i32, i32* %8
%10 = shl i32 %9, 8
%11 = or i32 %7, %10
%12 = getelementptr inbounds i32, i32* %0, i64 3
%13 = load i32, i32* %12
%14 = or i32 %11, %13
ret i32 %14
}
/* Variables and functions */
int WEXITSTATUS(int const);
int os_wexitstatus(const int r) { return WEXITSTATUS(r); }


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

x86 assembly (clang, -O2):
<os_wexitstatus>:
jmp    1030 <WEXITSTATUS@plt>

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

LLVM IR (-O2):
define i32 @os_wexitstatus(i32 %0) {
%2 = tail call i32 @WEXITSTATUS(i32 %0)
ret i32 %2
}
void fd252(int n) {
P0A:
  goto P0A;
  {
    typedef int(*b)[n];
  P01A:
    goto P01A;
    {
      typedef int(*c)[n];
    P012A:
      goto P012A;
      0;
    }
  P01B:
    goto P01B;
    {
      typedef int(*d)[n];
    P013A:
      goto P013A;
      0;
    }
  P01C:
    goto P01C;
    ;
    typedef int(*e)[n];
  P014A:
    goto P014A;
    0;
  };
P0B:
  goto P0B;
  {
    typedef int(*f)[n];
  P02A:
    goto P02A;
    {
      typedef int(*g)[n];
    P024A:
      goto P024A;
      0;
    };
  P02B:
    goto P02B;
    {
      typedef int(*h)[n];
    P025A:
      goto P025A;
      0;
    };
  P02C:
    goto P02C;
    ;
    typedef int(*i)[n];
  P026A:
    goto P026A;
    0;
  };
p0C:
  goto p0C;
  goto a;
a:;
  typedef int(*j)[n];
P03A:
  goto P03A;
  0;
P03B:
  goto P03B;
}


x86 assembly (clang, -O0):
<fd252>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
jmp    1107 <fd252+0x7>

x86 assembly (clang, -O2):
<fd252>:
jmp    1100 <fd252>

LLVM IR (-O0):
define void @fd252(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %3, %1
br label %3
4: ; No predecessors!
%5 = load i32, i32* %2
%6 = zext i32 %5 to i64
br label %7
7: ; preds = %7, %4
br label %7
8: ; No predecessors!
%9 = load i32, i32* %2
%10 = zext i32 %9 to i64
br label %11
11: ; preds = %11, %8
br label %11
12: ; preds = %12
br label %12
13: ; No predecessors!
%14 = load i32, i32* %2
%15 = zext i32 %14 to i64
br label %16
16: ; preds = %16, %13
br label %16
17: ; preds = %17
br label %17
18: ; No predecessors!
%19 = load i32, i32* %2
%20 = zext i32 %19 to i64
br label %21
21: ; preds = %21, %18
br label %21
22: ; preds = %22
br label %22
23: ; No predecessors!
%24 = load i32, i32* %2
%25 = zext i32 %24 to i64
br label %26
26: ; preds = %26, %23
br label %26
27: ; No predecessors!
%28 = load i32, i32* %2
%29 = zext i32 %28 to i64
br label %30
30: ; preds = %30, %27
br label %30
31: ; preds = %31
br label %31
32: ; No predecessors!
%33 = load i32, i32* %2
%34 = zext i32 %33 to i64
br label %35
35: ; preds = %35, %32
br label %35
36: ; preds = %36
br label %36
37: ; No predecessors!
%38 = load i32, i32* %2
%39 = zext i32 %38 to i64
br label %40
40: ; preds = %40, %37
br label %40
41: ; preds = %41
br label %41
42: ; No predecessors!
%43 = load i32, i32* %2
%44 = zext i32 %43 to i64
br label %45
45: ; preds = %45, %42
br label %45
46: ; preds = %46
br label %46
}

LLVM IR (-O2):
define void @fd252(i32 %0) {
br label %2
2: ; preds = %2, %1
br label %2
}
const char *timeout_vendor(void) { return "william@25thandClement.com"; }


x86 assembly (clang, -O0):
<timeout_vendor>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [27 x i8] c"william@25thandClement.com\00"
define i8* @timeout_vendor() {
ret i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [27 x i8] c"william@25thandClement.com\00"
define i8* @timeout_vendor() {
ret i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0)
}