// File: /workspace/github_c_makefile_star2_O0/vlenhart[P]q3bsp/vformat.cpp
// Function: VertexSection::SaveVRML(_IO_FILE*, bool)
void VertexSection::SaveVRML(FILE *fph,bool tex1)
{
  // save it into a VRML file!
  static int itemcount=1;

  fprintf(fph,"DEF item%d Separator {\n",itemcount++);
  fprintf(fph,"Translation { translation 0 0 0 }\n");
  fprintf(fph,"Material {\n");
  fprintf(fph,"  ambientColor 0.1791 0.06536 0.06536\n");
  fprintf(fph,"  diffuseColor 0.5373 0.1961 0.1961\n");
  fprintf(fph,"  specularColor 0.9 0.9 0.9\n");
  fprintf(fph,"  shininess 0.25\n");
  fprintf(fph,"  transparency 0\n");
  fprintf(fph,"}\n");
  fprintf(fph,"Texture2 {\n");


  const char *foo = mName;
  char scratch[256];

  if ( !tex1 )
  {
    while ( *foo && *foo != '+' ) foo++;
    char *dest = scratch;
    if ( *foo == '+' )
    {
      foo++;
      while ( *foo ) *dest++ = *foo++;
    }
    *dest = 0;
  }
  else
  {
    char *dest = scratch;
    while ( *foo && *foo != '+' ) *dest++ = *foo++;
    *dest = 0;
  }

  if ( tex1 )
    fprintf(fph,"  filename %c%s.tga%c\n",0x22,scratch,0x22);
  else
    fprintf(fph,"  filename %c%s.bmp%c\n",0x22,scratch,0x22);

  fprintf(fph,"}\n");

  mPoints.SaveVRML(fph,tex1);

  int tcount = mIndices.size()/3;

  if ( 1 )
  {
    fprintf(fph,"  IndexedFaceSet {\ncoordIndex [\n");
    UShortVector::iterator j= mIndices.begin();
    for (int i=0; i<tcount; i++)
    {
      int i1 = *j;
      j++;
      int i2 = *j;
      j++;
      int i3 = *j;
      j++;
      if ( i == (tcount-1) )
        fprintf(fph,"  %d, %d, %d, -1]\n",i1,i2,i3);
      else
        fprintf(fph,"  %d, %d, %d, -1,\n",i1,i2,i3);
    }
  }

  if ( 1 )
  {
    fprintf(fph,"  textureCoordIndex [\n");
    UShortVector::iterator j= mIndices.begin();
    for (int i=0; i<tcount; i++)
    {
      int i1 = *j;
      j++;
      int i2 = *j;
      j++;
      int i3 = *j;
      j++;
      if ( i == (tcount-1) )
        fprintf(fph,"  %d, %d, %d, -1]\n",i1,i2,i3);
      else
        fprintf(fph,"  %d, %d, %d, -1,\n",i1,i2,i3);
    }
  }
  fprintf(fph,"  }\n");
  fprintf(fph,"}\n");
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1c0, %rsp            # imm = 0x1C0
movb %dl, %al
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
andb $0x1, %al
movb %al, -0x11(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x1b0(%rbp)
movq -0x10(%rbp), %rdi
movl 0x199b9(%rip), %edx     # 0x3d408
movl %edx, %eax
addl $0x1, %eax
movl %eax, 0x199ae(%rip)     # 0x3d408
leaq 0x6e73(%rip), %rsi      # 0x2a8d4
movb $0x0, %al
callq 0x3430
movq -0x10(%rbp), %rdi
leaq 0x6e79(%rip), %rsi      # 0x2a8ec
movb $0x0, %al
callq 0x3430
movq -0x10(%rbp), %rdi
leaq 0x7105(%rip), %rsi      # 0x2ab8a
movb $0x0, %al
callq 0x3430
movq -0x10(%rbp), %rdi
leaq 0x6e78(%rip), %rsi      # 0x2a90f
movb $0x0, %al
callq 0x3430
movq -0x10(%rbp), %rdi
leaq 0x6e8d(%rip), %rsi      # 0x2a936
movb $0x0, %al
callq 0x3430
movq -0x10(%rbp), %rdi
leaq 0x6ea0(%rip), %rsi      # 0x2a95b
movb $0x0, %al
callq 0x3430
movq -0x10(%rbp), %rdi
leaq 0x6eab(%rip), %rsi      # 0x2a978
movb $0x0, %al
callq 0x3430
movq -0x10(%rbp), %rdi
leaq 0x6eab(%rip), %rsi      # 0x2a98a
movb $0x0, %al
callq 0x3430
movq -0x10(%rbp), %rdi
leaq 0x7308(%rip), %rsi      # 0x2adf9
movb $0x0, %al
callq 0x3430
movq -0x10(%rbp), %rdi
leaq 0x6e99(%rip), %rsi      # 0x2a99c
movb $0x0, %al
callq 0x3430
movq -0x1b0(%rbp), %rdi
callq 0xdce0
movq %rax, -0x20(%rbp)
testb $0x1, -0x11(%rbp)
jne 0x23bcb
jmp 0x23b26
movq -0x20(%rbp), %rcx
xorl %eax, %eax
cmpb $0x0, (%rcx)
movb %al, -0x1b1(%rbp)
je 0x23b4a
movq -0x20(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2b, %eax
setne %al
movb %al, -0x1b1(%rbp)
movb -0x1b1(%rbp), %al
testb $0x1, %al
jne 0x23b56
jmp 0x23b64
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0x23b26
leaq -0x120(%rbp), %rax
movq %rax, -0x128(%rbp)
movq -0x20(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2b, %eax
jne 0x23bbf
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
cmpb $0x0, (%rax)
je 0x23bbd
movq -0x20(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x20(%rbp)
movb (%rax), %cl
movq -0x128(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x128(%rbp)
movb %cl, (%rax)
jmp 0x23b8a
jmp 0x23bbf
movq -0x128(%rbp), %rax
movb $0x0, (%rax)
jmp 0x23c3d
leaq -0x120(%rbp), %rax
movq %rax, -0x130(%rbp)
movq -0x20(%rbp), %rcx
xorl %eax, %eax
cmpb $0x0, (%rcx)
movb %al, -0x1b2(%rbp)
je 0x23bfd
movq -0x20(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2b, %eax
setne %al
movb %al, -0x1b2(%rbp)
movb -0x1b2(%rbp), %al
testb $0x1, %al
jne 0x23c09
jmp 0x23c33
movq -0x20(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x20(%rbp)
movb (%rax), %cl
movq -0x130(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x130(%rbp)
movb %cl, (%rax)
jmp 0x23bd9
movq -0x130(%rbp), %rax
movb $0x0, (%rax)
testb $0x1, -0x11(%rbp)
je 0x23c67
movq -0x10(%rbp), %rdi
leaq -0x120(%rbp), %rcx
leaq 0x6d53(%rip), %rsi      # 0x2a9a8
movl $0x22, %r8d
movl %r8d, %edx
movb $0x0, %al
callq 0x3430
jmp 0x23c89
movq -0x10(%rbp), %rdi
leaq -0x120(%rbp), %rcx
leaq 0x6d46(%rip), %rsi      # 0x2a9bf
movl $0x22, %r8d
movl %r8d, %edx
movb $0x0, %al
callq 0x3430
movq -0x10(%rbp), %rdi
leaq 0x7165(%rip), %rsi      # 0x2adf9
movb $0x0, %al
callq 0x3430
movq -0x1b0(%rbp), %rdi
addq $0x38, %rdi
movq -0x10(%rbp), %rsi
movb -0x11(%rbp), %al
andb $0x1, %al
movzbl %al, %edx
callq 0x23f80
movq -0x1b0(%rbp), %rdi
addq $0x20, %rdi
callq 0x196e0
movl $0x3, %ecx
xorl %edx, %edx
divq %rcx
movl %eax, -0x134(%rbp)
movq -0x10(%rbp), %rdi
leaq 0x6cf4(%rip), %rsi      # 0x2a9d6
movb $0x0, %al
callq 0x3430
movq -0x1b0(%rbp), %rdi
addq $0x20, %rdi
callq 0x19d00
movq %rax, -0x140(%rbp)
movl $0x0, -0x144(%rbp)
movl -0x144(%rbp), %eax
cmpl -0x134(%rbp), %eax
jge 0x23e0f
leaq -0x140(%rbp), %rdi
callq 0x25030
movzwl (%rax), %eax
movl %eax, -0x148(%rbp)
leaq -0x140(%rbp), %rdi
xorl %esi, %esi
callq 0x25050
movq %rax, -0x150(%rbp)
leaq -0x140(%rbp), %rdi
callq 0x25030
movzwl (%rax), %eax
movl %eax, -0x154(%rbp)
leaq -0x140(%rbp), %rdi
xorl %esi, %esi
callq 0x25050
movq %rax, -0x160(%rbp)
leaq -0x140(%rbp), %rdi
callq 0x25030
movzwl (%rax), %eax
movl %eax, -0x164(%rbp)
leaq -0x140(%rbp), %rdi
xorl %esi, %esi
callq 0x25050
movq %rax, -0x170(%rbp)
movl -0x144(%rbp), %eax
movl -0x134(%rbp), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jne 0x23dd4
movq -0x10(%rbp), %rdi
movl -0x148(%rbp), %edx
movl -0x154(%rbp), %ecx
movl -0x164(%rbp), %r8d
leaq 0x6c2c(%rip), %rsi      # 0x2a9f7
movb $0x0, %al
callq 0x3430
jmp 0x23df9
movq -0x10(%rbp), %rdi
movl -0x148(%rbp), %edx
movl -0x154(%rbp), %ecx
movl -0x164(%rbp), %r8d
leaq 0x6c18(%rip), %rsi      # 0x2aa0a
movb $0x0, %al
callq 0x3430
jmp 0x23dfb
movl -0x144(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x144(%rbp)
jmp 0x23d0a
movq -0x10(%rbp), %rdi
leaq 0x6c03(%rip), %rsi      # 0x2aa1d
movb $0x0, %al
callq 0x3430
movq -0x1b0(%rbp), %rdi
addq $0x20, %rdi
callq 0x19d00
movq %rax, -0x178(%rbp)
movl $0x0, -0x17c(%rbp)
movl -0x17c(%rbp), %eax
cmpl -0x134(%rbp), %eax
jge 0x23f47
leaq -0x178(%rbp), %rdi
callq 0x25030
movzwl (%rax), %eax
movl %eax, -0x180(%rbp)
leaq -0x178(%rbp), %rdi
xorl %esi, %esi
callq 0x25050
movq %rax, -0x188(%rbp)
leaq -0x178(%rbp), %rdi
callq 0x25030
movzwl (%rax), %eax
movl %eax, -0x18c(%rbp)
leaq -0x178(%rbp), %rdi
xorl %esi, %esi
callq 0x25050
movq %rax, -0x198(%rbp)
leaq -0x178(%rbp), %rdi
callq 0x25030
movzwl (%rax), %eax
movl %eax, -0x19c(%rbp)
leaq -0x178(%rbp), %rdi
xorl %esi, %esi
callq 0x25050
movq %rax, -0x1a8(%rbp)
movl -0x17c(%rbp), %eax
movl -0x134(%rbp), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jne 0x23f0c
movq -0x10(%rbp), %rdi
movl -0x180(%rbp), %edx
movl -0x18c(%rbp), %ecx
movl -0x19c(%rbp), %r8d
leaq 0x6af4(%rip), %rsi      # 0x2a9f7
movb $0x0, %al
callq 0x3430
jmp 0x23f31
movq -0x10(%rbp), %rdi
movl -0x180(%rbp), %edx
movl -0x18c(%rbp), %ecx
movl -0x19c(%rbp), %r8d
leaq 0x6ae0(%rip), %rsi      # 0x2aa0a
movb $0x0, %al
callq 0x3430
jmp 0x23f33
movl -0x17c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x17c(%rbp)
jmp 0x23e42
movq -0x10(%rbp), %rdi
leaq 0x6b17(%rip), %rsi      # 0x2aa69
movb $0x0, %al
callq 0x3430
movq -0x10(%rbp), %rdi
leaq 0x6e95(%rip), %rsi      # 0x2adf9
movb $0x0, %al
callq 0x3430
addq $0x1c0, %rsp            # imm = 0x1C0
popq %rbp
retq
nopw %cs:(%rax,%rax)