// File: /workspace/github_c_makefile_star2_O2/vlenhart[P]q3bsp/q3shader.cpp
// Function: QuakeShaderFactory::Process(std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>> const&)
void QuakeShaderFactory::Process(const StringVector &args)
{

  if ( args[0] == "{" )
  {
    mBraceCount++;
  }
  else
  {
    if ( args[0] == "}" )
    {
      mBraceCount--;

      if ( mBraceCount == 0 ) // shader finished 
      {
        if ( mCurrent )
        {
          const StringRef& ref = mCurrent->GetName();
          QuakeShaderMap::iterator found;
          found = mShaders.find(ref);
          if ( found != mShaders.end() )
          {
            printf("Can't add shader %s, it already exists!!\n",ref.Get());
          }
          else
          {
            mShaders[ref] = mCurrent;
            printf("Added shader: %s\n",ref.Get());
            mCurrent = 0;
          }
        }
        else
        {
          printf("Got closing brace without valid shader defined.\n");
        }
      }
      else
      {
		  if ( mBraceCount == 1 ) {// shader stage finished        
			if (mCurrent && mCurrentStage)
				mCurrent->AddStage(mCurrentStage);
			delete mCurrentStage;
			mCurrentStage = 0;

		} 
		else  if ( mBraceCount < 0 )
        {
          printf("Missmatched closing brace situation!??\n");
          mBraceCount = 0;
        }
      }
    }
    else
    {
      if ( !mBraceCount )
      {
        delete mCurrent; // if didn't process the last one
        mCurrent = 0;
		delete mCurrentStage; // if didn't process the last one
        mCurrentStage = 0;

		// new shader start
        char name[256];
        //if ( GetName(args[0],name))
		strcpy(name,args[0].c_str()); // we take the full path name 
        {
          StringRef ref = StringDict::gStringDict().Get(name);
          mCurrent = new QuakeShader(ref);
        }
      }
      else
      if (mCurrent) {
		  if (mBraceCount == 1) { // at shader level 
		    if ( args[0] == "cull" && args.size() == 2)
	        {		// disable none trans alphashadow nomarks
				 mCurrent->mCull = args[1];
			}
		    else if ( args[0] == "surfaceparm" && args.size() == 2)
	        {
				if ( args[1] == "nolightmap" )
					 mCurrent->mNoLightMap = true;
				else if ( args[1] == "sky" )
					 mCurrent->mSky = true;
			}
			else if ( args[0] == "skyparms")
	        {

			}
		  } else 	
		  if (mBraceCount == 2) {	// at stage lavel 
		    if (!mCurrentStage) 
				mCurrentStage = new ShaderStage;


			String arg0; 
			strlwr(args[0],arg0);

			// process command!
			// store data in mCurrentStage

			if ( arg0 == "map"  && args.size() == 2  )
			{
			  //char name[256];
			  // this strips the extension ?	
			  //if ( GetName(args[1],name) )
			  if (args[1] != "$lightmap")	
			  {
				const StringRef ref = StringDict::gStringDict().Get(args[1]);
				mCurrentStage->map = ref;
				mCurrent->AddTexture(ref);
				//printf("Adding texture %s\n",ref.Get());
			  } else {
				  mCurrentStage->isLightMap = true;
			  }	
			}
			else if ( arg0 == "clampmap"  && args.size() == 2  )
			{
			  if (args[1] != "$lightmap")	
			  {
				const StringRef ref = StringDict::gStringDict().Get(args[1]);
				mCurrentStage->map = ref;
 				mCurrentStage->clamp = true;

				mCurrent->AddTexture(ref);
				//printf("Adding texture %s\n",ref.Get());
			  } else {
				  mCurrentStage->isLightMap = true;
				  //if (mCurrentStage->textureBlendMode == String(""))
				  //mCurrentStage->textureBlendMode = "ADD";
			  }	
			}
			else if ( arg0 == "animmap") {
				mCurrentStage->isAnimMap = true;
				mCurrentStage->animMapFrequency = (float)atof(args[1].c_str());
				for (unsigned int i=2; i< args.size(); i++) 
					mCurrentStage->animMap.push_back(args[i]);
			}
			else if ( arg0 == "blendfunc")
			{
					//blendFunc GL_DST_COLOR GL_ZERO
					//blendFunc GL_DST_COLOR GL_ONE_MINUS_DST_ALPHA
					//blendFunc GL_ONE GL_ONE
					//blendFunc GL_ONE GL_ZERO
					//blendFunc blend
					//blendFunc filter
					// [Source * <srcBlend>] + [Destination * <dstBlend>]
					if (args.size() == 3) {

						String arg1; 
						strupr(args[1],arg1);
						String arg2; 
						strupr(args[2],arg2);


						mCurrentStage->blendFuncSrc = arg1;
						mCurrentStage->blendFuncDst = arg2;

						if (arg1=="GL_SRC_ALPHA")
							mCurrentStage->textureBlendMode = "BLENDTEXTUREALPHA";

						if (arg1=="GL_ONE" &&  arg2=="GL_ZERO")
							mCurrentStage->textureBlendMode = "REPLACE";
						else 
						if (arg1=="GL_ONE" &&  arg2=="GL_ONE")
							mCurrentStage->textureBlendMode = "ADD";
						else 
						if (arg1=="GL_SRC_ALPHA" && arg2=="GL_ONE_MINUS_SRC_ALPHA")
							mCurrentStage->textureBlendMode = "BLENDTEXTUREALPHA";
						else 
						if (arg1=="GL_DST_COLOR" &&  arg2 =="GL_ONE_MINUS_DST_ALPHA")
							//mCurrentStage->textureBlendMode = "BLENDCURRENTALPHA"; // ??? 
							mCurrentStage->textureBlendMode = "MODULATE"; // ??? 
						else if (arg1=="GL_DST_COLOR" &&  arg2=="GL_ZERO")
							mCurrentStage->textureBlendMode = "MODULATE"; 


					   // GL_DST_COLOR GL_ONE_MINUS_DST_ALPHA
					   // GL_DST_COLOR GL_ZERO
					}
					else mCurrentStage->blendFuncSrc = args[1];
					if (args[1]=="add") {
						mCurrentStage->textureBlendMode = "ADD";
						mCurrentStage->blendFuncSrc = "GL_ONE";
						mCurrentStage->blendFuncDst = "GL_ONE";
					} else 
					if (args[1]=="filter") {
						mCurrentStage->textureBlendMode = "MODULATE";
						mCurrentStage->blendFuncSrc = "GL_DST_COLOR";
						mCurrentStage->blendFuncDst = "GL_ZERO";
					} else 
					if (args[1]=="blend") { // ??
						mCurrentStage->textureBlendMode = "BLENDTEXTUREALPHA";
						mCurrentStage->blendFuncSrc = "GL_SRC_ALPHA";
						mCurrentStage->blendFuncDst = "GL_ONE_MINUS_SRC_ALPHA";
					}

					//tcmod scroll 0 1
					//tcMod turb 0 .25 0 5.6
					//tcmod scale 1.5 1.5
					//tcGen environment
					//tcMod scroll 0.15 0.15
					//depthWrite
					//map $lightmap
					
					//rgbGen identity
					//rgbGen wave sin .5 .5 0 .5	
					//depthfunc equal



			}
			else if (arg0 == "alphafunc") 
			{  // GE128 
			}
			else if (arg0 == "tcmod")
			{
				if (mCurrentStage->tcmod.length()>0) 	mCurrentStage->tcmod += ',';

				if (args[1] == "scale" || args[1] == "scroll" || args[1] == "rotate") {
					for (unsigned int i=1; i< args.size(); i++) {
						mCurrentStage->tcmodOk += args[i];
						mCurrentStage->tcmodOk += ' ';
					}

				} else {
					for (unsigned int i=1; i< args.size(); i++) {
						mCurrentStage->tcmod += args[i];
						mCurrentStage->tcmod += ' ';
					}
				}
			}
			else if (arg0 == "tcgen")
			{
				if (mCurrentStage->tcmod.length()>0) 	mCurrentStage->tcmod += ',';
				mCurrentStage->tcmod += "tcgen ";
				for (unsigned int i=1; i< args.size(); i++) {
					mCurrentStage->tcmod += args[i];
					mCurrentStage->tcmod += ' ';
				}
			}
			else if (arg0 == "rgbgen")
			{
				// identityLighting
				// identity
				// wave <func> <base> <amp> <phase> <freq>
				for (unsigned int i=1; i< args.size(); i++) {
					if (i>1) mCurrentStage->rgbGen += ' ';
					mCurrentStage->rgbGen += args[i];
				}
			}
			else {

			}
		  } // braceCount == 2
      }
    }
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x158, %rsp            # imm = 0x158
movq %rsi, %r14
movq %rdi, %r12
movq (%rsi), %rdi
leaq 0x5ce0(%rip), %rsi      # 0x1160e
callq 0x99d7
testb %al, %al
je 0xb94e
incl 0x18(%r12)
addq $0x158, %rsp            # imm = 0x158
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq (%r14), %rdi
leaq 0x5cb8(%rip), %rsi      # 0x11610
callq 0x99d7
movl 0x18(%r12), %ecx
testb %al, %al
je 0xb9d2
leal -0x1(%rcx), %eax
movl %eax, 0x18(%r12)
cmpl $0x2, %ecx
je 0xbad6
cmpl $0x1, %ecx
jne 0xbb1d
movq 0x20(%r12), %r14
testq %r14, %r14
je 0xbbf7
addq $0x30, %r14
leaq 0x30(%r12), %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0xcf30
leaq 0x38(%r12), %rcx
cmpq %rcx, %rax
je 0xbce5
movq (%r14), %rsi
leaq 0x5c58(%rip), %rdi      # 0x11612
xorl %eax, %eax
addq $0x158, %rsp            # imm = 0x158
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2050
movq 0x20(%r12), %r15
testl %ecx, %ecx
je 0xba47
testq %r15, %r15
je 0xb93c
cmpl $0x2, %ecx
je 0xbb3a
cmpl $0x1, %ecx
jne 0xb93c
movq (%r14), %rdi
leaq 0x5c4e(%rip), %rsi      # 0x1164e
callq 0x99d7
movq (%r14), %rcx
testb %al, %al
je 0xbc14
movq 0x8(%r14), %rax
subq %rcx, %rax
cmpq $0x40, %rax
jne 0xbc14
addq $0x20, %rcx
leaq -0x180(%rbp), %r14
movq %r14, %rdi
movq %rcx, %rsi
callq 0xc6ba
movq 0x20(%r12), %rax
movq (%r14), %rcx
movq %rcx, (%rax)
jmp 0xb93c
testq %r15, %r15
je 0xba54
movq %r15, %rdi
callq 0xc566
pushq $0x68
popq %rsi
movq %r15, %rdi
callq 0x2230
andq $0x0, 0x20(%r12)
movq 0x28(%r12), %r15
testq %r15, %r15
je 0xba77
movq %r15, %rdi
callq 0xc5e6
movl $0xb8, %esi
movq %r15, %rdi
callq 0x2230
andq $0x0, 0x28(%r12)
movq (%r14), %rax
movq (%rax), %rsi
leaq -0x180(%rbp), %r14
movq %r14, %rdi
callq 0x21f0
callq 0x5aca
movq %rax, %rdi
movq %r14, %rsi
callq 0x5bae
leaq -0x58(%rbp), %r15
movq %rax, (%r15)
pushq $0x68
popq %rdi
callq 0x2220
movq %rax, %r14
movq %rax, %rdi
movq %r15, %rsi
callq 0xc672
movq %r14, 0x20(%r12)
jmp 0xb93c
movq 0x20(%r12), %rdi
testq %rdi, %rdi
je 0xbaf3
movq 0x28(%r12), %rsi
testq %rsi, %rsi
je 0xbaf3
addq $0x50, %rdi
callq 0xc9b6
movq 0x28(%r12), %r14
testq %r14, %r14
je 0xbb05
movq %r14, %rdi
callq 0xc5e6
movl $0xb8, %esi
movq %r14, %rdi
callq 0x2230
andq $0x0, 0x28(%r12)
jmp 0xb93c
jge 0xb93c
leaq 0x5c30(%rip), %rdi      # 0x1175a
callq 0x2380
andl $0x0, 0x18(%r12)
jmp 0xb93c
cmpq $0x0, 0x28(%r12)
jne 0xbb5c
movl $0xb8, %edi
callq 0x2220
movq %rax, %r15
movq %rax, %rdi
callq 0xc6e0
movq %r15, 0x28(%r12)
leaq -0x170(%rbp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
movq (%r14), %rdi
leaq -0x180(%rbp), %rsi
callq 0xc474
leaq 0x5b09(%rip), %rsi      # 0x1168e
leaq -0x180(%rbp), %rdi
callq 0x99d7
testb %al, %al
je 0xbc65
movq (%r14), %rdi
movq 0x8(%r14), %rax
subq %rdi, %rax
cmpq $0x40, %rax
jne 0xbc65
addq $0x20, %rdi
leaq 0x5abf(%rip), %rsi      # 0x11677
callq 0xc7c7
testb %al, %al
je 0xbed9
callq 0x5aca
movq (%r14), %rcx
movq 0x20(%rcx), %rsi
movq %rax, %rdi
callq 0x5bae
leaq -0x58(%rbp), %rsi
movq %rax, (%rsi)
movq 0x28(%r12), %rcx
movq %rax, (%rcx)
movq 0x20(%r12), %rdi
callq 0xc7d4
jmp 0xc2a4
leaq 0x5b83(%rip), %rdi      # 0x11781
addq $0x158, %rsp            # imm = 0x158
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2380
leaq 0x5a38(%rip), %rsi      # 0x11653
movq %rcx, %rdi
callq 0x99d7
movq (%r14), %rdi
testb %al, %al
je 0xbd14
movq 0x8(%r14), %rax
subq %rdi, %rax
cmpq $0x40, %rax
jne 0xbd14
addq $0x20, %rdi
leaq 0x5a15(%rip), %rsi      # 0x1165f
callq 0x99d7
testb %al, %al
je 0xbfd5
movq 0x20(%r12), %rax
movb $0x1, 0x9(%rax)
jmp 0xb93c
leaq 0x5a15(%rip), %rsi      # 0x11681
leaq -0x180(%rbp), %rdi
callq 0x99d7
testb %al, %al
je 0xbd31
movq (%r14), %rdi
movq 0x8(%r14), %rax
subq %rdi, %rax
cmpq $0x40, %rax
jne 0xbd31
addq $0x20, %rdi
leaq 0x59d8(%rip), %rsi      # 0x11677
callq 0xc7c7
testb %al, %al
je 0xbed9
callq 0x5aca
movq (%r14), %rcx
movq 0x20(%rcx), %rsi
movq %rax, %rdi
callq 0x5bae
leaq -0x58(%rbp), %rsi
movq %rax, (%rsi)
movq 0x28(%r12), %rcx
movq %rax, (%rcx)
movb $0x1, 0xaa(%rcx)
movq 0x20(%r12), %rdi
callq 0xc7d4
jmp 0xc2a4
movq 0x20(%r12), %rbx
movq %r15, %rdi
movq %r14, %rsi
callq 0xc620
movq %rbx, (%rax)
movq (%r14), %rsi
leaq 0x593a(%rip), %rdi      # 0x1163c
xorl %eax, %eax
callq 0x2050
andq $0x0, 0x20(%r12)
jmp 0xb93c
leaq 0x5953(%rip), %rsi      # 0x1166e
addq $0x158, %rsp            # imm = 0x158
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x99d7
leaq 0x5952(%rip), %rsi      # 0x1168a
leaq -0x180(%rbp), %rdi
callq 0x99d7
testb %al, %al
movq %r12, -0x38(%rbp)
je 0xbdbe
movq 0x28(%r12), %rbx
movb $0x1, 0xa9(%rbx)
movq (%r14), %r12
movq 0x20(%r12), %rdi
callq 0x22d0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x20(%rbx)
pushq $0x2
popq %rbx
leaq -0x58(%rbp), %r15
movl %ebx, %ebx
movq 0x8(%r14), %rax
subq %r12, %rax
sarq $0x5, %rax
cmpq %rbx, %rax
jbe 0xc2a4
movq -0x38(%rbp), %rax
movq 0x28(%rax), %r13
movq %rbx, %rax
shlq $0x5, %rax
addq %rax, %r12
movq %r15, %rdi
movq %r12, %rsi
callq 0xc6ba
addq $0x8, %r13
movq %r13, %rdi
movq %r15, %rsi
callq 0xd504
incl %ebx
movq (%r14), %r12
jmp 0xbd75
leaq 0x58cd(%rip), %rsi      # 0x11692
leaq -0x180(%rbp), %rdi
callq 0x99d7
testb %al, %al
je 0xbeea
movq (%r14), %rax
movq 0x8(%r14), %rcx
subq %rax, %rcx
cmpq $0x60, %rcx
jne 0xbffe
leaq -0x48(%rbp), %rcx
movq %rcx, -0x10(%rcx)
andq $0x0, -0x8(%rcx)
movb $0x0, (%rcx)
addq $0x20, %rax
leaq -0x58(%rbp), %rsi
movq %rax, %rdi
callq 0xc4b6
leaq -0x68(%rbp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
movq (%r14), %rdi
addq $0x40, %rdi
leaq -0x78(%rbp), %rsi
callq 0xc4b6
leaq -0x30(%rbp), %rdi
leaq -0x58(%rbp), %rsi
callq 0xc6ba
movq 0x28(%r12), %rax
leaq -0x30(%rbp), %rdi
movq (%rdi), %rcx
movq %rcx, 0x28(%rax)
leaq -0x78(%rbp), %rsi
callq 0xc6ba
movq 0x28(%r12), %rax
movq -0x30(%rbp), %rcx
movq %rcx, 0x30(%rax)
leaq 0x5835(%rip), %rsi      # 0x1169c
leaq -0x58(%rbp), %rdi
callq 0x99d7
testb %al, %al
je 0xbe94
leaq 0x582e(%rip), %rsi      # 0x116a9
leaq -0x30(%rbp), %rdi
callq 0x94e4
movq 0x28(%r12), %rax
movq -0x30(%rbp), %rcx
movq %rcx, 0xb0(%rax)
leaq 0x5820(%rip), %rsi      # 0x116bb
leaq -0x58(%rbp), %rdi
callq 0x99d7
testb %al, %al
je 0xc020
leaq 0x580f(%rip), %rsi      # 0x116c2
leaq -0x78(%rbp), %rdi
callq 0x99d7
testb %al, %al
je 0xc020
leaq 0x57ff(%rip), %rsi      # 0x116ca
leaq -0x30(%rbp), %rdi
callq 0x94e4
jmp 0xc1af
movq 0x28(%r12), %rax
movb $0x1, 0xa8(%rax)
jmp 0xc2a4
leaq 0x5831(%rip), %rsi      # 0x11722
leaq -0x180(%rbp), %rdi
callq 0x99d7
testb %al, %al
jne 0xc2a4
leaq 0x5820(%rip), %rsi      # 0x1172c
leaq -0x180(%rbp), %rdi
callq 0x99d7
testb %al, %al
je 0xc0a2
movq -0x38(%rbp), %rax
movq 0x28(%rax), %rdi
cmpq $0x0, 0x70(%rdi)
je 0xbf3b
addq $0x68, %rdi
pushq $0x2c
popq %rsi
callq 0x21d0
movq (%r14), %rdi
addq $0x20, %rdi
leaq 0x57e9(%rip), %rsi      # 0x11732
callq 0x99d7
testb %al, %al
jne 0xbf84
movq (%r14), %rdi
addq $0x20, %rdi
leaq 0x57d8(%rip), %rsi      # 0x11738
callq 0x99d7
testb %al, %al
jne 0xbf84
movq (%r14), %rdi
addq $0x20, %rdi
leaq 0x57c8(%rip), %rsi      # 0x1173f
callq 0x99d7
testb %al, %al
je 0xc3a0
pushq $0x1
popq %rbx
pushq $0x20
popq %r15
movq -0x38(%rbp), %r12
movl %ebx, %ebx
movq (%r14), %rsi
movq 0x8(%r14), %rax
subq %rsi, %rax
sarq $0x5, %rax
cmpq %rbx, %rax
jbe 0xc2a4
movq %rbx, %rax
shlq $0x5, %rax
addq %rax, %rsi
movq 0x28(%r12), %rdi
addq $0x48, %rdi
callq 0x2450
movq 0x28(%r12), %rdi
addq $0x48, %rdi
movl %r15d, %esi
callq 0x21d0
incl %ebx
jmp 0xbf8f
movq (%r14), %rdi
addq $0x20, %rdi
leaq 0x5687(%rip), %rsi      # 0x1166a
callq 0x99d7
testb %al, %al
je 0xb93c
movq 0x20(%r12), %rax
movb $0x1, 0xa(%rax)
jmp 0xb93c
addq $0x20, %rax
leaq -0x58(%rbp), %rdi
movq %rax, %rsi
callq 0xc6ba
movq 0x28(%r12), %rax
movq -0x58(%rbp), %rcx
movq %rcx, 0x28(%rax)
jmp 0xc1d1
leaq 0x5694(%rip), %rsi      # 0x116bb
leaq -0x58(%rbp), %rdi
callq 0x99d7
testb %al, %al
je 0xc05d
leaq 0x5680(%rip), %rsi      # 0x116bb
leaq -0x78(%rbp), %rdi
callq 0x99d7
testb %al, %al
je 0xc05d
leaq 0x5683(%rip), %rsi      # 0x116d2
leaq -0x30(%rbp), %rdi
callq 0x94e4
jmp 0xc1af
leaq 0x5638(%rip), %rsi      # 0x1169c
leaq -0x58(%rbp), %rdi
callq 0x99d7
testb %al, %al
je 0xc13d
leaq 0x565a(%rip), %rsi      # 0x116d6
leaq -0x78(%rbp), %rdi
callq 0x99d7
testb %al, %al
je 0xc13d
leaq 0x5615(%rip), %rsi      # 0x116a9
leaq -0x30(%rbp), %rdi
callq 0x94e4
jmp 0xc1af
leaq 0x569d(%rip), %rsi      # 0x11746
leaq -0x180(%rbp), %rdi
callq 0x99d7
testb %al, %al
je 0xc322
movq -0x38(%rbp), %rbx
movq 0x28(%rbx), %rdi
cmpq $0x0, 0x70(%rdi)
je 0xc0dc
addq $0x68, %rdi
pushq $0x2c
popq %rsi
callq 0x21d0
movq 0x28(%rbx), %rdi
addq $0x68, %rdi
leaq 0x5665(%rip), %rsi      # 0x1174c
callq 0x2420
pushq $0x1
popq %rbx
pushq $0x20
popq %r15
movq -0x38(%rbp), %r12
movl %ebx, %ebx
movq (%r14), %rsi
movq 0x8(%r14), %rax
subq %rsi, %rax
sarq $0x5, %rax
cmpq %rbx, %rax
jbe 0xc2a4
movq %rbx, %rax
shlq $0x5, %rax
addq %rax, %rsi
movq 0x28(%r12), %rdi
addq $0x68, %rdi
callq 0x2450
movq 0x28(%r12), %rdi
addq $0x68, %rdi
movl %r15d, %esi
callq 0x21d0
incl %ebx
jmp 0xc0f7
leaq 0x55a9(%rip), %rsi      # 0x116ed
leaq -0x58(%rbp), %rdi
callq 0x99d7
testb %al, %al
je 0xc177
leaq 0x55a2(%rip), %rsi      # 0x116fa
leaq -0x78(%rbp), %rdi
callq 0x99d7
testb %al, %al
je 0xc177
leaq 0x458a(%rip), %rsi      # 0x106f6
leaq -0x30(%rbp), %rdi
callq 0x94e4
jmp 0xc1af
leaq 0x556f(%rip), %rsi      # 0x116ed
leaq -0x58(%rbp), %rdi
callq 0x99d7
testb %al, %al
je 0xc1bf
leaq 0x5530(%rip), %rsi      # 0x116c2
leaq -0x78(%rbp), %rdi
callq 0x99d7
testb %al, %al
je 0xc1bf
leaq 0x4550(%rip), %rsi      # 0x106f6
leaq -0x30(%rbp), %rdi
callq 0x94e4
movq 0x28(%r12), %rax
movq -0x30(%rbp), %rcx
movq %rcx, 0xb0(%rax)
leaq -0x78(%rbp), %rdi
callq 0x2120
leaq -0x58(%rbp), %rdi
callq 0x2120
movq (%r14), %rdi
addq $0x20, %rdi
leaq 0x5532(%rip), %rsi      # 0x11711
callq 0x99d7
testb %al, %al
je 0xc235
leaq 0x54e3(%rip), %rsi      # 0x116d2
leaq -0x58(%rbp), %rdi
callq 0x94e4
movq 0x28(%r12), %rax
leaq -0x58(%rbp), %rdi
movq (%rdi), %rcx
movq %rcx, 0xb0(%rax)
leaq 0x54a9(%rip), %rsi      # 0x116bb
callq 0x94e4
movq 0x28(%r12), %rax
leaq -0x58(%rbp), %rdi
movq (%rdi), %rcx
movq %rcx, 0x28(%rax)
leaq 0x548d(%rip), %rsi      # 0x116bb
callq 0x94e4
jmp 0xc297
movq (%r14), %rdi
addq $0x20, %rdi
leaq 0x54d2(%rip), %rsi      # 0x11715
callq 0x99d7
testb %al, %al
je 0xc2b5
leaq 0x44a3(%rip), %rsi      # 0x106f6
leaq -0x58(%rbp), %rdi
callq 0x94e4
movq 0x28(%r12), %rax
leaq -0x58(%rbp), %rdi
movq (%rdi), %rcx
movq %rcx, 0xb0(%rax)
leaq 0x5477(%rip), %rsi      # 0x116ed
callq 0x94e4
movq 0x28(%r12), %rax
leaq -0x58(%rbp), %rdi
movq (%rdi), %rcx
movq %rcx, 0x28(%rax)
leaq 0x5430(%rip), %rsi      # 0x116c2
callq 0x94e4
movq 0x28(%r12), %rax
movq -0x58(%rbp), %rcx
movq %rcx, 0x30(%rax)
leaq -0x180(%rbp), %rdi
callq 0x2120
jmp 0xb93c
movq (%r14), %rdi
addq $0x20, %rdi
leaq 0x5459(%rip), %rsi      # 0x1171c
callq 0x99d7
testb %al, %al
je 0xc2a4
leaq 0x53d6(%rip), %rsi      # 0x116a9
leaq -0x58(%rbp), %rdi
callq 0x94e4
movq -0x38(%rbp), %rbx
movq 0x28(%rbx), %rax
leaq -0x58(%rbp), %rdi
movq (%rdi), %rcx
movq %rcx, 0xb0(%rax)
leaq 0x53a3(%rip), %rsi      # 0x1169c
callq 0x94e4
movq 0x28(%rbx), %rax
leaq -0x58(%rbp), %rdi
movq (%rdi), %rcx
movq %rcx, 0x28(%rax)
leaq 0x53c2(%rip), %rsi      # 0x116d6
callq 0x94e4
movq 0x28(%rbx), %rax
jmp 0xc29c
leaq 0x542a(%rip), %rsi      # 0x11753
leaq -0x180(%rbp), %rdi
callq 0x99d7
testb %al, %al
je 0xc2a4
pushq $0x1
popq %r12
movl $0x88, %r13d
pushq $0x20
popq %r15
movl %r12d, %r12d
movq (%r14), %rax
movq 0x8(%r14), %rcx
subq %rax, %rcx
sarq $0x5, %rcx
cmpq %r12, %rcx
jbe 0xc2a4
cmpl $0x2, %r12d
jb 0xc381
movq -0x38(%rbp), %rax
movq 0x28(%rax), %rdi
addq %r13, %rdi
movl %r15d, %esi
callq 0x21d0
movq (%r14), %rax
movq %r12, %rsi
shlq $0x5, %rsi
addq %rax, %rsi
movq -0x38(%rbp), %rax
movq 0x28(%rax), %rdi
addq %r13, %rdi
callq 0x2450
incl %r12d
jmp 0xc34b
pushq $0x1
popq %r12
pushq $0x20
popq %r15
movq -0x38(%rbp), %rbx
movl %r12d, %r12d
movq (%r14), %rsi
movq 0x8(%r14), %rax
subq %rsi, %rax
sarq $0x5, %rax
cmpq %r12, %rax
jbe 0xc2a4
movq %r12, %rax
shlq $0x5, %rax
addq %rax, %rsi
movq 0x28(%rbx), %rdi
addq $0x68, %rdi
callq 0x2450
movq 0x28(%rbx), %rdi
addq $0x68, %rdi
movl %r15d, %esi
callq 0x21d0
incl %r12d
jmp 0xc3ac
jmp 0xc414
jmp 0xc414
jmp 0xc414
jmp 0xc414
jmp 0xc45d
jmp 0xc414
jmp 0xc45d
jmp 0xc45d
jmp 0xc45d
jmp 0xc45d
jmp 0xc414
jmp 0xc45d
jmp 0xc45d
jmp 0xc45d
jmp 0xc45d
jmp 0xc414
jmp 0xc414
movq %rax, %rbx
leaq -0x78(%rbp), %rdi
callq 0x2120
leaq -0x58(%rbp), %rdi
callq 0x2120
jmp 0xc460
jmp 0xc45d
movq %rax, %rbx
jmp 0xc420
jmp 0xc45d
jmp 0xc45d
jmp 0xc45d
movq %rax, %rbx
movl $0xb8, %esi
movq %r15, %rdi
jmp 0xc456
jmp 0xc45d
jmp 0xc45d
jmp 0xc45d
jmp 0xc45d
movq %rax, %rbx
pushq $0x68
popq %rsi
movq %r14, %rdi
callq 0x2230
jmp 0xc46c
movq %rax, %rbx
leaq -0x180(%rbp), %rdi
callq 0x2120
movq %rbx, %rdi
callq 0x23e0