#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*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, double, double,
                           double);
int /*<<< orphan*/ printf(char *);
void gen_evalpoints(char *filename, double str_x, double end_x, double stp_x,
                    double str_y, double end_y, double stp_y, double str_z,
                    double end_z, double stp_z) {
  double i, j, k;
  FILE *fp;
  printf("Generating the evaluation points\n");
  fp = fopen(filename, "w");
  for (i = str_x; i <= end_x; i = i + stp_x) {
    for (j = str_y; j <= end_y; j = j + stp_y) {
      for (k = str_z; k <= end_z; k = k + stp_z) {
        fprintf(fp, "%f %f %f\n", i, j, k);
      }
    }
  }
  fclose(fp);
  printf("Finished generating the evaluation points\n");
}


x86 assembly (clang, -O0):
<gen_evalpoints>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movsd  0x10(%rbp),%xmm8
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
movsd  %xmm3,-0x28(%rbp)
movsd  %xmm4,-0x30(%rbp)
movsd  %xmm5,-0x38(%rbp)
movsd  %xmm6,-0x40(%rbp)
movsd  %xmm7,-0x48(%rbp)
lea    0xe7f(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%rdi
lea    0xe91(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,-0x68(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x50(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jb     1259 <gen_evalpoints+0x119>
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x58(%rbp),%xmm1
movsd  -0x30(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jb     1240 <gen_evalpoints+0x100>
movsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x60(%rbp),%xmm1
movsd  -0x48(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jb     1227 <gen_evalpoints+0xe7>
mov    -0x68(%rbp),%rdi
movsd  -0x50(%rbp),%xmm0
movsd  -0x58(%rbp),%xmm1
movsd  -0x60(%rbp),%xmm2
lea    0xe16(%rip),%rsi
call   1050 <fprintf@plt>
movsd  -0x60(%rbp),%xmm0
addsd  0x10(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
jmp    11e0 <gen_evalpoints+0xa0>
jmp    122c <gen_evalpoints+0xec>
movsd  -0x58(%rbp),%xmm0
addsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
jmp    11c2 <gen_evalpoints+0x82>
jmp    1245 <gen_evalpoints+0x105>
movsd  -0x50(%rbp),%xmm0
addsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
jmp    11a4 <gen_evalpoints+0x64>
mov    -0x68(%rbp),%rdi
call   1030 <fclose@plt>
lea    0xdc5(%rip),%rdi
call   1040 <printf@plt>
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gen_evalpoints>:
push   %r14
push   %rbx
sub    $0x58,%rsp
movsd  %xmm7,0x28(%rsp)
movsd  %xmm6,0x20(%rsp)
movsd  %xmm5,0x38(%rsp)
movsd  %xmm4,0x18(%rsp)
movsd  %xmm3,0x10(%rsp)
movsd  %xmm2,0x30(%rsp)
movsd  %xmm1,0x8(%rsp)
movsd  %xmm0,(%rsp)
mov    %rdi,%rbx
movsd  0x70(%rsp),%xmm0
movsd  %xmm0,0x40(%rsp)
lea    0xe80(%rip),%rdi
call   1030 <puts@plt>
lea    0xe68(%rip),%rsi
mov    %rbx,%rdi
call   1060 <fopen@plt>
movsd  (%rsp),%xmm0
movsd  0x28(%rsp),%xmm4
mov    %rax,%rbx
movsd  0x8(%rsp),%xmm1
ucomisd %xmm0,%xmm1
jae    11d5 <gen_evalpoints+0x95>
mov    %rbx,%rdi
call   1040 <fclose@plt>
lea    0xe64(%rip),%rdi
add    $0x58,%rsp
pop    %rbx
pop    %r14
jmp    1030 <puts@plt>
lea    0xe26(%rip),%r14
jmp    11f2 <gen_evalpoints+0xb2>
xchg   %ax,%ax
addsd  0x30(%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
ucomisd %xmm0,%xmm1
jb     11ba <gen_evalpoints+0x7a>
movsd  0x18(%rsp),%xmm1
ucomisd 0x10(%rsp),%xmm1
jb     11e0 <gen_evalpoints+0xa0>
movsd  0x10(%rsp),%xmm3
movsd  %xmm0,(%rsp)
jmp    1222 <gen_evalpoints+0xe2>
nopl   (%rax)
addsd  0x38(%rsp),%xmm3
movsd  0x18(%rsp),%xmm1
ucomisd %xmm3,%xmm1
jb     11e0 <gen_evalpoints+0xa0>
ucomisd 0x20(%rsp),%xmm4
jb     1210 <gen_evalpoints+0xd0>
movsd  0x20(%rsp),%xmm2
movsd  %xmm3,0x48(%rsp)
cs nopw 0x0(%rax,%rax,1)
movsd  %xmm2,0x50(%rsp)
mov    %rbx,%rdi
mov    %r14,%rsi
movapd %xmm3,%xmm1
call   1050 <fprintf@plt>
movsd  0x50(%rsp),%xmm2
movsd  0x40(%rsp),%xmm1
movsd  0x48(%rsp),%xmm3
movsd  (%rsp),%xmm0
movsd  0x28(%rsp),%xmm4
addsd  %xmm1,%xmm2
ucomisd %xmm2,%xmm4
jae    1240 <gen_evalpoints+0x100>
jmp    1210 <gen_evalpoints+0xd0>

LLVM IR (-O0):
@.str = [34 x i8] c"Generating the evaluation points\0A\00"
@.str.1 = [2 x i8] c"w\00"
@.str.2 = [10 x i8] c"%f %f %f\0A\00"
@.str.3 = [43 x i8] c"Finished generating the evaluation points\0A\00"
define void @gen_evalpoints(i8* %0, double %1, double %2, double %3, double %4, double %5, double %6, double %7, double %8, double %9) {
%11 = alloca i8*
%12 = alloca double
%13 = alloca double
%14 = alloca double
%15 = alloca double
%16 = alloca double
%17 = alloca double
%18 = alloca double
%19 = alloca double
%20 = alloca double
%21 = alloca double
%22 = alloca double
%23 = alloca double
%24 = alloca i32*
store i8* %0, i8** %11
store double %1, double* %12
store double %2, double* %13
store double %3, double* %14
store double %4, double* %15
store double %5, double* %16
store double %6, double* %17
store double %7, double* %18
store double %8, double* %19
store double %9, double* %20
%25 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%26 = load i8*, i8** %11
%27 = call i32* @fopen(i8* %26, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %27, i32** %24
%28 = load double, double* %12
store double %28, double* %21
br label %29
29: ; preds = %61, %10
%30 = load double, double* %21
%31 = load double, double* %13
%32 = fcmp ole double %30, %31
br i1 %32, label %33, label %65
33: ; preds = %29
%34 = load double, double* %15
store double %34, double* %22
br label %35
35: ; preds = %56, %33
%36 = load double, double* %22
%37 = load double, double* %16
%38 = fcmp ole double %36, %37
br i1 %38, label %39, label %60
39: ; preds = %35
%40 = load double, double* %18
store double %40, double* %23
br label %41
41: ; preds = %51, %39
%42 = load double, double* %23
%43 = load double, double* %19
%44 = fcmp ole double %42, %43
br i1 %44, label %45, label %55
45: ; preds = %41
%46 = load i32*, i32** %24
%47 = load double, double* %21
%48 = load double, double* %22
%49 = load double, double* %23
%50 = call i32 @fprintf(i32* %46, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), double %47, double %48, double %49)
br label %51
51: ; preds = %45
%52 = load double, double* %23
%53 = load double, double* %20
%54 = fadd double %52, %53
store double %54, double* %23
br label %41
55: ; preds = %41
br label %56
56: ; preds = %55
%57 = load double, double* %22
%58 = load double, double* %17
%59 = fadd double %57, %58
store double %59, double* %22
br label %35
60: ; preds = %35
br label %61
61: ; preds = %60
%62 = load double, double* %21
%63 = load double, double* %14
%64 = fadd double %62, %63
store double %64, double* %21
br label %29
65: ; preds = %29
%66 = load i32*, i32** %24
%67 = call i32 @fclose(i32* %66)
%68 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str.1 = [2 x i8] c"w\00"
@.str.2 = [10 x i8] c"%f %f %f\0A\00"
@str = [33 x i8] c"Generating the evaluation points\00"
@str.4 = [42 x i8] c"Finished generating the evaluation points\00"
define void @gen_evalpoints(i8* nocapture %0, double %1, double %2, double %3, double %4, double %5, double %6, double %7, double %8, double %9) {
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str, i64 0, i64 0))
%12 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%13 = fcmp ugt double %1, %2
br i1 %13, label %32, label %14
14: ; preds = %10
%15 = fcmp ugt double %4, %5
%16 = fcmp ugt double %7, %8
br label %17
17: ; preds = %14, %29
%18 = phi double [ %1, %14 ], [ %30, %29 ]
br i1 %15, label %29, label %19
19: ; preds = %17, %26
%20 = phi double [ %27, %26 ], [ %4, %17 ]
br i1 %16, label %26, label %21
21: ; preds = %19, %21
%22 = phi double [ %24, %21 ], [ %7, %19 ]
%23 = tail call i32 @fprintf(i32* %12, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), double %18, double %20, double %22)
%24 = fadd double %22, %9
%25 = fcmp ugt double %24, %8
br i1 %25, label %26, label %21
26: ; preds = %21, %19
%27 = fadd double %20, %6
%28 = fcmp ugt double %27, %5
br i1 %28, label %29, label %19
29: ; preds = %26, %17
%30 = fadd double %18, %3
%31 = fcmp ugt double %30, %2
br i1 %31, label %32, label %17
32: ; preds = %29, %10
%33 = tail call i32 @fclose(i32* %12)
%34 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @str.4, i64 0, i64 0))
ret void
}