#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*/ d_array;

/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stdout;
int /*<<< orphan*/ usleep(int);
int main(void) {
  double delay_sec = 3;
  int delay_us = delay_sec * 1000000;
  double num_steps = 60;
  double dmax = 500;
  double dmin = 0;
  double step_height = (dmax - dmin) / num_steps;
  double i;
  int j;
  double d_array[] = {1000.0, 750.0,  500.0,  400.0, 300.0, 250.0, 200.0,
                      150.0,  125.00, 100.00, 80.0,  60.0,  50.0,  40.0,
                      35.0,   30.0,   25.0,   20.0,  15.0,  13.0,  11.0,
                      10.0,   9.0,    8.0,    7.0,   6.0,   5.0,   4.0,
                      3.0,    2.0,    1.5,    1.0,   0.5,   0.0};
  for (j = 0; j < (sizeof(d_array) / sizeof(double)); j++) {
    fprintf(stdout, "%.2f\n", d_array[j]);
    usleep(delay_us);
  }
  fprintf(stdout, "q\n");
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x160,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xece(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xeb9(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x14(%rbp)
movsd  0xe9d(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xe88(%rip),%xmm0
movsd  %xmm0,-0x28(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x28(%rbp),%xmm0
subsd  -0x30(%rbp),%xmm0
divsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
lea    -0x160(%rbp),%rdi
lea    0xe79(%rip),%rsi
mov    $0x110,%edx
call   1040 <memcpy@plt>
movl   $0x0,-0x44(%rbp)
movslq -0x44(%rbp),%rax
cmp    $0x22,%rax
jae    1200 <main+0xd0>
mov    0x2e13(%rip),%rax
mov    (%rax),%edi
movslq -0x44(%rbp),%rax
movsd  -0x160(%rbp,%rax,8),%xmm0
ff ff
lea    0xf4d(%rip),%rsi
mov    $0x1,%al
call   1030 <fprintf@plt>
mov    -0x14(%rbp),%edi
call   1050 <usleep@plt>
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    11b8 <main+0x88>
mov    0x2dd9(%rip),%rax
mov    (%rax),%edi
lea    0xf26(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2dba(%rip),%rax
mov    (%rax),%eax
add    $0x160,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
xor    %ebx,%ebx
mov    0x2eaf(%rip),%r15
lea    0xec8(%rip),%r12
lea    0xfd1(%rip),%r14
nop
mov    (%r15),%edi
movsd  (%rbx,%r12,1),%xmm0
mov    %r14,%rsi
mov    $0x1,%al
call   1030 <fprintf@plt>
mov    $0x2dc6c0,%edi
call   1040 <usleep@plt>
add    $0x8,%rbx
cmp    $0x110,%rbx
jne    1140 <main+0x20>
mov    (%r15),%edi
lea    0xfa2(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    0x2e56(%rip),%rax
mov    (%rax),%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@__const.main.d_array = [34 x double] [double 1.000000e+03, double 7.500000e+02, double 5.000000e+02, double 4.000000e+02, double 3.000000e+02, double 2.500000e+02, double 2.000000e+02, double 1.500000e+02, double 1.250000e+02, double 1.000000e+02, double 8.000000e+01, double 6.000000e+01, double 5.000000e+01, double 4.000000e+01, double 3.500000e+01, double 3.000000e+01, double 2.500000e+01, double 2.000000e+01, double 1.500000e+01, double 1.300000e+01, double 1.100000e+01, double 1.000000e+01, double 9.000000e+00, double 8.000000e+00, double 7.000000e+00, double 6.000000e+00, double 5.000000e+00, double 4.000000e+00, double 3.000000e+00, double 2.000000e+00, double 1.500000e+00, double 1.000000e+00, double 5.000000e-01, double 0.000000e+00]
@stdout = global i32 0
@.str = [6 x i8] c"%.2f\0A\00"
@.str.1 = [3 x i8] c"q\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca i32
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca i32
%10 = alloca [34 x double]
store i32 0, i32* %1
store double 3.000000e+00, double* %2
%11 = load double, double* %2
%12 = fmul double %11, 1.000000e+06
%13 = fptosi double %12 to i32
store i32 %13, i32* %3
store double 6.000000e+01, double* %4
store double 5.000000e+02, double* %5
store double 0.000000e+00, double* %6
%14 = load double, double* %5
%15 = load double, double* %6
%16 = fsub double %14, %15
%17 = load double, double* %4
%18 = fdiv double %16, %17
store double %18, double* %7
%19 = bitcast [34 x double]* %10 to i8*
store i32 0, i32* %9
br label %20
20: ; preds = %33, %0
%21 = load i32, i32* %9
%22 = sext i32 %21 to i64
%23 = icmp ult i64 %22, 34
br i1 %23, label %24, label %36
24: ; preds = %20
%25 = load i32, i32* @stdout
%26 = load i32, i32* %9
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds [34 x double], [34 x double]* %10, i64 0, i64 %27
%29 = load double, double* %28
%30 = call i32 (i32, i8*, ...) @fprintf(i32 %25, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), double %29)
%31 = load i32, i32* %3
%32 = call i32 @usleep(i32 %31)
br label %33
33: ; preds = %24
%34 = load i32, i32* %9
%35 = add nsw i32 %34, 1
store i32 %35, i32* %9
br label %20
36: ; preds = %20
%37 = load i32, i32* @stdout
%38 = call i32 (i32, i8*, ...) @fprintf(i32 %37, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%39 = load i32, i32* @EXIT_SUCCESS
ret i32 %39
}

LLVM IR (-O2):
@__const.main.d_array = [34 x double] [double 1.000000e+03, double 7.500000e+02, double 5.000000e+02, double 4.000000e+02, double 3.000000e+02, double 2.500000e+02, double 2.000000e+02, double 1.500000e+02, double 1.250000e+02, double 1.000000e+02, double 8.000000e+01, double 6.000000e+01, double 5.000000e+01, double 4.000000e+01, double 3.500000e+01, double 3.000000e+01, double 2.500000e+01, double 2.000000e+01, double 1.500000e+01, double 1.300000e+01, double 1.100000e+01, double 1.000000e+01, double 9.000000e+00, double 8.000000e+00, double 7.000000e+00, double 6.000000e+00, double 5.000000e+00, double 4.000000e+00, double 3.000000e+00, double 2.000000e+00, double 1.500000e+00, double 1.000000e+00, double 5.000000e-01, double 0.000000e+00]
@stdout = global i32 0
@.str = [6 x i8] c"%.2f\0A\00"
@.str.1 = [3 x i8] c"q\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i64 [ 0, %0 ], [ %8, %1 ]
%3 = load i32, i32* @stdout
%4 = getelementptr inbounds [34 x double], [34 x double]* @__const.main.d_array, i64 0, i64 %2
%5 = load double, double* %4
%6 = tail call i32 (i32, i8*, ...) @fprintf(i32 %3, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), double %5)
%7 = tail call i32 @usleep(i32 3000000)
%8 = add nuw nsw i64 %2, 1
%9 = icmp eq i64 %8, 34
br i1 %9, label %10, label %1
10: ; preds = %1
%11 = load i32, i32* @stdout
%12 = tail call i32 (i32, i8*, ...) @fprintf(i32 %11, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%13 = load i32, i32* @EXIT_SUCCESS
ret i32 %13
}