#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 */
int /*<<< orphan*/ printf(char *, ...);
double sqrt(double);
int main(void) {
  int i;
  float f;
  printf("/* DIABLO 31 seek times; approx. 15 + 8.6 * sqrt(td) ms*/\n");
  printf("static const int diablo_31_seek_dt[] = {\n");
  for (i = 0; i < 203; i++) {
    f = 15.0 + sqrt(1.0 * i) * 8.6;
    printf("\t%d%s", (int)(f * 1000), i + 1 < 203 ? "," : "\n");
    if (7 == (i % 8))
      printf("\n");
  }
  printf("};\n");
  printf("\n");
  printf("/* DIABLO 44 seek times; approx. 8 + 3 * sqrt(td) ms */\n");
  printf("static const int diablo_44_seek_dt[] = {\n");
  for (i = 0; i < 406; i++) {
    f = 8.0 + sqrt(1.0 * i) * 3.0;
    printf("\t%d%s", (int)(f * 1000), i + 1 < 406 ? "," : "\n");
    if (7 == (i % 8))
      printf("\n");
  }
  printf("};\n");
  printf("\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xefa(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf27(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0xcb,-0x8(%rbp)
jge    120c <main+0xec>
cvtsi2sdl -0x8(%rbp),%xmm1
movsd  0xeac(%rip),%xmm0
mulsd  %xmm1,%xmm0
call   1040 <sqrt@plt>
movsd  0xea3(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe9f(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  0xe62(%rip),%xmm0
mulss  -0xc(%rbp),%xmm0
cvttss2si %xmm0,%esi
mov    -0x8(%rbp),%ecx
add    $0x1,%ecx
lea    0xf24(%rip),%rdx
lea    0xee0(%rip),%rax
cmp    $0xcb,%ecx
cmovl  %rax,%rdx
lea    0xec9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    $0x7,%eax
cmp    %edx,%eax
jne    11f9 <main+0xd9>
lea    0xee6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11fe <main+0xde>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1152 <main+0x32>
lea    0xe8a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeb7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe72(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe9d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x196,-0x8(%rbp)
jge    1305 <main+0x1e5>
cvtsi2sdl -0x8(%rbp),%xmm1
movsd  0xdb3(%rip),%xmm0
mulsd  %xmm1,%xmm0
call   1040 <sqrt@plt>
movsd  0xd92(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xd8e(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  0xd69(%rip),%xmm0
mulss  -0xc(%rbp),%xmm0
cvttss2si %xmm0,%esi
mov    -0x8(%rbp),%ecx
add    $0x1,%ecx
lea    0xe2b(%rip),%rdx
lea    0xde7(%rip),%rax
cmp    $0x196,%ecx
cmovl  %rax,%rdx
lea    0xdd0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    $0x7,%eax
cmp    %edx,%eax
jne    12f2 <main+0x1d2>
lea    0xded(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12f7 <main+0x1d7>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    124b <main+0x12b>
lea    0xd91(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xdbe(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x10,%rsp
lea    0xeeb(%rip),%rdi
call   1040 <puts@plt>
lea    0xf19(%rip),%rdi
call   1040 <puts@plt>
lea    0xed1(%rip),%r14
lea    0xec8(%rip),%r15
lea    0xebb(%rip),%r12
xorpd  %xmm1,%xmm1
xor    %ebx,%ebx
jmp    11a4 <main+0x64>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %ebp,%ebx
cmp    $0xcb,%ebp
movsd  0x8(%rsp),%xmm1
je     1237 <main+0xf7>
ucomisd 0xe7c(%rip),%xmm1
jb     11c0 <main+0x80>
xorps  %xmm0,%xmm0
sqrtsd %xmm1,%xmm0
jmp    11d5 <main+0x95>
nopw   0x0(%rax,%rax,1)
movapd %xmm1,%xmm0
movsd  %xmm1,0x8(%rsp)
call   1060 <sqrt@plt>
movsd  0x8(%rsp),%xmm1
mulsd  0xe23(%rip),%xmm0
addsd  0xe23(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
mulss  0xe3f(%rip),%xmm0
cvttss2si %xmm0,%esi
addsd  0xe13(%rip),%xmm1
movsd  %xmm1,0x8(%rsp)
lea    0x1(%rbx),%ebp
cmp    $0xca,%ebx
mov    %r15,%rdx
cmove  %r14,%rdx
mov    %r12,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
not    %ebx
test   $0x7,%bl
jne    1190 <main+0x50>
mov    $0xa,%edi
call   1030 <putchar@plt>
jmp    1190 <main+0x50>
lea    0xec4(%rip),%rdi
call   1040 <puts@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xe4d(%rip),%rdi
call   1040 <puts@plt>
lea    0xe79(%rip),%rdi
call   1040 <puts@plt>
lea    0xdc8(%rip),%r12
xorpd  %xmm1,%xmm1
xor    %ebx,%ebx
jmp    1294 <main+0x154>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %ebp,%ebx
cmp    $0x196,%ebp
movsd  0x8(%rsp),%xmm1
je     1327 <main+0x1e7>
ucomisd 0xd8c(%rip),%xmm1
jb     12b0 <main+0x170>
xorps  %xmm0,%xmm0
sqrtsd %xmm1,%xmm0
jmp    12c5 <main+0x185>
nopw   0x0(%rax,%rax,1)
movapd %xmm1,%xmm0
movsd  %xmm1,0x8(%rsp)
call   1060 <sqrt@plt>
movsd  0x8(%rsp),%xmm1
mulsd  0xd4b(%rip),%xmm0
addsd  0xd4b(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
mulss  0xd4f(%rip),%xmm0
cvttss2si %xmm0,%esi
addsd  0xd23(%rip),%xmm1
movsd  %xmm1,0x8(%rsp)
lea    0x1(%rbx),%ebp
cmp    $0x195,%ebx
mov    %r15,%rdx
cmove  %r14,%rdx
mov    %r12,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
not    %ebx
test   $0x7,%bl
jne    1280 <main+0x140>
mov    $0xa,%edi
call   1030 <putchar@plt>
jmp    1280 <main+0x140>
lea    0xdd4(%rip),%rdi
call   1040 <puts@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [59 x i8] c"/* DIABLO 31 seek times; approx. 15 + 8.6 * sqrt(td) ms*/\0A\00"
@.str.1 = [42 x i8] c"static const int diablo_31_seek_dt[] = {\0A\00"
@.str.2 = [6 x i8] c"\09%d%s\00"
@.str.3 = [2 x i8] c",\00"
@.str.4 = [2 x i8] c"\0A\00"
@.str.5 = [4 x i8] c"};\0A\00"
@.str.6 = [57 x i8] c"/* DIABLO 44 seek times; approx. 8 + 3 * sqrt(td) ms */\0A\00"
@.str.7 = [42 x i8] c"static const int diablo_44_seek_dt[] = {\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca float
store i32 0, i32* %1
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0))
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.1, i64 0, i64 0))
store i32 0, i32* %2
br label %6
6: ; preds = %31, %0
%7 = load i32, i32* %2
%8 = icmp slt i32 %7, 203
br i1 %8, label %9, label %34
9: ; preds = %6
%10 = load i32, i32* %2
%11 = sitofp i32 %10 to double
%12 = fmul double 1.000000e+00, %11
%13 = call double @sqrt(double %12)
%14 = call double @llvm.fmuladd.f64(double %13, double 8.600000e+00, double 1.500000e+01)
%15 = fptrunc double %14 to float
store float %15, float* %3
%16 = load float, float* %3
%17 = fmul float %16, 1.000000e+03
%18 = fptosi float %17 to i32
%19 = load i32, i32* %2
%20 = add nsw i32 %19, 1
%21 = icmp slt i32 %20, 203
%22 = zext i1 %21 to i64
%23 = select i1 %21, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0)
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 %18, i8* %23)
%25 = load i32, i32* %2
%26 = srem i32 %25, 8
%27 = icmp eq i32 7, %26
br i1 %27, label %28, label %30
28: ; preds = %9
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
br label %30
30: ; preds = %28, %9
br label %31
31: ; preds = %30
%32 = load i32, i32* %2
%33 = add nsw i32 %32, 1
store i32 %33, i32* %2
br label %6
34: ; preds = %6
%35 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0))
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%37 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.6, i64 0, i64 0))
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.7, i64 0, i64 0))
store i32 0, i32* %2
br label %39
39: ; preds = %64, %34
%40 = load i32, i32* %2
%41 = icmp slt i32 %40, 406
br i1 %41, label %42, label %67
42: ; preds = %39
%43 = load i32, i32* %2
%44 = sitofp i32 %43 to double
%45 = fmul double 1.000000e+00, %44
%46 = call double @sqrt(double %45)
%47 = call double @llvm.fmuladd.f64(double %46, double 3.000000e+00, double 8.000000e+00)
%48 = fptrunc double %47 to float
store float %48, float* %3
%49 = load float, float* %3
%50 = fmul float %49, 1.000000e+03
%51 = fptosi float %50 to i32
%52 = load i32, i32* %2
%53 = add nsw i32 %52, 1
%54 = icmp slt i32 %53, 406
%55 = zext i1 %54 to i64
%56 = select i1 %54, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0)
%57 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 %51, i8* %56)
%58 = load i32, i32* %2
%59 = srem i32 %58, 8
%60 = icmp eq i32 7, %59
br i1 %60, label %61, label %63
61: ; preds = %42
%62 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
br label %63
63: ; preds = %61, %42
br label %64
64: ; preds = %63
%65 = load i32, i32* %2
%66 = add nsw i32 %65, 1
store i32 %66, i32* %2
br label %39
67: ; preds = %39
%68 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0))
%69 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str.2 = [6 x i8] c"\09%d%s\00"
@.str.3 = [2 x i8] c",\00"
@.str.4 = [2 x i8] c"\0A\00"
@str = [58 x i8] c"/* DIABLO 31 seek times; approx. 15 + 8.6 * sqrt(td) ms*/\00"
@str.8 = [41 x i8] c"static const int diablo_31_seek_dt[] = {\00"
@str.10 = [56 x i8] c"/* DIABLO 44 seek times; approx. 8 + 3 * sqrt(td) ms */\00"
@str.11 = [41 x i8] c"static const int diablo_44_seek_dt[] = {\00"
@str.12 = [3 x i8] c"};\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([58 x i8], [58 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @str.8, i64 0, i64 0))
br label %3
3: ; preds = %0, %19
%4 = phi i32 [ 0, %0 ], [ %11, %19 ]
%5 = sitofp i32 %4 to double
%6 = tail call double @sqrt(double %5)
%7 = tail call double @llvm.fmuladd.f64(double %6, double 8.600000e+00, double 1.500000e+01)
%8 = fptrunc double %7 to float
%9 = fmul float %8, 1.000000e+03
%10 = fptosi float %9 to i32
%11 = add nuw nsw i32 %4, 1
%12 = icmp eq i32 %4, 202
%13 = select i1 %12, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0)
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 %10, i8* %13)
%15 = and i32 %4, 7
%16 = icmp eq i32 %15, 7
br i1 %16, label %17, label %19
17: ; preds = %3
%18 = tail call i32 @putchar(i32 10)
br label %19
19: ; preds = %3, %17
%20 = icmp eq i32 %11, 203
br i1 %20, label %21, label %3
21: ; preds = %19
%22 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str.12, i64 0, i64 0))
%23 = tail call i32 @putchar(i32 10)
%24 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([56 x i8], [56 x i8]* @str.10, i64 0, i64 0))
%25 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @str.11, i64 0, i64 0))
br label %26
26: ; preds = %21, %42
%27 = phi i32 [ 0, %21 ], [ %34, %42 ]
%28 = sitofp i32 %27 to double
%29 = tail call double @sqrt(double %28)
%30 = tail call double @llvm.fmuladd.f64(double %29, double 3.000000e+00, double 8.000000e+00)
%31 = fptrunc double %30 to float
%32 = fmul float %31, 1.000000e+03
%33 = fptosi float %32 to i32
%34 = add nuw nsw i32 %27, 1
%35 = icmp eq i32 %27, 405
%36 = select i1 %35, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0)
%37 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 %33, i8* %36)
%38 = and i32 %27, 7
%39 = icmp eq i32 %38, 7
br i1 %39, label %40, label %42
40: ; preds = %26
%41 = tail call i32 @putchar(i32 10)
br label %42
42: ; preds = %26, %40
%43 = icmp eq i32 %34, 406
br i1 %43, label %44, label %26
44: ; preds = %42
%45 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str.12, i64 0, i64 0))
%46 = tail call i32 @putchar(i32 10)
ret i32 0
}