// File: /workspace/github_c_makefile_star2_O0/vlenhart[P]q3bsp/vformat.cpp
// Function: VertexSection::SaveVRML2(_IO_FILE*, VFormatOptions&)
void VertexSection::SaveVRML2(FILE *fph,VFormatOptions &options)
{

  static int itemcount=1;

  bool hasLightMap = true;
  int numStages=2;
  int lightMapStage = 0; // place lightmap coord into this texture stage 
  bool vertexColor = true;

  //lightMapStage=1;

  // name of lightmap texture 
  StringRef lightMap;


  // parse mName into base texture + light map

  const char *foo = mName;
  char scratch[256];

  char *dest = scratch;
  while ( *foo && *foo != '+' ) *dest++ = *foo++;
  if (*foo == '+' && foo[1]) {
	  lightMap = foo+1;
	  hasLightMap = true;
  }	
  else  { 
	  hasLightMap = false;
	  numStages = 1;
	  lightMapStage = -1;
  }	
  *dest = 0;

  StringRef name(scratch);

  if (mShader) {
	  numStages =mShader->GetNumStages();
	  if (mShader->mNoLightMap) {
		  hasLightMap = false;
		  lightMapStage = -1;
	  }	else {
		  lightMapStage=mShader->mLightMapStage;
	  }	
	 //if (rgbGen == Identity)
	 //	 vertexColor = false;
  }	else {

  }	

  //fprintf(fph,"DEF item%d Shape {\n",itemcount++);
  fprintf(fph,"Shape {\n");
  fprintf(fph,"appearance ");


  // appearance node already defined ?
  AppearanceDefMap::iterator found;
  found = options.appearanceDefMap.find(mName);
  if ( found != options.appearanceDefMap.end()) { // simply use it 
	  //found.r
	  fprintf(fph,"USE %s\n",(const char *)(*found).second);
  } 
  else 
  {  // need to define new Appearance node 
	  if (options.verbose) {
		fprintf(fph," #%s\n",(const char *) mName);
		if (mShader) {
			  fprintf(fph," #shader %s\n",(const char *) mShader->GetName());
		}		
	  }	
	  
	  fprintf(fph,"DEF A%d Appearance {\n",options.appearanceCount);
	  char buf[60];
	  sprintf(buf,"_A%d",options.appearanceCount);

	  // insert new node into map 
	  options.textureDefMap.insert(AppearanceDefMap::value_type(StringRef(mName),StringRef(buf)));
	  
	  options.appearanceCount++;
		  
		  if (options.useLighting) {
			  fprintf(fph,"material Material {\n");
			  fprintf(fph,"  ambientIntensity 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");
		  }
		  else {  
		  if (options.useMat) {
			  if (!options.matDefined) {
				fprintf(fph,"material DEF MAT Material {\n");
				//fprintf(fph,"  diffuseColor 0 0 0\n");
				fprintf(fph,"  diffuseColor 1 1 1\n");
				//fprintf(fph,"  emissiveColor 0.5 0.5 0.5\n"); // overall brightness 
				fprintf(fph,"  emissiveColor 0.2 0.2 0.2\n"); // overall brightness 
				fprintf(fph,"}\n");
				options.matDefined = true;
			  } else 	
				fprintf(fph,"material USE MAT \n");

		  }
		  }
		  
		  
		  fprintf(fph,"texture ");
		  
		  bool tex1 = options.tex1;
		
		  
		  if (options.useMultiTexturing) {
			  fprintf(fph,"MultiTexture {\nmaterialColor TRUE texture [\n");
			  tex1 = true;
		
		  if (mShader) {
		    hasLightMap = false;
			numStages =mShader->GetNumStages();
			for (int i=0; i<numStages; i++) {
				
				//if (i>0 && numStages >2) // we can do only 2 stages 
				//	i=numStages-1;

				const ShaderStage& stage = mShader->GetStage(i);

				if (stage.isAnimMap) {
					if (options.useEffects) {
						fprintf(fph,"DEF MAP AnimMap {\nfrequency %f textures [\n",stage.animMapFrequency);
						for (unsigned int i=0; i<stage.animMap.size(); i++)
							WriteImageTexture(fph,stage.animMap[i],options,false,stage.clamp);

						//fprintf(fph,"] ROUTE TIMER.fraction_changed TO MAP.set_fraction \n");
					    fprintf(fph,"]ROUTE TIMER.time_changed TO MAP.set_time\n");

						fprintf(fph,"}");
					}else
						WriteImageTexture(fph,stage.animMap[0],options,false,stage.clamp);


				} else 
				if (stage.isLightMap) {
					WriteImageTexture(fph,lightMap,options,true,stage.clamp);
					hasLightMap = true;
					mShader->mLightMapStage=lightMapStage=i;
				} else 
					WriteImageTexture(fph,stage.map,options,false,stage.clamp);
			}
		  }	
		  else 
		  { // no shader
			//WriteImageTexture(fph,name,options,false);
			if (options.useMultiTexturing) {
				if (hasLightMap) {
					WriteImageTexture(fph,lightMap,options,true,false);
				}
			}
			WriteImageTexture(fph,name,options,false);

		  }	
		  } 
		  else {
			  // not useMultiTexturing
			  if (tex1) {
					if (mShader) 
					    mShader ->GetBaseTexture(name);

					WriteImageTexture(fph,name,options,false);

			  } else {	
				if (hasLightMap) {
					WriteImageTexture(fph,lightMap,options,true,false);
				}
				else WriteImageTexture(fph,"nomap",options,true,false);
			  }	

		  }	
		  if (options.useMultiTexturing) {
			  fprintf(fph,"]");
			  // add makes it to bright
			  // with modulate currently to dark
			  //if (numStages>1) 
			  if (mShader) {
				fprintf(fph,"mode [ ");
				bool hasTcMod = false;

				for (int i=0; i<numStages; i++) {
				
					//if (i>0 && numStages >2) // we can do only 2 stages 
					//	i=numStages-1;
					const ShaderStage& stage = mShader->GetStage(i);
					const char *mode = stage.textureBlendMode;
					
					if (stage.tcmod.length()>0) hasTcMod = true;
					if (stage.tcmodOk.length()>0) hasTcMod = true;

					if (i==0 && stage.textureBlendMode == String("ADD") && !stage.isLightMap)
						mode = "MODULATE";

					if (!mode) {
						if (i==0 && !options.useMat) 
							mode = "REPLACE";
					}	

					fprintf(fph,"\"%s\" ", mode ? mode : "ADD");
					fprintf(fph,"# blend %s %s \n",(const char *) stage.blendFuncSrc,(const char *) stage.blendFuncDst);

				}
				fprintf(fph,"]\n");

				// tcmod 
				if (hasTcMod) {
				fprintf(fph,"textureTransform [ ");

				for (int i=0; i<numStages; i++) {
				
					//if (i>0 && numStages >2) // we can do only 2 stages 
					//	i=numStages-1;
					const ShaderStage& stage = mShader->GetStage(i);
					const char *mode = stage.tcmod.c_str();
					const char *modeOk = stage.tcmodOk.c_str();

					if (stage.tcmod.length()>0 || stage.tcmodOk.length()>0 ) {
					   fprintf(fph,"DEF TC%d TcMod {\n",i);

					   if (stage.tcmodOk.length()>0)
						   fprintf(fph,"\t%s\n", modeOk);

					   if (stage.tcmod.length()>0) 
						   fprintf(fph,"\tmode \"%s\" \n",mode ? mode : "" );

					   //fprintf(fph,"ROUTE TIMER.fraction_changed TO TC%d.set_fraction \n",i);
					   fprintf(fph,"ROUTE TIMER.time_changed TO TC%d.set_time\n",i);
					   fprintf(fph,"}\n");
					}
					else  fprintf(fph,"NULL\n");

				}
				fprintf(fph,"]\n");
				}

			  } 
			  else {
				  if (hasLightMap)
					  fprintf(fph, "%s", options.blendMode);
				  else ; // MODULATE 
			  }					
			  fprintf(fph,"}");
		  }	// multi texture 
		  
		  fprintf(fph,"}\n");
  }	

  int tcount = mIndices.size()/3;

  // write the indexed face set 
  if ( 1 )
  {
    fprintf(fph,"geometry  IndexedFaceSet {\n");

    fprintf(fph,"\tccw FALSE creaseAngle 3.14\n");

	if (mShader && (mShader->mCull == StringRef("none") ||  mShader->mCull == StringRef("disable")))  {
	    fprintf(fph,"\tsolid FALSE\n");
	}
	if (mShader && (mShader->mCull == StringRef("back")))  {
	    fprintf(fph,"\tccw TRUE\n");
	}
    fprintf(fph,"\tcoordIndex [\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,"\t%d,%d,%d,-1]\n",i1,i2,i3);
      else
        fprintf(fph,"\t%d,%d,%d,-1,\n",i1,i2,i3);

    }
  }

  if ( 0 ) // if texCoord index == ccordIndex no need to export
  {
    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,"\t%d,%d,%d,-1]\n",i1,i2,i3);
      else
        fprintf(fph,"\t%d,%d,%d,-1,\n",i1,i2,i3);
    }
  }

  mPoints.SaveVRML2(fph,lightMapStage,options);

  fprintf(fph,"  }\n");
  fprintf(fph,"}\n");
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x3a0, %rsp            # imm = 0x3A0
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x2d8(%rbp)
movb $0x1, -0x19(%rbp)
movl $0x2, -0x20(%rbp)
movl $0x0, -0x24(%rbp)
movb $0x1, -0x25(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x9750
movq -0x2d8(%rbp), %rdi
callq 0xdce0
movq %rax, -0x38(%rbp)
leaq -0x140(%rbp), %rax
movq %rax, -0x148(%rbp)
movq -0x38(%rbp), %rcx
xorl %eax, %eax
cmpb $0x0, (%rcx)
movb %al, -0x2d9(%rbp)
je 0x22843
movq -0x38(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2b, %eax
setne %al
movb %al, -0x2d9(%rbp)
movb -0x2d9(%rbp), %al
testb $0x1, %al
jne 0x2284f
jmp 0x22879
movq -0x38(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x38(%rbp)
movb (%rax), %cl
movq -0x148(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x148(%rbp)
movb %cl, (%rax)
jmp 0x2281f
movq -0x38(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2b, %eax
jne 0x228b9
movq -0x38(%rbp), %rax
cmpb $0x0, 0x1(%rax)
je 0x228b9
movq -0x38(%rbp), %rsi
addq $0x1, %rsi
leaq -0x150(%rbp), %rdi
callq 0x11e90
leaq -0x30(%rbp), %rdi
leaq -0x150(%rbp), %rsi
callq 0xdca0
movb $0x1, -0x19(%rbp)
jmp 0x228cb
movb $0x0, -0x19(%rbp)
movl $0x1, -0x20(%rbp)
movl $0xffffffff, -0x24(%rbp) # imm = 0xFFFFFFFF
movq -0x148(%rbp), %rax
movb $0x0, (%rax)
leaq -0x140(%rbp), %rsi
leaq -0x158(%rbp), %rdi
callq 0x11e90
movq -0x2d8(%rbp), %rax
cmpq $0x0, 0x80(%rax)
je 0x22948
movq -0x2d8(%rbp), %rax
movq 0x80(%rax), %rdi
callq 0x25240
movl %eax, %ecx
movq -0x2d8(%rbp), %rax
movl %ecx, -0x20(%rbp)
movq 0x80(%rax), %rax
testb $0x1, 0x9(%rax)
je 0x22932
movb $0x0, -0x19(%rbp)
movl $0xffffffff, -0x24(%rbp) # imm = 0xFFFFFFFF
jmp 0x22946
movq -0x2d8(%rbp), %rax
movq 0x80(%rax), %rax
movl 0xc(%rax), %eax
movl %eax, -0x24(%rbp)
jmp 0x2294a
jmp 0x2294a
movq -0x10(%rbp), %rdi
leaq 0x81af(%rip), %rsi      # 0x2ab04
movb $0x0, %al
callq 0x3430
movq -0x10(%rbp), %rdi
leaq 0x81a6(%rip), %rsi      # 0x2ab0d
movb $0x0, %al
callq 0x3430
leaq -0x160(%rbp), %rdi
callq 0x250e0
movq -0x2d8(%rbp), %rsi
movq -0x18(%rbp), %rdi
addq $0x30, %rdi
callq 0x25100
movq %rax, -0x168(%rbp)
movq -0x168(%rbp), %rax
movq %rax, -0x160(%rbp)
movq -0x18(%rbp), %rdi
addq $0x30, %rdi
callq 0x25160
movq %rax, -0x170(%rbp)
leaq -0x160(%rbp), %rdi
leaq -0x170(%rbp), %rsi
callq 0x25130
testb $0x1, %al
jne 0x229d0
jmp 0x22a10
movq -0x10(%rbp), %rax
movq %rax, -0x2e8(%rbp)
leaq -0x160(%rbp), %rdi
callq 0x25190
movq %rax, %rdi
addq $0x8, %rdi
callq 0xdce0
movq -0x2e8(%rbp), %rdi
movq %rax, %rdx
leaq 0x809f(%rip), %rsi      # 0x2aaa3
movb $0x0, %al
callq 0x3430
jmp 0x23545
movq -0x18(%rbp), %rax
testb $0x1, 0x69(%rax)
je 0x22a9e
movq -0x2d8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq %rax, -0x2f0(%rbp)
callq 0xdce0
movq -0x2f0(%rbp), %rdi
movq %rax, %rdx
leaq 0x80d3(%rip), %rsi      # 0x2ab19
movb $0x0, %al
callq 0x3430
movq -0x2d8(%rbp), %rax
cmpq $0x0, 0x80(%rax)
je 0x22a9c
movq -0x2d8(%rbp), %rax
movq -0x10(%rbp), %rcx
movq %rcx, -0x2f8(%rbp)
movq 0x80(%rax), %rdi
callq 0x1d140
movq %rax, %rdi
callq 0xdce0
movq -0x2f8(%rbp), %rdi
movq %rax, %rdx
leaq 0x808a(%rip), %rsi      # 0x2ab1f
movb $0x0, %al
callq 0x3430
jmp 0x22a9e
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movl 0x60(%rax), %edx
leaq 0x807c(%rip), %rsi      # 0x2ab2c
movb $0x0, %al
callq 0x3430
leaq -0x1b0(%rbp), %rdi
movq -0x18(%rbp), %rax
movl 0x60(%rax), %edx
leaq 0x8076(%rip), %rsi      # 0x2ab42
movb $0x0, %al
callq 0x30a0
movq -0x2d8(%rbp), %rsi
movq -0x18(%rbp), %rax
movq %rax, -0x300(%rbp)
leaq -0x1c8(%rbp), %rdi
callq 0x12d40
leaq -0x1b0(%rbp), %rsi
leaq -0x1d0(%rbp), %rdi
callq 0x11e90
leaq -0x1c0(%rbp), %rdi
leaq -0x1c8(%rbp), %rsi
leaq -0x1d0(%rbp), %rdx
callq 0x25260
movq -0x300(%rbp), %rdi
leaq -0x1c0(%rbp), %rsi
callq 0x251c0
movq %rax, -0x1e0(%rbp)
movb %dl, -0x1d8(%rbp)
movq -0x18(%rbp), %rax
movl 0x60(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x60(%rax)
movq -0x18(%rbp), %rax
testb $0x1, 0x75(%rax)
je 0x22bc6
movq -0x10(%rbp), %rdi
leaq 0x7fe7(%rip), %rsi      # 0x2ab47
movb $0x0, %al
callq 0x3430
movq -0x10(%rbp), %rdi
leaq 0x7fea(%rip), %rsi      # 0x2ab5c
movb $0x0, %al
callq 0x3430
movq -0x10(%rbp), %rdi
leaq 0x7db2(%rip), %rsi      # 0x2a936
movb $0x0, %al
callq 0x3430
movq -0x10(%rbp), %rdi
leaq 0x7dc5(%rip), %rsi      # 0x2a95b
movb $0x0, %al
callq 0x3430
movq -0x10(%rbp), %rdi
leaq 0x7dd0(%rip), %rsi      # 0x2a978
movb $0x0, %al
callq 0x3430
movq -0x10(%rbp), %rdi
leaq 0x823f(%rip), %rsi      # 0x2adf9
movb $0x0, %al
callq 0x3430
jmp 0x22c48
movq -0x18(%rbp), %rax
testb $0x1, 0x76(%rax)
je 0x22c46
movq -0x18(%rbp), %rax
testb $0x1, 0xb0(%rax)
jne 0x22c32
movq -0x10(%rbp), %rdi
leaq 0x7f91(%rip), %rsi      # 0x2ab79
movb $0x0, %al
callq 0x3430
movq -0x10(%rbp), %rdi
leaq 0x7f9c(%rip), %rsi      # 0x2ab96
movb $0x0, %al
callq 0x3430
movq -0x10(%rbp), %rdi
leaq 0x7fa0(%rip), %rsi      # 0x2abac
movb $0x0, %al
callq 0x3430
movq -0x10(%rbp), %rdi
leaq 0x81db(%rip), %rsi      # 0x2adf9
movb $0x0, %al
callq 0x3430
movq -0x18(%rbp), %rax
movb $0x1, 0xb0(%rax)
jmp 0x22c44
movq -0x10(%rbp), %rdi
leaq 0x7f8c(%rip), %rsi      # 0x2abc9
movb $0x0, %al
callq 0x3430
jmp 0x22c46
jmp 0x22c48
movq -0x10(%rbp), %rdi
leaq 0x7f89(%rip), %rsi      # 0x2abdc
movb $0x0, %al
callq 0x3430
movq -0x18(%rbp), %rax
movb 0x6c(%rax), %al
andb $0x1, %al
movb %al, -0x1e1(%rbp)
movq -0x18(%rbp), %rax
testb $0x1, 0x6a(%rax)
je 0x22f29
movq -0x10(%rbp), %rdi
leaq 0x7f63(%rip), %rsi      # 0x2abe5
movb $0x0, %al
callq 0x3430
movq -0x2d8(%rbp), %rax
movb $0x1, -0x1e1(%rbp)
cmpq $0x0, 0x80(%rax)
je 0x22edf
movq -0x2d8(%rbp), %rax
movb $0x0, -0x19(%rbp)
movq 0x80(%rax), %rdi
callq 0x25240
movl %eax, -0x20(%rbp)
movl $0x0, -0x1e8(%rbp)
movl -0x1e8(%rbp), %eax
cmpl -0x20(%rbp), %eax
jge 0x22edd
movq -0x2d8(%rbp), %rax
movq 0x80(%rax), %rdi
movl -0x1e8(%rbp), %esi
callq 0x252a0
movq %rax, -0x1f0(%rbp)
movq -0x1f0(%rbp), %rax
testb $0x1, 0xa9(%rax)
je 0x22e43
movq -0x18(%rbp), %rax
testb $0x1, 0x77(%rax)
je 0x22df7
movq -0x10(%rbp), %rdi
movq -0x1f0(%rbp), %rax
movss 0x20(%rax), %xmm0
cvtss2sd %xmm0, %xmm0
leaq 0x7edd(%rip), %rsi      # 0x2ac12
movb $0x1, %al
callq 0x3430
movl $0x0, -0x1f4(%rbp)
movl -0x1f4(%rbp), %eax
movq %rax, -0x308(%rbp)
movq -0x1f0(%rbp), %rdi
addq $0x8, %rdi
callq 0x1e7b0
movq %rax, %rcx
movq -0x308(%rbp), %rax
cmpq %rcx, %rax
jae 0x22dd1
movq -0x10(%rbp), %rax
movq %rax, -0x310(%rbp)
movq -0x1f0(%rbp), %rdi
addq $0x8, %rdi
movl -0x1f4(%rbp), %eax
movl %eax, %esi
callq 0x252d0
movq -0x310(%rbp), %rdi
movq %rax, %rsi
movq -0x18(%rbp), %rdx
movq -0x1f0(%rbp), %rax
movb 0xaa(%rax), %al
xorl %ecx, %ecx
andb $0x1, %al
movzbl %al, %r8d
callq 0x24200
movl -0x1f4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1f4(%rbp)
jmp 0x22d46
movq -0x10(%rbp), %rdi
leaq 0x7e61(%rip), %rsi      # 0x2ac3d
movb $0x0, %al
callq 0x3430
movq -0x10(%rbp), %rdi
leaq 0x781d(%rip), %rsi      # 0x2a60b
movb $0x0, %al
callq 0x3430
jmp 0x22e3e
movq -0x10(%rbp), %rax
movq %rax, -0x318(%rbp)
movq -0x1f0(%rbp), %rdi
addq $0x8, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x252d0
movq -0x318(%rbp), %rdi
movq %rax, %rsi
movq -0x18(%rbp), %rdx
movq -0x1f0(%rbp), %rax
movb 0xaa(%rax), %al
xorl %ecx, %ecx
andb $0x1, %al
movzbl %al, %r8d
callq 0x24200
jmp 0x22ec7
movq -0x1f0(%rbp), %rax
testb $0x1, 0xa8(%rax)
je 0x22e9c
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rdx
movq -0x1f0(%rbp), %rax
movb 0xaa(%rax), %al
leaq -0x30(%rbp), %rsi
movl $0x1, %ecx
andb $0x1, %al
movzbl %al, %r8d
callq 0x24200
movq -0x2d8(%rbp), %rax
movb $0x1, -0x19(%rbp)
movl -0x1e8(%rbp), %ecx
movl %ecx, -0x24(%rbp)
movq 0x80(%rax), %rax
movl %ecx, 0xc(%rax)
jmp 0x22ec5
movq -0x10(%rbp), %rdi
movq -0x1f0(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x1f0(%rbp), %rax
movb 0xaa(%rax), %al
xorl %ecx, %ecx
andb $0x1, %al
movzbl %al, %r8d
callq 0x24200
jmp 0x22ec7
jmp 0x22ec9
movl -0x1e8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1e8(%rbp)
jmp 0x22cc9
jmp 0x22f24
movq -0x18(%rbp), %rax
testb $0x1, 0x6a(%rax)
je 0x22f0a
testb $0x1, -0x19(%rbp)
je 0x22f08
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rdx
leaq -0x30(%rbp), %rsi
movl $0x1, %ecx
xorl %r8d, %r8d
callq 0x24200
jmp 0x22f0a
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rdx
leaq -0x158(%rbp), %rsi
xorl %r8d, %r8d
movl %r8d, %ecx
callq 0x24200
jmp 0x22fdb
testb $0x1, -0x1e1(%rbp)
je 0x22f79
movq -0x2d8(%rbp), %rax
cmpq $0x0, 0x80(%rax)
je 0x22f5d
movq -0x2d8(%rbp), %rax
movq 0x80(%rax), %rdi
leaq -0x158(%rbp), %rsi
callq 0x252f0
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rdx
leaq -0x158(%rbp), %rsi
xorl %r8d, %r8d
movl %r8d, %ecx
callq 0x24200
jmp 0x22fd9
testb $0x1, -0x19(%rbp)
je 0x22f9a
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rdx
leaq -0x30(%rbp), %rsi
movl $0x1, %ecx
xorl %r8d, %r8d
callq 0x24200
jmp 0x22fd7
movq -0x10(%rbp), %rax
movq %rax, -0x320(%rbp)
leaq -0x200(%rbp), %rdi
leaq 0x7cb5(%rip), %rsi      # 0x2ac68
callq 0x11e90
movq -0x320(%rbp), %rdi
movq -0x18(%rbp), %rdx
leaq -0x200(%rbp), %rsi
movl $0x1, %ecx
xorl %r8d, %r8d
callq 0x24200
jmp 0x22fd9
jmp 0x22fdb
movq -0x18(%rbp), %rax
testb $0x1, 0x6a(%rax)
je 0x23533
movq -0x10(%rbp), %rdi
leaq 0x6a6e(%rip), %rsi      # 0x29a62
movb $0x0, %al
callq 0x3430
movq -0x2d8(%rbp), %rax
cmpq $0x0, 0x80(%rax)
je 0x234f8
movq -0x10(%rbp), %rdi
leaq 0x7c53(%rip), %rsi      # 0x2ac6e
movb $0x0, %al
callq 0x3430
movb $0x0, -0x201(%rbp)
movl $0x0, -0x208(%rbp)
movl -0x208(%rbp), %eax
cmpl -0x20(%rbp), %eax
jge 0x2331a
movq -0x2d8(%rbp), %rax
movq 0x80(%rax), %rdi
movl -0x208(%rbp), %esi
callq 0x252a0
movq %rax, -0x210(%rbp)
movq -0x210(%rbp), %rdi
addq $0xb0, %rdi
callq 0xdce0
movq %rax, -0x218(%rbp)
movq -0x210(%rbp), %rdi
addq $0x68, %rdi
callq 0x3470
cmpq $0x0, %rax
jbe 0x23099
movb $0x1, -0x201(%rbp)
movq -0x210(%rbp), %rdi
addq $0x48, %rdi
callq 0x3470
cmpq $0x0, %rax
jbe 0x230b6
movb $0x1, -0x201(%rbp)
movl -0x208(%rbp), %ecx
movb $0x0, -0x242(%rbp)
movb $0x0, -0x255(%rbp)
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0x321(%rbp)
jne 0x23186
movq -0x210(%rbp), %rax
addq $0xb0, %rax
movq %rax, -0x338(%rbp)
leaq -0x241(%rbp), %rdi
movq %rdi, -0x330(%rbp)
callq 0x3500
movq -0x330(%rbp), %rdx
movb $0x1, -0x242(%rbp)
leaq 0x760f(%rip), %rsi      # 0x2a726
leaq -0x240(%rbp), %rdi
callq 0x92b0
jmp 0x23125
movb $0x1, -0x255(%rbp)
leaq -0x220(%rbp), %rdi
leaq -0x240(%rbp), %rsi
callq 0x1d340
jmp 0x23141
movq -0x338(%rbp), %rdi
leaq -0x220(%rbp), %rsi
callq 0x24c10
movb %al, -0x339(%rbp)
jmp 0x2315c
movb -0x339(%rbp), %cl
xorl %eax, %eax
testb $0x1, %cl
movb %al, -0x321(%rbp)
jne 0x23171
jmp 0x23186
movq -0x210(%rbp), %rax
movb 0xa8(%rax), %al
xorb $-0x1, %al
movb %al, -0x321(%rbp)
movb -0x321(%rbp), %al
movb %al, -0x33a(%rbp)
testb $0x1, -0x255(%rbp)
jne 0x2319d
jmp 0x231a9
leaq -0x240(%rbp), %rdi
callq 0x3180
testb $0x1, -0x242(%rbp)
jne 0x231b4
jmp 0x231c0
leaq -0x241(%rbp), %rdi
callq 0x32e0
movb -0x33a(%rbp), %al
testb $0x1, %al
jne 0x231cc
jmp 0x23237
leaq 0x68da(%rip), %rax      # 0x29aad
movq %rax, -0x218(%rbp)
jmp 0x23237
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x250(%rbp)
movl %eax, -0x254(%rbp)
jmp 0x2321b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x250(%rbp)
movl %eax, -0x254(%rbp)
testb $0x1, -0x255(%rbp)
jne 0x2320d
jmp 0x23219
leaq -0x240(%rbp), %rdi
callq 0x3180
jmp 0x2321b
testb $0x1, -0x242(%rbp)
jne 0x23226
jmp 0x23232
leaq -0x241(%rbp), %rdi
callq 0x32e0
jmp 0x23853
cmpq $0x0, -0x218(%rbp)
jne 0x23264
cmpl $0x0, -0x208(%rbp)
jne 0x23262
movq -0x18(%rbp), %rax
testb $0x1, 0x76(%rax)
jne 0x23262
leaq 0x74c3(%rip), %rax      # 0x2a71e
movq %rax, -0x218(%rbp)
jmp 0x23264
movq -0x10(%rbp), %rax
movq %rax, -0x348(%rbp)
cmpq $0x0, -0x218(%rbp)
je 0x23289
movq -0x218(%rbp), %rax
movq %rax, -0x350(%rbp)
jmp 0x23299
leaq 0x7496(%rip), %rax      # 0x2a726
movq %rax, -0x350(%rbp)
jmp 0x23299
movq -0x348(%rbp), %rdi
movq -0x350(%rbp), %rdx
leaq 0x79c8(%rip), %rsi      # 0x2ac76
movb $0x0, %al
callq 0x3430
movq -0x10(%rbp), %rax
movq %rax, -0x360(%rbp)
movq -0x210(%rbp), %rdi
addq $0x28, %rdi
callq 0xdce0
movq %rax, -0x358(%rbp)
movq -0x210(%rbp), %rdi
addq $0x30, %rdi
callq 0xdce0
movq -0x360(%rbp), %rdi
movq -0x358(%rbp), %rdx
movq %rax, %rcx
leaq 0x797d(%rip), %rsi      # 0x2ac7c
movb $0x0, %al
callq 0x3430
movl -0x208(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x208(%rbp)
jmp 0x23033
movq -0x10(%rbp), %rdi
leaq 0x7771(%rip), %rsi      # 0x2aa96
movb $0x0, %al
callq 0x3430
testb $0x1, -0x201(%rbp)
je 0x234f6
movq -0x10(%rbp), %rdi
leaq 0x7948(%rip), %rsi      # 0x2ac8c
movb $0x0, %al
callq 0x3430
movl $0x0, -0x25c(%rbp)
movl -0x25c(%rbp), %eax
cmpl -0x20(%rbp), %eax
jge 0x234e4
movq -0x2d8(%rbp), %rax
movq 0x80(%rax), %rdi
movl -0x25c(%rbp), %esi
callq 0x252a0
movq %rax, -0x268(%rbp)
movq -0x268(%rbp), %rdi
addq $0x68, %rdi
callq 0x3130
movq %rax, -0x270(%rbp)
movq -0x268(%rbp), %rdi
addq $0x48, %rdi
callq 0x3130
movq %rax, -0x278(%rbp)
movq -0x268(%rbp), %rdi
addq $0x68, %rdi
callq 0x3470
cmpq $0x0, %rax
ja 0x233e2
movq -0x268(%rbp), %rdi
addq $0x48, %rdi
callq 0x3470
cmpq $0x0, %rax
jbe 0x234bc
movq -0x10(%rbp), %rdi
movl -0x25c(%rbp), %edx
leaq 0x78ad(%rip), %rsi      # 0x2aca0
movb $0x0, %al
callq 0x3430
movq -0x268(%rbp), %rdi
addq $0x48, %rdi
callq 0x3470
cmpq $0x0, %rax
jbe 0x23429
movq -0x10(%rbp), %rdi
movq -0x278(%rbp), %rdx
leaq 0x7890(%rip), %rsi      # 0x2acb2
movb $0x0, %al
callq 0x3430
movq -0x268(%rbp), %rdi
addq $0x68, %rdi
callq 0x3470
cmpq $0x0, %rax
jbe 0x23490
movq -0x10(%rbp), %rax
movq %rax, -0x368(%rbp)
cmpq $0x0, -0x270(%rbp)
je 0x23464
movq -0x270(%rbp), %rax
movq %rax, -0x370(%rbp)
jmp 0x23474
leaq 0x793b(%rip), %rax      # 0x2ada6
movq %rax, -0x370(%rbp)
jmp 0x23474
movq -0x368(%rbp), %rdi
movq -0x370(%rbp), %rdx
leaq 0x782e(%rip), %rsi      # 0x2acb7
movb $0x0, %al
callq 0x3430
movq -0x10(%rbp), %rdi
movl -0x25c(%rbp), %edx
leaq 0x7823(%rip), %rsi      # 0x2acc4
movb $0x0, %al
callq 0x3430
movq -0x10(%rbp), %rdi
leaq 0x7946(%rip), %rsi      # 0x2adf9
movb $0x0, %al
callq 0x3430
jmp 0x234ce
movq -0x10(%rbp), %rdi
leaq 0x7828(%rip), %rsi      # 0x2acef
movb $0x0, %al
callq 0x3430
jmp 0x234d0
movl -0x25c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x25c(%rbp)
jmp 0x23355
movq -0x10(%rbp), %rdi
leaq 0x75a7(%rip), %rsi      # 0x2aa96
movb $0x0, %al
callq 0x3430
jmp 0x23521
testb $0x1, -0x19(%rbp)
je 0x2351d
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x98(%rax), %rdx
leaq 0x7098(%rip), %rsi      # 0x2a5ac
movb $0x0, %al
callq 0x3430
jmp 0x2351f
jmp 0x2351f
jmp 0x23521
movq -0x10(%rbp), %rdi
leaq 0x70df(%rip), %rsi      # 0x2a60b
movb $0x0, %al
callq 0x3430
movq -0x10(%rbp), %rdi
leaq 0x78bb(%rip), %rsi      # 0x2adf9
movb $0x0, %al
callq 0x3430
movq -0x2d8(%rbp), %rdi
addq $0x20, %rdi
callq 0x196e0
movl $0x3, %ecx
xorl %edx, %edx
divq %rcx
movl %eax, -0x27c(%rbp)
movq -0x10(%rbp), %rdi
leaq 0x7785(%rip), %rsi      # 0x2acf5
movb $0x0, %al
callq 0x3430
movq -0x10(%rbp), %rdi
leaq 0x778f(%rip), %rsi      # 0x2ad11
movb $0x0, %al
callq 0x3430
movq -0x2d8(%rbp), %rcx
xorl %eax, %eax
cmpq $0x0, 0x80(%rcx)
movb %al, -0x371(%rbp)
je 0x2363d
movq -0x2d8(%rbp), %rax
movq 0x80(%rax), %rax
movq %rax, -0x380(%rbp)
leaq -0x288(%rbp), %rdi
leaq 0x7765(%rip), %rsi      # 0x2ad2e
callq 0x11e90
movq -0x380(%rbp), %rdi
leaq -0x288(%rbp), %rsi
callq 0x24c10
movb %al, %cl
movb $0x1, %al
testb $0x1, %cl
movb %al, -0x372(%rbp)
jne 0x23631
movq -0x2d8(%rbp), %rax
movq 0x80(%rax), %rax
movq %rax, -0x388(%rbp)
leaq -0x290(%rbp), %rdi
leaq 0x7720(%rip), %rsi      # 0x2ad33
callq 0x11e90
movq -0x388(%rbp), %rdi
leaq -0x290(%rbp), %rsi
callq 0x24c10
movb %al, -0x372(%rbp)
movb -0x372(%rbp), %al
movb %al, -0x371(%rbp)
movb -0x371(%rbp), %al
testb $0x1, %al
jne 0x23649
jmp 0x2365b
movq -0x10(%rbp), %rdi
leaq 0x76e7(%rip), %rsi      # 0x2ad3b
movb $0x0, %al
callq 0x3430
movq -0x2d8(%rbp), %rcx
xorl %eax, %eax
cmpq $0x0, 0x80(%rcx)
movb %al, -0x389(%rbp)
je 0x236b5
movq -0x2d8(%rbp), %rax
movq 0x80(%rax), %rax
movq %rax, -0x398(%rbp)
leaq -0x298(%rbp), %rdi
leaq 0x76b2(%rip), %rsi      # 0x2ad49
callq 0x11e90
movq -0x398(%rbp), %rdi
leaq -0x298(%rbp), %rsi
callq 0x24c10
movb %al, -0x389(%rbp)
movb -0x389(%rbp), %al
testb $0x1, %al
jne 0x236c1
jmp 0x236d3
movq -0x10(%rbp), %rdi
leaq 0x7682(%rip), %rsi      # 0x2ad4e
movb $0x0, %al
callq 0x3430
movq -0x10(%rbp), %rdi
leaq 0x767b(%rip), %rsi      # 0x2ad59
movb $0x0, %al
callq 0x3430
movq -0x2d8(%rbp), %rdi
addq $0x20, %rdi
callq 0x19d00
movq %rax, -0x2a0(%rbp)
movl $0x0, -0x2a4(%rbp)
movl -0x2a4(%rbp), %eax
cmpl -0x27c(%rbp), %eax
jge 0x2380b
leaq -0x2a0(%rbp), %rdi
callq 0x25030
movzwl (%rax), %eax
movl %eax, -0x2a8(%rbp)
leaq -0x2a0(%rbp), %rdi
xorl %esi, %esi
callq 0x25050
movq %rax, -0x2b0(%rbp)
leaq -0x2a0(%rbp), %rdi
callq 0x25030
movzwl (%rax), %eax
movl %eax, -0x2b4(%rbp)
leaq -0x2a0(%rbp), %rdi
xorl %esi, %esi
callq 0x25050
movq %rax, -0x2c0(%rbp)
leaq -0x2a0(%rbp), %rdi
callq 0x25030
movzwl (%rax), %eax
movl %eax, -0x2c4(%rbp)
leaq -0x2a0(%rbp), %rdi
xorl %esi, %esi
callq 0x25050
movq %rax, -0x2d0(%rbp)
movl -0x2a4(%rbp), %eax
movl -0x27c(%rbp), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jne 0x237d0
movq -0x10(%rbp), %rdi
movl -0x2a8(%rbp), %edx
movl -0x2b4(%rbp), %ecx
movl -0x2c4(%rbp), %r8d
leaq 0x75a1(%rip), %rsi      # 0x2ad68
movb $0x0, %al
callq 0x3430
jmp 0x237f5
movq -0x10(%rbp), %rdi
movl -0x2a8(%rbp), %edx
movl -0x2b4(%rbp), %ecx
movl -0x2c4(%rbp), %r8d
leaq 0x7589(%rip), %rsi      # 0x2ad77
movb $0x0, %al
callq 0x3430
jmp 0x237f7
movl -0x2a4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2a4(%rbp)
jmp 0x23706
movq -0x2d8(%rbp), %rdi
addq $0x38, %rdi
movq -0x10(%rbp), %rsi
movl -0x24(%rbp), %edx
movq -0x18(%rbp), %rcx
callq 0x24470
movq -0x10(%rbp), %rdi
leaq 0x7238(%rip), %rsi      # 0x2aa69
movb $0x0, %al
callq 0x3430
movq -0x10(%rbp), %rdi
leaq 0x75b6(%rip), %rsi      # 0x2adf9
movb $0x0, %al
callq 0x3430
addq $0x3a0, %rsp            # imm = 0x3A0
popq %rbp
retq
movq -0x250(%rbp), %rdi
callq 0x34f0
nop