#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 *, ...);
void print_timings(FILE *out, double get_timings[], double init_timings[],
                   double serialize_timings[], double deserialize_timings[],
                   const int nstructs) {
  int i;
  fprintf(out, "Get, init, save, restore (s)\n");
  for (i = 0; i < nstructs; i++) {
    fprintf(out, "%g, %g, %g, %g\n", get_timings[i], init_timings[i],
            serialize_timings[i], deserialize_timings[i]);
  }
}


x86 assembly (clang, -O0):
<print_timings>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9d,-0x2c(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec5(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
movl   $0x0,-0x30(%rbp)
mov    -0x30(%rbp),%eax
cmp    -0x2c(%rbp),%eax
jge    11a9 <print_timings+0x99>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
movslq -0x30(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x18(%rbp),%rax
movslq -0x30(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x20(%rbp),%rax
movslq -0x30(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
mov    -0x28(%rbp),%rax
movslq -0x30(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm3
lea    0xe8a(%rip),%rsi
mov    $0x4,%al
call   1030 <fprintf@plt>
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    1149 <print_timings+0x39>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_timings>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %r9d,%ebp
mov    %r8,(%rsp)
mov    %rcx,%r15
mov    %rdx,%r12
mov    %rsi,%r13
mov    %rdi,%rbx
lea    0xebb(%rip),%rdi
mov    $0x1d,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1040 <fwrite@plt>
test   %ebp,%ebp
jle    1197 <print_timings+0x77>
mov    %ebp,%ebp
xor    %r14d,%r14d
movsd  0x0(%r13,%r14,8),%xmm0
movsd  (%r12,%r14,8),%xmm1
movsd  (%r15,%r14,8),%xmm2
mov    (%rsp),%rax
movsd  (%rax,%r14,8),%xmm3
mov    %rbx,%rdi
lea    0xe97(%rip),%rsi
mov    $0x4,%al
call   1030 <fprintf@plt>
add    $0x1,%r14
cmp    %r14,%rbp
jne    1160 <print_timings+0x40>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [30 x i8] c"Get, init, save, restore (s)\0A\00"
@.str.1 = [16 x i8] c"%g, %g, %g, %g\0A\00"
define void @print_timings(i32* %0, double* %1, double* %2, double* %3, double* %4, i32 %5) {
%7 = alloca i32*
%8 = alloca double*
%9 = alloca double*
%10 = alloca double*
%11 = alloca double*
%12 = alloca i32
%13 = alloca i32
store i32* %0, i32** %7
store double* %1, double** %8
store double* %2, double** %9
store double* %3, double** %10
store double* %4, double** %11
store i32 %5, i32* %12
%14 = load i32*, i32** %7
%15 = call i32 (i32*, i8*, ...) @fprintf(i32* %14, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %13
br label %16
16: ; preds = %43, %6
%17 = load i32, i32* %13
%18 = load i32, i32* %12
%19 = icmp slt i32 %17, %18
br i1 %19, label %20, label %46
20: ; preds = %16
%21 = load i32*, i32** %7
%22 = load double*, double** %8
%23 = load i32, i32* %13
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds double, double* %22, i64 %24
%26 = load double, double* %25
%27 = load double*, double** %9
%28 = load i32, i32* %13
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds double, double* %27, i64 %29
%31 = load double, double* %30
%32 = load double*, double** %10
%33 = load i32, i32* %13
%34 = sext i32 %33 to i64
%35 = getelementptr inbounds double, double* %32, i64 %34
%36 = load double, double* %35
%37 = load double*, double** %11
%38 = load i32, i32* %13
%39 = sext i32 %38 to i64
%40 = getelementptr inbounds double, double* %37, i64 %39
%41 = load double, double* %40
%42 = call i32 (i32*, i8*, ...) @fprintf(i32* %21, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), double %26, double %31, double %36, double %41)
br label %43
43: ; preds = %20
%44 = load i32, i32* %13
%45 = add nsw i32 %44, 1
store i32 %45, i32* %13
br label %16
46: ; preds = %16
ret void
}

LLVM IR (-O2):
@.str = [30 x i8] c"Get, init, save, restore (s)\0A\00"
@.str.1 = [16 x i8] c"%g, %g, %g, %g\0A\00"
define void @print_timings(i32* nocapture %0, double* nocapture %1, double* nocapture %2, double* nocapture %3, double* nocapture %4, i32 %5) {
%7 = tail call i64 @fwrite(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i64 29, i64 1, i32* %0)
%8 = icmp sgt i32 %5, 0
br i1 %8, label %9, label %24
9: ; preds = %6
%10 = zext i32 %5 to i64
br label %11
11: ; preds = %9, %11
%12 = phi i64 [ 0, %9 ], [ %22, %11 ]
%13 = getelementptr inbounds double, double* %1, i64 %12
%14 = load double, double* %13
%15 = getelementptr inbounds double, double* %2, i64 %12
%16 = load double, double* %15
%17 = getelementptr inbounds double, double* %3, i64 %12
%18 = load double, double* %17
%19 = getelementptr inbounds double, double* %4, i64 %12
%20 = load double, double* %19
%21 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), double %14, double %16, double %18, double %20)
%22 = add nuw nsw i64 %12, 1
%23 = icmp eq i64 %22, %10
br i1 %23, label %24, label %11
24: ; preds = %11, %6
ret void
}