// File: /workspace/github_cpp_makefile_star2_O3/atfrank[P]PCASA/src/casa.cpp
// Function: main
int main (int argc, char **argv){
  int i;
  unsigned int j;
  double cutoff;
  int beta;
  std::vector<std::string> pdbs;
  std::string currArg;
  std::string fparmfile;
  std::string freffile;
  std::string fsasa;
  std::vector<std::string> trajs;
  int start=0;
  int stop=std::numeric_limits<int>::max();
  int skip=0;
  bool startFlag=false;
  unsigned int itrj;
  std::ifstream trjin;
  Trajectory *ftrjin;
  unsigned int nframe;
  AnalyzeCasa *anin;
  std::string fchemshift;
  std::string identification;
  std::string errorType;
  bool header;
  bool predict;
  
  trajs.clear();
  ftrjin=NULL;
  nframe=0;
  anin=NULL;
  fparmfile="";
  freffile="";
  fsasa="";
  cutoff=10.0;
  beta=-1;
  header=false;
  predict=false;
  identification="test";

  for (i=1; i<argc; i++){
    currArg=argv[i];
    if (currArg.compare("-h") == 0 || currArg.compare("-help") == 0){
      usage();
    }
    else if (currArg.compare("-parmfile") == 0 || currArg.compare("-P") == 0 ){
      currArg=argv[++i];
      fparmfile=currArg;
    }      
    else if (currArg.compare("-reffile") == 0 || currArg.compare("-R") == 0 ){
      currArg=argv[++i];
      freffile=currArg;
    }      
    else if (currArg.compare("-sasafile") == 0 || currArg.compare("-S") == 0 ){
      currArg=argv[++i];
      fsasa=currArg;
    }      
    else if (currArg.compare("-header") == 0 || currArg.compare("-head") == 0 ){
      header=true;
    }
    else if (currArg.compare("-predict") == 0 || currArg.compare("-p") == 0 ){
      predict=true;
    }
    else if (currArg.compare("-cutoff") == 0 || currArg.compare("-c") == 0 ){
      currArg=argv[++i];
      cutoff=atof(currArg.c_str());
    }
    else if (currArg.compare("-beta") == 0 || currArg.compare("-b") == 0 ){
      currArg=argv[++i];
      std::stringstream(currArg) >> beta;
    }    
    else if (currArg.compare("-trj") == 0 || currArg.compare("-traj") == 0 || currArg.compare("-t") == 0){
      currArg=argv[++i];
      trajs.push_back(currArg);
    }
    else if (currArg.compare("-skip") == 0){
      currArg=argv[++i];
      std::stringstream(currArg) >> skip;
    }
    else if (currArg.compare("-start") == 0){
      currArg=argv[++i];
      std::stringstream(currArg) >> start;
      start--;
      startFlag=true;
    }
    else if (currArg.compare("-stop") == 0){
      currArg=argv[++i];
      std::stringstream(currArg) >> stop;
    }
    else if (currArg.compare("-identification") == 0 || currArg.compare("-i") == 0 ){
      currArg=argv[++i];
      identification=currArg;
    }
    else if (currArg.compare(0,1,"-") == 0){
      std::cerr << "Warning: Skipping unknown option \"" << currArg << "\"" << std::endl;
    }
    else{
      pdbs.push_back(currArg);
    }
  }

  if (pdbs.size() == 0){
    std::cerr << std::endl << "Error: Please provide an input file" << std::endl << std::endl;
    usage();
  }


  Molecule *mol=NULL;
  anin=new AnalyzeCasa;

  if (trajs.size() > 0){
    if (pdbs.size() > 1){
      std::cerr << std::endl << "Warning: Only the first PDB structure is used for trajectory analysis" << std::endl << std::endl;
    }
    /* Trajectory analysis */
    anin->addSel(":.CA");
    mol=Molecule::readPDB(pdbs.at(0));
    anin->preAnalysis(mol);
    
    /* Process trajectories */
    for (itrj=0; itrj< trajs.size(); itrj++){
      trjin.open(trajs.at(itrj).c_str(), std::ios::binary);
      if (trjin.is_open()){
        ftrjin=new Trajectory;
        ftrjin->setMolecule(mol);
        if (ftrjin->findFormat(trjin) == true){
          ftrjin->readHeader(trjin);
          if (skip > 0 && startFlag == false){
            start=skip;
          }
          /* Loop through desired frames */
          for (i=start; i< ftrjin->getNFrame() && i< stop; i=i+1+skip){
            if( ftrjin->readFrame(trjin, i) == false){
              std::cerr << "Warning: EOF found before the next frame could be read" << std::endl;
              break;
            }
            nframe++;
            anin->clearMol();
            anin->preAnalysis(mol);
            anin->runAnalysisCasa(nframe,identification,header,predict,fparmfile,freffile,fsasa,cutoff,beta);
          }
        }
        else{
          std::cerr << "Warning: Skipping unknown trajectory format \"";
          std::cerr << trajs.at(itrj) << "\"" << std::endl;
        }
        if (ftrjin != NULL){
          delete ftrjin;
        }
      }
      trjin.close();
    }
  }
  else { 
    Molecule *mol=NULL;
      for (j=0; j< pdbs.size(); j++){
        mol=Molecule::readPDB(pdbs.at(j));
        anin->addSel(":.CA");
        anin->preAnalysis(mol);
        anin->runAnalysisCasa(j+1,identification,header,predict,fparmfile,freffile,fsasa,cutoff,beta);
        delete mol;
      }
      if (anin != NULL){
        delete anin;
      }

      return 0;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x688, %rsp            # imm = 0x688
movq %rsi, %rbx
movl %edi, 0x18(%rsp)
xorl %eax, %eax
movq %rax, 0x70(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x60(%rsp)
leaq 0x88(%rsp), %rcx
movq %rcx, -0x10(%rcx)
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
leaq 0x108(%rsp), %rcx
movq %rcx, -0x10(%rcx)
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
leaq 0xe8(%rsp), %rcx
movq %rcx, -0x10(%rcx)
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
leaq 0xc8(%rsp), %rcx
movq %rcx, -0x10(%rcx)
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
movq %rax, 0x50(%rsp)
movaps %xmm0, 0x40(%rsp)
movl %eax, 0x4(%rsp)
movl $0x7fffffff, 0x3c(%rsp) # imm = 0x7FFFFFFF
movl %eax, 0x10(%rsp)
leaq 0x480(%rsp), %rdi
callq 0x4330
leaq 0x2e8(%rsp), %rcx
movq %rcx, -0x10(%rcx)
xorl %eax, %eax
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
leaq 0xa8(%rsp), %rcx
movq %rcx, -0x10(%rcx)
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
leaq 0x2c8(%rsp), %rcx
movq %rcx, -0x10(%rcx)
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
movq 0x40(%rsp), %r14
movq 0x48(%rsp), %r15
cmpq %r14, %r15
je 0x4d7d
leaq 0x10(%r14), %r12
movq -0x10(%r12), %rdi
cmpq %rdi, %r12
je 0x4d67
movq (%r12), %rsi
incq %rsi
callq 0x42e0
leaq 0x20(%r12), %rax
addq $0x10, %r12
cmpq %r15, %r12
movq %rax, %r12
jne 0x4d51
movq %r14, 0x48(%rsp)
leaq 0xf8(%rsp), %rdi
movq 0x8(%rdi), %rdx
leaq 0x36726(%rip), %rcx     # 0x3b4b6
xorl %esi, %esi
xorl %r8d, %r8d
callq 0x4470
leaq 0xd8(%rsp), %rdi
movq 0x8(%rdi), %rdx
leaq 0x36709(%rip), %rcx     # 0x3b4b6
xorl %esi, %esi
xorl %r8d, %r8d
callq 0x4470
leaq 0xb8(%rsp), %rdi
movq 0x8(%rdi), %rdx
leaq 0x366ec(%rip), %rcx     # 0x3b4b6
xorl %esi, %esi
xorl %r8d, %r8d
callq 0x4470
movl $0xffffffff, 0x14(%rsp) # imm = 0xFFFFFFFF
leaq 0x98(%rsp), %rdi
movq 0x8(%rdi), %rdx
leaq 0x36367(%rip), %rcx     # 0x3b156
movl $0x4, %r8d
xorl %esi, %esi
callq 0x4470
cmpl $0x2, 0x18(%rsp)
jl 0x53ae
leaq 0x2f8(%rsp), %rax
addq $0x80, %rax
movq %rax, 0x8(%rsp)
movl $0x1, %r15d
movsd 0x361e0(%rip), %xmm0    # 0x3b008
movsd %xmm0, 0x58(%rsp)
movq $0x0, 0x28(%rsp)
leaq 0x78(%rsp), %r12
movq $0x0, 0x30(%rsp)
movq $0x0, 0x20(%rsp)
movslq %r15d, %rbp
movq (%rbx,%rbp,8), %r13
movq 0x80(%rsp), %r14
movq %r13, %rdi
callq 0x4140
movq %r12, %rdi
xorl %esi, %esi
movq %r14, %rdx
movq %r13, %rcx
movq %rax, %r8
callq 0x4470
movq %r12, %rdi
leaq 0x362d9(%rip), %rsi     # 0x3b15b
callq 0x40e0
testl %eax, %eax
je 0x5ed4
movq %r12, %rdi
leaq 0x362c5(%rip), %rsi     # 0x3b15e
callq 0x40e0
testl %eax, %eax
je 0x5ed4
movq %r12, %rdi
leaq 0x362b4(%rip), %rsi     # 0x3b164
callq 0x40e0
testl %eax, %eax
je 0x50d0
movq %r12, %rdi
leaq 0x362a7(%rip), %rsi     # 0x3b16e
callq 0x40e0
testl %eax, %eax
je 0x50d0
movq %r12, %rdi
leaq 0x36293(%rip), %rsi     # 0x3b171
callq 0x40e0
testl %eax, %eax
je 0x510a
movq %r12, %rdi
leaq 0x36285(%rip), %rsi     # 0x3b17a
callq 0x40e0
testl %eax, %eax
je 0x510a
movq %r12, %rdi
leaq 0x36271(%rip), %rsi     # 0x3b17d
callq 0x40e0
testl %eax, %eax
je 0x5144
movq %r12, %rdi
leaq 0x36264(%rip), %rsi     # 0x3b187
callq 0x40e0
testl %eax, %eax
je 0x5144
movq %r12, %rdi
leaq 0x36250(%rip), %rsi     # 0x3b18a
callq 0x40e0
testl %eax, %eax
je 0x5192
movq %r12, %rdi
leaq 0x36241(%rip), %rsi     # 0x3b192
callq 0x40e0
testl %eax, %eax
je 0x5192
movq %r12, %rdi
leaq 0x36230(%rip), %rsi     # 0x3b198
callq 0x40e0
testl %eax, %eax
je 0x519b
movq %r12, %rdi
leaq 0x36222(%rip), %rsi     # 0x3b1a1
callq 0x40e0
testl %eax, %eax
je 0x519b
movq %r12, %rdi
leaq 0x3620e(%rip), %rsi     # 0x3b1a4
callq 0x40e0
testl %eax, %eax
je 0x51a4
movq %r12, %rdi
leaq 0x361ff(%rip), %rsi     # 0x3b1ac
callq 0x40e0
testl %eax, %eax
je 0x51a4
movq %r12, %rdi
leaq 0x361eb(%rip), %rsi     # 0x3b1af
callq 0x40e0
testl %eax, %eax
je 0x51e1
movq %r12, %rdi
leaq 0x361da(%rip), %rsi     # 0x3b1b5
callq 0x40e0
testl %eax, %eax
je 0x51e1
movq %r12, %rdi
leaq 0x361c6(%rip), %rsi     # 0x3b1b8
callq 0x40e0
testl %eax, %eax
je 0x524f
movq %r12, %rdi
leaq 0x361b4(%rip), %rsi     # 0x3b1bd
callq 0x40e0
testl %eax, %eax
je 0x524f
movq %r12, %rdi
leaq 0x361a3(%rip), %rsi     # 0x3b1c3
callq 0x40e0
testl %eax, %eax
je 0x524f
movq %r12, %rdi
leaq 0x3618f(%rip), %rsi     # 0x3b1c6
callq 0x40e0
testl %eax, %eax
je 0x526e
movq %r12, %rdi
leaq 0x3617e(%rip), %rsi     # 0x3b1cc
callq 0x40e0
testl %eax, %eax
je 0x52a2
movq %r12, %rdi
leaq 0x3616e(%rip), %rsi     # 0x3b1d3
callq 0x40e0
testl %eax, %eax
je 0x5322
movq %r12, %rdi
leaq 0x3615d(%rip), %rsi     # 0x3b1d9
callq 0x40e0
testl %eax, %eax
je 0x5300
movq %r12, %rdi
leaq 0x36156(%rip), %rsi     # 0x3b1e9
callq 0x40e0
testl %eax, %eax
je 0x5300
movl $0x1, %edx
movq %r12, %rdi
xorl %esi, %esi
leaq 0x37369(%rip), %rcx     # 0x3c41a
callq 0x43c0
testl %eax, %eax
je 0x5359
leaq 0x60(%rsp), %rdi
movq %r12, %rsi
callq 0x62ec
jmp 0x517f
movq 0x8(%rbx,%rbp,8), %r14
movq 0x80(%rsp), %r13
movq %r14, %rdi
callq 0x4140
movq %r12, %rdi
xorl %esi, %esi
movq %r13, %rdx
movq %r14, %rcx
movq %rax, %r8
callq 0x4470
leaq 0xf8(%rsp), %rdi
movq %r12, %rsi
callq 0x4180
jmp 0x517c
movq 0x8(%rbx,%rbp,8), %r14
movq 0x80(%rsp), %r13
movq %r14, %rdi
callq 0x4140
movq %r12, %rdi
xorl %esi, %esi
movq %r13, %rdx
movq %r14, %rcx
movq %rax, %r8
callq 0x4470
leaq 0xd8(%rsp), %rdi
movq %r12, %rsi
callq 0x4180
jmp 0x517c
movq 0x8(%rbx,%rbp,8), %r14
movq 0x80(%rsp), %r13
movq %r14, %rdi
callq 0x4140
movq %r12, %rdi
xorl %esi, %esi
movq %r13, %rdx
movq %r14, %rcx
movq %rax, %r8
callq 0x4470
leaq 0xb8(%rsp), %rdi
movq %r12, %rsi
callq 0x4180
incl %r15d
incl %r15d
cmpl 0x18(%rsp), %r15d
jl 0x4e4e
jmp 0x53c8
movb $0x1, %al
movq %rax, 0x30(%rsp)
jmp 0x517f
movb $0x1, %al
movq %rax, 0x28(%rsp)
jmp 0x517f
movq 0x8(%rbx,%rbp,8), %r14
movq 0x80(%rsp), %r13
movq %r14, %rdi
callq 0x4140
movq %r12, %rdi
xorl %esi, %esi
movq %r13, %rdx
movq %r14, %rcx
movq %rax, %r8
callq 0x4470
incl %r15d
movq 0x78(%rsp), %rdi
callq 0x4380
movsd %xmm0, 0x58(%rsp)
jmp 0x517f
movq 0x8(%rbx,%rbp,8), %r14
movq 0x80(%rsp), %r13
movq %r14, %rdi
callq 0x4140
movq %r12, %rdi
xorl %esi, %esi
movq %r13, %rdx
movq %r14, %rcx
movq %rax, %r8
callq 0x4470
leaq 0x2f8(%rsp), %r14
movq %r14, %rdi
movq %r12, %rsi
movl $0x18, %edx
callq 0x4490
movq %r14, %rdi
leaq 0x14(%rsp), %rsi
callq 0x41b0
incl %r15d
movq %r14, %rdi
movq 0x3ead6d(%rip), %rsi    # 0x3effa8
callq 0x4240
movq 0x8(%rsp), %rdi
callq 0x4110
jmp 0x517f
movq 0x8(%rbx,%rbp,8), %rsi
movq %r12, %rdi
callq 0x43f0
leaq 0x40(%rsp), %rdi
movq %r12, %rsi
callq 0x62ec
jmp 0x517c
movq 0x8(%rbx,%rbp,8), %rsi
movq %r12, %rdi
callq 0x43f0
leaq 0x2f8(%rsp), %r14
movq %r14, %rdi
movq %r12, %rsi
movl $0x18, %edx
callq 0x4490
movq %r14, %rdi
leaq 0x10(%rsp), %rsi
callq 0x41b0
jmp 0x522e
movq 0x8(%rbx,%rbp,8), %rsi
movq %r12, %rdi
callq 0x43f0
leaq 0x2f8(%rsp), %r14
movq %r14, %rdi
movq %r12, %rsi
movl $0x18, %edx
callq 0x4490
movq %r14, %rdi
leaq 0x4(%rsp), %rsi
callq 0x41b0
incl %r15d
movq %r14, %rdi
movq 0x3eacc7(%rip), %rsi    # 0x3effa8
callq 0x4240
movq 0x8(%rsp), %rdi
callq 0x4110
decl 0x4(%rsp)
movb $0x1, %al
movq %rax, 0x20(%rsp)
jmp 0x517f
movq 0x8(%rbx,%rbp,8), %rsi
movq %r12, %rdi
callq 0x43f0
leaq 0x98(%rsp), %rdi
movq %r12, %rsi
callq 0x4180
jmp 0x517c
movq 0x8(%rbx,%rbp,8), %rsi
movq %r12, %rdi
callq 0x43f0
leaq 0x2f8(%rsp), %r14
movq %r14, %rdi
movq %r12, %rsi
movl $0x18, %edx
callq 0x4490
movq %r14, %rdi
leaq 0x3c(%rsp), %rsi
callq 0x41b0
jmp 0x522e
movl $0x22, %edx
movq 0x3eac8b(%rip), %rdi    # 0x3efff0
leaq 0x35e80(%rip), %rsi     # 0x3b1ec
callq 0x4340
movq 0x78(%rsp), %rsi
movq 0x80(%rsp), %rdx
movq 0x3eac6b(%rip), %rdi    # 0x3efff0
callq 0x4340
movq %rax, %r14
movl $0x1, %edx
movq %rax, %rdi
leaq 0x370f4(%rip), %rsi     # 0x3c490
callq 0x4340
movq %r14, %rdi
callq 0x4150
jmp 0x517f
movb $0x1, 0x20(%rsp)
movsd 0x35c4d(%rip), %xmm0    # 0x3b008
movsd %xmm0, 0x58(%rsp)
xorl %ebp, %ebp
xorl %r13d, %r13d
jmp 0x53dc
testb $0x1, 0x20(%rsp)
sete 0x20(%rsp)
movq 0x28(%rsp), %r13
movq 0x30(%rsp), %rbp
movq 0x68(%rsp), %rax
cmpq 0x60(%rsp), %rax
je 0x5e3d
movl $0xd0, %edi
callq 0x42d0
movq %rax, %rbx
leaq 0x2a8(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x35e27(%rip), %rsi     # 0x3b233
leaq 0x35e21(%rip), %rdx     # 0x3b234
leaq 0x298(%rsp), %rdi
callq 0x6512
leaq 0x298(%rsp), %rsi
movq %rbx, %rdi
callq 0x6c0a
movq 0x298(%rsp), %rdi
cmpq %r15, %rdi
je 0x544d
movq 0x2a8(%rsp), %rsi
incq %rsi
callq 0x42e0
movq 0x48(%rsp), %rdx
movq 0x60(%rsp), %rax
movq 0x68(%rsp), %rcx
cmpq 0x40(%rsp), %rdx
je 0x59f3
subq %rax, %rcx
cmpq $0x21, %rcx
jb 0x550b
movq 0x3eab75(%rip), %rdi    # 0x3efff0
movq (%rdi), %rax
addq -0x18(%rax), %rdi
movl $0xa, %esi
callq 0x42a0
movsbl %al, %esi
movq 0x3eab5a(%rip), %rdi    # 0x3efff0
callq 0x4040
movq %rax, %rdi
callq 0x41f0
movq %rax, %r14
leaq 0x35d88(%rip), %rsi     # 0x3b235
movl $0x45, %edx
movq %rax, %rdi
callq 0x4340
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x42a0
movsbl %al, %esi
movq %r14, %rdi
callq 0x4040
movq %rax, %rdi
callq 0x41f0
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x42a0
movsbl %al, %esi
movq %r14, %rdi
callq 0x4040
movq %rax, %rdi
callq 0x41f0
leaq 0x308(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x35d5d(%rip), %rsi     # 0x3b27b
leaq 0x35d5a(%rip), %rdx     # 0x3b27f
leaq 0x2f8(%rsp), %rdi
callq 0x6512
leaq 0x2f8(%rsp), %rsi
movq %rbx, %rdi
callq 0x6e82
movq 0x2f8(%rsp), %rdi
cmpq %r15, %rdi
je 0x555f
movq 0x308(%rsp), %rsi
incq %rsi
callq 0x42e0
movq 0x60(%rsp), %rax
cmpq %rax, 0x68(%rsp)
je 0x5ed9
leaq 0x288(%rsp), %r15
movq %r15, -0x10(%r15)
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
leaq 0x278(%rsp), %rdi
callq 0x647c
leaq 0x268(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x35f10(%rip), %rdx     # 0x3b4b6
leaq 0x258(%rsp), %rdi
movq %rdx, %rsi
callq 0x6512
leaq 0x278(%rsp), %rdi
leaq 0x258(%rsp), %rdx
xorl %esi, %esi
movl $0x1, %ecx
callq 0x235fe
movq %rax, 0x18(%rsp)
movq 0x258(%rsp), %rdi
cmpq %r12, %rdi
je 0x55f4
movq 0x268(%rsp), %rsi
incq %rsi
callq 0x42e0
movq 0x278(%rsp), %rdi
cmpq %r15, %rdi
je 0x5611
movq 0x288(%rsp), %rsi
incq %rsi
callq 0x42e0
movq %rbx, %rdi
movq 0x18(%rsp), %rsi
callq 0xd3b2
movq 0x40(%rsp), %rax
cmpq %rax, 0x48(%rsp)
je 0x5d08
xorl %r15d, %r15d
movzbl %bpl, %ecx
andl $0x1, %ecx
movl %ecx, 0x30(%rsp)
movzbl %r13b, %ecx
andl $0x1, %ecx
movl %ecx, 0x28(%rsp)
xorl %ebp, %ebp
movq %r15, %r13
shlq $0x5, %r13
movq (%rax,%r13), %rsi
leaq 0x480(%rsp), %rdi
movl $0x4, %edx
callq 0x41c0
leaq 0x4f8(%rsp), %rdi
callq 0x40b0
testb %al, %al
je 0x59c4
movl $0x198, %edi            # imm = 0x198
callq 0x42d0
movq %rax, %r12
movq %rax, %rdi
callq 0x37318
movq %r12, %rdi
movq 0x18(%rsp), %rsi
callq 0x396c2
movq %r12, %rdi
leaq 0x480(%rsp), %rsi
callq 0x375fe
testb %al, %al
je 0x56e0
movq %r12, %rdi
leaq 0x480(%rsp), %rsi
callq 0x37730
movl 0x10(%rsp), %r13d
testl %r13d, %r13d
setg %al
testb %al, 0x20(%rsp)
je 0x576b
movl %r13d, 0x4(%rsp)
jmp 0x5770
movl $0x2d, %edx
movq 0x3ea904(%rip), %rdi    # 0x3efff0
leaq 0x35bc4(%rip), %rsi     # 0x3b2b7
callq 0x4340
movq 0x40(%rsp), %rax
movq 0x48(%rsp), %rdx
subq %rax, %rdx
sarq $0x5, %rdx
cmpq %r15, %rdx
jbe 0x5ede
movq (%rax,%r13), %rsi
movq 0x8(%rax,%r13), %rdx
movq 0x3ea8ce(%rip), %rdi    # 0x3efff0
callq 0x4340
movq %rax, %r13
movl $0x1, %edx
movq %rax, %rdi
leaq 0x36d57(%rip), %rsi     # 0x3c490
callq 0x4340
movq (%r13), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x42a0
movsbl %al, %esi
movq %r13, %rdi
callq 0x4040
movq %rax, %rdi
callq 0x41f0
jmp 0x59af
movl 0x4(%rsp), %r13d
movq %r12, %rdi
callq 0x384ea
cmpl %eax, %r13d
jge 0x59af
cmpl 0x3c(%rsp), %r13d
jge 0x59af
movq %r12, %rdi
leaq 0x480(%rsp), %rsi
movl %r13d, %edx
callq 0x38914
testb %al, %al
je 0x5965
movq %rbx, %rdi
callq 0x6f42
movq %rbx, %rdi
movq 0x18(%rsp), %rsi
callq 0xd3b2
leaq 0x1e8(%rsp), %rax
movq %rax, 0x1d8(%rsp)
movq 0x98(%rsp), %rsi
movq 0xa0(%rsp), %rdx
addq %rsi, %rdx
leaq 0x1d8(%rsp), %rdi
callq 0x647c
leaq 0x1c8(%rsp), %rax
movq %rax, 0x1b8(%rsp)
movq 0xf8(%rsp), %rsi
movq 0x100(%rsp), %rdx
addq %rsi, %rdx
leaq 0x1b8(%rsp), %rdi
callq 0x647c
leaq 0x1a8(%rsp), %rax
movq %rax, 0x198(%rsp)
movq 0xd8(%rsp), %rsi
movq 0xe0(%rsp), %rdx
addq %rsi, %rdx
leaq 0x198(%rsp), %rdi
callq 0x647c
leaq 0x248(%rsp), %rax
movq %rax, 0x238(%rsp)
movq 0xb8(%rsp), %rsi
movq 0xc0(%rsp), %rdx
addq %rsi, %rdx
leaq 0x238(%rsp), %r14
movq %r14, %rdi
callq 0x647c
incl %ebp
movl 0x14(%rsp), %eax
subq $0x8, %rsp
movq %rbx, %rdi
movl %ebp, %esi
leaq 0x1e0(%rsp), %rdx
movl 0x38(%rsp), %ecx
movl 0x30(%rsp), %r8d
leaq 0x1c0(%rsp), %r9
movsd 0x60(%rsp), %xmm0
pushq %rax
pushq %r14
leaq 0x1b0(%rsp), %rax
pushq %rax
callq 0x10204
addq $0x20, %rsp
movq 0x238(%rsp), %rdi
leaq 0x248(%rsp), %rax
cmpq %rax, %rdi
je 0x58e7
movq 0x248(%rsp), %rsi
incq %rsi
callq 0x42e0
movq 0x198(%rsp), %rdi
leaq 0x1a8(%rsp), %rax
cmpq %rax, %rdi
je 0x590c
movq 0x1a8(%rsp), %rsi
incq %rsi
callq 0x42e0
movq 0x1b8(%rsp), %rdi
leaq 0x1c8(%rsp), %rax
cmpq %rax, %rdi
je 0x5931
movq 0x1c8(%rsp), %rsi
incq %rsi
callq 0x42e0
movq 0x1d8(%rsp), %rdi
leaq 0x1e8(%rsp), %rax
cmpq %rax, %rdi
je 0x5956
movq 0x1e8(%rsp), %rsi
incq %rsi
callq 0x42e0
movl 0x10(%rsp), %eax
addl %eax, %r13d
incl %r13d
jmp 0x5770
movl $0x36, %edx
movq 0x3ea67f(%rip), %rdi    # 0x3efff0
leaq 0x35908(%rip), %rsi     # 0x3b280
callq 0x4340
movq 0x3ea66c(%rip), %rcx    # 0x3efff0
movq (%rcx), %rax
movq -0x18(%rax), %rdi
addq %rcx, %rdi
movl $0xa, %esi
callq 0x42a0
movsbl %al, %esi
movq 0x3ea64e(%rip), %rdi    # 0x3efff0
callq 0x4040
movq %rax, %rdi
callq 0x41f0
movq %r12, %rdi
callq 0x632a
movl $0x198, %esi            # imm = 0x198
movq %r12, %rdi
callq 0x42e0
leaq 0x480(%rsp), %rdi
callq 0x4090
incl %r15d
movq 0x40(%rsp), %rax
movq 0x48(%rsp), %rcx
subq %rax, %rcx
sarq $0x5, %rcx
cmpq %r15, %rcx
ja 0x5649
jmp 0x5d08
cmpq %rax, %rcx
je 0x5cff
movq %r13, %rdx
movq %rbp, %rsi
movl $0x1, %ebp
xorl %ecx, %ecx
movzbl %sil, %r13d
andl $0x1, %r13d
movzbl %dl, %r14d
andl $0x1, %r14d
shlq $0x5, %rcx
leaq 0x188(%rsp), %rdx
movq %rdx, 0x178(%rsp)
movq (%rax,%rcx), %rsi
movq 0x8(%rax,%rcx), %rdx
addq %rsi, %rdx
leaq 0x178(%rsp), %rdi
callq 0x647c
leaq 0x228(%rsp), %rax
movq %rax, 0x218(%rsp)
leaq 0x218(%rsp), %r12
movq %r12, %rdi
leaq 0x35a4e(%rip), %rdx     # 0x3b4b6
movq %rdx, %rsi
callq 0x6512
leaq 0x178(%rsp), %rdi
xorl %esi, %esi
movq %r12, %rdx
movl $0x1, %ecx
callq 0x235fe
movq %rax, %r12
movq 0x218(%rsp), %rdi
leaq 0x228(%rsp), %rax
cmpq %rax, %rdi
je 0x5aaf
movq 0x228(%rsp), %rsi
incq %rsi
callq 0x42e0
movq 0x178(%rsp), %rdi
leaq 0x188(%rsp), %rax
cmpq %rax, %rdi
je 0x5ad4
movq 0x188(%rsp), %rsi
incq %rsi
callq 0x42e0
leaq 0x308(%rsp), %rax
movq %rax, 0x2f8(%rsp)
leaq 0x2f8(%rsp), %r15
movq %r15, %rdi
leaq 0x35785(%rip), %rsi     # 0x3b27b
leaq 0x35782(%rip), %rdx     # 0x3b27f
callq 0x6512
movq %rbx, %rdi
movq %r15, %rsi
callq 0x6e82
movq 0x2f8(%rsp), %rdi
leaq 0x308(%rsp), %rax
cmpq %rax, %rdi
je 0x5b32
movq 0x308(%rsp), %rsi
incq %rsi
callq 0x42e0
movq %rbx, %rdi
movq %r12, %rsi
callq 0xd3b2
leaq 0x168(%rsp), %rax
movq %rax, 0x158(%rsp)
movq 0x98(%rsp), %rsi
movq 0xa0(%rsp), %rdx
addq %rsi, %rdx
leaq 0x158(%rsp), %rdi
callq 0x647c
leaq 0x148(%rsp), %rax
movq %rax, 0x138(%rsp)
movq 0xf8(%rsp), %rsi
movq 0x100(%rsp), %rdx
addq %rsi, %rdx
leaq 0x138(%rsp), %rdi
callq 0x647c
leaq 0x128(%rsp), %rax
movq %rax, 0x118(%rsp)
movq 0xd8(%rsp), %rsi
movq 0xe0(%rsp), %rdx
addq %rsi, %rdx
leaq 0x118(%rsp), %rdi
callq 0x647c
leaq 0x208(%rsp), %rax
movq %rax, 0x1f8(%rsp)
movq 0xb8(%rsp), %rsi
movq 0xc0(%rsp), %rdx
addq %rsi, %rdx
leaq 0x1f8(%rsp), %r15
movq %r15, %rdi
callq 0x647c
movl 0x14(%rsp), %eax
subq $0x8, %rsp
movq %rbx, %rdi
movl %ebp, %esi
leaq 0x160(%rsp), %rdx
movl %r13d, %ecx
movl %r14d, %r8d
leaq 0x140(%rsp), %r9
movsd 0x60(%rsp), %xmm0
pushq %rax
pushq %r15
leaq 0x130(%rsp), %rax
pushq %rax
callq 0x10204
addq $0x20, %rsp
movq 0x1f8(%rsp), %rdi
leaq 0x208(%rsp), %rax
cmpq %rax, %rdi
je 0x5c63
movq 0x208(%rsp), %rsi
incq %rsi
callq 0x42e0
movq 0x118(%rsp), %rdi
leaq 0x128(%rsp), %rax
cmpq %rax, %rdi
je 0x5c88
movq 0x128(%rsp), %rsi
incq %rsi
callq 0x42e0
movq 0x138(%rsp), %rdi
leaq 0x148(%rsp), %rax
cmpq %rax, %rdi
je 0x5cad
movq 0x148(%rsp), %rsi
incq %rsi
callq 0x42e0
movq 0x158(%rsp), %rdi
leaq 0x168(%rsp), %rax
cmpq %rax, %rdi
je 0x5cd2
movq 0x168(%rsp), %rsi
incq %rsi
callq 0x42e0
testq %r12, %r12
je 0x5ce1
movq (%r12), %rax
movq %r12, %rdi
callq *0x8(%rax)
movl %ebp, %ecx
movq 0x60(%rsp), %rax
movq 0x68(%rsp), %rdx
subq %rax, %rdx
sarq $0x5, %rdx
incl %ebp
cmpq %rcx, %rdx
ja 0x5a19
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x8(%rax)
movq 0x2b8(%rsp), %rdi
leaq 0x2c8(%rsp), %rax
cmpq %rax, %rdi
je 0x5d2d
movq 0x2c8(%rsp), %rsi
incq %rsi
callq 0x42e0
movq 0x98(%rsp), %rdi
leaq 0xa8(%rsp), %rax
cmpq %rax, %rdi
je 0x5d52
movq 0xa8(%rsp), %rsi
incq %rsi
callq 0x42e0
movq 0x2d8(%rsp), %rdi
leaq 0x2e8(%rsp), %rax
cmpq %rax, %rdi
je 0x5d77
movq 0x2e8(%rsp), %rsi
incq %rsi
callq 0x42e0
leaq 0x480(%rsp), %rdi
callq 0x40c0
leaq 0x40(%rsp), %rdi
callq 0x6412
movq 0xb8(%rsp), %rdi
leaq 0xc8(%rsp), %rax
cmpq %rax, %rdi
je 0x5db3
movq 0xc8(%rsp), %rsi
incq %rsi
callq 0x42e0
movq 0xd8(%rsp), %rdi
leaq 0xe8(%rsp), %rax
cmpq %rax, %rdi
je 0x5dd8
movq 0xe8(%rsp), %rsi
incq %rsi
callq 0x42e0
movq 0xf8(%rsp), %rdi
leaq 0x108(%rsp), %rax
cmpq %rax, %rdi
je 0x5dfd
movq 0x108(%rsp), %rsi
incq %rsi
callq 0x42e0
movq 0x78(%rsp), %rdi
leaq 0x88(%rsp), %rax
cmpq %rax, %rdi
je 0x5e1f
movq 0x88(%rsp), %rsi
incq %rsi
callq 0x42e0
leaq 0x60(%rsp), %rdi
callq 0x6412
xorl %eax, %eax
addq $0x688, %rsp            # imm = 0x688
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x3ea1ac(%rip), %rdi    # 0x3efff0
movq (%rdi), %rax
addq -0x18(%rax), %rdi
movl $0xa, %esi
callq 0x42a0
movsbl %al, %esi
movq 0x3ea191(%rip), %rdi    # 0x3efff0
callq 0x4040
movq %rax, %rdi
callq 0x41f0
movq %rax, %rbx
leaq 0x35399(%rip), %rsi     # 0x3b20f
movl $0x23, %edx
movq %rax, %rdi
callq 0x4340
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x42a0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x4040
movq %rax, %rdi
callq 0x41f0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x42a0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x4040
movq %rax, %rdi
callq 0x41f0
callq 0x4b5c
xorl %r15d, %r15d
xorl %edx, %edx
leaq 0x35444(%rip), %rdi     # 0x3b329
movq %r15, %rsi
xorl %eax, %eax
callq 0x4440
jmp 0x5f04
jmp 0x61c0
jmp 0x5f04
jmp 0x61c0
jmp 0x5f04
jmp 0x61c0
movq %rax, %r14
movq 0x3ea09a(%rip), %rsi    # 0x3effa8
leaq 0x2f8(%rsp), %rdi
callq 0x4240
movq 0x8(%rsp), %rdi
callq 0x4110
jmp 0x61c3
jmp 0x61c0
movq %rax, %r14
movq 0x258(%rsp), %rdi
cmpq %r12, %rdi
je 0x5f54
movq 0x268(%rsp), %rsi
incq %rsi
callq 0x42e0
jmp 0x5f54
movq %rax, %r14
movq 0x278(%rsp), %rdi
cmpq %r15, %rdi
je 0x61c3
movq 0x288(%rsp), %rsi
jmp 0x61b4
movq %rax, %r14
movq 0x2f8(%rsp), %rdi
cmpq %r15, %rdi
jne 0x604e
jmp 0x61c3
jmp 0x61c0
movq %rax, %r14
movq 0x298(%rsp), %rdi
cmpq %r15, %rdi
je 0x5fb5
movq 0x2a8(%rsp), %rsi
incq %rsi
callq 0x42e0
jmp 0x5fb5
movq %rax, %r14
movl $0xd0, %esi
movq %rbx, %rdi
jmp 0x61b7
movq %rax, %r14
jmp 0x623f
movq %rax, %r14
movl $0x198, %esi            # imm = 0x198
movq %r12, %rdi
jmp 0x61b7
movq %rax, %r14
jmp 0x6007
movq %rax, %r14
movq 0x218(%rsp), %rdi
leaq 0x228(%rsp), %rax
cmpq %rax, %rdi
je 0x6007
movq 0x228(%rsp), %rsi
incq %rsi
callq 0x42e0
movq 0x178(%rsp), %rdi
leaq 0x188(%rsp), %rax
cmpq %rax, %rdi
je 0x61c3
movq 0x188(%rsp), %rsi
jmp 0x61b4
jmp 0x61c0
movq %rax, %r14
movq 0x2f8(%rsp), %rdi
leaq 0x308(%rsp), %rax
cmpq %rax, %rdi
je 0x61c3
movq 0x308(%rsp), %rsi
jmp 0x61b4
movq %rax, %r14
jmp 0x60dc
movq %rax, %r14
jmp 0x60b7
movq %rax, %r14
jmp 0x6092
movq %rax, %r14
movq 0x1f8(%rsp), %rdi
leaq 0x208(%rsp), %rax
cmpq %rax, %rdi
je 0x6092
movq 0x208(%rsp), %rsi
incq %rsi
callq 0x42e0
movq 0x118(%rsp), %rdi
leaq 0x128(%rsp), %rax
cmpq %rax, %rdi
je 0x60b7
movq 0x128(%rsp), %rsi
incq %rsi
callq 0x42e0
movq 0x138(%rsp), %rdi
leaq 0x148(%rsp), %rax
cmpq %rax, %rdi
je 0x60dc
movq 0x148(%rsp), %rsi
incq %rsi
callq 0x42e0
movq 0x158(%rsp), %rdi
leaq 0x168(%rsp), %rax
cmpq %rax, %rdi
je 0x61c3
movq 0x168(%rsp), %rsi
jmp 0x61b4
jmp 0x61c0
jmp 0x61c0
jmp 0x61c0
jmp 0x61c0
movq %rax, %r14
movq 0x238(%rsp), %rdi
leaq 0x248(%rsp), %rax
cmpq %rax, %rdi
je 0x6143
movq 0x248(%rsp), %rsi
incq %rsi
callq 0x42e0
jmp 0x6143
movq %rax, %r14
movq 0x198(%rsp), %rdi
leaq 0x1a8(%rsp), %rax
cmpq %rax, %rdi
je 0x616d
movq 0x1a8(%rsp), %rsi
incq %rsi
callq 0x42e0
jmp 0x616d
movq %rax, %r14
movq 0x1b8(%rsp), %rdi
leaq 0x1c8(%rsp), %rax
cmpq %rax, %rdi
je 0x6197
movq 0x1c8(%rsp), %rsi
incq %rsi
callq 0x42e0
jmp 0x6197
movq %rax, %r14
movq 0x1d8(%rsp), %rdi
leaq 0x1e8(%rsp), %rax
cmpq %rax, %rdi
je 0x61c3
movq 0x1e8(%rsp), %rsi
incq %rsi
callq 0x42e0
jmp 0x61c3
jmp 0x61c0
movq %rax, %r14
movq 0x2b8(%rsp), %rdi
leaq 0x2c8(%rsp), %rax
cmpq %rax, %rdi
je 0x61e8
movq 0x2c8(%rsp), %rsi
incq %rsi
callq 0x42e0
movq 0x98(%rsp), %rdi
leaq 0xa8(%rsp), %rax
cmpq %rax, %rdi
je 0x620d
movq 0xa8(%rsp), %rsi
incq %rsi
callq 0x42e0
movq 0x2d8(%rsp), %rdi
leaq 0x2e8(%rsp), %rax
cmpq %rax, %rdi
je 0x6232
movq 0x2e8(%rsp), %rsi
incq %rsi
callq 0x42e0
leaq 0x480(%rsp), %rdi
callq 0x40c0
leaq 0x40(%rsp), %rdi
callq 0x6412
movq 0xb8(%rsp), %rdi
leaq 0xc8(%rsp), %rax
cmpq %rax, %rdi
je 0x626e
movq 0xc8(%rsp), %rsi
incq %rsi
callq 0x42e0
movq 0xd8(%rsp), %rdi
leaq 0xe8(%rsp), %rax
cmpq %rax, %rdi
je 0x6293
movq 0xe8(%rsp), %rsi
incq %rsi
callq 0x42e0
movq 0xf8(%rsp), %rdi
leaq 0x108(%rsp), %rax
cmpq %rax, %rdi
je 0x62b8
movq 0x108(%rsp), %rsi
incq %rsi
callq 0x42e0
movq 0x78(%rsp), %rdi
leaq 0x88(%rsp), %rax
cmpq %rax, %rdi
je 0x62da
movq 0x88(%rsp), %rsi
incq %rsi
callq 0x42e0
leaq 0x60(%rsp), %rdi
callq 0x6412
movq %r14, %rdi
callq 0x4550