#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*/ exit(int);
int /*<<< orphan*/ printf(char *, ...);
void xsfvol(double value(), double xmin, double xmax, double ymin, double ymax,
            double zmin, double zmax, int nx, int ny, int nz) {
  int i, j, k;
  double dx, dy, dz;
  if (nx < 2 || ny < 2 || nz < 2) {
    printf("Invalid range of grid points\n");
    exit(-1);
  }
  dx = (xmax - xmin) / (nx - 1.);
  dy = (ymax - ymin) / (ny - 1.);
  dz = (zmax - zmin) / (nz - 1.);
  printf("ATOMS\n");
  printf("0 %20.8E %20.8E %20.8E\n", (xmax + xmin) / 2.0, (ymax + ymin) / 2.0,
         (zmax + zmin) / 2.0);
  printf("BEGIN_BLOCK_DATAGRID_3D\n");
  printf("datagrids\n");
  printf("BEGIN_DATAGRID_3D_DENSITY\n");
  printf("%d %d %d\n", nx, ny, nz);
  printf("%20.8E%20.8E%20.8E\n", xmin, ymin, zmin);
  printf("%20.8E%20.8E%20.8E\n", xmax - xmin, 0.0, 0.0);
  printf("%20.8E%20.8E%20.8E\n", 0.0, ymax - ymin, 0.0);
  printf("%20.8E%20.8E%20.8E\n", 0.0, 0.0, zmax - zmin);
  for (k = 0; k < nz; k++) {
    for (j = 0; j < ny; j++)
      for (i = 0; i < nx; i++)
        printf("%20.8E", value(xmin + dx * i, ymin + dy * j, zmin + dz * k));
    printf("\n");
  }
  printf("END_DATAGRID_3D\n");
  printf("END_BLOCK_DATAGRID_3D\n");
}


