#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*/ aft_tetra_qual(double *, int, int, int, int);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
int write_mesh_gmv_qual(char *fn, int nV, double *vertex, int nF, int *face,
                        int *facematerial, int nT, int *tetra,
                        int *tetramaterial) {
  int i, mmax = 0, unkmat = 0;
  FILE *f;
  f = fopen(fn, "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", nT);
  for (i = 0; i < nT; i++) {
    fprintf(f, " tet 4\n  %4d %4d %4d %4d\n", tetra[4 * i + 0],
            tetra[4 * i + 1], tetra[4 * i + 2], tetra[4 * i + 3]);
    if (mmax < tetramaterial[i])
      mmax = tetramaterial[i];
    if (tetramaterial[i] == 0)
      unkmat = 1;
  }
  for (i = 0; i < nF; i++) {
    if (mmax < facematerial[i])
      mmax = facematerial[i];
    if (facematerial[i] == 0)
      unkmat = 1;
  }
  if (nT) {
    fprintf(f, "\nmaterial %d 0\n", mmax + unkmat);
    for (i = 0; i < mmax; i++)
      fprintf(f, "mat%d\n", i + 1);
    if (unkmat)
      fprintf(f, "unknown\n");
    for (i = 0; i < nT; i++) {
      fprintf(f, " %2d", (tetramaterial[i]) ? tetramaterial[i] : mmax + unkmat);
    }
    fprintf(f, "\n\nvariable\nqual 0\n");
    for (i = 0; i < nT; i++) {
      fprintf(f, " %20.15lf",
              aft_tetra_qual(vertex, tetra[4 * i + 0] - 1, tetra[4 * i + 1] - 1,
                             tetra[4 * i + 2] - 1, tetra[4 * i + 3] - 1));
    }
    fprintf(f, "\nendvars\n");
  }
  fprintf(f, "\n\npolygons\n");
  for (i = 0; i < nF; i++) {
    fprintf(f, "%3d 3", (facematerial[i]) ? facematerial[i] : mmax + unkmat);
    fprintf(f, " %20.15lf %20.15lf %20.15lf\n",
            vertex[3 * face[3 * i + 0] + 0 - 3],
            vertex[3 * face[3 * i + 1] + 0 - 3],
            vertex[3 * face[3 * i + 2] + 0 - 3]);
    fprintf(f, "      %20.15lf %20.15lf %20.15lf\n",
            vertex[3 * face[3 * i + 0] + 1 - 3],
            vertex[3 * face[3 * i + 1] + 1 - 3],
            vertex[3 * face[3 * i + 2] + 1 - 3]);
    fprintf(f, "      %20.15lf %20.15lf %20.15lf\n",
            vertex[3 * face[3 * i + 0] + 2 - 3],
            vertex[3 * face[3 * i + 1] + 2 - 3],
            vertex[3 * face[3 * i + 2] + 2 - 3]);
  }
  fprintf(f, "endpoly\n");
  fprintf(f, "\nendgmv");
  fclose(f);
  return 0;
}


