// File: /workspace/github_c_makefile_star2_O1/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 0x3961(%rip), %rdi      # 0x13a4d
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 0x10189
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 0x390c(%rip), %rsi      # 0x13a74
leaq 0x38f7(%rip), %rax      # 0x13a66
cmoveq %rax, %rsi
movq %r15, %rdi
movb $0x3, %al
callq 0x2300
incq %rbx
addq $0x28, %r14
cmpq %rbx, %r12
jne 0x10139
leaq 0x38f1(%rip), %rdi      # 0x13a81
movl $0x5, %esi
movl $0x1, %edx
movq %r15, %rbx
movq %r15, %rcx
callq 0x2410
leaq 0x38db(%rip), %rdi      # 0x13a87
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 0x10270
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 0x10225
xorps %xmm0, %xmm0
cvtss2sd -0xc(%rax,%r14), %xmm0
movss 0x35a8(%rip), %xmm1     # 0x137c4
subss -0x8(%rax,%r14), %xmm1
jmp 0x1023d
xorps %xmm0, %xmm0
cvtss2sd -0x4(%rax,%r14), %xmm0
movss 0x358d(%rip), %xmm1     # 0x137c4
subss (%rax,%r14), %xmm1
cvtss2sd %xmm1, %xmm1
cmpq %r12, -0x30(%rbp)
jne 0x10253
movq %rbx, %rdi
leaq 0x3856(%rip), %rsi      # 0x13aa7
jmp 0x1025d
movq %rbx, %rdi
leaq 0x3855(%rip), %rsi      # 0x13ab2
movb $0x2, %al
callq 0x2300
incq %r12
addq $0x28, %r14
cmpq %r12, %r13
jne 0x10200
leaq 0x380a(%rip), %rdi      # 0x13a81
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