// File: 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:
subq $0xd38, %rsp            # imm = 0xD38
movl $0x0, 0xd34(%rsp)
movl %edi, 0xd30(%rsp)
movq %rsi, 0xd28(%rsp)
leaq 0xcf8(%rsp), %rdi
callq 0x77e0
leaq 0xcd8(%rsp), %rdi
callq 0x5600
leaq 0xcb8(%rsp), %rdi
callq 0x5600
leaq 0xc98(%rsp), %rdi
callq 0x5600
leaq 0xc78(%rsp), %rdi
callq 0x5600
leaq 0xc60(%rsp), %rdi
callq 0x77e0
movl $0x0, 0xc5c(%rsp)
callq 0x77f0
movl %eax, 0xc58(%rsp)
movl $0x0, 0xc54(%rsp)
movb $0x0, 0xc53(%rsp)
leaq 0xa40(%rsp), %rdi
callq 0x54c0
jmp 0x5f48
leaq 0x9f8(%rsp), %rdi
callq 0x5600
leaq 0x9d8(%rsp), %rdi
callq 0x5600
leaq 0x9b8(%rsp), %rdi
callq 0x5600
leaq 0xc60(%rsp), %rdi
callq 0x7800
movq $0x0, 0xa28(%rsp)
movl $0x0, 0xa24(%rsp)
movq $0x0, 0xa18(%rsp)
leaq 0x7540c(%rip), %rsi     # 0x7b3b2
leaq 0xcb8(%rsp), %rdi
callq 0x55f0
jmp 0x5fb5
leaq 0x753f6(%rip), %rsi     # 0x7b3b2
leaq 0xc98(%rsp), %rdi
callq 0x55f0
jmp 0x5fcb
leaq 0x753e0(%rip), %rsi     # 0x7b3b2
leaq 0xc78(%rsp), %rdi
callq 0x55f0
jmp 0x5fe1
movabsq $0x4024000000000000, %rax # imm = 0x4024000000000000
movq %rax, 0xd18(%rsp)
movl $0xffffffff, 0xd14(%rsp) # imm = 0xFFFFFFFF
movb $0x0, 0x9b7(%rsp)
movb $0x0, 0x9b6(%rsp)
leaq 0x75135(%rip), %rsi     # 0x7b14a
leaq 0x9d8(%rsp), %rdi
callq 0x55f0
jmp 0x6024
movl $0x1, 0xd24(%rsp)
movl 0xd24(%rsp), %eax
cmpl 0xd30(%rsp), %eax
jge 0x68c7
movq 0xd28(%rsp), %rax
movslq 0xd24(%rsp), %rcx
movq (%rax,%rcx,8), %rsi
leaq 0xcd8(%rsp), %rdi
callq 0x55f0
jmp 0x6066
leaq 0xcd8(%rsp), %rdi
leaq 0x750da(%rip), %rsi     # 0x7b14f
callq 0x5140
cmpl $0x0, %eax
je 0x6098
leaq 0xcd8(%rsp), %rdi
leaq 0x750c4(%rip), %rsi     # 0x7b152
callq 0x5140
cmpl $0x0, %eax
jne 0x60d6
callq 0x5d00
jmp 0x609f
jmp 0x68af
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xa38(%rsp)
movl %eax, 0xa34(%rsp)
jmp 0x7782
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xa38(%rsp)
movl %eax, 0xa34(%rsp)
jmp 0x774e
leaq 0xcd8(%rsp), %rdi
leaq 0x75073(%rip), %rsi     # 0x7b158
callq 0x5140
cmpl $0x0, %eax
je 0x6108
leaq 0xcd8(%rsp), %rdi
leaq 0x75064(%rip), %rsi     # 0x7b162
callq 0x5140
cmpl $0x0, %eax
jne 0x6153
movq 0xd28(%rsp), %rax
movslq 0xd24(%rsp), %rcx
movl %ecx, %edx
incl %edx
movl %edx, 0xd24(%rsp)
movq 0x8(%rax,%rcx,8), %rsi
leaq 0xcd8(%rsp), %rdi
callq 0x55f0
jmp 0x6137
leaq 0xcb8(%rsp), %rdi
leaq 0xcd8(%rsp), %rsi
callq 0x5060
jmp 0x614e
jmp 0x68ad
leaq 0xcd8(%rsp), %rdi
leaq 0x75003(%rip), %rsi     # 0x7b165
callq 0x5140
cmpl $0x0, %eax
je 0x6185
leaq 0xcd8(%rsp), %rdi
leaq 0x74ff3(%rip), %rsi     # 0x7b16e
callq 0x5140
cmpl $0x0, %eax
jne 0x61d0
movq 0xd28(%rsp), %rax
movslq 0xd24(%rsp), %rcx
movl %ecx, %edx
incl %edx
movl %edx, 0xd24(%rsp)
movq 0x8(%rax,%rcx,8), %rsi
leaq 0xcd8(%rsp), %rdi
callq 0x55f0
jmp 0x61b4
leaq 0xc98(%rsp), %rdi
leaq 0xcd8(%rsp), %rsi
callq 0x5060
jmp 0x61cb
jmp 0x68ab
leaq 0xcd8(%rsp), %rdi
leaq 0x74f92(%rip), %rsi     # 0x7b171
callq 0x5140
cmpl $0x0, %eax
je 0x6202
leaq 0xcd8(%rsp), %rdi
leaq 0x74f83(%rip), %rsi     # 0x7b17b
callq 0x5140
cmpl $0x0, %eax
jne 0x624d
movq 0xd28(%rsp), %rax
movslq 0xd24(%rsp), %rcx
movl %ecx, %edx
incl %edx
movl %edx, 0xd24(%rsp)
movq 0x8(%rax,%rcx,8), %rsi
leaq 0xcd8(%rsp), %rdi
callq 0x55f0
jmp 0x6231
leaq 0xc78(%rsp), %rdi
leaq 0xcd8(%rsp), %rsi
callq 0x5060
jmp 0x6248
jmp 0x68a9
leaq 0xcd8(%rsp), %rdi
leaq 0x74f22(%rip), %rsi     # 0x7b17e
callq 0x5140
cmpl $0x0, %eax
je 0x627f
leaq 0xcd8(%rsp), %rdi
leaq 0x74f11(%rip), %rsi     # 0x7b186
callq 0x5140
cmpl $0x0, %eax
jne 0x628c
movb $0x1, 0x9b7(%rsp)
jmp 0x68a7
leaq 0xcd8(%rsp), %rdi
leaq 0x74ef1(%rip), %rsi     # 0x7b18c
callq 0x5140
cmpl $0x0, %eax
je 0x62be
leaq 0xcd8(%rsp), %rdi
leaq 0x74ee1(%rip), %rsi     # 0x7b195
callq 0x5140
cmpl $0x0, %eax
jne 0x62cb
movb $0x1, 0x9b6(%rsp)
jmp 0x68a5
leaq 0xcd8(%rsp), %rdi
leaq 0x74ebe(%rip), %rsi     # 0x7b198
callq 0x5140
cmpl $0x0, %eax
je 0x62fd
leaq 0xcd8(%rsp), %rdi
leaq 0x74ead(%rip), %rsi     # 0x7b1a0
callq 0x5140
cmpl $0x0, %eax
jne 0x634f
movq 0xd28(%rsp), %rax
movslq 0xd24(%rsp), %rcx
movl %ecx, %edx
incl %edx
movl %edx, 0xd24(%rsp)
movq 0x8(%rax,%rcx,8), %rsi
leaq 0xcd8(%rsp), %rdi
callq 0x55f0
jmp 0x632c
leaq 0xcd8(%rsp), %rdi
callq 0x51a0
movq %rax, %rdi
callq 0x5530
movsd %xmm0, 0xd18(%rsp)
jmp 0x68a3
leaq 0xcd8(%rsp), %rdi
leaq 0x74e45(%rip), %rsi     # 0x7b1a3
callq 0x5140
cmpl $0x0, %eax
je 0x6385
leaq 0xcd8(%rsp), %rdi
leaq 0x74e32(%rip), %rsi     # 0x7b1a9
callq 0x5140
cmpl $0x0, %eax
jne 0x6439
movq 0xd28(%rsp), %rax
movslq 0xd24(%rsp), %rcx
movl %ecx, %edx
incl %edx
movl %edx, 0xd24(%rsp)
movq 0x8(%rax,%rcx,8), %rsi
leaq 0xcd8(%rsp), %rdi
callq 0x55f0
jmp 0x63b4
movl $0x10, %edi
movl $0x8, %esi
callq 0x7850
movl %eax, 0x170(%rsp)
jmp 0x63cc
movl 0x170(%rsp), %edx
leaq 0x828(%rsp), %rdi
leaq 0xcd8(%rsp), %rsi
callq 0x5670
jmp 0x63ea
leaq 0x828(%rsp), %rdi
leaq 0xd14(%rsp), %rsi
callq 0x7820
jmp 0x6401
leaq 0x828(%rsp), %rdi
callq 0x52e0
jmp 0x68a1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xa38(%rsp)
movl %eax, 0xa34(%rsp)
leaq 0x828(%rsp), %rdi
callq 0x52e0
jmp 0x774e
leaq 0xcd8(%rsp), %rdi
leaq 0x74d64(%rip), %rsi     # 0x7b1ac
callq 0x5140
cmpl $0x0, %eax
je 0x6484
leaq 0xcd8(%rsp), %rdi
leaq 0x74d50(%rip), %rsi     # 0x7b1b1
callq 0x5140
cmpl $0x0, %eax
je 0x6484
leaq 0xcd8(%rsp), %rdi
leaq 0x74d3d(%rip), %rsi     # 0x7b1b7
callq 0x5140
cmpl $0x0, %eax
jne 0x64cf
movq 0xd28(%rsp), %rax
movslq 0xd24(%rsp), %rcx
movl %ecx, %edx
incl %edx
movl %edx, 0xd24(%rsp)
movq 0x8(%rax,%rcx,8), %rsi
leaq 0xcd8(%rsp), %rdi
callq 0x55f0
jmp 0x64b3
leaq 0xc60(%rsp), %rdi
leaq 0xcd8(%rsp), %rsi
callq 0x7870
jmp 0x64ca
jmp 0x689f
leaq 0xcd8(%rsp), %rdi
leaq 0x74cdc(%rip), %rsi     # 0x7b1ba
callq 0x5140
cmpl $0x0, %eax
jne 0x65a0
movq 0xd28(%rsp), %rax
movslq 0xd24(%rsp), %rcx
movl %ecx, %edx
incl %edx
movl %edx, 0xd24(%rsp)
movq 0x8(%rax,%rcx,8), %rsi
leaq 0xcd8(%rsp), %rdi
callq 0x55f0
jmp 0x651b
movl $0x10, %edi
movl $0x8, %esi
callq 0x7850
movl %eax, 0x16c(%rsp)
jmp 0x6533
movl 0x16c(%rsp), %edx
leaq 0x6a0(%rsp), %rdi
leaq 0xcd8(%rsp), %rsi
callq 0x5670
jmp 0x6551
leaq 0x6a0(%rsp), %rdi
leaq 0xc54(%rsp), %rsi
callq 0x7820
jmp 0x6568
leaq 0x6a0(%rsp), %rdi
callq 0x52e0
jmp 0x689d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xa38(%rsp)
movl %eax, 0xa34(%rsp)
leaq 0x6a0(%rsp), %rdi
callq 0x52e0
jmp 0x774e
leaq 0xcd8(%rsp), %rdi
leaq 0x74c11(%rip), %rsi     # 0x7b1c0
callq 0x5140
cmpl $0x0, %eax
jne 0x668a
movq 0xd28(%rsp), %rax
movslq 0xd24(%rsp), %rcx
movl %ecx, %edx
incl %edx
movl %edx, 0xd24(%rsp)
movq 0x8(%rax,%rcx,8), %rsi
leaq 0xcd8(%rsp), %rdi
callq 0x55f0
jmp 0x65ec
movl $0x10, %edi
movl $0x8, %esi
callq 0x7850
movl %eax, 0x168(%rsp)
jmp 0x6604
movl 0x168(%rsp), %edx
leaq 0x518(%rsp), %rdi
leaq 0xcd8(%rsp), %rsi
callq 0x5670
jmp 0x6622
leaq 0x518(%rsp), %rdi
leaq 0xc5c(%rsp), %rsi
callq 0x7820
jmp 0x6639
leaq 0x518(%rsp), %rdi
callq 0x52e0
movl 0xc5c(%rsp), %eax
addl $-0x1, %eax
movl %eax, 0xc5c(%rsp)
movb $0x1, 0xc53(%rsp)
jmp 0x689b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xa38(%rsp)
movl %eax, 0xa34(%rsp)
leaq 0x518(%rsp), %rdi
callq 0x52e0
jmp 0x774e
leaq 0xcd8(%rsp), %rdi
leaq 0x74b2e(%rip), %rsi     # 0x7b1c7
callq 0x5140
cmpl $0x0, %eax
jne 0x675b
movq 0xd28(%rsp), %rax
movslq 0xd24(%rsp), %rcx
movl %ecx, %edx
incl %edx
movl %edx, 0xd24(%rsp)
movq 0x8(%rax,%rcx,8), %rsi
leaq 0xcd8(%rsp), %rdi
callq 0x55f0
jmp 0x66d6
movl $0x10, %edi
movl $0x8, %esi
callq 0x7850
movl %eax, 0x164(%rsp)
jmp 0x66ee
movl 0x164(%rsp), %edx
leaq 0x390(%rsp), %rdi
leaq 0xcd8(%rsp), %rsi
callq 0x5670
jmp 0x670c
leaq 0x390(%rsp), %rdi
leaq 0xc58(%rsp), %rsi
callq 0x7820
jmp 0x6723
leaq 0x390(%rsp), %rdi
callq 0x52e0
jmp 0x6899
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xa38(%rsp)
movl %eax, 0xa34(%rsp)
leaq 0x390(%rsp), %rdi
callq 0x52e0
jmp 0x774e
leaq 0xcd8(%rsp), %rdi
leaq 0x74a63(%rip), %rsi     # 0x7b1cd
callq 0x5140
cmpl $0x0, %eax
je 0x678d
leaq 0xcd8(%rsp), %rdi
leaq 0x74a5a(%rip), %rsi     # 0x7b1dd
callq 0x5140
cmpl $0x0, %eax
jne 0x67d8
movq 0xd28(%rsp), %rax
movslq 0xd24(%rsp), %rcx
movl %ecx, %edx
incl %edx
movl %edx, 0xd24(%rsp)
movq 0x8(%rax,%rcx,8), %rsi
leaq 0xcd8(%rsp), %rdi
callq 0x55f0
jmp 0x67bc
leaq 0x9d8(%rsp), %rdi
leaq 0xcd8(%rsp), %rsi
callq 0x5060
jmp 0x67d3
jmp 0x6897
leaq 0x75beb(%rip), %rcx     # 0x7c3ca
xorl %eax, %eax
movl %eax, %esi
leaq 0xcd8(%rsp), %rdi
movl $0x1, %edx
callq 0x55a0
movl %eax, 0x160(%rsp)
jmp 0x67fe
movl 0x160(%rsp), %eax
cmpl $0x0, %eax
jne 0x687c
movq 0x4347df(%rip), %rdi    # 0x43aff0
leaq 0x749c8(%rip), %rsi     # 0x7b1e0
callq 0x53f0
movq %rax, 0x158(%rsp)
jmp 0x6827
movq 0x158(%rsp), %rdi
leaq 0xcd8(%rsp), %rsi
callq 0x5390
movq %rax, 0x150(%rsp)
jmp 0x6846
movq 0x150(%rsp), %rdi
leaq 0x75b97(%rip), %rsi     # 0x7c3ec
callq 0x53f0
movq %rax, 0x148(%rsp)
jmp 0x6864
movq 0x148(%rsp), %rdi
movq 0x434735(%rip), %rsi    # 0x43afa8
callq 0x5460
jmp 0x687a
jmp 0x6895
leaq 0xcf8(%rsp), %rdi
leaq 0xcd8(%rsp), %rsi
callq 0x7870
jmp 0x6893
jmp 0x6895
jmp 0x6897
jmp 0x6899
jmp 0x689b
jmp 0x689d
jmp 0x689f
jmp 0x68a1
jmp 0x68a3
jmp 0x68a5
jmp 0x68a7
jmp 0x68a9
jmp 0x68ab
jmp 0x68ad
jmp 0x68af
jmp 0x68b1
movl 0xd24(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xd24(%rsp)
jmp 0x602f
leaq 0xcf8(%rsp), %rdi
callq 0x78e0
cmpq $0x0, %rax
jne 0x6952
movq 0x43470f(%rip), %rdi    # 0x43aff0
movq 0x4346c0(%rip), %rsi    # 0x43afa8
callq 0x5460
movq %rax, 0x140(%rsp)
jmp 0x68f7
movq 0x140(%rsp), %rdi
leaq 0x748fd(%rip), %rsi     # 0x7b203
callq 0x53f0
movq %rax, 0x138(%rsp)
jmp 0x6915
movq 0x138(%rsp), %rdi
movq 0x434684(%rip), %rsi    # 0x43afa8
callq 0x5460
movq %rax, 0x130(%rsp)
jmp 0x6933
movq 0x130(%rsp), %rdi
movq 0x434666(%rip), %rsi    # 0x43afa8
callq 0x5460
jmp 0x6949
callq 0x5d00
jmp 0x6950
jmp 0x6952
movq $0x0, 0x388(%rsp)
movl $0xd0, %edi
callq 0x5410
movq %rax, 0x128(%rsp)
jmp 0x6972
movb $0x1, 0x366(%rsp)
leaq 0x367(%rsp), %rdi
movq %rdi, 0x120(%rsp)
callq 0x5730
movq 0x120(%rsp), %rdx
leaq 0x74889(%rip), %rsi     # 0x7b227
leaq 0x368(%rsp), %rdi
callq 0x7900
jmp 0x69ad
movq 0x128(%rsp), %rdi
leaq 0x368(%rsp), %rsi
callq 0x9620
jmp 0x69c4
movq 0x128(%rsp), %rax
movb $0x0, 0x366(%rsp)
movq %rax, 0xa18(%rsp)
leaq 0x368(%rsp), %rdi
callq 0x5250
leaq 0x367(%rsp), %rdi
callq 0x5480
leaq 0xc60(%rsp), %rdi
callq 0x78e0
cmpq $0x0, %rax
jbe 0x7271
leaq 0xcf8(%rsp), %rdi
callq 0x78e0
cmpq $0x1, %rax
jbe 0x6afc
movq 0x4345c5(%rip), %rdi    # 0x43aff0
movq 0x434576(%rip), %rsi    # 0x43afa8
callq 0x5460
movq %rax, 0x118(%rsp)
jmp 0x6a41
movq 0x118(%rsp), %rdi
leaq 0x747d9(%rip), %rsi     # 0x7b229
callq 0x53f0
movq %rax, 0x110(%rsp)
jmp 0x6a5f
movq 0x110(%rsp), %rdi
movq 0x43453a(%rip), %rsi    # 0x43afa8
callq 0x5460
movq %rax, 0x108(%rsp)
jmp 0x6a7d
movq 0x108(%rsp), %rdi
movq 0x43451c(%rip), %rsi    # 0x43afa8
callq 0x5460
jmp 0x6a93
jmp 0x6afc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xa38(%rsp)
movl %eax, 0xa34(%rsp)
jmp 0x6acc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xa38(%rsp)
movl %eax, 0xa34(%rsp)
leaq 0x368(%rsp), %rdi
callq 0x5250
leaq 0x367(%rsp), %rdi
callq 0x5480
testb $0x1, 0x366(%rsp)
jne 0x6ae5
jmp 0x6af7
movq 0x128(%rsp), %rdi
movl $0xd0, %esi
callq 0x5420
jmp 0x774e
movq 0xa18(%rsp), %rax
movq %rax, 0xf8(%rsp)
leaq 0x33f(%rsp), %rdi
movq %rdi, 0x100(%rsp)
callq 0x5730
movq 0x100(%rsp), %rdx
leaq 0x7473f(%rip), %rsi     # 0x7b26f
leaq 0x340(%rsp), %rdi
callq 0x7900
jmp 0x6b3f
movq 0xf8(%rsp), %rdi
leaq 0x340(%rsp), %rsi
callq 0x9910
jmp 0x6b56
leaq 0x340(%rsp), %rdi
callq 0x5250
leaq 0x33f(%rsp), %rdi
callq 0x5480
xorl %eax, %eax
movl %eax, %esi
leaq 0xcf8(%rsp), %rdi
callq 0x79c0
movq %rax, 0xf0(%rsp)
jmp 0x6b8b
movq 0xf0(%rsp), %rsi
leaq 0x318(%rsp), %rdi
callq 0x51b0
jmp 0x6ba2
leaq 0x2f7(%rsp), %rdi
movq %rdi, 0xe8(%rsp)
callq 0x5730
movq 0xe8(%rsp), %rdx
leaq 0x747ec(%rip), %rsi     # 0x7b3b2
leaq 0x2f8(%rsp), %rdi
callq 0x7900
jmp 0x6bd5
leaq 0x318(%rsp), %rdi
xorl %esi, %esi
leaq 0x2f8(%rsp), %rdx
movl $0x1, %ecx
callq 0x41ef0
movq %rax, 0xe0(%rsp)
jmp 0x6bfb
movq 0xe0(%rsp), %rax
movq %rax, 0x388(%rsp)
leaq 0x2f8(%rsp), %rdi
callq 0x5250
leaq 0x2f7(%rsp), %rdi
callq 0x5480
leaq 0x318(%rsp), %rdi
callq 0x5250
movq 0xa18(%rsp), %rdi
movq 0x388(%rsp), %rsi
callq 0xf020
jmp 0x6c49
movl $0x0, 0xc4c(%rsp)
movl 0xc4c(%rsp), %eax
movq %rax, 0xd8(%rsp)
leaq 0xc60(%rsp), %rdi
callq 0x78e0
movq %rax, %rcx
movq 0xd8(%rsp), %rax
cmpq %rcx, %rax
jae 0x726c
movl 0xc4c(%rsp), %eax
movl %eax, %esi
leaq 0xc60(%rsp), %rdi
callq 0x79c0
movq %rax, 0xd0(%rsp)
jmp 0x6ca4
movq 0xd0(%rsp), %rdi
callq 0x51a0
movq %rax, %rsi
leaq 0xa40(%rsp), %rdi
movl $0x4, %edx
callq 0x5260
jmp 0x6cc8
leaq 0xa40(%rsp), %rdi
callq 0x5690
movb %al, 0xcf(%rsp)
jmp 0x6cde
movb 0xcf(%rsp), %al
testb $0x1, %al
jne 0x6cee
jmp 0x7245
movl $0x198, %edi            # imm = 0x198
callq 0x5410
movq %rax, 0xc0(%rsp)
jmp 0x6d02
movq 0xc0(%rsp), %rdi
callq 0x70ca0
jmp 0x6d11
movq 0xc0(%rsp), %rax
movq %rax, 0xa28(%rsp)
movq 0xa28(%rsp), %rdi
movq 0x388(%rsp), %rsi
callq 0x74600
jmp 0x6d38
movq 0xa28(%rsp), %rdi
leaq 0xa40(%rsp), %rsi
callq 0x71440
movb %al, 0xbf(%rsp)
jmp 0x6d56
movb 0xbf(%rsp), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x1, %eax
jne 0x7187
movq 0xa28(%rsp), %rdi
leaq 0xa40(%rsp), %rsi
callq 0x71620
jmp 0x6d82
cmpl $0x0, 0xc54(%rsp)
jle 0x6e82
movb 0xc53(%rsp), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0x6e82
movl 0xc54(%rsp), %eax
movl %eax, 0xc5c(%rsp)
jmp 0x6e82
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xa38(%rsp)
movl %eax, 0xa34(%rsp)
jmp 0x6def
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xa38(%rsp)
movl %eax, 0xa34(%rsp)
leaq 0x340(%rsp), %rdi
callq 0x5250
leaq 0x33f(%rsp), %rdi
callq 0x5480
jmp 0x774e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xa38(%rsp)
movl %eax, 0xa34(%rsp)
jmp 0x6e38
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xa38(%rsp)
movl %eax, 0xa34(%rsp)
leaq 0x2f8(%rsp), %rdi
callq 0x5250
leaq 0x2f7(%rsp), %rdi
callq 0x5480
leaq 0x318(%rsp), %rdi
callq 0x5250
jmp 0x774e
movq 0xc0(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xa38(%rsp)
movl %eax, 0xa34(%rsp)
movl $0x198, %esi            # imm = 0x198
callq 0x5420
jmp 0x774e
movl 0xc5c(%rsp), %eax
movl %eax, 0xd24(%rsp)
movl 0xd24(%rsp), %eax
movl %eax, 0xb4(%rsp)
movq 0xa28(%rsp), %rdi
callq 0x72670
movl %eax, 0xb8(%rsp)
jmp 0x6eb4
movl 0xb4(%rsp), %ecx
movl 0xb8(%rsp), %edx
xorl %eax, %eax
cmpl %edx, %ecx
movb %al, 0xb3(%rsp)
jge 0x6ee7
movl 0xd24(%rsp), %eax
cmpl 0xc58(%rsp), %eax
setl %al
movb %al, 0xb3(%rsp)
movb 0xb3(%rsp), %al
testb $0x1, %al
jne 0x6ef7
jmp 0x7182
movq 0xa28(%rsp), %rdi
movl 0xd24(%rsp), %edx
leaq 0xa40(%rsp), %rsi
callq 0x72cd0
movb %al, 0xb2(%rsp)
jmp 0x6f1c
movb 0xb2(%rsp), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0x6f65
movq 0x4340bc(%rip), %rdi    # 0x43aff0
leaq 0x74339(%rip), %rsi     # 0x7b274
callq 0x53f0
movq %rax, 0xa8(%rsp)
jmp 0x6f4a
movq 0xa8(%rsp), %rdi
movq 0x43404f(%rip), %rsi    # 0x43afa8
callq 0x5460
jmp 0x6f60
jmp 0x7182
movl 0xa24(%rsp), %eax
incl %eax
movl %eax, 0xa24(%rsp)
movq 0xa18(%rsp), %rdi
callq 0x9a20
jmp 0x6f84
movq 0xa18(%rsp), %rdi
movq 0x388(%rsp), %rsi
callq 0xf020
jmp 0x6f9b
movq 0xa18(%rsp), %rax
movq %rax, 0x98(%rsp)
movl 0xa24(%rsp), %eax
movl %eax, 0xa4(%rsp)
leaq 0x2d0(%rsp), %rdi
leaq 0x9d8(%rsp), %rsi
callq 0x51b0
jmp 0x6fd0
movb 0x9b7(%rsp), %al
movb %al, 0x96(%rsp)
movb 0x9b6(%rsp), %al
movb %al, 0x97(%rsp)
leaq 0x2b0(%rsp), %rdi
leaq 0xcb8(%rsp), %rsi
callq 0x51b0
jmp 0x7003
leaq 0x290(%rsp), %rdi
leaq 0xc98(%rsp), %rsi
callq 0x51b0
jmp 0x701a
leaq 0x270(%rsp), %rdi
leaq 0xc78(%rsp), %rsi
callq 0x51b0
jmp 0x7031
movl 0xa4(%rsp), %esi
movq 0x98(%rsp), %rdi
movb 0x97(%rsp), %al
movb 0x96(%rsp), %cl
movsd 0xd18(%rsp), %xmm0
movl 0xd14(%rsp), %r8d
movq %rsp, %rdx
movl %r8d, 0x10(%rdx)
leaq 0x270(%rsp), %r8
movq %r8, 0x8(%rdx)
leaq 0x290(%rsp), %r8
movq %r8, (%rdx)
movzbl %cl, %ecx
andl $0x1, %ecx
movzbl %al, %r8d
andl $0x1, %r8d
leaq 0x2d0(%rsp), %rdx
leaq 0x2b0(%rsp), %r9
callq 0x136c0
jmp 0x70a2
leaq 0x270(%rsp), %rdi
callq 0x5250
leaq 0x290(%rsp), %rdi
callq 0x5250
leaq 0x2b0(%rsp), %rdi
callq 0x5250
leaq 0x2d0(%rsp), %rdi
callq 0x5250
movl 0xd24(%rsp), %eax
addl $0x1, %eax
addl 0xc54(%rsp), %eax
movl %eax, 0xd24(%rsp)
jmp 0x6e90
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xa38(%rsp)
movl %eax, 0xa34(%rsp)
jmp 0x7170
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xa38(%rsp)
movl %eax, 0xa34(%rsp)
jmp 0x7163
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xa38(%rsp)
movl %eax, 0xa34(%rsp)
jmp 0x7156
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xa38(%rsp)
movl %eax, 0xa34(%rsp)
leaq 0x270(%rsp), %rdi
callq 0x5250
leaq 0x290(%rsp), %rdi
callq 0x5250
leaq 0x2b0(%rsp), %rdi
callq 0x5250
leaq 0x2d0(%rsp), %rdi
callq 0x5250
jmp 0x774e
jmp 0x720a
movq 0x433e62(%rip), %rdi    # 0x43aff0
leaq 0x74116(%rip), %rsi     # 0x7b2ab
callq 0x53f0
jmp 0x719c
movl 0xc4c(%rsp), %eax
movl %eax, %esi
leaq 0xc60(%rsp), %rdi
callq 0x79c0
movq %rax, 0x88(%rsp)
jmp 0x71bc
movq 0x88(%rsp), %rsi
movq 0x433e25(%rip), %rdi    # 0x43aff0
callq 0x5390
movq %rax, 0x80(%rsp)
jmp 0x71da
movq 0x80(%rsp), %rdi
leaq 0x75203(%rip), %rsi     # 0x7c3ec
callq 0x53f0
movq %rax, 0x78(%rsp)
jmp 0x71f5
movq 0x78(%rsp), %rdi
movq 0x433da7(%rip), %rsi    # 0x43afa8
callq 0x5460
jmp 0x7208
jmp 0x720a
cmpq $0x0, 0xa28(%rsp)
je 0x7243
movq 0xa28(%rsp), %rax
movq %rax, 0x70(%rsp)
cmpq $0x0, %rax
je 0x7241
movq 0x70(%rsp), %rdi
callq 0x7a00
movq 0x70(%rsp), %rdi
movl $0x198, %esi            # imm = 0x198
callq 0x5420
jmp 0x7243
jmp 0x7245
leaq 0xa40(%rsp), %rdi
callq 0x50e0
jmp 0x7254
jmp 0x7256
movl 0xc4c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xc4c(%rsp)
jmp 0x6c54
jmp 0x76b2
movq $0x0, 0x268(%rsp)
movl $0x0, 0xd20(%rsp)
movl 0xd20(%rsp), %eax
movq %rax, 0x68(%rsp)
leaq 0xcf8(%rsp), %rdi
callq 0x78e0
movq %rax, %rcx
movq 0x68(%rsp), %rax
cmpq %rcx, %rax
jae 0x766f
movl 0xd20(%rsp), %eax
movl %eax, %esi
leaq 0xcf8(%rsp), %rdi
callq 0x79c0
movq %rax, 0x60(%rsp)
jmp 0x72cf
movq 0x60(%rsp), %rsi
leaq 0x248(%rsp), %rdi
callq 0x51b0
jmp 0x72e3
leaq 0x227(%rsp), %rdi
movq %rdi, 0x58(%rsp)
callq 0x5730
movq 0x58(%rsp), %rdx
leaq 0x740b1(%rip), %rsi     # 0x7b3b2
leaq 0x228(%rsp), %rdi
callq 0x7900
jmp 0x7310
leaq 0x248(%rsp), %rdi
xorl %esi, %esi
leaq 0x228(%rsp), %rdx
movl $0x1, %ecx
callq 0x41ef0
movq %rax, 0x50(%rsp)
jmp 0x7333
movq 0x50(%rsp), %rax
movq %rax, 0x268(%rsp)
leaq 0x228(%rsp), %rdi
callq 0x5250
leaq 0x227(%rsp), %rdi
callq 0x5480
leaq 0x248(%rsp), %rdi
callq 0x5250
movq 0xa18(%rsp), %rax
movq %rax, 0x40(%rsp)
leaq 0x1ff(%rsp), %rdi
movq %rdi, 0x48(%rsp)
callq 0x5730
movq 0x48(%rsp), %rdx
leaq 0x73edd(%rip), %rsi     # 0x7b26f
leaq 0x200(%rsp), %rdi
callq 0x7900
jmp 0x73a1
movq 0x40(%rsp), %rdi
leaq 0x200(%rsp), %rsi
callq 0x9910
jmp 0x73b5
leaq 0x200(%rsp), %rdi
callq 0x5250
leaq 0x1ff(%rsp), %rdi
callq 0x5480
movq 0xa18(%rsp), %rdi
movq 0x268(%rsp), %rsi
callq 0xf020
jmp 0x73e6
movq 0xa18(%rsp), %rax
movq %rax, 0x30(%rsp)
movl 0xd20(%rsp), %eax
incl %eax
movl %eax, 0x3c(%rsp)
leaq 0x1d8(%rsp), %rdi
leaq 0x9d8(%rsp), %rsi
callq 0x51b0
jmp 0x7417
movb 0x9b7(%rsp), %al
movb %al, 0x2e(%rsp)
movb 0x9b6(%rsp), %al
movb %al, 0x2f(%rsp)
leaq 0x1b8(%rsp), %rdi
leaq 0xcb8(%rsp), %rsi
callq 0x51b0
jmp 0x7444
leaq 0x198(%rsp), %rdi
leaq 0xc98(%rsp), %rsi
callq 0x51b0
jmp 0x745b
leaq 0x178(%rsp), %rdi
leaq 0xc78(%rsp), %rsi
callq 0x51b0
jmp 0x7472
movl 0x3c(%rsp), %esi
movq 0x30(%rsp), %rdi
movb 0x2f(%rsp), %al
movb 0x2e(%rsp), %cl
movsd 0xd18(%rsp), %xmm0
movl 0xd14(%rsp), %r8d
movq %rsp, %rdx
movl %r8d, 0x10(%rdx)
leaq 0x178(%rsp), %r8
movq %r8, 0x8(%rdx)
leaq 0x198(%rsp), %r8
movq %r8, (%rdx)
movzbl %cl, %ecx
andl $0x1, %ecx
movzbl %al, %r8d
andl $0x1, %r8d
leaq 0x1d8(%rsp), %rdx
leaq 0x1b8(%rsp), %r9
callq 0x136c0
jmp 0x74d7
leaq 0x178(%rsp), %rdi
callq 0x5250
leaq 0x198(%rsp), %rdi
callq 0x5250
leaq 0x1b8(%rsp), %rdi
callq 0x5250
leaq 0x1d8(%rsp), %rdi
callq 0x5250
movq 0x268(%rsp), %rax
movq %rax, 0x20(%rsp)
cmpq $0x0, %rax
je 0x7529
movq 0x20(%rsp), %rdi
movq (%rdi), %rax
callq *0x8(%rax)
jmp 0x752b
movl 0xd20(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xd20(%rsp)
jmp 0x7288
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xa38(%rsp)
movl %eax, 0xa34(%rsp)
jmp 0x7578
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xa38(%rsp)
movl %eax, 0xa34(%rsp)
leaq 0x228(%rsp), %rdi
callq 0x5250
leaq 0x227(%rsp), %rdi
callq 0x5480
leaq 0x248(%rsp), %rdi
callq 0x5250
jmp 0x774e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xa38(%rsp)
movl %eax, 0xa34(%rsp)
jmp 0x75ce
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xa38(%rsp)
movl %eax, 0xa34(%rsp)
leaq 0x200(%rsp), %rdi
callq 0x5250
leaq 0x1ff(%rsp), %rdi
callq 0x5480
jmp 0x774e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xa38(%rsp)
movl %eax, 0xa34(%rsp)
jmp 0x765d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xa38(%rsp)
movl %eax, 0xa34(%rsp)
jmp 0x7650
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xa38(%rsp)
movl %eax, 0xa34(%rsp)
jmp 0x7643
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xa38(%rsp)
movl %eax, 0xa34(%rsp)
leaq 0x178(%rsp), %rdi
callq 0x5250
leaq 0x198(%rsp), %rdi
callq 0x5250
leaq 0x1b8(%rsp), %rdi
callq 0x5250
leaq 0x1d8(%rsp), %rdi
callq 0x5250
jmp 0x774e
cmpq $0x0, 0xa18(%rsp)
je 0x769a
movq 0xa18(%rsp), %rax
movq %rax, 0x18(%rsp)
cmpq $0x0, %rax
je 0x7698
movq 0x18(%rsp), %rdi
movq (%rdi), %rax
callq *0x8(%rax)
jmp 0x769a
movl $0x0, 0xd34(%rsp)
movl $0x1, 0x174(%rsp)
jmp 0x76bd
movl $0x0, 0x174(%rsp)
leaq 0x9b8(%rsp), %rdi
callq 0x5250
leaq 0x9d8(%rsp), %rdi
callq 0x5250
leaq 0x9f8(%rsp), %rdi
callq 0x5250
leaq 0xa40(%rsp), %rdi
callq 0x5120
leaq 0xc60(%rsp), %rdi
callq 0x7ab0
leaq 0xc78(%rsp), %rdi
callq 0x5250
leaq 0xc98(%rsp), %rdi
callq 0x5250
leaq 0xcb8(%rsp), %rdi
callq 0x5250
leaq 0xcd8(%rsp), %rdi
callq 0x5250
leaq 0xcf8(%rsp), %rdi
callq 0x7ab0
movl 0xd34(%rsp), %eax
addq $0xd38, %rsp            # imm = 0xD38
retq
leaq 0x9b8(%rsp), %rdi
callq 0x5250
leaq 0x9d8(%rsp), %rdi
callq 0x5250
leaq 0x9f8(%rsp), %rdi
callq 0x5250
leaq 0xa40(%rsp), %rdi
callq 0x5120
leaq 0xc60(%rsp), %rdi
callq 0x7ab0
leaq 0xc78(%rsp), %rdi
callq 0x5250
leaq 0xc98(%rsp), %rdi
callq 0x5250
leaq 0xcb8(%rsp), %rdi
callq 0x5250
leaq 0xcd8(%rsp), %rdi
callq 0x5250
leaq 0xcf8(%rsp), %rdi
callq 0x7ab0
movq 0xa38(%rsp), %rdi
callq 0x5720
nopl (%rax)