x86 assembly (clang, -O0):
<write_mesh_gmv_qual>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    0x20(%rbp),%rax
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%eax
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
movl   $0x0,-0x38(%rbp)
movl   $0x0,-0x3c(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xe7e(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,-0x48(%rbp)
mov    -0x48(%rbp),%rdi
mov    -0xc(%rbp),%edx
lea    0xe69(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    120c <write_mesh_gmv_qual+0xcc>
mov    -0x48(%rbp),%rdi
mov    -0x18(%rbp),%rax
imul   $0x3,-0x34(%rbp),%ecx
add    $0x0,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x18(%rbp),%rax
imul   $0x3,-0x34(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x18(%rbp),%rax
imul   $0x3,-0x34(%rbp),%ecx
add    $0x2,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm2
lea    0xeae(%rip),%rsi
mov    $0x3,%al
call   1040 <fprintf@plt>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    11a7 <write_mesh_gmv_qual+0x67>
mov    -0x48(%rbp),%rdi
mov    0x10(%rbp),%edx
lea    0xe03(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    0x10(%rbp),%eax
jge    12e2 <write_mesh_gmv_qual+0x1a2>
mov    -0x48(%rbp),%rdi
mov    0x18(%rbp),%rax
mov    -0x34(%rbp),%ecx
shl    $0x2,%ecx
add    $0x0,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%edx
mov    0x18(%rbp),%rax
mov    -0x34(%rbp),%ecx
shl    $0x2,%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%ecx
mov    0x18(%rbp),%rax
mov    -0x34(%rbp),%esi
shl    $0x2,%esi
add    $0x2,%esi
movslq %esi,%rsi
mov    (%rax,%rsi,4),%r8d
mov    0x18(%rbp),%rax
mov    -0x34(%rbp),%esi
shl    $0x2,%esi
add    $0x3,%esi
movslq %esi,%rsi
mov    (%rax,%rsi,4),%r9d
lea    0xd9c(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x38(%rbp),%eax
mov    0x20(%rbp),%rcx
movslq -0x34(%rbp),%rdx
cmp    (%rcx,%rdx,4),%eax
jge    12b6 <write_mesh_gmv_qual+0x176>
mov    0x20(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x38(%rbp)
mov    0x20(%rbp),%rax
movslq -0x34(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
jne    12cf <write_mesh_gmv_qual+0x18f>
movl   $0x1,-0x3c(%rbp)
jmp    12d4 <write_mesh_gmv_qual+0x194>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1228 <write_mesh_gmv_qual+0xe8>
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    1343 <write_mesh_gmv_qual+0x203>
mov    -0x38(%rbp),%eax
mov    -0x30(%rbp),%rcx
movslq -0x34(%rbp),%rdx
cmp    (%rcx,%rdx,4),%eax
jge    1317 <write_mesh_gmv_qual+0x1d7>
mov    -0x30(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x38(%rbp)
mov    -0x30(%rbp),%rax
movslq -0x34(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
jne    1330 <write_mesh_gmv_qual+0x1f0>
movl   $0x1,-0x3c(%rbp)
jmp    1335 <write_mesh_gmv_qual+0x1f5>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    12e9 <write_mesh_gmv_qual+0x1a9>
cmpl   $0x0,0x10(%rbp)
je     14ed <write_mesh_gmv_qual+0x3ad>
mov    -0x48(%rbp),%rdi
mov    -0x38(%rbp),%edx
add    -0x3c(%rbp),%edx
lea    0xce5(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0x38(%rbp),%eax
jge    139e <write_mesh_gmv_qual+0x25e>
mov    -0x48(%rbp),%rdi
mov    -0x34(%rbp),%edx
add    $0x1,%edx
lea    0xcca(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    136c <write_mesh_gmv_qual+0x22c>
cmpl   $0x0,-0x3c(%rbp)
je     13ba <write_mesh_gmv_qual+0x27a>
mov    -0x48(%rbp),%rdi
lea    0xca7(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    0x10(%rbp),%eax
jge    1426 <write_mesh_gmv_qual+0x2e6>
mov    -0x48(%rbp),%rax
mov    %rax,-0x50(%rbp)
mov    0x20(%rbp),%rax
movslq -0x34(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
je     13fa <write_mesh_gmv_qual+0x2ba>
mov    0x20(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x54(%rbp)
jmp    1403 <write_mesh_gmv_qual+0x2c3>
mov    -0x38(%rbp),%eax
add    -0x3c(%rbp),%eax
mov    %eax,-0x54(%rbp)
mov    -0x50(%rbp),%rdi
mov    -0x54(%rbp),%edx
lea    0xc52(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    13c1 <write_mesh_gmv_qual+0x281>
mov    -0x48(%rbp),%rdi
lea    0xc37(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    0x10(%rbp),%eax
jge    14db <write_mesh_gmv_qual+0x39b>
mov    -0x48(%rbp),%rax
mov    %rax,-0x60(%rbp)
mov    -0x18(%rbp),%rdi
mov    0x18(%rbp),%rax
mov    -0x34(%rbp),%ecx
shl    $0x2,%ecx
add    $0x0,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%esi
sub    $0x1,%esi
mov    0x18(%rbp),%rax
mov    -0x34(%rbp),%ecx
shl    $0x2,%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%edx
sub    $0x1,%edx
mov    0x18(%rbp),%rax
mov    -0x34(%rbp),%ecx
shl    $0x2,%ecx
add    $0x2,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%ecx
sub    $0x1,%ecx
mov    0x18(%rbp),%rax
mov    -0x34(%rbp),%r8d
shl    $0x2,%r8d
add    $0x3,%r8d
movslq %r8d,%r8
mov    (%rax,%r8,4),%r8d
sub    $0x1,%r8d
call   1050 <aft_tetra_qual@plt>
mov    -0x60(%rbp),%rdi
mov    %eax,%edx
lea    0xbb5(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    143f <write_mesh_gmv_qual+0x2ff>
mov    -0x48(%rbp),%rdi
lea    0xb9f(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x48(%rbp),%rdi
lea    0xb97(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    16e5 <write_mesh_gmv_qual+0x5a5>
mov    -0x48(%rbp),%rax
mov    %rax,-0x68(%rbp)
mov    -0x30(%rbp),%rax
movslq -0x34(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
je     153f <write_mesh_gmv_qual+0x3ff>
mov    -0x30(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x6c(%rbp)
jmp    1548 <write_mesh_gmv_qual+0x408>
mov    -0x38(%rbp),%eax
add    -0x3c(%rbp),%eax
mov    %eax,-0x6c(%rbp)
mov    -0x68(%rbp),%rdi
mov    -0x6c(%rbp),%edx
lea    0xb45(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x48(%rbp),%rdi
mov    -0x18(%rbp),%rax
mov    -0x28(%rbp),%rcx
imul   $0x3,-0x34(%rbp),%edx
add    $0x0,%edx
movslq %edx,%rdx
imul   $0x3,(%rcx,%rdx,4),%ecx
add    $0x0,%ecx
sub    $0x3,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x18(%rbp),%rax
mov    -0x28(%rbp),%rcx
imul   $0x3,-0x34(%rbp),%edx
add    $0x1,%edx
movslq %edx,%rdx
imul   $0x3,(%rcx,%rdx,4),%ecx
add    $0x0,%ecx
sub    $0x3,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x18(%rbp),%rax
mov    -0x28(%rbp),%rcx
imul   $0x3,-0x34(%rbp),%edx
add    $0x2,%edx
movslq %edx,%rdx
imul   $0x3,(%rcx,%rdx,4),%ecx
add    $0x0,%ecx
sub    $0x3,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm2
lea    0xad2(%rip),%rsi
mov    $0x3,%al
call   1040 <fprintf@plt>
mov    -0x48(%rbp),%rdi
mov    -0x18(%rbp),%rax
mov    -0x28(%rbp),%rcx
imul   $0x3,-0x34(%rbp),%edx
add    $0x0,%edx
movslq %edx,%rdx
imul   $0x3,(%rcx,%rdx,4),%ecx
add    $0x1,%ecx
sub    $0x3,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x18(%rbp),%rax
mov    -0x28(%rbp),%rcx
imul   $0x3,-0x34(%rbp),%edx
add    $0x1,%edx
movslq %edx,%rdx
imul   $0x3,(%rcx,%rdx,4),%ecx
add    $0x1,%ecx
sub    $0x3,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x18(%rbp),%rax
mov    -0x28(%rbp),%rcx
imul   $0x3,-0x34(%rbp),%edx
add    $0x2,%edx
movslq %edx,%rdx
imul   $0x3,(%rcx,%rdx,4),%ecx
add    $0x1,%ecx
sub    $0x3,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm2
lea    0xa4f(%rip),%rsi
mov    $0x3,%al
call   1040 <fprintf@plt>
mov    -0x48(%rbp),%rdi
mov    -0x18(%rbp),%rax
mov    -0x28(%rbp),%rcx
imul   $0x3,-0x34(%rbp),%edx
add    $0x0,%edx
movslq %edx,%rdx
imul   $0x3,(%rcx,%rdx,4),%ecx
add    $0x2,%ecx
sub    $0x3,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x18(%rbp),%rax
mov    -0x28(%rbp),%rcx
imul   $0x3,-0x34(%rbp),%edx
add    $0x1,%edx
movslq %edx,%rdx
imul   $0x3,(%rcx,%rdx,4),%ecx
add    $0x2,%ecx
sub    $0x3,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x18(%rbp),%rax
mov    -0x28(%rbp),%rcx
imul   $0x3,-0x34(%rbp),%edx
add    $0x2,%edx
movslq %edx,%rdx
imul   $0x3,(%rcx,%rdx,4),%ecx
add    $0x2,%ecx
sub    $0x3,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm2
lea    0x9d1(%rip),%rsi
mov    $0x3,%al
call   1040 <fprintf@plt>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1506 <write_mesh_gmv_qual+0x3c6>
mov    -0x48(%rbp),%rdi
lea    0x9d3(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x48(%rbp),%rdi
lea    0x9ca(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x48(%rbp),%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_mesh_gmv_qual>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x48,%rsp
mov    %r9,0x10(%rsp)
mov    %r8,0x8(%rsp)
mov    %ecx,0x18(%rsp)
mov    %rdx,%rbx
mov    %esi,%ebp
lea    0xe88(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,%r12
lea    0xe7b(%rip),%rsi
xor    %r14d,%r14d
mov    %rax,%rdi
mov    %ebp,%edx
xor    %eax,%eax
call   1040 <fprintf@plt>
test   %ebp,%ebp
jle    11d7 <write_mesh_gmv_qual+0x87>
mov    %ebp,%eax
shl    $0x3,%rax
lea    (%rax,%rax,2),%r13
xor    %ebp,%ebp
lea    0xef8(%rip),%r15
nopl   (%rax)
movq   (%rbx,%rbp,1),%xmm0
movq   0x8(%rbx,%rbp,1),%xmm1
movq   0x10(%rbx,%rbp,1),%xmm2
mov    %r12,%rdi
mov    %r15,%rsi
mov    $0x3,%al
call   1040 <fprintf@plt>
add    $0x18,%rbp
cmp    %rbp,%r13
jne    11b0 <write_mesh_gmv_qual+0x60>
mov    %rbx,0x38(%rsp)
mov    0x88(%rsp),%r15
lea    0xe32(%rip),%rsi
mov    %r12,%rdi
mov    0x80(%rsp),%ebp
mov    %ebp,%edx
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    %ebp,%eax
mov    %rax,0x30(%rsp)
mov    $0x0,%ebx
test   %ebp,%ebp
jle    127b <write_mesh_gmv_qual+0x12b>
mov    %r15,%rbp
mov    0x30(%rsp),%rax
lea    0x0(,%rax,4),%r13
xor    %r15d,%r15d
xor    %ebx,%ebx
xor    %r14d,%r14d
cs nopw 0x0(%rax,%rax,1)
mov    0x0(%rbp,%r15,4),%edx
mov    0x4(%rbp,%r15,4),%ecx
mov    0x8(%rbp,%r15,4),%r8d
mov    0xc(%rbp,%r15,4),%r9d
mov    %r12,%rdi
lea    0xddb(%rip),%rsi
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    0x90(%rsp),%rax
mov    (%rax,%r15,1),%eax
cmp    %eax,%r14d
cmovl  %eax,%r14d
test   %eax,%eax
mov    $0x1,%eax
cmove  %eax,%ebx
add    $0x4,%r15
cmp    %r15,%r13
jne    1230 <write_mesh_gmv_qual+0xe0>
mov    0x18(%rsp),%r15d
mov    %r15d,%r8d
test   %r15d,%r15d
jle    14b8 <write_mesh_gmv_qual+0x368>
cmp    $0x8,%r15d
jae    129e <write_mesh_gmv_qual+0x14e>
xor    %eax,%eax
mov    0x10(%rsp),%rdi
jmp    1495 <write_mesh_gmv_qual+0x345>
mov    %r8d,%eax
and    $0xfffffff8,%eax
movd   %ebx,%xmm8
pshufd $0x0,%xmm8,%xmm2
movd   %r14d,%xmm0
pshufd $0x0,%xmm0,%xmm7
lea    -0x8(%rax),%rdx
mov    %rdx,%rcx
shr    $0x3,%rcx
add    $0x1,%rcx
test   %rdx,%rdx
mov    0x10(%rsp),%rdi
je     1820 <write_mesh_gmv_qual+0x6d0>
mov    %rcx,%rsi
and    $0xfffffffffffffffe,%rsi
xor    %edx,%edx
pxor   %xmm9,%xmm9
movdqa %xmm2,%xmm11
movdqa %xmm2,%xmm10
movdqa %xmm7,%xmm0
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movdqu (%rdi,%rdx,4),%xmm5
movdqu 0x10(%rdi,%rdx,4),%xmm2
movdqu 0x20(%rdi,%rdx,4),%xmm6
movdqu 0x30(%rdi,%rdx,4),%xmm4
movdqa %xmm7,%xmm1
pcmpgtd %xmm5,%xmm1
pand   %xmm1,%xmm7
pandn  %xmm5,%xmm1
por    %xmm7,%xmm1
movdqa %xmm0,%xmm3
pcmpgtd %xmm2,%xmm3
pand   %xmm3,%xmm0
pandn  %xmm2,%xmm3
por    %xmm0,%xmm3
pcmpeqd %xmm9,%xmm5
pcmpeqd %xmm9,%xmm2
movdqa %xmm1,%xmm7
pcmpgtd %xmm6,%xmm7
pand   %xmm7,%xmm1
pandn  %xmm6,%xmm7
por    %xmm1,%xmm7
movdqa %xmm3,%xmm0
pcmpgtd %xmm4,%xmm0
pand   %xmm0,%xmm3
pandn  %xmm4,%xmm0
por    %xmm3,%xmm0
pcmpeqd %xmm9,%xmm6
por    %xmm5,%xmm6
pcmpeqd %xmm9,%xmm4
por    %xmm2,%xmm4
movdqa %xmm6,%xmm2
pandn  %xmm11,%xmm2
psubd  %xmm6,%xmm2
movdqa %xmm4,%xmm6
pandn  %xmm10,%xmm6
psubd  %xmm4,%xmm6
add    $0x10,%rdx
movdqa %xmm2,%xmm11
movdqa %xmm6,%xmm10
add    $0xfffffffffffffffe,%rsi
jne    1300 <write_mesh_gmv_qual+0x1b0>
test   $0x1,%cl
je     1419 <write_mesh_gmv_qual+0x2c9>
movdqu (%rdi,%rdx,4),%xmm1
movdqu 0x10(%rdi,%rdx,4),%xmm3
movdqa %xmm7,%xmm4
pcmpgtd %xmm1,%xmm4
pand   %xmm4,%xmm7
pandn  %xmm1,%xmm4
por    %xmm4,%xmm7
movdqa %xmm0,%xmm4
pcmpgtd %xmm3,%xmm4
pand   %xmm4,%xmm0
pandn  %xmm3,%xmm4
por    %xmm4,%xmm0
pxor   %xmm4,%xmm4
pcmpeqd %xmm4,%xmm1
pcmpeqd %xmm4,%xmm3
movdqa %xmm1,%xmm4
pandn  %xmm2,%xmm4
psubd  %xmm1,%xmm4
movdqa %xmm3,%xmm1
pandn  %xmm6,%xmm1
psubd  %xmm3,%xmm1
movdqa %xmm4,%xmm2
movdqa %xmm1,%xmm6
movdqa %xmm7,%xmm1
pcmpgtd %xmm0,%xmm1
pand   %xmm1,%xmm7
pandn  %xmm0,%xmm1
por    %xmm7,%xmm1
pshufd $0xee,%xmm1,%xmm0
movdqa %xmm1,%xmm3
pcmpgtd %xmm0,%xmm3
pand   %xmm3,%xmm1
pandn  %xmm0,%xmm3
por    %xmm1,%xmm3
pshufd $0x55,%xmm3,%xmm0
movdqa %xmm3,%xmm1
pcmpgtd %xmm0,%xmm1
pand   %xmm1,%xmm3
pandn  %xmm0,%xmm1
por    %xmm3,%xmm1
movd   %xmm1,%r14d
pshufd $0x0,%xmm8,%xmm0
movdqa %xmm2,%xmm1
pcmpeqd %xmm0,%xmm1
pand   %xmm1,%xmm6
pandn  %xmm2,%xmm1
por    %xmm6,%xmm1
pcmpeqd %xmm0,%xmm1
movmskps %xmm1,%ecx
cmp    $0xf,%ecx
mov    $0x1,%ecx
cmovne %ecx,%ebx
cmp    %r8,%rax
je     14b8 <write_mesh_gmv_qual+0x368>
mov    $0x1,%ecx
nopw   0x0(%rax,%rax,1)
mov    (%rdi,%rax,4),%edx
cmp    %edx,%r14d
cmovl  %edx,%r14d
test   %edx,%edx
cmove  %ecx,%ebx
add    $0x1,%rax
cmp    %rax,%r8
jne    14a0 <write_mesh_gmv_qual+0x350>
mov    %r8,0x40(%rsp)
cmpl   $0x0,0x80(%rsp)
je     1652 <write_mesh_gmv_qual+0x502>
mov    %rbx,0x20(%rsp)
lea    (%rbx,%r14,1),%edx
lea    0xb68(%rip),%rsi
mov    %r12,%rdi
mov    %edx,0x2c(%rsp)
xor    %eax,%eax
call   1040 <fprintf@plt>
test   %r14d,%r14d
jle    1525 <write_mesh_gmv_qual+0x3d5>
mov    %r14d,%ebx
neg    %ebx
mov    $0x1,%r13d
lea    0xb53(%rip),%rbp
mov    %r12,%rdi
mov    %rbp,%rsi
mov    %r13d,%edx
xor    %eax,%eax
call   1040 <fprintf@plt>
lea    (%rbx,%r13,1),%eax
add    $0x1,%eax
mov    %r13d,%ecx
add    $0x1,%ecx
mov    %ecx,%r13d
cmp    $0x1,%eax
jne    1500 <write_mesh_gmv_qual+0x3b0>
cmpl   $0x0,0x20(%rsp)
mov    0x90(%rsp),%r13
mov    0x30(%rsp),%rbp
je     1552 <write_mesh_gmv_qual+0x402>
lea    0xb1a(%rip),%rdi
mov    $0x8,%esi
mov    $0x1,%edx
mov    %r12,%rcx
call   1070 <fwrite@plt>
cmpl   $0x0,0x80(%rsp)
jle    1616 <write_mesh_gmv_qual+0x4c6>
xor    %ebx,%ebx
mov    0x2c(%rsp),%r15d
nopw   0x0(%rax,%rax,1)
mov    0x0(%r13,%rbx,4),%edx
test   %edx,%edx
cmove  %r15d,%edx
mov    %r12,%rdi
lea    0xade(%rip),%rsi
xor    %eax,%eax
call   1040 <fprintf@plt>
add    $0x1,%rbx
cmp    %rbx,%rbp
jne    1570 <write_mesh_gmv_qual+0x420>
lea    0xacc(%rip),%rdi
mov    $0x12,%esi
mov    $0x1,%edx
mov    %r12,%rcx
call   1070 <fwrite@plt>
cmpl   $0x0,0x80(%rsp)
mov    0x38(%rsp),%r13
mov    0x88(%rsp),%r15
jle    162f <write_mesh_gmv_qual+0x4df>
shl    $0x4,%rbp
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,1),%esi
mov    0x4(%r15,%rbx,1),%edx
add    $0xffffffff,%esi
add    $0xffffffff,%edx
mov    0x8(%r15,%rbx,1),%ecx
add    $0xffffffff,%ecx
mov    0xc(%r15,%rbx,1),%r8d
add    $0xffffffff,%r8d
mov    %r13,%rdi
call   1050 <aft_tetra_qual@plt>
mov    %r12,%rdi
lea    0xa79(%rip),%rsi
mov    %eax,%edx
xor    %eax,%eax
call   1040 <fprintf@plt>
add    $0x10,%rbx
cmp    %rbx,%rbp
jne    15d0 <write_mesh_gmv_qual+0x480>
jmp    162f <write_mesh_gmv_qual+0x4df>
lea    0xa4b(%rip),%rdi
mov    $0x12,%esi
mov    $0x1,%edx
mov    %r12,%rcx
call   1070 <fwrite@plt>
lea    0xa4f(%rip),%rdi
mov    $0x9,%esi
mov    $0x1,%edx
mov    %r12,%rcx
call   1070 <fwrite@plt>
mov    0x20(%rsp),%rbx
mov    0x18(%rsp),%r15d
lea    0xa36(%rip),%rdi
mov    $0xb,%esi
mov    $0x1,%edx
mov    %r12,%rcx
call   1070 <fwrite@plt>
test   %r15d,%r15d
mov    0x38(%rsp),%r13
mov    0x8(%rsp),%rbp
mov    0x10(%rsp),%rax
jle    17d5 <write_mesh_gmv_qual+0x685>
add    %r14d,%ebx
mov    0x40(%rsp),%rcx
lea    (%rcx,%rcx,2),%rcx
mov    %rcx,0x18(%rsp)
xor    %r14d,%r14d
mov    %rbx,0x20(%rsp)
nopl   0x0(%rax)
mov    %rax,0x10(%rsp)
mov    (%rax),%edx
test   %edx,%edx
cmove  %ebx,%edx
mov    %r12,%rdi
lea    0x9e5(%rip),%rsi
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    %r14d,%ecx
movslq 0x0(%rbp,%rcx,4),%rax
mov    %rcx,%rbp
lea    (%rax,%rax,2),%rax
movsd  -0x18(%r13,%rax,8),%xmm0
lea    0x1(%r14),%r15d
mov    0x8(%rsp),%rax
movslq (%rax,%r15,4),%rax
lea    (%rax,%rax,2),%rax
movsd  -0x18(%r13,%rax,8),%xmm1
mov    %r12,%rbx
lea    0x2(%r14),%r12d
mov    0x8(%rsp),%rax
movslq (%rax,%r12,4),%rax
lea    (%rax,%rax,2),%rax
movsd  -0x18(%r13,%rax,8),%xmm2
mov    %rbx,%rdi
lea    0x996(%rip),%rsi
mov    $0x3,%al
call   1040 <fprintf@plt>
mov    0x8(%rsp),%rax
movslq (%rax,%rbp,4),%rax
lea    (%rax,%rax,2),%rax
movsd  -0x10(%r13,%rax,8),%xmm0
mov    0x8(%rsp),%rax
movslq (%rax,%r15,4),%rax
lea    (%rax,%rax,2),%rax
movsd  -0x10(%r13,%rax,8),%xmm1
mov    0x8(%rsp),%rax
movslq (%rax,%r12,4),%rax
lea    (%rax,%rax,2),%rax
movsd  -0x10(%r13,%rax,8),%xmm2
mov    %rbx,%rdi
lea    0x944(%rip),%rsi
mov    $0x3,%al
call   1040 <fprintf@plt>
mov    0x8(%rsp),%rax
movslq (%rax,%rbp,4),%rax
lea    (%rax,%rax,2),%rax
movq   -0x8(%r13,%rax,8),%xmm0
mov    0x8(%rsp),%rax
movslq (%rax,%r15,4),%rax
mov    0x8(%rsp),%rbp
mov    0x10(%rsp),%r15
lea    (%rax,%rax,2),%rax
movsd  -0x8(%r13,%rax,8),%xmm1
movslq 0x0(%rbp,%r12,4),%rax
mov    %rbx,%r12
mov    0x20(%rsp),%rbx
lea    (%rax,%rax,2),%rax
movq   -0x8(%r13,%rax,8),%xmm2
mov    %r12,%rdi
lea    0x8e9(%rip),%rsi
mov    $0x3,%al
call   1040 <fprintf@plt>
mov    %r15,%rax
add    $0x3,%r14
add    $0x4,%rax
cmp    %r14,0x18(%rsp)
jne    16a0 <write_mesh_gmv_qual+0x550>
lea    0x8e7(%rip),%rdi
mov    $0x8,%esi
mov    $0x1,%edx
mov    %r12,%rcx
call   1070 <fwrite@plt>
lea    0x8d7(%rip),%rdi
mov    $0x7,%esi
mov    $0x1,%edx
mov    %r12,%rcx
call   1070 <fwrite@plt>
mov    %r12,%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
add    $0x48,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
xor    %edx,%edx
movdqa %xmm2,%xmm6
movdqa %xmm7,%xmm0
test   $0x1,%cl
jne    13ba <write_mesh_gmv_qual+0x26a>
jmp    1419 <write_mesh_gmv_qual+0x2c9>

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 = [26 x i8] c" tet 4\0A %4d %4d %4d %4d\0A\00"
@.str.5 = [16 x i8] c"\0Amaterial %d 0\0A\00"
@.str.6 = [7 x i8] c"mat%d\0A\00"
@.str.7 = [9 x i8] c"unknown\0A\00"
@.str.8 = [5 x i8] c" %2d\00"
@.str.9 = [19 x i8] c"\0A\0Avariable\0Aqual 0\0A\00"
@.str.10 = [10 x i8] c" %20.15lf\00"
@.str.11 = [10 x i8] c"\0Aendvars\0A\00"
@.str.12 = [12 x i8] c"\0A\0Apolygons\0A\00"
@.str.13 = [6 x i8] c"%3d 3\00"
@.str.14 = [29 x i8] c" %20.15lf %20.15lf %20.15lf\0A\00"
@.str.15 = [34 x i8] c" %20.15lf %20.15lf %20.15lf\0A\00"
@.str.16 = [9 x i8] c"endpoly\0A\00"
@.str.17 = [8 x i8] c"\0Aendgmv\00"
define i32 @write_mesh_gmv_qual(i8* %0, i32 %1, double* %2, i32 %3, i32* %4, i32* %5, i32 %6, i32* %7, i32* %8) {
%10 = alloca i8*
%11 = alloca i32
%12 = alloca double*
%13 = alloca i32
%14 = alloca i32*
%15 = alloca i32*
%16 = alloca i32
%17 = alloca i32*
%18 = alloca i32*
%19 = alloca i32
%20 = alloca i32
%21 = alloca i32
%22 = alloca i32*
store i8* %0, i8** %10
store i32 %1, i32* %11
store double* %2, double** %12
store i32 %3, i32* %13
store i32* %4, i32** %14
store i32* %5, i32** %15
store i32 %6, i32* %16
store i32* %7, i32** %17
store i32* %8, i32** %18
store i32 0, i32* %20
store i32 0, i32* %21
%23 = load i8*, i8** %10
%24 = call i32* @fopen(i8* %23, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %24, i32** %22
%25 = load i32*, i32** %22
%26 = load i32, i32* %11
%27 = call i32 (i32*, i8*, ...) @fprintf(i32* %25, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i32 %26)
store i32 0, i32* %19
br label %28
28: ; preds = %56, %9
%29 = load i32, i32* %19
%30 = load i32, i32* %11
%31 = icmp slt i32 %29, %30
br i1 %31, label %32, label %59
32: ; preds = %28
%33 = load i32*, i32** %22
%34 = load double*, double** %12
%35 = load i32, i32* %19
%36 = mul nsw i32 3, %35
%37 = add nsw i32 %36, 0
%38 = sext i32 %37 to i64
%39 = getelementptr inbounds double, double* %34, i64 %38
%40 = load double, double* %39
%41 = load double*, double** %12
%42 = load i32, i32* %19
%43 = mul nsw i32 3, %42
%44 = add nsw i32 %43, 1
%45 = sext i32 %44 to i64
%46 = getelementptr inbounds double, double* %41, i64 %45
%47 = load double, double* %46
%48 = load double*, double** %12
%49 = load i32, i32* %19
%50 = mul nsw i32 3, %49
%51 = add nsw i32 %50, 2
%52 = sext i32 %51 to i64
%53 = getelementptr inbounds double, double* %48, i64 %52
%54 = load double, double* %53
%55 = call i32 (i32*, i8*, ...) @fprintf(i32* %33, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0), double %40, double %47, double %54)
br label %56
56: ; preds = %32
%57 = load i32, i32* %19
%58 = add nsw i32 %57, 1
store i32 %58, i32* %19
br label %28
59: ; preds = %28
%60 = load i32*, i32** %22
%61 = load i32, i32* %16
%62 = call i32 (i32*, i8*, ...) @fprintf(i32* %60, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), i32 %61)
store i32 0, i32* %19
br label %63
63: ; preds = %120, %59
%64 = load i32, i32* %19
%65 = load i32, i32* %16
%66 = icmp slt i32 %64, %65
br i1 %66, label %67, label %123
67: ; preds = %63
%68 = load i32*, i32** %22
%69 = load i32*, i32** %17
%70 = load i32, i32* %19
%71 = mul nsw i32 4, %70
%72 = add nsw i32 %71, 0
%73 = sext i32 %72 to i64
%74 = getelementptr inbounds i32, i32* %69, i64 %73
%75 = load i32, i32* %74
%76 = load i32*, i32** %17
%77 = load i32, i32* %19
%78 = mul nsw i32 4, %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 = load i32*, i32** %17
%84 = load i32, i32* %19
%85 = mul nsw i32 4, %84
%86 = add nsw i32 %85, 2
%87 = sext i32 %86 to i64
%88 = getelementptr inbounds i32, i32* %83, i64 %87
%89 = load i32, i32* %88
%90 = load i32*, i32** %17
%91 = load i32, i32* %19
%92 = mul nsw i32 4, %91
%93 = add nsw i32 %92, 3
%94 = sext i32 %93 to i64
%95 = getelementptr inbounds i32, i32* %90, i64 %94
%96 = load i32, i32* %95
%97 = call i32 (i32*, i8*, ...) @fprintf(i32* %68, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.4, i64 0, i64 0), i32 %75, i32 %82, i32 %89, i32 %96)
%98 = load i32, i32* %20
%99 = load i32*, i32** %18
%100 = load i32, i32* %19
%101 = sext i32 %100 to i64
%102 = getelementptr inbounds i32, i32* %99, i64 %101
%103 = load i32, i32* %102
%104 = icmp slt i32 %98, %103
br i1 %104, label %105, label %111
105: ; preds = %67
%106 = load i32*, i32** %18
%107 = load i32, i32* %19
%108 = sext i32 %107 to i64
%109 = getelementptr inbounds i32, i32* %106, i64 %108
%110 = load i32, i32* %109
store i32 %110, i32* %20
br label %111
111: ; preds = %105, %67
%112 = load i32*, i32** %18
%113 = load i32, i32* %19
%114 = sext i32 %113 to i64
%115 = getelementptr inbounds i32, i32* %112, i64 %114
%116 = load i32, i32* %115
%117 = icmp eq i32 %116, 0
br i1 %117, label %118, label %119
118: ; preds = %111
store i32 1, i32* %21
br label %119
119: ; preds = %118, %111
br label %120
120: ; preds = %119
%121 = load i32, i32* %19
%122 = add nsw i32 %121, 1
store i32 %122, i32* %19
br label %63
123: ; preds = %63
store i32 0, i32* %19
br label %124
124: ; preds = %151, %123
%125 = load i32, i32* %19
%126 = load i32, i32* %13
%127 = icmp slt i32 %125, %126
br i1 %127, label %128, label %154
128: ; preds = %124
%129 = load i32, i32* %20
%130 = load i32*, i32** %15
%131 = load i32, i32* %19
%132 = sext i32 %131 to i64
%133 = getelementptr inbounds i32, i32* %130, i64 %132
%134 = load i32, i32* %133
%135 = icmp slt i32 %129, %134
br i1 %135, label %136, label %142
136: ; preds = %128
%137 = load i32*, i32** %15
%138 = load i32, i32* %19
%139 = sext i32 %138 to i64
%140 = getelementptr inbounds i32, i32* %137, i64 %139
%141 = load i32, i32* %140
store i32 %141, i32* %20
br label %142
142: ; preds = %136, %128
%143 = load i32*, i32** %15
%144 = load i32, i32* %19
%145 = sext i32 %144 to i64
%146 = getelementptr inbounds i32, i32* %143, i64 %145
%147 = load i32, i32* %146
%148 = icmp eq i32 %147, 0
br i1 %148, label %149, label %150
149: ; preds = %142
store i32 1, i32* %21
br label %150
150: ; preds = %149, %142
br label %151
151: ; preds = %150
%152 = load i32, i32* %19
%153 = add nsw i32 %152, 1
store i32 %153, i32* %19
br label %124
154: ; preds = %124
%155 = load i32, i32* %16
%156 = icmp ne i32 %155, 0
br i1 %156, label %157, label %260
157: ; preds = %154
%158 = load i32*, i32** %22
%159 = load i32, i32* %20
%160 = load i32, i32* %21
%161 = add nsw i32 %159, %160
%162 = call i32 (i32*, i8*, ...) @fprintf(i32* %158, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.5, i64 0, i64 0), i32 %161)
store i32 0, i32* %19
br label %163
163: ; preds = %172, %157
%164 = load i32, i32* %19
%165 = load i32, i32* %20
%166 = icmp slt i32 %164, %165
br i1 %166, label %167, label %175
167: ; preds = %163
%168 = load i32*, i32** %22
%169 = load i32, i32* %19
%170 = add nsw i32 %169, 1
%171 = call i32 (i32*, i8*, ...) @fprintf(i32* %168, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0), i32 %170)
br label %172
172: ; preds = %167
%173 = load i32, i32* %19
%174 = add nsw i32 %173, 1
store i32 %174, i32* %19
br label %163
175: ; preds = %163
%176 = load i32, i32* %21
%177 = icmp ne i32 %176, 0
br i1 %177, label %178, label %181
178: ; preds = %175
%179 = load i32*, i32** %22
%180 = call i32 (i32*, i8*, ...) @fprintf(i32* %179, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.7, i64 0, i64 0))
br label %181
181: ; preds = %178, %175
store i32 0, i32* %19
br label %182
182: ; preds = %207, %181
%183 = load i32, i32* %19
%184 = load i32, i32* %16
%185 = icmp slt i32 %183, %184
br i1 %185, label %186, label %210
186: ; preds = %182
%187 = load i32*, i32** %22
%188 = load i32*, i32** %18
%189 = load i32, i32* %19
%190 = sext i32 %189 to i64
%191 = getelementptr inbounds i32, i32* %188, i64 %190
%192 = load i32, i32* %191
%193 = icmp ne i32 %192, 0
br i1 %193, label %194, label %200
194: ; preds = %186
%195 = load i32*, i32** %18
%196 = load i32, i32* %19
%197 = sext i32 %196 to i64
%198 = getelementptr inbounds i32, i32* %195, i64 %197
%199 = load i32, i32* %198
br label %204
200: ; preds = %186
%201 = load i32, i32* %20
%202 = load i32, i32* %21
%203 = add nsw i32 %201, %202
br label %204
204: ; preds = %200, %194
%205 = phi i32 [ %199, %194 ], [ %203, %200 ]
%206 = call i32 (i32*, i8*, ...) @fprintf(i32* %187, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0), i32 %205)
br label %207
207: ; preds = %204
%208 = load i32, i32* %19
%209 = add nsw i32 %208, 1
store i32 %209, i32* %19
br label %182
210: ; preds = %182
%211 = load i32*, i32** %22
%212 = call i32 (i32*, i8*, ...) @fprintf(i32* %211, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.9, i64 0, i64 0))
store i32 0, i32* %19
br label %213
213: ; preds = %254, %210
%214 = load i32, i32* %19
%215 = load i32, i32* %16
%216 = icmp slt i32 %214, %215
br i1 %216, label %217, label %257
217: ; preds = %213
%218 = load i32*, i32** %22
%219 = load double*, double** %12
%220 = load i32*, i32** %17
%221 = load i32, i32* %19
%222 = mul nsw i32 4, %221
%223 = add nsw i32 %222, 0
%224 = sext i32 %223 to i64
%225 = getelementptr inbounds i32, i32* %220, i64 %224
%226 = load i32, i32* %225
%227 = sub nsw i32 %226, 1
%228 = load i32*, i32** %17
%229 = load i32, i32* %19
%230 = mul nsw i32 4, %229
%231 = add nsw i32 %230, 1
%232 = sext i32 %231 to i64
%233 = getelementptr inbounds i32, i32* %228, i64 %232
%234 = load i32, i32* %233
%235 = sub nsw i32 %234, 1
%236 = load i32*, i32** %17
%237 = load i32, i32* %19
%238 = mul nsw i32 4, %237
%239 = add nsw i32 %238, 2
%240 = sext i32 %239 to i64
%241 = getelementptr inbounds i32, i32* %236, i64 %240
%242 = load i32, i32* %241
%243 = sub nsw i32 %242, 1
%244 = load i32*, i32** %17
%245 = load i32, i32* %19
%246 = mul nsw i32 4, %245
%247 = add nsw i32 %246, 3
%248 = sext i32 %247 to i64
%249 = getelementptr inbounds i32, i32* %244, i64 %248
%250 = load i32, i32* %249
%251 = sub nsw i32 %250, 1
%252 = call i32 @aft_tetra_qual(double* %219, i32 %227, i32 %235, i32 %243, i32 %251)
%253 = call i32 (i32*, i8*, ...) @fprintf(i32* %218, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.10, i64 0, i64 0), i32 %252)
br label %254
254: ; preds = %217
%255 = load i32, i32* %19
%256 = add nsw i32 %255, 1
store i32 %256, i32* %19
br label %213
257: ; preds = %213
%258 = load i32*, i32** %22
%259 = call i32 (i32*, i8*, ...) @fprintf(i32* %258, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.11, i64 0, i64 0))
br label %260
260: ; preds = %257, %154
%261 = load i32*, i32** %22
%262 = call i32 (i32*, i8*, ...) @fprintf(i32* %261, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.12, i64 0, i64 0))
store i32 0, i32* %19
br label %263
263: ; preds = %420, %260
%264 = load i32, i32* %19
%265 = load i32, i32* %13
%266 = icmp slt i32 %264, %265
br i1 %266, label %267, label %423
267: ; preds = %263
%268 = load i32*, i32** %22
%269 = load i32*, i32** %15
%270 = load i32, i32* %19
%271 = sext i32 %270 to i64
%272 = getelementptr inbounds i32, i32* %269, i64 %271
%273 = load i32, i32* %272
%274 = icmp ne i32 %273, 0
br i1 %274, label %275, label %281
275: ; preds = %267
%276 = load i32*, i32** %15
%277 = load i32, i32* %19
%278 = sext i32 %277 to i64
%279 = getelementptr inbounds i32, i32* %276, i64 %278
%280 = load i32, i32* %279
br label %285
281: ; preds = %267
%282 = load i32, i32* %20
%283 = load i32, i32* %21
%284 = add nsw i32 %282, %283
br label %285
285: ; preds = %281, %275
%286 = phi i32 [ %280, %275 ], [ %284, %281 ]
%287 = call i32 (i32*, i8*, ...) @fprintf(i32* %268, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.13, i64 0, i64 0), i32 %286)
%288 = load i32*, i32** %22
%289 = load double*, double** %12
%290 = load i32*, i32** %14
%291 = load i32, i32* %19
%292 = mul nsw i32 3, %291
%293 = add nsw i32 %292, 0
%294 = sext i32 %293 to i64
%295 = getelementptr inbounds i32, i32* %290, i64 %294
%296 = load i32, i32* %295
%297 = mul nsw i32 3, %296
%298 = add nsw i32 %297, 0
%299 = sub nsw i32 %298, 3
%300 = sext i32 %299 to i64
%301 = getelementptr inbounds double, double* %289, i64 %300
%302 = load double, double* %301
%303 = load double*, double** %12
%304 = load i32*, i32** %14
%305 = load i32, i32* %19
%306 = mul nsw i32 3, %305
%307 = add nsw i32 %306, 1
%308 = sext i32 %307 to i64
%309 = getelementptr inbounds i32, i32* %304, i64 %308
%310 = load i32, i32* %309
%311 = mul nsw i32 3, %310
%312 = add nsw i32 %311, 0
%313 = sub nsw i32 %312, 3
%314 = sext i32 %313 to i64
%315 = getelementptr inbounds double, double* %303, i64 %314
%316 = load double, double* %315
%317 = load double*, double** %12
%318 = load i32*, i32** %14
%319 = load i32, i32* %19
%320 = mul nsw i32 3, %319
%321 = add nsw i32 %320, 2
%322 = sext i32 %321 to i64
%323 = getelementptr inbounds i32, i32* %318, i64 %322
%324 = load i32, i32* %323
%325 = mul nsw i32 3, %324
%326 = add nsw i32 %325, 0
%327 = sub nsw i32 %326, 3
%328 = sext i32 %327 to i64
%329 = getelementptr inbounds double, double* %317, i64 %328
%330 = load double, double* %329
%331 = call i32 (i32*, i8*, ...) @fprintf(i32* %288, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.14, i64 0, i64 0), double %302, double %316, double %330)
%332 = load i32*, i32** %22
%333 = load double*, double** %12
%334 = load i32*, i32** %14
%335 = load i32, i32* %19
%336 = mul nsw i32 3, %335
%337 = add nsw i32 %336, 0
%338 = sext i32 %337 to i64
%339 = getelementptr inbounds i32, i32* %334, i64 %338
%340 = load i32, i32* %339
%341 = mul nsw i32 3, %340
%342 = add nsw i32 %341, 1
%343 = sub nsw i32 %342, 3
%344 = sext i32 %343 to i64
%345 = getelementptr inbounds double, double* %333, i64 %344
%346 = load double, double* %345
%347 = load double*, double** %12
%348 = load i32*, i32** %14
%349 = load i32, i32* %19
%350 = mul nsw i32 3, %349
%351 = add nsw i32 %350, 1
%352 = sext i32 %351 to i64
%353 = getelementptr inbounds i32, i32* %348, i64 %352
%354 = load i32, i32* %353
%355 = mul nsw i32 3, %354
%356 = add nsw i32 %355, 1
%357 = sub nsw i32 %356, 3
%358 = sext i32 %357 to i64
%359 = getelementptr inbounds double, double* %347, i64 %358
%360 = load double, double* %359
%361 = load double*, double** %12
%362 = load i32*, i32** %14
%363 = load i32, i32* %19
%364 = mul nsw i32 3, %363
%365 = add nsw i32 %364, 2
%366 = sext i32 %365 to i64
%367 = getelementptr inbounds i32, i32* %362, i64 %366
%368 = load i32, i32* %367
%369 = mul nsw i32 3, %368
%370 = add nsw i32 %369, 1
%371 = sub nsw i32 %370, 3
%372 = sext i32 %371 to i64
%373 = getelementptr inbounds double, double* %361, i64 %372
%374 = load double, double* %373
%375 = call i32 (i32*, i8*, ...) @fprintf(i32* %332, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.15, i64 0, i64 0), double %346, double %360, double %374)
%376 = load i32*, i32** %22
%377 = load double*, double** %12
%378 = load i32*, i32** %14
%379 = load i32, i32* %19
%380 = mul nsw i32 3, %379
%381 = add nsw i32 %380, 0
%382 = sext i32 %381 to i64
%383 = getelementptr inbounds i32, i32* %378, i64 %382
%384 = load i32, i32* %383
%385 = mul nsw i32 3, %384
%386 = add nsw i32 %385, 2
%387 = sub nsw i32 %386, 3
%388 = sext i32 %387 to i64
%389 = getelementptr inbounds double, double* %377, i64 %388
%390 = load double, double* %389
%391 = load double*, double** %12
%392 = load i32*, i32** %14
%393 = load i32, i32* %19
%394 = mul nsw i32 3, %393
%395 = add nsw i32 %394, 1
%396 = sext i32 %395 to i64
%397 = getelementptr inbounds i32, i32* %392, i64 %396
%398 = load i32, i32* %397
%399 = mul nsw i32 3, %398
%400 = add nsw i32 %399, 2
%401 = sub nsw i32 %400, 3
%402 = sext i32 %401 to i64
%403 = getelementptr inbounds double, double* %391, i64 %402
%404 = load double, double* %403
%405 = load double*, double** %12
%406 = load i32*, i32** %14
%407 = load i32, i32* %19
%408 = mul nsw i32 3, %407
%409 = add nsw i32 %408, 2
%410 = sext i32 %409 to i64
%411 = getelementptr inbounds i32, i32* %406, i64 %410
%412 = load i32, i32* %411
%413 = mul nsw i32 3, %412
%414 = add nsw i32 %413, 2
%415 = sub nsw i32 %414, 3
%416 = sext i32 %415 to i64
%417 = getelementptr inbounds double, double* %405, i64 %416
%418 = load double, double* %417
%419 = call i32 (i32*, i8*, ...) @fprintf(i32* %376, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.15, i64 0, i64 0), double %390, double %404, double %418)
br label %420
420: ; preds = %285
%421 = load i32, i32* %19
%422 = add nsw i32 %421, 1
store i32 %422, i32* %19
br label %263
423: ; preds = %263
%424 = load i32*, i32** %22
%425 = call i32 (i32*, i8*, ...) @fprintf(i32* %424, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.16, i64 0, i64 0))
%426 = load i32*, i32** %22
%427 = call i32 (i32*, i8*, ...) @fprintf(i32* %426, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.17, i64 0, i64 0))
%428 = load i32*, i32** %22
%429 = call i32 @fclose(i32* %428)
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 = [26 x i8] c" tet 4\0A %4d %4d %4d %4d\0A\00"
@.str.5 = [16 x i8] c"\0Amaterial %d 0\0A\00"
@.str.6 = [7 x i8] c"mat%d\0A\00"
@.str.7 = [9 x i8] c"unknown\0A\00"
@.str.8 = [5 x i8] c" %2d\00"
@.str.9 = [19 x i8] c"\0A\0Avariable\0Aqual 0\0A\00"
@.str.10 = [10 x i8] c" %20.15lf\00"
@.str.11 = [10 x i8] c"\0Aendvars\0A\00"
@.str.12 = [12 x i8] c"\0A\0Apolygons\0A\00"
@.str.13 = [6 x i8] c"%3d 3\00"
@.str.14 = [29 x i8] c" %20.15lf %20.15lf %20.15lf\0A\00"
@.str.15 = [34 x i8] c" %20.15lf %20.15lf %20.15lf\0A\00"
@.str.16 = [9 x i8] c"endpoly\0A\00"
@.str.17 = [8 x i8] c"\0Aendgmv\00"
define i32 @write_mesh_gmv_qual(i8* nocapture %0, i32 %1, double* %2, i32 %3, i32* nocapture %4, i32* nocapture %5, i32 %6, i32* nocapture %7, i32* nocapture %8) {
%10 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%11 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %10, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i32 %1)
%12 = icmp sgt i32 %1, 0
br i1 %12, label %13, label %29
13: ; preds = %9
%14 = zext i32 %1 to i64
br label %15
15: ; preds = %13, %15
%16 = phi i64 [ 0, %13 ], [ %27, %15 ]
%17 = mul nuw nsw i64 %16, 3
%18 = getelementptr inbounds double, double* %2, i64 %17
%19 = load double, double* %18
%20 = add nuw nsw i64 %17, 1
%21 = getelementptr inbounds double, double* %2, i64 %20
%22 = load double, double* %21
%23 = add nuw nsw i64 %17, 2
%24 = getelementptr inbounds double, double* %2, i64 %23
%25 = load double, double* %24
%26 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %10, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0), double %19, double %22, double %25)
%27 = add nuw nsw i64 %16, 1
%28 = icmp eq i64 %27, %14
br i1 %28, label %29, label %15
29: ; preds = %15, %9
%30 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %10, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), i32 %6)
%31 = icmp sgt i32 %6, 0
br i1 %31, label %32, label %34
32: ; preds = %29
%33 = zext i32 %6 to i64
br label %142
34: ; preds = %142, %29
%35 = phi i32 [ 0, %29 ], [ %162, %142 ]
%36 = phi i32 [ 0, %29 ], [ %164, %142 ]
%37 = icmp sgt i32 %3, 0
br i1 %37, label %38, label %179
38: ; preds = %34
%39 = zext i32 %3 to i64
%40 = icmp ult i32 %3, 8
br i1 %40, label %138, label %41
41: ; preds = %38
%42 = and i64 %39, 4294967288
%43 = insertelement <4 x i32> poison, i32 %36, i64 0
%44 = shufflevector <4 x i32> %43, <4 x i32> poison, <4 x i32> zeroinitializer
%45 = insertelement <4 x i32> poison, i32 %35, i64 0
%46 = shufflevector <4 x i32> %45, <4 x i32> poison, <4 x i32> zeroinitializer
%47 = add nsw i64 %42, -8
%48 = lshr exact i64 %47, 3
%49 = add nuw nsw i64 %48, 1
%50 = and i64 %49, 1
%51 = icmp eq i64 %47, 0
br i1 %51, label %93, label %52
52: ; preds = %41
%53 = and i64 %49, 4611686018427387902
br label %54
54: ; preds = %54, %52
%55 = phi i64 [ 0, %52 ], [ %90, %54 ]
%56 = phi <4 x i32> [ %44, %52 ], [ %87, %54 ]
%57 = phi <4 x i32> [ %44, %52 ], [ %89, %54 ]
%58 = phi <4 x i32> [ %46, %52 ], [ %82, %54 ]
%59 = phi <4 x i32> [ %46, %52 ], [ %83, %54 ]
%60 = phi i64 [ 0, %52 ], [ %91, %54 ]
%61 = getelementptr inbounds i32, i32* %5, i64 %55
%62 = bitcast i32* %61 to <4 x i32>*
%63 = load <4 x i32>, <4 x i32>* %62
%64 = getelementptr inbounds i32, i32* %61, i64 4
%65 = bitcast i32* %64 to <4 x i32>*
%66 = load <4 x i32>, <4 x i32>* %65
%67 = icmp slt <4 x i32> %58, %63
%68 = icmp slt <4 x i32> %59, %66
%69 = select <4 x i1> %67, <4 x i32> %63, <4 x i32> %58
%70 = select <4 x i1> %68, <4 x i32> %66, <4 x i32> %59
%71 = icmp eq <4 x i32> %63, zeroinitializer
%72 = icmp eq <4 x i32> %66, zeroinitializer
%73 = or i64 %55, 8
%74 = getelementptr inbounds i32, i32* %5, i64 %73
%75 = bitcast i32* %74 to <4 x i32>*
%76 = load <4 x i32>, <4 x i32>* %75
%77 = getelementptr inbounds i32, i32* %74, i64 4
%78 = bitcast i32* %77 to <4 x i32>*
%79 = load <4 x i32>, <4 x i32>* %78
%80 = icmp slt <4 x i32> %69, %76
%81 = icmp slt <4 x i32> %70, %79
%82 = select <4 x i1> %80, <4 x i32> %76, <4 x i32> %69
%83 = select <4 x i1> %81, <4 x i32> %79, <4 x i32> %70
%84 = icmp eq <4 x i32> %76, zeroinitializer
%85 = icmp eq <4 x i32> %79, zeroinitializer
%86 = select <4 x i1> %84, <4 x i1> <i1 true, i1 true, i1 true, i1 true>, <4 x i1> %71
%87 = select <4 x i1> %86, <4 x i32> <i32 1, i32 1, i32 1, i32 1>, <4 x i32> %56
%88 = select <4 x i1> %85, <4 x i1> <i1 true, i1 true, i1 true, i1 true>, <4 x i1> %72
%89 = select <4 x i1> %88, <4 x i32> <i32 1, i32 1, i32 1, i32 1>, <4 x i32> %57
%90 = add nuw i64 %55, 16
%91 = add i64 %60, 2
%92 = icmp eq i64 %91, %53
br i1 %92, label %93, label %54
93: ; preds = %54, %41
%94 = phi <4 x i32> [ undef, %41 ], [ %82, %54 ]
%95 = phi <4 x i32> [ undef, %41 ], [ %83, %54 ]
%96 = phi <4 x i32> [ undef, %41 ], [ %87, %54 ]
%97 = phi <4 x i32> [ undef, %41 ], [ %89, %54 ]
%98 = phi i64 [ 0, %41 ], [ %90, %54 ]
%99 = phi <4 x i32> [ %44, %41 ], [ %87, %54 ]
%100 = phi <4 x i32> [ %44, %41 ], [ %89, %54 ]
%101 = phi <4 x i32> [ %46, %41 ], [ %82, %54 ]
%102 = phi <4 x i32> [ %46, %41 ], [ %83, %54 ]
%103 = icmp eq i64 %50, 0
br i1 %103, label %119, label %104
104: ; preds = %93
%105 = getelementptr inbounds i32, i32* %5, i64 %98
%106 = bitcast i32* %105 to <4 x i32>*
%107 = load <4 x i32>, <4 x i32>* %106
%108 = getelementptr inbounds i32, i32* %105, i64 4
%109 = bitcast i32* %108 to <4 x i32>*
%110 = load <4 x i32>, <4 x i32>* %109
%111 = icmp slt <4 x i32> %101, %107
%112 = icmp slt <4 x i32> %102, %110
%113 = select <4 x i1> %111, <4 x i32> %107, <4 x i32> %101
%114 = select <4 x i1> %112, <4 x i32> %110, <4 x i32> %102
%115 = icmp eq <4 x i32> %107, zeroinitializer
%116 = icmp eq <4 x i32> %110, zeroinitializer
%117 = select <4 x i1> %115, <4 x i32> <i32 1, i32 1, i32 1, i32 1>, <4 x i32> %99
%118 = select <4 x i1> %116, <4 x i32> <i32 1, i32 1, i32 1, i32 1>, <4 x i32> %100
br label %119
119: ; preds = %93, %104
%120 = phi <4 x i32> [ %94, %93 ], [ %113, %104 ]
%121 = phi <4 x i32> [ %95, %93 ], [ %114, %104 ]
%122 = phi <4 x i32> [ %96, %93 ], [ %117, %104 ]
%123 = phi <4 x i32> [ %97, %93 ], [ %118, %104 ]
%124 = icmp sgt <4 x i32> %120, %121
%125 = select <4 x i1> %124, <4 x i32> %120, <4 x i32> %121
%126 = call i32 @llvm.vector.reduce.smax.v4i32(<4 x i32> %125)
%127 = insertelement <4 x i32> poison, i32 %36, i64 0
%128 = shufflevector <4 x i32> %127, <4 x i32> poison, <4 x i32> zeroinitializer
%129 = icmp eq <4 x i32> %122, %128
%130 = select <4 x i1> %129, <4 x i32> %123, <4 x i32> %122
%131 = insertelement <4 x i32> poison, i32 %36, i64 0
%132 = shufflevector <4 x i32> %131, <4 x i32> poison, <4 x i32> zeroinitializer
%133 = icmp ne <4 x i32> %130, %132
%134 = bitcast <4 x i1> %133 to i4
%135 = icmp eq i4 %134, 0
%136 = select i1 %135, i32 %36, i32 1
%137 = icmp eq i64 %42, %39
br i1 %137, label %179, label %138
138: ; preds = %38, %119
%139 = phi i64 [ 0, %38 ], [ %42, %119 ]
%140 = phi i32 [ %36, %38 ], [ %136, %119 ]
%141 = phi i32 [ %35, %38 ], [ %126, %119 ]
br label %167
142: ; preds = %32, %142
%143 = phi i64 [ 0, %32 ], [ %165, %142 ]
%144 = phi i32 [ 0, %32 ], [ %164, %142 ]
%145 = phi i32 [ 0, %32 ], [ %162, %142 ]
%146 = shl nsw i64 %143, 2
%147 = getelementptr inbounds i32, i32* %7, i64 %146
%148 = load i32, i32* %147
%149 = or i64 %146, 1
%150 = getelementptr inbounds i32, i32* %7, i64 %149
%151 = load i32, i32* %150
%152 = or i64 %146, 2
%153 = getelementptr inbounds i32, i32* %7, i64 %152
%154 = load i32, i32* %153
%155 = or i64 %146, 3
%156 = getelementptr inbounds i32, i32* %7, i64 %155
%157 = load i32, i32* %156
%158 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %10, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.4, i64 0, i64 0), i32 %148, i32 %151, i32 %154, i32 %157)
%159 = getelementptr inbounds i32, i32* %8, i64 %143
%160 = load i32, i32* %159
%161 = icmp slt i32 %145, %160
%162 = select i1 %161, i32 %160, i32 %145
%163 = icmp eq i32 %160, 0
%164 = select i1 %163, i32 1, i32 %144
%165 = add nuw nsw i64 %143, 1
%166 = icmp eq i64 %165, %33
br i1 %166, label %34, label %142
167: ; preds = %138, %167
%168 = phi i64 [ %177, %167 ], [ %139, %138 ]
%169 = phi i32 [ %176, %167 ], [ %140, %138 ]
%170 = phi i32 [ %174, %167 ], [ %141, %138 ]
%171 = getelementptr inbounds i32, i32* %5, i64 %168
%172 = load i32, i32* %171
%173 = icmp slt i32 %170, %172
%174 = select i1 %173, i32 %172, i32 %170
%175 = icmp eq i32 %172, 0
%176 = select i1 %175, i32 1, i32 %169
%177 = add nuw nsw i64 %168, 1
%178 = icmp eq i64 %177, %39
br i1 %178, label %179, label %167
179: ; preds = %167, %119, %34
%180 = phi i32 [ %35, %34 ], [ %126, %119 ], [ %174, %167 ]
%181 = phi i32 [ %36, %34 ], [ %136, %119 ], [ %176, %167 ]
%182 = icmp eq i32 %6, 0
br i1 %182, label %238, label %183
183: ; preds = %179
%184 = add nsw i32 %181, %180
%185 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %10, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.5, i64 0, i64 0), i32 %184)
%186 = icmp sgt i32 %180, 0
br i1 %186, label %187, label %192
187: ; preds = %183, %187
%188 = phi i32 [ %189, %187 ], [ 0, %183 ]
%189 = add nuw nsw i32 %188, 1
%190 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %10, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0), i32 %189)
%191 = icmp eq i32 %189, %180
br i1 %191, label %192, label %187
192: ; preds = %187, %183
%193 = icmp eq i32 %181, 0
br i1 %193, label %196, label %194
194: ; preds = %192
%195 = tail call i64 @fwrite(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.7, i64 0, i64 0), i64 8, i64 1, i32* %10)
br label %196
196: ; preds = %194, %192
br i1 %31, label %199, label %197
197: ; preds = %196
%198 = tail call i64 @fwrite(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.9, i64 0, i64 0), i64 18, i64 1, i32* %10)
br label %236
199: ; preds = %196
%200 = zext i32 %6 to i64
br label %201
201: ; preds = %199, %201
%202 = phi i64 [ 0, %199 ], [ %208, %201 ]
%203 = getelementptr inbounds i32, i32* %8, i64 %202
%204 = load i32, i32* %203
%205 = icmp eq i32 %204, 0
%206 = select i1 %205, i32 %184, i32 %204
%207 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %10, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0), i32 %206)
%208 = add nuw nsw i64 %202, 1
%209 = icmp eq i64 %208, %200
br i1 %209, label %210, label %201
210: ; preds = %201
%211 = tail call i64 @fwrite(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.9, i64 0, i64 0), i64 18, i64 1, i32* %10)
br i1 %31, label %212, label %236
212: ; preds = %210
%213 = zext i32 %6 to i64
br label %214
214: ; preds = %212, %214
%215 = phi i64 [ 0, %212 ], [ %234, %214 ]
%216 = shl nsw i64 %215, 2
%217 = getelementptr inbounds i32, i32* %7, i64 %216
%218 = load i32, i32* %217
%219 = add nsw i32 %218, -1
%220 = or i64 %216, 1
%221 = getelementptr inbounds i32, i32* %7, i64 %220
%222 = load i32, i32* %221
%223 = add nsw i32 %222, -1
%224 = or i64 %216, 2
%225 = getelementptr inbounds i32, i32* %7, i64 %224
%226 = load i32, i32* %225
%227 = add nsw i32 %226, -1
%228 = or i64 %216, 3
%229 = getelementptr inbounds i32, i32* %7, i64 %228
%230 = load i32, i32* %229
%231 = add nsw i32 %230, -1
%232 = tail call i32 @aft_tetra_qual(double* %2, i32 %219, i32 %223, i32 %227, i32 %231)
%233 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %10, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.10, i64 0, i64 0), i32 %232)
%234 = add nuw nsw i64 %215, 1
%235 = icmp eq i64 %234, %213
br i1 %235, label %236, label %214
236: ; preds = %214, %197, %210
%237 = tail call i64 @fwrite(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.11, i64 0, i64 0), i64 9, i64 1, i32* %10)
br label %238
238: ; preds = %236, %179
%239 = tail call i64 @fwrite(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.12, i64 0, i64 0), i64 11, i64 1, i32* %10)
br i1 %37, label %240, label %319
240: ; preds = %238
%241 = add nsw i32 %181, %180
%242 = zext i32 %3 to i64
br label %243
243: ; preds = %240, %243
%244 = phi i64 [ 0, %240 ], [ %317, %243 ]
%245 = getelementptr inbounds i32, i32* %5, i64 %244
%246 = load i32, i32* %245
%247 = icmp eq i32 %246, 0
%248 = select i1 %247, i32 %241, i32 %246
%249 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %10, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.13, i64 0, i64 0), i32 %248)
%250 = trunc i64 %244 to i32
%251 = mul nsw i32 %250, 3
%252 = zext i32 %251 to i64
%253 = getelementptr inbounds i32, i32* %4, i64 %252
%254 = load i32, i32* %253
%255 = mul nsw i32 %254, 3
%256 = add nsw i32 %255, -3
%257 = sext i32 %256 to i64
%258 = getelementptr inbounds double, double* %2, i64 %257
%259 = load double, double* %258
%260 = add nuw nsw i32 %251, 1
%261 = zext i32 %260 to i64
%262 = getelementptr inbounds i32, i32* %4, i64 %261
%263 = load i32, i32* %262
%264 = mul nsw i32 %263, 3
%265 = add nsw i32 %264, -3
%266 = sext i32 %265 to i64
%267 = getelementptr inbounds double, double* %2, i64 %266
%268 = load double, double* %267
%269 = add nuw nsw i32 %251, 2
%270 = zext i32 %269 to i64
%271 = getelementptr inbounds i32, i32* %4, i64 %270
%272 = load i32, i32* %271
%273 = mul nsw i32 %272, 3
%274 = add nsw i32 %273, -3
%275 = sext i32 %274 to i64
%276 = getelementptr inbounds double, double* %2, i64 %275
%277 = load double, double* %276
%278 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %10, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.14, i64 0, i64 0), double %259, double %268, double %277)
%279 = load i32, i32* %253
%280 = mul nsw i32 %279, 3
%281 = add nsw i32 %280, -2
%282 = sext i32 %281 to i64
%283 = getelementptr inbounds double, double* %2, i64 %282
%284 = load double, double* %283
%285 = load i32, i32* %262
%286 = mul nsw i32 %285, 3
%287 = add nsw i32 %286, -2
%288 = sext i32 %287 to i64
%289 = getelementptr inbounds double, double* %2, i64 %288
%290 = load double, double* %289
%291 = load i32, i32* %271
%292 = mul nsw i32 %291, 3
%293 = add nsw i32 %292, -2
%294 = sext i32 %293 to i64
%295 = getelementptr inbounds double, double* %2, i64 %294
%296 = load double, double* %295
%297 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %10, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.15, i64 0, i64 0), double %284, double %290, double %296)
%298 = load i32, i32* %253
%299 = mul nsw i32 %298, 3
%300 = add nsw i32 %299, -1
%301 = sext i32 %300 to i64
%302 = getelementptr inbounds double, double* %2, i64 %301
%303 = load double, double* %302
%304 = load i32, i32* %262
%305 = mul nsw i32 %304, 3
%306 = add nsw i32 %305, -1
%307 = sext i32 %306 to i64
%308 = getelementptr inbounds double, double* %2, i64 %307
%309 = load double, double* %308
%310 = load i32, i32* %271
%311 = mul nsw i32 %310, 3
%312 = add nsw i32 %311, -1
%313 = sext i32 %312 to i64
%314 = getelementptr inbounds double, double* %2, i64 %313
%315 = load double, double* %314
%316 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %10, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.15, i64 0, i64 0), double %303, double %309, double %315)
%317 = add nuw nsw i64 %244, 1
%318 = icmp eq i64 %317, %242
br i1 %318, label %319, label %243
319: ; preds = %243, %238
%320 = tail call i64 @fwrite(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.16, i64 0, i64 0), i64 8, i64 1, i32* %10)
%321 = tail call i64 @fwrite(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.17, i64 0, i64 0), i64 7, i64 1, i32* %10)
%322 = tail call i32 @fclose(i32* %10)
ret i32 0
}