// File: 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:
subq $0xb68, %rsp            # imm = 0xB68
movl $0x0, 0xb64(%rsp)
movl %edi, 0xb60(%rsp)
movq %rsi, 0xb58(%rsp)
cmpl $0x2, 0xb60(%rsp)
jl 0x3367
movl $0x1, 0xb54(%rsp)
movl 0xb54(%rsp), %eax
cmpl 0xb60(%rsp), %eax
jge 0x3365
movq 0xb58(%rsp), %rax
movslq 0xb54(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, 0x3d0(%rsp)
leaq 0xb2f(%rsp), %rdi
movq %rdi, 0x3d8(%rsp)
callq 0x2390
movq 0x3d0(%rsp), %rsi
movq 0x3d8(%rsp), %rdx
leaq 0xb30(%rsp), %rdi
callq 0x54f0
jmp 0x324e
leaq 0xb30(%rsp), %rdi
leaq 0x6e10(%rip), %rsi      # 0xa06d
xorl %eax, %eax
movl %eax, %edx
callq 0x23d0
movq %rax, 0x3c8(%rsp)
leaq 0xb30(%rsp), %rdi
callq 0x2130
leaq 0xb2f(%rsp), %rdi
callq 0x2240
movq 0x3c8(%rsp), %rax
cmpq $-0x1, %rax
je 0x334d
movq 0xad27(%rip), %rdi      # 0xdfc8
leaq 0x6dc8(%rip), %rsi      # 0xa070
callq 0x21d0
movq %rax, %rdi
leaq 0x6dea(%rip), %rsi      # 0xa0a1
callq 0x21d0
movq %rax, %rdi
leaq 0x6e0c(%rip), %rsi      # 0xa0d2
callq 0x21d0
movq %rax, %rdi
leaq 0x6e1c(%rip), %rsi      # 0xa0f1
callq 0x21d0
movq %rax, %rdi
leaq 0x6e38(%rip), %rsi      # 0xa11c
callq 0x21d0
movq %rax, %rdi
leaq 0x6e42(%rip), %rsi      # 0xa135
callq 0x21d0
movq %rax, %rdi
leaq 0x6e4d(%rip), %rsi      # 0xa14f
callq 0x21d0
movq %rax, %rdi
leaq 0x6e67(%rip), %rsi      # 0xa178
callq 0x21d0
movq %rax, %rdi
leaq 0x6d35(%rip), %rsi      # 0xa055
callq 0x21d0
jmp 0x334d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xb20(%rsp)
movl %eax, 0xb1c(%rsp)
leaq 0xb2f(%rsp), %rdi
callq 0x2240
jmp 0x54a4
jmp 0x334f
movl 0xb54(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xb54(%rsp)
jmp 0x31ea
jmp 0x3367
leaq 0xaf8(%rsp), %rdi
callq 0x22f0
leaq 0xac8(%rsp), %rdi
callq 0x5700
movq 0xac50(%rip), %rdi      # 0xdfd8
leaq 0xaf8(%rsp), %rsi
callq 0x2070
movq %rax, 0x3c0(%rsp)
jmp 0x339f
movq 0x3c0(%rsp), %rdi
movq (%rdi), %rax
movq -0x18(%rax), %rax
addq %rax, %rdi
callq 0x22b0
movb %al, 0x3bf(%rsp)
jmp 0x33bf
movb 0x3bf(%rsp), %al
testb $0x1, %al
jne 0x33cf
jmp 0x544b
leaq 0x948(%rsp), %rdi
leaq 0xaf8(%rsp), %rsi
movl $0x8, %edx
callq 0x2360
jmp 0x33eb
xorl %eax, %eax
movl %eax, %esi
leaq 0xaf8(%rsp), %rdi
callq 0x23e0
movq %rax, 0x3b0(%rsp)
jmp 0x3406
movq 0x3b0(%rsp), %rax
movsbl (%rax), %eax
cmpl $0x40, %eax
jne 0x36ed
leaq 0xaf8(%rsp), %rdi
leaq 0x6d58(%rip), %rsi      # 0xa181
xorl %eax, %eax
movl %eax, %edx
callq 0x23d0
cmpq $-0x1, %rax
jne 0x347a
movl $0x5, 0x944(%rsp)
jmp 0x53d7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xb20(%rsp)
movl %eax, 0xb1c(%rsp)
jmp 0x548a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xb20(%rsp)
movl %eax, 0xb1c(%rsp)
jmp 0x543c
leaq 0x920(%rsp), %rdi
movq %rdi, 0x3a0(%rsp)
callq 0x22f0
leaq 0x900(%rsp), %rdi
callq 0x22f0
leaq 0x8e0(%rsp), %rdi
callq 0x22f0
movq 0x3a0(%rsp), %rsi
leaq 0x948(%rsp), %rdi
callq 0x22c0
movq %rax, 0x3a8(%rsp)
jmp 0x34c8
movq 0x3a8(%rsp), %rdi
leaq 0x900(%rsp), %rsi
callq 0x22c0
movq %rax, 0x398(%rsp)
jmp 0x34e7
movq 0x398(%rsp), %rdi
leaq 0x8e0(%rsp), %rsi
callq 0x22c0
jmp 0x34fe
leaq 0x900(%rsp), %rdi
leaq 0x6c78(%rip), %rsi      # 0xa185
xorl %eax, %eax
movl %eax, %edx
callq 0x23d0
movq %rax, 0x8d8(%rsp)
cmpq $-0x1, 0x8d8(%rsp)
jne 0x3579
movl $0x5, 0x944(%rsp)
jmp 0x36b3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xb20(%rsp)
movl %eax, 0xb1c(%rsp)
leaq 0x8e0(%rsp), %rdi
callq 0x2130
leaq 0x900(%rsp), %rdi
callq 0x2130
leaq 0x920(%rsp), %rdi
callq 0x2130
jmp 0x543c
movq 0x8d8(%rsp), %rdx
addq $0x3, %rdx
leaq 0x8b8(%rsp), %rdi
leaq 0x900(%rsp), %rsi
movq $-0x1, %rcx
callq 0x2200
jmp 0x35a3
leaq 0x900(%rsp), %rdi
leaq 0x8b8(%rsp), %rsi
callq 0x2290
leaq 0x8b8(%rsp), %rdi
callq 0x2130
leaq 0x8e0(%rsp), %rdi
leaq 0x6bb5(%rip), %rsi      # 0xa189
xorl %eax, %eax
movl %eax, %edx
callq 0x23d0
movq %rax, 0x8d8(%rsp)
cmpq $-0x1, 0x8d8(%rsp)
jne 0x3600
movl $0x5, 0x944(%rsp)
jmp 0x36b3
movq 0x8d8(%rsp), %rdx
addq $0x3, %rdx
leaq 0x898(%rsp), %rdi
leaq 0x8e0(%rsp), %rsi
movq $-0x1, %rcx
callq 0x2200
jmp 0x362a
leaq 0x8e0(%rsp), %rdi
movq %rdi, 0x380(%rsp)
leaq 0x898(%rsp), %rsi
movq %rsi, 0x378(%rsp)
callq 0x2290
movq 0x378(%rsp), %rdi
callq 0x2130
movq 0x380(%rsp), %rdi
callq 0x20d0
movq %rax, %rdi
callq 0x2330
movl %eax, 0x38c(%rsp)
leaq 0xac8(%rsp), %rdi
leaq 0x900(%rsp), %rsi
callq 0x5710
movq %rax, 0x390(%rsp)
jmp 0x3697
movq 0x390(%rsp), %rax
movl 0x38c(%rsp), %ecx
movl %ecx, (%rax)
movl $0x0, 0x944(%rsp)
leaq 0x8e0(%rsp), %rdi
callq 0x2130
leaq 0x900(%rsp), %rdi
callq 0x2130
leaq 0x920(%rsp), %rdi
callq 0x2130
movl 0x944(%rsp), %eax
testl %eax, %eax
jne 0x53d7
jmp 0x36eb
jmp 0x36ed
leaq 0x87f(%rsp), %rdi
movq %rdi, 0x370(%rsp)
callq 0x5800
movq 0x370(%rsp), %rdx
xorl %eax, %eax
movl %eax, %esi
leaq 0x880(%rsp), %rdi
callq 0x5810
jmp 0x371d
leaq 0x87f(%rsp), %rdi
callq 0x5890
leaq 0x858(%rsp), %rdi
callq 0x22f0
leaq 0x948(%rsp), %rdi
leaq 0x858(%rsp), %rsi
callq 0x22c0
movq %rax, 0x368(%rsp)
jmp 0x3756
movq 0x368(%rsp), %rdi
movq (%rdi), %rax
movq -0x18(%rax), %rax
addq %rax, %rdi
callq 0x22b0
movb %al, 0x367(%rsp)
jmp 0x3776
movb 0x367(%rsp), %al
testb $0x1, %al
jne 0x3783
jmp 0x37db
leaq 0x880(%rsp), %rdi
leaq 0x858(%rsp), %rsi
callq 0x58a0
jmp 0x379a
jmp 0x3737
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xb20(%rsp)
movl %eax, 0xb1c(%rsp)
leaq 0x87f(%rsp), %rdi
callq 0x5890
jmp 0x543c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xb20(%rsp)
movl %eax, 0xb1c(%rsp)
jmp 0x5422
leaq 0x880(%rsp), %rdi
callq 0x5910
cmpq $0xb, %rax
jae 0x37fe
movl $0x5, 0x944(%rsp)
jmp 0x53bd
xorl %eax, %eax
movl %eax, %esi
movq %rsi, 0x350(%rsp)
leaq 0x880(%rsp), %rdi
callq 0x5930
movq 0x350(%rsp), %rsi
movq %rax, %rdi
callq 0x23e0
movq %rax, 0x358(%rsp)
jmp 0x3831
movq 0x358(%rsp), %rax
movsbl (%rax), %eax
cmpl $0x40, %eax
jne 0x3851
movl $0x5, 0x944(%rsp)
jmp 0x53bd
leaq 0x740(%rsp), %rdi
callq 0x5950
leaq 0x640(%rsp), %rdi
movq %rdi, 0x348(%rsp)
callq 0x59f0
leaq 0x5a0(%rsp), %rdi
callq 0x5a70
xorl %eax, %eax
movl %eax, %esi
leaq 0x880(%rsp), %rdi
callq 0x5930
movq 0x348(%rsp), %rdi
movq %rax, %rsi
callq 0x2040
jmp 0x38a3
leaq 0x880(%rsp), %rdi
movq %rdi, 0x340(%rsp)
movl $0x1, %esi
callq 0x5930
movq %rax, %rdi
callq 0x20d0
movq %rax, %rdi
callq 0x2330
movq 0x340(%rsp), %rdi
movl %eax, 0x660(%rsp)
movl $0x2, %esi
callq 0x5930
movq %rax, %rsi
leaq 0x668(%rsp), %rdi
callq 0x2040
jmp 0x38f8
leaq 0x880(%rsp), %rdi
movq %rdi, 0x338(%rsp)
movl $0x3, %esi
callq 0x5930
movq %rax, %rdi
callq 0x20d0
movq %rax, %rdi
callq 0x2330
movq 0x338(%rsp), %rdi
movl %eax, 0x688(%rsp)
movl $0x4, %esi
callq 0x5930
movq %rax, %rdi
callq 0x20d0
movq %rax, %rdi
callq 0x2330
movq 0x338(%rsp), %rdi
movl %eax, 0x68c(%rsp)
movl $0x5, %esi
callq 0x5930
movq %rax, %rsi
leaq 0x690(%rsp), %rdi
callq 0x2040
jmp 0x3976
leaq 0x880(%rsp), %rdi
movl $0x6, %esi
callq 0x5930
movq %rax, %rsi
leaq 0x6b0(%rsp), %rdi
callq 0x2040
jmp 0x399a
leaq 0x880(%rsp), %rdi
movq %rdi, 0x330(%rsp)
movl $0x7, %esi
callq 0x5930
movq %rax, %rdi
callq 0x20d0
movq %rax, %rdi
callq 0x2330
movq 0x330(%rsp), %rdi
movl %eax, 0x6d0(%rsp)
movl $0x8, %esi
callq 0x5930
movq %rax, %rdi
callq 0x20d0
movq %rax, %rdi
callq 0x2330
movq 0x330(%rsp), %rdi
movl %eax, 0x6d4(%rsp)
movl $0x9, %esi
callq 0x5930
movq %rax, %rsi
leaq 0x6d8(%rsp), %rdi
callq 0x2040
jmp 0x3a18
leaq 0x880(%rsp), %rdi
movl $0xa, %esi
callq 0x5930
movq %rax, %rsi
leaq 0x6f8(%rsp), %rdi
callq 0x2040
jmp 0x3a3c
leaq 0x6d8(%rsp), %rdi
movq %rdi, 0x328(%rsp)
callq 0x2310
movq 0x328(%rsp), %rdi
negl %eax
movl %eax, 0x718(%rsp)
callq 0x2310
movl %eax, 0x71c(%rsp)
leaq 0x720(%rsp), %rdi
leaq 0x65d7(%rip), %rsi      # 0xa054
callq 0x22e0
jmp 0x3a84
movl $0x0, 0x59c(%rsp)
movl $0xb, 0x598(%rsp)
movl 0x598(%rsp), %eax
movl %eax, 0x324(%rsp)
leaq 0x880(%rsp), %rdi
callq 0x5910
movq %rax, %rcx
movl 0x324(%rsp), %eax
cmpl %ecx, %eax
jge 0x3ed9
movslq 0x598(%rsp), %rsi
leaq 0x880(%rsp), %rdi
callq 0x5930
movq %rax, %rsi
xorl %eax, %eax
movl %eax, %edx
leaq 0x578(%rsp), %rdi
movl $0x3, %ecx
callq 0x2200
jmp 0x3af7
leaq 0x668f(%rip), %rsi      # 0xa18d
leaq 0x578(%rsp), %rdi
callq 0x54c0
movb %al, 0x323(%rsp)
jmp 0x3b14
leaq 0x578(%rsp), %rdi
callq 0x2130
movb 0x323(%rsp), %al
testb $0x1, %al
jne 0x3b31
jmp 0x3c27
movslq 0x598(%rsp), %rsi
leaq 0x880(%rsp), %rdi
movq %rdi, 0x310(%rsp)
callq 0x5930
movq %rax, %rdi
movl $0x3a, %esi
movq $-0x1, %rdx
movq %rdx, 0x318(%rsp)
callq 0x23b0
movq 0x310(%rsp), %rdi
movq %rax, 0x570(%rsp)
movslq 0x598(%rsp), %rsi
callq 0x5930
movq 0x318(%rsp), %rcx
movq %rax, %rsi
movq 0x570(%rsp), %rdx
incq %rdx
leaq 0x550(%rsp), %rdi
callq 0x2200
jmp 0x3bac
leaq 0x550(%rsp), %rdi
callq 0x20d0
movq %rax, %rdi
callq 0x2330
movl %eax, 0x718(%rsp)
leaq 0x550(%rsp), %rdi
callq 0x2130
movl 0x59c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x59c(%rsp)
jmp 0x3c27
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xb20(%rsp)
movl %eax, 0xb1c(%rsp)
jmp 0x53fb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xb20(%rsp)
movl %eax, 0xb1c(%rsp)
leaq 0x578(%rsp), %rdi
callq 0x2130
jmp 0x53fb
movslq 0x598(%rsp), %rsi
leaq 0x880(%rsp), %rdi
callq 0x5930
movq %rax, %rsi
xorl %eax, %eax
movl %eax, %edx
leaq 0x530(%rsp), %rdi
movl $0x3, %ecx
callq 0x2200
jmp 0x3c57
leaq 0x6533(%rip), %rsi      # 0xa191
leaq 0x530(%rsp), %rdi
callq 0x54c0
movb %al, 0x30f(%rsp)
jmp 0x3c74
leaq 0x530(%rsp), %rdi
callq 0x2130
movb 0x30f(%rsp), %al
testb $0x1, %al
jne 0x3c91
jmp 0x3d6e
movslq 0x598(%rsp), %rsi
leaq 0x880(%rsp), %rdi
movq %rdi, 0x2f8(%rsp)
callq 0x5930
movq %rax, %rdi
movl $0x3a, %esi
movq $-0x1, %rdx
movq %rdx, 0x300(%rsp)
callq 0x23b0
movq 0x2f8(%rsp), %rdi
movq %rax, 0x528(%rsp)
movslq 0x598(%rsp), %rsi
callq 0x5930
movq 0x300(%rsp), %rcx
movq %rax, %rsi
movq 0x528(%rsp), %rdx
incq %rdx
leaq 0x508(%rsp), %rdi
callq 0x2200
jmp 0x3d0c
leaq 0x508(%rsp), %rdi
callq 0x20d0
movq %rax, %rdi
callq 0x2330
movl %eax, 0x71c(%rsp)
leaq 0x508(%rsp), %rdi
callq 0x2130
movl 0x59c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x59c(%rsp)
jmp 0x3d6e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xb20(%rsp)
movl %eax, 0xb1c(%rsp)
leaq 0x530(%rsp), %rdi
callq 0x2130
jmp 0x53fb
movslq 0x598(%rsp), %rsi
leaq 0x880(%rsp), %rdi
callq 0x5930
movq %rax, %rsi
xorl %eax, %eax
movl %eax, %edx
leaq 0x4e8(%rsp), %rdi
movl $0x3, %ecx
callq 0x2200
jmp 0x3d9e
leaq 0x63f0(%rip), %rsi      # 0xa195
leaq 0x4e8(%rsp), %rdi
callq 0x54c0
movb %al, 0x2f7(%rsp)
jmp 0x3dbb
leaq 0x4e8(%rsp), %rdi
callq 0x2130
movb 0x2f7(%rsp), %al
testb $0x1, %al
jne 0x3dd8
jmp 0x3eb5
movslq 0x598(%rsp), %rsi
leaq 0x880(%rsp), %rdi
movq %rdi, 0x2e0(%rsp)
callq 0x5930
movq %rax, %rdi
movl $0x3a, %esi
movq $-0x1, %rdx
movq %rdx, 0x2e8(%rsp)
callq 0x23b0
movq 0x2e0(%rsp), %rdi
movq %rax, 0x4e0(%rsp)
movslq 0x598(%rsp), %rsi
callq 0x5930
movq 0x2e8(%rsp), %rcx
movq %rax, %rsi
movq 0x4e0(%rsp), %rdx
incq %rdx
leaq 0x4c0(%rsp), %rdi
callq 0x2200
jmp 0x3e53
leaq 0x640(%rsp), %rdi
addq $0xe0, %rdi
leaq 0x4c0(%rsp), %rsi
callq 0x2290
leaq 0x4c0(%rsp), %rdi
callq 0x2130
movl 0x59c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x59c(%rsp)
jmp 0x3eb5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xb20(%rsp)
movl %eax, 0xb1c(%rsp)
leaq 0x4e8(%rsp), %rdi
callq 0x2130
jmp 0x53fb
cmpl $0x3, 0x59c(%rsp)
jne 0x3ec1
jmp 0x3ed9
jmp 0x3ec3
movl 0x598(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x598(%rsp)
jmp 0x3a9a
movb 0x660(%rsp), %al
andb $0x1, %al
movb %al, 0x635(%rsp)
movl 0x660(%rsp), %eax
andl $0x2, %eax
shrl %eax
movb %al, 0x636(%rsp)
movl 0x660(%rsp), %eax
andl $0x4, %eax
shrl $0x2, %eax
movb %al, 0x637(%rsp)
movl 0x660(%rsp), %eax
andl $0x8, %eax
shrl $0x3, %eax
movb %al, 0x638(%rsp)
movl 0x660(%rsp), %eax
andl $0x10, %eax
shrl $0x4, %eax
movb %al, 0x639(%rsp)
movl 0x660(%rsp), %eax
andl $0x20, %eax
shrl $0x5, %eax
movb %al, 0x63a(%rsp)
movl 0x660(%rsp), %eax
andl $0x40, %eax
shrl $0x6, %eax
movb %al, 0x63b(%rsp)
movb 0x660(%rsp), %al
shrb $0x7, %al
movb %al, 0x63c(%rsp)
movl 0x660(%rsp), %eax
shrl $0x8, %eax
andl $0x1, %eax
movb %al, 0x63d(%rsp)
movl 0x660(%rsp), %eax
shrl $0x9, %eax
andl $0x1, %eax
movb %al, 0x63e(%rsp)
movl 0x660(%rsp), %eax
shrl $0xa, %eax
andl $0x1, %eax
movb %al, 0x63f(%rsp)
leaq 0x430(%rsp), %rdi
callq 0x5ac0
jmp 0x3fbc
movl 0x688(%rsp), %edi
decl %edi
leaq 0x690(%rsp), %rsi
leaq 0x430(%rsp), %rdx
callq 0x2530
jmp 0x3fdc
leaq 0x640(%rsp), %rdi
addq $0x98, %rdi
callq 0x2160
movslq 0x458(%rsp), %rcx
cmpq %rcx, %rax
je 0x4112
cmpl $0x0, 0x458(%rsp)
jle 0x4112
movq 0x9fda(%rip), %rdi      # 0xdff0
leaq 0x617c(%rip), %rsi      # 0xa199
callq 0x21d0
movq %rax, 0x2d8(%rsp)
jmp 0x402c
movq 0x2d8(%rsp), %rdi
leaq 0xaf8(%rsp), %rsi
callq 0x21c0
movq %rax, 0x2d0(%rsp)
jmp 0x404b
movq 0x2d0(%rsp), %rdi
movq 0x9f5e(%rip), %rsi      # 0xdfb8
callq 0x2220
movq %rax, 0x2c8(%rsp)
jmp 0x4069
leaq 0x6d8(%rsp), %rdi
callq 0x2160
movq 0x2c8(%rsp), %rdi
movq %rax, %rsi
callq 0x2080
movq %rax, 0x2c0(%rsp)
jmp 0x4090
movq 0x2c0(%rsp), %rdi
leaq 0x5fb4(%rip), %rsi      # 0xa053
callq 0x21d0
movq %rax, 0x2b8(%rsp)
jmp 0x40ae
movq 0x2b8(%rsp), %rdi
movl 0x458(%rsp), %esi
callq 0x2370
movq %rax, 0x2b0(%rsp)
jmp 0x40cc
movq 0x2b0(%rsp), %rdi
movq 0x9edd(%rip), %rsi      # 0xdfb8
callq 0x2220
jmp 0x40e2
movl $0x1, %edi
callq 0x2280
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xb20(%rsp)
movl %eax, 0xb1c(%rsp)
leaq 0x430(%rsp), %rdi
callq 0x5c70
jmp 0x53fb
movl $0x0, 0x740(%rsp)
movl 0x71c(%rsp), %eax
movl %eax, 0x744(%rsp)
movl $0x0, 0x748(%rsp)
movl $0x0, 0x74c(%rsp)
movl $0x0, 0x750(%rsp)
movl $0x0, 0x754(%rsp)
movl $0x0, 0x758(%rsp)
movl $0x0, 0x75c(%rsp)
movl 0x660(%rsp), %eax
andl $0x10, %eax
cmpl $0x0, %eax
jle 0x418d
leaq 0x603b(%rip), %rax      # 0xa1be
movq %rax, 0x2a8(%rsp)
jmp 0x419e
leaq 0x602c(%rip), %rax      # 0xa1c0
movq %rax, 0x2a8(%rsp)
jmp 0x419e
movq 0x2a8(%rsp), %rsi
leaq 0x760(%rsp), %rdi
callq 0x22e0
jmp 0x41b5
leaq 0x780(%rsp), %rdi
leaq 0x640(%rsp), %rsi
callq 0x2040
jmp 0x41cc
leaq 0x6d8(%rsp), %rdi
callq 0x2160
movl %eax, 0x7a0(%rsp)
movl 0x43c(%rsp), %eax
movl %eax, 0x7a4(%rsp)
movl 0x444(%rsp), %eax
incl %eax
movl %eax, 0x7a8(%rsp)
leaq 0x668(%rsp), %rsi
leaq 0x7b0(%rsp), %rdi
callq 0x2040
jmp 0x4215
leaq 0x668(%rsp), %rsi
leaq 0xac8(%rsp), %rdi
callq 0x5710
movq %rax, 0x2a0(%rsp)
jmp 0x4234
movq 0x2a0(%rsp), %rax
movl (%rax), %eax
movl %eax, 0x7d0(%rsp)
movl 0x440(%rsp), %eax
movl %eax, 0x7d4(%rsp)
movl 0x448(%rsp), %eax
incl %eax
movl %eax, 0x7d8(%rsp)
movl $0x0, 0x7dc(%rsp)
leaq 0x7e0(%rsp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x55b0
jmp 0x4281
leaq 0x7f8(%rsp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x55b0
jmp 0x4294
leaq 0x810(%rsp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x55b0
jmp 0x42a7
movl $0x0, 0x42c(%rsp)
movslq 0x42c(%rsp), %rax
movq %rax, 0x298(%rsp)
leaq 0x640(%rsp), %rdi
addq $0x98, %rdi
callq 0x2160
movq %rax, %rcx
movq 0x298(%rsp), %rax
cmpq %rcx, %rax
jae 0x4371
leaq 0x6d8(%rsp), %rdi
movslq 0x42c(%rsp), %rsi
callq 0x23e0
movq %rax, 0x290(%rsp)
jmp 0x4309
movq 0x290(%rsp), %rax
movsbl (%rax), %eax
cmpl $0x4e, %eax
je 0x4348
leaq 0x6d8(%rsp), %rdi
movslq 0x42c(%rsp), %rsi
callq 0x23e0
movq %rax, 0x288(%rsp)
jmp 0x4338
movq 0x288(%rsp), %rax
movsbl (%rax), %eax
cmpl $0x6e, %eax
jne 0x4359
movl 0x74c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x74c(%rsp)
jmp 0x435b
movl 0x42c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x42c(%rsp)
jmp 0x42b2
movl $0x0, 0x428(%rsp)
movslq 0x428(%rsp), %rax
movq %rax, 0x280(%rsp)
leaq 0x430(%rsp), %rdi
addq $0x30, %rdi
callq 0x5680
movq %rax, %rcx
movq 0x280(%rsp), %rax
cmpq %rcx, %rax
jae 0x45f3
leaq 0x430(%rsp), %rdi
addq $0x30, %rdi
movslq 0x428(%rsp), %rsi
callq 0x56a0
cmpl $0x0, (%rax)
je 0x4429
leaq 0x430(%rsp), %rdi
addq $0x30, %rdi
movslq 0x428(%rsp), %rsi
callq 0x56a0
cmpl $0x2, (%rax)
je 0x4429
leaq 0x430(%rsp), %rdi
addq $0x30, %rdi
movslq 0x428(%rsp), %rsi
callq 0x56a0
cmpl $0x7, (%rax)
je 0x4429
leaq 0x430(%rsp), %rdi
addq $0x30, %rdi
movslq 0x428(%rsp), %rsi
callq 0x56a0
cmpl $0x8, (%rax)
jne 0x4452
leaq 0x430(%rsp), %rdi
addq $0x48, %rdi
movslq 0x428(%rsp), %rsi
callq 0x56a0
movl (%rax), %eax
addl 0x740(%rsp), %eax
movl %eax, 0x740(%rsp)
leaq 0x430(%rsp), %rdi
addq $0x30, %rdi
movslq 0x428(%rsp), %rsi
callq 0x56a0
cmpl $0x1, (%rax)
jne 0x44aa
movl 0x750(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x750(%rsp)
leaq 0x430(%rsp), %rdi
addq $0x48, %rdi
movslq 0x428(%rsp), %rsi
callq 0x56a0
movl (%rax), %eax
addl 0x754(%rsp), %eax
movl %eax, 0x754(%rsp)
leaq 0x430(%rsp), %rdi
addq $0x30, %rdi
movslq 0x428(%rsp), %rsi
callq 0x56a0
cmpl $0x2, (%rax)
jne 0x4502
movl 0x758(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x758(%rsp)
leaq 0x430(%rsp), %rdi
addq $0x48, %rdi
movslq 0x428(%rsp), %rsi
callq 0x56a0
movl (%rax), %eax
addl 0x75c(%rsp), %eax
movl %eax, 0x75c(%rsp)
leaq 0x430(%rsp), %rdi
addq $0x30, %rdi
movslq 0x428(%rsp), %rsi
callq 0x56a0
cmpl $0x0, (%rax)
jne 0x45db
movl 0x7dc(%rsp), %eax
incl %eax
movl %eax, 0x7dc(%rsp)
leaq 0x7e0(%rsp), %rax
movq %rax, 0x278(%rsp)
leaq 0x478(%rsp), %rdi
movslq 0x428(%rsp), %rsi
callq 0x56a0
movq 0x278(%rsp), %rdi
movq %rax, %rsi
callq 0x5b60
jmp 0x456b
leaq 0x7f8(%rsp), %rax
movq %rax, 0x270(%rsp)
leaq 0x490(%rsp), %rdi
movslq 0x428(%rsp), %rsi
callq 0x56a0
movq 0x270(%rsp), %rdi
movq %rax, %rsi
callq 0x5b60
jmp 0x45a2
leaq 0x810(%rsp), %rax
movq %rax, 0x268(%rsp)
leaq 0x4a8(%rsp), %rdi
movslq 0x428(%rsp), %rsi
callq 0x56a0
movq 0x268(%rsp), %rdi
movq %rax, %rsi
callq 0x5b60
jmp 0x45d9
jmp 0x45db
jmp 0x45dd
movl 0x428(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x428(%rsp)
jmp 0x437c
leaq 0x760(%rsp), %rdi
leaq 0x5bbc(%rip), %rsi      # 0xa1be
callq 0x54c0
movb %al, 0x267(%rsp)
jmp 0x4610
movb 0x267(%rsp), %al
testb $0x1, %al
jne 0x4620
jmp 0x480e
movl 0x7a0(%rsp), %eax
subl 0x7a8(%rsp), %eax
movl %eax, 0x7a4(%rsp)
movl 0x7a0(%rsp), %eax
subl 0x7a4(%rsp), %eax
movl %eax, 0x7a8(%rsp)
movl $0x0, 0x424(%rsp)
movslq 0x424(%rsp), %rax
movq %rax, 0x258(%rsp)
leaq 0x740(%rsp), %rdi
addq $0xa0, %rdi
callq 0x5680
movq %rax, %rcx
movq 0x258(%rsp), %rax
cmpq %rcx, %rax
jae 0x4731
leaq 0x740(%rsp), %rdi
addq $0xb8, %rdi
movslq 0x424(%rsp), %rsi
callq 0x56a0
movl (%rax), %eax
movl %eax, 0x250(%rsp)
leaq 0x740(%rsp), %rdi
addq $0xa0, %rdi
movslq 0x424(%rsp), %rsi
callq 0x56a0
movq %rax, %rcx
movl 0x250(%rsp), %eax
addl (%rcx), %eax
movl %eax, 0x420(%rsp)
movl 0x7a0(%rsp), %eax
subl 0x420(%rsp), %eax
movl %eax, 0x254(%rsp)
leaq 0x740(%rsp), %rdi
addq $0xb8, %rdi
movslq 0x424(%rsp), %rsi
callq 0x56a0
movl 0x254(%rsp), %ecx
movl %ecx, (%rax)
movl 0x424(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x424(%rsp)
jmp 0x4655
leaq 0x7e0(%rsp), %rdi
movq %rdi, 0x248(%rsp)
callq 0x5c10
movq 0x248(%rsp), %rdi
movq %rax, 0x418(%rsp)
callq 0x5c40
movq %rax, 0x410(%rsp)
movq 0x418(%rsp), %rdi
movq 0x410(%rsp), %rsi
callq 0x5bd0
jmp 0x477a
leaq 0x7f8(%rsp), %rdi
movq %rdi, 0x240(%rsp)
callq 0x5c10
movq 0x240(%rsp), %rdi
movq %rax, 0x408(%rsp)
callq 0x5c40
movq %rax, 0x400(%rsp)
movq 0x408(%rsp), %rdi
movq 0x400(%rsp), %rsi
callq 0x5bd0
jmp 0x47c3
leaq 0x810(%rsp), %rdi
movq %rdi, 0x238(%rsp)
callq 0x5c10
movq 0x238(%rsp), %rdi
movq %rax, 0x3f8(%rsp)
callq 0x5c40
movq %rax, 0x3f0(%rsp)
movq 0x3f8(%rsp), %rdi
movq 0x3f0(%rsp), %rsi
callq 0x5bd0
jmp 0x480c
jmp 0x480e
movl $0x1, 0x5a0(%rsp)
leaq 0x6b0(%rsp), %rsi
leaq 0x5a8(%rsp), %rdi
callq 0x2040
jmp 0x4830
movl 0x6d0(%rsp), %eax
subl $0x1, %eax
movl %eax, 0x5c8(%rsp)
movl 0x6d4(%rsp), %eax
movl %eax, 0x5cc(%rsp)
movl 0x68c(%rsp), %eax
movl %eax, 0x5d0(%rsp)
movl 0x718(%rsp), %eax
movl %eax, 0x5d4(%rsp)
movl 0x740(%rsp), %eax
subl 0x744(%rsp), %eax
movl %eax, 0x5d8(%rsp)
movb 0x635(%rsp), %al
andb $0x1, %al
movb %al, 0x5dc(%rsp)
movb 0x636(%rsp), %al
andb $0x1, %al
movb %al, 0x5dd(%rsp)
movb 0x63d(%rsp), %al
andb $0x1, %al
movb %al, 0x5de(%rsp)
movb 0x63e(%rsp), %al
andb $0x1, %al
movb %al, 0x5df(%rsp)
movb 0x63f(%rsp), %al
andb $0x1, %al
movb %al, 0x5e0(%rsp)
testb $0x1, 0x635(%rsp)
jne 0x48ea
movl $0x1, 0x5a0(%rsp)
jmp 0x49d7
movl $0x0, 0x5a0(%rsp)
testb $0x1, 0x63b(%rsp)
je 0x490a
movl $0x1, 0x5a0(%rsp)
testb $0x1, 0x63c(%rsp)
je 0x491f
movl $0x2, 0x5a0(%rsp)
cmpl $0x0, 0x5a0(%rsp)
sete %al
andb $0x1, %al
movzbl %al, %eax
movb 0x63b(%rsp), %cl
andb $0x1, %cl
movzbl %cl, %ecx
movb 0x63c(%rsp), %dl
andb $0x1, %dl
movzbl %dl, %edx
cmpl %edx, %ecx
sete %cl
andb $0x1, %cl
movzbl %cl, %ecx
orl %ecx, %eax
cmpl $0x0, %eax
je 0x49d5
movq 0x968e(%rip), %rdi      # 0xdff0
leaq 0x5859(%rip), %rsi      # 0xa1c2
callq 0x21d0
movq %rax, 0x230(%rsp)
jmp 0x4978
movq 0x230(%rsp), %rdi
movq 0x9631(%rip), %rsi      # 0xdfb8
callq 0x2220
movq %rax, 0x228(%rsp)
jmp 0x4996
movq 0x228(%rsp), %rdi
leaq 0xaf8(%rsp), %rsi
callq 0x21c0
movq %rax, 0x220(%rsp)
jmp 0x49b5
movq 0x220(%rsp), %rdi
movq 0x95f4(%rip), %rsi      # 0xdfb8
callq 0x2220
jmp 0x49cb
movl $0x1, %edi
callq 0x2280
jmp 0x49d7
movq 0x95ea(%rip), %rdi      # 0xdfc8
leaq 0x57e8(%rip), %rsi      # 0xa1cd
callq 0x21d0
movq %rax, 0x218(%rsp)
jmp 0x49f4
movq 0x218(%rsp), %rdi
leaq 0xaf8(%rsp), %rsi
callq 0x21c0
movq %rax, 0x210(%rsp)
jmp 0x4a13
movq 0x210(%rsp), %rdi
leaq 0x5633(%rip), %rsi      # 0xa055
callq 0x21d0
jmp 0x4a29
movl 0x740(%rsp), %esi
movq 0x9591(%rip), %rdi      # 0xdfc8
callq 0x2370
movq %rax, 0x208(%rsp)
jmp 0x4a46
movq 0x208(%rsp), %rdi
leaq 0x55fe(%rip), %rsi      # 0xa053
callq 0x21d0
movq %rax, 0x200(%rsp)
jmp 0x4a64
movq 0x200(%rsp), %rdi
movl 0x744(%rsp), %esi
callq 0x2370
movq %rax, 0x1f8(%rsp)
jmp 0x4a82
movq 0x1f8(%rsp), %rdi
leaq 0x55c2(%rip), %rsi      # 0xa053
callq 0x21d0
movq %rax, 0x1f0(%rsp)
jmp 0x4aa0
movq 0x1f0(%rsp), %rdi
movl 0x748(%rsp), %esi
callq 0x2370
movq %rax, 0x1e8(%rsp)
jmp 0x4abe
movq 0x1e8(%rsp), %rdi
leaq 0x5586(%rip), %rsi      # 0xa053
callq 0x21d0
movq %rax, 0x1e0(%rsp)
jmp 0x4adc
movq 0x1e0(%rsp), %rdi
movl 0x74c(%rsp), %esi
callq 0x2370
movq %rax, 0x1d8(%rsp)
jmp 0x4afa
movq 0x1d8(%rsp), %rdi
leaq 0x554a(%rip), %rsi      # 0xa053
callq 0x21d0
movq %rax, 0x1d0(%rsp)
jmp 0x4b18
movq 0x1d0(%rsp), %rdi
movl 0x750(%rsp), %esi
callq 0x2370
movq %rax, 0x1c8(%rsp)
jmp 0x4b36
movq 0x1c8(%rsp), %rdi
leaq 0x550e(%rip), %rsi      # 0xa053
callq 0x21d0
movq %rax, 0x1c0(%rsp)
jmp 0x4b54
movq 0x1c0(%rsp), %rdi
movl 0x754(%rsp), %esi
callq 0x2370
movq %rax, 0x1b8(%rsp)
jmp 0x4b72
movq 0x1b8(%rsp), %rdi
leaq 0x54d2(%rip), %rsi      # 0xa053
callq 0x21d0
movq %rax, 0x1b0(%rsp)
jmp 0x4b90
movq 0x1b0(%rsp), %rdi
movl 0x758(%rsp), %esi
callq 0x2370
movq %rax, 0x1a8(%rsp)
jmp 0x4bae
movq 0x1a8(%rsp), %rdi
leaq 0x5496(%rip), %rsi      # 0xa053
callq 0x21d0
movq %rax, 0x1a0(%rsp)
jmp 0x4bcc
movq 0x1a0(%rsp), %rdi
movl 0x75c(%rsp), %esi
callq 0x2370
movq %rax, 0x198(%rsp)
jmp 0x4bea
movq 0x198(%rsp), %rdi
leaq 0x545a(%rip), %rsi      # 0xa053
callq 0x21d0
movq %rax, 0x190(%rsp)
jmp 0x4c08
movq 0x190(%rsp), %rdi
leaq 0x760(%rsp), %rsi
callq 0x21c0
movq %rax, 0x188(%rsp)
jmp 0x4c27
movq 0x188(%rsp), %rdi
leaq 0x541d(%rip), %rsi      # 0xa053
callq 0x21d0
movq %rax, 0x180(%rsp)
jmp 0x4c45
movq 0x180(%rsp), %rdi
leaq 0x780(%rsp), %rsi
callq 0x21c0
movq %rax, 0x178(%rsp)
jmp 0x4c64
movq 0x178(%rsp), %rdi
leaq 0x53e0(%rip), %rsi      # 0xa053
callq 0x21d0
movq %rax, 0x170(%rsp)
jmp 0x4c82
movq 0x170(%rsp), %rdi
movl 0x7a0(%rsp), %esi
callq 0x2370
movq %rax, 0x168(%rsp)
jmp 0x4ca0
movq 0x168(%rsp), %rdi
leaq 0x53a4(%rip), %rsi      # 0xa053
callq 0x21d0
movq %rax, 0x160(%rsp)
jmp 0x4cbe
movq 0x160(%rsp), %rdi
movl 0x7a4(%rsp), %esi
callq 0x2370
movq %rax, 0x158(%rsp)
jmp 0x4cdc
movq 0x158(%rsp), %rdi
leaq 0x5368(%rip), %rsi      # 0xa053
callq 0x21d0
movq %rax, 0x150(%rsp)
jmp 0x4cfa
movq 0x150(%rsp), %rdi
movl 0x7a8(%rsp), %esi
callq 0x2370
movq %rax, 0x148(%rsp)
jmp 0x4d18
movq 0x148(%rsp), %rdi
leaq 0x532c(%rip), %rsi      # 0xa053
callq 0x21d0
movq %rax, 0x140(%rsp)
jmp 0x4d36
movq 0x140(%rsp), %rdi
leaq 0x7b0(%rsp), %rsi
callq 0x21c0
movq %rax, 0x138(%rsp)
jmp 0x4d55
movq 0x138(%rsp), %rdi
leaq 0x52ef(%rip), %rsi      # 0xa053
callq 0x21d0
movq %rax, 0x130(%rsp)
jmp 0x4d73
movq 0x130(%rsp), %rdi
movl 0x7d0(%rsp), %esi
callq 0x2370
movq %rax, 0x128(%rsp)
jmp 0x4d91
movq 0x128(%rsp), %rdi
leaq 0x52b3(%rip), %rsi      # 0xa053
callq 0x21d0
movq %rax, 0x120(%rsp)
jmp 0x4daf
movq 0x120(%rsp), %rdi
movl 0x7d4(%rsp), %esi
callq 0x2370
movq %rax, 0x118(%rsp)
jmp 0x4dcd
movq 0x118(%rsp), %rdi
leaq 0x5277(%rip), %rsi      # 0xa053
callq 0x21d0
movq %rax, 0x110(%rsp)
jmp 0x4deb
movq 0x110(%rsp), %rdi
movl 0x7d8(%rsp), %esi
callq 0x2370
movq %rax, 0x108(%rsp)
jmp 0x4e09
movq 0x108(%rsp), %rdi
leaq 0x523b(%rip), %rsi      # 0xa053
callq 0x21d0
movq %rax, 0x100(%rsp)
jmp 0x4e27
movq 0x100(%rsp), %rdi
movl 0x7dc(%rsp), %esi
callq 0x2370
movq %rax, 0xf8(%rsp)
jmp 0x4e45
movq 0xf8(%rsp), %rdi
leaq 0x51ff(%rip), %rsi      # 0xa053
callq 0x21d0
jmp 0x4e5b
movl $0x0, 0x3ec(%rsp)
movslq 0x3ec(%rsp), %rax
movq %rax, 0xf0(%rsp)
leaq 0x740(%rsp), %rdi
addq $0xa0, %rdi
callq 0x5680
movq %rax, %rcx
movq 0xf0(%rsp), %rax
cmpq %rcx, %rax
jae 0x4ef5
leaq 0x7e0(%rsp), %rdi
movslq 0x3ec(%rsp), %rsi
callq 0x56a0
movl (%rax), %esi
movq 0x9110(%rip), %rdi      # 0xdfc8
callq 0x2370
movq %rax, 0xe8(%rsp)
jmp 0x4ec7
movq 0xe8(%rsp), %rdi
leaq 0x52f9(%rip), %rsi      # 0xa1cf
callq 0x21d0
jmp 0x4edd
jmp 0x4edf
movl 0x3ec(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x3ec(%rsp)
jmp 0x4e66
movq 0x90cc(%rip), %rdi      # 0xdfc8
leaq 0x5150(%rip), %rsi      # 0xa053
callq 0x21d0
jmp 0x4f0a
movl $0x0, 0x3e8(%rsp)
movslq 0x3e8(%rsp), %rax
movq %rax, 0xe0(%rsp)
leaq 0x740(%rsp), %rdi
addq $0xb8, %rdi
callq 0x5680
movq %rax, %rcx
movq 0xe0(%rsp), %rax
cmpq %rcx, %rax
jae 0x4fa4
leaq 0x7f8(%rsp), %rdi
movslq 0x3e8(%rsp), %rsi
callq 0x56a0
movl (%rax), %esi
movq 0x9061(%rip), %rdi      # 0xdfc8
callq 0x2370
movq %rax, 0xd8(%rsp)
jmp 0x4f76
movq 0xd8(%rsp), %rdi
leaq 0x524a(%rip), %rsi      # 0xa1cf
callq 0x21d0
jmp 0x4f8c
jmp 0x4f8e
movl 0x3e8(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x3e8(%rsp)
jmp 0x4f15
movq 0x901d(%rip), %rdi      # 0xdfc8
leaq 0x50a1(%rip), %rsi      # 0xa053
callq 0x21d0
jmp 0x4fb9
movl $0x0, 0x3e4(%rsp)
movslq 0x3e4(%rsp), %rax
movq %rax, 0xd0(%rsp)
leaq 0x740(%rsp), %rdi
addq $0xd0, %rdi
callq 0x5680
movq %rax, %rcx
movq 0xd0(%rsp), %rax
cmpq %rcx, %rax
jae 0x5053
leaq 0x810(%rsp), %rdi
movslq 0x3e4(%rsp), %rsi
callq 0x56a0
movl (%rax), %esi
movq 0x8fb2(%rip), %rdi      # 0xdfc8
callq 0x2370
movq %rax, 0xc8(%rsp)
jmp 0x5025
movq 0xc8(%rsp), %rdi
leaq 0x519b(%rip), %rsi      # 0xa1cf
callq 0x21d0
jmp 0x503b
jmp 0x503d
movl 0x3e4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x3e4(%rsp)
jmp 0x4fc4
movq 0x8f6e(%rip), %rdi      # 0xdfc8
leaq 0x4ff2(%rip), %rsi      # 0xa053
callq 0x21d0
jmp 0x5068
movq 0x8f59(%rip), %rdi      # 0xdfc8
leaq 0x5159(%rip), %rsi      # 0xa1cf
callq 0x21d0
movq %rax, 0xc0(%rsp)
jmp 0x5085
movq 0xc0(%rsp), %rdi
leaq 0x4fbf(%rip), %rsi      # 0xa053
callq 0x21d0
jmp 0x509b
movq 0x8f26(%rip), %rdi      # 0xdfc8
leaq 0x5126(%rip), %rsi      # 0xa1cf
callq 0x21d0
movq %rax, 0xb8(%rsp)
jmp 0x50b8
movq 0xb8(%rsp), %rdi
leaq 0x4f8c(%rip), %rsi      # 0xa053
callq 0x21d0
jmp 0x50ce
movl 0x5a0(%rsp), %esi
movq 0x8eec(%rip), %rdi      # 0xdfc8
callq 0x2370
movq %rax, 0xb0(%rsp)
jmp 0x50eb
movq 0xb0(%rsp), %rdi
leaq 0x4f59(%rip), %rsi      # 0xa053
callq 0x21d0
movq %rax, 0xa8(%rsp)
jmp 0x5109
movq 0xa8(%rsp), %rdi
leaq 0x5a8(%rsp), %rsi
callq 0x21c0
movq %rax, 0xa0(%rsp)
jmp 0x5128
movq 0xa0(%rsp), %rdi
leaq 0x4f1c(%rip), %rsi      # 0xa053
callq 0x21d0
movq %rax, 0x98(%rsp)
jmp 0x5146
movq 0x98(%rsp), %rdi
movl 0x5c8(%rsp), %esi
callq 0x2370
movq %rax, 0x90(%rsp)
jmp 0x5164
movq 0x90(%rsp), %rdi
leaq 0x4ee0(%rip), %rsi      # 0xa053
callq 0x21d0
movq %rax, 0x88(%rsp)
jmp 0x5182
movq 0x88(%rsp), %rdi
movl 0x5cc(%rsp), %esi
callq 0x2370
movq %rax, 0x80(%rsp)
jmp 0x51a0
movq 0x80(%rsp), %rdi
leaq 0x4ea4(%rip), %rsi      # 0xa053
callq 0x21d0
movq %rax, 0x78(%rsp)
jmp 0x51bb
movq 0x78(%rsp), %rdi
movl 0x5d0(%rsp), %esi
callq 0x2370
movq %rax, 0x70(%rsp)
jmp 0x51d3
movq 0x70(%rsp), %rdi
leaq 0x4e74(%rip), %rsi      # 0xa053
callq 0x21d0
movq %rax, 0x68(%rsp)
jmp 0x51eb
movq 0x68(%rsp), %rdi
movl 0x5d4(%rsp), %esi
callq 0x2370
movq %rax, 0x60(%rsp)
jmp 0x5203
movq 0x60(%rsp), %rdi
leaq 0x4e44(%rip), %rsi      # 0xa053
callq 0x21d0
movq %rax, 0x58(%rsp)
jmp 0x521b
movq 0x58(%rsp), %rdi
movl 0x5d8(%rsp), %esi
callq 0x2370
movq %rax, 0x50(%rsp)
jmp 0x5233
movq 0x50(%rsp), %rdi
leaq 0x4e14(%rip), %rsi      # 0xa053
callq 0x21d0
movq %rax, 0x48(%rsp)
jmp 0x524b
movq 0x48(%rsp), %rdi
movzbl 0x5dc(%rsp), %eax
andl $0x1, %eax
leaq 0x4f6f(%rip), %rcx      # 0xa1d1
movsbl (%rax,%rcx), %esi
callq 0x2270
movq %rax, 0x40(%rsp)
jmp 0x5272
movq 0x40(%rsp), %rdi
leaq 0x4dd5(%rip), %rsi      # 0xa053
callq 0x21d0
movq %rax, 0x38(%rsp)
jmp 0x528a
movq 0x38(%rsp), %rdi
movzbl 0x5dd(%rsp), %eax
andl $0x1, %eax
leaq 0x4edd(%rip), %rcx      # 0xa17e
movsbl (%rax,%rcx), %esi
callq 0x2270
movq %rax, 0x30(%rsp)
jmp 0x52b1
movq 0x30(%rsp), %rdi
leaq 0x4d96(%rip), %rsi      # 0xa053
callq 0x21d0
movq %rax, 0x28(%rsp)
jmp 0x52c9
movq 0x28(%rsp), %rdi
movzbl 0x5de(%rsp), %eax
andl $0x1, %eax
leaq 0x4ef4(%rip), %rcx      # 0xa1d4
movsbl (%rax,%rcx), %esi
callq 0x2270
movq %rax, 0x20(%rsp)
jmp 0x52f0
movq 0x20(%rsp), %rdi
leaq 0x4d57(%rip), %rsi      # 0xa053
callq 0x21d0
movq %rax, 0x18(%rsp)
jmp 0x5308
movq 0x18(%rsp), %rdi
movzbl 0x5df(%rsp), %eax
andl $0x1, %eax
leaq 0x4eb8(%rip), %rcx      # 0xa1d7
movsbl (%rax,%rcx), %esi
callq 0x2270
movq %rax, 0x10(%rsp)
jmp 0x532f
movq 0x10(%rsp), %rdi
leaq 0x4d18(%rip), %rsi      # 0xa053
callq 0x21d0
movq %rax, 0x8(%rsp)
jmp 0x5347
movq 0x8(%rsp), %rdi
movzbl 0x5e0(%rsp), %eax
andl $0x1, %eax
leaq 0x4e7c(%rip), %rcx      # 0xa1da
movsbl (%rax,%rcx), %esi
callq 0x2270
jmp 0x5369
movq 0x8c58(%rip), %rdi      # 0xdfc8
movq 0x8c41(%rip), %rsi      # 0xdfb8
callq 0x2220
jmp 0x537e
leaq 0x430(%rsp), %rdi
callq 0x5c70
leaq 0x5a0(%rsp), %rdi
callq 0x5cc0
leaq 0x640(%rsp), %rdi
callq 0x5d10
leaq 0x740(%rsp), %rdi
callq 0x5d90
movl $0x0, 0x944(%rsp)
leaq 0x858(%rsp), %rdi
callq 0x2130
leaq 0x880(%rsp), %rdi
callq 0x5e30
leaq 0x948(%rsp), %rdi
callq 0x2100
movl 0x944(%rsp), %eax
testl %eax, %eax
je 0x53f6
jmp 0x53f1
jmp 0x3381
jmp 0x3381
leaq 0x5a0(%rsp), %rdi
callq 0x5cc0
leaq 0x640(%rsp), %rdi
callq 0x5d10
leaq 0x740(%rsp), %rdi
callq 0x5d90
leaq 0x858(%rsp), %rdi
callq 0x2130
leaq 0x880(%rsp), %rdi
callq 0x5e30
leaq 0x948(%rsp), %rdi
callq 0x2100
jmp 0x548a
movl $0x0, 0xb64(%rsp)
movl $0x1, 0x944(%rsp)
leaq 0xac8(%rsp), %rdi
callq 0x5e90
leaq 0xaf8(%rsp), %rdi
callq 0x2130
movl 0xb64(%rsp), %eax
addq $0xb68, %rsp            # imm = 0xB68
retq
leaq 0xac8(%rsp), %rdi
callq 0x5e90
leaq 0xaf8(%rsp), %rdi
callq 0x2130
movq 0xb20(%rsp), %rdi
callq 0x2380
nopw %cs:(%rax,%rax)
nopl (%rax,%rax)