#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
unsigned long long cpucycles();
int /*<<< orphan*/ empty();
int /*<<< orphan*/ print_bench(char *, unsigned long long *, int);
void speed_empty() {
  unsigned long long t[20];
  int i;
  for (i = 0; i < 20; i++) {
    t[i] = cpucycles();
    empty();
  }
  print_bench("empty", t, 20);
}


x86 assembly (clang, -O0):
<speed_empty>:
push   %rbp
mov    %rsp,%rbp
sub    $0xb0,%rsp
movl   $0x0,-0xa4(%rbp)
cmpl   $0x14,-0xa4(%rbp)
jge    1186 <speed_empty+0x56>
mov    $0x0,%al
call   1050 <cpucycles@plt>
mov    %rax,%rcx
movslq -0xa4(%rbp),%rax
mov    %rcx,-0xa0(%rbp,%rax,8)
ff
mov    $0x0,%al
call   1030 <empty@plt>
mov    -0xa4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xa4(%rbp)
jmp    1145 <speed_empty+0x15>
lea    -0xa0(%rbp),%rsi
lea    0xe6c(%rip),%rdi
mov    $0x14,%edx
call   1040 <print_bench@plt>
add    $0xb0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<speed_empty>:
sub    $0xa8,%rsp
xor    %eax,%eax
call   1050 <cpucycles@plt>
mov    %rax,(%rsp)
xor    %eax,%eax
call   1030 <empty@plt>
xor    %eax,%eax
call   1050 <cpucycles@plt>
mov    %rax,0x8(%rsp)
xor    %eax,%eax
call   1030 <empty@plt>
xor    %eax,%eax
call   1050 <cpucycles@plt>
mov    %rax,0x10(%rsp)
xor    %eax,%eax
call   1030 <empty@plt>
xor    %eax,%eax
call   1050 <cpucycles@plt>
mov    %rax,0x18(%rsp)
xor    %eax,%eax
call   1030 <empty@plt>
xor    %eax,%eax
call   1050 <cpucycles@plt>
mov    %rax,0x20(%rsp)
xor    %eax,%eax
call   1030 <empty@plt>
xor    %eax,%eax
call   1050 <cpucycles@plt>
mov    %rax,0x28(%rsp)
xor    %eax,%eax
call   1030 <empty@plt>
xor    %eax,%eax
call   1050 <cpucycles@plt>
mov    %rax,0x30(%rsp)
xor    %eax,%eax
call   1030 <empty@plt>
xor    %eax,%eax
call   1050 <cpucycles@plt>
mov    %rax,0x38(%rsp)
xor    %eax,%eax
call   1030 <empty@plt>
xor    %eax,%eax
call   1050 <cpucycles@plt>
mov    %rax,0x40(%rsp)
xor    %eax,%eax
call   1030 <empty@plt>
xor    %eax,%eax
call   1050 <cpucycles@plt>
mov    %rax,0x48(%rsp)
xor    %eax,%eax
call   1030 <empty@plt>
xor    %eax,%eax
call   1050 <cpucycles@plt>
mov    %rax,0x50(%rsp)
xor    %eax,%eax
call   1030 <empty@plt>
xor    %eax,%eax
call   1050 <cpucycles@plt>
mov    %rax,0x58(%rsp)
xor    %eax,%eax
call   1030 <empty@plt>
xor    %eax,%eax
call   1050 <cpucycles@plt>
mov    %rax,0x60(%rsp)
xor    %eax,%eax
call   1030 <empty@plt>
xor    %eax,%eax
call   1050 <cpucycles@plt>
mov    %rax,0x68(%rsp)
xor    %eax,%eax
call   1030 <empty@plt>
xor    %eax,%eax
call   1050 <cpucycles@plt>
mov    %rax,0x70(%rsp)
xor    %eax,%eax
call   1030 <empty@plt>
xor    %eax,%eax
call   1050 <cpucycles@plt>
mov    %rax,0x78(%rsp)
xor    %eax,%eax
call   1030 <empty@plt>
xor    %eax,%eax
call   1050 <cpucycles@plt>
mov    %rax,0x80(%rsp)
xor    %eax,%eax
call   1030 <empty@plt>
xor    %eax,%eax
call   1050 <cpucycles@plt>
mov    %rax,0x88(%rsp)
xor    %eax,%eax
call   1030 <empty@plt>
xor    %eax,%eax
call   1050 <cpucycles@plt>
mov    %rax,0x90(%rsp)
xor    %eax,%eax
call   1030 <empty@plt>
xor    %eax,%eax
call   1050 <cpucycles@plt>
mov    %rax,0x98(%rsp)
xor    %eax,%eax
call   1030 <empty@plt>
lea    0xd3b(%rip),%rdi
mov    %rsp,%rsi
mov    $0x14,%edx
call   1040 <print_bench@plt>
add    $0xa8,%rsp
ret

