xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ d6();
int nd6(int amount) {
  if (amount <= 0) {
    return -1;
  }
  int value = 0;
  for (int i = 0; i < amount; i++) {
    value += d6();
  }
  return value;
}


x86 assembly (clang, -O0):
<nd6>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jg     1131 <nd6+0x21>
movl   $0xffffffff,-0x4(%rbp)
jmp    1173 <nd6+0x63>
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    116d <nd6+0x5d>
mov    $0x0,%al
call   1030 <d6@plt>
mov    %rax,%rcx
movslq -0xc(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    113f <nd6+0x2f>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nd6>:
push   %rbp
push   %rbx
push   %rax
test   %edi,%edi
jle    1130 <nd6+0x20>
mov    %edi,%ebx
xor    %ebp,%ebp
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <d6@plt>
add    %eax,%ebp
add    $0xffffffff,%ebx
jne    1120 <nd6+0x10>
jmp    1135 <nd6+0x25>
mov    $0xffffffff,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @nd6(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
%6 = load i32, i32* %3
%7 = icmp sle i32 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %1
store i32 -1, i32* %2
br label %25
9: ; preds = %1
store i32 0, i32* %4
store i32 0, i32* %5
br label %10
10: ; preds = %20, %9
%11 = load i32, i32* %5
%12 = load i32, i32* %3
%13 = icmp slt i32 %11, %12
br i1 %13, label %14, label %23
14: ; preds = %10
%15 = call i64 (...) @d6()
%16 = load i32, i32* %4
%17 = sext i32 %16 to i64
%18 = add nsw i64 %17, %15
%19 = trunc i64 %18 to i32
store i32 %19, i32* %4
br label %20
20: ; preds = %14
%21 = load i32, i32* %5
%22 = add nsw i32 %21, 1
store i32 %22, i32* %5
br label %10
23: ; preds = %10
%24 = load i32, i32* %4
store i32 %24, i32* %2
br label %25
25: ; preds = %23, %8
%26 = load i32, i32* %2
ret i32 %26
}

LLVM IR (-O2):
define i32 @nd6(i32 %0) {
%2 = icmp slt i32 %0, 1
br i1 %2, label %11, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %9, %3 ], [ 0, %1 ]
%5 = phi i32 [ %8, %3 ], [ 0, %1 ]
%6 = tail call i64 (...) @d6()
%7 = trunc i64 %6 to i32
%8 = add i32 %5, %7
%9 = add nuw nsw i32 %4, 1
%10 = icmp eq i32 %9, %0
br i1 %10, label %11, label %3
11: ; preds = %3, %1
%12 = phi i32 [ -1, %1 ], [ %8, %3 ]
ret i32 %12
}
char *getOtherEndpoint() { return "local"; }


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

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

