#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 *, ...);
int scg_write_front_gmv(int nV, int nF, double *vertex, int *face, char *file) {
  int i;
  FILE *f;
  f = fopen(file, "w");
  fprintf(f, "gmvinput ascii\n\nnodev %5d\n", nV);
  for (i = 0; i < nV; i++) {
    fprintf(f, "  %20.15lf %20.15lf %20.15lf\n", vertex[3 * i + 0],
            vertex[3 * i + 1], vertex[3 * i + 2]);
  }
  fprintf(f, "\ncells %5d\n", 0);
  fprintf(f, "\n\npolygons\n");
  for (i = 0; i < nF; i++) {
    fprintf(f, "%3d 3", 0);
    fprintf(f, " %20.15lf %20.15lf %20.15lf\n", vertex[3 * face[3 * i + 0] + 0],
            vertex[3 * face[3 * i + 1] + 0], vertex[3 * face[3 * i + 2] + 0]);
    fprintf(f, "      %20.15lf %20.15lf %20.15lf\n",
            vertex[3 * face[3 * i + 0] + 1], vertex[3 * face[3 * i + 1] + 1],
            vertex[3 * face[3 * i + 2] + 1]);
    fprintf(f, "      %20.15lf %20.15lf %20.15lf\n",
            vertex[3 * face[3 * i + 0] + 2], vertex[3 * face[3 * i + 1] + 2],
            vertex[3 * face[3 * i + 2] + 2]);
  }
  fprintf(f, "endpoly\n");
  fprintf(f, "\nendgmv");
  fclose(f);
  return 0;
}


