// File: /workspace/github_cpp_makefile_star2_O2/joao18araujo[P]pierluigi/src/fourth_species_counterpoint.cpp
// Function: FourthSpeciesCounterpoint::solve(unsigned int, unsigned int, int, int, bool, Song&)
bool FourthSpeciesCounterpoint::solve(unsigned position, unsigned compass_position, int paralels, int same_movements, bool ascendant, Song & counterpoint){
  if(position + compass_position == 0){
    memset(dp, true, sizeof dp);
    srand(clock());
  }

  if(position >= song->size_without_rest()){
    // printf("Total: %d %lu\n", paralels, song->size() - same_movements);
    return true;
  }

  if((position + compass_position) && !dp[position][compass_position][counterpoint.back().midi_number][paralels][same_movements]) return false;

  vector<Interval> possible_intervals;

  Note note = song->notes[position];

  if(position and (position < song->size_without_rest() - 1 or compass_position == 0)){
    auto previous_note = song->notes[position - 1 + (compass_position != 0)];
    auto previous_counterpoint_note = counterpoint.notes.back();
    auto melodic_cantus_interval = Interval(previous_note, note);
    bool melodic_ascendant = !melodic_cantus_interval.ascendant(); // XOR with true
    auto previous_interval = Interval(previous_note, previous_counterpoint_note);
    auto linked_interval = Interval(note, previous_counterpoint_note);

    int size = 0;
    if(not note.rest()){
      if(compass_position == 0){
        if(linked_interval.is_dissonant()) {
          possible_intervals.push_back(linked_interval);
          size = possible_intervals.size();
        }

        if(ascendant){
          possible_intervals.push_back(Interval("P4", ascendant));
          possible_intervals.push_back(Interval("m7", ascendant));
          possible_intervals.push_back(Interval("M7", ascendant));
        }else{
          possible_intervals.push_back(Interval("m2", ascendant));
          possible_intervals.push_back(Interval("M2", ascendant));
          possible_intervals.push_back(Interval("m9", ascendant));
          possible_intervals.push_back(Interval("M9", ascendant));
        }
      }else{
        if(ascendant){
          if(previous_interval.quantitative == 4){
            possible_intervals.push_back(Interval("m3", ascendant));
            possible_intervals.push_back(Interval("M3", ascendant));
          }else if(previous_interval.quantitative == 7){
            possible_intervals.push_back(Interval("m6", ascendant));
            possible_intervals.push_back(Interval("M6", ascendant));
          }
        }else{
          if(previous_interval.quantitative == 2){
            possible_intervals.push_back(Interval("m3", ascendant));
            possible_intervals.push_back(Interval("M3", ascendant));
          }else if(previous_interval.quantitative == 9){
            possible_intervals.push_back(Interval("m10", ascendant));
            possible_intervals.push_back(Interval("M10", ascendant));
          }
        }
      }

      random_shuffle(possible_intervals.begin() + size, possible_intervals.end());
    }else{
      possible_intervals.push_back(Interval("P1"));
    }

    // printf("[%u][%u][%d][%d][%d]\n", position - 1 + compass_position, compass_position, song->notes[position - 1 + compass_position].midi_number, paralels, same_movements);

    int par, sm;
    for(auto interval : possible_intervals){
      auto c_note = Interval::interval_to_note(note, interval);
      c_note.duration /= 2;
      c_note.linked = (c_note == counterpoint.back());
      Interval melodic_interval(previous_counterpoint_note, note);

      par = paralels - (interval.quantitative == previous_interval.quantitative and (interval.quantitative == 3 || interval.quantitative == 6 || interval.quantitative == 10));
      sm = same_movements - (melodic_interval.ascendant() != melodic_ascendant);
      if(par < 0 || sm < 0) continue;
      counterpoint.notes.push_back(c_note);
      if(solve(position + compass_position, (compass_position + 1)%2, par, sm, ascendant, counterpoint)) return true;
      counterpoint.notes.pop_back();
    }
  }else if(position == song->size_without_rest() - 1 && compass_position){
    //Última nota
    auto previous_note = song->notes[position - 1];
    auto previous_counterpoint_note = counterpoint.notes.back();
    auto melodic_cantus_interval = Interval(previous_note, note);
    bool melodic_ascendant = !melodic_cantus_interval.ascendant(); // XOR with true
    auto previous_interval = Interval(previous_note, previous_counterpoint_note);

    if(not note.rest()){
      analyse_and_add_interval(true, melodic_ascendant, possible_intervals, previous_note, note, Interval("P1", ascendant), &counterpoint);
      if(previous_interval != "P8")
        analyse_and_add_interval(true, melodic_ascendant, possible_intervals, previous_note, note, Interval("P8", ascendant), &counterpoint);
      if(previous_interval != "P5" && ascendant)
        analyse_and_add_interval(true, melodic_ascendant, possible_intervals, previous_note, note, Interval("P5", ascendant), &counterpoint);

      random_shuffle(possible_intervals.begin(), possible_intervals.end());
      int size = possible_intervals.size();

      analyse_and_add_interval(false, !melodic_ascendant, possible_intervals, previous_note, note, Interval("P1", ascendant), &counterpoint);
      if(previous_interval != "P8")
        analyse_and_add_interval(false, !melodic_ascendant, possible_intervals, previous_note, note, Interval("P8", ascendant), &counterpoint);
      if(previous_interval != "P5" && ascendant)
        analyse_and_add_interval(false, !melodic_ascendant, possible_intervals, previous_note, note, Interval("P5", ascendant), &counterpoint);

      random_shuffle(possible_intervals.begin() + size, possible_intervals.end());
    }else{
      possible_intervals.push_back(Interval("P1"));
    }

    int par, sm;
    for(auto interval : possible_intervals){
      auto c_note = Interval::interval_to_note(note, interval);
      Interval melodic_interval(previous_counterpoint_note, note);

      par = paralels - (interval.quantitative == previous_interval.quantitative and (interval.quantitative == 3 || interval.quantitative == 6 || interval.quantitative == 10)); //TODO: criar método retornando qualidade
      sm = same_movements -  (melodic_interval.ascendant() != melodic_ascendant);
      if(par < 0 || sm < 0) continue;
      c_note.duration /= 2;
      counterpoint.notes.push_back(c_note);
      if(solve(position + 1, 0, par, sm, ascendant, counterpoint)) return true;
      counterpoint.notes.pop_back();
    }
  }else{
    //Primeira nota
    if(compass_position == 0){
      counterpoint.notes.push_back(Note("r", "", 0, song->notes[0].duration / 2));
      if(solve(0, 1, paralels, same_movements, ascendant, counterpoint)) return true;
      counterpoint.notes.pop_back();
    }else{
      possible_intervals.push_back(Interval("P1", ascendant));
      possible_intervals.push_back(Interval("P8", ascendant));
      possible_intervals.push_back(Interval("m3", ascendant));
      possible_intervals.push_back(Interval("M3", ascendant));
      possible_intervals.push_back(Interval("m7", ascendant));
      possible_intervals.push_back(Interval("M7", ascendant));
      possible_intervals.push_back(Interval("m10", ascendant));
      possible_intervals.push_back(Interval("M10", ascendant));

      random_shuffle(possible_intervals.begin(), possible_intervals.end());

      for(auto interval : possible_intervals){
        auto c_note = Interval::interval_to_note(note, interval);
        c_note.duration /= 2;
        counterpoint.notes.push_back(c_note);
        if(solve(position + compass_position, (compass_position + 1)%2, paralels, same_movements, ascendant, counterpoint)) return true;
        counterpoint.notes.pop_back();
      }
    }
  }

  dp[position][compass_position][counterpoint.back().midi_number][paralels][same_movements] = false;
  return false;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x12c8, %rsp           # imm = 0x12C8
movq %r9, 0x18(%rsp)
movl %r8d, %ebp
movl %ecx, 0x44(%rsp)
movl %edx, 0x40(%rsp)
movl %esi, %r15d
movl %edi, %r14d
movl %esi, %eax
addl %edi, %eax
movl %eax, 0xa8(%rsp)
jne 0xc79a
leaq 0x2e02f(%rip), %rdi     # 0x3a7b0
pushq $0x1
popq %rsi
movl $0x9bc8cf8, %edx        # imm = 0x9BC8CF8
callq 0x5220
callq 0x5270
movl %eax, %edi
callq 0x5330
leaq 0x9bf6d07(%rip), %rax   # 0x9c034a8
movq (%rax), %rdi
callq 0x17cf4
movb $0x1, %bl
cmpl %r14d, %eax
jbe 0xe1de
movl %ebp, 0x48(%rsp)
movq %r14, 0x108(%rsp)
movl %r14d, %r12d
movl %r15d, 0x114(%rsp)
movl %r15d, %r15d
movslq 0x40(%rsp), %r13
movslq 0x44(%rsp), %r14
cmpl $0x0, 0xa8(%rsp)
je 0xc83d
leaq 0x248(%rsp), %rbx
movq %rbx, %rdi
movq 0x18(%rsp), %rsi
callq 0x17d60
imulq $0x1081c8, %r12, %rax   # imm = 0x1081C8
addq 0x2d773(%rip), %rax     # 0x39f78
movslq 0x4c(%rbx), %rcx
imulq $0x42072, %r15, %rdx    # imm = 0x42072
addq %rax, %rdx
imulq $0xbbd, %rcx, %rax      # imm = 0xBBD
addq %rdx, %rax
imulq $0x259, %r13, %rcx      # imm = 0x259
addq %rax, %rcx
movb (%r14,%rcx), %bpl
movq %rbx, %rdi
callq 0x979a
cmpb $0x1, %bpl
jne 0xca6a
movq %r15, 0x200(%rsp)
movq %r13, 0x208(%rsp)
movq %r14, 0x210(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x20(%rsp)
andq $0x0, 0x30(%rsp)
leaq 0x9bf6c3e(%rip), %rbx   # 0x9c034a8
movq (%rbx), %rax
movq %r12, 0x1f8(%rsp)
imulq $0x58, %r12, %rsi
addq (%rax), %rsi
leaq 0x248(%rsp), %rdi
callq 0x12676
movzbl 0x48(%rsp), %eax
movl %eax, 0x14(%rsp)
movl 0x114(%rsp), %ebp
movl %ebp, %eax
notl %eax
movl %eax, 0x38(%rsp)
pushq $0x30
popq %r14
movq 0x108(%rsp), %r15
testl %r15d, %r15d
je 0xc8cd
movq (%rbx), %rdi
callq 0x17cf4
testl %ebp, %ebp
je 0xce8c
decl %eax
cmpl %r15d, %eax
ja 0xce8c
movq (%rbx), %rdi
callq 0x17cf4
testl %ebp, %ebp
je 0xca71
decl %eax
cmpl %r15d, %eax
jne 0xca71
movq (%rbx), %rax
leal -0x1(%r15), %ecx
imulq $0x58, %rcx, %rsi
addq (%rax), %rsi
leaq 0xb0(%rsp), %rdi
callq 0x12676
movq 0x18(%rsp), %rax
movq 0x8(%rax), %rsi
addq $-0x58, %rsi
leaq 0x1a0(%rsp), %rdi
callq 0x12676
leaq 0xdf8(%rsp), %rdi
leaq 0xb0(%rsp), %rsi
callq 0x12676
leaq 0xda0(%rsp), %rdi
leaq 0x248(%rsp), %rsi
callq 0x12676
leaq 0x148(%rsp), %rdi
leaq 0xdf8(%rsp), %rsi
leaq 0xda0(%rsp), %rdx
callq 0xf41a
leaq 0xda0(%rsp), %rdi
callq 0x979a
leaq 0xdf8(%rsp), %rdi
callq 0x979a
leaq 0x148(%rsp), %rdi
callq 0xf856
movl %eax, %r12d
leaq 0xd48(%rsp), %rdi
leaq 0xb0(%rsp), %rsi
callq 0x12676
leaq 0xcf0(%rsp), %rdi
leaq 0x1a0(%rsp), %rsi
callq 0x12676
leaq 0x218(%rsp), %rdi
leaq 0xd48(%rsp), %rsi
leaq 0xcf0(%rsp), %rdx
callq 0xf41a
leaq 0xcf0(%rsp), %rdi
callq 0x979a
leaq 0xd48(%rsp), %rdi
callq 0x979a
leaq 0x248(%rsp), %rdi
callq 0x1302a
movl %r12d, %ecx
xorb $0x1, %cl
movb %cl, 0x38(%rsp)
testb %al, %al
je 0xd070
leaq 0x1c60b(%rip), %rsi     # 0x29020
leaq 0x410(%rsp), %rdi
leaq 0x118(%rsp), %rdx
callq 0x96e6
leaq 0x50(%rsp), %rdi
leaq 0x410(%rsp), %rsi
pushq $0x1
popq %rdx
callq 0xf280
leaq 0x20(%rsp), %rdi
leaq 0x50(%rsp), %rsi
callq 0xc54a
leaq 0x58(%rsp), %rdi
callq 0x51b0
leaq 0x410(%rsp), %rdi
callq 0x51b0
jmp 0xd635
xorl %ebx, %ebx
jmp 0xe1de
testl %ebp, %ebp
je 0xd92e
leaq 0x1c5a0(%rip), %rsi     # 0x29020
leaq 0x3b0(%rsp), %rdi
leaq 0x1a0(%rsp), %rdx
callq 0x96e6
leaq 0xb0(%rsp), %rdi
leaq 0x3b0(%rsp), %rsi
movl 0x14(%rsp), %edx
callq 0xf280
leaq 0x20(%rsp), %rdi
leaq 0xb0(%rsp), %rsi
callq 0xc54a
leaq 0xb8(%rsp), %rdi
callq 0x51b0
leaq 0x3b0(%rsp), %rdi
callq 0x51b0
leaq 0x1c542(%rip), %rsi     # 0x29023
leaq 0x390(%rsp), %rdi
leaq 0x1a0(%rsp), %rdx
callq 0x96e6
leaq 0xb0(%rsp), %rdi
leaq 0x390(%rsp), %rsi
movl 0x14(%rsp), %edx
callq 0xf280
leaq 0x20(%rsp), %rdi
leaq 0xb0(%rsp), %rsi
callq 0xc54a
leaq 0xb8(%rsp), %rdi
callq 0x51b0
leaq 0x390(%rsp), %rdi
callq 0x51b0
leaq 0x1c4e7(%rip), %rsi     # 0x29029
leaq 0x370(%rsp), %rdi
leaq 0x1a0(%rsp), %rdx
callq 0x96e6
leaq 0xb0(%rsp), %rdi
leaq 0x370(%rsp), %rsi
movl 0x14(%rsp), %edx
callq 0xf280
leaq 0x20(%rsp), %rdi
leaq 0xb0(%rsp), %rsi
callq 0xc54a
leaq 0xb8(%rsp), %rdi
callq 0x51b0
leaq 0x370(%rsp), %rdi
callq 0x51b0
leaq 0x1c489(%rip), %rsi     # 0x2902c
leaq 0x350(%rsp), %rdi
leaq 0x1a0(%rsp), %rdx
callq 0x96e6
leaq 0xb0(%rsp), %rdi
leaq 0x350(%rsp), %rsi
movl 0x14(%rsp), %edx
callq 0xf280
leaq 0x20(%rsp), %rdi
leaq 0xb0(%rsp), %rsi
callq 0xc54a
leaq 0xb8(%rsp), %rdi
callq 0x51b0
leaq 0x350(%rsp), %rdi
callq 0x51b0
leaq 0x1c4b7(%rip), %rsi     # 0x290bb
leaq 0x330(%rsp), %rdi
leaq 0x1a0(%rsp), %rdx
callq 0x96e6
leaq 0xb0(%rsp), %rdi
leaq 0x330(%rsp), %rsi
movl 0x14(%rsp), %edx
callq 0xf280
leaq 0x20(%rsp), %rdi
leaq 0xb0(%rsp), %rsi
callq 0xc54a
leaq 0xb8(%rsp), %rdi
callq 0x51b0
leaq 0x330(%rsp), %rdi
callq 0x51b0
leaq 0x1c459(%rip), %rsi     # 0x290be
leaq 0x310(%rsp), %rdi
leaq 0x1a0(%rsp), %rdx
callq 0x96e6
leaq 0xb0(%rsp), %rdi
leaq 0x310(%rsp), %rsi
movl 0x14(%rsp), %edx
callq 0xf280
leaq 0x20(%rsp), %rdi
leaq 0xb0(%rsp), %rsi
callq 0xc54a
leaq 0xb8(%rsp), %rdi
callq 0x51b0
leaq 0x310(%rsp), %rdi
callq 0x51b0
leaq 0x1c36f(%rip), %rsi     # 0x29035
leaq 0x2f0(%rsp), %rdi
leaq 0x1a0(%rsp), %rdx
callq 0x96e6
leaq 0xb0(%rsp), %rdi
leaq 0x2f0(%rsp), %rsi
movl 0x14(%rsp), %edx
callq 0xf280
leaq 0x20(%rsp), %rdi
leaq 0xb0(%rsp), %rsi
callq 0xc54a
leaq 0xb8(%rsp), %rdi
callq 0x51b0
leaq 0x2f0(%rsp), %rdi
callq 0x51b0
leaq 0x1c312(%rip), %rsi     # 0x29039
leaq 0x2d0(%rsp), %rdi
leaq 0x1a0(%rsp), %rdx
callq 0x96e6
leaq 0xb0(%rsp), %rdi
leaq 0x2d0(%rsp), %rsi
movl 0x14(%rsp), %edx
callq 0xf280
leaq 0x20(%rsp), %rdi
leaq 0xb0(%rsp), %rsi
callq 0xc54a
leaq 0xb8(%rsp), %rdi
callq 0x51b0
leaq 0x2d0(%rsp), %rdi
callq 0x51b0
movq 0x20(%rsp), %rdi
movq 0x28(%rsp), %rsi
callq 0xc3c6
movq 0x20(%rsp), %rbx
movq 0x28(%rsp), %rax
movq %rax, 0x48(%rsp)
andl $0x1, 0x38(%rsp)
leaq 0x1a0(%rsp), %rbp
leaq 0x1168(%rsp), %r13
leaq 0x870(%rsp), %r14
leaq 0xb0(%rsp), %r15
movq 0x18(%rsp), %r12
cmpq 0x48(%rsp), %rbx
je 0xe15b
movq %rbp, %rdi
movq %rbx, %rsi
callq 0x97b4
movq %r13, %rdi
leaq 0x248(%rsp), %rsi
callq 0x12676
movq %r14, %rdi
movq %rbp, %rsi
callq 0x97b4
movq %r15, %rdi
movq %r13, %rsi
movq %r14, %rdx
callq 0xf750
leaq 0x878(%rsp), %rdi
callq 0x51b0
movq %r13, %rdi
callq 0x979a
movl 0xb0(%rsp), %eax
cltd
pushq $0x2
popq %rcx
idivl %ecx
movl %eax, 0xb0(%rsp)
movq %r12, %rdi
movq %r15, %rsi
callq 0x986e
movl 0xa8(%rsp), %edi
movl 0x38(%rsp), %esi
movl 0x40(%rsp), %edx
movl 0x44(%rsp), %ecx
movl 0x14(%rsp), %r8d
movq %r12, %r9
callq 0xc746
testb %al, %al
jne 0xda05
movq 0x18(%rsp), %rdi
callq 0xc42c
movq %r15, %rdi
callq 0x979a
leaq 0x1a8(%rsp), %rdi
callq 0x51b0
addq $0x30, %rbx
jmp 0xcdc9
movq (%rbx), %rax
cmpl $0x1, %ebp
sbbl $-0x1, %r15d
decl %r15d
imulq $0x58, %r15, %rsi
addq (%rax), %rsi
leaq 0xb0(%rsp), %rdi
callq 0x12676
movq 0x18(%rsp), %rax
movq 0x8(%rax), %rsi
addq $-0x58, %rsi
leaq 0x1a0(%rsp), %rdi
callq 0x12676
movl 0x48(%rsp), %ebx
leaq 0x1008(%rsp), %rdi
leaq 0xb0(%rsp), %rsi
callq 0x12676
leaq 0xfb0(%rsp), %rdi
leaq 0x248(%rsp), %rsi
callq 0x12676
leaq 0x218(%rsp), %rdi
leaq 0x1008(%rsp), %rsi
leaq 0xfb0(%rsp), %rdx
callq 0xf41a
leaq 0xfb0(%rsp), %rdi
callq 0x979a
leaq 0x1008(%rsp), %rdi
callq 0x979a
leaq 0x218(%rsp), %rdi
callq 0xf856
movb %al, 0x3f(%rsp)
leaq 0xf58(%rsp), %rdi
leaq 0xb0(%rsp), %rsi
callq 0x12676
leaq 0xf00(%rsp), %rdi
leaq 0x1a0(%rsp), %rsi
callq 0x12676
leaq 0x118(%rsp), %rdi
leaq 0xf58(%rsp), %rsi
leaq 0xf00(%rsp), %rdx
callq 0xf41a
leaq 0xf00(%rsp), %rdi
callq 0x979a
leaq 0xf58(%rsp), %rdi
callq 0x979a
leaq 0xea8(%rsp), %rdi
leaq 0x248(%rsp), %rsi
callq 0x12676
leaq 0xe50(%rsp), %rdi
leaq 0x1a0(%rsp), %rsi
callq 0x12676
leaq 0x2a0(%rsp), %rdi
leaq 0xea8(%rsp), %rsi
leaq 0xe50(%rsp), %rdx
callq 0xf41a
leaq 0xe50(%rsp), %rdi
callq 0x979a
leaq 0xea8(%rsp), %rdi
callq 0x979a
leaq 0x248(%rsp), %rdi
callq 0x1302a
testb %al, %al
je 0xd854
leaq 0x1c005(%rip), %rsi     # 0x29020
leaq 0x4f0(%rsp), %rdi
leaq 0x148(%rsp), %rdx
callq 0x96e6
leaq 0x50(%rsp), %rdi
leaq 0x4f0(%rsp), %rsi
pushq $0x1
popq %rdx
callq 0xf280
leaq 0x20(%rsp), %rdi
leaq 0x50(%rsp), %rsi
callq 0xc54a
leaq 0x58(%rsp), %rdi
callq 0x51b0
leaq 0x4f0(%rsp), %rdi
callq 0x51b0
jmp 0xdefc
leaq 0xc98(%rsp), %rdi
leaq 0xb0(%rsp), %rsi
callq 0x12676
leaq 0xc40(%rsp), %rdi
leaq 0x248(%rsp), %rsi
callq 0x12676
leaq 0x1bf7f(%rip), %rsi     # 0x29020
leaq 0x4d0(%rsp), %rdi
leaq 0x50(%rsp), %rdx
callq 0x96e6
leaq 0x7e0(%rsp), %rdi
leaq 0x4d0(%rsp), %rsi
movl 0x14(%rsp), %edx
callq 0xf280
movq 0x18(%rsp), %rax
movq %rax, (%rsp)
movzbl 0x38(%rsp), %r13d
pushq $0x1
popq %rdi
leaq 0x20(%rsp), %rdx
leaq 0xc98(%rsp), %rcx
leaq 0xc40(%rsp), %r8
leaq 0x7e0(%rsp), %r9
movl %r13d, %esi
callq 0xea86
leaq 0x7e8(%rsp), %rdi
callq 0x51b0
leaq 0x4d0(%rsp), %rdi
callq 0x51b0
leaq 0xc40(%rsp), %rdi
callq 0x979a
leaq 0xc98(%rsp), %rdi
callq 0x979a
leaq 0x1bee5(%rip), %rsi     # 0x29023
leaq 0x50(%rsp), %rdi
leaq 0x118(%rsp), %rdx
callq 0x96e6
leaq 0x218(%rsp), %rdi
leaq 0x50(%rsp), %rsi
callq 0xf59e
movl %eax, %ebx
leaq 0x50(%rsp), %rdi
callq 0x51b0
testb %bl, %bl
je 0xd237
leaq 0xbe8(%rsp), %rdi
leaq 0xb0(%rsp), %rsi
callq 0x12676
leaq 0xb90(%rsp), %rdi
leaq 0x248(%rsp), %rsi
callq 0x12676
leaq 0x1be7c(%rip), %rsi     # 0x29023
leaq 0x4b0(%rsp), %rdi
leaq 0x50(%rsp), %rdx
callq 0x96e6
leaq 0x7b0(%rsp), %rdi
leaq 0x4b0(%rsp), %rsi
movl 0x14(%rsp), %edx
callq 0xf280
movq 0x18(%rsp), %rax
movq %rax, (%rsp)
pushq $0x1
popq %rdi
leaq 0x20(%rsp), %rdx
leaq 0xbe8(%rsp), %rcx
leaq 0xb90(%rsp), %r8
leaq 0x7b0(%rsp), %r9
movl %r13d, %esi
callq 0xea86
leaq 0x7b8(%rsp), %rdi
callq 0x51b0
leaq 0x4b0(%rsp), %rdi
callq 0x51b0
leaq 0xb90(%rsp), %rdi
callq 0x979a
leaq 0xbe8(%rsp), %rdi
callq 0x979a
leaq 0x1bde8(%rip), %rsi     # 0x29026
leaq 0x50(%rsp), %rdi
leaq 0x118(%rsp), %rdx
callq 0x96e6
leaq 0x218(%rsp), %rdi
leaq 0x50(%rsp), %rsi
callq 0xf59e
movl %eax, %ebx
andb 0x48(%rsp), %bl
leaq 0x50(%rsp), %rdi
callq 0x51b0
cmpb $0x1, %bl
jne 0xd33b
leaq 0xb38(%rsp), %rdi
leaq 0xb0(%rsp), %rsi
callq 0x12676
leaq 0xae0(%rsp), %rdi
leaq 0x248(%rsp), %rsi
callq 0x12676
leaq 0x1bd7a(%rip), %rsi     # 0x29026
leaq 0x490(%rsp), %rdi
leaq 0x50(%rsp), %rdx
callq 0x96e6
leaq 0x780(%rsp), %rdi
leaq 0x490(%rsp), %rsi
pushq $0x1
popq %rdx
callq 0xf280
movq 0x18(%rsp), %rax
movq %rax, (%rsp)
pushq $0x1
popq %rdi
leaq 0x20(%rsp), %rdx
leaq 0xb38(%rsp), %rcx
leaq 0xae0(%rsp), %r8
leaq 0x780(%rsp), %r9
movl %r13d, %esi
callq 0xea86
leaq 0x788(%rsp), %rdi
callq 0x51b0
leaq 0x490(%rsp), %rdi
callq 0x51b0
leaq 0xae0(%rsp), %rdi
callq 0x979a
leaq 0xb38(%rsp), %rdi
callq 0x979a
movq 0x20(%rsp), %rdi
movq 0x28(%rsp), %rsi
callq 0xc3c6
movq 0x28(%rsp), %rax
subq 0x20(%rsp), %rax
cqto
idivq %r14
movq %rax, %r13
leaq 0xa88(%rsp), %rdi
leaq 0xb0(%rsp), %rsi
callq 0x12676
leaq 0xa30(%rsp), %rdi
leaq 0x248(%rsp), %rsi
callq 0x12676
leaq 0x1bc93(%rip), %rsi     # 0x29020
leaq 0x470(%rsp), %rdi
leaq 0x50(%rsp), %rdx
callq 0x96e6
leaq 0x750(%rsp), %rdi
leaq 0x470(%rsp), %rsi
movl 0x14(%rsp), %edx
callq 0xf280
movq 0x18(%rsp), %rax
movq %rax, (%rsp)
movzbl %r12b, %ebp
leaq 0x20(%rsp), %rdx
leaq 0xa88(%rsp), %rcx
leaq 0xa30(%rsp), %r8
leaq 0x750(%rsp), %r9
xorl %edi, %edi
movl %ebp, %esi
callq 0xea86
leaq 0x758(%rsp), %rdi
callq 0x51b0
leaq 0x470(%rsp), %rdi
callq 0x51b0
leaq 0xa30(%rsp), %rdi
callq 0x979a
leaq 0xa88(%rsp), %rdi
callq 0x979a
leaq 0x1bbfd(%rip), %rsi     # 0x29023
leaq 0x50(%rsp), %rdi
leaq 0x118(%rsp), %rdx
callq 0x96e6
leaq 0x218(%rsp), %rdi
leaq 0x50(%rsp), %rsi
callq 0xf59e
movl %eax, %ebx
leaq 0x50(%rsp), %rdi
callq 0x51b0
testb %bl, %bl
je 0xd51d
leaq 0x9d8(%rsp), %rdi
leaq 0xb0(%rsp), %rsi
callq 0x12676
leaq 0x980(%rsp), %rdi
leaq 0x248(%rsp), %rsi
callq 0x12676
leaq 0x1bb94(%rip), %rsi     # 0x29023
leaq 0x450(%rsp), %rdi
leaq 0x50(%rsp), %rdx
callq 0x96e6
leaq 0x720(%rsp), %rdi
leaq 0x450(%rsp), %rsi
movl 0x14(%rsp), %edx
callq 0xf280
movq 0x18(%rsp), %rax
movq %rax, (%rsp)
leaq 0x20(%rsp), %rdx
leaq 0x9d8(%rsp), %rcx
leaq 0x980(%rsp), %r8
leaq 0x720(%rsp), %r9
xorl %edi, %edi
movl %ebp, %esi
callq 0xea86
leaq 0x728(%rsp), %rdi
callq 0x51b0
leaq 0x450(%rsp), %rdi
callq 0x51b0
leaq 0x980(%rsp), %rdi
callq 0x979a
leaq 0x9d8(%rsp), %rdi
callq 0x979a
leaq 0x1bb02(%rip), %rsi     # 0x29026
leaq 0x50(%rsp), %rdi
leaq 0x118(%rsp), %rdx
callq 0x96e6
leaq 0x218(%rsp), %rdi
leaq 0x50(%rsp), %rsi
callq 0xf59e
movl %eax, %ebx
andb 0x48(%rsp), %bl
leaq 0x50(%rsp), %rdi
callq 0x51b0
cmpb $0x1, %bl
jne 0xd61f
leaq 0x928(%rsp), %rdi
leaq 0xb0(%rsp), %rsi
callq 0x12676
leaq 0x8d0(%rsp), %rdi
leaq 0x248(%rsp), %rsi
callq 0x12676
leaq 0x1ba94(%rip), %rsi     # 0x29026
leaq 0x430(%rsp), %rdi
leaq 0x50(%rsp), %rdx
callq 0x96e6
leaq 0x6f0(%rsp), %rdi
leaq 0x430(%rsp), %rsi
pushq $0x1
popq %rdx
callq 0xf280
movq 0x18(%rsp), %rax
movq %rax, (%rsp)
leaq 0x20(%rsp), %rdx
leaq 0x928(%rsp), %rcx
leaq 0x8d0(%rsp), %r8
leaq 0x6f0(%rsp), %r9
xorl %edi, %edi
movl %ebp, %esi
callq 0xea86
leaq 0x6f8(%rsp), %rdi
callq 0x51b0
leaq 0x430(%rsp), %rdi
callq 0x51b0
leaq 0x8d0(%rsp), %rdi
callq 0x979a
leaq 0x928(%rsp), %rdi
callq 0x979a
movslq %r13d, %rax
imulq $0x30, %rax, %rdi
addq 0x20(%rsp), %rdi
movq 0x28(%rsp), %rsi
callq 0xc3c6
movq 0x20(%rsp), %rsi
movq 0x28(%rsp), %rax
movq %rax, 0xa8(%rsp)
incl %r15d
leaq 0x118(%rsp), %r12
leaq 0x1060(%rsp), %r14
leaq 0x248(%rsp), %r13
cmpq 0xa8(%rsp), %rsi
je 0xd80b
movq %r12, %rdi
movq %rsi, 0x48(%rsp)
callq 0x97b4
movq %r14, %rdi
movq %r13, %rsi
callq 0x12676
leaq 0x8a0(%rsp), %rbx
movq %rbx, %rdi
movq %r12, %rsi
callq 0x97b4
leaq 0x50(%rsp), %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0xf750
leaq 0x8a8(%rsp), %rdi
callq 0x51b0
movq %r14, %rdi
callq 0x979a
leaq 0x1218(%rsp), %rbx
movq %rbx, %rdi
leaq 0x1a0(%rsp), %rsi
callq 0x12676
leaq 0x11c0(%rsp), %r14
movq %r14, %rdi
movq %r13, %rsi
callq 0x12676
movq %r15, %rbp
leaq 0x2a0(%rsp), %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0xf41a
movq %r14, %rdi
movq %r12, %r14
callq 0x979a
movq %rbx, %rdi
callq 0x979a
movl 0x118(%rsp), %eax
xorl %r15d, %r15d
cmpl 0x218(%rsp), %eax
jne 0xd742
pushq $-0x1
popq %r15
cmpl $0x3, %eax
je 0xd742
cmpl $0x6, %eax
je 0xd742
xorl %r15d, %r15d
cmpl $0xa, %eax
sete %r15b
negl %r15d
movq %r13, %rbx
leaq 0x2a0(%rsp), %rdi
callq 0xf856
addl 0x40(%rsp), %r15d
xorb 0x38(%rsp), %al
movzbl %al, %eax
movl 0x44(%rsp), %r13d
subl %eax, %r13d
movl %r13d, %eax
orl %r15d, %eax
pushq $0x5
popq %r12
js 0xd7bd
movl 0x50(%rsp), %eax
cltd
pushq $0x2
popq %rcx
idivl %ecx
movl %eax, 0x50(%rsp)
movq 0x18(%rsp), %rdi
leaq 0x50(%rsp), %rsi
callq 0x986e
movl %ebp, %edi
xorl %esi, %esi
movl %r15d, %edx
movl %r13d, %ecx
movl 0x14(%rsp), %r8d
movq 0x18(%rsp), %r9
callq 0xc746
pushq $0x1
popq %r12
testb %al, %al
jne 0xd7bd
movq 0x18(%rsp), %rdi
callq 0xc42c
xorl %r12d, %r12d
leaq 0x2a8(%rsp), %rdi
callq 0x51b0
leaq 0x50(%rsp), %rdi
callq 0x979a
leaq 0x120(%rsp), %rdi
callq 0x51b0
cmpl $0x5, %r12d
je 0xd7ec
testl %r12d, %r12d
jne 0xd80f
movq 0x48(%rsp), %rsi
addq $0x30, %rsi
movq %rbp, %r15
movq %r14, %r12
leaq 0x1060(%rsp), %r14
movq %rbx, %r13
jmp 0xd662
pushq $0x4
popq %r12
leaq 0x220(%rsp), %rdi
callq 0x51b0
leaq 0x150(%rsp), %rdi
callq 0x51b0
leaq 0x1a0(%rsp), %rdi
callq 0x979a
leaq 0xb0(%rsp), %rdi
callq 0x979a
movb $0x1, %bl
testb $0x3, %r12b
jne 0xe1c7
jmp 0xe15b
testl %ebp, %ebp
je 0xda26
movl 0x118(%rsp), %eax
testb %bl, %bl
je 0xdb6b
xorl %r15d, %r15d
cmpl $0x7, %eax
je 0xdd84
cmpl $0x4, %eax
jne 0xdee6
leaq 0x1b7a2(%rip), %rsi     # 0x29029
leaq 0x5f0(%rsp), %rdi
leaq 0x148(%rsp), %rdx
callq 0x96e6
leaq 0x50(%rsp), %rdi
leaq 0x5f0(%rsp), %rsi
pushq $0x1
popq %rdx
callq 0xf280
leaq 0x20(%rsp), %rdi
leaq 0x50(%rsp), %rsi
callq 0xc54a
leaq 0x58(%rsp), %rdi
callq 0x51b0
leaq 0x5f0(%rsp), %rdi
callq 0x51b0
leaq 0x1b74e(%rip), %rsi     # 0x2902c
leaq 0x5d0(%rsp), %rdi
leaq 0x148(%rsp), %rdx
callq 0x96e6
leaq 0x50(%rsp), %rdi
leaq 0x5d0(%rsp), %rsi
pushq $0x1
popq %rdx
callq 0xf280
leaq 0x20(%rsp), %rdi
leaq 0x50(%rsp), %rsi
callq 0xc54a
leaq 0x58(%rsp), %rdi
callq 0x51b0
leaq 0x5d0(%rsp), %rdi
jmp 0xde2d
leaq 0x1c310(%rip), %rsi     # 0x29c45
leaq 0x3f0(%rsp), %rdi
leaq 0x1a0(%rsp), %rdx
callq 0x96e6
leaq 0x1bdf9(%rip), %rsi     # 0x2974a
leaq 0x3d0(%rsp), %rdi
leaq 0x50(%rsp), %rdx
callq 0x96e6
movq (%rbx), %rax
movq (%rax), %rax
movl (%rax), %eax
pushq $0x2
popq %rcx
cltd
idivl %ecx
leaq 0xb0(%rsp), %rdi
leaq 0x3f0(%rsp), %rsi
leaq 0x3d0(%rsp), %rdx
xorl %ecx, %ecx
movl %eax, %r8d
xorl %r9d, %r9d
callq 0x12538
leaq 0xb0(%rsp), %rsi
movq 0x18(%rsp), %rbx
movq %rbx, %rdi
callq 0xf11e
leaq 0xb0(%rsp), %rdi
callq 0x979a
leaq 0x3d0(%rsp), %rdi
callq 0x51b0
leaq 0x3f0(%rsp), %rdi
callq 0x51b0
pushq $0x1
popq %rsi
xorl %edi, %edi
movl 0x40(%rsp), %edx
movl 0x44(%rsp), %ecx
movl 0x14(%rsp), %r8d
movq %rbx, %r9
callq 0xc746
movb $0x1, %bl
testb %al, %al
jne 0xe1c7
movq 0x18(%rsp), %rdi
callq 0xc42c
jmp 0xe15b
leaq 0xb0(%rsp), %rdi
callq 0x979a
leaq 0x1a8(%rsp), %rdi
callq 0x51b0
movb $0x1, %bl
jmp 0xe1c7
leaq 0x2a0(%rsp), %rdi
callq 0xf5ea
xorl %r15d, %r15d
testb %al, %al
je 0xda5e
leaq 0x20(%rsp), %rdi
leaq 0x2a0(%rsp), %rsi
callq 0x9968
movq 0x28(%rsp), %rax
subq 0x20(%rsp), %rax
cqto
idivq %r14
movq %rax, %r15
testb %bl, %bl
je 0xdc2c
leaq 0x1b64b(%rip), %rsi     # 0x290b8
leaq 0x6d0(%rsp), %rdi
leaq 0x148(%rsp), %rdx
callq 0x96e6
leaq 0x50(%rsp), %rdi
leaq 0x6d0(%rsp), %rsi
pushq $0x1
popq %rdx
callq 0xf280
leaq 0x20(%rsp), %rdi
leaq 0x50(%rsp), %rsi
callq 0xc54a
leaq 0x58(%rsp), %rdi
callq 0x51b0
leaq 0x6d0(%rsp), %rdi
callq 0x51b0
leaq 0x1b5f7(%rip), %rsi     # 0x290bb
leaq 0x6b0(%rsp), %rdi
leaq 0x148(%rsp), %rdx
callq 0x96e6
leaq 0x50(%rsp), %rdi
leaq 0x6b0(%rsp), %rsi
pushq $0x1
popq %rdx
callq 0xf280
leaq 0x20(%rsp), %rdi
leaq 0x50(%rsp), %rsi
callq 0xc54a
leaq 0x58(%rsp), %rdi
callq 0x51b0
leaq 0x6b0(%rsp), %rdi
callq 0x51b0
leaq 0x1b5a3(%rip), %rsi     # 0x290be
leaq 0x690(%rsp), %rdi
leaq 0x148(%rsp), %rdx
callq 0x96e6
leaq 0x50(%rsp), %rdi
leaq 0x690(%rsp), %rsi
pushq $0x1
popq %rdx
callq 0xf280
leaq 0x20(%rsp), %rdi
leaq 0x50(%rsp), %rsi
callq 0xc54a
leaq 0x58(%rsp), %rdi
callq 0x51b0
leaq 0x690(%rsp), %rdi
jmp 0xde2d
cmpl $0x9, %eax
je 0xde37
xorl %r15d, %r15d
cmpl $0x2, %eax
jne 0xdee6
leaq 0x1b4a2(%rip), %rsi     # 0x29029
leaq 0x570(%rsp), %rdi
leaq 0x148(%rsp), %rdx
callq 0x96e6
leaq 0x50(%rsp), %rdi
leaq 0x570(%rsp), %rsi
xorl %edx, %edx
callq 0xf280
leaq 0x20(%rsp), %rdi
leaq 0x50(%rsp), %rsi
callq 0xc54a
leaq 0x58(%rsp), %rdi
callq 0x51b0
leaq 0x570(%rsp), %rdi
callq 0x51b0
leaq 0x1b44f(%rip), %rsi     # 0x2902c
leaq 0x550(%rsp), %rdi
leaq 0x148(%rsp), %rdx
callq 0x96e6
leaq 0x50(%rsp), %rdi
leaq 0x550(%rsp), %rsi
xorl %edx, %edx
callq 0xf280
leaq 0x20(%rsp), %rdi
leaq 0x50(%rsp), %rsi
callq 0xc54a
leaq 0x58(%rsp), %rdi
callq 0x51b0
leaq 0x550(%rsp), %rdi
jmp 0xdede
leaq 0x1b47f(%rip), %rsi     # 0x290b2
leaq 0x670(%rsp), %rdi
leaq 0x148(%rsp), %rdx
callq 0x96e6
leaq 0x50(%rsp), %rdi
leaq 0x670(%rsp), %rsi
xorl %edx, %edx
callq 0xf280
leaq 0x20(%rsp), %rdi
leaq 0x50(%rsp), %rsi
callq 0xc54a
leaq 0x58(%rsp), %rdi
callq 0x51b0
leaq 0x670(%rsp), %rdi
callq 0x51b0
leaq 0x1b42c(%rip), %rsi     # 0x290b5
leaq 0x650(%rsp), %rdi
leaq 0x148(%rsp), %rdx
callq 0x96e6
leaq 0x50(%rsp), %rdi
leaq 0x650(%rsp), %rsi
xorl %edx, %edx
callq 0xf280
leaq 0x20(%rsp), %rdi
leaq 0x50(%rsp), %rsi
callq 0xc54a
leaq 0x58(%rsp), %rdi
callq 0x51b0
leaq 0x650(%rsp), %rdi
callq 0x51b0
leaq 0x1b3e2(%rip), %rsi     # 0x290c1
leaq 0x630(%rsp), %rdi
leaq 0x148(%rsp), %rdx
callq 0x96e6
leaq 0x50(%rsp), %rdi
leaq 0x630(%rsp), %rsi
xorl %edx, %edx
callq 0xf280
leaq 0x20(%rsp), %rdi
leaq 0x50(%rsp), %rsi
callq 0xc54a
leaq 0x58(%rsp), %rdi
callq 0x51b0
leaq 0x630(%rsp), %rdi
callq 0x51b0
leaq 0x1b38f(%rip), %rsi     # 0x290c4
leaq 0x610(%rsp), %rdi
leaq 0x148(%rsp), %rdx
callq 0x96e6
leaq 0x50(%rsp), %rdi
leaq 0x610(%rsp), %rsi
xorl %edx, %edx
callq 0xf280
leaq 0x20(%rsp), %rdi
leaq 0x50(%rsp), %rsi
callq 0xc54a
leaq 0x58(%rsp), %rdi
callq 0x51b0
leaq 0x610(%rsp), %rdi
jmp 0xde2d
leaq 0x1b2a4(%rip), %rsi     # 0x2902f
leaq 0x5b0(%rsp), %rdi
leaq 0x148(%rsp), %rdx
callq 0x96e6
leaq 0x50(%rsp), %rdi
leaq 0x5b0(%rsp), %rsi
pushq $0x1
popq %rdx
callq 0xf280
leaq 0x20(%rsp), %rdi
leaq 0x50(%rsp), %rsi
callq 0xc54a
leaq 0x58(%rsp), %rdi
callq 0x51b0
leaq 0x5b0(%rsp), %rdi
callq 0x51b0
leaq 0x1b250(%rip), %rsi     # 0x29032
leaq 0x590(%rsp), %rdi
leaq 0x148(%rsp), %rdx
callq 0x96e6
leaq 0x50(%rsp), %rdi
leaq 0x590(%rsp), %rsi
pushq $0x1
popq %rdx
callq 0xf280
leaq 0x20(%rsp), %rdi
leaq 0x50(%rsp), %rsi
callq 0xc54a
leaq 0x58(%rsp), %rdi
callq 0x51b0
leaq 0x590(%rsp), %rdi
callq 0x51b0
jmp 0xdee6
leaq 0x1b1f7(%rip), %rsi     # 0x29035
leaq 0x530(%rsp), %rdi
leaq 0x148(%rsp), %rdx
callq 0x96e6
leaq 0x50(%rsp), %rdi
leaq 0x530(%rsp), %rsi
xorl %edx, %edx
callq 0xf280
leaq 0x20(%rsp), %rdi
leaq 0x50(%rsp), %rsi
callq 0xc54a
leaq 0x58(%rsp), %rdi
callq 0x51b0
leaq 0x530(%rsp), %rdi
callq 0x51b0
leaq 0x1b1a5(%rip), %rsi     # 0x29039
leaq 0x510(%rsp), %rdi
leaq 0x148(%rsp), %rdx
callq 0x96e6
leaq 0x50(%rsp), %rdi
leaq 0x510(%rsp), %rsi
xorl %edx, %edx
callq 0xf280
leaq 0x20(%rsp), %rdi
leaq 0x50(%rsp), %rsi
callq 0xc54a
leaq 0x58(%rsp), %rdi
callq 0x51b0
leaq 0x510(%rsp), %rdi
callq 0x51b0
xorl %r15d, %r15d
movslq %r15d, %rax
imulq $0x30, %rax, %rdi
addq 0x20(%rsp), %rdi
movq 0x28(%rsp), %rsi
callq 0xc3c6
movq 0x20(%rsp), %rsi
movq 0x28(%rsp), %rax
movq %rax, 0x108(%rsp)
andl $0x1, 0x38(%rsp)
leaq 0x840(%rsp), %r15
leaq 0x1270(%rsp), %rbx
leaq 0x248(%rsp), %r12
leaq 0x810(%rsp), %r13
leaq 0x148(%rsp), %rbp
leaq 0x10b8(%rsp), %r14
cmpq 0x108(%rsp), %rsi
je 0xe10f
movq %r15, %rdi
movq %rsi, 0x48(%rsp)
callq 0x97b4
movq %rbx, %rdi
movq %r12, %rsi
callq 0x12676
movq %r13, %rdi
movq %r15, %rsi
callq 0x97b4
leaq 0x50(%rsp), %rdi
movq %rbx, %rsi
movq %r13, %rdx
callq 0xf750
leaq 0x818(%rsp), %rdi
callq 0x51b0
movq %rbx, %rdi
callq 0x979a
movl 0x50(%rsp), %eax
cltd
pushq $0x2
popq %rcx
idivl %ecx
movl %eax, 0x50(%rsp)
movq %rbp, %rdi
movq 0x18(%rsp), %rsi
callq 0x17d60
leaq 0x50(%rsp), %rdi
movq %rbp, %rsi
callq 0x12f5e
movb %al, 0xa5(%rsp)
movq %rbp, %rdi
callq 0x979a
leaq 0x1110(%rsp), %rdi
leaq 0x1a0(%rsp), %rsi
callq 0x12676
movq %r14, %rdi
movq %r12, %rsi
callq 0x12676
movq %r14, %r12
movq %rbp, %rdi
leaq 0x1110(%rsp), %r14
movq %r14, %rsi
movq %r12, %rdx
callq 0xf41a
movq %rbx, %r13
movq %r15, %rbx
movq %r12, %rdi
callq 0x979a
movq %r14, %rdi
callq 0x979a
movl 0x840(%rsp), %eax
xorl %r15d, %r15d
cmpl 0x118(%rsp), %eax
jne 0xe04d
pushq $-0x1
popq %r15
cmpl $0x3, %eax
je 0xe04d
cmpl $0x6, %eax
je 0xe04d
xorl %r15d, %r15d
cmpl $0xa, %eax
sete %r15b
negl %r15d
movq %rbp, %r14
movq %rbp, %rdi
callq 0xf856
addl 0x40(%rsp), %r15d
xorb 0x3f(%rsp), %al
xorb $0x1, %al
movzbl %al, %eax
movl 0x44(%rsp), %r12d
subl %eax, %r12d
movl %r12d, %eax
orl %r15d, %eax
pushq $0x3
popq %rbp
js 0xe0bb
movq 0x18(%rsp), %rdi
leaq 0x50(%rsp), %rsi
callq 0x986e
movl 0xa8(%rsp), %edi
movl 0x38(%rsp), %esi
movl %r15d, %edx
movl %r12d, %ecx
movl 0x14(%rsp), %r8d
movq 0x18(%rsp), %r9
callq 0xc746
pushq $0x1
popq %rbp
testb %al, %al
jne 0xe0bb
movq 0x18(%rsp), %rdi
callq 0xc42c
xorl %ebp, %ebp
leaq 0x150(%rsp), %rdi
callq 0x51b0
leaq 0x50(%rsp), %rdi
callq 0x979a
leaq 0x848(%rsp), %rdi
callq 0x51b0
cmpl $0x3, %ebp
je 0xe0e8
testl %ebp, %ebp
jne 0xe112
movq 0x48(%rsp), %rsi
addq $0x30, %rsi
movq %rbx, %r15
movq %r13, %rbx
leaq 0x248(%rsp), %r12
leaq 0x810(%rsp), %r13
movq %r14, %rbp
jmp 0xdf3b
pushq $0x2
popq %rbp
leaq 0x2a8(%rsp), %rdi
callq 0x51b0
leaq 0x120(%rsp), %rdi
callq 0x51b0
leaq 0x220(%rsp), %rdi
callq 0x51b0
leaq 0x1a0(%rsp), %rdi
callq 0x979a
leaq 0xb0(%rsp), %rdi
callq 0x979a
movb $0x1, %bl
testb $0x1, %bpl
jne 0xe1c7
leaq 0xb0(%rsp), %rdi
movq 0x18(%rsp), %rsi
callq 0x17d60
leaq 0xb0(%rsp), %rdi
imulq $0x1081c8, 0x1f8(%rsp), %rax # imm = 0x1081C8
addq 0x2bdf0(%rip), %rax     # 0x39f78
movslq 0x4c(%rdi), %rcx
imulq $0x42072, 0x200(%rsp), %rdx # imm = 0x42072
addq %rax, %rdx
imulq $0xbbd, %rcx, %rax      # imm = 0xBBD
imulq $0x259, 0x208(%rsp), %rcx # imm = 0x259
addq %rdx, %rcx
addq %rax, %rcx
movq 0x210(%rsp), %rax
movb $0x0, (%rax,%rcx)
callq 0x979a
xorl %ebx, %ebx
leaq 0x248(%rsp), %rdi
callq 0x979a
leaq 0x20(%rsp), %rdi
callq 0x98a8
movl %ebx, %eax
addq $0x12c8, %rsp           # imm = 0x12C8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x58(%rsp), %rdi
callq 0x51b0
jmp 0xe231
movq %rax, %rbx
leaq 0x58(%rsp), %rdi
callq 0x51b0
jmp 0xe241
movq %rax, %rbx
leaq 0x58(%rsp), %rdi
callq 0x51b0
jmp 0xe251
movq %rax, %rbx
leaq 0x58(%rsp), %rdi
callq 0x51b0
jmp 0xe261
movq %rax, %rbx
leaq 0x510(%rsp), %rdi
jmp 0xe9e3
movq %rax, %rbx
leaq 0x590(%rsp), %rdi
jmp 0xe9e3
movq %rax, %rbx
leaq 0x550(%rsp), %rdi
jmp 0xe9e3
movq %rax, %rbx
leaq 0x5d0(%rsp), %rdi
jmp 0xe9e3
jmp 0xe8e6
jmp 0xe8e6
jmp 0xe8e6
jmp 0xe8e6
movq %rax, %rbx
leaq 0x58(%rsp), %rdi
callq 0x51b0
jmp 0xe2c1
movq %rax, %rbx
leaq 0x58(%rsp), %rdi
callq 0x51b0
jmp 0xe2d1
movq %rax, %rbx
leaq 0x58(%rsp), %rdi
callq 0x51b0
jmp 0xe2e1
movq %rax, %rbx
leaq 0x58(%rsp), %rdi
callq 0x51b0
jmp 0xe2f1
movq %rax, %rbx
leaq 0x530(%rsp), %rdi
jmp 0xe9e3
movq %rax, %rbx
leaq 0x5b0(%rsp), %rdi
jmp 0xe9e3
movq %rax, %rbx
leaq 0x570(%rsp), %rdi
jmp 0xe9e3
movq %rax, %rbx
leaq 0x5f0(%rsp), %rdi
jmp 0xe9e3
jmp 0xe8e6
jmp 0xe8e6
jmp 0xe8e6
jmp 0xe8e6
movq %rax, %rbx
leaq 0x58(%rsp), %rdi
callq 0x51b0
jmp 0xe324
movq %rax, %rbx
leaq 0x610(%rsp), %rdi
jmp 0xe9e3
jmp 0xe8e6
movq %rax, %rbx
leaq 0x58(%rsp), %rdi
callq 0x51b0
jmp 0xe357
movq %rax, %rbx
leaq 0x58(%rsp), %rdi
callq 0x51b0
jmp 0xe367
movq %rax, %rbx
leaq 0x630(%rsp), %rdi
jmp 0xe9e3
movq %rax, %rbx
leaq 0x690(%rsp), %rdi
jmp 0xe9e3
jmp 0xe8e6
jmp 0xe8e6
movq %rax, %rbx
leaq 0x58(%rsp), %rdi
callq 0x51b0
jmp 0xe39f
movq %rax, %rbx
leaq 0x58(%rsp), %rdi
callq 0x51b0
jmp 0xe3af
movq %rax, %rbx
leaq 0x650(%rsp), %rdi
jmp 0xe9e3
movq %rax, %rbx
leaq 0x6b0(%rsp), %rdi
jmp 0xe9e3
jmp 0xe8e6
jmp 0xe8e6
movq %rax, %rbx
leaq 0x58(%rsp), %rdi
callq 0x51b0
jmp 0xe3e7
movq %rax, %rbx
leaq 0x58(%rsp), %rdi
callq 0x51b0
jmp 0xe3f7
movq %rax, %rbx
leaq 0x670(%rsp), %rdi
jmp 0xe9e3
movq %rax, %rbx
leaq 0x6d0(%rsp), %rdi
jmp 0xe9e3
jmp 0xe8e6
jmp 0xe8e6
movq %rax, %rbx
leaq 0x6f8(%rsp), %rdi
callq 0x51b0
jmp 0xe423
movq %rax, %rbx
leaq 0x430(%rsp), %rdi
callq 0x51b0
jmp 0xe435
movq %rax, %rbx
leaq 0x8d0(%rsp), %rdi
callq 0x979a
jmp 0xe447
movq %rax, %rbx
leaq 0x928(%rsp), %rdi
jmp 0xe647
movq %rax, %rbx
leaq 0x728(%rsp), %rdi
callq 0x51b0
jmp 0xe469
movq %rax, %rbx
leaq 0x450(%rsp), %rdi
callq 0x51b0
jmp 0xe47b
movq %rax, %rbx
leaq 0x980(%rsp), %rdi
callq 0x979a
jmp 0xe48d
movq %rax, %rbx
leaq 0x9d8(%rsp), %rdi
jmp 0xe647
movq %rax, %rbx
leaq 0x788(%rsp), %rdi
callq 0x51b0
jmp 0xe4af
movq %rax, %rbx
leaq 0x490(%rsp), %rdi
callq 0x51b0
jmp 0xe4c1
movq %rax, %rbx
leaq 0xae0(%rsp), %rdi
callq 0x979a
jmp 0xe4d3
movq %rax, %rbx
leaq 0xb38(%rsp), %rdi
jmp 0xe647
movq %rax, %rbx
leaq 0x7b8(%rsp), %rdi
callq 0x51b0
jmp 0xe4f5
movq %rax, %rbx
leaq 0x4b0(%rsp), %rdi
callq 0x51b0
jmp 0xe507
movq %rax, %rbx
leaq 0xb90(%rsp), %rdi
callq 0x979a
jmp 0xe519
movq %rax, %rbx
leaq 0xbe8(%rsp), %rdi
jmp 0xe647
movq %rax, %rbx
leaq 0xb0(%rsp), %rdi
callq 0x979a
jmp 0xe53b
movq %rax, %rbx
leaq 0x3d0(%rsp), %rdi
callq 0x51b0
jmp 0xe54d
movq %rax, %rbx
leaq 0x3f0(%rsp), %rdi
jmp 0xe95f
jmp 0xe8a8
jmp 0xe8e6
movq %rax, %rbx
leaq 0x58(%rsp), %rdi
callq 0x51b0
jmp 0xe576
movq %rax, %rbx
leaq 0x4f0(%rsp), %rdi
jmp 0xe9e3
jmp 0xe8e6
jmp 0xe9b7
jmp 0xe5e5
jmp 0xe9b7
jmp 0xe5e5
jmp 0xe9b7
movq %rax, %rbx
leaq 0x758(%rsp), %rdi
callq 0x51b0
jmp 0xe5b0
movq %rax, %rbx
leaq 0x470(%rsp), %rdi
callq 0x51b0
jmp 0xe5c2
movq %rax, %rbx
leaq 0xa30(%rsp), %rdi
callq 0x979a
jmp 0xe5d4
movq %rax, %rbx
leaq 0xa88(%rsp), %rdi
jmp 0xe647
jmp 0xe5e5
jmp 0xe9b7
movq %rax, %rbx
leaq 0x50(%rsp), %rdi
jmp 0xea2e
jmp 0xe9b7
movq %rax, %rbx
leaq 0x7e8(%rsp), %rdi
callq 0x51b0
jmp 0xe60c
movq %rax, %rbx
leaq 0x4d0(%rsp), %rdi
callq 0x51b0
jmp 0xe61e
movq %rax, %rbx
leaq 0xc40(%rsp), %rdi
callq 0x979a
jmp 0xe63f
movq %rax, %rbx
leaq 0x58(%rsp), %rdi
callq 0x51b0
jmp 0xe654
movq %rax, %rbx
leaq 0xc98(%rsp), %rdi
callq 0x979a
jmp 0xea33
movq %rax, %rbx
leaq 0x410(%rsp), %rdi
jmp 0xea2e
jmp 0xe9b7
movq %rax, %rbx
leaq 0xb8(%rsp), %rdi
callq 0x51b0
jmp 0xe67b
movq %rax, %rbx
leaq 0x2d0(%rsp), %rdi
jmp 0xe95f
jmp 0xe8a8
movq %rax, %rbx
leaq 0xb8(%rsp), %rdi
callq 0x51b0
jmp 0xe6a2
movq %rax, %rbx
leaq 0x2f0(%rsp), %rdi
jmp 0xe95f
jmp 0xe8a8
movq %rax, %rbx
leaq 0xb8(%rsp), %rdi
callq 0x51b0
jmp 0xe6c9
movq %rax, %rbx
leaq 0x310(%rsp), %rdi
jmp 0xe95f
jmp 0xe8a8
movq %rax, %rbx
leaq 0xb8(%rsp), %rdi
callq 0x51b0
jmp 0xe6f0
movq %rax, %rbx
leaq 0x330(%rsp), %rdi
jmp 0xe95f
jmp 0xe8a8
movq %rax, %rbx
leaq 0xb8(%rsp), %rdi
callq 0x51b0
jmp 0xe717
movq %rax, %rbx
leaq 0x350(%rsp), %rdi
jmp 0xe95f
jmp 0xe8a8
movq %rax, %rbx
leaq 0xb8(%rsp), %rdi
callq 0x51b0
jmp 0xe73e
movq %rax, %rbx
leaq 0x370(%rsp), %rdi
jmp 0xe95f
jmp 0xe8a8
movq %rax, %rbx
leaq 0xb8(%rsp), %rdi
callq 0x51b0
jmp 0xe765
movq %rax, %rbx
leaq 0x390(%rsp), %rdi
jmp 0xe95f
jmp 0xe8a8
movq %rax, %rbx
leaq 0xb8(%rsp), %rdi
callq 0x51b0
jmp 0xe78c
movq %rax, %rbx
leaq 0x3b0(%rsp), %rdi
jmp 0xe95f
jmp 0xe8a8
movq %rax, %rbx
leaq 0xe50(%rsp), %rdi
callq 0x979a
jmp 0xe7b3
movq %rax, %rbx
leaq 0xea8(%rsp), %rdi
callq 0x979a
jmp 0xe9f5
movq %rax, %rbx
jmp 0xe9f5
movq %rax, %rbx
leaq 0xf00(%rsp), %rdi
callq 0x979a
jmp 0xe7e2
movq %rax, %rbx
leaq 0xf58(%rsp), %rdi
callq 0x979a
jmp 0xea02
jmp 0xe7f6
movq %rax, %rbx
jmp 0xea02
movq %rax, %rbx
leaq 0xfb0(%rsp), %rdi
callq 0x979a
jmp 0xe813
movq %rax, %rbx
leaq 0x1008(%rsp), %rdi
jmp 0xe879
jmp 0xe883
jmp 0xe88b
jmp 0xe8a8
jmp 0xe9b7
movq %rax, %rbx
leaq 0xcf0(%rsp), %rdi
callq 0x979a
jmp 0xe840
movq %rax, %rbx
leaq 0xd48(%rsp), %rdi
callq 0x979a
jmp 0xea40
jmp 0xe854
movq %rax, %rbx
jmp 0xea40
movq %rax, %rbx
leaq 0xda0(%rsp), %rdi
callq 0x979a
jmp 0xe871
movq %rax, %rbx
leaq 0xdf8(%rsp), %rdi
callq 0x979a
jmp 0xea4d
movq %rax, %rbx
jmp 0xea4d
movq %rax, %rbx
jmp 0xea5a
jmp 0xe8a8
jmp 0xe8e6
jmp 0xe8a8
jmp 0xe9b7
movq %rax, %rbx
jmp 0xea74
jmp 0xe8a8
movq %rax, %rbx
jmp 0xea67
movq %rax, %rbx
jmp 0xe8cd
movq %rax, %rbx
jmp 0xe957
movq %rax, %rbx
leaq 0x878(%rsp), %rdi
callq 0x51b0
leaq 0x1168(%rsp), %rdi
jmp 0xe952
movq %rax, %rbx
leaq 0x148(%rsp), %rdi
jmp 0xe913
jmp 0xe93f
movq %rax, %rbx
jmp 0xe9e8
movq %rax, %rbx
jmp 0xe90b
movq %rax, %rbx
jmp 0xe9db
movq %rax, %rbx
leaq 0x10b8(%rsp), %rdi
callq 0x979a
leaq 0x1110(%rsp), %rdi
callq 0x979a
jmp 0xe9d1
movq %rax, %rbx
jmp 0xe932
movq %rax, %rbx
leaq 0x818(%rsp), %rdi
callq 0x51b0
leaq 0x1270(%rsp), %rdi
jmp 0xe9d6
movq %rax, %rbx
jmp 0xe9d1
movq %rax, %rbx
leaq 0xb0(%rsp), %rdi
callq 0x979a
leaq 0x1a8(%rsp), %rdi
callq 0x51b0
jmp 0xea67
movq %rax, %rbx
jmp 0xe97e
movq %rax, %rbx
leaq 0x8a8(%rsp), %rdi
callq 0x51b0
leaq 0x1060(%rsp), %rdi
jmp 0xea21
movq %rax, %rbx
jmp 0xea1c
movq %rax, %rbx
jmp 0xe9a8
movq %rax, %rbx
leaq 0x11c0(%rsp), %rdi
callq 0x979a
leaq 0x1218(%rsp), %rdi
callq 0x979a
jmp 0xea1c
movq %rax, %rbx
jmp 0xea33
movq %rax, %rbx
jmp 0xea26
movq %rax, %rbx
leaq 0x150(%rsp), %rdi
callq 0x51b0
leaq 0x50(%rsp), %rdi
callq 0x979a
leaq 0x848(%rsp), %rdi
callq 0x51b0
leaq 0x2a8(%rsp), %rdi
callq 0x51b0
leaq 0x120(%rsp), %rdi
callq 0x51b0
leaq 0x220(%rsp), %rdi
jmp 0xea48
movq %rax, %rbx
leaq 0x2a8(%rsp), %rdi
callq 0x51b0
leaq 0x50(%rsp), %rdi
callq 0x979a
leaq 0x120(%rsp), %rdi
callq 0x51b0
leaq 0x220(%rsp), %rdi
callq 0x51b0
leaq 0x150(%rsp), %rdi
callq 0x51b0
leaq 0x1a0(%rsp), %rdi
callq 0x979a
leaq 0xb0(%rsp), %rdi
callq 0x979a
leaq 0x248(%rsp), %rdi
callq 0x979a
leaq 0x20(%rsp), %rdi
callq 0x98a8
movq %rbx, %rdi
callq 0x55d0