// File: /workspace/github_c_makefile_star2_O3/vlenhart[P]q3bsp/vformat.cpp
// Function: VertexPool::SaveVRML(_IO_FILE*, bool)
void VertexPool::SaveVRML(FILE *fph,bool tex1)
{
  if ( 1 )
  {
    fprintf(fph,"  Coordinate3 {\npoint [\n");
    int count = mVtxs.size();
    for (int i=0; i<count; i++)
    {
      const LightMapVertex &vtx = mVtxs[i];
      if ( i == (count-1) )
        fprintf(fph,"  %f %f %f\n]\n",vtx.mPos.x,vtx.mPos.y,vtx.mPos.z);
      else
        fprintf(fph,"  %f %f %f,\n",vtx.mPos.x,vtx.mPos.y,vtx.mPos.z);
    }
    fprintf(fph,"   }\n");
  }
  if ( 1 )
  {
    fprintf(fph,"  TextureCoordinate2 {\npoint [\n");
    int count = mVtxs.size();

    for (int i=0; i<count; i++)
    {
      const LightMapVertex &vtx = mVtxs[i];

      if ( !tex1 ) // if saving second U/V channel.
      {
        if ( i == (count-1) )
          fprintf(fph,"  %f %f\n]\n",vtx.mTexel2.x,1.0f-vtx.mTexel2.y);
        else
          fprintf(fph,"  %f %f,\n",vtx.mTexel2.x,1.0f-vtx.mTexel2.y);
      }
      else
      {
        if ( i == (count-1) )
          fprintf(fph,"  %f %f\n]\n",vtx.mTexel1.x,1.0f-vtx.mTexel1.y);
        else
          fprintf(fph,"  %f %f,\n",vtx.mTexel1.x,1.0f-vtx.mTexel1.y);
      }
    }

    fprintf(fph,"   }\n");
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %edx, -0x34(%rbp)
movq %rsi, %rcx
movq %rdi, %rbx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movq %rax, -0x30(%rbp)
leaq 0x39ff(%rip), %rdi      # 0x13a29
movl $0x18, %esi
movl $0x1, %edx
movq %rcx, %r15
callq 0x2410
movq 0x38(%rbx), %r12
movq %rbx, -0x40(%rbp)
subq 0x30(%rbx), %r12
sarq $0x3, %r12
movabsq $-0x3333333333333333, %rax # imm = 0xCCCCCCCCCCCCCCCD
imulq %rax, %r12
testl %r12d, %r12d
jle 0x100c7
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
leal (%r12,%rax), %r13d
andl $0x7fffffff, %r12d      # imm = 0x7FFFFFFF
movl $0x8, %r14d
xorl %ebx, %ebx
movq -0x40(%rbp), %rax
movq 0x30(%rax), %rax
xorps %xmm0, %xmm0
cvtss2sd -0x8(%rax,%r14), %xmm0
xorps %xmm1, %xmm1
cvtss2sd -0x4(%rax,%r14), %xmm1
xorps %xmm2, %xmm2
cvtss2sd (%rax,%r14), %xmm2
cmpq %rbx, %r13
leaq 0x39aa(%rip), %rsi      # 0x13a50
leaq 0x3995(%rip), %rax      # 0x13a42
cmoveq %rax, %rsi
movq %r15, %rdi
movb $0x3, %al
callq 0x2300
incq %rbx
addq $0x28, %r14
cmpq %rbx, %r12
jne 0x10077
leaq 0x398f(%rip), %rdi      # 0x13a5d
movl $0x5, %esi
movl $0x1, %edx
movq %r15, %rbx
movq %r15, %rcx
callq 0x2410
leaq 0x3979(%rip), %rdi      # 0x13a63
movl $0x1f, %esi
movl $0x1, %edx
movq %r15, %rcx
callq 0x2410
movq -0x40(%rbp), %r15
movq 0x38(%r15), %r13
subq 0x30(%r15), %r13
sarq $0x3, %r13
movabsq $-0x3333333333333333, %rax # imm = 0xCCCCCCCCCCCCCCCD
imulq %rax, %r13
testl %r13d, %r13d
jle 0x101ae
movq -0x30(%rbp), %rax
addl %r13d, %eax
movq %rax, -0x30(%rbp)
andl $0x7fffffff, %r13d      # imm = 0x7FFFFFFF
movl $0x18, %r14d
xorl %r12d, %r12d
movq 0x30(%r15), %rax
cmpb $0x0, -0x34(%rbp)
je 0x10163
xorps %xmm0, %xmm0
cvtss2sd -0xc(%rax,%r14), %xmm0
movss 0x3646(%rip), %xmm1     # 0x137a0
subss -0x8(%rax,%r14), %xmm1
jmp 0x1017b
xorps %xmm0, %xmm0
cvtss2sd -0x4(%rax,%r14), %xmm0
movss 0x362b(%rip), %xmm1     # 0x137a0
subss (%rax,%r14), %xmm1
cvtss2sd %xmm1, %xmm1
cmpq %r12, -0x30(%rbp)
jne 0x10191
movq %rbx, %rdi
leaq 0x38f4(%rip), %rsi      # 0x13a83
jmp 0x1019b
movq %rbx, %rdi
leaq 0x38f3(%rip), %rsi      # 0x13a8e
movb $0x2, %al
callq 0x2300
incq %r12
addq $0x28, %r14
cmpq %r12, %r13
jne 0x1013e
leaq 0x38a8(%rip), %rdi      # 0x13a5d
movl $0x5, %esi
movl $0x1, %edx
movq %rbx, %rcx
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2410