// File: /workspace/github_cpp_makefile_star2_O2/jaudoux[P]countTags/src/countTags.cpp
// Function: main
int main (int argc, char *argv[]) {

  // Config vars
  const char * tags_file;
  const char * seq_file;
  uint32_t tag_length = 22;
  bool stranded = false;
  bool normalize = false;
  bool print_tag_names = false;
  uint32_t nb_tags = 0;
  uint32_t max_reads = UINT32_MAX;
  int nb_threads = 1;
  uint32_t nb_samples;
  uint32_t i;
  uint32_t read_id;

  char * seq;
  std::string tag_name;
  uint32_t seq_length;
  uint64_t tag;
  uint64_t valrev,valfwd;
  uint64_t nb_factors;
  int64_t last;
  std::unordered_map<uint64_t,double*>  tags_counts;
  std::unordered_map<uint64_t,std::vector<std::string>> tags_names;
  std::unordered_map<uint64_t,double*>::iterator it_counts;
  std::vector<uint64_t> nb_factors_by_sample;

  // File vars
  std::string gzip_pipe = "gunzip -fc ";
  std::string cat_pipe = "cat ";
  std::string tmp;
  FILE * file;
  char * line = NULL;
  size_t len = 0;
  ssize_t read;
  uint32_t line_id = 0;

  /**********************************
   *
   *        Parsing options
   *
   *********************************/
  argc-=(argc>0); argv+=(argc>0); // skip program name argv[0] if present
  option::Stats  stats(usage, argc, argv);
  option::Option options[stats.options_max], buffer[stats.buffer_max];
  option::Parser parse(usage, argc, argv, options, buffer);

  if (parse.error())
    return 1;

  if (options[HELP] || argc == 0) {
    option::printUsage(std::cout, usage);
    return 0;
  }

  // TODO we should check the length to choose the appropriate
  // integer size to use
  if (options[PROBE_LENGTH]) {
    tag_length = atoi(options[PROBE_LENGTH].arg);
  }

  if (options[MAX_READS]) {
    max_reads = atoi(options[MAX_READS].arg);
  }

  //if (options[NB_THREADS]) {
  //  nb_threads = atoi(options[NB_THREADS].arg);
  //}

  if (options[STRANDED]) {
    stranded = true;
  }

  if (options[NORMALIZE]) {
    normalize = true;
  }

  if (options[TAG_NAMES]) {
    print_tag_names = true;
  }

  if(parse.nonOptionsCount() < 2) {
    option::printUsage(std::cout, usage);
    return 0;
  }

  tags_file = parse.nonOption(0);
  nb_samples = parse.nonOptionsCount() - 1;

  /**********************************
   *
   *   Create tags counting table
   *
   *********************************/
  file = popen(tmp.append(cat_pipe).append(tags_file).c_str(),"r");
  line_id = 0;

  std::cerr << "Counting k-mers" << std::endl;
  // Create hash table of k-mer counts
  line_id = 0;
  nb_tags = 0;
  while ((read = getline(&line, &len, file)) != -1) {
    if(line_id % 2 == 0) {
      tag_name = line;
      tag_name.pop_back(); // remove new_line char
      tag_name.erase(0,1); // remove the fasta ">" prefix
    }
    if(line_id % 2 == 1) {
      tag = DNAtoInt(line,tag_length,stranded);
      tags_counts[tag] = new double[nb_samples]();
      tags_names[tag].push_back(tag_name);
      nb_tags++;
    }
    line_id++;
  }
  fclose(file);
  if (line)
    free(line);

  std::cerr << "Finished indexing tags" << std::endl;


  /**********************************
   *
   *            First pass
   *
   *********************************/
//#pragma omp parallel num_threads(nb_threads)
  for (int s = 0; s < nb_samples; ++s) {
    std::cerr << "Counting tags for file: " << parse.nonOption(s+1) << "\n";

    line = NULL;
    len = 0;
    line_id = 0;
    tmp = "";
    file = popen(tmp.append(gzip_pipe).append(parse.nonOption(s+1)).c_str(),"r");
    nb_factors = 0;

    while ((read = getline(&line, &len, file)) != -1) {
      // If this line is a sequence
      if(line_id % 4 == 1) {
        read_id = ((int)((double)line_id*0.25) + 1);
        if(read_id >= max_reads) {
          break;
        }
        // Print a user-friendly output on STDERR every each XXXX reads processed
        if(read_id % MILLION == 0) {
          std::cerr << (int)((double)line_id*0.25) + 1 << " reads parsed" << std::endl;
        }
        // set seq to line
        seq = line;
        seq_length = strlen(seq) - 1; // Minus 1 because we have a new line

        // Skip the sequence if the read length is < to the tag_length
        if(seq_length < tag_length)
          continue;

        nb_tags = seq_length - tag_length + 1;
        nb_factors += nb_tags;

        //uint64_t valrev,valfwd;
        last = -3;

        for(i = 0; i < nb_tags; i++) {
          it_counts = tags_counts.find(valns(i,seq,tag_length,&last,&valfwd,&valrev,stranded));
          if(it_counts != tags_counts.end()) {
            it_counts->second[s]++;
          }
        }
      }
      line_id++;
    }

    nb_factors_by_sample.push_back(nb_factors);

    if(normalize && nb_factors > 0) {
      std::cerr << "Normalize counts" << std::endl;
      for (it_counts=tags_counts.begin(); it_counts!=tags_counts.end(); ++it_counts) {
        // TODO We should take into accout the error rate...
        if(it_counts->second[s] > 0)
          it_counts->second[s] = it_counts->second[s] * MILLION / nb_factors;
      }
    }

    // Close file and clear line buffer
    fclose(file);
    if (line)
      free(line);
  }

  /****
   * PRINT THE RESULTS
   */
  // First print headers
  std::cout << "tag";
  if (print_tag_names)
    std::cout << "\ttag_names";
  for (int s = 0; s < nb_samples; ++s) {
    std::cout << "\t" << parse.nonOption(s+1);
  }
  std::cout << "\n";
  char *tag_seq = new char[tag_length];
  for (it_counts=tags_counts.begin(); it_counts!=tags_counts.end(); ++it_counts) {
    intToDNA(it_counts->first,tag_length,tag_seq);
    std::cout << tag_seq;
    if(print_tag_names) {
      std::cout << "\t" << join(tags_names[it_counts->first],",");
    }
    for (int s = 0; s < nb_samples; ++s) {
      std::cout << "\t" << it_counts->second[s];
    }
    std::cout << std::endl;
  }

  std::cout << "total_factors";
  if (print_tag_names)
    std::cout << "\t*";
  for (int s = 0; s < nb_samples; ++s) {
    std::cout << "\t" << nb_factors_by_sample[s];
  }
  std::cout << std::endl;

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1e8, %rsp            # imm = 0x1E8
movq %rsi, %r14
movl %edi, %ebx
leaq -0x1c8(%rbp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq -0x178(%rbp), %rax
movq %rax, -0x30(%rax)
pushq $0x1
popq %rcx
movq %rcx, -0x28(%rax)
xorpd %xmm0, %xmm0
movupd %xmm0, -0x20(%rax)
movl $0x3f800000, %edx       # imm = 0x3F800000
movl %edx, -0x10(%rax)
movupd %xmm0, -0x8(%rax)
leaq -0x1e0(%rbp), %rax
movq %rax, -0x30(%rax)
movq %rcx, -0x28(%rax)
movupd %xmm0, -0x20(%rax)
movl %edx, -0x10(%rax)
movupd %xmm0, -0x8(%rax)
movapd %xmm0, -0xd0(%rbp)
andq $0x0, -0xc0(%rbp)
leaq 0x3abd(%rip), %rsi      # 0x60c0
leaq -0x170(%rbp), %rdi
leaq -0x130(%rbp), %rdx
callq 0x2eac
leaq 0x3aaf(%rip), %rsi      # 0x60cc
leaq -0x130(%rbp), %rdi
leaq -0x110(%rbp), %rdx
callq 0x2eac
leaq -0x100(%rbp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
andq $0x0, -0x38(%rbp)
movb $0x0, (%rax)
andq $0x0, -0x68(%rbp)
xorl %eax, %eax
testl %ebx, %ebx
setg %al
subl %eax, %ebx
xorl %eax, %eax
testl %ebx, %ebx
setg %al
leaq (%r14,%rax,8), %r14
leaq 0x7538(%rip), %rsi      # 0x9ba0
leaq -0x98(%rbp), %rdi
movl %ebx, %edx
movq %r14, %rcx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x2f06
movq %rsp, -0xd8(%rbp)
movl -0x94(%rbp), %ecx
movq %rsp, %r15
imulq $0x30, %rcx, %rax
subq %rax, %r15
movq %r15, %rsp
testq %rcx, %rcx
je 0x26ce
leaq 0x10(%r15), %rcx
leaq 0x1(%r15), %rdx
xorl %esi, %esi
xorpd %xmm0, %xmm0
leaq (%rdx,%rsi), %rdi
movupd %xmm0, 0xc(%rcx,%rsi)
movapd %xmm0, (%rcx,%rsi)
movq %rdi, -0x8(%rcx,%rsi)
movq %rdi, -0x10(%rcx,%rsi)
addq $0x30, %rsi
cmpq %rsi, %rax
jne 0x26ac
movl -0x98(%rbp), %ecx
movq %rsp, %r9
imulq $0x30, %rcx, %rax
subq %rax, %r9
movq %r9, %rsp
testq %rcx, %rcx
je 0x2716
leaq 0x10(%r9), %rcx
leaq 0x1(%r9), %rdx
xorl %esi, %esi
xorpd %xmm0, %xmm0
leaq (%rdx,%rsi), %rdi
movupd %xmm0, 0xc(%rcx,%rsi)
movapd %xmm0, (%rcx,%rsi)
movq %rdi, -0x8(%rcx,%rsi)
movq %rdi, -0x10(%rcx,%rsi)
addq $0x30, %rsi
cmpq %rsi, %rax
jne 0x26f4
subq $0x8, %rsp
leaq 0x747f(%rip), %rsi      # 0x9ba0
leaq -0xb0(%rbp), %rdi
movl %ebx, %edx
movq %r14, %rcx
movq %r15, %r8
pushq $-0x1
pushq $0x0
pushq $0x0
callq 0x2f30
addq $0x20, %rsp
cmpb $0x0, -0xa0(%rbp)
je 0x2750
pushq $0x1
popq %rbx
jmp 0x2db0
testl %ebx, %ebx
je 0x27a1
cmpq $0x0, 0x40(%r15)
jne 0x27a1
cmpq $0x0, 0x70(%r15)
je 0x2770
movq 0x80(%r15), %rdi
callq 0x22a0
jmp 0x2773
pushq $0x16
popq %rax
movl %eax, -0x2c(%rbp)
cmpq $0x0, 0xd0(%r15)
je 0x278e
movq 0xe0(%r15), %rdi
callq 0x22a0
jmp 0x2791
pushq $-0x1
popq %rax
movl %eax, -0x3c(%rbp)
movl -0xac(%rbp), %r14d
cmpl $0x2, %r14d
jge 0x27c3
movq 0x7818(%rip), %rdi      # 0x9fc0
leaq 0x73f1(%rip), %rsi      # 0x9ba0
pushq $0x50
popq %rdx
pushq $0x32
popq %rcx
pushq $0x4b
popq %r8
callq 0x2f6f
jmp 0x2dae
movq 0xa0(%r15), %rax
movq %rax, -0x80(%rbp)
movq 0x130(%r15), %rax
movq %rax, -0xe0(%rbp)
movq 0x160(%r15), %rax
movq %rax, -0x60(%rbp)
movq -0xa8(%rbp), %rax
movq (%rax), %rbx
leaq -0x110(%rbp), %rdi
leaq -0x130(%rbp), %rsi
callq 0x2350
movq %rax, %rdi
movq %rbx, %rsi
callq 0x2320
movq (%rax), %rdi
leaq 0x38b8(%rip), %rsi      # 0x60d1
callq 0x2080
movq %rax, %r15
movq 0x77c0(%rip), %rdi      # 0x9fe8
leaq 0x38a4(%rip), %rsi      # 0x60d3
callq 0x2160
movq %rax, %rdi
callq 0x20d0
leaq -0x198(%rbp), %rax
movq %rax, -0x48(%rbp)
decl %r14d
movl %r14d, %eax
movq %rax, -0x50(%rbp)
leaq (,%rax,8), %r12
xorl %r14d, %r14d
leaq -0x1d8(%rbp), %r13
leaq -0x38(%rbp), %rdi
leaq -0x68(%rbp), %rsi
movq %r15, %rdx
callq 0x21f0
cmpq $-0x1, %rax
je 0x2916
movq -0x38(%rbp), %rsi
testb $0x1, %r14b
jne 0x28a6
movq %r13, %rdi
callq 0x2330
movq %r13, %rdi
callq 0x21e0
movq %r13, %rdi
xorl %esi, %esi
pushq $0x1
popq %rdx
callq 0x2040
jmp 0x290e
xorl %edx, %edx
cmpq $0x0, -0x80(%rbp)
setne %dl
movq %rsi, %rdi
movl -0x2c(%rbp), %esi
callq 0x2f93
movq %rax, -0x90(%rbp)
movq %r12, %rdi
callq 0x2030
movq %rax, %rbx
movq %rax, %rdi
xorl %esi, %esi
movq %r12, %rdx
callq 0x20f0
leaq -0x1a8(%rbp), %rdi
leaq -0x90(%rbp), %rsi
callq 0x4754
movq %rbx, (%rax)
leaq -0x210(%rbp), %rdi
leaq -0x90(%rbp), %rsi
callq 0x4acc
movq %rax, %rdi
movq %r13, %rsi
callq 0x3036
incl %r14d
jmp 0x2863
movq %r15, %rdi
callq 0x2170
movq -0x38(%rbp), %rdi
callq 0x21d0
movq 0x76ba(%rip), %rdi      # 0x9fe8
leaq 0x37ae(%rip), %rsi      # 0x60e3
callq 0x2160
movq %rax, %rdi
callq 0x20d0
xorl %r14d, %r14d
leaq -0x110(%rbp), %rbx
cmpq -0x50(%rbp), %r14
je 0x2bea
movq 0x768b(%rip), %rdi      # 0x9fe8
leaq 0x3796(%rip), %rsi      # 0x60fa
callq 0x2160
movq -0xa8(%rbp), %rcx
movq 0x8(%rcx,%r14,8), %rsi
movq %rax, %rdi
callq 0x2160
movq %rax, %rdi
leaq 0x392d(%rip), %rsi      # 0x62b4
callq 0x2160
andq $0x0, -0x38(%rbp)
andq $0x0, -0x68(%rbp)
movq %rbx, %rdi
leaq 0x37a2(%rip), %rsi      # 0x6142
callq 0x2330
movq %rbx, %rdi
leaq -0x170(%rbp), %rsi
callq 0x2350
leaq 0x1(%r14), %rdx
movq -0xa8(%rbp), %rcx
movq %rdx, -0xe8(%rbp)
movq (%rcx,%rdx,8), %rsi
movq %rax, %rdi
callq 0x2320
movq %r14, -0x78(%rbp)
movq (%rax), %rdi
leaq 0x36f1(%rip), %rsi      # 0x60d1
callq 0x2080
movq %rax, -0x88(%rbp)
andq $0x0, -0x58(%rbp)
xorl %eax, %eax
movl %eax, %r15d
andl $0x3, %r15d
movl %eax, -0x6c(%rbp)
movl %eax, %eax
cvtsi2sd %rax, %xmm0
mulsd 0x35fc(%rip), %xmm0     # 0x6008
cvttsd2si %xmm0, %r12d
incl %r12d
movl %r12d, %eax
xorl %edx, %edx
movl $0xf4240, %ecx          # imm = 0xF4240
divl %ecx
movl %edx, %r14d
leaq -0x38(%rbp), %rdi
leaq -0x68(%rbp), %rsi
movq -0x88(%rbp), %rdx
callq 0x21f0
cmpq $-0x1, %rax
je 0x2b2b
cmpl $0x1, %r15d
jne 0x2b21
cmpl -0x3c(%rbp), %r12d
jae 0x2b2b
testl %r14d, %r14d
jne 0x2a80
movq 0x7587(%rip), %rdi      # 0x9fe8
movl %r12d, %esi
callq 0x22f0
movq %rax, %rdi
leaq 0x36a0(%rip), %rsi      # 0x6113
callq 0x2160
movq %rax, %rdi
callq 0x20d0
movq -0x38(%rbp), %r13
movq %r13, %rdi
callq 0x20b0
movq %rax, %rbx
decl %ebx
subl -0x2c(%rbp), %ebx
jb 0x2a23
incl %ebx
addq %rbx, -0x58(%rbp)
movq $-0x3, -0xf0(%rbp)
xorl %r14d, %r14d
cmpl %r14d, %ebx
je 0x2b21
xorl %eax, %eax
cmpq $0x0, -0x80(%rbp)
setne %al
subq $0x8, %rsp
movl %r14d, %edi
movq %r13, %rsi
movl -0x2c(%rbp), %edx
leaq -0xf0(%rbp), %rcx
leaq -0x1b0(%rbp), %r8
leaq -0x1b8(%rbp), %r9
pushq %rax
callq 0x3062
popq %rcx
popq %rdx
movq %rax, -0x150(%rbp)
leaq -0x1a8(%rbp), %rdi
leaq -0x150(%rbp), %rsi
callq 0x4ffe
testq %rax, %rax
je 0x2b1c
movq 0x10(%rax), %rax
movq -0x78(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
addsd 0x34f9(%rip), %xmm0     # 0x6010
movsd %xmm0, (%rax,%rcx,8)
incl %r14d
jmp 0x2aaa
movl -0x6c(%rbp), %eax
incl %eax
jmp 0x29f3
leaq -0xd0(%rbp), %rdi
leaq -0x58(%rbp), %rsi
callq 0x3154
leaq -0x110(%rbp), %rbx
movq -0x78(%rbp), %r14
cmpq $0x0, -0xe0(%rbp)
je 0x2bc9
cmpq $0x0, -0x58(%rbp)
je 0x2bc9
movq 0x748a(%rip), %rdi      # 0x9fe8
leaq 0x35bc(%rip), %rsi      # 0x6121
callq 0x2160
movq %rax, %rdi
callq 0x20d0
movq -0x198(%rbp), %rax
movsd -0x58(%rbp), %xmm1
unpcklps 0x34ab(%rip), %xmm1     # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x34b3(%rip), %xmm1     # 0x6040
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
testq %rax, %rax
je 0x2bc9
movq 0x10(%rax), %rcx
movsd (%rcx,%r14,8), %xmm1
ucomisd 0x3470(%rip), %xmm1     # 0x6020
jbe 0x2bc4
mulsd 0x345e(%rip), %xmm1     # 0x6018
divsd %xmm0, %xmm1
movsd %xmm1, (%rcx,%r14,8)
movq (%rax), %rax
jmp 0x2b99
movq -0x88(%rbp), %rdi
callq 0x2170
movq -0x38(%rbp), %rdi
callq 0x21d0
movq -0xe8(%rbp), %r14
jmp 0x294c
movq 0x73cf(%rip), %rdi      # 0x9fc0
leaq 0x353a(%rip), %rsi      # 0x6132
callq 0x2160
cmpq $0x0, -0x60(%rbp)
je 0x2c17
movq 0x73b5(%rip), %rdi      # 0x9fc0
leaq 0x3524(%rip), %rsi      # 0x6136
callq 0x2160
xorl %r15d, %r15d
movq 0x739f(%rip), %rbx      # 0x9fc0
leaq 0x3519(%rip), %r14      # 0x6141
cmpq %r15, -0x50(%rbp)
je 0x2c52
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2160
movq -0xa8(%rbp), %rcx
movq 0x8(%rcx,%r15,8), %rsi
incq %r15
movq %rax, %rdi
callq 0x2160
jmp 0x2c28
movq 0x7367(%rip), %rdi      # 0x9fc0
leaq 0x3654(%rip), %rsi      # 0x62b4
callq 0x2160
movl -0x2c(%rbp), %edi
callq 0x2030
movq %rax, %r14
movq 0x7349(%rip), %r15      # 0x9fc0
leaq 0x34c3(%rip), %r12      # 0x6141
leaq -0x150(%rbp), %r13
movq -0x48(%rbp), %rax
movq (%rax), %rax
testq %rax, %rax
je 0x2d3b
movq %rax, -0x48(%rbp)
movq 0x8(%rax), %rdi
movl -0x2c(%rbp), %esi
movq %r14, %rdx
callq 0x3174
movq %r15, %rdi
movq %r14, %rsi
callq 0x2160
cmpq $0x0, -0x60(%rbp)
je 0x2d01
movq %r15, %rdi
movq %r12, %rsi
callq 0x2160
movq %rax, %rbx
movq -0x48(%rbp), %rax
leaq 0x8(%rax), %rsi
leaq -0x210(%rbp), %rdi
callq 0x4acc
movq %r13, %rdi
movq %rax, %rsi
leaq 0x345a(%rip), %rdx      # 0x6143
callq 0x24ac
movq %rbx, %rdi
movq %r13, %rsi
callq 0x2150
movq %r13, %rdi
callq 0x20c0
xorl %ebx, %ebx
cmpq %rbx, -0x50(%rbp)
je 0x2d2e
movq %r15, %rdi
movq %r12, %rsi
callq 0x2160
movq -0x48(%rbp), %rcx
movq 0x10(%rcx), %rcx
movsd (%rcx,%rbx,8), %xmm0
movq %rax, %rdi
callq 0x22c0
incq %rbx
jmp 0x2d03
movq %r15, %rdi
callq 0x20d0
jmp 0x2c85
movq 0x727e(%rip), %rdi      # 0x9fc0
leaq 0x33fc(%rip), %rsi      # 0x6145
callq 0x2160
cmpq $0x0, -0x60(%rbp)
je 0x2d68
movq 0x7264(%rip), %rdi      # 0x9fc0
leaq 0x33f0(%rip), %rsi      # 0x6153
callq 0x2160
xorl %r15d, %r15d
movq 0x724e(%rip), %rbx      # 0x9fc0
leaq 0x33c8(%rip), %r14      # 0x6141
cmpq %r15, -0x50(%rbp)
je 0x2da2
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2160
movq -0xd0(%rbp), %rcx
movq (%rcx,%r15,8), %rsi
movq %rax, %rdi
callq 0x2100
incq %r15
jmp 0x2d79
movq 0x7217(%rip), %rdi      # 0x9fc0
callq 0x20d0
xorl %ebx, %ebx
movq -0xd8(%rbp), %rsp
leaq -0x110(%rbp), %rdi
callq 0x20c0
leaq -0x130(%rbp), %rdi
callq 0x20c0
leaq -0x170(%rbp), %rdi
callq 0x20c0
leaq -0xd0(%rbp), %rdi
callq 0x3d2e
leaq -0x210(%rbp), %rdi
callq 0x39ce
leaq -0x1a8(%rbp), %rdi
callq 0x3b14
leaq -0x1d8(%rbp), %rdi
callq 0x20c0
movl %ebx, %eax
leaq -0x28(%rbp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x2e4d
jmp 0x2e4d
movq %rax, %rbx
jmp 0x2e68
movq %rax, %rbx
jmp 0x2e74
movq %rax, %rbx
leaq -0x150(%rbp), %rdi
callq 0x20c0
jmp 0x2e50
jmp 0x2e4d
jmp 0x2e4d
jmp 0x2e4d
jmp 0x2e4d
jmp 0x2e4d
jmp 0x2e4d
jmp 0x2e4d
jmp 0x2e4d
jmp 0x2e4d
movq %rax, %rbx
leaq -0x110(%rbp), %rdi
callq 0x20c0
leaq -0x130(%rbp), %rdi
callq 0x20c0
leaq -0x170(%rbp), %rdi
callq 0x20c0
leaq -0xd0(%rbp), %rdi
callq 0x3d2e
leaq -0x210(%rbp), %rdi
callq 0x39ce
leaq -0x1a8(%rbp), %rdi
callq 0x3b14
leaq -0x1d8(%rbp), %rdi
callq 0x20c0
movq %rbx, %rdi
callq 0x2300