// File: /workspace/github_cpp_makefile_star2_O3/yhwu[P]sam2psl/sam2psl.cpp
// Function: main
int main(int argc, char* argv[])
{
  
  if ( argc>=2 ) {
    for( int i=1; i<argc; ++i) {
      if( string( argv[i]).find("-h")!=string::npos) 
	cout << "matches\tmisMatches\trepMatches\tnCount\tqNumInsert\t"
	     << "qBaseInsert\ttNumInsert\ttBaseInsert\tstrand\tqName\t"
	     << "qSize\tqStart\tqEnd\ttName\ttSize\t"
	     << "tStart\ttEnd\tblockCount\tblockSizes\tqStarts\t"
	     << "tStarts\tqBlocks\ttBlocks\t"
	     << "RI\tRNEXT\tPNEXT\tTLEN\tMAPQ\t"
	     << "AS\tMAPS\tFPAIRED\tFPROPER_PAIR\tFSECONDARY\t"
	     << "FQC\tFDUP"
	     << "\n";
    } 
  }
  
  string line;
  map<string,int> targetLen;  
  
  while( getline(cin, line) ) {
    istringstream iss(line);
    if ( line[0]=='@' ) {
      if ( line.find("@SQ")==string::npos ) continue; 
      string tmps, SN, LN;
      iss >> tmps >> SN >> LN;
      size_t p1=SN.find("SN:");
      if ( p1==string::npos ) continue; 
      SN=SN.substr(p1+3);
      p1=LN.find("LN:");
      if ( p1==string::npos ) continue; 
      LN=LN.substr(p1+3);
      targetLen[SN]=atoi(LN.c_str());
    }
    vector<string> field(0);
    string tmps;
    while( iss>>tmps ) field.push_back(tmps); 
    if( field.size()<11 ) continue;
    if( field[0][0]=='@' ) continue;
    
    PSL_st psl;
    SAM_st sam;
    FLAG_st flag;
    PSLComment_st pslc;
    
    sam.QNAME=field[0];
    sam.FLAG=atoi(field[1].c_str());
    sam.RNAME=field[2];
    sam.POS=atoi(field[3].c_str());
    sam.MAPQ=atoi(field[4].c_str());
    sam.CIGAR=field[5];
    sam.RNEXT=field[6];
    sam.PNEXT=atoi(field[7].c_str());
    sam.TLEN=atoi(field[8].c_str());
    sam.SEQ=field[9];
    sam.QUAL=field[10];
    sam.AS=-sam.SEQ.length();
    sam.NM=sam.SEQ.length();
    sam.MD="";
    int optionalField=0;
    for(int i=11; i<(int)field.size(); ++i) {
      if( field[i].substr(0,3)=="AS:" ) {
	size_t p=field[i].rfind(':');
	sam.AS=atoi( field[i].substr(p+1).c_str() );
	optionalField+=1;
      }
      if( field[i].substr(0,3)=="NM:" ) {
	size_t p=field[i].rfind(':');
	sam.NM=atoi( field[i].substr(p+1).c_str() );
	optionalField+=1;
      }
      if( field[i].substr(0,3)=="MD:" ) {
	size_t p=field[i].rfind(':');
	sam.MD=field[i].substr(p+1);
	optionalField+=1;
      }
      if( optionalField==3 ) break;
    }
    
    flag.FPAIRED = bool(sam.FLAG & BAM_FPAIRED);
    flag.FPROPER_PAIR = bool(sam.FLAG & BAM_FPROPER_PAIR);
    flag.FUNMAP = bool(sam.FLAG & BAM_FUNMAP);
    flag.FMUNMAP = bool(sam.FLAG & BAM_FMUNMAP);
    flag.FREVERSE = bool(sam.FLAG & BAM_FREVERSE); 
    flag.FMREVERSE = bool(sam.FLAG & BAM_FMREVERSE);
    flag.FREAD1 = bool(sam.FLAG & BAM_FREAD1);
    flag.FREAD2 = bool(sam.FLAG & BAM_FREAD2);
    flag.FSECONDARY = bool(sam.FLAG & BAM_FSECONDARY);
    flag.FQCFAIL = bool(sam.FLAG & BAM_FQCFAIL);
    flag.FDUP = bool(sam.FLAG & BAM_FDUP);

    POSCIGAR_st m;
    resolve_cigar_pos(sam.POS-1, sam.CIGAR, m);  // sam is 1-based, psl is 0-based
    if ( sam.SEQ.size() != m.l_qseq && m.l_qseq>0 ) {
      cerr << "SEQ length not calculated correctly\t"
	   << line << endl
	   << sam.SEQ.size() << "\t" << m.l_qseq << endl;
      exit(1);
    }
    
    psl.matches=0;
    psl.misMatches=sam.NM;
    psl.repMatches=0;
    psl.nCount=0;
    psl.qNumInsert=0;
    psl.qBaseInsert=0;
    psl.tNumInsert=0;
    psl.tBaseInsert=0;
    psl.strand= (sam.FLAG & BAM_FREVERSE) > 0 ? "-":"+";
    psl.qName=sam.QNAME;
    psl.qSize=sam.SEQ.size();
    psl.qStart=m.qStart;
    psl.qEnd=m.qEnd+1;  // m is 0-base closed, psl is 0-base half open
    psl.tName=sam.RNAME;
    psl.tSize=targetLen[sam.RNAME];
    psl.tStart=m.tStart;
    psl.tEnd=m.tEnd+1;  // m is 0-base closed, psl is 0-base half open
    psl.blockCount=0;
    psl.blockSizes.resize(0);
    psl.qStarts.resize(0);
    psl.tStarts.resize(0);
    for( int i=0; i<sam.SEQ.size(); ++i) {
      if( sam.SEQ[i]=='N' || sam.SEQ[i]=='n' ) psl.nCount+=1;
    }
    for( int i=0; i<m.op.size(); ++i) {
      if ( m.op[i] == BAM_CMATCH || 
	   m.op[i] == BAM_CDEL || 
	   m.op[i] == BAM_CEQUAL || 
	   m.op[i] == BAM_CDIFF) psl.matches+=m.nop[i];
      
      if ( m.op[i] == BAM_CINS ) {
	psl.qNumInsert+=1;
	psl.qBaseInsert+=m.nop[i];
      }
      
      if ( m.op[i] == BAM_CDEL ) {
	psl.tNumInsert+=1;
	psl.tBaseInsert+=m.nop[i];
      }
      
      if ( m.op[i] == BAM_CMATCH ) {
	psl.blockCount+=1;
	psl.blockSizes.push_back( m.nop[i] );
	psl.qStarts.push_back( m.qop[i] );
	psl.tStarts.push_back( m.top[i] );
      }
    }
    // note so far it is assumed strand is +
    if ( psl.strand=="-" ) {
      psl.qStart=psl.qSize-psl.qEnd;
      psl.qEnd=psl.qSize-psl.qStart;
      for(int i=0; i<psl.blockSizes.size(); ++i) {
	int qEndOnPlus=psl.qStarts[i]+psl.blockSizes[i];
	psl.qStarts[i]=psl.qSize-qEndOnPlus;
	// note tStart remain same
      }
      reverse(psl.blockSizes.begin(), psl.blockSizes.end());
      reverse(psl.qStarts.begin(), psl.qStarts.end());
      reverse(psl.tStarts.begin(), psl.tStarts.end());
    }
    
    pslc.RI=1;
    pslc.RNEXT=sam.RNEXT;
    pslc.PNEXT=sam.PNEXT-1; //SAM is 1-based
    pslc.TLEN=sam.TLEN;
    pslc.MAPQ=sam.MAPQ;
    pslc.AS=sam.AS;
    pslc.MAPS=psl.matches-psl.misMatches;
    pslc.FPAIRED=flag.FPAIRED;
    pslc.FPROPER_PAIR=flag.FPROPER_PAIR;
    pslc.FSECONDARY=flag.FSECONDARY;
    pslc.FQCFAIL=flag.FQCFAIL;
    pslc.FDUP=flag.FDUP;
    if ( !flag.FPAIRED ) pslc.RI=1;
    else {
      pslc.RI=0;
      if( flag.FREAD1 ) pslc.RI=1;
      if( flag.FREAD2 ) pslc.RI=2;
      if( pslc.RI==0 | flag.FREAD1==flag.FREAD2 ) {
	cerr << "check flag" << endl
	     << line << endl;
	exit(1);
      }
    }
    
    cout << "#"<< line << "\n";
    cout << psl.matches << "\t"
	 << psl.misMatches << "\t"
	 << psl.repMatches << "\t"
	 << psl.nCount << "\t"
	 << psl.qNumInsert << "\t"
	 << psl.qBaseInsert << "\t"
	 << psl.tNumInsert << "\t"
	 << psl.tBaseInsert << "\t"
	 << psl.strand << "\t"
	 << psl.qName << "\t"
	 << psl.qSize << "\t"
	 << psl.qStart << "\t"
	 << psl.qEnd << "\t"
	 << psl.tName << "\t"
	 << psl.tSize << "\t"
	 << psl.tStart << "\t"
	 << psl.tEnd << "\t"
	 << psl.blockCount << "\t";
    for(int i=0; i<psl.blockSizes.size(); ++i) cout << psl.blockSizes[i] << ",";
    cout << "\t";
    for(int i=0; i<psl.qStarts.size(); ++i) cout << psl.qStarts[i] << ",";
    cout << "\t";
    for(int i=0; i<psl.tStarts.size(); ++i) cout << psl.tStarts[i] << ",";
    cout << "\t";
    
    cout << "," << "\t";  // reserve for pslx
    cout << "," << "\t";  // reserve for pslx
    
    cout << pslc.RI << "\t"
	 << pslc.RNEXT << "\t"
	 << pslc.PNEXT << "\t"
	 << pslc.TLEN << "\t"
	 << pslc.MAPQ << "\t"
	 << pslc.AS << "\t"
	 << pslc.MAPS << "\t"
	 << "SP"[pslc.FPAIRED] << "\t"
	 << "UP"[pslc.FPROPER_PAIR] << "\t"
	 << "PS"[pslc.FSECONDARY] << "\t"
	 << "PF"[pslc.FQCFAIL] << "\t"
	 << "PD"[pslc.FDUP];
    
    cout << endl;
  }
  
  return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x578, %rsp            # imm = 0x578
cmpl $0x2, %edi
jl 0x2ae4
movq %rsi, %rbx
movl %edi, %r15d
movl $0x1, %r12d
leaq 0x3f8(%rsp), %r14
movq 0x5600(%rip), %r13      # 0x7fc8
movq (%rbx,%r12,8), %rsi
movq %r14, %rdi
leaq 0x170(%rsp), %rdx
callq 0x4486
movl $0x2, %ecx
movq %r14, %rdi
leaq 0x369e(%rip), %rsi      # 0x6089
xorl %edx, %edx
callq 0x22a0
movq %rax, %rbp
movq 0x3f8(%rsp), %rdi
leaq 0x408(%rsp), %rax
cmpq %rax, %rdi
je 0x2a1a
movq 0x408(%rsp), %rsi
incq %rsi
callq 0x2190
cmpq $-0x1, %rbp
je 0x2ad8
movl $0x30, %edx
movq %r13, %rdi
leaq 0x3659(%rip), %rsi      # 0x608c
callq 0x21c0
movl $0x30, %edx
movq %r13, %rdi
leaq 0x3676(%rip), %rsi      # 0x60bd
callq 0x21c0
movl $0x1e, %edx
movq %r13, %rdi
leaq 0x3693(%rip), %rsi      # 0x60ee
callq 0x21c0
movl $0x2a, %edx
movq %r13, %rdi
leaq 0x369e(%rip), %rsi      # 0x610d
callq 0x21c0
movl $0x18, %edx
movq %r13, %rdi
leaq 0x36b5(%rip), %rsi      # 0x6138
callq 0x21c0
movl $0x19, %edx
movq %r13, %rdi
leaq 0x36ba(%rip), %rsi      # 0x6151
callq 0x21c0
movl $0x28, %edx
movq %r13, %rdi
leaq 0x36c0(%rip), %rsi      # 0x616b
callq 0x21c0
movl $0x8, %edx
movq %r13, %rdi
leaq 0x36d5(%rip), %rsi      # 0x6194
callq 0x21c0
movl $0x1, %edx
movq %r13, %rdi
leaq 0x359e(%rip), %rsi      # 0x6071
callq 0x21c0
incq %r12
cmpq %r12, %r15
jne 0x29c8
leaq 0x40(%rsp), %rax
movq %rax, -0x10(%rax)
xorl %ecx, %ecx
movq %rcx, -0x8(%rax)
movb $0x0, (%rax)
leaq 0x3d0(%rsp), %rax
movl $0x0, (%rax)
movq %rcx, 0x8(%rax)
movq %rax, 0x10(%rax)
movq %rax, 0x18(%rax)
movq %rcx, 0x20(%rax)
leaq 0x2c0(%rsp), %r14
leaq 0xf0(%rsp), %r15
movl $0x80, %eax
leaq 0x170(%rsp), %rcx
leaq (%rcx,%rax), %rdx
movq %rdx, 0x3b8(%rsp)
leaq 0x2b0(%rsp), %rdx
addq %rdx, %rax
movq %rax, 0x3c0(%rsp)
movl $0xb8, %eax
addq %rax, %rdx
movq %rdx, 0x3b0(%rsp)
addq %rcx, %rax
movq %rax, 0x288(%rsp)
movq 0x5466(%rip), %r13      # 0x7fd8
leaq 0x3f8(%rsp), %rbx
movq 0x543f(%rip), %rbp      # 0x7fc0
leaq 0x290(%rsp), %r12
movq (%r13), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x2170
movsbl %al, %edx
movq %r13, %rdi
leaq 0x30(%rsp), %rsi
callq 0x22d0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x4233
movq %rbx, %rdi
leaq 0x30(%rsp), %rsi
movl $0x8, %edx
callq 0x2280
movq 0x30(%rsp), %rax
cmpb $0x40, (%rax)
jne 0x2e09
movl $0x3, %ecx
leaq 0x30(%rsp), %rdi
leaq 0x35ac(%rip), %rsi      # 0x619d
xorl %edx, %edx
callq 0x22a0
cmpq $-0x1, %rax
je 0x4216
leaq 0x180(%rsp), %rax
movq %rax, 0x170(%rsp)
xorl %eax, %eax
movq %rax, 0x178(%rsp)
movb %al, 0x180(%rsp)
movq %r14, 0x2b0(%rsp)
movq %rax, 0x2b8(%rsp)
movb %al, 0x2c0(%rsp)
movq %r15, 0xe0(%rsp)
movq %rax, 0xe8(%rsp)
movb %al, 0xf0(%rsp)
movq %rbx, %rdi
leaq 0x170(%rsp), %rsi
callq 0x21f0
movq %rax, %rdi
leaq 0x2b0(%rsp), %rsi
callq 0x21f0
movq %rax, %rdi
leaq 0xe0(%rsp), %rsi
callq 0x21f0
movl $0x3, %ecx
leaq 0x2b0(%rsp), %rdi
leaq 0x350c(%rip), %rsi      # 0x61a1
xorl %edx, %edx
callq 0x22a0
cmpq $-0x1, %rax
je 0x393b
addq $0x3, %rax
leaq 0x50(%rsp), %rbp
movq %rbp, %rdi
leaq 0x2b0(%rsp), %r13
movq %r13, %rsi
movq %rax, %rdx
movq $-0x1, %rcx
callq 0x21a0
movq %r13, %rdi
movq %rbp, %rsi
callq 0x21e0
movq 0x50(%rsp), %rdi
leaq 0x60(%rsp), %rax
cmpq %rax, %rdi
je 0x2cf3
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x2190
movl $0x3, %ecx
leaq 0xe0(%rsp), %rdi
leaq 0x349e(%rip), %rsi      # 0x61a5
xorl %edx, %edx
callq 0x22a0
cmpq $-0x1, %rax
movq 0x52bf(%rip), %r13      # 0x7fd8
movq 0x52a0(%rip), %rbp      # 0x7fc0
je 0x393b
addq $0x3, %rax
leaq 0x50(%rsp), %rbp
movq %rbp, %rdi
leaq 0xe0(%rsp), %r15
movq %r15, %rsi
movq %rax, %rdx
movq $-0x1, %rcx
callq 0x21a0
movq %r15, %rdi
movq %rbp, %rsi
callq 0x21e0
movq 0x50(%rsp), %rdi
leaq 0x60(%rsp), %rax
cmpq %rax, %rdi
je 0x2d73
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x2190
movq 0xe0(%rsp), %rdi
callq 0x2250
movl %eax, %r15d
leaq 0x3c8(%rsp), %rdi
leaq 0x2b0(%rsp), %rsi
callq 0x44f6
movq 0x5221(%rip), %rbp      # 0x7fc0
movl %r15d, (%rax)
movq 0xe0(%rsp), %rdi
leaq 0xf0(%rsp), %r15
cmpq %r15, %rdi
je 0x2dc7
movq 0xf0(%rsp), %rsi
incq %rsi
callq 0x2190
movq 0x2b0(%rsp), %rdi
cmpq %r14, %rdi
je 0x2de4
movq 0x2c0(%rsp), %rsi
incq %rsi
callq 0x2190
movq 0x170(%rsp), %rdi
leaq 0x180(%rsp), %rax
cmpq %rax, %rdi
je 0x2e09
movq 0x180(%rsp), %rsi
incq %rsi
callq 0x2190
pxor %xmm0, %xmm0
movdqa %xmm0, 0x10(%rsp)
xorl %eax, %eax
movq %rax, 0x20(%rsp)
leaq 0x2a0(%rsp), %rcx
movq %rcx, 0x290(%rsp)
movq %rax, 0x298(%rsp)
movb $0x0, 0x2a0(%rsp)
movq %rbx, %rdi
movq %r12, %rsi
callq 0x21f0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x2e62
leaq 0x10(%rsp), %rdi
movq %r12, %rsi
callq 0x4572
jmp 0x2e3a
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rax
subq %rsi, %rax
cmpq $0x160, %rax            # imm = 0x160
jb 0x41e7
movq (%rsi), %rax
cmpb $0x40, (%rax)
je 0x41e7
leaq 0x1a0(%rsp), %rax
movq %rax, 0x190(%rsp)
xorl %eax, %eax
movq %rax, 0x198(%rsp)
movb %al, 0x1a0(%rsp)
leaq 0x1c0(%rsp), %rcx
movq %rcx, 0x1b0(%rsp)
movq %rax, 0x1b8(%rsp)
movb %al, 0x1c0(%rsp)
movq 0x3b8(%rsp), %rcx
movq %rcx, 0x1e0(%rsp)
movq %rax, 0x1e8(%rsp)
movb %al, 0x1f0(%rsp)
leaq 0x210(%rsp), %rcx
movq %rax, 0x70(%rcx)
pxor %xmm0, %xmm0
movdqu %xmm0, 0x60(%rcx)
movdqu %xmm0, 0x50(%rcx)
movdqu %xmm0, 0x40(%rcx)
movdqu %xmm0, 0x30(%rcx)
movdqu %xmm0, 0x20(%rcx)
movdqu %xmm0, 0x10(%rcx)
movdqu %xmm0, (%rcx)
movq %r14, 0x2b0(%rsp)
movq %rax, 0x2b8(%rsp)
movb %al, 0x2c0(%rsp)
leaq 0x2e8(%rsp), %rcx
movq %rcx, 0x2d8(%rsp)
movq %rax, 0x2e0(%rsp)
movb %al, 0x2e8(%rsp)
leaq 0x310(%rsp), %rcx
movq %rcx, 0x300(%rsp)
movq %rax, 0x308(%rsp)
movb %al, 0x310(%rsp)
movq 0x3c0(%rsp), %rcx
movq %rcx, 0x320(%rsp)
movq %rax, 0x328(%rsp)
movb %al, 0x330(%rsp)
leaq 0x358(%rsp), %rcx
movq %rcx, 0x348(%rsp)
movq %rax, 0x350(%rsp)
movb %al, 0x358(%rsp)
leaq 0x378(%rsp), %rcx
movq %rcx, 0x368(%rsp)
movq %rax, 0x370(%rsp)
movb %al, 0x378(%rsp)
leaq 0x3a0(%rsp), %rcx
movq %rcx, 0x390(%rsp)
movq %rax, 0x398(%rsp)
movb %al, 0x3a0(%rsp)
leaq 0xf8(%rsp), %rcx
movq %rcx, 0xe8(%rsp)
movq %rax, 0xf0(%rsp)
movb %al, 0xf8(%rsp)
movq %rax, 0x78(%r15)
movdqu %xmm0, 0x68(%r15)
movdqu %xmm0, 0x58(%r15)
movdqu %xmm0, 0x48(%r15)
movdqu %xmm0, 0x38(%r15)
leaq 0x2b0(%rsp), %rdi
callq 0x20e0
movq 0x10(%rsp), %r15
movq 0x20(%r15), %rdi
callq 0x2250
movl %eax, 0x2d0(%rsp)
addq $0x40, %r15
leaq 0x2d8(%rsp), %rdi
movq %r15, %rsi
callq 0x20e0
movq 0x10(%rsp), %r15
movq 0x60(%r15), %rdi
callq 0x2250
movl %eax, 0x2f8(%rsp)
movq 0x80(%r15), %rdi
callq 0x2250
movl %eax, 0x2fc(%rsp)
addq $0xa0, %r15
leaq 0x300(%rsp), %rdi
movq %r15, %rsi
callq 0x20e0
movq 0x10(%rsp), %rsi
movl $0xc0, %eax
addq %rax, %rsi
leaq 0x320(%rsp), %rdi
callq 0x20e0
movq 0x10(%rsp), %r15
movq 0xe0(%r15), %rdi
callq 0x2250
movl %eax, 0x340(%rsp)
movq 0x100(%r15), %rdi
callq 0x2250
movl %eax, 0x344(%rsp)
addq $0x120, %r15            # imm = 0x120
leaq 0x348(%rsp), %rdi
movq %r15, %rsi
callq 0x20e0
movq 0x10(%rsp), %rsi
movl $0x140, %eax            # imm = 0x140
addq %rax, %rsi
movq 0x3b0(%rsp), %rdi
callq 0x20e0
movl 0x350(%rsp), %eax
movl %eax, %ecx
negl %ecx
movl %ecx, 0x388(%rsp)
movl %eax, 0x38c(%rsp)
movq 0x398(%rsp), %rdx
leaq 0x390(%rsp), %rdi
xorl %esi, %esi
leaq 0x2f2f(%rip), %rcx      # 0x6070
xorl %r8d, %r8d
callq 0x2240
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rax
subq %rsi, %rax
shrq $0x5, %rax
cmpl $0xc, %eax
leaq 0x50(%rsp), %r15
jl 0x33bf
xorl %r13d, %r13d
movl $0xb, %ebp
movl $0x160, %r14d           # imm = 0x160
addq %r14, %rsi
movl $0x3, %ecx
movq %r15, %rdi
xorl %edx, %edx
callq 0x21a0
movq %r15, %rdi
leaq 0x3017(%rip), %rsi      # 0x61a9
callq 0x2070
movl %eax, %r15d
movq 0x50(%rsp), %rdi
leaq 0x60(%rsp), %rax
cmpq %rax, %rdi
je 0x31b6
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x2190
testl %r15d, %r15d
jne 0x3222
movq 0x10(%rsp), %rdi
addq %r14, %rdi
movl $0x3a, %esi
movq $-0x1, %rdx
callq 0x22e0
movq 0x10(%rsp), %rsi
addq %r14, %rsi
leaq 0x1(%rax), %rdx
leaq 0x50(%rsp), %rdi
movq $-0x1, %rcx
callq 0x21a0
movq 0x50(%rsp), %r15
movq %r15, %rdi
callq 0x2250
movl %eax, 0x388(%rsp)
leaq 0x60(%rsp), %rax
cmpq %rax, %r15
je 0x321f
movq 0x60(%rsp), %rsi
incq %rsi
movq %r15, %rdi
callq 0x2190
incl %r13d
leaq 0x50(%rsp), %r15
movq 0x10(%rsp), %rsi
addq %r14, %rsi
movl $0x3, %ecx
movq %r15, %rdi
xorl %edx, %edx
callq 0x21a0
movq %r15, %rdi
leaq 0x2f65(%rip), %rsi      # 0x61ad
callq 0x2070
movl %eax, %r15d
movq 0x50(%rsp), %rdi
leaq 0x60(%rsp), %rax
cmpq %rax, %rdi
je 0x326c
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x2190
testl %r15d, %r15d
jne 0x32d8
movq 0x10(%rsp), %rdi
addq %r14, %rdi
movl $0x3a, %esi
movq $-0x1, %rdx
callq 0x22e0
movq 0x10(%rsp), %rsi
addq %r14, %rsi
leaq 0x1(%rax), %rdx
leaq 0x50(%rsp), %rdi
movq $-0x1, %rcx
callq 0x21a0
movq 0x50(%rsp), %r15
movq %r15, %rdi
callq 0x2250
movl %eax, 0x38c(%rsp)
leaq 0x60(%rsp), %rax
cmpq %rax, %r15
je 0x32d5
movq 0x60(%rsp), %rsi
incq %rsi
movq %r15, %rdi
callq 0x2190
incl %r13d
leaq 0x50(%rsp), %r15
movq 0x10(%rsp), %rsi
addq %r14, %rsi
movl $0x3, %ecx
movq %r15, %rdi
xorl %edx, %edx
callq 0x21a0
movq %r15, %rdi
leaq 0x2eb3(%rip), %rsi      # 0x61b1
callq 0x2070
movl %eax, %r15d
movq 0x50(%rsp), %rdi
leaq 0x60(%rsp), %rax
cmpq %rax, %rdi
je 0x3322
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x2190
testl %r15d, %r15d
je 0x332e
leaq 0x50(%rsp), %r15
jmp 0x3396
movq 0x10(%rsp), %rdi
addq %r14, %rdi
movl $0x3a, %esi
movq $-0x1, %rdx
callq 0x22e0
movq 0x10(%rsp), %rsi
addq %r14, %rsi
leaq 0x1(%rax), %rdx
leaq 0x50(%rsp), %r15
movq %r15, %rdi
movq $-0x1, %rcx
callq 0x21a0
leaq 0x390(%rsp), %rdi
movq %r15, %rsi
callq 0x21e0
movq 0x50(%rsp), %rdi
leaq 0x60(%rsp), %rax
cmpq %rax, %rdi
je 0x3393
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x2190
incl %r13d
cmpl $0x3, %r13d
je 0x33bf
incq %rbp
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rax
subq %rsi, %rax
shrq $0x5, %rax
cltq
addq $0x20, %r14
cmpq %rax, %rbp
jl 0x3176
movq %r15, %rdx
movl 0x2d0(%rsp), %r15d
pcmpeqd %xmm0, %xmm0
movdqu %xmm0, 0x6c(%rsp)
movdqa %xmm0, 0x60(%rsp)
movdqa %xmm0, 0x50(%rsp)
leaq 0x60(%rsp), %rax
pxor %xmm0, %xmm0
movdqu %xmm0, 0x70(%rax)
movdqu %xmm0, 0x60(%rax)
movdqu %xmm0, 0x50(%rax)
movdqu %xmm0, 0x40(%rax)
movdqu %xmm0, 0x30(%rax)
movdqu %xmm0, 0x20(%rax)
movl 0x2f8(%rsp), %edi
decl %edi
leaq 0x300(%rsp), %rsi
callq 0x243c
leaq 0x180(%rsp), %rcx
leaq 0x2b0(%rsp), %r14
leaq 0x2da6(%rip), %rbp      # 0x61da
movslq 0x78(%rsp), %rax
testq %rax, %rax
jle 0x344c
cmpq %rax, 0x350(%rsp)
jne 0x4270
movl $0x0, 0x170(%rsp)
movl 0x38c(%rsp), %eax
movl %eax, 0x174(%rsp)
pxor %xmm0, %xmm0
movdqu %xmm0, -0x8(%rcx)
movq $0x0, 0x8(%rcx)
testb $0x10, 0x2d0(%rsp)
movq %rbp, %rcx
leaq 0x2d54(%rip), %rax      # 0x61dc
cmoveq %rax, %rcx
movq 0x198(%rsp), %rdx
movl $0x1, %r8d
leaq 0x190(%rsp), %rdi
xorl %esi, %esi
callq 0x2240
leaq 0x1b0(%rsp), %rdi
movq %r14, %rsi
callq 0x20e0
movl 0x350(%rsp), %eax
movl %eax, 0x1d0(%rsp)
movl 0x5c(%rsp), %eax
movl 0x64(%rsp), %ecx
movl %eax, 0x1d4(%rsp)
incl %ecx
movl %ecx, 0x1d8(%rsp)
leaq 0x1e0(%rsp), %rdi
leaq 0x2d8(%rsp), %rsi
callq 0x20e0
leaq 0x3c8(%rsp), %rdi
leaq 0x2d8(%rsp), %rsi
callq 0x44f6
movl (%rax), %eax
movl %eax, 0x200(%rsp)
movl 0x60(%rsp), %eax
movl 0x68(%rsp), %ecx
movl %eax, 0x204(%rsp)
incl %ecx
movl %ecx, 0x208(%rsp)
movl $0x0, 0x20c(%rsp)
leaq 0x210(%rsp), %rdi
xorl %esi, %esi
callq 0x44c4
movq 0x288(%rsp), %rdi
xorl %esi, %esi
callq 0x44c4
leaq 0x240(%rsp), %rdi
xorl %esi, %esi
callq 0x44c4
movq 0x350(%rsp), %rax
testq %rax, %rax
je 0x359d
movl 0x17c(%rsp), %ecx
movq 0x348(%rsp), %rdx
xorl %esi, %esi
movzbl (%rdx,%rsi), %edi
orl $0x20, %edi
cmpl $0x6e, %edi
jne 0x3595
incl %ecx
movl %ecx, 0x17c(%rsp)
incq %rsi
cmpq %rsi, %rax
jne 0x3580
movq 0x80(%rsp), %rax
cmpq %rax, 0x88(%rsp)
je 0x3713
xorl %r14d, %r14d
xorl %r13d, %r13d
movl (%rax,%r14), %ecx
cmpl $0x8, %ecx
ja 0x35e3
movl $0x185, %edx            # imm = 0x185
btl %ecx, %edx
jae 0x35e3
movq 0x98(%rsp), %rcx
movl (%rcx,%r14), %ecx
addl %ecx, 0x170(%rsp)
movl (%rax,%r14), %ecx
cmpl $0x1, %ecx
jne 0x3606
incl 0x180(%rsp)
movq 0x98(%rsp), %rcx
movl (%rcx,%r14), %ecx
addl %ecx, 0x184(%rsp)
movl (%rax,%r14), %ecx
cmpl $0x2, %ecx
jne 0x3629
incl 0x188(%rsp)
movq 0x98(%rsp), %rcx
movl (%rcx,%r14), %ecx
addl %ecx, 0x18c(%rsp)
movl (%rax,%r14), %ecx
testl %ecx, %ecx
jne 0x36ec
incl 0x20c(%rsp)
movq 0x98(%rsp), %rdx
addq %r14, %rdx
movq 0x218(%rsp), %rsi
cmpq 0x220(%rsp), %rsi
je 0x3667
movl (%rdx), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x218(%rsp)
jmp 0x3674
leaq 0x210(%rsp), %rdi
callq 0x51aa
movq 0xb0(%rsp), %rdx
addq %r14, %rdx
movq 0x230(%rsp), %rsi
cmpq 0x238(%rsp), %rsi
je 0x36a3
movl (%rdx), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x230(%rsp)
jmp 0x36b0
movq 0x288(%rsp), %rdi
callq 0x51aa
movq 0xc8(%rsp), %rdx
addq %r14, %rdx
movq 0x248(%rsp), %rsi
cmpq 0x250(%rsp), %rsi
je 0x36df
movl (%rdx), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x248(%rsp)
jmp 0x36ec
leaq 0x240(%rsp), %rdi
callq 0x51aa
incq %r13
movq 0x80(%rsp), %rax
movq 0x88(%rsp), %rcx
subq %rax, %rcx
sarq $0x2, %rcx
addq $0x4, %r14
cmpq %r13, %rcx
ja 0x35b9
leaq 0x190(%rsp), %rdi
movq %rbp, %rsi
callq 0x2070
testl %eax, %eax
movq 0x489c(%rip), %r13      # 0x7fc8
jne 0x385c
movl 0x1d0(%rsp), %eax
subl 0x1d8(%rsp), %eax
movl %eax, 0x1d4(%rsp)
movq 0x218(%rsp), %rax
movq 0x210(%rsp), %rcx
movq %rax, %rdx
subq %rcx, %rdx
je 0x3794
sarq $0x2, %rdx
movq 0x228(%rsp), %rsi
cmpq $0x1, %rdx
adcq $0x0, %rdx
xorl %edi, %edi
movl (%rcx,%rdi,4), %r8d
movl 0x1d0(%rsp), %r9d
addl (%rsi,%rdi,4), %r8d
subl %r8d, %r9d
movl %r9d, (%rsi,%rdi,4)
incq %rdi
cmpq %rdi, %rdx
jne 0x3775
cmpq %rax, %rcx
setne %dl
addq $-0x4, %rax
cmpq %rcx, %rax
seta %sil
andb %dl, %sil
cmpb $0x1, %sil
jne 0x37cc
addq $0x4, %rcx
movl -0x4(%rcx), %edx
movl (%rax), %esi
movl %esi, -0x4(%rcx)
movl %edx, (%rax)
addq $-0x4, %rax
leaq 0x4(%rcx), %rdx
cmpq %rax, %rcx
movq %rdx, %rcx
jb 0x37b2
movq 0x228(%rsp), %rax
movq 0x230(%rsp), %rcx
cmpq %rcx, %rax
setne %dl
addq $-0x4, %rcx
cmpq %rax, %rcx
seta %sil
andb %dl, %sil
cmpb $0x1, %sil
jne 0x3814
addq $0x4, %rax
movl -0x4(%rax), %edx
movl (%rcx), %esi
movl %esi, -0x4(%rax)
movl %edx, (%rcx)
addq $-0x4, %rcx
leaq 0x4(%rax), %rdx
cmpq %rcx, %rax
movq %rdx, %rax
jb 0x37fa
movq 0x240(%rsp), %rax
movq 0x248(%rsp), %rcx
cmpq %rcx, %rax
setne %dl
addq $-0x4, %rcx
cmpq %rax, %rcx
seta %sil
andb %dl, %sil
cmpb $0x1, %sil
jne 0x385c
addq $0x4, %rax
movl -0x4(%rax), %edx
movl (%rcx), %esi
movl %esi, -0x4(%rax)
movl %edx, (%rcx)
addq $-0x4, %rcx
leaq 0x4(%rax), %rdx
cmpq %rcx, %rax
movq %rdx, %rax
jb 0x3842
movl $0x1, 0xe0(%rsp)
leaq 0xe8(%rsp), %rdi
leaq 0x320(%rsp), %rsi
callq 0x20e0
movl %r15d, %eax
andl $0x1, %eax
movl %r15d, %ecx
shrb %cl
andb $0x1, %cl
movl %r15d, %edx
shrl $0x8, %edx
andb $0x1, %dl
movl %r15d, %esi
shrl $0x9, %esi
andb $0x1, %sil
movl %r15d, %edi
shrl $0xa, %edi
andb $0x1, %dil
movl 0x2fc(%rsp), %r8d
movl 0x340(%rsp), %r9d
decl %r9d
movl %r9d, 0x108(%rsp)
movl 0x344(%rsp), %r9d
movl %r9d, 0x10c(%rsp)
movl %r8d, 0x110(%rsp)
movl 0x388(%rsp), %r8d
movl 0x170(%rsp), %r9d
subl 0x174(%rsp), %r9d
movl %r8d, 0x114(%rsp)
movl %r9d, 0x118(%rsp)
movb %al, 0x11c(%rsp)
movb %cl, 0x11d(%rsp)
movb %dl, 0x11e(%rsp)
movb %sil, 0x11f(%rsp)
movb %dil, 0x120(%rsp)
testl %eax, %eax
jne 0x39a3
movl $0x1, 0xe0(%rsp)
jmp 0x39da
movq 0xe0(%rsp), %rdi
cmpq %r15, %rdi
je 0x3958
movq 0xf0(%rsp), %rsi
incq %rsi
callq 0x2190
movq 0x2b0(%rsp), %rdi
cmpq %r14, %rdi
je 0x3975
movq 0x2c0(%rsp), %rsi
incq %rsi
callq 0x2190
movq 0x170(%rsp), %rdi
leaq 0x180(%rsp), %rax
cmpq %rax, %rdi
je 0x4216
movq 0x180(%rsp), %rsi
incq %rsi
callq 0x2190
jmp 0x4216
movl %r15d, %ecx
andl $0x80, %ecx
shrl $0x6, %r15d
andl $0x1, %r15d
testl %ecx, %ecx
movl $0x2, %eax
cmovel %r15d, %eax
movl %eax, 0xe0(%rsp)
shrl $0x7, %ecx
cmpl %ecx, %r15d
je 0x42e3
testl %eax, %eax
je 0x42e3
movl $0x1, %edx
movq %r13, %rdi
leaq 0x2800(%rip), %rsi      # 0x61e9
callq 0x21c0
movq 0x30(%rsp), %rsi
movq 0x38(%rsp), %rdx
movq %r13, %rdi
callq 0x21c0
movl $0x1, %edx
movq %rax, %rdi
leaq 0x2662(%rip), %rsi      # 0x6071
callq 0x21c0
movl 0x170(%rsp), %esi
movq %r13, %rdi
callq 0x2290
movq %rax, %r15
movl $0x1, %edx
movq %rax, %rdi
leaq 0x263a(%rip), %rsi      # 0x606f
callq 0x21c0
movl 0x174(%rsp), %esi
movq %r15, %rdi
callq 0x2290
movq %rax, %r15
movl $0x1, %edx
movq %rax, %rdi
leaq 0x2614(%rip), %rsi      # 0x606f
callq 0x21c0
movl 0x178(%rsp), %esi
movq %r15, %rdi
callq 0x2290
movq %rax, %r15
movl $0x1, %edx
movq %rax, %rdi
leaq 0x25ee(%rip), %rsi      # 0x606f
callq 0x21c0
movl 0x17c(%rsp), %esi
movq %r15, %rdi
callq 0x2290
movq %rax, %r15
movl $0x1, %edx
movq %rax, %rdi
leaq 0x25c8(%rip), %rsi      # 0x606f
callq 0x21c0
movl 0x180(%rsp), %esi
movq %r15, %rdi
callq 0x2290
movq %rax, %r15
movl $0x1, %edx
movq %rax, %rdi
leaq 0x25a2(%rip), %rsi      # 0x606f
callq 0x21c0
movl 0x184(%rsp), %esi
movq %r15, %rdi
callq 0x2290
movq %rax, %r15
movl $0x1, %edx
movq %rax, %rdi
leaq 0x257c(%rip), %rsi      # 0x606f
callq 0x21c0
movl 0x188(%rsp), %esi
movq %r15, %rdi
callq 0x2290
movq %rax, %r15
movl $0x1, %edx
movq %rax, %rdi
leaq 0x2556(%rip), %rsi      # 0x606f
callq 0x21c0
movl 0x18c(%rsp), %esi
movq %r15, %rdi
callq 0x2290
movq %rax, %r15
movl $0x1, %edx
movq %rax, %rdi
leaq 0x2530(%rip), %rsi      # 0x606f
callq 0x21c0
movq 0x190(%rsp), %rsi
movq 0x198(%rsp), %rdx
movq %r15, %rdi
callq 0x21c0
movq %rax, %r15
movl $0x1, %edx
movq %rax, %rdi
leaq 0x2501(%rip), %rsi      # 0x606f
callq 0x21c0
movq 0x1b0(%rsp), %rsi
movq 0x1b8(%rsp), %rdx
movq %r15, %rdi
callq 0x21c0
movq %rax, %r15
movl $0x1, %edx
movq %rax, %rdi
leaq 0x24d2(%rip), %rsi      # 0x606f
callq 0x21c0
movl 0x1d0(%rsp), %esi
movq %r15, %rdi
callq 0x2290
movq %rax, %r15
movl $0x1, %edx
movq %rax, %rdi
leaq 0x24ac(%rip), %rsi      # 0x606f
callq 0x21c0
movl 0x1d4(%rsp), %esi
movq %r15, %rdi
callq 0x2290
movq %rax, %r15
movl $0x1, %edx
movq %rax, %rdi
leaq 0x2486(%rip), %rsi      # 0x606f
callq 0x21c0
movl 0x1d8(%rsp), %esi
movq %r15, %rdi
callq 0x2290
movq %rax, %r15
movl $0x1, %edx
movq %rax, %rdi
leaq 0x2460(%rip), %rsi      # 0x606f
callq 0x21c0
movq 0x1e0(%rsp), %rsi
movq 0x1e8(%rsp), %rdx
movq %r15, %rdi
callq 0x21c0
movq %rax, %r15
movl $0x1, %edx
movq %rax, %rdi
leaq 0x2431(%rip), %rsi      # 0x606f
callq 0x21c0
movl 0x200(%rsp), %esi
movq %r15, %rdi
callq 0x2290
movq %rax, %r15
movl $0x1, %edx
movq %rax, %rdi
leaq 0x240b(%rip), %rsi      # 0x606f
callq 0x21c0
movl 0x204(%rsp), %esi
movq %r15, %rdi
callq 0x2290
movq %rax, %r15
movl $0x1, %edx
movq %rax, %rdi
leaq 0x23e5(%rip), %rsi      # 0x606f
callq 0x21c0
movl 0x208(%rsp), %esi
movq %r15, %rdi
callq 0x2290
movq %rax, %r15
movl $0x1, %edx
movq %rax, %rdi
leaq 0x23bf(%rip), %rsi      # 0x606f
callq 0x21c0
movl 0x20c(%rsp), %esi
movq %r15, %rdi
callq 0x2290
movl $0x1, %edx
movq %rax, %rdi
leaq 0x239c(%rip), %rsi      # 0x606f
callq 0x21c0
movq 0x210(%rsp), %rax
cmpq %rax, 0x218(%rsp)
je 0x3d2c
xorl %r14d, %r14d
movl (%rax,%r14,4), %esi
movq %r13, %rdi
callq 0x2290
movl $0x1, %edx
movq %rax, %rdi
leaq 0x24e3(%rip), %rsi      # 0x61eb
callq 0x21c0
incq %r14
movq 0x210(%rsp), %rax
movq 0x218(%rsp), %rcx
subq %rax, %rcx
sarq $0x2, %rcx
cmpq %r14, %rcx
ja 0x3ced
movl $0x1, %edx
movq %r13, %rdi
leaq 0x2334(%rip), %rsi      # 0x606f
callq 0x21c0
movq 0x228(%rsp), %rax
cmpq %rax, 0x230(%rsp)
je 0x3d94
xorl %r14d, %r14d
movl (%rax,%r14,4), %esi
movq %r13, %rdi
callq 0x2290
movl $0x1, %edx
movq %rax, %rdi
leaq 0x247b(%rip), %rsi      # 0x61eb
callq 0x21c0
incq %r14
movq 0x228(%rsp), %rax
movq 0x230(%rsp), %rcx
subq %rax, %rcx
sarq $0x2, %rcx
cmpq %r14, %rcx
ja 0x3d55
movl $0x1, %edx
movq %r13, %rdi
leaq 0x22cc(%rip), %rsi      # 0x606f
callq 0x21c0
movq 0x240(%rsp), %rax
cmpq %rax, 0x248(%rsp)
je 0x3dfc
xorl %r14d, %r14d
movl (%rax,%r14,4), %esi
movq %r13, %rdi
callq 0x2290
movl $0x1, %edx
movq %rax, %rdi
leaq 0x2413(%rip), %rsi      # 0x61eb
callq 0x21c0
incq %r14
movq 0x240(%rsp), %rax
movq 0x248(%rsp), %rcx
subq %rax, %rcx
sarq $0x2, %rcx
cmpq %r14, %rcx
ja 0x3dbd
movl $0x1, %edx
movq %r13, %rdi
leaq 0x2264(%rip), %rsi      # 0x606f
callq 0x21c0
movl $0x1, %edx
movq %r13, %rdi
leaq 0x23cc(%rip), %rsi      # 0x61eb
callq 0x21c0
movl $0x1, %edx
movq %r13, %rdi
leaq 0x223c(%rip), %rsi      # 0x606f
callq 0x21c0
movl $0x1, %edx
movq %r13, %rdi
leaq 0x23a4(%rip), %rsi      # 0x61eb
callq 0x21c0
movl $0x1, %edx
movq %r13, %rdi
leaq 0x2214(%rip), %rsi      # 0x606f
callq 0x21c0
movl 0xe0(%rsp), %esi
movq %r13, %rdi
callq 0x2290
movq %rax, %r15
movl $0x1, %edx
movq %rax, %rdi
leaq 0x21ee(%rip), %rsi      # 0x606f
callq 0x21c0
movq 0xe8(%rsp), %rsi
movq 0xf0(%rsp), %rdx
movq %r15, %rdi
callq 0x21c0
movq %rax, %r15
movl $0x1, %edx
movq %rax, %rdi
leaq 0x21bf(%rip), %rsi      # 0x606f
callq 0x21c0
movl 0x108(%rsp), %esi
movq %r15, %rdi
callq 0x2290
movq %rax, %r15
movl $0x1, %edx
movq %rax, %rdi
leaq 0x2199(%rip), %rsi      # 0x606f
callq 0x21c0
movl 0x10c(%rsp), %esi
movq %r15, %rdi
callq 0x2290
movq %rax, %r15
movl $0x1, %edx
movq %rax, %rdi
leaq 0x2173(%rip), %rsi      # 0x606f
callq 0x21c0
movl 0x110(%rsp), %esi
movq %r15, %rdi
callq 0x2290
movq %rax, %r15
movl $0x1, %edx
movq %rax, %rdi
leaq 0x214d(%rip), %rsi      # 0x606f
callq 0x21c0
movl 0x114(%rsp), %esi
movq %r15, %rdi
callq 0x2290
movq %rax, %r15
movl $0x1, %edx
movq %rax, %rdi
leaq 0x2127(%rip), %rsi      # 0x606f
callq 0x21c0
movl 0x118(%rsp), %esi
movq %r15, %rdi
callq 0x2290
movq %rax, %r15
movl $0x1, %edx
movq %rax, %rdi
leaq 0x2101(%rip), %rsi      # 0x606f
callq 0x21c0
movzbl 0x11c(%rsp), %eax
leaq 0x226b(%rip), %rcx      # 0x61ed
movb (%rax,%rcx), %al
movb %al, 0xf(%rsp)
movl $0x1, %edx
movq %r15, %rdi
leaq 0xf(%rsp), %rsi
callq 0x21c0
movq %rax, %r15
movl $0x1, %edx
movq %rax, %rdi
leaq 0x20c2(%rip), %rsi      # 0x606f
callq 0x21c0
movzbl 0x11d(%rsp), %eax
leaq 0x21d9(%rip), %rcx      # 0x619a
movb (%rax,%rcx), %al
movb %al, 0xf(%rsp)
movl $0x1, %edx
movq %r15, %rdi
leaq 0xf(%rsp), %rsi
callq 0x21c0
movq %rax, %r15
movl $0x1, %edx
movq %rax, %rdi
leaq 0x2083(%rip), %rsi      # 0x606f
callq 0x21c0
movzbl 0x11e(%rsp), %eax
leaq 0x21f0(%rip), %rcx      # 0x61f0
movb (%rax,%rcx), %al
movb %al, 0xf(%rsp)
movl $0x1, %edx
movq %r15, %rdi
leaq 0xf(%rsp), %rsi
callq 0x21c0
movq %rax, %r15
movl $0x1, %edx
movq %rax, %rdi
leaq 0x2044(%rip), %rsi      # 0x606f
callq 0x21c0
movzbl 0x11f(%rsp), %eax
leaq 0x21b4(%rip), %rcx      # 0x61f3
movb (%rax,%rcx), %al
movb %al, 0xf(%rsp)
movl $0x1, %edx
movq %r15, %rdi
leaq 0xf(%rsp), %rsi
callq 0x21c0
movq %rax, %r15
movl $0x1, %edx
movq %rax, %rdi
leaq 0x2005(%rip), %rsi      # 0x606f
callq 0x21c0
movzbl 0x120(%rsp), %eax
leaq 0x2178(%rip), %rcx      # 0x61f6
movb (%rax,%rcx), %al
movb %al, 0xf(%rsp)
movl $0x1, %edx
movq %r15, %rdi
leaq 0xf(%rsp), %rsi
callq 0x21c0
movq (%r13), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x2170
movsbl %al, %esi
movq %r13, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2110
movq 0xc8(%rsp), %rdi
testq %rdi, %rdi
je 0x40dc
movq 0xd8(%rsp), %rsi
subq %rdi, %rsi
callq 0x2190
movq 0xb0(%rsp), %rdi
testq %rdi, %rdi
leaq 0xf0(%rsp), %r15
movq 0x3eca(%rip), %rbp      # 0x7fc0
je 0x4108
movq 0xc0(%rsp), %rsi
subq %rdi, %rsi
callq 0x2190
movq 0x98(%rsp), %rdi
testq %rdi, %rdi
leaq 0x2c0(%rsp), %r14
movq 0x3eb6(%rip), %r13      # 0x7fd8
je 0x4134
movq 0xa8(%rsp), %rsi
subq %rdi, %rsi
callq 0x2190
movq 0x80(%rsp), %rdi
testq %rdi, %rdi
je 0x4151
movq 0x90(%rsp), %rsi
subq %rdi, %rsi
callq 0x2190
movq 0x158(%rsp), %rdi
testq %rdi, %rdi
je 0x416e
movq 0x168(%rsp), %rsi
subq %rdi, %rsi
callq 0x2190
movq 0x140(%rsp), %rdi
testq %rdi, %rdi
je 0x418b
movq 0x150(%rsp), %rsi
subq %rdi, %rsi
callq 0x2190
movq 0x128(%rsp), %rdi
testq %rdi, %rdi
je 0x41a8
movq 0x138(%rsp), %rsi
subq %rdi, %rsi
callq 0x2190
movq 0xe8(%rsp), %rdi
leaq 0xf8(%rsp), %rax
cmpq %rax, %rdi
je 0x41cd
movq 0xf8(%rsp), %rsi
incq %rsi
callq 0x2190
leaq 0x2b0(%rsp), %rdi
callq 0x4670
leaq 0x170(%rsp), %rdi
callq 0x4734
movq 0x290(%rsp), %rdi
leaq 0x2a0(%rsp), %rax
cmpq %rax, %rdi
je 0x420c
movq 0x2a0(%rsp), %rsi
incq %rsi
callq 0x2190
leaq 0x10(%rsp), %rdi
callq 0x47f0
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x2210
leaq 0x470(%rsp), %rdi
callq 0x2080
jmp 0x2b89
leaq 0x3c8(%rsp), %rdi
callq 0x485a
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0x425c
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x2190
xorl %eax, %eax
addq $0x578, %rsp            # imm = 0x578
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x3d79(%rip), %rdi      # 0x7ff0
leaq 0x1f37(%rip), %rsi      # 0x61b5
movl $0x24, %edx
callq 0x21c0
movq 0x30(%rsp), %rsi
movq 0x38(%rsp), %rdx
movq 0x3d57(%rip), %rdi      # 0x7ff0
callq 0x21c0
movq %rax, %rdi
callq 0x20c0
movq 0x350(%rsp), %rsi
movq %rax, %rdi
callq 0x2100
movq %rax, %rbx
leaq 0x1daf(%rip), %rsi      # 0x606f
movl $0x1, %edx
movq %rax, %rdi
callq 0x21c0
movl 0x78(%rsp), %esi
movq %rbx, %rdi
callq 0x2290
movq %rax, %rdi
callq 0x20c0
jmp 0x4321
movq 0x3d06(%rip), %rdi      # 0x7ff0
leaq 0x1eed(%rip), %rsi      # 0x61de
movl $0xa, %edx
callq 0x21c0
movq 0x3cee(%rip), %rdi      # 0x7ff0
callq 0x20c0
movq 0x30(%rsp), %rsi
movq 0x38(%rsp), %rdx
movq %rax, %rdi
callq 0x21c0
movq %rax, %rdi
callq 0x20c0
movl $0x1, %edi
callq 0x21d0
jmp 0x433c
jmp 0x433c
jmp 0x433c
jmp 0x43cc
jmp 0x43b7
jmp 0x43b7
jmp 0x43b7
movq %rax, %rbx
movq 0xe0(%rsp), %rdi
leaq 0xf0(%rsp), %rax
cmpq %rax, %rdi
je 0x4364
movq 0xf0(%rsp), %rsi
incq %rsi
callq 0x2190
movq 0x2b0(%rsp), %rdi
cmpq %r14, %rdi
je 0x4381
movq 0x2c0(%rsp), %rsi
incq %rsi
callq 0x2190
movq 0x170(%rsp), %rdi
leaq 0x180(%rsp), %rax
cmpq %rax, %rdi
je 0x4434
movq 0x180(%rsp), %rsi
incq %rsi
callq 0x2190
jmp 0x4434
jmp 0x43be
jmp 0x43b7
jmp 0x43b7
jmp 0x43b7
movq %rax, %rbx
jmp 0x43d9
jmp 0x43cc
movq %rax, %rbx
jmp 0x4455
jmp 0x43cc
jmp 0x43cc
jmp 0x43cc
movq %rax, %rbx
leaq 0x50(%rsp), %rdi
callq 0x45b0
leaq 0xe0(%rsp), %rdi
callq 0x460e
leaq 0x2b0(%rsp), %rdi
callq 0x4670
leaq 0x170(%rsp), %rdi
callq 0x4734
jmp 0x4405
movq %rax, %rbx
movq 0x290(%rsp), %rdi
leaq 0x2a0(%rsp), %rax
cmpq %rax, %rdi
je 0x442a
movq 0x2a0(%rsp), %rsi
incq %rsi
callq 0x2190
leaq 0x10(%rsp), %rdi
callq 0x47f0
movq 0x3b85(%rip), %rsi      # 0x7fc0
leaq 0x3f8(%rsp), %rdi
callq 0x2210
leaq 0x470(%rsp), %rdi
callq 0x2080
leaq 0x3c8(%rsp), %rdi
callq 0x485a
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0x447e
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x2190
movq %rbx, %rdi
callq 0x22b0