LLVM IR (-O0):
@.str = [6 x i8] c"empty\00"
define void @speed_empty() {
%1 = alloca [20 x i64]
%2 = alloca i32
store i32 0, i32* %2
br label %3
3: ; preds = %12, %0
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 20
br i1 %5, label %6, label %15
6: ; preds = %3
%7 = call i64 (...) @cpucycles()
%8 = load i32, i32* %2
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds [20 x i64], [20 x i64]* %1, i64 0, i64 %9
store i64 %7, i64* %10
%11 = call i32 (...) @empty()
br label %12
12: ; preds = %6
%13 = load i32, i32* %2
%14 = add nsw i32 %13, 1
store i32 %14, i32* %2
br label %3
15: ; preds = %3
%16 = getelementptr inbounds [20 x i64], [20 x i64]* %1, i64 0, i64 0
%17 = call i32 @print_bench(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i64* %16, i32 20)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"empty\00"
define void @speed_empty() {
%1 = alloca [20 x i64]
%2 = bitcast [20 x i64]* %1 to i8*
%3 = tail call i64 (...) @cpucycles()
%4 = getelementptr inbounds [20 x i64], [20 x i64]* %1, i64 0, i64 0
store i64 %3, i64* %4
%5 = tail call i32 (...) @empty()
%6 = tail call i64 (...) @cpucycles()
%7 = getelementptr inbounds [20 x i64], [20 x i64]* %1, i64 0, i64 1
store i64 %6, i64* %7
%8 = tail call i32 (...) @empty()
%9 = tail call i64 (...) @cpucycles()
%10 = getelementptr inbounds [20 x i64], [20 x i64]* %1, i64 0, i64 2
store i64 %9, i64* %10
%11 = tail call i32 (...) @empty()
%12 = tail call i64 (...) @cpucycles()
%13 = getelementptr inbounds [20 x i64], [20 x i64]* %1, i64 0, i64 3
store i64 %12, i64* %13
%14 = tail call i32 (...) @empty()
%15 = tail call i64 (...) @cpucycles()
%16 = getelementptr inbounds [20 x i64], [20 x i64]* %1, i64 0, i64 4
store i64 %15, i64* %16
%17 = tail call i32 (...) @empty()
%18 = tail call i64 (...) @cpucycles()
%19 = getelementptr inbounds [20 x i64], [20 x i64]* %1, i64 0, i64 5
store i64 %18, i64* %19
%20 = tail call i32 (...) @empty()
%21 = tail call i64 (...) @cpucycles()
%22 = getelementptr inbounds [20 x i64], [20 x i64]* %1, i64 0, i64 6
store i64 %21, i64* %22
%23 = tail call i32 (...) @empty()
%24 = tail call i64 (...) @cpucycles()
%25 = getelementptr inbounds [20 x i64], [20 x i64]* %1, i64 0, i64 7
store i64 %24, i64* %25
%26 = tail call i32 (...) @empty()
%27 = tail call i64 (...) @cpucycles()
%28 = getelementptr inbounds [20 x i64], [20 x i64]* %1, i64 0, i64 8
store i64 %27, i64* %28
%29 = tail call i32 (...) @empty()
%30 = tail call i64 (...) @cpucycles()
%31 = getelementptr inbounds [20 x i64], [20 x i64]* %1, i64 0, i64 9
store i64 %30, i64* %31
%32 = tail call i32 (...) @empty()
%33 = tail call i64 (...) @cpucycles()
%34 = getelementptr inbounds [20 x i64], [20 x i64]* %1, i64 0, i64 10
store i64 %33, i64* %34
%35 = tail call i32 (...) @empty()
%36 = tail call i64 (...) @cpucycles()
%37 = getelementptr inbounds [20 x i64], [20 x i64]* %1, i64 0, i64 11
store i64 %36, i64* %37
%38 = tail call i32 (...) @empty()
%39 = tail call i64 (...) @cpucycles()
%40 = getelementptr inbounds [20 x i64], [20 x i64]* %1, i64 0, i64 12
store i64 %39, i64* %40
%41 = tail call i32 (...) @empty()
%42 = tail call i64 (...) @cpucycles()
%43 = getelementptr inbounds [20 x i64], [20 x i64]* %1, i64 0, i64 13
store i64 %42, i64* %43
%44 = tail call i32 (...) @empty()
%45 = tail call i64 (...) @cpucycles()
%46 = getelementptr inbounds [20 x i64], [20 x i64]* %1, i64 0, i64 14
store i64 %45, i64* %46
%47 = tail call i32 (...) @empty()
%48 = tail call i64 (...) @cpucycles()
%49 = getelementptr inbounds [20 x i64], [20 x i64]* %1, i64 0, i64 15
store i64 %48, i64* %49
%50 = tail call i32 (...) @empty()
%51 = tail call i64 (...) @cpucycles()
%52 = getelementptr inbounds [20 x i64], [20 x i64]* %1, i64 0, i64 16
store i64 %51, i64* %52
%53 = tail call i32 (...) @empty()
%54 = tail call i64 (...) @cpucycles()
%55 = getelementptr inbounds [20 x i64], [20 x i64]* %1, i64 0, i64 17
store i64 %54, i64* %55
%56 = tail call i32 (...) @empty()
%57 = tail call i64 (...) @cpucycles()
%58 = getelementptr inbounds [20 x i64], [20 x i64]* %1, i64 0, i64 18
store i64 %57, i64* %58
%59 = tail call i32 (...) @empty()
%60 = tail call i64 (...) @cpucycles()
%61 = getelementptr inbounds [20 x i64], [20 x i64]* %1, i64 0, i64 19
store i64 %60, i64* %61
%62 = tail call i32 (...) @empty()
%63 = call i32 @print_bench(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i64* %4, i32 20)
ret void
}