// File: ke6jjj[P]r-dat/AudioFrameReceiver.cc
// Function: AudioFrameReceiver::ReceiveFrame(Track const&, Track const&)
void
AudioFrameReceiver::ReceiveFrame(const Track& a, const Track& b)
{
  const uint8_t *item;
  uint32_t absoluteFrame = 0;

  printf("\n");

  //
  // Examine the Absolute Time subcode.
  //
  if (a.GetSubcode(2, &item)) {
    TimeCode time(item);
    absoluteFrame = time.AbsoluteFrame();
    printf("Absolute time: %02dh-%02dm-%02ds-%02df (%d)\n",
      time.Hour(),
      time.Minute(),
      time.Second(),
      time.Frame(),
      absoluteFrame
    );
    uint16_t program = time.Program();
    switch (program) {
    case TimeCode::PROGRAM_NOT_VALID:
      break;
    case TimeCode::PROGRAM_LEAD_IN:
    case TimeCode::PROGRAM_LEAD_OUT:
      printf("Program ID   : (%s)\n",
             program == TimeCode::PROGRAM_LEAD_IN ? "LEAD IN" : "LEAD_OUT");
      break;
    default:
      printf("Program ID   : %03d\n", program);
      break;
    }
    uint8_t index = time.Index();
    switch (index) {
    case TimeCode::INDEX_NOT_VALID:
      break;
    default:
      printf("Index ID     : %03d\n", index);
      break;
    }
  }
  
  //
  // If the absolute frame number is corrupted or the universal "I don't know"
  // value of 100h-100m-100s-100f (12203433), then display a session-psuedo
  // frame.
  //
  if (absoluteFrame == 0 || absoluteFrame == 12203433) {
    TimeCode time(static_cast<uint32_t>(mNextSessionFrameNumber));
    printf("Psuedo   time: %02dh-%02dm-%02ds-%02df (%d)\n",
      time.Hour(),
      time.Minute(),
      time.Second(),
      time.Frame(),
      mNextSessionFrameNumber
    );
    absoluteFrame = mNextSessionFrameNumber;
  }

  uint8_t control_id;
  if (a.GetControlID(control_id) && control_id != 0) {
    printf("Control      :");
    if (control_id & 0x1)
      // TOC ID
      printf(" TOC");
    if (control_id & 0x2)
      // Shortening ID
      printf(" SKIP");
    if (control_id & 0x4)
      // Start ID
      printf(" START");
    if (control_id & 0x8)
      printf(" PRIORITY");
    printf("\n");
  }
  
  //
  // Examine Program Time subcode.
  //
  if (a.GetSubcode(1, &item)) {
    TimeCode time(item);
    printf("Program time : %02dh-%02dm-%02ds-%02df\n",
      time.Hour(),
      time.Minute(),
      time.Second(),
      time.Frame()
    );
  }
    
  //
  // Examine Running Time / Pro R time.
  //
  if (a.GetSubcode(3, &item)) {
    TimeCode time(item);
    if (item[0] & 0x4) {
      //
      // Running Time.
      //
      printf("Running time : %02dh-%02dm-%02ds-%02df\n",
        time.Hour(),
        time.Minute(),
        time.Second(),
        time.Frame()
      );
    } else {
      //
      // Pro R Time
      //
      uint8_t sid = (item[0] & 3);
      uint8_t freq = (item[1] & 0xC0) >> 6;
      uint8_t xrate = (item[1] & 0x38) >> 3;
      uint8_t msb = (item[1] & 0x07);
      uint8_t lsb = item[2];
      const char *code_type;
      switch (sid) {
      case 0:
        code_type = "IEC/SMPTE";
        break;
      case 1:
        code_type = "Pro DIO; sample address";
        break;
      case 2:
        code_type = "Pro DIO; Time-of-day";
        break;
      case 3:
        code_type = "Reserved-3";
        break;
      default:
        code_type = "?";
        break;
      }
      const char *freq_str;
      switch (freq) {
      case 0:
        freq_str = "48 kHz";
        break;
      case 1:
        freq_str = "44.1 kHz";
        break;
      case 2:
        freq_str = "32 kHz";
        break;
      case 3:
        freq_str = "Reserved-3";
        break;
      default:
        freq_str = "?";
        break;
      }
      const char *smpte_xrate;
      switch (xrate) {
      case 0:
        smpte_xrate = "30 Hz";
        break;
      case 1:
        smpte_xrate = "29.97 Hz NDF";
        break;
      case 2:
        smpte_xrate = "29.97 Hz DF";
        break;
      case 3:
        smpte_xrate = "25 Hz";
        break;
      case 4:
        smpte_xrate = "24 Hz";
        break;
      case 5:
        smpte_xrate = "Reserved-5";
        break;
      case 6:
        smpte_xrate = "Reserved-6";
        break;
      case 7:
        smpte_xrate = "Reserved-7";
        break;
      default:
        smpte_xrate = "?";
        break;
      }
      printf("Pro R Time   : %02dh-%02dm-%02ds-%02df (%s-%s-%s)\n",
        time.Hour(),
        time.Minute(),
        time.Second(),
        time.Frame(),
        code_type,
        freq_str,
        smpte_xrate
      );
    }
  }

  //
  // Examine Table of Contents subcode.
  //
  if (a.GetSubcode(4, &item)) {
    printf("Table of Cont:\n");
    TimeCode time(item);
    uint16_t program = time.Program();
    switch (program) {
    case TimeCode::PROGRAM_NOT_VALID:
      break;
    case TimeCode::PROGRAM_LEAD_IN:
    case TimeCode::PROGRAM_LEAD_OUT:
      printf("  Program ID : (%s)\n",
             program == TimeCode::PROGRAM_LEAD_IN ? "LEAD IN" : "LEAD_OUT");
      break;
    default:
      printf("  Program ID : %03d\n", program);
      break;
    }
    uint8_t index = time.Index();
    switch (index) {
    case TimeCode::INDEX_NOT_VALID:
      break;
    default:
      printf("  Index ID   : %03d\n", index);
      break;
    }
    printf("  Time       : %02dh-%02dm-%02ds-%02df\n",
      time.Hour(),
      time.Minute(),
      time.Second(),
      time.Frame()
    );
  }

  //
  // Examine the Date & Time subcode.
  //
  if (a.GetSubcode(5, &item))
    HandleDateTime(item, absoluteFrame);
  else
    HandleDateTime(NULL, absoluteFrame);

  //
  // Examine Catalog Number subcode.
  //
  if (a.GetSubcode(6, &item)) {
  }

  //
  // Examine ISRC subcode.
  //
  if (a.GetSubcode(7, &item)) {
    printf("ISRC         : (not yet)\n");
  }

  //
  // Examine Pro Binary subcode.
  //
  if (a.GetSubcode(8, &item)) {
    printf("Pro Binary   : (not yet)\n");
  }

  //
  // Print the sub-code signature.
  //
  const Track::SubcodeSignatureArray& signature = a.SubcodeSignature();
  printf("Subcode packs:");
  for (size_t i = 0; i < 7; i++)
    printf(" %-2d", signature[i]);
  putchar('\n');

  //
  // Fetch and demultiplex all the data from the track pair.
  //
  mFrame.FillFromTrackPair(a, b);
  const DATFrame::DataArray& data = mFrame.Data();

  //
  // Print out error statistics for the frame.
  //
  unsigned int c1_errors = mFrame.C1Errors();
  unsigned int c1_uncorrectable = mFrame.C1UncorrectableErrors();
  unsigned int c1_corrected = c1_errors - c1_uncorrectable;
  unsigned int c2_uncorrectable = mFrame.C2UncorrectableErrors();
  unsigned int c2_corrected = c1_uncorrectable - c2_uncorrectable;

  printf("Errors  C1/C2: %d/%d",
    c1_corrected,
    c2_corrected
  );

  if (c2_uncorrectable > 0)
    printf(" %d UNCORRECTED\n", c2_uncorrectable);
  else
    printf(" (all corrected)\n");
  

  printf("Samples      : L    R\n");
  for (size_t i = 0; i < 8; i++) {
    printf("               %02x%02x %02x%02x\n",
      data[i][1], data[i][0],
      data[i][3], data[i][2]
    );
  }

  //
  // Ensure that everything printed so far is immediately visible.
  //
  fflush(stdout);

  //
  // Dump samples to file, if asked.
  //
  if (mFile != NULL) {
    for (size_t i = 0; i < DATFrame::kUserDataRows; i++) {
      fwrite(data[i], DATFrame::kBytesPerRow, 1, mFile);
    }
    mFramesWritten += DATFrame::kUserDataRows;
  }

  mHaveLastAbsoluteFrameNumber = true;
  mLastAbsoluteFrameNumber = absoluteFrame;
  mNextSessionFrameNumber++;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1e0, %rsp            # imm = 0x1E0
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0xd0(%rbp)
movl $0x0, -0x24(%rbp)
leaq 0x9fe9(%rip), %rdi      # 0xf4e9
movb $0x0, %al
callq 0x2040
movq -0x10(%rbp), %rdi
movl $0x2, %esi
leaq -0x20(%rbp), %rdx
callq 0x4640
testb $0x1, %al
jne 0x5522
jmp 0x56e4
movq -0x20(%rbp), %rsi
leaq -0x2c(%rbp), %rdi
movq %rdi, -0xe0(%rbp)
callq 0xcac0
movq -0xe0(%rbp), %rdi
callq 0xcdb0
movl %eax, -0xd4(%rbp)
jmp 0x554a
movl -0xd4(%rbp), %eax
movl %eax, -0x24(%rbp)
leaq -0x2c(%rbp), %rdi
callq 0xcd30
movb %al, -0xe1(%rbp)
jmp 0x5564
movb -0xe1(%rbp), %al
movzbl %al, %eax
movl %eax, -0xe8(%rbp)
leaq -0x2c(%rbp), %rdi
callq 0xcd50
movb %al, -0xe2(%rbp)
jmp 0x5584
movb -0xe2(%rbp), %al
movzbl %al, %eax
movl %eax, -0xf0(%rbp)
leaq -0x2c(%rbp), %rdi
callq 0xcd70
movb %al, -0xe9(%rbp)
jmp 0x55a4
movb -0xe9(%rbp), %al
movzbl %al, %eax
movl %eax, -0xf8(%rbp)
leaq -0x2c(%rbp), %rdi
callq 0xcd90
movb %al, -0xf1(%rbp)
jmp 0x55c4
movl -0xf8(%rbp), %ecx
movl -0xf0(%rbp), %edx
movl -0xe8(%rbp), %esi
movb -0xf1(%rbp), %al
movzbl %al, %r8d
movl -0x24(%rbp), %r9d
leaq 0x9712(%rip), %rdi      # 0xecfd
xorl %eax, %eax
callq 0x2040
jmp 0x55f4
leaq -0x2c(%rbp), %rdi
callq 0xccf0
movw %ax, -0xfa(%rbp)
jmp 0x5606
movw -0xfa(%rbp), %ax
movw %ax, -0x3e(%rbp)
movzwl -0x3e(%rbp), %eax
movl %eax, -0x100(%rbp)
subl $0x80aa, %eax           # imm = 0x80AA
je 0x565c
jmp 0x5624
movl -0x100(%rbp), %eax
subl $0x80bb, %eax           # imm = 0x80BB
je 0x565e
jmp 0x5633
movl -0x100(%rbp), %eax
subl $0x80ee, %eax           # imm = 0x80EE
je 0x565e
jmp 0x568a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x2c(%rbp), %rdi
callq 0x6a90
jmp 0x6214
jmp 0x56a0
movw -0x3e(%rbp), %ax
subw $0x80bb, %ax            # imm = 0x80BB
leaq 0x96d2(%rip), %rax      # 0xed3f
leaq 0x96d3(%rip), %rsi      # 0xed47
cmoveq %rax, %rsi
leaq 0x96ab(%rip), %rdi      # 0xed2a
xorl %eax, %eax
callq 0x2040
jmp 0x5688
jmp 0x56a0
movzwl -0x3e(%rbp), %esi
leaq 0x96bb(%rip), %rdi      # 0xed50
xorl %eax, %eax
callq 0x2040
jmp 0x569e
jmp 0x56a0
leaq -0x2c(%rbp), %rdi
callq 0xcd10
movb %al, -0x101(%rbp)
jmp 0x56b1
movb -0x101(%rbp), %al
movb %al, -0x3f(%rbp)
movb -0x3f(%rbp), %al
subb $-0x56, %al
jne 0x56c5
jmp 0x56c3
jmp 0x56db
movzbl -0x3f(%rbp), %esi
leaq 0x9695(%rip), %rdi      # 0xed65
xorl %eax, %eax
callq 0x2040
jmp 0x56d9
jmp 0x56db
leaq -0x2c(%rbp), %rdi
callq 0x6a90
cmpl $0x0, -0x24(%rbp)
je 0x56f7
cmpl $0xba35a9, -0x24(%rbp)  # imm = 0xBA35A9
jne 0x57f8
movq -0xd0(%rbp), %rax
movl 0x2db8(%rax), %esi
leaq -0x48(%rbp), %rdi
movq %rdi, -0x110(%rbp)
callq 0xcc00
movq -0x110(%rbp), %rdi
callq 0xcd30
movb %al, -0x102(%rbp)
jmp 0x5728
movb -0x102(%rbp), %al
movzbl %al, %eax
movl %eax, -0x118(%rbp)
leaq -0x48(%rbp), %rdi
callq 0xcd50
movb %al, -0x111(%rbp)
jmp 0x5748
movb -0x111(%rbp), %al
movzbl %al, %eax
movl %eax, -0x120(%rbp)
leaq -0x48(%rbp), %rdi
callq 0xcd70
movb %al, -0x119(%rbp)
jmp 0x5768
movb -0x119(%rbp), %al
movzbl %al, %eax
movl %eax, -0x128(%rbp)
leaq -0x48(%rbp), %rdi
callq 0xcd90
movb %al, -0x121(%rbp)
jmp 0x5788
movl -0x128(%rbp), %ecx
movl -0x120(%rbp), %edx
movl -0x118(%rbp), %esi
movq -0xd0(%rbp), %rax
movb -0x121(%rbp), %dil
movzbl %dil, %r8d
movl 0x2db8(%rax), %r9d
leaq 0x95c0(%rip), %rdi      # 0xed7a
xorl %eax, %eax
callq 0x2040
jmp 0x57c3
movq -0xd0(%rbp), %rax
movl 0x2db8(%rax), %eax
movl %eax, -0x24(%rbp)
leaq -0x48(%rbp), %rdi
callq 0x6a90
jmp 0x57f8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x48(%rbp), %rdi
callq 0x6a90
jmp 0x6214
movq -0x10(%rbp), %rdi
leaq -0x49(%rbp), %rsi
callq 0x4ee0
testb $0x1, %al
jne 0x580e
jmp 0x589f
movzbl -0x49(%rbp), %eax
cmpl $0x0, %eax
je 0x589f
leaq 0x9585(%rip), %rdi      # 0xeda7
movb $0x0, %al
callq 0x2040
movzbl -0x49(%rbp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x5843
leaq 0x957a(%rip), %rdi      # 0xedb6
movb $0x0, %al
callq 0x2040
movzbl -0x49(%rbp), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x585d
leaq 0x9565(%rip), %rdi      # 0xedbb
movb $0x0, %al
callq 0x2040
movzbl -0x49(%rbp), %eax
andl $0x4, %eax
cmpl $0x0, %eax
je 0x5877
leaq 0x9551(%rip), %rdi      # 0xedc1
movb $0x0, %al
callq 0x2040
movzbl -0x49(%rbp), %eax
andl $0x8, %eax
cmpl $0x0, %eax
je 0x5891
leaq 0x953e(%rip), %rdi      # 0xedc8
movb $0x0, %al
callq 0x2040
leaq 0x9c51(%rip), %rdi      # 0xf4e9
movb $0x0, %al
callq 0x2040
movq -0x10(%rbp), %rdi
movl $0x1, %esi
leaq -0x20(%rbp), %rdx
callq 0x4640
testb $0x1, %al
jne 0x58ba
jmp 0x5993
movq -0x20(%rbp), %rsi
leaq -0x52(%rbp), %rdi
movq %rdi, -0x138(%rbp)
callq 0xcac0
movq -0x138(%rbp), %rdi
callq 0xcd30
movb %al, -0x129(%rbp)
jmp 0x58e2
movb -0x129(%rbp), %al
movzbl %al, %eax
movl %eax, -0x140(%rbp)
leaq -0x52(%rbp), %rdi
callq 0xcd50
movb %al, -0x139(%rbp)
jmp 0x5902
movb -0x139(%rbp), %al
movzbl %al, %eax
movl %eax, -0x148(%rbp)
leaq -0x52(%rbp), %rdi
callq 0xcd70
movb %al, -0x141(%rbp)
jmp 0x5922
movb -0x141(%rbp), %al
movzbl %al, %eax
movl %eax, -0x150(%rbp)
leaq -0x52(%rbp), %rdi
callq 0xcd90
movb %al, -0x149(%rbp)
jmp 0x5942
movl -0x150(%rbp), %ecx
movl -0x148(%rbp), %edx
movl -0x140(%rbp), %esi
movb -0x149(%rbp), %al
movzbl %al, %r8d
leaq 0x946d(%rip), %rdi      # 0xedd2
xorl %eax, %eax
callq 0x2040
jmp 0x596e
leaq -0x52(%rbp), %rdi
callq 0x6a90
jmp 0x5993
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x52(%rbp), %rdi
callq 0x6a90
jmp 0x6214
movq -0x10(%rbp), %rdi
movl $0x3, %esi
leaq -0x20(%rbp), %rdx
callq 0x4640
testb $0x1, %al
jne 0x59ae
jmp 0x5cf1
movq -0x20(%rbp), %rsi
leaq -0x5a(%rbp), %rdi
callq 0xcac0
movq -0x20(%rbp), %rax
movzbl (%rax), %eax
andl $0x4, %eax
cmpl $0x0, %eax
je 0x5a8a
leaq -0x5a(%rbp), %rdi
callq 0xcd30
movb %al, -0x151(%rbp)
jmp 0x59df
movb -0x151(%rbp), %al
movzbl %al, %eax
movl %eax, -0x158(%rbp)
leaq -0x5a(%rbp), %rdi
callq 0xcd50
movb %al, -0x152(%rbp)
jmp 0x59ff
movb -0x152(%rbp), %al
movzbl %al, %eax
movl %eax, -0x160(%rbp)
leaq -0x5a(%rbp), %rdi
callq 0xcd70
movb %al, -0x159(%rbp)
jmp 0x5a1f
movb -0x159(%rbp), %al
movzbl %al, %eax
movl %eax, -0x168(%rbp)
leaq -0x5a(%rbp), %rdi
callq 0xcd90
movb %al, -0x161(%rbp)
jmp 0x5a3f
movl -0x168(%rbp), %ecx
movl -0x160(%rbp), %edx
movl -0x158(%rbp), %esi
movb -0x161(%rbp), %al
movzbl %al, %r8d
leaq 0x9398(%rip), %rdi      # 0xedfa
xorl %eax, %eax
callq 0x2040
jmp 0x5a6b
jmp 0x5ce8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x5a(%rbp), %rdi
callq 0x6a90
jmp 0x6214
movq -0x20(%rbp), %rax
movb (%rax), %al
andb $0x3, %al
movb %al, -0x5b(%rbp)
movq -0x20(%rbp), %rax
movzbl 0x1(%rax), %eax
shrl $0x6, %eax
movb %al, -0x5c(%rbp)
movq -0x20(%rbp), %rax
movzbl 0x1(%rax), %eax
andl $0x38, %eax
shrl $0x3, %eax
movb %al, -0x5d(%rbp)
movq -0x20(%rbp), %rax
movb 0x1(%rax), %al
andb $0x7, %al
movb %al, -0x5e(%rbp)
movq -0x20(%rbp), %rax
movb 0x2(%rax), %al
movb %al, -0x5f(%rbp)
movzbl -0x5b(%rbp), %eax
movq %rax, -0x170(%rbp)
subq $0x3, %rax
ja 0x5b26
movq -0x170(%rbp), %rax
leaq 0x9127(%rip), %rcx      # 0xec10
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x9329(%rip), %rax      # 0xee22
movq %rax, -0x68(%rbp)
jmp 0x5b31
leaq 0x9326(%rip), %rax      # 0xee2c
movq %rax, -0x68(%rbp)
jmp 0x5b31
leaq 0x9331(%rip), %rax      # 0xee44
movq %rax, -0x68(%rbp)
jmp 0x5b31
leaq 0x9339(%rip), %rax      # 0xee59
movq %rax, -0x68(%rbp)
jmp 0x5b31
leaq 0x9337(%rip), %rax      # 0xee64
movq %rax, -0x68(%rbp)
movzbl -0x5c(%rbp), %eax
movq %rax, -0x178(%rbp)
subq $0x3, %rax
ja 0x5b8d
movq -0x178(%rbp), %rax
leaq 0x90d0(%rip), %rcx      # 0xec20
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x9306(%rip), %rax      # 0xee66
movq %rax, -0x70(%rbp)
jmp 0x5b98
leaq 0x9300(%rip), %rax      # 0xee6d
movq %rax, -0x70(%rbp)
jmp 0x5b98
leaq 0x92fc(%rip), %rax      # 0xee76
movq %rax, -0x70(%rbp)
jmp 0x5b98
leaq 0x92d2(%rip), %rax      # 0xee59
movq %rax, -0x70(%rbp)
jmp 0x5b98
leaq 0x92d0(%rip), %rax      # 0xee64
movq %rax, -0x70(%rbp)
movzbl -0x5d(%rbp), %eax
movq %rax, -0x180(%rbp)
subq $0x7, %rax
ja 0x5c28
movq -0x180(%rbp), %rax
leaq 0x9079(%rip), %rcx      # 0xec30
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x92b6(%rip), %rax      # 0xee7d
movq %rax, -0x78(%rbp)
jmp 0x5c33
leaq 0x92af(%rip), %rax      # 0xee83
movq %rax, -0x78(%rbp)
jmp 0x5c33
leaq 0x92af(%rip), %rax      # 0xee90
movq %rax, -0x78(%rbp)
jmp 0x5c33
leaq 0x92ae(%rip), %rax      # 0xee9c
movq %rax, -0x78(%rbp)
jmp 0x5c33
leaq 0x92a7(%rip), %rax      # 0xeea2
movq %rax, -0x78(%rbp)
jmp 0x5c33
leaq 0x92a0(%rip), %rax      # 0xeea8
movq %rax, -0x78(%rbp)
jmp 0x5c33
leaq 0x929e(%rip), %rax      # 0xeeb3
movq %rax, -0x78(%rbp)
jmp 0x5c33
leaq 0x929c(%rip), %rax      # 0xeebe
movq %rax, -0x78(%rbp)
jmp 0x5c33
leaq 0x9235(%rip), %rax      # 0xee64
movq %rax, -0x78(%rbp)
leaq -0x5a(%rbp), %rdi
callq 0xcd30
movb %al, -0x181(%rbp)
jmp 0x5c44
movb -0x181(%rbp), %al
movzbl %al, %eax
movl %eax, -0x188(%rbp)
leaq -0x5a(%rbp), %rdi
callq 0xcd50
movb %al, -0x182(%rbp)
jmp 0x5c64
movb -0x182(%rbp), %al
movzbl %al, %eax
movl %eax, -0x190(%rbp)
leaq -0x5a(%rbp), %rdi
callq 0xcd70
movb %al, -0x189(%rbp)
jmp 0x5c84
movb -0x189(%rbp), %al
movzbl %al, %eax
movl %eax, -0x198(%rbp)
leaq -0x5a(%rbp), %rdi
callq 0xcd90
movb %al, -0x191(%rbp)
jmp 0x5ca4
movl -0x198(%rbp), %ecx
movl -0x190(%rbp), %edx
movl -0x188(%rbp), %esi
movb -0x191(%rbp), %al
movzbl %al, %r8d
movq -0x68(%rbp), %r9
movq -0x70(%rbp), %rdi
movq -0x78(%rbp), %r10
movq %rsp, %rax
movq %r10, 0x8(%rax)
movq %rdi, (%rax)
leaq 0x91ec(%rip), %rdi      # 0xeec9
xorl %eax, %eax
callq 0x2040
jmp 0x5ce6
jmp 0x5ce8
leaq -0x5a(%rbp), %rdi
callq 0x6a90
movq -0x10(%rbp), %rdi
movl $0x4, %esi
leaq -0x20(%rbp), %rdx
callq 0x4640
testb $0x1, %al
jne 0x5d0c
jmp 0x5ed3
leaq 0x91e9(%rip), %rdi      # 0xeefc
xorl %eax, %eax
callq 0x2040
movq -0x20(%rbp), %rsi
leaq -0x80(%rbp), %rdi
movq %rdi, -0x1a8(%rbp)
callq 0xcac0
movq -0x1a8(%rbp), %rdi
callq 0xccf0
movw %ax, -0x19a(%rbp)
jmp 0x5d43
movw -0x19a(%rbp), %ax
movw %ax, -0x82(%rbp)
movzwl -0x82(%rbp), %eax
movl %eax, -0x1ac(%rbp)
subl $0x80aa, %eax           # imm = 0x80AA
je 0x5d9f
jmp 0x5d67
movl -0x1ac(%rbp), %eax
subl $0x80bb, %eax           # imm = 0x80BB
je 0x5da1
jmp 0x5d76
movl -0x1ac(%rbp), %eax
subl $0x80ee, %eax           # imm = 0x80EE
je 0x5da1
jmp 0x5dd0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x80(%rbp), %rdi
callq 0x6a90
jmp 0x6214
jmp 0x5de9
movw -0x82(%rbp), %ax
subw $0x80bb, %ax            # imm = 0x80BB
leaq 0x8f8c(%rip), %rax      # 0xed3f
leaq 0x8f8d(%rip), %rsi      # 0xed47
cmoveq %rax, %rsi
leaq 0x9147(%rip), %rdi      # 0xef0c
xorl %eax, %eax
callq 0x2040
jmp 0x5dce
jmp 0x5de9
movzwl -0x82(%rbp), %esi
leaq 0x9143(%rip), %rdi      # 0xef21
xorl %eax, %eax
callq 0x2040
jmp 0x5de7
jmp 0x5de9
leaq -0x80(%rbp), %rdi
callq 0xcd10
movb %al, -0x1ad(%rbp)
jmp 0x5dfa
movb -0x1ad(%rbp), %al
movb %al, -0x83(%rbp)
movb -0x83(%rbp), %al
subb $-0x56, %al
jne 0x5e14
jmp 0x5e12
jmp 0x5e2d
movzbl -0x83(%rbp), %esi
leaq 0x9114(%rip), %rdi      # 0xef36
xorl %eax, %eax
callq 0x2040
jmp 0x5e2b
jmp 0x5e2d
leaq -0x80(%rbp), %rdi
callq 0xcd30
movb %al, -0x1ae(%rbp)
jmp 0x5e3e
movb -0x1ae(%rbp), %al
movzbl %al, %eax
movl %eax, -0x1b4(%rbp)
leaq -0x80(%rbp), %rdi
callq 0xcd50
movb %al, -0x1af(%rbp)
jmp 0x5e5e
movb -0x1af(%rbp), %al
movzbl %al, %eax
movl %eax, -0x1bc(%rbp)
leaq -0x80(%rbp), %rdi
callq 0xcd70
movb %al, -0x1b5(%rbp)
jmp 0x5e7e
movb -0x1b5(%rbp), %al
movzbl %al, %eax
movl %eax, -0x1c4(%rbp)
leaq -0x80(%rbp), %rdi
callq 0xcd90
movb %al, -0x1bd(%rbp)
jmp 0x5e9e
movl -0x1c4(%rbp), %ecx
movl -0x1bc(%rbp), %edx
movl -0x1b4(%rbp), %esi
movb -0x1bd(%rbp), %al
movzbl %al, %r8d
leaq 0x908a(%rip), %rdi      # 0xef4b
xorl %eax, %eax
callq 0x2040
jmp 0x5eca
leaq -0x80(%rbp), %rdi
callq 0x6a90
movq -0x10(%rbp), %rdi
movl $0x5, %esi
leaq -0x20(%rbp), %rdx
callq 0x4640
testb $0x1, %al
jne 0x5eeb
jmp 0x5f00
movq -0xd0(%rbp), %rdi
movq -0x20(%rbp), %rsi
movl -0x24(%rbp), %edx
callq 0x6220
jmp 0x5f13
movq -0xd0(%rbp), %rdi
movl -0x24(%rbp), %edx
xorl %eax, %eax
movl %eax, %esi
callq 0x6220
movq -0x10(%rbp), %rdi
movl $0x6, %esi
leaq -0x20(%rbp), %rdx
callq 0x4640
testb $0x1, %al
jne 0x5f2b
jmp 0x5f2d
jmp 0x5f2d
movq -0x10(%rbp), %rdi
movl $0x7, %esi
leaq -0x20(%rbp), %rdx
callq 0x4640
testb $0x1, %al
jne 0x5f45
jmp 0x5f53
leaq 0x9027(%rip), %rdi      # 0xef73
movb $0x0, %al
callq 0x2040
movq -0x10(%rbp), %rdi
movl $0x8, %esi
leaq -0x20(%rbp), %rdx
callq 0x4640
testb $0x1, %al
jne 0x5f6b
jmp 0x5f79
leaq 0x901b(%rip), %rdi      # 0xef8d
movb $0x0, %al
callq 0x2040
movq -0x10(%rbp), %rdi
callq 0x4760
movq %rax, -0x90(%rbp)
leaq 0x9017(%rip), %rdi      # 0xefa7
movb $0x0, %al
callq 0x2040
movq $0x0, -0x98(%rbp)
cmpq $0x7, -0x98(%rbp)
jae 0x5fe0
movq -0x90(%rbp), %rax
movq -0x98(%rbp), %rcx
movzbl (%rax,%rcx), %esi
leaq 0x8ff1(%rip), %rdi      # 0xefb6
movb $0x0, %al
callq 0x2040
movq -0x98(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x98(%rbp)
jmp 0x5fa2
movl $0xa, %edi
callq 0x2180
movq -0xd0(%rbp), %rdi
addq $0x18, %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x8d40
movq -0xd0(%rbp), %rdi
addq $0x18, %rdi
callq 0x9170
movq -0xd0(%rbp), %rdi
movq %rax, -0xa0(%rbp)
addq $0x18, %rdi
callq 0x91f0
movq -0xd0(%rbp), %rdi
movl %eax, -0xa4(%rbp)
addq $0x18, %rdi
callq 0x9210
movq -0xd0(%rbp), %rdi
movl %eax, -0xa8(%rbp)
movl -0xa4(%rbp), %eax
subl -0xa8(%rbp), %eax
movl %eax, -0xac(%rbp)
addq $0x18, %rdi
callq 0x9230
movl %eax, -0xb0(%rbp)
movl -0xa8(%rbp), %eax
subl -0xb0(%rbp), %eax
movl %eax, -0xb4(%rbp)
movl -0xac(%rbp), %esi
movl -0xb4(%rbp), %edx
leaq 0x8f2a(%rip), %rdi      # 0xefbc
movb $0x0, %al
callq 0x2040
cmpl $0x0, -0xb0(%rbp)
jbe 0x60b8
movl -0xb0(%rbp), %esi
leaq 0x8f22(%rip), %rdi      # 0xefd1
movb $0x0, %al
callq 0x2040
jmp 0x60c6
leaq 0x8f23(%rip), %rdi      # 0xefe2
movb $0x0, %al
callq 0x2040
leaq 0x8f27(%rip), %rdi      # 0xeff4
movb $0x0, %al
callq 0x2040
movq $0x0, -0xc0(%rbp)
cmpq $0x8, -0xc0(%rbp)
jae 0x6157
movq -0xa0(%rbp), %rax
movq -0xc0(%rbp), %rcx
movzbl 0x1(%rax,%rcx,4), %esi
movq -0xa0(%rbp), %rax
movq -0xc0(%rbp), %rcx
movzbl (%rax,%rcx,4), %edx
movq -0xa0(%rbp), %rax
movq -0xc0(%rbp), %rcx
movzbl 0x3(%rax,%rcx,4), %ecx
movq -0xa0(%rbp), %rax
movq -0xc0(%rbp), %rdi
movzbl 0x2(%rax,%rdi,4), %r8d
leaq 0x8ecf(%rip), %rdi      # 0xf00b
movb $0x0, %al
callq 0x2040
movq -0xc0(%rbp), %rax
addq $0x1, %rax
movq %rax, -0xc0(%rbp)
jmp 0x60df
movq 0xee62(%rip), %rax      # 0x14fc0
movq (%rax), %rdi
callq 0x2120
movq -0xd0(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x61e5
movq $0x0, -0xc8(%rbp)
cmpq $0x5a0, -0xc8(%rbp) # imm = 0x5A0
jae 0x61cf
movq -0xd0(%rbp), %rax
movq -0xa0(%rbp), %rdi
movq -0xc8(%rbp), %rcx
shlq $0x2, %rcx
addq %rcx, %rdi
movq 0x8(%rax), %rcx
movl $0x4, %esi
movl $0x1, %edx
callq 0x21f0
movq -0xc8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0xc8(%rbp)
jmp 0x617f
movq -0xd0(%rbp), %rax
movq 0x10(%rax), %rcx
addq $0x5a0, %rcx            # imm = 0x5A0
movq %rcx, 0x10(%rax)
movq -0xd0(%rbp), %rax
movb $0x1, 0x2db0(%rax)
movl -0x24(%rbp), %ecx
movl %ecx, 0x2db4(%rax)
movl 0x2db8(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x2db8(%rax)
addq $0x1e0, %rsp            # imm = 0x1E0
popq %rbp
retq
movq -0x38(%rbp), %rdi
callq 0x21d0
nopl (%rax)