// File: /workspace/github_c_makefile_star2_O3/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 $0x148, %rsp            # imm = 0x148
movq %rsi, %r14
movq %rdi, %rbx
movq (%rsi), %rdi
leaq 0x6b32(%rip), %rsi      # 0x135fa
callq 0x20d0
testl %eax, %eax
je 0xcb5a
movq (%r14), %rdi
leaq 0x6b1d(%rip), %rsi      # 0x135fc
callq 0x20d0
movl 0x18(%rbx), %ecx
testl %eax, %eax
je 0xcb62
movq 0x20(%rbx), %r15
testl %ecx, %ecx
je 0xcbf1
testq %r15, %r15
je 0xd790
cmpl $0x2, %ecx
je 0xcdf9
cmpl $0x1, %ecx
jne 0xd790
movq (%r14), %rdi
leaq 0x6b1e(%rip), %rsi      # 0x1363a
callq 0x20d0
movq (%r14), %r15
testl %eax, %eax
jne 0xceb5
movq 0x8(%r14), %rax
subq %r15, %rax
cmpq $0x40, %rax
jne 0xceb5
callq 0x69ac
movq 0x20(%r15), %rsi
movq %rax, %rdi
callq 0x6a3e
movq 0x20(%rbx), %rcx
movq %rax, (%rcx)
jmp 0xd790
incl 0x18(%rbx)
jmp 0xd790
leal -0x1(%rcx), %eax
movl %eax, 0x18(%rbx)
cmpl $0x2, %ecx
je 0xcd3a
cmpl $0x1, %ecx
jne 0xcddb
movq 0x20(%rbx), %r14
testq %r14, %r14
je 0xd0d4
leaq 0x30(%r14), %rsi
movq 0x40(%rbx), %rcx
testq %rcx, %rcx
je 0xcbc6
leaq 0x38(%rbx), %rdi
movq (%rsi), %rax
movq %rdi, %rdx
xorl %r8d, %r8d
cmpq 0x20(%rcx), %rax
setb %r8b
cmovaeq %rcx, %rdx
movq 0x10(%rcx,%r8,8), %rcx
testq %rcx, %rcx
jne 0xcb9e
cmpq %rdi, %rdx
je 0xcbc6
cmpq %rax, 0x20(%rdx)
jae 0xd196
leaq 0x30(%rbx), %rdi
callq 0xd9e0
movq %r14, (%rax)
movq 0x30(%r14), %rsi
leaq 0x6a4b(%rip), %rdi      # 0x13628
xorl %eax, %eax
callq 0x2050
movq $0x0, 0x20(%rbx)
jmp 0xd790
testq %r15, %r15
je 0xcc2c
leaq 0x50(%r15), %rdi
callq 0xdcac
movq 0x38(%r15), %rdi
testq %rdi, %rdi
je 0xcc14
movq 0x48(%r15), %rsi
subq %rdi, %rsi
callq 0x2230
movq 0x10(%r15), %rdi
leaq 0x20(%r15), %rax
cmpq %rax, %rdi
je 0xcc2c
movq (%rax), %rsi
incq %rsi
callq 0x2230
movl $0x68, %esi
movq %r15, %rdi
callq 0x2230
movq $0x0, 0x20(%rbx)
movq 0x28(%rbx), %r15
testq %r15, %r15
je 0xccad
movq 0x88(%r15), %rdi
leaq 0x98(%r15), %rax
cmpq %rax, %rdi
je 0xcc68
movq (%rax), %rsi
incq %rsi
callq 0x2230
movq 0x68(%r15), %rdi
leaq 0x78(%r15), %rax
cmpq %rax, %rdi
je 0xcc80
movq (%rax), %rsi
incq %rsi
callq 0x2230
movq 0x48(%r15), %rdi
leaq 0x58(%r15), %rax
cmpq %rax, %rdi
je 0xcc98
movq (%rax), %rsi
incq %rsi
callq 0x2230
movq 0x8(%r15), %rdi
testq %rdi, %rdi
je 0xccad
movq 0x18(%r15), %rsi
subq %rdi, %rsi
callq 0x2230
movl $0xb8, %esi
movq %r15, %rdi
callq 0x2230
xorl %r15d, %r15d
movq %r15, 0x28(%rbx)
movq (%r14), %rax
movq (%rax), %rsi
leaq -0x170(%rbp), %r14
movq %r14, %rdi
callq 0x21f0
callq 0x69ac
movq %rax, %rdi
movq %r14, %rsi
callq 0x6a3e
movq %rax, %r14
movl $0x68, %edi
callq 0x2220
leaq 0x5eb8(%rip), %rcx      # 0x12bb2
movq %rcx, (%rax)
leaq 0x20(%rax), %rcx
movq %rcx, 0x10(%rax)
movq %r15, 0x18(%rax)
movb %r15b, 0x20(%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x38(%rax)
movups %xmm0, 0x48(%rax)
movups %xmm0, 0x58(%rax)
movq %r14, 0x30(%rax)
movw $0x0, 0x8(%rax)
movb %r15b, 0xa(%rax)
movl $0x0, 0xc(%rax)
movq %rax, 0x20(%rbx)
jmp 0xd790
movq 0x20(%rbx), %rdi
testq %rdi, %rdi
je 0xcd55
movq 0x28(%rbx), %rsi
testq %rsi, %rsi
je 0xcd55
addq $0x50, %rdi
callq 0xdd76
movq 0x28(%rbx), %r14
testq %r14, %r14
je 0xcdc1
movq 0x88(%r14), %rdi
leaq 0x98(%r14), %rax
cmpq %rax, %rdi
je 0xcd7c
movq (%rax), %rsi
incq %rsi
callq 0x2230
movq 0x68(%r14), %rdi
leaq 0x78(%r14), %rax
cmpq %rax, %rdi
je 0xcd94
movq (%rax), %rsi
incq %rsi
callq 0x2230
movq 0x48(%r14), %rdi
leaq 0x58(%r14), %rax
cmpq %rax, %rdi
je 0xcdac
movq (%rax), %rsi
incq %rsi
callq 0x2230
movq 0x8(%r14), %rdi
testq %rdi, %rdi
je 0xcdc1
movq 0x18(%r14), %rsi
subq %rdi, %rsi
callq 0x2230
movl $0xb8, %esi
movq %r14, %rdi
callq 0x2230
movq $0x0, 0x28(%rbx)
jmp 0xd790
jge 0xd790
leaq 0x695e(%rip), %rdi      # 0x13746
callq 0x2350
movl $0x0, 0x18(%rbx)
jmp 0xd790
cmpq $0x0, 0x28(%rbx)
jne 0xce19
movl $0xb8, %edi
callq 0x2220
movq %rax, %r15
movq %rax, %rdi
callq 0xda48
movq %r15, 0x28(%rbx)
leaq -0x160(%rbp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
movq (%r14), %rdi
leaq -0x170(%rbp), %rsi
callq 0xd842
leaq 0x6835(%rip), %rsi      # 0x1367a
leaq -0x170(%rbp), %rdi
callq 0x20d0
testl %eax, %eax
jne 0xcf20
movq (%r14), %rdi
movq 0x8(%r14), %rax
subq %rdi, %rax
cmpq $0x40, %rax
jne 0xcf20
addq $0x20, %rdi
leaq 0x67eb(%rip), %rsi      # 0x13663
callq 0x20d0
testl %eax, %eax
je 0xd375
callq 0x69ac
movq (%r14), %rcx
movq 0x20(%rcx), %rsi
movq %rax, %rdi
callq 0x6a3e
leaq -0x50(%rbp), %rsi
movq %rax, (%rsi)
movq 0x28(%rbx), %rcx
movq %rax, (%rcx)
movq 0x20(%rbx), %rdi
callq 0xdb60
jmp 0xd76e
leaq 0x6783(%rip), %rsi      # 0x1363f
movq %r15, %rdi
callq 0x20d0
movq (%r14), %rdi
testl %eax, %eax
jne 0xcf96
movq 0x8(%r14), %rax
subq %rdi, %rax
cmpq $0x40, %rax
jne 0xcf96
addq $0x20, %rdi
leaq 0x6760(%rip), %rsi      # 0x1364b
callq 0x20d0
testl %eax, %eax
je 0xd47a
movq (%r14), %rdi
addq $0x20, %rdi
leaq 0x6750(%rip), %rsi      # 0x13656
callq 0x20d0
testl %eax, %eax
jne 0xd790
movq 0x20(%rbx), %rax
movb $0x1, 0xa(%rax)
jmp 0xd790
leaq 0x6746(%rip), %rsi      # 0x1366d
leaq -0x170(%rbp), %rdi
callq 0x20d0
testl %eax, %eax
jne 0xcfb3
movq (%r14), %rdi
movq 0x8(%r14), %rax
subq %rdi, %rax
cmpq $0x40, %rax
jne 0xcfb3
addq $0x20, %rdi
leaq 0x6711(%rip), %rsi      # 0x13663
callq 0x20d0
testl %eax, %eax
je 0xd375
callq 0x69ac
movq (%r14), %rcx
movq 0x20(%rcx), %rsi
movq %rax, %rdi
callq 0x6a3e
leaq -0x50(%rbp), %rsi
movq %rax, (%rsi)
movq 0x28(%rbx), %rcx
movq %rax, (%rcx)
movb $0x1, 0xaa(%rcx)
movq 0x20(%rbx), %rdi
callq 0xdb60
jmp 0xd76e
leaq 0x66bd(%rip), %rsi      # 0x1365a
addq $0x148, %rsp            # imm = 0x148
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x20d0
leaq 0x66bc(%rip), %rsi      # 0x13676
leaq -0x170(%rbp), %rdi
callq 0x20d0
testl %eax, %eax
movq %rbx, -0x30(%rbp)
je 0xd0f1
leaq 0x66a5(%rip), %rsi      # 0x1367e
leaq -0x170(%rbp), %rdi
callq 0x20d0
testl %eax, %eax
je 0xd1b8
leaq 0x671a(%rip), %rsi      # 0x1370e
leaq -0x170(%rbp), %rdi
callq 0x20d0
testl %eax, %eax
je 0xd76e
leaq 0x6709(%rip), %rsi      # 0x13718
leaq -0x170(%rbp), %rdi
callq 0x20d0
testl %eax, %eax
je 0xd3a3
leaq 0x6708(%rip), %rsi      # 0x13732
leaq -0x170(%rbp), %rdi
callq 0x20d0
testl %eax, %eax
je 0xd4f4
leaq 0x66fa(%rip), %rsi      # 0x1373f
leaq -0x170(%rbp), %rdi
callq 0x20d0
testl %eax, %eax
jne 0xd76e
movq (%r14), %rax
movq 0x8(%r14), %rcx
subq %rax, %rcx
cmpq $0x21, %rcx
jb 0xd76e
movl $0x1, %r15d
movl $0x1, %r13d
movl $0x88, %r12d
movq -0x30(%rbp), %rbx
cmpl $0x2, %r15d
jb 0xd09d
movq 0x28(%rbx), %rdi
addq %r12, %rdi
movl $0x20, %esi
callq 0x21d0
movq (%r14), %rax
shlq $0x5, %r13
movq 0x28(%rbx), %rdi
addq %r12, %rdi
movq (%rax,%r13), %rsi
movq 0x8(%rax,%r13), %rdx
callq 0x20e0
incl %r15d
movq (%r14), %rax
movq 0x8(%r14), %rcx
subq %rax, %rcx
sarq $0x5, %rcx
movq %r15, %r13
cmpq %r15, %rcx
ja 0xd083
jmp 0xd76e
leaq 0x6692(%rip), %rdi      # 0x1376d
addq $0x148, %rsp            # imm = 0x148
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2350
movq 0x28(%rbx), %rbx
movb $0x1, 0xa9(%rbx)
movq (%r14), %r15
movq 0x20(%r15), %rdi
callq 0x22d0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x20(%rbx)
movq 0x8(%r14), %rax
subq %r15, %rax
cmpq $0x41, %rax
jb 0xd76e
movl $0x2, %ebx
movl $0x3, %r13d
movq -0x30(%rbp), %rax
movq 0x28(%rax), %r12
callq 0x69ac
shlq $0x5, %rbx
movq (%r15,%rbx), %rsi
movq %rax, %rdi
callq 0x6a3e
movq %rax, -0x50(%rbp)
movq 0x10(%r12), %rsi
cmpq 0x18(%r12), %rsi
je 0xd168
movq %rax, (%rsi)
addq $0x8, %rsi
movq %rsi, 0x10(%r12)
jmp 0xd178
addq $0x8, %r12
movq %r12, %rdi
leaq -0x50(%rbp), %rdx
callq 0xe7e8
movl %r13d, %ebx
movq (%r14), %r15
movq 0x8(%r14), %rax
subq %r15, %rax
sarq $0x5, %rax
incl %r13d
cmpq %rbx, %rax
ja 0xd12d
jmp 0xd76e
leaq 0x6461(%rip), %rdi      # 0x135fe
movq %rax, %rsi
xorl %eax, %eax
addq $0x148, %rsp            # imm = 0x148
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2050
movq (%r14), %r15
movq 0x8(%r14), %rax
subq %r15, %rax
cmpq $0x60, %rax
jne 0xd385
leaq -0x40(%rbp), %r12
movq %r12, -0x10(%r12)
movq $0x0, -0x8(%r12)
movb $0x0, (%r12)
addq $0x20, %r15
leaq -0x50(%rbp), %rsi
movq %r15, %rdi
callq 0xd89f
leaq -0x60(%rbp), %r15
movq %r15, -0x10(%r15)
movq $0x0, -0x8(%r15)
movb $0x0, (%r15)
movq (%r14), %rdi
addq $0x40, %rdi
leaq -0x70(%rbp), %rsi
callq 0xd89f
callq 0x69ac
movq -0x50(%rbp), %rsi
movq %rax, %rdi
callq 0x6a3e
movq 0x28(%rbx), %rcx
movq %rax, 0x28(%rcx)
callq 0x69ac
movq -0x70(%rbp), %rsi
movq %rax, %rdi
callq 0x6a3e
movq 0x28(%rbx), %rcx
movq %rax, 0x30(%rcx)
leaq 0x6438(%rip), %rsi      # 0x13688
leaq -0x50(%rbp), %rdi
callq 0x20d0
testl %eax, %eax
jne 0xd27c
callq 0x69ac
leaq 0x642c(%rip), %rsi      # 0x13695
movq %rax, %rdi
callq 0x6a3e
movq 0x28(%rbx), %rcx
movq %rax, 0xb0(%rcx)
leaq 0x6424(%rip), %rsi      # 0x136a7
leaq -0x50(%rbp), %rdi
callq 0x20d0
testl %eax, %eax
jne 0xd2a8
leaq 0x6417(%rip), %rsi      # 0x136ae
leaq -0x70(%rbp), %rdi
callq 0x20d0
testl %eax, %eax
je 0xd592
leaq 0x63f8(%rip), %rsi      # 0x136a7
leaq -0x50(%rbp), %rdi
callq 0x20d0
testl %eax, %eax
jne 0xd2d4
leaq 0x63e4(%rip), %rsi      # 0x136a7
leaq -0x70(%rbp), %rdi
callq 0x20d0
testl %eax, %eax
je 0xd5a8
leaq 0x63ad(%rip), %rsi      # 0x13688
leaq -0x50(%rbp), %rdi
callq 0x20d0
testl %eax, %eax
jne 0xd300
leaq 0x63d3(%rip), %rsi      # 0x136c2
leaq -0x70(%rbp), %rdi
callq 0x20d0
testl %eax, %eax
je 0xd5be
leaq 0x63d2(%rip), %rsi      # 0x136d9
leaq -0x50(%rbp), %rdi
callq 0x20d0
testl %eax, %eax
jne 0xd32c
leaq 0x63cb(%rip), %rsi      # 0x136e6
leaq -0x70(%rbp), %rdi
callq 0x20d0
testl %eax, %eax
je 0xd5d4
leaq 0x63a6(%rip), %rsi      # 0x136d9
leaq -0x50(%rbp), %rdi
callq 0x20d0
testl %eax, %eax
jne 0xd5f3
leaq 0x6363(%rip), %rsi      # 0x136ae
leaq -0x70(%rbp), %rdi
callq 0x20d0
testl %eax, %eax
jne 0xd5f3
callq 0x69ac
leaq 0x538e(%rip), %rsi      # 0x126f6
movq %rax, %rdi
callq 0x6a3e
jmp 0xd5e8
movq 0x28(%rbx), %rax
movb $0x1, 0xa8(%rax)
jmp 0xd76e
callq 0x69ac
movq 0x20(%r15), %rsi
movq %rax, %rdi
callq 0x6a3e
movq 0x28(%rbx), %rcx
movq %rax, 0x28(%rcx)
jmp 0xd61d
movq -0x30(%rbp), %rax
movq 0x28(%rax), %rdi
cmpq $0x0, 0x70(%rdi)
je 0xd3c0
addq $0x68, %rdi
movl $0x2c, %esi
callq 0x21d0
movq (%r14), %rdi
addq $0x20, %rdi
leaq 0x6350(%rip), %rsi      # 0x1371e
callq 0x20d0
testl %eax, %eax
je 0xd487
movq (%r14), %rdi
addq $0x20, %rdi
leaq 0x633b(%rip), %rsi      # 0x13724
callq 0x20d0
testl %eax, %eax
je 0xd487
movq (%r14), %rdi
addq $0x20, %rdi
leaq 0x6327(%rip), %rsi      # 0x1372b
callq 0x20d0
testl %eax, %eax
je 0xd487
movq (%r14), %rax
movq 0x8(%r14), %rcx
subq %rax, %rcx
cmpq $0x21, %rcx
jb 0xd76e
movl $0x1, %ecx
movl $0x2, %r15d
movq -0x30(%rbp), %rbx
shlq $0x5, %rcx
movq 0x28(%rbx), %rdi
addq $0x68, %rdi
movq (%rax,%rcx), %rsi
movq 0x8(%rax,%rcx), %rdx
callq 0x20e0
movq 0x28(%rbx), %rdi
addq $0x68, %rdi
movl $0x20, %esi
callq 0x21d0
movl %r15d, %ecx
movq (%r14), %rax
movq 0x8(%r14), %rdx
subq %rax, %rdx
sarq $0x5, %rdx
incl %r15d
cmpq %rcx, %rdx
ja 0xd430
jmp 0xd76e
movq 0x20(%rbx), %rax
movb $0x1, 0x9(%rax)
jmp 0xd790
movq (%r14), %rax
movq 0x8(%r14), %rcx
subq %rax, %rcx
cmpq $0x21, %rcx
jb 0xd76e
movl $0x1, %ecx
movl $0x2, %r15d
movq -0x30(%rbp), %rbx
shlq $0x5, %rcx
movq 0x28(%rbx), %rdi
addq $0x48, %rdi
movq (%rax,%rcx), %rsi
movq 0x8(%rax,%rcx), %rdx
callq 0x20e0
movq 0x28(%rbx), %rdi
addq $0x48, %rdi
movl $0x20, %esi
callq 0x21d0
movl %r15d, %ecx
movq (%r14), %rax
movq 0x8(%r14), %rdx
subq %rax, %rdx
sarq $0x5, %rdx
incl %r15d
cmpq %rcx, %rdx
ja 0xd4aa
jmp 0xd76e
movq -0x30(%rbp), %rbx
movq 0x28(%rbx), %rdi
cmpq $0x0, 0x70(%rdi)
je 0xd515
addq $0x68, %rdi
movl $0x2c, %esi
callq 0x21d0
movq 0x28(%rbx), %rdi
addq $0x68, %rdi
leaq 0x6218(%rip), %rsi      # 0x13738
callq 0x2400
movq (%r14), %rax
movq 0x8(%r14), %rcx
subq %rax, %rcx
cmpq $0x21, %rcx
jb 0xd76e
movl $0x1, %ecx
movl $0x2, %r15d
movq -0x30(%rbp), %rbx
shlq $0x5, %rcx
movq 0x28(%rbx), %rdi
addq $0x68, %rdi
movq (%rax,%rcx), %rsi
movq 0x8(%rax,%rcx), %rdx
callq 0x20e0
movq 0x28(%rbx), %rdi
addq $0x68, %rdi
movl $0x20, %esi
callq 0x21d0
movl %r15d, %ecx
movq (%r14), %rax
movq 0x8(%r14), %rdx
subq %rax, %rdx
sarq $0x5, %rdx
incl %r15d
cmpq %rcx, %rdx
ja 0xd548
jmp 0xd76e
callq 0x69ac
leaq 0x6118(%rip), %rsi      # 0x136b6
movq %rax, %rdi
callq 0x6a3e
jmp 0xd5e8
callq 0x69ac
leaq 0x610a(%rip), %rsi      # 0x136be
movq %rax, %rdi
callq 0x6a3e
jmp 0xd5e8
callq 0x69ac
leaq 0x60cb(%rip), %rsi      # 0x13695
movq %rax, %rdi
callq 0x6a3e
jmp 0xd5e8
callq 0x69ac
leaq 0x5116(%rip), %rsi      # 0x126f6
movq %rax, %rdi
callq 0x6a3e
movq 0x28(%rbx), %rcx
movq %rax, 0xb0(%rcx)
movq -0x70(%rbp), %rdi
cmpq %r15, %rdi
je 0xd608
movq -0x60(%rbp), %rsi
incq %rsi
callq 0x2230
movq -0x50(%rbp), %rdi
cmpq %r12, %rdi
je 0xd61d
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x2230
movq (%r14), %rdi
addq $0x20, %rdi
leaq 0x60d2(%rip), %rsi      # 0x136fd
callq 0x20d0
testl %eax, %eax
je 0xd6c6
movq (%r14), %rdi
addq $0x20, %rdi
leaq 0x60bb(%rip), %rsi      # 0x13701
callq 0x20d0
testl %eax, %eax
je 0xd717
movq (%r14), %rdi
addq $0x20, %rdi
leaq 0x60a7(%rip), %rsi      # 0x13708
callq 0x20d0
testl %eax, %eax
jne 0xd76e
callq 0x69ac
leaq 0x601b(%rip), %rsi      # 0x13695
movq %rax, %rdi
callq 0x6a3e
movq -0x30(%rbp), %rbx
movq 0x28(%rbx), %rcx
movq %rax, 0xb0(%rcx)
callq 0x69ac
leaq 0x5feb(%rip), %rsi      # 0x13688
movq %rax, %rdi
callq 0x6a3e
movq 0x28(%rbx), %rcx
movq %rax, 0x28(%rcx)
callq 0x69ac
leaq 0x6009(%rip), %rsi      # 0x136c2
movq %rax, %rdi
callq 0x6a3e
jmp 0xd766
callq 0x69ac
leaq 0x5fec(%rip), %rsi      # 0x136be
movq %rax, %rdi
callq 0x6a3e
movq 0x28(%rbx), %rcx
movq %rax, 0xb0(%rcx)
callq 0x69ac
leaq 0x5fb6(%rip), %rsi      # 0x136a7
movq %rax, %rdi
callq 0x6a3e
movq 0x28(%rbx), %rcx
movq %rax, 0x28(%rcx)
callq 0x69ac
leaq 0x5f9a(%rip), %rsi      # 0x136a7
movq %rax, %rdi
callq 0x6a3e
jmp 0xd766
callq 0x69ac
leaq 0x4fd3(%rip), %rsi      # 0x126f6
movq %rax, %rdi
callq 0x6a3e
movq 0x28(%rbx), %rcx
movq %rax, 0xb0(%rcx)
callq 0x69ac
leaq 0x5f97(%rip), %rsi      # 0x136d9
movq %rax, %rdi
callq 0x6a3e
movq 0x28(%rbx), %rcx
movq %rax, 0x28(%rcx)
callq 0x69ac
leaq 0x5f50(%rip), %rsi      # 0x136ae
movq %rax, %rdi
callq 0x6a3e
movq 0x28(%rbx), %rcx
movq %rax, 0x30(%rcx)
movq -0x170(%rbp), %rdi
leaq -0x160(%rbp), %rax
cmpq %rax, %rdi
je 0xd790
movq -0x160(%rbp), %rsi
incq %rsi
callq 0x2230
addq $0x148, %rsp            # imm = 0x148
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xd7c9
jmp 0xd7c9
jmp 0xd7c9
jmp 0xd7c9
jmp 0xd7c9
jmp 0xd815
jmp 0xd815
jmp 0xd815
jmp 0xd7c9
jmp 0xd815
jmp 0xd815
jmp 0xd815
jmp 0xd7c9
movq %rax, %rbx
jmp 0xd7e1
jmp 0xd815
jmp 0xd815
jmp 0xd815
jmp 0xd7c9
movq %rax, %rbx
movq -0x70(%rbp), %rdi
cmpq %r15, %rdi
je 0xd7e1
movq -0x60(%rbp), %rsi
incq %rsi
callq 0x2230
movq -0x50(%rbp), %rdi
cmpq %r12, %rdi
je 0xd818
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x2230
jmp 0xd818
jmp 0xd815
jmp 0xd815
jmp 0xd815
movq %rax, %rbx
movl $0xb8, %esi
movq %r15, %rdi
jmp 0xd835
jmp 0xd815
jmp 0xd815
jmp 0xd815
jmp 0xd815
jmp 0xd815
movq %rax, %rbx
movq -0x170(%rbp), %rdi
leaq -0x160(%rbp), %rax
cmpq %rax, %rdi
je 0xd83a
movq -0x160(%rbp), %rsi
incq %rsi
callq 0x2230
movq %rbx, %rdi
callq 0x23c0