#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*/ print_bench(char *, unsigned long long *, int);
void speed_nothing() {
  unsigned long long t[10];
  int i;
  for (i = 0; i < 10; i++)
    t[i] = cpucycles();
  print_bench("nothing", t, 10);
}


x86 assembly (clang, -O0):
<speed_nothing>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x54(%rbp)
cmpl   $0xa,-0x54(%rbp)
jge    115a <speed_nothing+0x3a>
mov    $0x0,%al
call   1040 <cpucycles@plt>
mov    %rax,%rcx
movslq -0x54(%rbp),%rax
mov    %rcx,-0x50(%rbp,%rax,8)
mov    -0x54(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x54(%rbp)
jmp    112f <speed_nothing+0xf>
lea    -0x50(%rbp),%rsi
lea    0xe9b(%rip),%rdi
mov    $0xa,%edx
call   1030 <print_bench@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<speed_nothing>:
sub    $0x58,%rsp
xor    %eax,%eax
call   1040 <cpucycles@plt>
mov    %rax,(%rsp)
xor    %eax,%eax
call   1040 <cpucycles@plt>
mov    %rax,0x8(%rsp)
xor    %eax,%eax
call   1040 <cpucycles@plt>
mov    %rax,0x10(%rsp)
xor    %eax,%eax
call   1040 <cpucycles@plt>
mov    %rax,0x18(%rsp)
xor    %eax,%eax
call   1040 <cpucycles@plt>
mov    %rax,0x20(%rsp)
xor    %eax,%eax
call   1040 <cpucycles@plt>
mov    %rax,0x28(%rsp)
xor    %eax,%eax
call   1040 <cpucycles@plt>
mov    %rax,0x30(%rsp)
xor    %eax,%eax
call   1040 <cpucycles@plt>
mov    %rax,0x38(%rsp)
xor    %eax,%eax
call   1040 <cpucycles@plt>
mov    %rax,0x40(%rsp)
xor    %eax,%eax
call   1040 <cpucycles@plt>
mov    %rax,0x48(%rsp)
lea    0xe5e(%rip),%rdi
mov    %rsp,%rsi
mov    $0xa,%edx
call   1030 <print_bench@plt>
add    $0x58,%rsp
ret

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

LLVM IR (-O2):
@.str = [8 x i8] c"nothing\00"
define void @speed_nothing() {
%1 = alloca [10 x i64]
%2 = bitcast [10 x i64]* %1 to i8*
%3 = tail call i64 (...) @cpucycles()
%4 = getelementptr inbounds [10 x i64], [10 x i64]* %1, i64 0, i64 0
store i64 %3, i64* %4
%5 = tail call i64 (...) @cpucycles()
%6 = getelementptr inbounds [10 x i64], [10 x i64]* %1, i64 0, i64 1
store i64 %5, i64* %6
%7 = tail call i64 (...) @cpucycles()
%8 = getelementptr inbounds [10 x i64], [10 x i64]* %1, i64 0, i64 2
store i64 %7, i64* %8
%9 = tail call i64 (...) @cpucycles()
%10 = getelementptr inbounds [10 x i64], [10 x i64]* %1, i64 0, i64 3
store i64 %9, i64* %10
%11 = tail call i64 (...) @cpucycles()
%12 = getelementptr inbounds [10 x i64], [10 x i64]* %1, i64 0, i64 4
store i64 %11, i64* %12
%13 = tail call i64 (...) @cpucycles()
%14 = getelementptr inbounds [10 x i64], [10 x i64]* %1, i64 0, i64 5
store i64 %13, i64* %14
%15 = tail call i64 (...) @cpucycles()
%16 = getelementptr inbounds [10 x i64], [10 x i64]* %1, i64 0, i64 6
store i64 %15, i64* %16
%17 = tail call i64 (...) @cpucycles()
%18 = getelementptr inbounds [10 x i64], [10 x i64]* %1, i64 0, i64 7
store i64 %17, i64* %18
%19 = tail call i64 (...) @cpucycles()
%20 = getelementptr inbounds [10 x i64], [10 x i64]* %1, i64 0, i64 8
store i64 %19, i64* %20
%21 = tail call i64 (...) @cpucycles()
%22 = getelementptr inbounds [10 x i64], [10 x i64]* %1, i64 0, i64 9
store i64 %21, i64* %22
%23 = call i32 @print_bench(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i64* %4, i32 10)
ret void
}