LLVM IR (-O0):
@.str = [6 x i8] c"local\00"
define i8* @getOtherEndpoint() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [6 x i8] c"local\00"
define i8* @getOtherEndpoint() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void bar(int m) { printf("Hi, I'm bar!\n"); }


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"Hi, I'm bar!\0A\00"
define void @bar(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [13 x i8] c"Hi, I'm bar!\00"
define void @bar(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ usleep(int);
void test_delay(int ticks) { usleep(ticks * 10000); }


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

x86 assembly (clang, -O2):
<test_delay>:
imul   $0x2710,%edi,%edi
jmp    1030 <usleep@plt>

LLVM IR (-O0):
define void @test_delay(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 %3, 10000
%5 = call i32 @usleep(i32 %4)
ret void
}

LLVM IR (-O2):
define void @test_delay(i32 %0) {
%2 = mul nsw i32 %0, 10000
%3 = tail call i32 @usleep(i32 %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ WINDOW;

/* Variables and functions */
void drawBorders(WINDOW *screen) { int x, y, i; }


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

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

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

LLVM IR (-O2):
define void @drawBorders(i32* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ shutdown(int, int);
void tdisconnect(int targetfd) { shutdown(targetfd, 2); }


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

x86 assembly (clang, -O2):
<tdisconnect>:
mov    $0x2,%esi
jmp    1030 <shutdown@plt>

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

LLVM IR (-O2):
define void @tdisconnect(i32 %0) {
%2 = tail call i32 @shutdown(i32 %0, i32 2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strpbrk(int /*<<< orphan*/, char *);
int main(void) {
  const char *a = "abc";
  const char *b = a;
  strpbrk(b++, "");
  if (b != a + 1)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
mov    %eax,%edi
lea    0xeb9(%rip),%rsi
call   1030 <strpbrk@plt>
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
add    $0x1,%rcx
cmp    %rcx,%rax
je     1170 <main+0x60>
movl   $0x1,-0x4(%rbp)
jmp    1177 <main+0x67>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"abc\00"
@.str.1 = [1 x i8] zeroinitializer
define i32 @main() {
%1 = tail call i32 @strpbrk(i32 ptrtoint ([4 x i8]* @.str to i32), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int scanf(char *, int *, int *);
int main() {
  int v, t;
  while (scanf("%d %d", &v, &t) == 2) {
    printf("%d\n", 2 * t * v);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <scanf@plt>
cmp    $0x2,%eax
jne    1167 <main+0x47>
mov    -0xc(%rbp),%esi
shl    $0x1,%esi
imul   -0x8(%rbp),%esi
lea    0xea9(%rip),%rdi
call   1030 <printf@plt>
jmp    112f <main+0xf>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
lea    0xed1(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1040 <scanf@plt>
cmp    $0x2,%eax
jne    1185 <main+0x65>
lea    0xebe(%rip),%r14
lea    0xeb1(%rip),%r15
lea    0x4(%rsp),%r12
mov    %rsp,%rbx
nopw   0x0(%rax,%rax,1)
mov    (%rsp),%esi
imul   0x4(%rsp),%esi
add    %esi,%esi
mov    %r14,%rdi
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %r12,%rsi
mov    %rbx,%rdx
call   1040 <scanf@plt>
cmp    $0x2,%eax
je     1160 <main+0x40>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = icmp eq i32 %5, 2
br i1 %6, label %7, label %15
7: ; preds = %0, %7
%8 = load i32, i32* %2
%9 = shl nsw i32 %8, 1
%10 = load i32, i32* %1
%11 = mul nsw i32 %9, %10
%12 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %11)
%13 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%14 = icmp eq i32 %13, 2
br i1 %14, label %7, label %15
15: ; preds = %7, %0
ret i32 0
}
/* Variables and functions */
int ssds_get_gen_num(int, char *, char *, char *);
int ssds_get_num_class_items(int pcfd, char *class_def) {
  return ssds_get_gen_num(pcfd, class_def, "gc", "num_items");
}


x86 assembly (clang, -O0):
<ssds_get_num_class_items>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    0xed3(%rip),%rdx
lea    0xecf(%rip),%rcx
call   1030 <ssds_get_gen_num@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ssds_get_num_class_items>:
lea    0xee9(%rip),%rdx
lea    0xee5(%rip),%rcx
jmp    1030 <ssds_get_gen_num@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"gc\00"
@.str.1 = [10 x i8] c"num_items\00"
define i32 @ssds_get_num_class_items(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = load i8*, i8** %4
%7 = call i32 @ssds_get_gen_num(i32 %5, i8* %6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
ret i32 %7
}

LLVM IR (-O2):
@.str = [3 x i8] c"gc\00"
@.str.1 = [10 x i8] c"num_items\00"
define i32 @ssds_get_num_class_items(i32 %0, i8* %1) {
%3 = tail call i32 @ssds_get_gen_num(i32 %0, i8* %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
ret i32 %3
}
void f1(float x) {}


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

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

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

LLVM IR (-O2):
define void @f1(float %0) {
ret void
}
int jac_chain_nm3_work(int *sz_arg, int *sz_res, int *sz_iw, int *sz_w) {
  if (sz_arg)
    *sz_arg = 2;
  if (sz_res)
    *sz_res = 2;
  if (sz_iw)
    *sz_iw = 0;
  if (sz_w)
    *sz_w = 23;
  return 0;
}


x86 assembly (clang, -O0):
<jac_chain_nm3_work>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1129 <jac_chain_nm3_work+0x29>
mov    -0x8(%rbp),%rax
movl   $0x2,(%rax)
cmpq   $0x0,-0x10(%rbp)
je     113e <jac_chain_nm3_work+0x3e>
mov    -0x10(%rbp),%rax
movl   $0x2,(%rax)
cmpq   $0x0,-0x18(%rbp)
je     1153 <jac_chain_nm3_work+0x53>
mov    -0x18(%rbp),%rax
movl   $0x0,(%rax)
cmpq   $0x0,-0x20(%rbp)
je     1168 <jac_chain_nm3_work+0x68>
mov    -0x20(%rbp),%rax
movl   $0x17,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<jac_chain_nm3_work>:
test   %rdi,%rdi
je     110b <jac_chain_nm3_work+0xb>
movl   $0x2,(%rdi)
test   %rsi,%rsi
je     1116 <jac_chain_nm3_work+0x16>
movl   $0x2,(%rsi)
test   %rdx,%rdx
je     1121 <jac_chain_nm3_work+0x21>
movl   $0x0,(%rdx)
test   %rcx,%rcx
je     112c <jac_chain_nm3_work+0x2c>
movl   $0x17,(%rcx)
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @jac_chain_nm3_work(i32* writeonly %0, i32* writeonly %1, i32* writeonly %2, i32* writeonly %3) {
%5 = icmp eq i32* %0, null
br i1 %5, label %7, label %6
6: ; preds = %4
store i32 2, i32* %0
br label %7
7: ; preds = %6, %4
%8 = icmp eq i32* %1, null
br i1 %8, label %10, label %9
9: ; preds = %7
store i32 2, i32* %1
br label %10
10: ; preds = %9, %7
%11 = icmp eq i32* %2, null
br i1 %11, label %13, label %12
12: ; preds = %10
store i32 0, i32* %2
br label %13
13: ; preds = %12, %10
%14 = icmp eq i32* %3, null
br i1 %14, label %16, label %15
15: ; preds = %13
store i32 23, i32* %3
br label %16
16: ; preds = %15, %13
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ usleep(int);
void simple_thread_msleep(int ms) { usleep(ms * 1000); }


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

x86 assembly (clang, -O2):
<simple_thread_msleep>:
imul   $0x3e8,%edi,%edi
jmp    1030 <usleep@plt>

LLVM IR (-O0):
define void @simple_thread_msleep(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 %3, 1000
%5 = call i32 @usleep(i32 %4)
ret void
}

LLVM IR (-O2):
define void @simple_thread_msleep(i32 %0) {
%2 = mul nsw i32 %0, 1000
%3 = tail call i32 @usleep(i32 %2)
ret void
}
extern int sigreturn(void *uc, int flavour) {}


x86 assembly (clang, -O0):
<sigreturn>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @sigreturn(i8* nocapture readnone %0, i32 %1) {
ret i32 undef
}
void swap(long int *x, long int *y) {
  long int temp = 0;
  temp = *x;
  *x = *y;
  *y = temp;
}


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

x86 assembly (clang, -O2):
<swap>:
mov    (%rdi),%rax
mov    (%rsi),%rcx
mov    %rcx,(%rdi)
mov    %rax,(%rsi)
ret

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

LLVM IR (-O2):
define void @swap(i64* nocapture %0, i64* nocapture %1) {
%3 = load i64, i64* %0
%4 = load i64, i64* %1
store i64 %4, i64* %0
store i64 %3, i64* %1
ret void
}
void cs_low() {}


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

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

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

LLVM IR (-O2):
define void @cs_low() {
ret void
}
/* Variables and functions */
int factorial(int);
int /*<<< orphan*/ printf(char *, int, int, int);
int main() {
  char result[] = "INPUT: %d%cRESULT: %d";
  int input = 4;
  int a = factorial(input);
  printf(result, input, 10, a);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%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)
mov    0xebf(%rip),%ax
mov    %ax,-0xc(%rbp)
movl   $0x4,-0x24(%rbp)
mov    -0x24(%rbp),%edi
call   1030 <factorial@plt>
mov    %eax,-0x28(%rbp)
lea    -0x20(%rbp),%rdi
mov    -0x24(%rbp),%esi
mov    -0x28(%rbp),%ecx
mov    $0xa,%edx
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movaps 0xed5(%rip),%xmm0
movaps %xmm0,(%rsp)
movabs $0x6425203a544c55,%rax
mov    %rax,0xe(%rsp)
mov    $0x4,%edi
call   1030 <factorial@plt>
mov    %rsp,%rdi
mov    $0x4,%esi
mov    $0xa,%edx
mov    %eax,%ecx
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.result = [22 x i8] c"INPUT: %d%cRESULT: %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [22 x i8]
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = bitcast [22 x i8]* %2 to i8*
store i32 4, i32* %3
%6 = load i32, i32* %3
%7 = call i32 @factorial(i32 %6)
store i32 %7, i32* %4
%8 = getelementptr inbounds [22 x i8], [22 x i8]* %2, i64 0, i64 0
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = call i32 @printf(i8* %8, i32 %9, i32 10, i32 %10)
ret i32 0
}

LLVM IR (-O2):
@__const.main.result = [22 x i8] c"INPUT: %d%cRESULT: %d\00"
define i32 @main() {
%1 = alloca [22 x i8]
%2 = getelementptr inbounds [22 x i8], [22 x i8]* %1, i64 0, i64 0
%3 = tail call i32 @factorial(i32 4)
%4 = call i32 @printf(i8* %2, i32 4, i32 10, i32 %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(double *, double const *, int);
void doubles_xytcov_copy(const double xyta[3], const double Ca[9],
                         double xytr[3], double Cr[9]) {
  memcpy(xytr, xyta, 3 * sizeof(double));
  memcpy(Cr, Ca, 9 * sizeof(double));
}


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

x86 assembly (clang, -O2):
<doubles_xytcov_copy>:
push   %r14
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %rsi,%rbx
mov    %rdi,%rsi
mov    %rdx,%rdi
mov    $0x18,%edx
call   1030 <memcpy@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    $0x48,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <memcpy@plt>

LLVM IR (-O0):
define void @doubles_xytcov_copy(double* %0, double* %1, double* %2, double* %3) {
%5 = alloca double*
%6 = alloca double*
%7 = alloca double*
%8 = alloca double*
store double* %0, double** %5
store double* %1, double** %6
store double* %2, double** %7
store double* %3, double** %8
%9 = load double*, double** %7
%10 = load double*, double** %5
%11 = call i32 @memcpy(double* %9, double* %10, i32 24)
%12 = load double*, double** %8
%13 = load double*, double** %6
%14 = call i32 @memcpy(double* %12, double* %13, i32 72)
ret void
}

LLVM IR (-O2):
define void @doubles_xytcov_copy(double* %0, double* %1, double* %2, double* %3) {
%5 = tail call i32 @memcpy(double* %2, double* %0, i32 24)
%6 = tail call i32 @memcpy(double* %3, double* %1, i32 72)
ret void
}
/* Variables and functions */
scalar_t__ RAND_MAX;
double rand();
double frand() { return rand() / (double)RAND_MAX; }


x86 assembly (clang, -O0):
<frand>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <rand@plt>
mov    0x2ec6(%rip),%rax
cvtsi2sdq (%rax),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<frand>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
mov    0x2ec9(%rip),%rax
cvtsi2sdq (%rax),%xmm1
divsd  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
@RAND_MAX = global i64 0
define double @frand() {
%1 = call double (...) @rand()
%2 = load i64, i64* @RAND_MAX
%3 = sitofp i64 %2 to double
%4 = fdiv double %1, %3
ret double %4
}

LLVM IR (-O2):
@RAND_MAX = global i64 0
define double @frand() {
%1 = tail call double (...) @rand()
%2 = load i64, i64* @RAND_MAX
%3 = sitofp i64 %2 to double
%4 = fdiv double %1, %3
ret double %4
}
/* Variables and functions */
scalar_t__ syscall2(int, int);
void *sbrk(int incr) { return (void *)syscall2(45, incr); }


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

x86 assembly (clang, -O2):
<sbrk>:
mov    %edi,%esi
mov    $0x2d,%edi
jmp    1030 <syscall2@plt>

LLVM IR (-O0):
define i8* @sbrk(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @syscall2(i32 45, i32 %3)
%5 = inttoptr i64 %4 to i8*
ret i8* %5
}

LLVM IR (-O2):
define i8* @sbrk(i32 %0) {
%2 = tail call i64 @syscall2(i32 45, i32 %0)
%3 = inttoptr i64 %2 to i8*
ret i8* %3
}
void ARpintf_Init(void) {}


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

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

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

LLVM IR (-O2):
define void @ARpintf_Init() {
ret void
}
int isLeap(int year) {
  if (year % 4 == 0 && (year % 100 != 0 || year % 400 == 0))
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<isLeap>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    114f <isLeap+0x4f>
mov    -0x8(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1143 <isLeap+0x43>
mov    -0x8(%rbp),%eax
mov    $0x190,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    114f <isLeap+0x4f>
movl   $0x1,-0x4(%rbp)
jmp    1156 <isLeap+0x56>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isLeap>:
test   $0x3,%dil
jne    1143 <isLeap+0x43>
imul   $0xc28f5c29,%edi,%ecx
add    $0x51eb850,%ecx
ror    $0x2,%ecx
mov    $0x1,%eax
cmp    $0x28f5c28,%ecx
ja     1145 <isLeap+0x45>
movslq %edi,%rcx
imul   $0x51eb851f,%rcx,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x27,%rcx
add    %edx,%ecx
imul   $0x190,%ecx,%ecx
sub    %ecx,%edi
je     1145 <isLeap+0x45>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @isLeap(i32 %0) {
%2 = and i32 %0, 3
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %10
4: ; preds = %1
%5 = srem i32 %0, 100
%6 = icmp ne i32 %5, 0
%7 = srem i32 %0, 400
%8 = icmp eq i32 %7, 0
%9 = or i1 %6, %8
br i1 %9, label %11, label %10
10: ; preds = %4, %1
br label %11
11: ; preds = %4, %10
%12 = phi i32 [ 0, %10 ], [ 1, %4 ]
ret i32 %12
}
/* Variables and functions */
scalar_t__ random();
unsigned long int benchmark_loc() {
  static unsigned long int loc;
  loc += random();
  return (loc % ((8 * 1024 * 1024) / sizeof(double)));
}


x86 assembly (clang, -O0):
<benchmark_loc>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <random@plt>
add    0x2f0e(%rip),%rax
mov    %rax,0x2f07(%rip)
mov    0x2f00(%rip),%rax
and    $0xfffff,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<benchmark_loc>:
push   %rax
xor    %eax,%eax
call   1030 <random@plt>
add    0x2f11(%rip),%rax
mov    %rax,0x2f0a(%rip)
and    $0xfffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@benchmark_loc.loc = internal global i64 0
define i64 @benchmark_loc() {
%1 = call i64 (...) @random()
%2 = load i64, i64* @benchmark_loc.loc
%3 = add i64 %2, %1
store i64 %3, i64* @benchmark_loc.loc
%4 = load i64, i64* @benchmark_loc.loc
%5 = urem i64 %4, 1048576
ret i64 %5
}

LLVM IR (-O2):
@benchmark_loc.loc = internal unnamed_addr global i64 0
define i64 @benchmark_loc() {
%1 = tail call i64 (...) @random()
%2 = load i64, i64* @benchmark_loc.loc
%3 = add i64 %2, %1
store i64 %3, i64* @benchmark_loc.loc
%4 = and i64 %3, 1048575
ret i64 %4
}
unsigned int bcma_core_mips_irq(struct bcma_device *dev) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.bcma_device = type opaque
define i32 @bcma_core_mips_irq(%struct.bcma_device* nocapture readnone %0) {
ret i32 0
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int am_hal_clkgen_sysclk_get();
int /*<<< orphan*/ am_hal_flash_delay(int);
void am_util_delay_us(uint32_t ui32MicroSeconds) {
  uint32_t ui32Loops =
      ui32MicroSeconds * (am_hal_clkgen_sysclk_get() / 3000000);
  am_hal_flash_delay(ui32Loops);
}


x86 assembly (clang, -O0):
<am_util_delay_us>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1030 <am_hal_clkgen_sysclk_get@plt>
mov    $0x2dc6c0,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
imul   %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <am_hal_flash_delay@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<am_util_delay_us>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <am_hal_clkgen_sysclk_get@plt>
cltq
imul   $0x165e9f81,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x32,%rax
add    %ecx,%eax
imul   %eax,%ebx
mov    %ebx,%edi
pop    %rbx
jmp    1040 <am_hal_flash_delay@plt>

LLVM IR (-O0):
define void @am_util_delay_us(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 (...) @am_hal_clkgen_sysclk_get()
%6 = sdiv i32 %5, 3000000
%7 = mul nsw i32 %4, %6
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = call i32 @am_hal_flash_delay(i32 %8)
ret void
}

LLVM IR (-O2):
define void @am_util_delay_us(i32 %0) {
%2 = tail call i32 (...) @am_hal_clkgen_sysclk_get()
%3 = sdiv i32 %2, 3000000
%4 = mul nsw i32 %3, %0
%5 = tail call i32 @am_hal_flash_delay(i32 %4)
ret void
}
int RTco_initThread(__attribute__((unused)) void (*proc)(void),
                    __attribute__((unused)) unsigned int stackSize) {
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @RTco_initThread(void ()* nocapture readnone %0, i32 %1) {
ret i32 0
}
void mbr_set_magic(unsigned char *b) {
  b[510] = 0x55;
  b[511] = 0xaa;
}


x86 assembly (clang, -O0):
<mbr_set_magic>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x55,0x1fe(%rax)
mov    -0x8(%rbp),%rax
movb   $0xaa,0x1ff(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<mbr_set_magic>:
movw   $0xaa55,0x1fe(%rdi)
55 aa
ret

LLVM IR (-O0):
define void @mbr_set_magic(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 510
store i8 85, i8* %4
%5 = load i8*, i8** %2
%6 = getelementptr inbounds i8, i8* %5, i64 511
store i8 -86, i8* %6
ret void
}

LLVM IR (-O2):
define void @mbr_set_magic(i8* nocapture writeonly %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 510
store i8 85, i8* %2
%3 = getelementptr inbounds i8, i8* %0, i64 511
store i8 -86, i8* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fwprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
extern void *net_fail(int fd) {
  fwprintf(stderr, L"errors occurred, quitting\n");
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<net_fail>:
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 <fwprintf@plt>
mov    0x2e91(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<net_fail>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fwprintf@plt>
mov    0x2e9b(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [27 x i32] [i32 101, i32 114, i32 114, i32 111, i32 114, i32 115, i32 32, i32 111, i32 99, i32 99, i32 117, i32 114, i32 114, i32 101, i32 100, i32 44, i32 32, i32 113, i32 117, i32 105, i32 116, i32 116, i32 105, i32 110, i32 103, i32 10, i32 0]
@EXIT_FAILURE = global i32 0
define i8* @net_fail(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @stderr
%4 = call i32 @fwprintf(i32 %3, i8* bitcast ([27 x i32]* @.str to i8*))
%5 = load i32, i32* @EXIT_FAILURE
%6 = call i32 @exit(i32 %5)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [27 x i32] [i32 101, i32 114, i32 114, i32 111, i32 114, i32 115, i32 32, i32 111, i32 99, i32 99, i32 117, i32 114, i32 114, i32 101, i32 100, i32 44, i32 32, i32 113, i32 117, i32 105, i32 116, i32 116, i32 105, i32 110, i32 103, i32 10, i32 0]
@EXIT_FAILURE = global i32 0
define noalias i8* @net_fail(i32 %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fwprintf(i32 %2, i8* bitcast ([27 x i32]* @.str to i8*))
%4 = load i32, i32* @EXIT_FAILURE
%5 = tail call i32 @exit(i32 %4)
unreachable
}
void mplcec4_init(void) {}


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

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

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

LLVM IR (-O2):
define void @mplcec4_init() {
ret void
}
void pendfunc1(int x) { int y = x + 4; }


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

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

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

LLVM IR (-O2):
define void @pendfunc1(i32 %0) {
ret void
}
/* Type definitions */
typedef scalar_t__ uint64_t;
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
scalar_t__ fprintf(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ stdout;
void print_lowerhex32(uint64_t value) {
  if (fprintf(stdout, "%08x\n", (uint32_t)value) < 0) {
    exit(EXIT_FAILURE);
  }
}


x86 assembly (clang, -O0):
<print_lowerhex32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ea5(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rax
mov    %eax,%edx
lea    0xebe(%rip),%rsi
call   1030 <fprintf@plt>
cmp    $0x0,%rax
jge    115f <print_lowerhex32+0x3f>
mov    0x2e88(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_lowerhex32>:
push   %rax
mov    %rdi,%rdx
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
test   %rax,%rax
js     1140 <print_lowerhex32+0x20>
pop    %rax
ret
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [6 x i8] c"%08x\0A\00"
@EXIT_FAILURE = global i32 0
define void @print_lowerhex32(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i32, i32* @stdout
%4 = load i64, i64* %2
%5 = trunc i64 %4 to i32
%6 = call i64 @fprintf(i32 %3, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = icmp slt i64 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load i32, i32* @EXIT_FAILURE
%10 = call i32 @exit(i32 %9)
unreachable
11: ; preds = %1
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [6 x i8] c"%08x\0A\00"
@EXIT_FAILURE = global i32 0
define void @print_lowerhex32(i64 %0) {
%2 = load i32, i32* @stdout
%3 = trunc i64 %0 to i32
%4 = tail call i64 @fprintf(i32 %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = icmp slt i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i32, i32* @EXIT_FAILURE
%8 = tail call i32 @exit(i32 %7)
unreachable
9: ; preds = %1
ret void
}
void ProtSetup(void) {
  do {
  } while (0);
}


x86 assembly (clang, -O0):
<ProtSetup>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <ProtSetup+0x9>
jmp    110e <ProtSetup+0xe>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @ProtSetup() {
br label %1
1: ; preds = %0
br label %2
2: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @ProtSetup() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, int, int);
void draw_void(FILE *fp, int x, int y) {
  fprintf(fp, "(void) %d %d void\n", x, y);
}


x86 assembly (clang, -O0):
<draw_void>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
lea    0xecd(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<draw_void>:
mov    %edx,%ecx
mov    %esi,%edx
lea    0xee5(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"(void) %d %d void\0A\00"
define void @draw_void(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32*, i32** %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i32 @fprintf(i32* %7, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %8, i32 %9)
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"(void) %d %d void\0A\00"
define void @draw_void(i32* nocapture %0, i32 %1, i32 %2) {
%4 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %2)
ret void
}
void RTReqQueueCreate(void) {}


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

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

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

LLVM IR (-O2):
define void @RTReqQueueCreate() {
ret void
}
void rcu_register_thread_bp(void) {}


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

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

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

LLVM IR (-O2):
define void @rcu_register_thread_bp() {
ret void
}
unsigned long long rdtsc_ll(void) {
  unsigned long long __h__, __l__;
  __asm__ __volatile__("rdtsc" : "=d"(__h__), "=a"(__l__));
  return (__h__ << 32) | __l__;
}


x86 assembly (clang, -O0):
<rdtsc_ll>:
push   %rbp
mov    %rsp,%rbp
rdtsc
mov    %rdx,-0x8(%rbp)
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
shl    $0x20,%rax
or     -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rdtsc_ll>:
rdtsc
shl    $0x20,%rdx
or     %rdx,%rax
ret

LLVM IR (-O0):
define i64 @rdtsc_ll() {
%1 = alloca i64
%2 = alloca i64
%3 = call { i64, i64 } asm sideeffect "rdtsc", "={dx},={ax},~{dirflag},~{fpsr},~{flags}"()
%4 = extractvalue { i64, i64 } %3, 0
%5 = extractvalue { i64, i64 } %3, 1
store i64 %4, i64* %1
store i64 %5, i64* %2
%6 = load i64, i64* %1
%7 = shl i64 %6, 32
%8 = load i64, i64* %2
%9 = or i64 %7, %8
ret i64 %9
}

LLVM IR (-O2):
define i64 @rdtsc_ll() {
%1 = tail call { i64, i64 } asm sideeffect "rdtsc", "={dx},={ax},~{dirflag},~{fpsr},~{flags}"()
%2 = extractvalue { i64, i64 } %1, 0
%3 = extractvalue { i64, i64 } %1, 1
%4 = shl i64 %2, 32
%5 = or i64 %4, %3
ret i64 %5
}
/* Variables and functions */
int snprintf(char *, int, char *, unsigned char);
int STR_FEC_RATE_IN(char *p, int n, unsigned char fec_in_rate) {
  if (fec_in_rate == 0)
    return 0;
  return snprintf(p, n, "fect_rate_in:%d ", fec_in_rate);
}


x86 assembly (clang, -O0):
<STR_FEC_RATE_IN>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dl,%al
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %al,-0x15(%rbp)
movzbl -0x15(%rbp),%eax
cmp    $0x0,%eax
jne    113d <STR_FEC_RATE_IN+0x2d>
movl   $0x0,-0x4(%rbp)
jmp    1157 <STR_FEC_RATE_IN+0x47>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
lea    0xeb5(%rip),%rdx
movzbl -0x15(%rbp),%ecx
call   1030 <snprintf@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<STR_FEC_RATE_IN>:
test   %edx,%edx
je     1123 <STR_FEC_RATE_IN+0x13>
movzbl %dl,%ecx
lea    0xee2(%rip),%rdx
jmp    1030 <snprintf@plt>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
@.str = [17 x i8] c"fect_rate_in:%d \00"
define i32 @STR_FEC_RATE_IN(i8* %0, i32 %1, i8 zeroext %2) {
%4 = icmp eq i8 %2, 0
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = tail call i32 @snprintf(i8* %0, i32 %1, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8 zeroext %2)
br label %7
7: ; preds = %3, %5
%8 = phi i32 [ %6, %5 ], [ 0, %3 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int);
int main() {
  int a[] = {1, 2, 3, 99, 23};
  int *ap, *bp;
  ap = &a[2];
  bp = ap + 1;
  printf("%d\t%d\t%d\n", *ap, *ap + 1, *bp);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xed7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xed5(%rip),%eax
mov    %eax,-0x10(%rbp)
lea    -0x20(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x30(%rbp)
mov    -0x28(%rbp),%rax
mov    (%rax),%esi
mov    -0x28(%rbp),%rax
mov    (%rax),%edx
add    $0x1,%edx
mov    -0x30(%rbp),%rax
mov    (%rax),%ecx
lea    0xea2(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@__const.main.a = [5 x i32] [i32 1, i32 2, i32 3, i32 99, i32 23]
@.str = [10 x i8] c"%d\09%d\09%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [5 x i32]
%3 = alloca i32*
%4 = alloca i32*
store i32 0, i32* %1
%5 = bitcast [5 x i32]* %2 to i8*
%6 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 2
store i32* %6, i32** %3
%7 = load i32*, i32** %3
%8 = getelementptr inbounds i32, i32* %7, i64 1
store i32* %8, i32** %4
%9 = load i32*, i32** %3
%10 = load i32, i32* %9
%11 = load i32*, i32** %3
%12 = load i32, i32* %11
%13 = add nsw i32 %12, 1
%14 = load i32*, i32** %4
%15 = load i32, i32* %14
%16 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %10, i32 %13, i32 %15)
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"%d\09%d\09%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 3, i32 4, i32 99)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sensors_cleanup();
void exit_cleanup() {
  printf("\nCleanup..");
  sensors_cleanup();
  printf(". done, exiting\n");
  exit(0);
}


x86 assembly (clang, -O0):
<exit_cleanup>:
push   %rbp
mov    %rsp,%rbp
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <sensors_cleanup@plt>
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<exit_cleanup>:
push   %rax
lea    0xeb8(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <sensors_cleanup@plt>
lea    0xeb0(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"\0ACleanup..\00"
@.str.1 = [17 x i8] c". done, exiting\0A\00"
define void @exit_cleanup() {
%1 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @sensors_cleanup()
%3 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [11 x i8] c"\0ACleanup..\00"
@str = [16 x i8] c". done, exiting\00"
define void @exit_cleanup() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @sensors_cleanup()
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int partition(int *, int, int);
void quick(int a[], int first, int last) {
  int pivot;
  if (first < last) {
    pivot = partition(a, first, last);
    quick(a, first, pivot - 1);
    quick(a, pivot + 1, last);
  }
}


x86 assembly (clang, -O0):
<quick>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1174 <quick+0x54>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <partition@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
sub    $0x1,%edx
call   1040 <quick@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%edx
call   1040 <quick@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @quick(i32* %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %2
br i1 %4, label %5, label %11
5: ; preds = %3, %5
%6 = phi i32 [ %9, %5 ], [ %1, %3 ]
%7 = tail call i32 @partition(i32* %0, i32 %6, i32 %2)
%8 = add nsw i32 %7, -1
tail call void @quick(i32* %0, i32 %6, i32 %8)
%9 = add nsw i32 %7, 1
%10 = icmp slt i32 %9, %2
br i1 %10, label %5, label %11
11: ; preds = %5, %3
ret void
}
signed int rt_cond_wait(union anon$42 *cvp, union anon$40 *mp) {
  signed int status = 0;
  status = pthread_cond_wait(cvp, mp);
  return status;
}


x86 assembly (clang, -O0):
<rt_cond_wait>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x0,%al
call   1030 <pthread_cond_wait@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%"union.anon$42" = type opaque
%"union.anon$40" = type opaque
define i32 @rt_cond_wait(%"union.anon$42"* %0, %"union.anon$40"* %1) {
%3 = alloca %"union.anon$42"*
%4 = alloca %"union.anon$40"*
%5 = alloca i32
store %"union.anon$42"* %0, %"union.anon$42"** %3
store %"union.anon$40"* %1, %"union.anon$40"** %4
store i32 0, i32* %5
%6 = load %"union.anon$42"*, %"union.anon$42"** %3
%7 = load %"union.anon$40"*, %"union.anon$40"** %4
%8 = call i32 (%"union.anon$42"*, %"union.anon$40"*, ...) bitcast (i32 (...)* @pthread_cond_wait to i32 (%"union.anon$42"*, %"union.anon$40"*, ...)*)(%"union.anon$42"* %6, %"union.anon$40"* %7)
store i32 %8, i32* %5
%9 = load i32, i32* %5
ret i32 %9
}

LLVM IR (-O2):
%"union.anon$42" = type opaque
%"union.anon$40" = type opaque
define i32 @rt_cond_wait(%"union.anon$42"* %0, %"union.anon$40"* %1) {
%3 = tail call i32 (%"union.anon$42"*, %"union.anon$40"*, ...) bitcast (i32 (...)* @pthread_cond_wait to i32 (%"union.anon$42"*, %"union.anon$40"*, ...)*)(%"union.anon$42"* %0, %"union.anon$40"* %1)
ret i32 %3
}