x86 assembly (clang, -O0):
<xsfvol>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
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)
mov    %esi,-0x3c(%rbp)
mov    %edx,-0x40(%rbp)
mov    %ecx,-0x44(%rbp)
cmpl   $0x2,-0x3c(%rbp)
jl     1171 <xsfvol+0x51>
cmpl   $0x2,-0x40(%rbp)
jl     1171 <xsfvol+0x51>
cmpl   $0x2,-0x44(%rbp)
jge    1189 <xsfvol+0x69>
lea    0xe98(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>
movsd  -0x18(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
cvtsi2sdl -0x3c(%rbp),%xmm1
movsd  0xe68(%rip),%xmm2
subsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x28(%rbp),%xmm0
subsd  -0x20(%rbp),%xmm0
cvtsi2sdl -0x40(%rbp),%xmm1
movsd  0xe44(%rip),%xmm2
subsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x38(%rbp),%xmm0
subsd  -0x30(%rbp),%xmm0
cvtsi2sdl -0x44(%rbp),%xmm1
movsd  0xe20(%rip),%xmm2
subsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
lea    0xe32(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movsd  -0x18(%rbp),%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  0xdeb(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  -0x28(%rbp),%xmm1
addsd  -0x20(%rbp),%xmm1
movsd  0xdd5(%rip),%xmm2
divsd  %xmm2,%xmm1
movsd  -0x38(%rbp),%xmm2
addsd  -0x30(%rbp),%xmm2
movsd  0xdbf(%rip),%xmm3
divsd  %xmm3,%xmm2
lea    0xde9(%rip),%rdi
mov    $0x3,%al
call   1030 <printf@plt>
lea    0xdf3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xdfe(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xdfb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x3c(%rbp),%esi
mov    -0x40(%rbp),%edx
mov    -0x44(%rbp),%ecx
lea    0xdff(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movsd  -0x10(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
movsd  -0x30(%rbp),%xmm2
lea    0xdec(%rip),%rdi
mov    $0x3,%al
call   1030 <printf@plt>
movsd  -0x18(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
lea    0xdd4(%rip),%rdi
xorps  %xmm2,%xmm2
movaps %xmm2,%xmm1
mov    $0x3,%al
call   1030 <printf@plt>
movsd  -0x28(%rbp),%xmm1
subsd  -0x20(%rbp),%xmm1
lea    0xdb6(%rip),%rdi
xorps  %xmm2,%xmm2
movaps %xmm2,%xmm0
mov    $0x3,%al
call   1030 <printf@plt>
movsd  -0x38(%rbp),%xmm2
subsd  -0x30(%rbp),%xmm2
lea    0xd98(%rip),%rdi
xorps  %xmm1,%xmm1
movaps %xmm1,%xmm0
mov    $0x3,%al
call   1030 <printf@plt>
movl   $0x0,-0x50(%rbp)
mov    -0x50(%rbp),%eax
cmp    -0x44(%rbp),%eax
jge    13dc <xsfvol+0x2bc>
movl   $0x0,-0x4c(%rbp)
mov    -0x4c(%rbp),%eax
cmp    -0x40(%rbp),%eax
jge    13c0 <xsfvol+0x2a0>
movl   $0x0,-0x48(%rbp)
mov    -0x48(%rbp),%eax
cmp    -0x3c(%rbp),%eax
jge    13ad <xsfvol+0x28d>
mov    -0x8(%rbp),%rcx
movsd  -0x10(%rbp),%xmm1
movsd  -0x58(%rbp),%xmm0
cvtsi2sdl -0x48(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  -0x20(%rbp),%xmm2
movsd  -0x60(%rbp),%xmm1
cvtsi2sdl -0x4c(%rbp),%xmm3
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
movsd  -0x30(%rbp),%xmm3
movsd  -0x68(%rbp),%xmm2
cvtsi2sdl -0x50(%rbp),%xmm4
mulsd  %xmm4,%xmm2
addsd  %xmm3,%xmm2
mov    $0x3,%al
call   *%rcx
lea    0xd12(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0x48(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x48(%rbp)
jmp    1338 <xsfvol+0x218>
jmp    13b2 <xsfvol+0x292>
mov    -0x4c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4c(%rbp)
jmp    1325 <xsfvol+0x205>
lea    0xcf9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x50(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x50(%rbp)
jmp    1312 <xsfvol+0x1f2>
lea    0xcce(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xcd1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xsfvol>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x68,%rsp
mov    %ecx,0x4(%rsp)
movsd  %xmm4,0x8(%rsp)
movsd  %xmm2,0x10(%rsp)
cmp    $0x2,%esi
jl     1439 <xsfvol+0x2f9>
mov    %edx,%r15d
cmp    $0x2,%edx
jl     1439 <xsfvol+0x2f9>
cmpl   $0x1,0x4(%rsp)
jle    1439 <xsfvol+0x2f9>
mov    %esi,%r13d
mov    %rdi,%rbp
movapd %xmm1,%xmm2
subsd  %xmm0,%xmm2
movsd  %xmm2,0x38(%rsp)
movsd  %xmm0,0x30(%rsp)
xorps  %xmm0,%xmm0
cvtsi2sd %esi,%xmm0
movsd  %xmm1,0x28(%rsp)
movsd  0xe53(%rip),%xmm1
addsd  %xmm1,%xmm0
divsd  %xmm0,%xmm2
movsd  %xmm2,0x60(%rsp)
movapd %xmm3,%xmm2
xorps  %xmm0,%xmm0
cvtsi2sd %r15d,%xmm0
subsd  0x10(%rsp),%xmm2
movsd  %xmm2,0x40(%rsp)
addsd  %xmm1,%xmm0
divsd  %xmm0,%xmm2
movsd  %xmm2,0x58(%rsp)
movapd %xmm5,%xmm2
subsd  0x8(%rsp),%xmm2
movsd  %xmm2,0x48(%rsp)
mov    0x4(%rsp),%ebx
xorps  %xmm0,%xmm0
cvtsi2sd %ebx,%xmm0
addsd  %xmm1,%xmm0
movapd %xmm2,%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,0x50(%rsp)
lea    0xe40(%rip),%rdi
movsd  %xmm5,0x20(%rsp)
movsd  %xmm3,0x18(%rsp)
call   1040 <puts@plt>
movsd  0x28(%rsp),%xmm0
addsd  0x30(%rsp),%xmm0
movsd  0xdce(%rip),%xmm3
mulsd  %xmm3,%xmm0
movsd  0x18(%rsp),%xmm1
addsd  0x10(%rsp),%xmm1
mulsd  %xmm3,%xmm1
movsd  0x20(%rsp),%xmm2
addsd  0x8(%rsp),%xmm2
mulsd  %xmm3,%xmm2
lea    0xdb3(%rip),%rdi
mov    $0x3,%al
call   1050 <printf@plt>
lea    0xde8(%rip),%rdi
call   1040 <puts@plt>
lea    0xdf4(%rip),%rdi
call   1040 <puts@plt>
lea    0xdf2(%rip),%rdi
call   1040 <puts@plt>
lea    0xd99(%rip),%rdi
xor    %r14d,%r14d
mov    %r13d,%esi
mov    %r15d,%edx
mov    %ebx,%ecx
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xd8a(%rip),%rbx
mov    %rbx,%rdi
movsd  0x30(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
movsd  0x8(%rsp),%xmm2
mov    $0x3,%al
call   1050 <printf@plt>
xorps  %xmm1,%xmm1
xorps  %xmm2,%xmm2
mov    %rbx,%rdi
movsd  0x38(%rsp),%xmm0
mov    $0x3,%al
call   1050 <printf@plt>
xorpd  %xmm0,%xmm0
xorps  %xmm2,%xmm2
mov    %rbx,%rdi
movsd  0x40(%rsp),%xmm1
mov    $0x3,%al
call   1050 <printf@plt>
xorpd  %xmm0,%xmm0
xorpd  %xmm1,%xmm1
mov    %rbx,%rdi
movsd  0x48(%rsp),%xmm2
mov    $0x3,%al
call   1050 <printf@plt>
xorpd  %xmm0,%xmm0
lea    0xd32(%rip),%rbx
nopl   0x0(%rax)
mov    %r14d,0x20(%rsp)
movsd  0x50(%rsp),%xmm1
movsd  %xmm0,0x18(%rsp)
mulsd  %xmm0,%xmm1
addsd  0x8(%rsp),%xmm1
xorpd  %xmm0,%xmm0
xor    %r14d,%r14d
movsd  %xmm1,0x38(%rsp)
nopl   0x0(%rax,%rax,1)
movsd  0x58(%rsp),%xmm2
movsd  %xmm0,0x28(%rsp)
mulsd  %xmm0,%xmm2
addsd  0x10(%rsp),%xmm2
movsd  %xmm2,0x40(%rsp)
xorpd  %xmm2,%xmm2
mov    %r13d,%r12d
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movsd  %xmm2,0x48(%rsp)
movsd  0x60(%rsp),%xmm0
mulsd  %xmm2,%xmm0
addsd  0x30(%rsp),%xmm0
movsd  0x40(%rsp),%xmm1
movsd  0x38(%rsp),%xmm2
mov    $0x3,%al
call   *%rbp
mov    %rbx,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
movsd  0x48(%rsp),%xmm2
movsd  0xc52(%rip),%xmm0
addsd  %xmm0,%xmm2
add    $0xffffffff,%r12d
jne    1380 <xsfvol+0x240>
movsd  0x28(%rsp),%xmm2
addsd  %xmm0,%xmm2
movapd %xmm2,%xmm0
add    $0x1,%r14d
cmp    %r15d,%r14d
jne    1350 <xsfvol+0x210>
mov    $0xa,%edi
call   1030 <putchar@plt>
movsd  0xc1b(%rip),%xmm1
movsd  0x18(%rsp),%xmm0
addsd  %xmm1,%xmm0
mov    0x20(%rsp),%r14d
add    $0x1,%r14d
cmp    0x4(%rsp),%r14d
jne    1320 <xsfvol+0x1e0>
lea    0xc7d(%rip),%rdi
call   1040 <puts@plt>
lea    0xc81(%rip),%rdi
add    $0x68,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <puts@plt>
lea    0xc7d(%rip),%rdi
call   1040 <puts@plt>
mov    $0xffffffff,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [30 x i8] c"Invalid range of grid points\0A\00"
@.str.1 = [7 x i8] c"ATOMS\0A\00"
@.str.2 = [24 x i8] c"0 %20.8E %20.8E %20.8E\0A\00"
@.str.3 = [25 x i8] c"BEGIN_BLOCK_DATAGRID_3D\0A\00"
@.str.4 = [11 x i8] c"datagrids\0A\00"
@.str.5 = [27 x i8] c"BEGIN_DATAGRID_3D_DENSITY\0A\00"
@.str.6 = [10 x i8] c"%d %d %d\0A\00"
@.str.7 = [20 x i8] c"%20.8E%20.8E%20.8E\0A\00"
@.str.8 = [7 x i8] c"%20.8E\00"
@.str.9 = [2 x i8] c"\0A\00"
@.str.10 = [17 x i8] c"END_DATAGRID_3D\0A\00"
@.str.11 = [23 x i8] c"END_BLOCK_DATAGRID_3D\0A\00"
define void @xsfvol(double (...)* %0, double %1, double %2, double %3, double %4, double %5, double %6, i32 %7, i32 %8, i32 %9) {
%11 = alloca double (...)*
%12 = alloca double
%13 = alloca double
%14 = alloca double
%15 = alloca double
%16 = alloca double
%17 = alloca double
%18 = alloca i32
%19 = alloca i32
%20 = alloca i32
%21 = alloca i32
%22 = alloca i32
%23 = alloca i32
%24 = alloca double
%25 = alloca double
%26 = alloca double
store double (...)* %0, double (...)** %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 i32 %7, i32* %18
store i32 %8, i32* %19
store i32 %9, i32* %20
%27 = load i32, i32* %18
%28 = icmp slt i32 %27, 2
br i1 %28, label %35, label %29
29: ; preds = %10
%30 = load i32, i32* %19
%31 = icmp slt i32 %30, 2
br i1 %31, label %35, label %32
32: ; preds = %29
%33 = load i32, i32* %20
%34 = icmp slt i32 %33, 2
br i1 %34, label %35, label %38
35: ; preds = %32, %29, %10
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%37 = call i32 @exit(i32 -1)
unreachable
38: ; preds = %32
%39 = load double, double* %13
%40 = load double, double* %12
%41 = fsub double %39, %40
%42 = load i32, i32* %18
%43 = sitofp i32 %42 to double
%44 = fsub double %43, 1.000000e+00
%45 = fdiv double %41, %44
store double %45, double* %24
%46 = load double, double* %15
%47 = load double, double* %14
%48 = fsub double %46, %47
%49 = load i32, i32* %19
%50 = sitofp i32 %49 to double
%51 = fsub double %50, 1.000000e+00
%52 = fdiv double %48, %51
store double %52, double* %25
%53 = load double, double* %17
%54 = load double, double* %16
%55 = fsub double %53, %54
%56 = load i32, i32* %20
%57 = sitofp i32 %56 to double
%58 = fsub double %57, 1.000000e+00
%59 = fdiv double %55, %58
store double %59, double* %26
%60 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%61 = load double, double* %13
%62 = load double, double* %12
%63 = fadd double %61, %62
%64 = fdiv double %63, 2.000000e+00
%65 = load double, double* %15
%66 = load double, double* %14
%67 = fadd double %65, %66
%68 = fdiv double %67, 2.000000e+00
%69 = load double, double* %17
%70 = load double, double* %16
%71 = fadd double %69, %70
%72 = fdiv double %71, 2.000000e+00
%73 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), double %64, double %68, double %72)
%74 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0))
%75 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0))
%76 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.5, i64 0, i64 0))
%77 = load i32, i32* %18
%78 = load i32, i32* %19
%79 = load i32, i32* %20
%80 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0), i32 %77, i32 %78, i32 %79)
%81 = load double, double* %12
%82 = load double, double* %14
%83 = load double, double* %16
%84 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.7, i64 0, i64 0), double %81, double %82, double %83)
%85 = load double, double* %13
%86 = load double, double* %12
%87 = fsub double %85, %86
%88 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.7, i64 0, i64 0), double %87, double 0.000000e+00, double 0.000000e+00)
%89 = load double, double* %15
%90 = load double, double* %14
%91 = fsub double %89, %90
%92 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.7, i64 0, i64 0), double 0.000000e+00, double %91, double 0.000000e+00)
%93 = load double, double* %17
%94 = load double, double* %16
%95 = fsub double %93, %94
%96 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.7, i64 0, i64 0), double 0.000000e+00, double 0.000000e+00, double %95)
store i32 0, i32* %23
br label %97
97: ; preds = %140, %38
%98 = load i32, i32* %23
%99 = load i32, i32* %20
%100 = icmp slt i32 %98, %99
br i1 %100, label %101, label %143
101: ; preds = %97
store i32 0, i32* %22
br label %102
102: ; preds = %135, %101
%103 = load i32, i32* %22
%104 = load i32, i32* %19
%105 = icmp slt i32 %103, %104
br i1 %105, label %106, label %138
106: ; preds = %102
store i32 0, i32* %21
br label %107
107: ; preds = %131, %106
%108 = load i32, i32* %21
%109 = load i32, i32* %18
%110 = icmp slt i32 %108, %109
br i1 %110, label %111, label %134
111: ; preds = %107
%112 = load double (...)*, double (...)** %11
%113 = load double, double* %12
%114 = load double, double* %24
%115 = load i32, i32* %21
%116 = sitofp i32 %115 to double
%117 = call double @llvm.fmuladd.f64(double %114, double %116, double %113)
%118 = load double, double* %14
%119 = load double, double* %25
%120 = load i32, i32* %22
%121 = sitofp i32 %120 to double
%122 = call double @llvm.fmuladd.f64(double %119, double %121, double %118)
%123 = load double, double* %16
%124 = load double, double* %26
%125 = load i32, i32* %23
%126 = sitofp i32 %125 to double
%127 = call double @llvm.fmuladd.f64(double %124, double %126, double %123)
%128 = bitcast double (...)* %112 to double (double, double, double, ...)*
%129 = call double (double, double, double, ...) %128(double %117, double %122, double %127)
%130 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i64 0, i64 0), double %129)
br label %131
131: ; preds = %111
%132 = load i32, i32* %21
%133 = add nsw i32 %132, 1
store i32 %133, i32* %21
br label %107
134: ; preds = %107
br label %135
135: ; preds = %134
%136 = load i32, i32* %22
%137 = add nsw i32 %136, 1
store i32 %137, i32* %22
br label %102
138: ; preds = %102
%139 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0))
br label %140
140: ; preds = %138
%141 = load i32, i32* %23
%142 = add nsw i32 %141, 1
store i32 %142, i32* %23
br label %97
143: ; preds = %97
%144 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.10, i64 0, i64 0))
%145 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.11, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str.2 = [24 x i8] c"0 %20.8E %20.8E %20.8E\0A\00"
@.str.6 = [10 x i8] c"%d %d %d\0A\00"
@.str.7 = [20 x i8] c"%20.8E%20.8E%20.8E\0A\00"
@.str.8 = [7 x i8] c"%20.8E\00"
@str = [6 x i8] c"ATOMS\00"
@str.12 = [24 x i8] c"BEGIN_BLOCK_DATAGRID_3D\00"
@str.13 = [10 x i8] c"datagrids\00"
@str.14 = [26 x i8] c"BEGIN_DATAGRID_3D_DENSITY\00"
@str.15 = [16 x i8] c"END_DATAGRID_3D\00"
@str.16 = [22 x i8] c"END_BLOCK_DATAGRID_3D\00"
@str.17 = [29 x i8] c"Invalid range of grid points\00"
define void @xsfvol(double (...)* nocapture %0, double %1, double %2, double %3, double %4, double %5, double %6, i32 %7, i32 %8, i32 %9) {
%11 = icmp slt i32 %7, 2
%12 = icmp slt i32 %8, 2
%13 = or i1 %11, %12
%14 = icmp slt i32 %9, 2
%15 = or i1 %13, %14
br i1 %15, label %16, label %19
16: ; preds = %10
%17 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str.17, i64 0, i64 0))
%18 = tail call i32 @exit(i32 -1)
unreachable
19: ; preds = %10
%20 = fsub double %2, %1
%21 = sitofp i32 %7 to double
%22 = fadd double %21, -1.000000e+00
%23 = fdiv double %20, %22
%24 = fsub double %4, %3
%25 = sitofp i32 %8 to double
%26 = fadd double %25, -1.000000e+00
%27 = fdiv double %24, %26
%28 = fsub double %6, %5
%29 = sitofp i32 %9 to double
%30 = fadd double %29, -1.000000e+00
%31 = fdiv double %28, %30
%32 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
%33 = fadd double %1, %2
%34 = fmul double %33, 5.000000e-01
%35 = fadd double %3, %4
%36 = fmul double %35, 5.000000e-01
%37 = fadd double %5, %6
%38 = fmul double %37, 5.000000e-01
%39 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), double %34, double %36, double %38)
%40 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str.12, i64 0, i64 0))
%41 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str.13, i64 0, i64 0))
%42 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str.14, i64 0, i64 0))
%43 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0), i32 %7, i32 %8, i32 %9)
%44 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.7, i64 0, i64 0), double %1, double %3, double %5)
%45 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.7, i64 0, i64 0), double %20, double 0.000000e+00, double 0.000000e+00)
%46 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.7, i64 0, i64 0), double 0.000000e+00, double %24, double 0.000000e+00)
%47 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.7, i64 0, i64 0), double 0.000000e+00, double 0.000000e+00, double %28)
%48 = bitcast double (...)* %0 to double (double, double, double, ...)*
br label %49
49: ; preds = %19, %68
%50 = phi i32 [ 0, %19 ], [ %70, %68 ]
%51 = sitofp i32 %50 to double
%52 = tail call double @llvm.fmuladd.f64(double %31, double %51, double %5)
br label %53
53: ; preds = %49, %65
%54 = phi i32 [ 0, %49 ], [ %66, %65 ]
%55 = sitofp i32 %54 to double
%56 = tail call double @llvm.fmuladd.f64(double %27, double %55, double %3)
br label %57
57: ; preds = %53, %57
%58 = phi i32 [ 0, %53 ], [ %63, %57 ]
%59 = sitofp i32 %58 to double
%60 = tail call double @llvm.fmuladd.f64(double %23, double %59, double %1)
%61 = tail call double (double, double, double, ...) %48(double %60, double %56, double %52)
%62 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i64 0, i64 0), double %61)
%63 = add nuw nsw i32 %58, 1
%64 = icmp eq i32 %63, %7
br i1 %64, label %65, label %57
65: ; preds = %57
%66 = add nuw nsw i32 %54, 1
%67 = icmp eq i32 %66, %8
br i1 %67, label %68, label %53
68: ; preds = %65
%69 = tail call i32 @putchar(i32 10)
%70 = add nuw nsw i32 %50, 1
%71 = icmp eq i32 %70, %9
br i1 %71, label %72, label %49
72: ; preds = %68
%73 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str.15, i64 0, i64 0))
%74 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str.16, i64 0, i64 0))
ret void
}