// File: /workspace/github_c_makefile_star2_O2/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
pushq %rax
movl %edx, -0x2c(%rbp)
movq %rsi, %rbx
movq %rdi, %r15
movl $0xffffffff, %r14d      # imm = 0xFFFFFFFF
leaq 0x302f(%rip), %rdi      # 0x11a3d
pushq $0x18
popq %rsi
pushq $0x1
popq %rdx
movq %rbx, %rcx
callq 0x2440
movq 0x38(%r15), %rax
subq 0x30(%r15), %rax
pushq $0x28
popq %rcx
cqto
idivq %rcx
leal (%r14,%rax), %ecx
xorl %r12d, %r12d
testl %eax, %eax
cmovlel %r12d, %eax
imulq $0x28, %rax, %r13
imulq $0x28, %rcx, %r14
cmpq %r12, %r13
je 0xea83
movq 0x30(%r15), %rax
cvtss2sd (%rax,%r12), %xmm0
cvtss2sd 0x4(%rax,%r12), %xmm1
cvtss2sd 0x8(%rax,%r12), %xmm2
cmpq %r12, %r14
leaq 0x2ffc(%rip), %rsi      # 0x11a64
leaq 0x2fe7(%rip), %rax      # 0x11a56
cmoveq %rax, %rsi
movq %rbx, %rdi
movb $0x3, %al
callq 0x2330
addq $0x28, %r12
jmp 0xea41
leaq 0x2fe7(%rip), %rdi      # 0x11a71
pushq $0x5
popq %rsi
pushq $0x1
popq %r12
movq %r12, %rdx
movq %rbx, %rcx
callq 0x2440
leaq 0x2fd4(%rip), %rdi      # 0x11a77
pushq $0x1f
popq %rsi
movq %r12, %rdx
movq %rbx, %rcx
callq 0x2440
movq 0x38(%r15), %rax
subq 0x30(%r15), %rax
cqto
pushq $0x28
popq %rcx
idivq %rcx
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
addl %eax, %ecx
xorl %r12d, %r12d
testl %eax, %eax
cmovlel %r12d, %eax
imulq $0x28, %rax, %r13
imulq $0x28, %rcx, %r14
cmpq %r12, %r13
je 0xeb3f
movq 0x30(%r15), %rax
cmpb $0x0, -0x2c(%rbp)
je 0xeb00
cvtss2sd 0xc(%rax,%r12), %xmm0
movss 0x2cbd(%rip), %xmm1     # 0x117b4
subss 0x10(%rax,%r12), %xmm1
jmp 0xeb16
cvtss2sd 0x14(%rax,%r12), %xmm0
movss 0x2ca5(%rip), %xmm1     # 0x117b4
subss 0x18(%rax,%r12), %xmm1
cvtss2sd %xmm1, %xmm1
movq %rbx, %rdi
cmpq %r12, %r14
jne 0xeb2b
leaq 0x2f6e(%rip), %rsi      # 0x11a97
jmp 0xeb32
leaq 0x2f70(%rip), %rsi      # 0x11aa2
movb $0x2, %al
callq 0x2330
addq $0x28, %r12
jmp 0xead9
leaq 0x2f2b(%rip), %rdi      # 0x11a71
pushq $0x5
popq %rsi
pushq $0x1
popq %rdx
movq %rbx, %rcx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2440