#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 *, double, double,
                           double);
void write_vtkPointCoordinates(FILE *fp, int imax, int jmax, int kmax,
                               double dx, double dy, double dz) {
  double i, j, k;
  for (k = 0; k < kmax + 1; k += 1) {
    for (j = 0; j < jmax + 1; j += 1) {
      for (i = 0; i < imax + 1; i += 1) {
        fprintf(fp, "%f %f %f\n", i * dx, j * dy, k * dz);
      }
    }
  }
}


x86 assembly (clang, -O0):
<write_vtkPointCoordinates>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
movsd  %xmm0,-0x20(%rbp)
movsd  %xmm1,-0x28(%rbp)
movsd  %xmm2,-0x30(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x48(%rbp),%xmm1
mov    -0x14(%rbp),%eax
add    $0x1,%eax
cvtsi2sd %eax,%xmm0
ucomisd %xmm1,%xmm0
jbe    1214 <write_vtkPointCoordinates+0x104>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x40(%rbp),%xmm1
mov    -0x10(%rbp),%eax
add    $0x1,%eax
cvtsi2sd %eax,%xmm0
ucomisd %xmm1,%xmm0
jbe    11f8 <write_vtkPointCoordinates+0xe8>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x38(%rbp),%xmm1
mov    -0xc(%rbp),%eax
add    $0x1,%eax
cvtsi2sd %eax,%xmm0
ucomisd %xmm1,%xmm0
jbe    11dc <write_vtkPointCoordinates+0xcc>
mov    -0x8(%rbp),%rdi
movsd  -0x38(%rbp),%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  -0x40(%rbp),%xmm1
mulsd  -0x28(%rbp),%xmm1
movsd  -0x48(%rbp),%xmm2
mulsd  -0x30(%rbp),%xmm2
lea    0xe48(%rip),%rsi
call   1030 <fprintf@plt>
movsd  0xe33(%rip),%xmm0
addsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
jmp    117e <write_vtkPointCoordinates+0x6e>
jmp    11e1 <write_vtkPointCoordinates+0xd1>
movsd  0xe17(%rip),%xmm0
addsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
jmp    115d <write_vtkPointCoordinates+0x4d>
jmp    11fd <write_vtkPointCoordinates+0xed>
movsd  0xdfb(%rip),%xmm0
addsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
jmp    113c <write_vtkPointCoordinates+0x2c>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_vtkPointCoordinates>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x58,%rsp
movsd  %xmm2,0x18(%rsp)
movsd  %xmm1,0x28(%rsp)
test   %ecx,%ecx
js     1260 <write_vtkPointCoordinates+0x150>
movapd %xmm0,%xmm1
mov    %edx,%r14d
mov    %esi,%r15d
mov    %rdi,%rbx
add    $0x1,%ecx
xorps  %xmm0,%xmm0
cvtsi2sd %ecx,%xmm0
movsd  %xmm0,0x20(%rsp)
lea    0x1(%r14),%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  %xmm0,0x30(%rsp)
lea    0x1(%r15),%eax
cvtsi2sd %eax,%xmm5
xorpd  %xmm0,%xmm0
movsd  %xmm0,(%rsp)
lea    0xe93(%rip),%r12
movsd  0xe83(%rip),%xmm4
movsd  %xmm1,0x40(%rsp)
movsd  %xmm5,0x38(%rsp)
jmp    11ae <write_vtkPointCoordinates+0x9e>
nopl   0x0(%rax,%rax,1)
movsd  (%rsp),%xmm3
addsd  %xmm4,%xmm3
movsd  0x20(%rsp),%xmm0
movsd  %xmm3,(%rsp)
ucomisd %xmm3,%xmm0
jbe    1260 <write_vtkPointCoordinates+0x150>
test   %r14d,%r14d
js     1190 <write_vtkPointCoordinates+0x80>
movsd  (%rsp),%xmm2
mulsd  0x18(%rsp),%xmm2
xorpd  %xmm0,%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  %xmm2,0x48(%rsp)
jmp    11ec <write_vtkPointCoordinates+0xdc>
movsd  0x8(%rsp),%xmm3
addsd  %xmm4,%xmm3
movsd  0x30(%rsp),%xmm0
movsd  %xmm3,0x8(%rsp)
ucomisd %xmm3,%xmm0
jbe    1190 <write_vtkPointCoordinates+0x80>
test   %r15d,%r15d
js     11d0 <write_vtkPointCoordinates+0xc0>
movsd  0x8(%rsp),%xmm0
mulsd  0x28(%rsp),%xmm0
movsd  %xmm0,0x50(%rsp)
xorpd  %xmm0,%xmm0
nopw   0x0(%rax,%rax,1)
movsd  %xmm0,0x10(%rsp)
movsd  0x10(%rsp),%xmm0
mulsd  %xmm1,%xmm0
mov    %rbx,%rdi
mov    %r12,%rsi
movsd  0x50(%rsp),%xmm1
call   1030 <fprintf@plt>
movsd  0x10(%rsp),%xmm0
movsd  0x48(%rsp),%xmm2
movsd  0xdbb(%rip),%xmm4
movsd  0x38(%rsp),%xmm5
movsd  0x40(%rsp),%xmm1
addsd  %xmm4,%xmm0
ucomisd %xmm0,%xmm5
ja     1210 <write_vtkPointCoordinates+0x100>
jmp    11d0 <write_vtkPointCoordinates+0xc0>
add    $0x58,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [10 x i8] c"%f %f %f\0A\00"
define void @write_vtkPointCoordinates(i32* %0, i32 %1, i32 %2, i32 %3, double %4, double %5, double %6) {
%8 = alloca i32*
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca double
%13 = alloca double
%14 = alloca double
%15 = alloca double
%16 = alloca double
%17 = alloca double
store i32* %0, i32** %8
store i32 %1, i32* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store double %4, double* %12
store double %5, double* %13
store double %6, double* %14
store double 0.000000e+00, double* %17
br label %18
18: ; preds = %58, %7
%19 = load double, double* %17
%20 = load i32, i32* %11
%21 = add nsw i32 %20, 1
%22 = sitofp i32 %21 to double
%23 = fcmp olt double %19, %22
br i1 %23, label %24, label %61
24: ; preds = %18
store double 0.000000e+00, double* %16
br label %25
25: ; preds = %54, %24
%26 = load double, double* %16
%27 = load i32, i32* %10
%28 = add nsw i32 %27, 1
%29 = sitofp i32 %28 to double
%30 = fcmp olt double %26, %29
br i1 %30, label %31, label %57
31: ; preds = %25
store double 0.000000e+00, double* %15
br label %32
32: ; preds = %50, %31
%33 = load double, double* %15
%34 = load i32, i32* %9
%35 = add nsw i32 %34, 1
%36 = sitofp i32 %35 to double
%37 = fcmp olt double %33, %36
br i1 %37, label %38, label %53
38: ; preds = %32
%39 = load i32*, i32** %8
%40 = load double, double* %15
%41 = load double, double* %12
%42 = fmul double %40, %41
%43 = load double, double* %16
%44 = load double, double* %13
%45 = fmul double %43, %44
%46 = load double, double* %17
%47 = load double, double* %14
%48 = fmul double %46, %47
%49 = call i32 @fprintf(i32* %39, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), double %42, double %45, double %48)
br label %50
50: ; preds = %38
%51 = load double, double* %15
%52 = fadd double %51, 1.000000e+00
store double %52, double* %15
br label %32
53: ; preds = %32
br label %54
54: ; preds = %53
%55 = load double, double* %16
%56 = fadd double %55, 1.000000e+00
store double %56, double* %16
br label %25
57: ; preds = %25
br label %58
58: ; preds = %57
%59 = load double, double* %17
%60 = fadd double %59, 1.000000e+00
store double %60, double* %17
br label %18
61: ; preds = %18
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"%f %f %f\0A\00"
define void @write_vtkPointCoordinates(i32* nocapture %0, i32 %1, i32 %2, i32 %3, double %4, double %5, double %6) {
%8 = add nsw i32 %3, 1
%9 = sitofp i32 %8 to double
%10 = icmp sgt i32 %3, -1
br i1 %10, label %11, label %38
11: ; preds = %7
%12 = add nsw i32 %2, 1
%13 = sitofp i32 %12 to double
%14 = icmp sgt i32 %2, -1
%15 = add nsw i32 %1, 1
%16 = sitofp i32 %15 to double
%17 = icmp sgt i32 %1, -1
br label %18
18: ; preds = %11, %35
%19 = phi double [ 0.000000e+00, %11 ], [ %36, %35 ]
br i1 %14, label %20, label %35
20: ; preds = %18
%21 = fmul double %19, %6
br label %22
22: ; preds = %20, %32
%23 = phi double [ 0.000000e+00, %20 ], [ %33, %32 ]
br i1 %17, label %24, label %32
24: ; preds = %22
%25 = fmul double %23, %5
br label %26
26: ; preds = %24, %26
%27 = phi double [ 0.000000e+00, %24 ], [ %30, %26 ]
%28 = fmul double %27, %4
%29 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), double %28, double %25, double %21)
%30 = fadd double %27, 1.000000e+00
%31 = fcmp olt double %30, %16
br i1 %31, label %26, label %32
32: ; preds = %26, %22
%33 = fadd double %23, 1.000000e+00
%34 = fcmp olt double %33, %13
br i1 %34, label %22, label %35
35: ; preds = %32, %18
%36 = fadd double %19, 1.000000e+00
%37 = fcmp olt double %36, %9
br i1 %37, label %18, label %38
38: ; preds = %35, %7
ret void
}