#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 */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, unsigned long);
void measure_print(FILE *out, char *variable_name, int cpu,
                   long unsigned *elapsed[48], long unsigned *n_all) {
  long long unsigned i;
  for (i = 0; i < n_all[cpu] && i < 1000000; i++)
    fprintf(out, "%7lu\n", elapsed[cpu][i]);
}


x86 assembly (clang, -O0):
<measure_print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
movq   $0x0,-0x30(%rbp)
mov    -0x30(%rbp),%rcx
mov    -0x28(%rbp),%rdx
movslq -0x14(%rbp),%rsi
xor    %eax,%eax
cmp    (%rdx,%rsi,8),%rcx
mov    %al,-0x31(%rbp)
jae    115c <measure_print+0x4c>
cmpq   $0xf4240,-0x30(%rbp)
setb   %al
mov    %al,-0x31(%rbp)
mov    -0x31(%rbp),%al
test   $0x1,%al
jne    116c <measure_print+0x5c>
jmp    11a1 <measure_print+0x91>
mov    -0x8(%rbp),%rdi
mov    -0x20(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    -0x30(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
lea    0xe75(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x30(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x30(%rbp)
jmp    1133 <measure_print+0x23>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<measure_print>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
movslq %edx,%rbx
cmpq   $0x0,(%r8,%rbx,8)
je     1166 <measure_print+0x56>
mov    %r8,%r15
mov    %rcx,%r14
mov    %rdi,%r13
xor    %ebp,%ebp
lea    0xec9(%rip),%r12
nopw   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rax
mov    (%rax,%rbp,8),%rdx
mov    %r13,%rdi
mov    %r12,%rsi
call   1030 <fprintf@plt>
cmp    $0xf423e,%rbp
ja     1166 <measure_print+0x56>
add    $0x1,%rbp
cmp    (%r15,%rbx,8),%rbp
jb     1140 <measure_print+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%7lu\0A\00"
define void @measure_print(i32* %0, i8* %1, i32 %2, i64** %3, i64* %4) {
%6 = alloca i32*
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i64**
%10 = alloca i64*
%11 = alloca i64
store i32* %0, i32** %6
store i8* %1, i8** %7
store i32 %2, i32* %8
store i64** %3, i64*** %9
store i64* %4, i64** %10
store i64 0, i64* %11
br label %12
12: ; preds = %36, %5
%13 = load i64, i64* %11
%14 = load i64*, i64** %10
%15 = load i32, i32* %8
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i64, i64* %14, i64 %16
%18 = load i64, i64* %17
%19 = icmp ult i64 %13, %18
br i1 %19, label %20, label %23
20: ; preds = %12
%21 = load i64, i64* %11
%22 = icmp ult i64 %21, 1000000
br label %23
23: ; preds = %20, %12
%24 = phi i1 [ false, %12 ], [ %22, %20 ]
br i1 %24, label %25, label %39
25: ; preds = %23
%26 = load i32*, i32** %6
%27 = load i64**, i64*** %9
%28 = load i32, i32* %8
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds i64*, i64** %27, i64 %29
%31 = load i64*, i64** %30
%32 = load i64, i64* %11
%33 = getelementptr inbounds i64, i64* %31, i64 %32
%34 = load i64, i64* %33
%35 = call i32 @fprintf(i32* %26, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i64 %34)
br label %36
36: ; preds = %25
%37 = load i64, i64* %11
%38 = add i64 %37, 1
store i64 %38, i64* %11
br label %12
39: ; preds = %23
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"%7lu\0A\00"
define void @measure_print(i32* nocapture %0, i8* nocapture readnone %1, i32 %2, i64** nocapture %3, i64* nocapture %4) {
%6 = sext i32 %2 to i64
%7 = getelementptr inbounds i64, i64* %4, i64 %6
%8 = load i64, i64* %7
%9 = icmp eq i64 %8, 0
br i1 %9, label %23, label %10
10: ; preds = %5
%11 = getelementptr inbounds i64*, i64** %3, i64 %6
br label %12
12: ; preds = %10, %12
%13 = phi i64 [ 0, %10 ], [ %18, %12 ]
%14 = load i64*, i64** %11
%15 = getelementptr inbounds i64, i64* %14, i64 %13
%16 = load i64, i64* %15
%17 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i64 %16)
%18 = add nuw nsw i64 %13, 1
%19 = load i64, i64* %7
%20 = icmp ult i64 %18, %19
%21 = icmp ult i64 %13, 999999
%22 = and i1 %21, %20
br i1 %22, label %12, label %23
23: ; preds = %12, %5
ret void
}