x86 assembly (clang, -O0):
<scg_write_front_gmv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
lea    0xeab(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rdi
mov    -0x4(%rbp),%edx
lea    0xe96(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    11df <scg_write_front_gmv+0xaf>
mov    -0x30(%rbp),%rdi
mov    -0x10(%rbp),%rax
imul   $0x3,-0x24(%rbp),%ecx
add    $0x0,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
imul   $0x3,-0x24(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x10(%rbp),%rax
imul   $0x3,-0x24(%rbp),%ecx
add    $0x2,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm2
lea    0xe75(%rip),%rsi
mov    $0x3,%al
call   1040 <fprintf@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    117a <scg_write_front_gmv+0x4a>
mov    -0x30(%rbp),%rdi
lea    0xe33(%rip),%rsi
xor    %edx,%edx
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x30(%rbp),%rdi
lea    0xe2b(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1399 <scg_write_front_gmv+0x269>
mov    -0x30(%rbp),%rdi
lea    0xe12(%rip),%rsi
xor    %edx,%edx
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x30(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
imul   $0x3,-0x24(%rbp),%edx
add    $0x0,%edx
movslq %edx,%rdx
imul   $0x3,(%rcx,%rdx,4),%ecx
add    $0x0,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
imul   $0x3,-0x24(%rbp),%edx
add    $0x1,%edx
movslq %edx,%rdx
imul   $0x3,(%rcx,%rdx,4),%ecx
add    $0x0,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
imul   $0x3,-0x24(%rbp),%edx
add    $0x2,%edx
movslq %edx,%rdx
imul   $0x3,(%rcx,%rdx,4),%ecx
add    $0x0,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm2
lea    0xda6(%rip),%rsi
mov    $0x3,%al
call   1040 <fprintf@plt>
mov    -0x30(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
imul   $0x3,-0x24(%rbp),%edx
add    $0x0,%edx
movslq %edx,%rdx
imul   $0x3,(%rcx,%rdx,4),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
imul   $0x3,-0x24(%rbp),%edx
add    $0x1,%edx
movslq %edx,%rdx
imul   $0x3,(%rcx,%rdx,4),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
imul   $0x3,-0x24(%rbp),%edx
add    $0x2,%edx
movslq %edx,%rdx
imul   $0x3,(%rcx,%rdx,4),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm2
lea    0xd2c(%rip),%rsi
mov    $0x3,%al
call   1040 <fprintf@plt>
mov    -0x30(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
imul   $0x3,-0x24(%rbp),%edx
add    $0x0,%edx
movslq %edx,%rdx
imul   $0x3,(%rcx,%rdx,4),%ecx
add    $0x2,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
imul   $0x3,-0x24(%rbp),%edx
add    $0x1,%edx
movslq %edx,%rdx
imul   $0x3,(%rcx,%rdx,4),%ecx
add    $0x2,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
imul   $0x3,-0x24(%rbp),%edx
add    $0x2,%edx
movslq %edx,%rdx
imul   $0x3,(%rcx,%rdx,4),%ecx
add    $0x2,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm2
lea    0xcb7(%rip),%rsi
mov    $0x3,%al
call   1040 <fprintf@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    120c <scg_write_front_gmv+0xdc>
mov    -0x30(%rbp),%rdi
lea    0xcb9(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x30(%rbp),%rdi
lea    0xcb0(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x30(%rbp),%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<scg_write_front_gmv>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rcx,%r15
mov    %rdx,%rbx
mov    %esi,0x8(%rsp)
mov    %edi,%ebp
lea    0xe9f(%rip),%rsi
mov    %r8,%rdi
call   1050 <fopen@plt>
mov    %rax,%r12
lea    0xe8f(%rip),%rsi
mov    %rax,%rdi
mov    %ebp,%edx
xor    %eax,%eax
call   1040 <fprintf@plt>
test   %ebp,%ebp
jle    11c7 <scg_write_front_gmv+0x87>
mov    %ebp,%eax
shl    $0x3,%rax
lea    (%rax,%rax,2),%r13
xor    %ebp,%ebp
lea    0xea9(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
movsd  (%rbx,%rbp,1),%xmm0
movsd  0x8(%rbx,%rbp,1),%xmm1
movsd  0x10(%rbx,%rbp,1),%xmm2
mov    %r12,%rdi
mov    %r14,%rsi
mov    $0x3,%al
call   1040 <fprintf@plt>
add    $0x18,%rbp
cmp    %rbp,%r13
jne    11a0 <scg_write_front_gmv+0x60>
lea    0xe4f(%rip),%rsi
mov    %r12,%rdi
xor    %edx,%edx
xor    %eax,%eax
call   1040 <fprintf@plt>
lea    0xe48(%rip),%rdi
mov    $0xb,%esi
mov    $0x1,%edx
mov    %r12,%rcx
call   1060 <fwrite@plt>
mov    0x8(%rsp),%eax
test   %eax,%eax
jle    1304 <scg_write_front_gmv+0x1c4>
mov    %eax,%eax
lea    (%rax,%rax,2),%rax
mov    %rax,0x8(%rsp)
xor    %r13d,%r13d
mov    %r12,0x10(%rsp)
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r12,%rdi
lea    0xe0b(%rip),%rsi
xor    %edx,%edx
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    %r13d,%r12d
movslq (%r15,%r12,4),%rax
lea    (%rax,%rax,2),%rax
movsd  (%rbx,%rax,8),%xmm0
lea    0x1(%r13),%ebp
movslq (%r15,%rbp,4),%rax
lea    (%rax,%rax,2),%rax
movsd  (%rbx,%rax,8),%xmm1
lea    0x2(%r13),%r14d
movslq (%r15,%r14,4),%rax
lea    (%rax,%rax,2),%rax
movsd  (%rbx,%rax,8),%xmm2
mov    0x10(%rsp),%rdi
lea    0xdcf(%rip),%rsi
mov    $0x3,%al
call   1040 <fprintf@plt>
movslq (%r15,%r12,4),%rax
lea    (%rax,%rax,2),%rax
movsd  0x8(%rbx,%rax,8),%xmm0
movslq (%r15,%rbp,4),%rax
lea    (%rax,%rax,2),%rax
movsd  0x8(%rbx,%rax,8),%xmm1
movslq (%r15,%r14,4),%rax
lea    (%rax,%rax,2),%rax
movsd  0x8(%rbx,%rax,8),%xmm2
mov    0x10(%rsp),%rdi
lea    0xd8d(%rip),%rsi
mov    $0x3,%al
call   1040 <fprintf@plt>
movslq (%r15,%r12,4),%rax
lea    (%rax,%rax,2),%rax
movsd  0x10(%rbx,%rax,8),%xmm0
movslq (%r15,%rbp,4),%rax
lea    (%rax,%rax,2),%rax
movsd  0x10(%rbx,%rax,8),%xmm1
movslq (%r15,%r14,4),%rax
mov    0x10(%rsp),%r12
lea    (%rax,%rax,2),%rax
movsd  0x10(%rbx,%rax,8),%xmm2
mov    %r12,%rdi
lea    0xd4d(%rip),%rsi
mov    $0x3,%al
call   1040 <fprintf@plt>
add    $0x3,%r13
cmp    %r13,0x8(%rsp)
jne    1220 <scg_write_front_gmv+0xe0>
lea    0xd52(%rip),%rdi
mov    $0x8,%esi
mov    $0x1,%edx
mov    %r12,%rcx
call   1060 <fwrite@plt>
lea    0xd42(%rip),%rdi
mov    $0x7,%esi
mov    $0x1,%edx
mov    %r12,%rcx
call   1060 <fwrite@plt>
mov    %r12,%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [2 x i8] c"w\00"
@.str.1 = [27 x i8] c"gmvinput ascii\0A\0Anodev %5d\0A\00"
@.str.2 = [30 x i8] c" %20.15lf %20.15lf %20.15lf\0A\00"
@.str.3 = [12 x i8] c"\0Acells %5d\0A\00"
@.str.4 = [12 x i8] c"\0A\0Apolygons\0A\00"
@.str.5 = [6 x i8] c"%3d 3\00"
@.str.6 = [29 x i8] c" %20.15lf %20.15lf %20.15lf\0A\00"
@.str.7 = [34 x i8] c" %20.15lf %20.15lf %20.15lf\0A\00"
@.str.8 = [9 x i8] c"endpoly\0A\00"
@.str.9 = [8 x i8] c"\0Aendgmv\00"
define i32 @scg_write_front_gmv(i32 %0, i32 %1, double* %2, i32* %3, i8* %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca double*
%9 = alloca i32*
%10 = alloca i8*
%11 = alloca i32
%12 = alloca i32*
store i32 %0, i32* %6
store i32 %1, i32* %7
store double* %2, double** %8
store i32* %3, i32** %9
store i8* %4, i8** %10
%13 = load i8*, i8** %10
%14 = call i32* @fopen(i8* %13, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %14, i32** %12
%15 = load i32*, i32** %12
%16 = load i32, i32* %6
%17 = call i32 (i32*, i8*, ...) @fprintf(i32* %15, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i32 %16)
store i32 0, i32* %11
br label %18
18: ; preds = %46, %5
%19 = load i32, i32* %11
%20 = load i32, i32* %6
%21 = icmp slt i32 %19, %20
br i1 %21, label %22, label %49
22: ; preds = %18
%23 = load i32*, i32** %12
%24 = load double*, double** %8
%25 = load i32, i32* %11
%26 = mul nsw i32 3, %25
%27 = add nsw i32 %26, 0
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds double, double* %24, i64 %28
%30 = load double, double* %29
%31 = load double*, double** %8
%32 = load i32, i32* %11
%33 = mul nsw i32 3, %32
%34 = add nsw i32 %33, 1
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds double, double* %31, i64 %35
%37 = load double, double* %36
%38 = load double*, double** %8
%39 = load i32, i32* %11
%40 = mul nsw i32 3, %39
%41 = add nsw i32 %40, 2
%42 = sext i32 %41 to i64
%43 = getelementptr inbounds double, double* %38, i64 %42
%44 = load double, double* %43
%45 = call i32 (i32*, i8*, ...) @fprintf(i32* %23, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0), double %30, double %37, double %44)
br label %46
46: ; preds = %22
%47 = load i32, i32* %11
%48 = add nsw i32 %47, 1
store i32 %48, i32* %11
br label %18
49: ; preds = %18
%50 = load i32*, i32** %12
%51 = call i32 (i32*, i8*, ...) @fprintf(i32* %50, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), i32 0)
%52 = load i32*, i32** %12
%53 = call i32 (i32*, i8*, ...) @fprintf(i32* %52, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0))
store i32 0, i32* %11
br label %54
54: ; preds = %184, %49
%55 = load i32, i32* %11
%56 = load i32, i32* %7
%57 = icmp slt i32 %55, %56
br i1 %57, label %58, label %187
58: ; preds = %54
%59 = load i32*, i32** %12
%60 = call i32 (i32*, i8*, ...) @fprintf(i32* %59, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), i32 0)
%61 = load i32*, i32** %12
%62 = load double*, double** %8
%63 = load i32*, i32** %9
%64 = load i32, i32* %11
%65 = mul nsw i32 3, %64
%66 = add nsw i32 %65, 0
%67 = sext i32 %66 to i64
%68 = getelementptr inbounds i32, i32* %63, i64 %67
%69 = load i32, i32* %68
%70 = mul nsw i32 3, %69
%71 = add nsw i32 %70, 0
%72 = sext i32 %71 to i64
%73 = getelementptr inbounds double, double* %62, i64 %72
%74 = load double, double* %73
%75 = load double*, double** %8
%76 = load i32*, i32** %9
%77 = load i32, i32* %11
%78 = mul nsw i32 3, %77
%79 = add nsw i32 %78, 1
%80 = sext i32 %79 to i64
%81 = getelementptr inbounds i32, i32* %76, i64 %80
%82 = load i32, i32* %81
%83 = mul nsw i32 3, %82
%84 = add nsw i32 %83, 0
%85 = sext i32 %84 to i64
%86 = getelementptr inbounds double, double* %75, i64 %85
%87 = load double, double* %86
%88 = load double*, double** %8
%89 = load i32*, i32** %9
%90 = load i32, i32* %11
%91 = mul nsw i32 3, %90
%92 = add nsw i32 %91, 2
%93 = sext i32 %92 to i64
%94 = getelementptr inbounds i32, i32* %89, i64 %93
%95 = load i32, i32* %94
%96 = mul nsw i32 3, %95
%97 = add nsw i32 %96, 0
%98 = sext i32 %97 to i64
%99 = getelementptr inbounds double, double* %88, i64 %98
%100 = load double, double* %99
%101 = call i32 (i32*, i8*, ...) @fprintf(i32* %61, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.6, i64 0, i64 0), double %74, double %87, double %100)
%102 = load i32*, i32** %12
%103 = load double*, double** %8
%104 = load i32*, i32** %9
%105 = load i32, i32* %11
%106 = mul nsw i32 3, %105
%107 = add nsw i32 %106, 0
%108 = sext i32 %107 to i64
%109 = getelementptr inbounds i32, i32* %104, i64 %108
%110 = load i32, i32* %109
%111 = mul nsw i32 3, %110
%112 = add nsw i32 %111, 1
%113 = sext i32 %112 to i64
%114 = getelementptr inbounds double, double* %103, i64 %113
%115 = load double, double* %114
%116 = load double*, double** %8
%117 = load i32*, i32** %9
%118 = load i32, i32* %11
%119 = mul nsw i32 3, %118
%120 = add nsw i32 %119, 1
%121 = sext i32 %120 to i64
%122 = getelementptr inbounds i32, i32* %117, i64 %121
%123 = load i32, i32* %122
%124 = mul nsw i32 3, %123
%125 = add nsw i32 %124, 1
%126 = sext i32 %125 to i64
%127 = getelementptr inbounds double, double* %116, i64 %126
%128 = load double, double* %127
%129 = load double*, double** %8
%130 = load i32*, i32** %9
%131 = load i32, i32* %11
%132 = mul nsw i32 3, %131
%133 = add nsw i32 %132, 2
%134 = sext i32 %133 to i64
%135 = getelementptr inbounds i32, i32* %130, i64 %134
%136 = load i32, i32* %135
%137 = mul nsw i32 3, %136
%138 = add nsw i32 %137, 1
%139 = sext i32 %138 to i64
%140 = getelementptr inbounds double, double* %129, i64 %139
%141 = load double, double* %140
%142 = call i32 (i32*, i8*, ...) @fprintf(i32* %102, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.7, i64 0, i64 0), double %115, double %128, double %141)
%143 = load i32*, i32** %12
%144 = load double*, double** %8
%145 = load i32*, i32** %9
%146 = load i32, i32* %11
%147 = mul nsw i32 3, %146
%148 = add nsw i32 %147, 0
%149 = sext i32 %148 to i64
%150 = getelementptr inbounds i32, i32* %145, i64 %149
%151 = load i32, i32* %150
%152 = mul nsw i32 3, %151
%153 = add nsw i32 %152, 2
%154 = sext i32 %153 to i64
%155 = getelementptr inbounds double, double* %144, i64 %154
%156 = load double, double* %155
%157 = load double*, double** %8
%158 = load i32*, i32** %9
%159 = load i32, i32* %11
%160 = mul nsw i32 3, %159
%161 = add nsw i32 %160, 1
%162 = sext i32 %161 to i64
%163 = getelementptr inbounds i32, i32* %158, i64 %162
%164 = load i32, i32* %163
%165 = mul nsw i32 3, %164
%166 = add nsw i32 %165, 2
%167 = sext i32 %166 to i64
%168 = getelementptr inbounds double, double* %157, i64 %167
%169 = load double, double* %168
%170 = load double*, double** %8
%171 = load i32*, i32** %9
%172 = load i32, i32* %11
%173 = mul nsw i32 3, %172
%174 = add nsw i32 %173, 2
%175 = sext i32 %174 to i64
%176 = getelementptr inbounds i32, i32* %171, i64 %175
%177 = load i32, i32* %176
%178 = mul nsw i32 3, %177
%179 = add nsw i32 %178, 2
%180 = sext i32 %179 to i64
%181 = getelementptr inbounds double, double* %170, i64 %180
%182 = load double, double* %181
%183 = call i32 (i32*, i8*, ...) @fprintf(i32* %143, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.7, i64 0, i64 0), double %156, double %169, double %182)
br label %184
184: ; preds = %58
%185 = load i32, i32* %11
%186 = add nsw i32 %185, 1
store i32 %186, i32* %11
br label %54
187: ; preds = %54
%188 = load i32*, i32** %12
%189 = call i32 (i32*, i8*, ...) @fprintf(i32* %188, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.8, i64 0, i64 0))
%190 = load i32*, i32** %12
%191 = call i32 (i32*, i8*, ...) @fprintf(i32* %190, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.9, i64 0, i64 0))
%192 = load i32*, i32** %12
%193 = call i32 @fclose(i32* %192)
ret i32 0
}

LLVM IR (-O2):
@.str = [2 x i8] c"w\00"
@.str.1 = [27 x i8] c"gmvinput ascii\0A\0Anodev %5d\0A\00"
@.str.2 = [30 x i8] c" %20.15lf %20.15lf %20.15lf\0A\00"
@.str.3 = [12 x i8] c"\0Acells %5d\0A\00"
@.str.4 = [12 x i8] c"\0A\0Apolygons\0A\00"
@.str.5 = [6 x i8] c"%3d 3\00"
@.str.6 = [29 x i8] c" %20.15lf %20.15lf %20.15lf\0A\00"
@.str.7 = [34 x i8] c" %20.15lf %20.15lf %20.15lf\0A\00"
@.str.8 = [9 x i8] c"endpoly\0A\00"
@.str.9 = [8 x i8] c"\0Aendgmv\00"
define i32 @scg_write_front_gmv(i32 %0, i32 %1, double* nocapture %2, i32* nocapture %3, i8* nocapture %4) {
%6 = tail call i32* @fopen(i8* %4, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %6, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i32 %0)
%8 = icmp sgt i32 %0, 0
br i1 %8, label %9, label %25
9: ; preds = %5
%10 = zext i32 %0 to i64
br label %11
11: ; preds = %9, %11
%12 = phi i64 [ 0, %9 ], [ %23, %11 ]
%13 = mul nuw nsw i64 %12, 3
%14 = getelementptr inbounds double, double* %2, i64 %13
%15 = load double, double* %14
%16 = add nuw nsw i64 %13, 1
%17 = getelementptr inbounds double, double* %2, i64 %16
%18 = load double, double* %17
%19 = add nuw nsw i64 %13, 2
%20 = getelementptr inbounds double, double* %2, i64 %19
%21 = load double, double* %20
%22 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %6, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0), double %15, double %18, double %21)
%23 = add nuw nsw i64 %12, 1
%24 = icmp eq i64 %23, %10
br i1 %24, label %25, label %11
25: ; preds = %11, %5
%26 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %6, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), i32 0)
%27 = tail call i64 @fwrite(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0), i64 11, i64 1, i32* %6)
%28 = icmp sgt i32 %1, 0
br i1 %28, label %29, label %100
29: ; preds = %25
%30 = zext i32 %1 to i64
br label %31
31: ; preds = %29, %31
%32 = phi i64 [ 0, %29 ], [ %98, %31 ]
%33 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %6, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), i32 0)
%34 = trunc i64 %32 to i32
%35 = mul nsw i32 %34, 3
%36 = zext i32 %35 to i64
%37 = getelementptr inbounds i32, i32* %3, i64 %36
%38 = load i32, i32* %37
%39 = mul nsw i32 %38, 3
%40 = sext i32 %39 to i64
%41 = getelementptr inbounds double, double* %2, i64 %40
%42 = load double, double* %41
%43 = add nuw nsw i32 %35, 1
%44 = zext i32 %43 to i64
%45 = getelementptr inbounds i32, i32* %3, i64 %44
%46 = load i32, i32* %45
%47 = mul nsw i32 %46, 3
%48 = sext i32 %47 to i64
%49 = getelementptr inbounds double, double* %2, i64 %48
%50 = load double, double* %49
%51 = add nuw nsw i32 %35, 2
%52 = zext i32 %51 to i64
%53 = getelementptr inbounds i32, i32* %3, i64 %52
%54 = load i32, i32* %53
%55 = mul nsw i32 %54, 3
%56 = sext i32 %55 to i64
%57 = getelementptr inbounds double, double* %2, i64 %56
%58 = load double, double* %57
%59 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %6, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.6, i64 0, i64 0), double %42, double %50, double %58)
%60 = load i32, i32* %37
%61 = mul nsw i32 %60, 3
%62 = add nsw i32 %61, 1
%63 = sext i32 %62 to i64
%64 = getelementptr inbounds double, double* %2, i64 %63
%65 = load double, double* %64
%66 = load i32, i32* %45
%67 = mul nsw i32 %66, 3
%68 = add nsw i32 %67, 1
%69 = sext i32 %68 to i64
%70 = getelementptr inbounds double, double* %2, i64 %69
%71 = load double, double* %70
%72 = load i32, i32* %53
%73 = mul nsw i32 %72, 3
%74 = add nsw i32 %73, 1
%75 = sext i32 %74 to i64
%76 = getelementptr inbounds double, double* %2, i64 %75
%77 = load double, double* %76
%78 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %6, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.7, i64 0, i64 0), double %65, double %71, double %77)
%79 = load i32, i32* %37
%80 = mul nsw i32 %79, 3
%81 = add nsw i32 %80, 2
%82 = sext i32 %81 to i64
%83 = getelementptr inbounds double, double* %2, i64 %82
%84 = load double, double* %83
%85 = load i32, i32* %45
%86 = mul nsw i32 %85, 3
%87 = add nsw i32 %86, 2
%88 = sext i32 %87 to i64
%89 = getelementptr inbounds double, double* %2, i64 %88
%90 = load double, double* %89
%91 = load i32, i32* %53
%92 = mul nsw i32 %91, 3
%93 = add nsw i32 %92, 2
%94 = sext i32 %93 to i64
%95 = getelementptr inbounds double, double* %2, i64 %94
%96 = load double, double* %95
%97 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %6, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.7, i64 0, i64 0), double %84, double %90, double %96)
%98 = add nuw nsw i64 %32, 1
%99 = icmp eq i64 %98, %30
br i1 %99, label %100, label %31
100: ; preds = %31, %25
%101 = tail call i64 @fwrite(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.8, i64 0, i64 0), i64 8, i64 1, i32* %6)
%102 = tail call i64 @fwrite(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.9, i64 0, i64 0), i64 7, i64 1, i32* %6)
%103 = tail call i32 @fclose(i32* %6)
ret i32 0
}