#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*/ time_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
char *ctime(int /*<<< orphan*/ *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
int /*<<< orphan*/ fwrite(char const *, int, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, float, float, float, float, float, float);
int /*<<< orphan*/ time(int /*<<< orphan*/);
int write_AVS_header(FILE *fp, int dim, float xmin, float ymin, float zmin,
                     float xmax, float ymax, float zmax, char gridtype) {
  const char FORM_FEEDS[2] = {12, 12};
  float center_x, center_y, center_z, spacing;
  time_t tclock = time(0);
  if (fp == NULL)
    return 0;
  printf("writing an AVS header, min (%f, %f, %f): max (%f, %f, %f)\n", xmin,
         ymin, zmin, xmax, ymax, zmax);
  center_x = (xmin + xmax) / 2.;
  center_y = (ymin + ymax) / 2.;
  center_z = (zmin + zmax) / 2.;
  spacing = (xmax - xmin) / (float)(dim - 1);
  fprintf(fp, "# AVS field file -- generated by GEM\n");
  fprintf(fp, "# creation date: %s", ctime(&tclock));
  fprintf(fp,
          "# Scalar field for cubic lattice: ON_GEOM_CENT resolved to (%f %f "
          "%f) %i %f \n",
          center_x, center_y, center_z, dim, spacing);
  fprintf(fp, "ndim=3         # number of dimensions in the field \n");
  fprintf(fp, "dim1=%i # dimension of axis 1\n", dim);
  fprintf(fp, "dim2=%i # dimension of axis 2\n", dim);
  fprintf(fp, "dim3=%i # dimension of axis 3\n", dim);
  fprintf(fp, "nspace=3       # number of physical coordinates per point \n");
  fprintf(fp, "veclen=1       # number of data components per point \n");
  fprintf(fp, "data=%s    # data type (byte, integer, float, double) \n",
          ((gridtype == 'f') ? "float" : "double"));
  fprintf(fp, "min_ext=%f %f %f\n", xmin, ymin, zmin);
  fprintf(fp, "max_ext=%f %f %f\n", xmax, ymax, zmax);
  fprintf(fp,
          "field=uniform  # field type (uniform, rectilinear, irregular)\n");
  fwrite(FORM_FEEDS, sizeof(char), 2, fp);
  return 1;
}


x86 assembly (clang, -O0):
<write_AVS_header>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %dl,%al
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
movss  %xmm0,-0x18(%rbp)
movss  %xmm1,-0x1c(%rbp)
movss  %xmm2,-0x20(%rbp)
movss  %xmm3,-0x24(%rbp)
movss  %xmm4,-0x28(%rbp)
movss  %xmm5,-0x2c(%rbp)
mov    %al,-0x2d(%rbp)
mov    0xe7f(%rip),%ax
mov    %ax,-0x2f(%rbp)
xor    %edi,%edi
call   1060 <time@plt>
mov    %eax,-0x44(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    11ae <write_AVS_header+0x5e>
movl   $0x0,-0x4(%rbp)
jmp    13f9 <write_AVS_header+0x2a9>
movss  -0x18(%rbp),%xmm0
movss  -0x1c(%rbp),%xmm1
movss  -0x20(%rbp),%xmm2
movss  -0x24(%rbp),%xmm3
movss  -0x28(%rbp),%xmm4
movss  -0x2c(%rbp),%xmm5
lea    0xe37(%rip),%rdi
call   1040 <printf@plt>
movss  -0x18(%rbp),%xmm0
addss  -0x24(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe12(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x34(%rbp)
movss  -0x1c(%rbp),%xmm0
addss  -0x28(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xdef(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x38(%rbp)
movss  -0x20(%rbp),%xmm0
addss  -0x2c(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xdcc(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x3c(%rbp)
movss  -0x24(%rbp),%xmm0
subss  -0x18(%rbp),%xmm0
mov    -0x14(%rbp),%eax
sub    $0x1,%eax
cvtsi2ss %eax,%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x40(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xddc(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x10(%rbp),%rax
mov    %rax,-0x50(%rbp)
lea    -0x44(%rbp),%rdi
call   1030 <ctime@plt>
mov    -0x50(%rbp),%rdi
mov    %rax,%rdx
lea    0xddc(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x10(%rbp),%rdi
movss  -0x34(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x38(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
movss  -0x3c(%rbp),%xmm2
cvtss2sd %xmm2,%xmm2
mov    -0x14(%rbp),%edx
movss  -0x40(%rbp),%xmm3
cvtss2sd %xmm3,%xmm3
lea    0xdb7(%rip),%rsi
mov    $0x4,%al
call   1050 <fprintf@plt>
mov    -0x10(%rbp),%rdi
lea    0xdf3(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%edx
lea    0xe13(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%edx
lea    0xe1d(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%edx
lea    0xe27(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x10(%rbp),%rdi
lea    0xe34(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x10(%rbp),%rdi
lea    0xe5e(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x10(%rbp),%rdi
movsbl -0x2d(%rbp),%ecx
lea    0xebd(%rip),%rdx
lea    0xeb0(%rip),%rax
cmp    $0x66,%ecx
cmove  %rax,%rdx
lea    0xe6a(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x10(%rbp),%rdi
movss  -0x18(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x1c(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
movss  -0x20(%rbp),%xmm2
cvtss2sd %xmm2,%xmm2
lea    0xe82(%rip),%rsi
mov    $0x3,%al
call   1050 <fprintf@plt>
mov    -0x10(%rbp),%rdi
movss  -0x24(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x28(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
movss  -0x2c(%rbp),%xmm2
cvtss2sd %xmm2,%xmm2
lea    0xe67(%rip),%rsi
mov    $0x3,%al
call   1050 <fprintf@plt>
mov    -0x10(%rbp),%rdi
lea    0xe67(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
lea    -0x2f(%rbp),%rdi
mov    -0x10(%rbp),%rcx
mov    $0x1,%esi
mov    $0x2,%edx
call   1070 <fwrite@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_AVS_header>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x38,%rsp
mov    %edx,%r14d
movss  %xmm5,0x1c(%rsp)
movss  %xmm4,0x18(%rsp)
movss  %xmm3,0x14(%rsp)
movss  %xmm2,0x10(%rsp)
movss  %xmm1,0xc(%rsp)
movss  %xmm0,0x8(%rsp)
mov    %esi,%r15d
mov    %rdi,%rbx
movw   $0xc0c,0x22(%rsp)
xor    %ebp,%ebp
xor    %edi,%edi
call   1060 <time@plt>
mov    %eax,0x34(%rsp)
test   %rbx,%rbx
je     13f2 <write_AVS_header+0x2a2>
lea    0xe59(%rip),%rdi
movss  0x8(%rsp),%xmm0
movss  0xc(%rsp),%xmm1
movss  0x10(%rsp),%xmm2
movss  0x14(%rsp),%xmm3
movss  0x18(%rsp),%xmm4
movss  0x1c(%rsp),%xmm5
call   1040 <printf@plt>
movss  0x8(%rsp),%xmm2
movaps %xmm2,%xmm3
movss  0x14(%rsp),%xmm1
addss  %xmm1,%xmm3
movss  0xe11(%rip),%xmm0
mulss  %xmm0,%xmm3
movss  %xmm3,0x30(%rsp)
movss  0xc(%rsp),%xmm3
addss  0x18(%rsp),%xmm3
mulss  %xmm0,%xmm3
movss  %xmm3,0x2c(%rsp)
movss  0x10(%rsp),%xmm3
addss  0x1c(%rsp),%xmm3
mulss  %xmm0,%xmm3
movss  %xmm3,0x28(%rsp)
subss  %xmm2,%xmm1
lea    -0x1(%r15),%eax
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
divss  %xmm0,%xmm1
movss  %xmm1,0x24(%rsp)
lea    0xdfa(%rip),%rdi
mov    $0x25,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1070 <fwrite@plt>
lea    0x34(%rsp),%rdi
call   1030 <ctime@plt>
lea    0xdfd(%rip),%rsi
mov    %rbx,%rdi
mov    %rax,%rdx
xor    %eax,%eax
call   1050 <fprintf@plt>
movss  0x30(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  0x2c(%rsp),%xmm1
cvtss2sd %xmm1,%xmm1
movss  0x28(%rsp),%xmm2
cvtss2sd %xmm2,%xmm2
movss  0x24(%rsp),%xmm3
cvtss2sd %xmm3,%xmm3
lea    0xdd5(%rip),%rsi
mov    %rbx,%rdi
mov    %r15d,%edx
mov    $0x4,%al
call   1050 <fprintf@plt>
lea    0xe0f(%rip),%rdi
mov    $0x34,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1070 <fwrite@plt>
lea    0xe2b(%rip),%rsi
mov    %rbx,%rdi
mov    %r15d,%edx
xor    %eax,%eax
call   1050 <fprintf@plt>
lea    0xe36(%rip),%rsi
mov    %rbx,%rdi
mov    %r15d,%edx
xor    %eax,%eax
call   1050 <fprintf@plt>
lea    0xe41(%rip),%rsi
mov    %rbx,%rdi
mov    %r15d,%edx
xor    %eax,%eax
call   1050 <fprintf@plt>
lea    0xe4c(%rip),%rdi
mov    $0x3b,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1070 <fwrite@plt>
lea    0xe6f(%rip),%rdi
mov    $0x36,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1070 <fwrite@plt>
cmp    $0x66,%r14b
lea    0xec1(%rip),%rax
lea    0xec0(%rip),%rdx
cmove  %rax,%rdx
lea    0xe77(%rip),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <fprintf@plt>
movss  0x8(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  0xc(%rsp),%xmm1
cvtss2sd %xmm1,%xmm1
movss  0x10(%rsp),%xmm2
cvtss2sd %xmm2,%xmm2
lea    0xe8d(%rip),%rsi
mov    %rbx,%rdi
mov    $0x3,%al
call   1050 <fprintf@plt>
movss  0x14(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  0x18(%rsp),%xmm1
cvtss2sd %xmm1,%xmm1
movss  0x1c(%rsp),%xmm2
cvtss2sd %xmm2,%xmm2
lea    0xe70(%rip),%rsi
mov    %rbx,%rdi
mov    $0x3,%al
call   1050 <fprintf@plt>
lea    0xe71(%rip),%rdi
mov    $0x3e,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1070 <fwrite@plt>
lea    0x22(%rsp),%rdi
mov    $0x1,%ebp
mov    $0x1,%esi
mov    $0x2,%edx
mov    %rbx,%rcx
call   1070 <fwrite@plt>
mov    %ebp,%eax
add    $0x38,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@__const.write_AVS_header.FORM_FEEDS = [2 x i8] c"\0C\0C"
@.str = [59 x i8] c"writing an AVS header, min (%f, %f, %f): max (%f, %f, %f)\0A\00"
@.str.1 = [38 x i8] c"# AVS field file -- generated by GEM\0A\00"
@.str.2 = [20 x i8] c"# creation date: %s\00"
@.str.3 = [78 x i8] c"# Scalar field for cubic lattice: ON_GEOM_CENT resolved to (%f %f %f) %i %f \0A\00"
@.str.4 = [53 x i8] c"ndim=3 # number of dimensions in the field \0A\00"
@.str.5 = [31 x i8] c"dim1=%i # dimension of axis 1\0A\00"
@.str.6 = [31 x i8] c"dim2=%i # dimension of axis 2\0A\00"
@.str.7 = [31 x i8] c"dim3=%i # dimension of axis 3\0A\00"
@.str.8 = [60 x i8] c"nspace=3 # number of physical coordinates per point \0A\00"
@.str.9 = [55 x i8] c"veclen=1 # number of data components per point \0A\00"
@.str.10 = [56 x i8] c"data=%s # data type (byte, integer, float, double) \0A\00"
@.str.11 = [6 x i8] c"float\00"
@.str.12 = [7 x i8] c"double\00"
@.str.13 = [18 x i8] c"min_ext=%f %f %f\0A\00"
@.str.14 = [18 x i8] c"max_ext=%f %f %f\0A\00"
@.str.15 = [63 x i8] c"field=uniform # field type (uniform, rectilinear, irregular)\0A\00"
define i32 @write_AVS_header(i32* %0, i32 %1, float %2, float %3, float %4, float %5, float %6, float %7, i8 signext %8) {
%10 = alloca i32
%11 = alloca i32*
%12 = alloca i32
%13 = alloca float
%14 = alloca float
%15 = alloca float
%16 = alloca float
%17 = alloca float
%18 = alloca float
%19 = alloca i8
%20 = alloca [2 x i8]
%21 = alloca float
%22 = alloca float
%23 = alloca float
%24 = alloca float
%25 = alloca i32
store i32* %0, i32** %11
store i32 %1, i32* %12
store float %2, float* %13
store float %3, float* %14
store float %4, float* %15
store float %5, float* %16
store float %6, float* %17
store float %7, float* %18
store i8 %8, i8* %19
%26 = bitcast [2 x i8]* %20 to i8*
%27 = call i32 @time(i32 0)
store i32 %27, i32* %25
%28 = load i32*, i32** %11
%29 = icmp eq i32* %28, null
br i1 %29, label %30, label %31
30: ; preds = %9
store i32 0, i32* %10
br label %123
31: ; preds = %9
%32 = load float, float* %13
%33 = load float, float* %14
%34 = load float, float* %15
%35 = load float, float* %16
%36 = load float, float* %17
%37 = load float, float* %18
%38 = call i32 @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0), float %32, float %33, float %34, float %35, float %36, float %37)
%39 = load float, float* %13
%40 = load float, float* %16
%41 = fadd float %39, %40
%42 = fpext float %41 to double
%43 = fdiv double %42, 2.000000e+00
%44 = fptrunc double %43 to float
store float %44, float* %21
%45 = load float, float* %14
%46 = load float, float* %17
%47 = fadd float %45, %46
%48 = fpext float %47 to double
%49 = fdiv double %48, 2.000000e+00
%50 = fptrunc double %49 to float
store float %50, float* %22
%51 = load float, float* %15
%52 = load float, float* %18
%53 = fadd float %51, %52
%54 = fpext float %53 to double
%55 = fdiv double %54, 2.000000e+00
%56 = fptrunc double %55 to float
store float %56, float* %23
%57 = load float, float* %16
%58 = load float, float* %13
%59 = fsub float %57, %58
%60 = load i32, i32* %12
%61 = sub nsw i32 %60, 1
%62 = sitofp i32 %61 to float
%63 = fdiv float %59, %62
store float %63, float* %24
%64 = load i32*, i32** %11
%65 = call i32 (i32*, i8*, ...) @fprintf(i32* %64, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
%66 = load i32*, i32** %11
%67 = call i8* @ctime(i32* %25)
%68 = call i32 (i32*, i8*, ...) @fprintf(i32* %66, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i8* %67)
%69 = load i32*, i32** %11
%70 = load float, float* %21
%71 = fpext float %70 to double
%72 = load float, float* %22
%73 = fpext float %72 to double
%74 = load float, float* %23
%75 = fpext float %74 to double
%76 = load i32, i32* %12
%77 = load float, float* %24
%78 = fpext float %77 to double
%79 = call i32 (i32*, i8*, ...) @fprintf(i32* %69, i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str.3, i64 0, i64 0), double %71, double %73, double %75, i32 %76, double %78)
%80 = load i32*, i32** %11
%81 = call i32 (i32*, i8*, ...) @fprintf(i32* %80, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.4, i64 0, i64 0))
%82 = load i32*, i32** %11
%83 = load i32, i32* %12
%84 = call i32 (i32*, i8*, ...) @fprintf(i32* %82, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.5, i64 0, i64 0), i32 %83)
%85 = load i32*, i32** %11
%86 = load i32, i32* %12
%87 = call i32 (i32*, i8*, ...) @fprintf(i32* %85, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.6, i64 0, i64 0), i32 %86)
%88 = load i32*, i32** %11
%89 = load i32, i32* %12
%90 = call i32 (i32*, i8*, ...) @fprintf(i32* %88, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.7, i64 0, i64 0), i32 %89)
%91 = load i32*, i32** %11
%92 = call i32 (i32*, i8*, ...) @fprintf(i32* %91, i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.8, i64 0, i64 0))
%93 = load i32*, i32** %11
%94 = call i32 (i32*, i8*, ...) @fprintf(i32* %93, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.9, i64 0, i64 0))
%95 = load i32*, i32** %11
%96 = load i8, i8* %19
%97 = sext i8 %96 to i32
%98 = icmp eq i32 %97, 102
%99 = zext i1 %98 to i64
%100 = select i1 %98, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.11, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.12, i64 0, i64 0)
%101 = call i32 (i32*, i8*, ...) @fprintf(i32* %95, i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.10, i64 0, i64 0), i8* %100)
%102 = load i32*, i32** %11
%103 = load float, float* %13
%104 = fpext float %103 to double
%105 = load float, float* %14
%106 = fpext float %105 to double
%107 = load float, float* %15
%108 = fpext float %107 to double
%109 = call i32 (i32*, i8*, ...) @fprintf(i32* %102, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.13, i64 0, i64 0), double %104, double %106, double %108)
%110 = load i32*, i32** %11
%111 = load float, float* %16
%112 = fpext float %111 to double
%113 = load float, float* %17
%114 = fpext float %113 to double
%115 = load float, float* %18
%116 = fpext float %115 to double
%117 = call i32 (i32*, i8*, ...) @fprintf(i32* %110, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.14, i64 0, i64 0), double %112, double %114, double %116)
%118 = load i32*, i32** %11
%119 = call i32 (i32*, i8*, ...) @fprintf(i32* %118, i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.15, i64 0, i64 0))
%120 = getelementptr inbounds [2 x i8], [2 x i8]* %20, i64 0, i64 0
%121 = load i32*, i32** %11
%122 = call i32 @fwrite(i8* %120, i32 1, i32 2, i32* %121)
store i32 1, i32* %10
br label %123
123: ; preds = %31, %30
%124 = load i32, i32* %10
ret i32 %124
}

LLVM IR (-O2):
@.str = [59 x i8] c"writing an AVS header, min (%f, %f, %f): max (%f, %f, %f)\0A\00"
@.str.1 = [38 x i8] c"# AVS field file -- generated by GEM\0A\00"
@.str.2 = [20 x i8] c"# creation date: %s\00"
@.str.3 = [78 x i8] c"# Scalar field for cubic lattice: ON_GEOM_CENT resolved to (%f %f %f) %i %f \0A\00"
@.str.4 = [53 x i8] c"ndim=3 # number of dimensions in the field \0A\00"
@.str.5 = [31 x i8] c"dim1=%i # dimension of axis 1\0A\00"
@.str.6 = [31 x i8] c"dim2=%i # dimension of axis 2\0A\00"
@.str.7 = [31 x i8] c"dim3=%i # dimension of axis 3\0A\00"
@.str.8 = [60 x i8] c"nspace=3 # number of physical coordinates per point \0A\00"
@.str.9 = [55 x i8] c"veclen=1 # number of data components per point \0A\00"
@.str.10 = [56 x i8] c"data=%s # data type (byte, integer, float, double) \0A\00"
@.str.11 = [6 x i8] c"float\00"
@.str.12 = [7 x i8] c"double\00"
@.str.13 = [18 x i8] c"min_ext=%f %f %f\0A\00"
@.str.14 = [18 x i8] c"max_ext=%f %f %f\0A\00"
@.str.15 = [63 x i8] c"field=uniform # field type (uniform, rectilinear, irregular)\0A\00"
define i32 @write_AVS_header(i32* %0, i32 %1, float %2, float %3, float %4, float %5, float %6, float %7, i8 signext %8) {
%10 = alloca i16
%11 = alloca i32
%12 = bitcast i16* %10 to i8*
store i16 3084, i16* %10
%13 = bitcast i32* %11 to i8*
%14 = tail call i32 @time(i32 0)
store i32 %14, i32* %11
%15 = icmp eq i32* %0, null
br i1 %15, label %55, label %16
16: ; preds = %9
%17 = tail call i32 @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0), float %2, float %3, float %4, float %5, float %6, float %7)
%18 = fadd float %2, %5
%19 = fmul float %18, 5.000000e-01
%20 = fadd float %3, %6
%21 = fmul float %20, 5.000000e-01
%22 = fadd float %4, %7
%23 = fmul float %22, 5.000000e-01
%24 = fsub float %5, %2
%25 = add nsw i32 %1, -1
%26 = sitofp i32 %25 to float
%27 = fdiv float %24, %26
%28 = tail call i64 bitcast (i32 (i8*, i32, i32, i32*)* @fwrite to i64 (i8*, i64, i64, i32*)*)(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0), i64 37, i64 1, i32* %0)
%29 = call i8* @ctime(i32* %11)
%30 = call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i8* %29)
%31 = fpext float %19 to double
%32 = fpext float %21 to double
%33 = fpext float %23 to double
%34 = fpext float %27 to double
%35 = call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str.3, i64 0, i64 0), double %31, double %32, double %33, i32 %1, double %34)
%36 = call i64 bitcast (i32 (i8*, i32, i32, i32*)* @fwrite to i64 (i8*, i64, i64, i32*)*)(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.4, i64 0, i64 0), i64 52, i64 1, i32* %0)
%37 = call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.5, i64 0, i64 0), i32 %1)
%38 = call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.6, i64 0, i64 0), i32 %1)
%39 = call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.7, i64 0, i64 0), i32 %1)
%40 = call i64 bitcast (i32 (i8*, i32, i32, i32*)* @fwrite to i64 (i8*, i64, i64, i32*)*)(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.8, i64 0, i64 0), i64 59, i64 1, i32* %0)
%41 = call i64 bitcast (i32 (i8*, i32, i32, i32*)* @fwrite to i64 (i8*, i64, i64, i32*)*)(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.9, i64 0, i64 0), i64 54, i64 1, i32* %0)
%42 = icmp eq i8 %8, 102
%43 = select i1 %42, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.11, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.12, i64 0, i64 0)
%44 = call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.10, i64 0, i64 0), i8* %43)
%45 = fpext float %2 to double
%46 = fpext float %3 to double
%47 = fpext float %4 to double
%48 = call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.13, i64 0, i64 0), double %45, double %46, double %47)
%49 = fpext float %5 to double
%50 = fpext float %6 to double
%51 = fpext float %7 to double
%52 = call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.14, i64 0, i64 0), double %49, double %50, double %51)
%53 = call i64 bitcast (i32 (i8*, i32, i32, i32*)* @fwrite to i64 (i8*, i64, i64, i32*)*)(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.15, i64 0, i64 0), i64 62, i64 1, i32* %0)
%54 = call i32 @fwrite(i8* %12, i32 1, i32 2, i32* %0)
br label %55
55: ; preds = %9, %16
%56 = phi i32 [ 1, %16 ], [ 0, %9 ]
ret i32 %56
}