LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/ke6jjj[P]r-dat/RDATDecoder.cc
// Function: RDATDecoder::EvaluateClock()
void
RDATDecoder::EvaluateClock()
{
  int i, maxI, minI;
  float max = 0.0, min = 100.0, ratio;

  for (i = maxI = 0; i < mSyncWindowSize; i++) {
    //
    // Find the highest peak.
    //
    if (mSyncWindow[i] > max) {
      max = mSyncWindow[i];
      maxI = i;
    }
    //
    // And the lowest valley.
    //
    if (mSyncWindow[i] < min)
      min = mSyncWindow[i];
  }
  
  if (maxI != mSyncWindowSyncPos) {
    //
    // We've found a new sync position.
    // In the future we might calculate clock error here.
    //
    mSyncWindowSyncPos = maxI;
    mSyncWindowNextEvalPos = (maxI + mSyncWindowSize / 2) %
                              mSyncWindowSize;
  }
  
  //
  // If there is a significant difference between the highest
  // peak and the lowest valley then we have a good clock signal.
  //
  if (max > 0.0)
    ratio = min / max;
  else
    ratio = 0.0;

  if (ratio < mClockRatioThreshold) {
    if (!mClockDetected && mDecoder != NULL)
      mDecoder->ClockDetected(true);
    mClockDetected = true;
  } else {
    if (mClockDetected && mDecoder != NULL)
      mDecoder->ClockDetected(false);
    mClockDetected = false;
  }
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl 0x18(%rdi), %ecx
xorl %eax, %eax
testl %ecx, %ecx
movl $0x0, %edx
cmovgl %ecx, %edx
movq 0x10(%rdi), %rdi
movss 0x5899(%rip), %xmm0     # 0x82e4
xorps %xmm1, %xmm1
xorl %esi, %esi
cmpq %rax, %rdx
je 0x2a76
movss (%rdi,%rax,4), %xmm2
ucomiss %xmm1, %xmm2
cmoval %eax, %esi
movaps %xmm2, %xmm3
maxss %xmm1, %xmm3
minss %xmm0, %xmm2
incq %rax
movaps %xmm3, %xmm1
movaps %xmm2, %xmm0
jmp 0x2a50
cmpl 0x20(%rbx), %esi
je 0x2a8e
movl %esi, 0x20(%rbx)
pushq $0x2
popq %rdi
movl %ecx, %eax
cltd
idivl %edi
addl %esi, %eax
cltd
idivl %ecx
movl %edx, 0x28(%rbx)
divss %xmm1, %xmm0
xorps %xmm2, %xmm2
cmpltss %xmm1, %xmm2
andps %xmm0, %xmm2
movss 0x30(%rbx), %xmm0
ucomiss %xmm2, %xmm0
movb 0x2c(%rbx), %al
jbe 0x2ac2
movb $0x1, %bpl
testb %al, %al
jne 0x2add
movq 0x8(%rbx), %rdi
testq %rdi, %rdi
je 0x2add
movq (%rdi), %rax
pushq $0x1
popq %rsi
jmp 0x2ad6
testb %al, %al
je 0x2adb
movq 0x8(%rbx), %rdi
testq %rdi, %rdi
je 0x2adb
movq (%rdi), %rax
xorl %ebp, %ebp
xorl %esi, %esi
callq *0x8(%rax)
jmp 0x2add
xorl %ebp, %ebp
movb %bpl, 0x2c(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/ke6jjj[P]r-dat/DATWordReceiver.cc
// Function: DATWordReceiver::DumpWord(unsigned short, unsigned short)
void
DATWordReceiver::DumpWord(uint16_t raw, uint16_t decode)
{
  if (decode & WORD_SYNC) {
    printf("\nSYNC");
  } else if (decode & WORD_ATF2) {
    printf(" AT2");
  } else if (decode & WORD_ATF3) {
    printf(" AT3");
  } else if (decode & WORD_INVALID) {
    printf(" XXX");
  } else {
    printf(" %02x", decode);
  }
}

// Assembly:
btl $0x8, %edx
jb 0x2c8f
btl $0x9, %edx
jb 0x2c98
btl $0xa, %edx
jb 0x2ca1
testw %dx, %dx
js 0x2caa
leaq 0x5ecf(%rip), %rdi      # 0x8b55
movl %edx, %esi
xorl %eax, %eax
jmp 0x2040
leaq 0x5eaa(%rip), %rdi      # 0x8b40
jmp 0x2cb1
leaq 0x5ea7(%rip), %rdi      # 0x8b46
jmp 0x2cb1
leaq 0x5ea3(%rip), %rdi      # 0x8b4b
jmp 0x2cb1
leaq 0x5e9f(%rip), %rdi      # 0x8b50
xorl %eax, %eax
jmp 0x2040
// File: /workspace/github_cpp_makefile_star2_O2/ke6jjj[P]r-dat/DATWordReceiver.cc
// Function: DATWordReceiver::ReceiveWord(unsigned short, unsigned short)
void
DATWordReceiver::ReceiveWord(uint16_t raw, uint16_t decode)
{
  if (decode & WORD_SYNC)
    mBlock.Reset();
  if (decode & WORD_ATF2)
    mBlockReceiver->ReceiveATFTone(2);
  if (decode & WORD_ATF3)
    mBlockReceiver->ReceiveATFTone(3);

  bool complete = mBlock.AddByte(raw, decode);

  if (complete)
    DumpCurrentBlock();
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %edx, %ebp
movl %esi, %r14d
movq %rdi, %rbx
btl $0x8, %edx
jae 0x2cd3
leaq 0x8(%rbx), %rdi
callq 0x2dfc
btl $0x9, %ebp
jae 0x2ce9
movq 0xa0(%rbx), %rdi
movq (%rdi), %rax
pushq $0x2
popq %rsi
callq *0x10(%rax)
btl $0xa, %ebp
jae 0x2cff
movq 0xa0(%rbx), %rdi
movq (%rdi), %rax
pushq $0x3
popq %rsi
callq *0x10(%rax)
leaq 0x8(%rbx), %rdi
movzwl %r14w, %esi
movzwl %bp, %edx
callq 0x2e06
testb %al, %al
je 0x2d1f
movq %rbx, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x2d24
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/ke6jjj[P]r-dat/DATWordReceiver.cc
// Function: DATWordReceiver::TrackDetected(bool)
void
DATWordReceiver::TrackDetected(bool up)
{
  if (mDump)
    return;

  if (up == false) {
    //
    // Track is ending. Dump any pending blocks.
    //
    DumpCurrentBlock();
  }

  //
  // Notify the block receiver of the new track state.
  //
  mBlockReceiver->TrackDetected(up);
}

// Assembly:
cmpb $0x0, (%rdi)
je 0x2d4c
retq
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebx
movq %rdi, %r14
testb %bl, %bl
jne 0x2d61
movq %r14, %rdi
callq 0x2d24
movq 0xa0(%r14), %rdi
movq (%rdi), %rax
movq (%rax), %rax
movzbl %bl, %esi
addq $0x8, %rsp
popq %rbx
popq %r14
jmpq *%rax
// File: /workspace/github_cpp_makefile_star2_O2/ke6jjj[P]r-dat/DATWordReceiver.cc
// Function: DATWordReceiver::Stop()
void
DATWordReceiver::Stop()
{
  if (mBlock.Size() > 0)
    DumpCurrentBlock();
  if (mBlockReceiver != NULL)
    mBlockReceiver->Stop();
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
addq $0x8, %rdi
callq 0x2e30
testq %rax, %rax
je 0x2d94
movq %rbx, %rdi
callq 0x2d24
movq 0xa0(%rbx), %rdi
testq %rdi, %rdi
je 0x2da7
movq (%rdi), %rax
popq %rbx
jmpq *0x18(%rax)
popq %rbx
retq
nopl (%rax)
// File: /workspace/github_cpp_makefile_star2_O2/ke6jjj[P]r-dat/RDATEQDecoder.cc
// Function: RDATEQDecoder::RDATEQDecoder(float)
RDATEQDecoder::RDATEQDecoder(float sampleRate)
: mSyncWindowCurPos(0), mSyncWindowSyncPos(0),
  mClockDetected(false), mClockRatioThreshold(0.97),
  mClockAlpha(1.0 / 30.0)
{
  int i;
  
  //
  // Create a filter bank/window for the clock detector.
  //
  mSyncWindowSize = sampleRate / kSymbolRate;
  mSyncWindow = new float[mSyncWindowSize];
  mSyncWindowEvalPos = mSyncWindowSize / 2;
  mSyncWindowNextEvalPos = mSyncWindowEvalPos;
  
  for (i = 0; i < mSyncWindowSize; i++)
    mSyncWindow[i] = 0.0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0xba72(%rip), %rax      # 0xeae0
movq %rax, (%rdi)
andq $0x0, 0x1c(%rdi)
movb $0x0, 0x2c(%rdi)
movsd 0x522e(%rip), %xmm1     # 0x82b0
divss 0x5246(%rip), %xmm0     # 0x82d0
cvttss2si %xmm0, %eax
movsd %xmm1, 0x30(%rdi)
movl %eax, 0x18(%rdi)
movslq %eax, %r14
leaq (,%r14,4), %rax
xorl %r15d, %r15d
testl %r14d, %r14d
pushq $-0x1
popq %rdi
cmovnsq %rax, %rdi
movl $0x0, %r12d
cmovgl %r14d, %r12d
callq 0x2030
movq %rax, %rcx
movq %rax, 0x10(%rbx)
pushq $0x2
popq %rsi
movl %r14d, %eax
cltd
idivl %esi
movl %eax, 0x24(%rbx)
movl %eax, 0x28(%rbx)
cmpq %r15, %r12
je 0x30e2
andl $0x0, (%rcx,%r15,4)
incq %r15
jmp 0x30d3
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/ke6jjj[P]r-dat/RDATEQDecoder.cc
// Function: RDATEQDecoder::Process(float*, unsigned long)
void
RDATEQDecoder::Process(float *samples, size_t count)
{
  size_t i;
  float signal;
  bool sign, zeroCross;
  
  for (i = 0; i < count; i++) {
    //
    // Look at the sample.
    //
    signal = samples[i];

    //
    // Send the baseband signal to the clock detector.
    // If it returns true, then the clock detector has
    // achieved a good lock and suggests sampling the
    // signal now.
    //
    if (ClockDetect(signal)) {
      //
      // Signal should be sampled now.
      //
      mDecoder->ReceiveSample(signal);
    }
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
xorl %r12d, %r12d
cmpq %r12, %rbx
je 0x3166
movss (%r14,%r12,4), %xmm0
movq %r15, %rdi
movss %xmm0, 0x4(%rsp)
callq 0x3172
testb %al, %al
je 0x3161
movq 0x8(%r15), %rdi
movq (%rdi), %rax
movss 0x4(%rsp), %xmm0
callq *0x10(%rax)
incq %r12
jmp 0x3134
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/ke6jjj[P]r-dat/Track.cc
// Function: Track::Track(Track::Head)
Track::Track(Head head)
  : mHead(head), mHaveLastBlock(false), mC1Errors(0), mC1UncorrectableErrors(0),
    mC2UncorrectableErrors(0), mHaveControlID(false), mHaveDataID(false)
{
  int i, j;
  
  //
  // Invalidate all parsed sub-codes.
  //
  for (i = 0; i < 16; i++)
    mSubcodeIsValid[i] = false;
  
  //
  // Invalidate the sub-code signature.
  //
  for (i = 0; i < 7; i++)
    mSubcodeSignature[i] = 0;
  
  //
  // Invalidate all blocks.
  //
  for (i = 0; i < kBlocks; i++) {
    for (j = 0; j < kBlockSize; j++) {
      mDataIsValid[i][j] = false;
      mData[i][j] = 0;
    }
    mHeaderIsValid[i] = false;
  }
}

// Assembly:
movl %esi, (%rdi)
xorl %eax, %eax
movb %al, 0x85(%rdi)
movb %al, 0x87(%rdi)
movb %al, 0x25af(%rdi)
xorps %xmm0, %xmm0
movups %xmm0, 0x25b8(%rdi)
andq $0x0, 0x25c8(%rdi)
cmpq $0x10, %rax
je 0x32c0
movb $0x0, 0x74(%rdi,%rax)
incq %rax
jmp 0x32b0
pushq $-0x7
popq %rax
testq %rax, %rax
je 0x32d5
movb $0x0, 0x8f(%rdi,%rax)
incq %rax
jmp 0x32c3
leaq 0x128f(%rdi), %rax
xorl %ecx, %ecx
xorl %edx, %edx
cmpq $0x90, %rdx
je 0x3311
xorl %esi, %esi
cmpq $0x20, %rsi
je 0x3300
movb %cl, (%rax,%rsi)
movb %cl, -0x1200(%rax,%rsi)
incq %rsi
jmp 0x32eb
movb $0x0, 0x251f(%rdi,%rdx)
incq %rdx
addq $0x20, %rax
jmp 0x32e0
retq
// File: /workspace/github_cpp_makefile_star2_O2/ke6jjj[P]r-dat/Track.cc
// Function: Track::AddBlock(DATBlock const&)
void
Track::AddBlock(const DATBlock& block)
{
  if (!BlockHeaderIsValid(block)) {
    //
    // Block doesn't have a valid header, but there might reason to
    // accept it.
    //
    if (mHaveLastBlock && block.Size() == 36) {
      if ((mLastBlockNumber >= 0    && mLastBlockNumber < 0x7f) ||
          (mLastBlockNumber >= 0x88 && mLastBlockNumber < 0x8f) ||
          (mLastBlockNumber >= 0x80 && mLastBlockNumber < 0x88)) {
        //
        // This block doesn't have a valid header but we've received blocks
        // before it that are ok and we're still expecting blocks in this
        // region. It is likely that this block simply has a bad header but
        // its byte payload is just fine. Let's interpret this block as being
        // the next block in the sequence.
        //
        AddGuessedBlock(mLastBlockNumber + 1, block);
        mLastBlockNumber++;
      }
    }
    return;
  }
  
  //
  // Block header checks out. Add the block data to the location
  // that it identifies itself as.
  //
  AddVerifiedBlock(block);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movq %rsi, %rdi
callq 0x2e30
cmpq $0x4, %rax
jae 0x338f
cmpb $0x1, 0x25af(%rbx)
jne 0x3387
movq %r14, %rdi
callq 0x2e30
cmpq $0x24, %rax
jne 0x3387
movb 0x25b0(%rbx), %al
cmpb $0x7f, %al
setb %cl
leal 0x78(%rax), %edx
cmpb $0x7, %dl
setb %dl
orb %cl, %dl
jne 0x3371
cmpb $0x7f, %al
sete %cl
cmpb $-0x78, %al
setae %dl
orb %cl, %dl
jne 0x3387
incb %al
movzbl %al, %esi
movq %rbx, %rdi
movq %r14, %rdx
callq 0x33d0
incb 0x25b0(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq %r14, %rdi
callq 0x2e3c
movzwl 0x2(%rax), %edx
movzwl 0x4(%rax), %ecx
movl %ecx, %esi
orl %edx, %esi
movzwl 0x6(%rax), %eax
movl %eax, %edi
orw %si, %di
js 0x3334
xorl %edx, %ecx
xorl %eax, %ecx
movzbl %cl, %eax
testw %ax, %ax
jne 0x3334
movq %rbx, %rdi
movq %r14, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x33e0
// File: /workspace/github_cpp_makefile_star2_O2/ke6jjj[P]r-dat/Track.cc
// Function: Track::DataFill(unsigned char, DATBlock const&)
void
Track::DataFill(uint8_t block_number, const DATBlock& block)
{
  //
  // Copy the bytes into our large block array while also marking
  // those bytes which are valid and invalid.
  //
  size_t count = block.Size();
  if (count < 4)
    return;

  count -= 4;

  if (count > 32)
    count = 32;
  
  const uint16_t *bytes = block.FlaggedBytes();
  for (size_t i = 0; i < count; i++) {
    mData[block_number][i] = bytes[i+4] & 0xff;
    mDataIsValid[block_number][i] = (bytes[i+4] & 0x8000) == 0;
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %r14
movl %esi, %ebp
movq %rdi, %rbx
movq %rdx, %rdi
callq 0x2e30
cmpq $0x4, %rax
jae 0x379e
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
addq $-0x4, %rax
cmpq $0x20, %rax
pushq $0x20
popq %r15
cmovbq %rax, %r15
movq %r14, %rdi
callq 0x2e3c
movzbl %bpl, %ecx
shll $0x5, %ecx
addq %rbx, %rcx
addq $0x128f, %rcx           # imm = 0x128F
xorl %edx, %edx
cmpq %rdx, %r15
je 0x3793
movb 0x8(%rax,%rdx,2), %sil
movb %sil, -0x1200(%rcx,%rdx)
cmpw $0x0, 0x8(%rax,%rdx,2)
setns (%rcx,%rdx)
incq %rdx
jmp 0x37c9
// File: /workspace/github_cpp_makefile_star2_O2/ke6jjj[P]r-dat/AudioFrameReceiver.cc
// Function: AudioFrameReceiver::IsFrame(Track const&, Track const&)
bool
AudioFrameReceiver::IsFrame(const Track& A, const Track& B)
{
  //
  // We have a previous track. Are these two a pair or are they
  // separate?
  //
  const uint8_t *A_abstime;
  const uint8_t *B_abstime;
  bool A_good;
  bool B_good;
      
  //
  // Examine their absolute times. (Subcode 2).
  //
  A_good = A.GetSubcode(2, &A_abstime);
  B_good = B.GetSubcode(2, &B_abstime);

  //
  // These two tracks are look like a pair if they have the same, measurable
  // absolute time.
  //
  bool timeGood = A_good && B_good && (memcmp(A_abstime, B_abstime, 7) == 0);
  
  //
  // Finally, just make sure that neither track is in the wrong spot.
  //
  printf("Pair times good: %d\n", timeGood);
  printf("Pairs          : %d %d\n", A.GetHead(), B.GetHead());

  return timeGood
         && A.GetHead() != Track::HEAD_B
         && B.GetHead() != Track::HEAD_A;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdx, %rbx
movq %rsi, %r14
pushq $0x2
popq %rbp
leaq 0x8(%rsp), %rdx
movq %rsi, %rdi
movl %ebp, %esi
callq 0x343e
movl %eax, %r15d
movq %rsp, %rdx
movq %rbx, %rdi
movl %ebp, %esi
callq 0x343e
testb %r15b, %r15b
je 0x3a1b
testb %al, %al
je 0x3a1b
movq 0x8(%rsp), %rdi
movq (%rsp), %rsi
pushq $0x7
popq %rdx
callq 0x2100
movl %eax, %r15d
xorl %esi, %esi
testl %eax, %eax
sete %sil
leaq 0x51f6(%rip), %rdi      # 0x8bcc
xorl %ebp, %ebp
xorl %eax, %eax
callq 0x2040
movq %r14, %rdi
callq 0x3314
movl %eax, %r12d
movq %rbx, %rdi
callq 0x3314
leaq 0x51e8(%rip), %rdi      # 0x8be1
movl %r12d, %esi
movl %eax, %edx
xorl %eax, %eax
callq 0x2040
testl %r15d, %r15d
jne 0x3a53
movq %r14, %rdi
callq 0x3314
cmpl $0x1, %eax
jne 0x3a62
xorl %ebp, %ebp
jmp 0x3a53
leaq 0x51aa(%rip), %rdi      # 0x8bcc
xorl %ebp, %ebp
xorl %esi, %esi
xorl %eax, %eax
callq 0x2040
movq %r14, %rdi
callq 0x3314
movl %eax, %r14d
movq %rbx, %rdi
callq 0x3314
leaq 0x519a(%rip), %rdi      # 0x8be1
movl %r14d, %esi
movl %eax, %edx
xorl %eax, %eax
callq 0x2040
movl %ebp, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rbx, %rdi
callq 0x3314
testl %eax, %eax
setne %bpl
jmp 0x3a53
// File: /workspace/github_cpp_makefile_star2_O2/ke6jjj[P]r-dat/AudioFrameReceiver.cc
// Function: AudioFrameReceiver::SetDumpFile(char const*)
bool
AudioFrameReceiver::SetDumpFile(const char *path)
{
  mFile = fopen(path, "wb");
  mFramesWritten = 0;
  
  if (mFile != NULL) {
    uint8_t header_space[kWAVHeaderSize + kWAVFormatChunkHeaderSize +
                         kWAVDataChunkHeaderSize];
    memset(header_space, 0, sizeof(header_space));
    fwrite(header_space, sizeof(header_space), 1, mFile);
  }
  
  return mFile != NULL;
}

// Assembly:
pushq %rbx
subq $0x30, %rsp
movq %rsi, %rax
movq %rdi, %rbx
leaq 0x47e2(%rip), %rsi      # 0x8f42
movq %rax, %rdi
callq 0x2130
movq %rax, 0x8(%rbx)
andq $0x0, 0x10(%rbx)
testq %rax, %rax
je 0x479f
xorps %xmm0, %xmm0
movq %rsp, %rdi
movups %xmm0, 0x1c(%rdi)
movaps %xmm0, 0x10(%rdi)
movaps %xmm0, (%rdi)
pushq $0x2c
popq %rsi
pushq $0x1
popq %rdx
movq %rax, %rcx
callq 0x2200
cmpq $0x0, 0x8(%rbx)
setne %al
jmp 0x47a1
xorl %eax, %eax
addq $0x30, %rsp
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/ke6jjj[P]r-dat/DDSFrameReceiver.cc
// Function: DDSFrameReceiver::DumpGroup()
void
DDSFrameReceiver::DumpGroup()
{
  //
  // Perform ECC3 correction on the group. It's likely complete now.
  //
  bool correct = mBasicGroup->Correct();
  uint32_t group_id = mBasicGroup->BasicGroupID();
  printf("Group ECC3    : %s (Group %d)\n", correct ? "GOOD" : "----BAD---",
         group_id);
  printf("------------------------------------------------------------\n");
  
  //
  // Figure out what file name we should store this group's data under.
  //
  char *groupFilename, *validName, *eccName, *eccValidName;
  groupFilename = validName = eccName = eccValidName = NULL;
  GenerateGroupFilenames(group_id, groupFilename, validName, eccName,
    eccValidName);
  
  //
  // Dump the group data to disk.
  //
  mBasicGroup->DumpToFile(groupFilename, validName, eccName, eccValidName);

  free(groupFilename);
  free(validName);
  free(eccName);
  free(eccValidName);

  //
  // Mark that we now have no group.
  //
  mHaveGroup = false;
  delete mBasicGroup;
  mBasicGroup = NULL;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
movq 0x8(%rdi), %rdi
callq 0x6b5c
movl %eax, %r14d
movq 0x8(%rbx), %rdi
callq 0x6c0a
movl %eax, %ebp
leaq 0x46c7(%rip), %rax      # 0x923c
leaq 0x46c5(%rip), %rsi      # 0x9241
testb %r14b, %r14b
cmovneq %rax, %rsi
leaq 0x4693(%rip), %rdi      # 0x921d
movl %ebp, %edx
xorl %eax, %eax
callq 0x2040
leaq 0x46ee(%rip), %rdi      # 0x9288
callq 0x21c0
leaq 0x8(%rsp), %r14
andq $0x0, (%r14)
leaq 0x10(%rsp), %r15
andq $0x0, (%r15)
leaq 0x18(%rsp), %r12
andq $0x0, (%r12)
leaq 0x20(%rsp), %r13
andq $0x0, (%r13)
movq %rbx, %rdi
movl %ebp, %esi
movq %r13, %rdx
movq %r12, %rcx
movq %r15, %r8
movq %r14, %r9
callq 0x4dd8
movq 0x8(%rbx), %rdi
movq (%r13), %rsi
movq (%r12), %rdx
movq (%r15), %rcx
movq (%r14), %r8
callq 0x688e
movq (%r13), %rdi
callq 0x2140
movq (%r12), %rdi
callq 0x2140
movq (%r15), %rdi
callq 0x2140
movq (%r14), %rdi
callq 0x2140
movb $0x0, 0x10(%rbx)
movq 0x8(%rbx), %r14
testq %r14, %r14
je 0x4c29
movq %r14, %rdi
callq 0x66e6
movl $0x40a4c, %esi          # imm = 0x40A4C
movq %r14, %rdi
callq 0x20f0
andq $0x0, 0x8(%rbx)
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/ke6jjj[P]r-dat/DDSFrameReceiver.cc
// Function: DDSFrameReceiver::AddFrame(DDSGroup3&)
void
DDSFrameReceiver::AddFrame(DDSGroup3& frame)
{
  //
  // Is this a continuation of the last group or a new group?
  //
  if (mHaveGroup && mGroupNumber != frame.BasicGroupID()) {
    //
    // We have a basic group but this frame is outside of it.
    // Dump the current group.
    //
    DumpGroup();
  }
  
  //
  // Is this the start of a new group?
  //
  if (!mHaveGroup) {      
    //
    // Prepare a new group with this frame's group number.
    // This may also entail loading anything we currently know about this
    // group from a previous decoding process.
    //
    NewGroup(frame.BasicGroupID());
  }
  
  //
  // De-whiten the data into a G1 group.
  //
  DDSGroup1 g1(frame);
  
  //
  // Copy it into the basic group in the appropriate spot.
  //
  mBasicGroup->AddSubFrame(g1);
    
  //
  // If this was the last frame of the group, dump the group.
  //
  if (frame.IsLastLogicalFrame())
    DumpGroup();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x2d08, %rsp           # imm = 0x2D08
movq %rsi, %r14
movq %rdi, %rbx
cmpb $0x1, 0x10(%rdi)
jne 0x4c7a
movl 0x14(%rbx), %ebp
movq %r14, %rdi
callq 0x4e86
cmpl %eax, %ebp
je 0x4c7a
movq %rbx, %rdi
callq 0x4b46
cmpb $0x0, 0x10(%rbx)
jne 0x4c92
movq %r14, %rdi
callq 0x4e86
movq %rbx, %rdi
movl %eax, %esi
callq 0x4d02
leaq 0x8(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x63fc
movq 0x8(%rbx), %rdi
movq %r15, %rsi
callq 0x6a14
movq %r14, %rdi
callq 0x4e8e
testb %al, %al
je 0x4cc2
movq %rbx, %rdi
callq 0x4b46
leaq 0x8(%rsp), %rdi
callq 0x64d8
addq $0x2d08, %rsp           # imm = 0x2D08
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x64d8
movq %rbx, %rdi
callq 0x21e0
nop
// File: /workspace/github_cpp_makefile_star2_O2/ke6jjj[P]r-dat/DDSFrameReceiver.cc
// Function: DDSFrameReceiver::NewGroup(unsigned int)
void
DDSFrameReceiver::NewGroup(uint32_t group_id)
{
  //
  // Construct a new group object.
  //
  mBasicGroup = new BasicGroup(group_id);
  
  //
  // Figure out what file name we would have previously stored this
  // group's data under, if available.
  //
  char *groupFilename, *validName, *eccName, *eccValidName;
  groupFilename = validName = eccName = eccValidName = NULL;
  GenerateGroupFilenames(group_id, groupFilename, validName, eccName,
    eccValidName);
  
  //
  // Load any previous data for this group.
  //
  mBasicGroup->LoadFromFile(groupFilename, validName, eccName, eccValidName);
  
  free(groupFilename);
  free(validName);
  free(eccName);
  free(eccValidName);

  //
  // Mark that we now have a group.
  //
  mHaveGroup = true;
  mGroupNumber = group_id;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %esi, %ebx
movq %rdi, %r14
movl $0x40a4c, %edi          # imm = 0x40A4C
callq 0x20e0
movq %rax, %r15
movq %rax, %rdi
movl %ebx, %esi
callq 0x66a0
movq %r15, 0x8(%r14)
leaq 0x8(%rsp), %r15
andq $0x0, (%r15)
leaq 0x10(%rsp), %r12
andq $0x0, (%r12)
leaq 0x18(%rsp), %r13
andq $0x0, (%r13)
leaq 0x20(%rsp), %rbp
andq $0x0, (%rbp)
movq %r14, %rdi
movl %ebx, %esi
movq %rbp, %rdx
movq %r13, %rcx
movq %r12, %r8
movq %r15, %r9
callq 0x4dd8
movq 0x8(%r14), %rdi
movq (%rbp), %rsi
movq (%r13), %rdx
movq (%r12), %rcx
movq (%r15), %r8
callq 0x66e8
movq (%rbp), %rdi
callq 0x2140
movq (%r13), %rdi
callq 0x2140
movq (%r12), %rdi
callq 0x2140
movq (%r15), %rdi
callq 0x2140
movb $0x1, 0x10(%r14)
movl %ebx, 0x14(%r14)
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movl $0x40a4c, %esi          # imm = 0x40A4C
movq %r15, %rdi
callq 0x20f0
movq %rbx, %rdi
callq 0x21e0
// File: /workspace/github_cpp_makefile_star2_O2/ke6jjj[P]r-dat/DDSFrameReceiver.cc
// Function: DDSFrameReceiver::GenerateGroupFilenames(unsigned int, char*&, char*&, char*&, char*&)
void
DDSFrameReceiver::GenerateGroupFilenames(uint32_t group_id,
  char*& groupFilename, char*& validName, char*& eccName, char*& eccValidName)
{
  asprintf(&groupFilename, "%s/g%06d.bin", mOutputDirectory, group_id);
  asprintf(&validName,     "%s/g%06d.val", mOutputDirectory, group_id);
  asprintf(&eccName,       "%s/g%06d.ecc.bin", mOutputDirectory, group_id);
  asprintf(&eccValidName,  "%s/g%06d.ecc.val", mOutputDirectory, group_id);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %r9, %rbx
movq %r8, %r15
movq %rcx, %r12
movq %rdx, %rax
movl %esi, %ebp
movq %rdi, %r14
movq 0x20(%rdi), %rdx
leaq 0x4450(%rip), %rsi      # 0x924c
movq %rax, %rdi
movl %ebp, %ecx
xorl %eax, %eax
callq 0x2080
movq 0x20(%r14), %rdx
leaq 0x4446(%rip), %rsi      # 0x9259
movq %r12, %rdi
movl %ebp, %ecx
xorl %eax, %eax
callq 0x2080
movq 0x20(%r14), %rdx
leaq 0x443c(%rip), %rsi      # 0x9266
movq %r15, %rdi
movl %ebp, %ecx
xorl %eax, %eax
callq 0x2080
movq 0x20(%r14), %rdx
leaq 0x4436(%rip), %rsi      # 0x9277
movq %rbx, %rdi
movl %ebp, %ecx
xorl %eax, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x2080
nopl (%rax)
// File: /workspace/github_cpp_makefile_star2_O2/ke6jjj[P]r-dat/DDSGroup3.cc
// Function: DDSGroup3::DecodeFrame(Track const&, Track const&)
DDSGroup3::DecodeError
DDSGroup3::DecodeFrame(const Track& A, const Track& B)
{
  //
  // Retrieve the items from subcode id #3 from both tracks.
  // 
  const uint8_t *a_subcode, *b_subcode;
  
  if (!A.GetSubcode(3, &a_subcode))
    return A_MISSING_SUBCODE_3;
  if (!B.GetSubcode(3, &b_subcode))
    return B_MISSING_SUBCODE_3;
  
  //
  // Every track should have a valid subcode pack 3. Let's fetch it from
  // both tracks and make certain they match. (This may be redundant as
  // the frame pairing protocol is supposed to have checked this earlier).
  //
  DDSSubcodePack3 a3, b3;
  a3.Decode(a_subcode);
  b3.Decode(b_subcode);
    
  //
  // Assert that both tracks contain the same absolute frame number.
  //
  if (a3.mAbsoluteFrameID != b3.mAbsoluteFrameID)
    return ABSOLUTE_FRAME_MISMATCH;
    
  //
  // Record frame numbers and such.
  //
  mPartitionID = PartitionID(a3.mPartitionID);
  mAreaID   = AreaID(a3.mAreaID);
  mAbsoluteFrameID = a3.mAbsoluteFrameID;

  //
  // Fetch additional items, depending on the Area of the tape
  // we're supposedly in.
  //
  switch (mAreaID) {
  case DEVICE_AREA:
  case REFERENCE_AREA:
  case SYSTEM_AREA:
  case EOD_AREA:
    //
    // Not handling these areas yet.
    //
    return DECODE_OK;
  case DATA_AREA:
    //
    // Data area frames also have data, which we should check and store.
    //
    // Assert that both tracks of this famre also agree on their logical
    // frame number (this frame's position within the larger Basic Group).
    //
    if (a3.mLogicalFrameID != b3.mLogicalFrameID)
      return LOGICAL_FRAME_MISMATCH;
    
    return HandleDataAreaFrame(a3, A, B);
    break;
  default:
    return UNKNOWN_AREA_ID;
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
pushq $0x3
popq %rsi
leaq 0x20(%rsp), %rdx
movq %r14, %rdi
callq 0x343e
testb %al, %al
je 0x4f63
pushq $0x3
popq %rsi
leaq 0x18(%rsp), %rdx
movq %rbx, %rdi
callq 0x343e
testb %al, %al
je 0x4f67
xorl %ebp, %ebp
leaq 0x8(%rsp), %r12
movb %bpl, (%r12)
leaq 0x28(%rsp), %r13
movb %bpl, (%r13)
movq 0x20(%rsp), %rsi
movq %r12, %rdi
callq 0x6344
movq 0x18(%rsp), %rsi
movq %r13, %rdi
callq 0x6344
movl 0x4(%r12), %ecx
cmpl 0x4(%r13), %ecx
jne 0x4f6b
movzbl 0x9(%rsp), %eax
movl %eax, 0x4(%r15)
movzbl 0xa(%rsp), %eax
movl %eax, (%r15)
movl %ecx, 0x8(%r15)
cmpl $0x3, %eax
jb 0x4f6e
cmpl $0x5, %eax
je 0x4f6e
cmpl $0x4, %eax
jne 0x4f7f
movb 0x12(%rsp), %al
cmpb 0x32(%rsp), %al
jne 0x4f83
leaq 0x8(%rsp), %rsi
movq %r15, %rdi
movq %r14, %rdx
movq %rbx, %rcx
callq 0x4f88
movl %eax, %ebp
jmp 0x4f6e
pushq $0x1
jmp 0x4f6d
pushq $0x2
jmp 0x4f6d
pushq $0x6
popq %rbp
movl %ebp, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
pushq $0x8
jmp 0x4f6d
pushq $0x7
jmp 0x4f6d
nop
// File: /workspace/github_cpp_makefile_star2_O2/ke6jjj[P]r-dat/ECC_C1.cc
// Function: ECC_C1::ComputeSyndrome(unsigned char (&) [4])
bool
ECC_C1::ComputeSyndrome(uint8_t (&syndrome)[ECC_C1::kTwoT])
{
  //
  // Multiply the filled in vector by the check matrix to produce a
  // result vector.
  //
  bool ok = true;
  for (size_t i = 0; i < kTwoT; i++) {
    uint8_t result = 0;
    for (size_t j = 0; j < kN; j++) {
      result ^= ECC_GF28_multiply(mData[j], gHp[i][j]);
    }

    syndrome[i] = result;

    //
    // Everything is ok if all previous entries are zero and this
    // entry is zero.
    //
    ok = ok && result == 0;
  }

  return ok;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, (%rsp)
movq %rdi, %r15
movb $0x1, %bl
leaq 0x426d(%rip), %r12      # 0x9400
xorl %r13d, %r13d
cmpq $0x4, %r13
je 0x51d7
xorl %ebp, %ebp
xorl %r14d, %r14d
cmpq $0x20, %r14
je 0x51be
movzbl (%r15,%r14), %edi
movzbl (%r12,%r14), %esi
callq 0x59b4
xorb %al, %bpl
incq %r14
jmp 0x51a1
movq (%rsp), %rax
movb %bpl, (%rax,%r13)
testb %bpl, %bpl
sete %al
andb %al, %bl
incq %r13
addq $0x20, %r12
jmp 0x5196
andb $0x1, %bl
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/ke6jjj[P]r-dat/./ReedSolomon_EUA.h
// Function: void poly_multiply_by_x<5ul>(unsigned char const (&) [5ul], unsigned char (&) [5ul])
void
poly_multiply_by_x(const uint8_t (&in)[n], uint8_t (&out)[n])
{
  //
  // Perform this in a manner that will be safe even if in and out
  // are the same array.
  //
  for (size_t i = n - 1; i > 0; i--)
    out[i] = in[i-1];
  out[0] = 0;
}

// Assembly:
pushq $0x4
popq %rax
movq %rax, %rcx
subq $0x1, %rcx
jb 0x5700
movb -0x1(%rdi,%rax), %dl
movb %dl, (%rsi,%rax)
movq %rcx, %rax
jmp 0x56ee
movb $0x0, (%rsi)
retq
// File: /workspace/github_cpp_makefile_star2_O2/ke6jjj[P]r-dat/./ReedSolomon_EUA.h
// Function: unsigned char poly_evaluate<4ul>(unsigned char const (&) [4ul], unsigned char)
uint8_t
poly_evaluate(const uint8_t (&in)[n], uint8_t x)
{
  uint8_t y = x;
  uint8_t r = in[0];
  
  for (size_t i = 1; i < n; i++) {
    r ^= ECC_GF28_multiply(in[i], y);
    y = ECC_GF28_multiply(y, x);
  }
  
  return r;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %esi, %eax
movq %rdi, %rbx
movb (%rdi), %bpl
pushq $0x1
popq %r12
movzbl %al, %r14d
cmpq $0x4, %r12
je 0x5771
movzbl (%rbx,%r12), %edi
movzbl %al, %r15d
movl %r15d, %esi
callq 0x59b4
xorb %al, %bpl
movl %r15d, %edi
movl %r14d, %esi
callq 0x59b4
incq %r12
jmp 0x5747
movl %ebp, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/ke6jjj[P]r-dat/ECC_GF28.cc
// Function: ECC_GF28_multiply(unsigned char, unsigned char)
uint8_t
ECC_GF28_multiply(uint8_t a, uint8_t b)
{
  if (a == 0 || b == 0)
    return 0;

  if (a == 1)
    return b;

  if (b == 1)
    return a;
  
  //
  // Use the discrete logarithm table to make multiplicaton an O(1)
  // operation.
  //
  return kPowAlpha[(kLogAlpha[a] + kLogAlpha[b]) % 255];
}

// Assembly:
testl %edi, %edi
sete %cl
testl %esi, %esi
sete %dl
orb %cl, %dl
je 0x59c5
xorl %eax, %eax
retq
movl %esi, %eax
cmpb $0x1, %dil
je 0x59c4
cmpb $0x1, %al
jne 0x59d4
movl %edi, %eax
retq
movzbl %dil, %ecx
leaq 0x3bd1(%rip), %rdx      # 0x95b0
movzbl (%rcx,%rdx), %ecx
movzbl %al, %eax
movzbl (%rax,%rdx), %eax
addl %ecx, %eax
movw $0xff, %cx
xorl %edx, %edx
divw %cx
movzwl %dx, %eax
leaq 0x3ab1(%rip), %rcx      # 0x94b0
movb (%rax,%rcx), %al
retq
// File: /workspace/github_cpp_makefile_star2_O2/ke6jjj[P]r-dat/ECC_GF28.cc
// Function: ECC_GF28_evaluate(unsigned char const*, unsigned char, unsigned long)
uint8_t
ECC_GF28_evaluate(const uint8_t p[], uint8_t x, size_t n)
{
  uint8_t y = 1;
  uint8_t res = 0;
  
  for (size_t i = 0; i < n; i++) {
    res ^= ECC_GF28_multiply(p[i], y);
    y = ECC_GF28_multiply(y, x);
  }
  
  return res;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rdi, %r14
movb $0x1, %al
xorl %r15d, %r15d
movzbl %sil, %ebp
xorl %r13d, %r13d
cmpq %r13, %rbx
je 0x5a55
movzbl (%r14,%r13), %edi
movzbl %al, %r12d
movl %r12d, %esi
callq 0x59b4
xorb %al, %r15b
movl %r12d, %edi
movl %ebp, %esi
callq 0x59b4
incq %r13
jmp 0x5a2d
movl %r15d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/ke6jjj[P]r-dat/ECC_C2.cc
// Function: ECC_C2::ComputeSyndrome(unsigned char*)
bool
ECC_C2::ComputeSyndrome(uint8_t syndrome[ECC_C2::kTwoT])
{
  //
  // Multiply the filled in vector by the check matrix to produce a
  // result vector.
  //
  bool ok = true;
  for (size_t i = 0; i < kTwoT; i++) {
    uint8_t result = 0;
    for (size_t j = 0; j < kN; j++) {
      result ^= ECC_GF28_multiply(mData[j], gHq[i][j]);
    }

    syndrome[i] = result;

    //
    // Everything is ok if all previous entries are zero and this
    // entry is zero.
    //
    ok = ok && result == 0;
  }

  return ok;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, (%rsp)
movq %rdi, %r15
movb $0x1, %bl
leaq 0x3ccd(%rip), %r12      # 0x97b0
xorl %r13d, %r13d
cmpq $0x6, %r13
je 0x5b27
xorl %ebp, %ebp
xorl %r14d, %r14d
cmpq $0x20, %r14
je 0x5b0e
movzbl (%r15,%r14), %edi
movzbl (%r12,%r14), %esi
callq 0x59b4
xorb %al, %bpl
incq %r14
jmp 0x5af1
movq (%rsp), %rax
movb %bpl, (%rax,%r13)
testb %bpl, %bpl
sete %al
andb %al, %bl
incq %r13
addq $0x20, %r12
jmp 0x5ae6
andb $0x1, %bl
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/ke6jjj[P]r-dat/DDSSubcode.cc
// Function: DDSSubcodePack1::Decode(unsigned char const*)
void
DDSSubcodePack1::Decode(const uint8_t *bytes)
{
  uint8_t position;
  uint16_t group;
  uint32_t separator_1_count;
  bool changed;
  
  position = bytes[0] & 7;
  group = DecodeU16(&bytes[1]);
  separator_1_count = DecodeU32(&bytes[3]);
  
  mValid = true;
  mPosition = position;
  mGroup = group;
  mSeparator1Count = separator_1_count;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movb (%rsi), %bpl
andb $0x7, %bpl
movzwl 0x1(%rsi), %r14d
rolw $0x8, %r14w
leaq 0x3(%rsi), %rdi
callq 0x6309
movb $0x1, (%rbx)
movb %bpl, 0x1(%rbx)
movw %r14w, 0x2(%rbx)
movl %eax, 0x4(%rbx)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/ke6jjj[P]r-dat/DDSGroup1.cc
// Function: DDSGroup1::DDSGroup1(DDSGroup3&)
DDSGroup1::DDSGroup1(DDSGroup3& g3)
  : mBasicGroupID(g3.BasicGroupID()), mSubFrameID(g3.LogicalFrameID()),
    mIsECCFrame(g3.IsECC3Frame()), mIsLastFrame(g3.IsLastLogicalFrame())
{
  //
  // The data in the G3 is a G2 group wrapper with a header row. The G2
  // group is a G1 group with a data whitening LFSR stream added to it.
  // We need to remove that whitening as we write the data out.
  //
  
  //
  // Fetch a pointer to the data and validity arrays of the G3 frame.
  //
  const DATFrame::DataArray& data = g3.Frame().Data();
  const DATFrame::ValidityArray& valid = g3.Frame().Valid();
  
  uint16_t lfsr = 1;
  
  for (size_t i = 1; i < DATFrame::kUserDataRows; i++) {
    for (size_t j = 0; j < DATFrame::kBytesPerRow; j++) {
      //
      // Look up the data.
      //
      uint8_t byte = data[i][j];
      
      //
      // Dewhiten it.
      //
      byte ^= (lfsr & 0xff);
      
      //
      // Store it in our array.
      //
      mData[(i - 1) * 4 + j] = byte;
      mDataIsValid[(i - 1) * 4 + j] = valid[i][j];
       
      //
      // Crank the LFSR.
      //
      lfsr = (((uint16_t)(G2LFSR[lfsr & 0x1ff])) << 7) | ((lfsr >> 8) & 0xff);
    }
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r15
movq %rdi, %rbx
movq %rsi, %rdi
callq 0x4e86
movl %eax, 0x2cf8(%rbx)
movq %r15, %rdi
callq 0x4e8a
movb %al, 0x2cfc(%rbx)
movq %r15, %rdi
callq 0x4e8e
movb %al, 0x2cfd(%rbx)
movq %r15, %rdi
callq 0x4e92
movb %al, 0x2cfe(%rbx)
movq %r15, %rdi
callq 0x4e74
movq %rax, %rdi
callq 0x5976
movq %rax, %r14
movq %r15, %rdi
callq 0x4e74
movq %rax, %rdi
callq 0x597a
addq $0x4, %rax
addq $0x4, %r14
movw $0x1, %cx
pushq $0x1
popq %rdx
leaq 0x3438(%rip), %rsi      # 0x98b0
cmpq $0x5a0, %rdx            # imm = 0x5A0
je 0x64d2
xorl %edi, %edi
cmpq $0x4, %rdi
je 0x64c1
movzwl %cx, %ecx
movb (%r14,%rdi), %r8b
xorb %cl, %r8b
movb %r8b, (%rbx,%rdi)
movb (%rax,%rdi), %r8b
movb %r8b, 0x167c(%rbx,%rdi)
movl %ecx, %r8d
andl $0x1ff, %r8d            # imm = 0x1FF
movzbl (%r8,%rsi), %r8d
shll $0x7, %r8d
shrl $0x8, %ecx
orl %r8d, %ecx
incq %rdi
jmp 0x6483
incq %rdx
addq $0x4, %rbx
addq $0x4, %rax
addq $0x4, %r14
jmp 0x6478
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/ke6jjj[P]r-dat/File.cc
// Function: File::Open(char const*, unsigned long)
bool
File::Open(const char *path, size_t quanta)
{
  mFd = ::open(path, O_RDONLY);
  if (mFd == -1)
    return false;

  mOpen = true;
  Reset(quanta);

  return true;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdx, %rbx
movq %rdi, %r14
movq %rsi, %rdi
xorl %esi, %esi
xorl %eax, %eax
callq 0x20b0
movl %eax, %ebp
movl %eax, 0x4(%r14)
cmpl $-0x1, %eax
je 0x6580
movb $0x1, (%r14)
movq %r14, %rdi
movq %rbx, %rsi
callq 0x658c
cmpl $-0x1, %ebp
setne %al
popq %rbx
popq %r14
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/ke6jjj[P]r-dat/File.cc
// Function: File::Reset(unsigned long)
void
File::Reset(size_t quanta)
{
  delete mResidual;
  mQuanta = quanta;
  mResidual = new char[mQuanta];
  mResidualCount = 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq 0x8(%rdi), %rdi
pushq $0x1
popq %rsi
callq 0x20f0
movq %rbx, 0x10(%r14)
movq %rbx, %rdi
callq 0x2030
movq %rax, 0x8(%r14)
andq $0x0, 0x18(%r14)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/ke6jjj[P]r-dat/File.cc
// Function: File::Open(int, unsigned long)
bool
File::Open(int fd, size_t quanta)
{
  mFd = fd;
  if (mFd == -1)
    return false;

  mOpen = true;
  Reset(quanta);

  return true;
}

// Assembly:
pushq %rbx
movl %esi, %ebx
movl %esi, 0x4(%rdi)
cmpl $-0x1, %esi
je 0x65d6
movb $0x1, (%rdi)
movq %rdx, %rsi
callq 0x658c
cmpl $-0x1, %ebx
setne %al
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/ke6jjj[P]r-dat/File.cc
// Function: File::Read(void*, unsigned long)
size_t
File::Read(void *buf, size_t count)
{
  char *cbuf = (char *) buf;

  if (!mOpen)
    return 0;

  if (count == 0)
    return 0;
  
  size_t total = count * mQuanta;

  //
  // Copy in any residual data first.
  //
  if (mResidualCount > 0) {
    memcpy(cbuf, mResidual, mResidualCount);
    total -= mResidualCount;
  }

  size_t pos = mResidualCount;

  while (total > 0) {
    int nread = ::read(mFd, &cbuf[pos], total);
    if (nread == -1 || nread == 0) {
      //
      // Some sort of error occurred. Probably a signal.
      //
      break;
    }
    total -= nread;
    pos += nread;
  }

  //
  // Is there any residual data?
  //
  size_t residue = pos % mQuanta;
  if (residue != 0) {
    memcpy(mResidual, &cbuf[pos - residue], residue);
    pos -= residue;
  }

  mResidualCount = residue;

  return pos / mQuanta;
}

// Assembly:
xorl %eax, %eax
testq %rdx, %rdx
je 0x6693
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpb $0x0, (%rdi)
je 0x6688
movq %rdx, %r15
movq %rsi, %r14
imulq 0x10(%rbx), %r15
movq 0x18(%rbx), %rdx
testq %rdx, %rdx
je 0x6626
movq 0x8(%rbx), %rsi
movq %r14, %rdi
callq 0x20c0
movq 0x18(%rbx), %rcx
subq %rcx, %r15
jmp 0x6628
xorl %ecx, %ecx
movq %rcx, %r12
testq %r15, %r15
je 0x664f
movl 0x4(%rbx), %edi
leaq (%r14,%r12), %rsi
movq %r15, %rdx
callq 0x21a0
movslq %eax, %rcx
incl %eax
subq %rcx, %r15
addq %r12, %rcx
cmpl $0x1, %eax
ja 0x6628
movq 0x10(%rbx), %rcx
movq %r12, %rax
xorl %edx, %edx
divq %rcx
movq %rdx, %r15
testq %rdx, %rdx
je 0x667c
movq 0x8(%rbx), %rdi
subq %r15, %r12
addq %r12, %r14
movq %r14, %rsi
movq %r15, %rdx
callq 0x20c0
movq 0x10(%rbx), %rcx
movq %r15, 0x18(%rbx)
movq %r12, %rax
xorl %edx, %edx
divq %rcx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/ke6jjj[P]r-dat/BasicGroup.cc
// Function: BasicGroup::BasicGroup(unsigned int)
BasicGroup::BasicGroup(uint32_t id)
  : mBasicGroupID(id)
{
  for (size_t i = 0; i < kSize; i++) {
    mData[i] = 0;
    mDataIsValid[i] = false;
  }
  
  for (size_t i = 0; i < DDSGroup1::kSize; i++) {
    mECCData[i] = 0;
    mECCDataIsValid[i] = false;
  }
}

// Assembly:
movl %esi, (%rdi)
movq $-0x1eea8, %rax         # imm = 0xFFFE1158
xorl %ecx, %ecx
testq %rax, %rax
je 0x66c3
movb %cl, 0x1eeac(%rdi,%rax)
movb %cl, 0x3dd54(%rdi,%rax)
incq %rax
jmp 0x66ab
movq $-0x167c, %rax          # imm = 0xE984
xorl %ecx, %ecx
testq %rax, %rax
je 0x66e4
movb %cl, 0x3f3d0(%rdi,%rax)
movb %cl, 0x40a4c(%rdi,%rax)
incq %rax
jmp 0x66cc
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/ke6jjj[P]r-dat/BasicGroup.cc
// Function: BasicGroup::Correct()
bool
BasicGroup::Correct()
{
  ECC_C3 C3;
  size_t uncorrectableErrors = 0;
  
  for (ECCFill_C3 c3_fill(*this); !c3_fill.End(); c3_fill.Next()) {
    //
    // Fill the error check vector.
    //      
    C3.Fill(c3_fill);

    //
    // Detect errors in this vector and correct them.
    //
    ECC_C3::Status ok = C3.Correct();
    switch (ok) {
    case ECC_C3::NO_ERRORS:
      //
      // No errors. Nothing to be done.
      //
      break;
    case ECC_C3::CORRECTED:
      //
      // There were errors but they were corrected.
      // Put the corrected data back into the track.
      //
      C3.Dump(c3_fill);
      break;
    case ECC_C3::UNCORRECTABLE:
      //
      // Slice was uncorrectable. Leave it as is.
      //
      uncorrectableErrors++;
      break;
    }
  }
  
  return uncorrectableErrors == 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0xa0, %rsp
movq %rdi, %rbx
leaq 0xc(%rsp), %rdi
callq 0x6db4
leaq 0x68(%rsp), %rdi
movq %rbx, %rsi
callq 0x6c4c
xorl %r15d, %r15d
leaq 0x68(%rsp), %rbx
leaq 0xc(%rsp), %r14
movq %rbx, %rdi
callq 0x6cf4
testb %al, %al
jne 0x6bd2
movq %r14, %rdi
movq %rbx, %rsi
callq 0x6db8
movq %r14, %rdi
callq 0x6e70
cmpl $0x1, %eax
je 0x6bbd
cmpl $0x2, %eax
jne 0x6bc8
incq %r15
jmp 0x6bc8
movq %r14, %rdi
movq %rbx, %rsi
callq 0x7048
movq %rbx, %rdi
callq 0x6ca2
jmp 0x6b8f
testq %r15, %r15
sete %bl
leaq 0xc(%rsp), %rdi
callq 0x6db6
movl %ebx, %eax
addq $0xa0, %rsp
popq %rbx
popq %r14
popq %r15
retq
jmp 0x6bf5
jmp 0x6bf5
movq %rax, %rbx
leaq 0xc(%rsp), %rdi
callq 0x6db6
movq %rbx, %rdi
callq 0x21e0
// File: /workspace/github_cpp_makefile_star2_O2/ke6jjj[P]r-dat/ECCFill_C3.cc
// Function: ECCFill_C3::Data(unsigned long)
uint8_t&
ECCFill_C3::Data(size_t position)
{
  bool isECC;
  const size_t offset = compute_offset(position, mByteSlice, mTrackPair,
    mInterleaveSet, isECC);
  
  if (!isECC)
    return mData[offset];
  else
    return mECCData[offset];
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rax
movq %rdi, %rbx
movl 0x28(%rdi), %esi
movl 0x2c(%rdi), %edx
movl 0x30(%rdi), %ecx
leaq 0x7(%rsp), %r14
movq %rax, %rdi
movq %r14, %r8
callq 0x6d37
movzbl (%r14), %ecx
shll $0x4, %ecx
addq 0x8(%rbx,%rcx), %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/ke6jjj[P]r-dat/ECCFill_C3.cc
// Function: ECCFill_C3::Valid(unsigned long)
bool&
ECCFill_C3::Valid(size_t position)
{
  bool isECC;
  const size_t offset = compute_offset(position, mByteSlice, mTrackPair,
    mInterleaveSet, isECC);

  if (!isECC)
    return mDataIsValid[offset];
  else
    return mECCDataIsValid[offset];
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rax
movq %rdi, %rbx
movl 0x28(%rdi), %esi
movl 0x2c(%rdi), %edx
movl 0x30(%rdi), %ecx
leaq 0x7(%rsp), %r14
movq %rax, %rdi
movq %r14, %r8
callq 0x6d37
movzbl (%r14), %ecx
shll $0x4, %ecx
addq 0x10(%rcx,%rbx), %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/ke6jjj[P]r-dat/ECC_C3.cc
// Function: ECC_C3::ComputeSyndrome(unsigned char*)
bool
ECC_C3::ComputeSyndrome(uint8_t syndrome[ECC_C3::kTwoT])
{
  //
  // Multiply the filled in vector by the check matrix to produce a
  // result vector.
  //
  bool ok = true;
  for (size_t i = 0; i < kTwoT; i++) {
    uint8_t result = 0;
    for (size_t j = 0; j < kN; j++) {
      result ^= ECC_GF28_multiply(mData[j], gHi[i][j]);
    }

    syndrome[i] = result;

    //
    // Everything is ok if all previous entries are zero and this
    // entry is zero.
    //
    ok = ok && result == 0;
  }

  return ok;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, (%rsp)
movq %rdi, %r15
movb $0x1, %bl
leaq 0x2d49(%rip), %r12      # 0x9b60
xorl %r13d, %r13d
cmpq $0x2, %r13
je 0x6e5b
xorl %ebp, %ebp
xorl %r14d, %r14d
cmpq $0x2e, %r14
je 0x6e42
movzbl (%r15,%r14), %edi
movzbl (%r12,%r14), %esi
callq 0x59b4
xorb %al, %bpl
incq %r14
jmp 0x6e25
movq (%rsp), %rax
movb %bpl, (%rax,%r13)
testb %bpl, %bpl
sete %al
andb %al, %bl
incq %r13
addq $0x2e, %r12
jmp 0x6e1a
andb $0x1, %bl
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/ke6jjj[P]r-dat/XDR.cc
// Function: XDR::AddString(char const*, unsigned long)
bool
XDR::AddString(const char *str, size_t len)
{
  if (!SizeCheck(len))
    return false;
  
  memcpy(&mData[mPosition], str, len);
  mPosition += len;
  
  return true;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r14
movq (%rdi), %r15
movq 0x8(%rdi), %rdi
leaq (%rdi,%rdx), %r12
cmpq %r15, %r12
ja 0x7465
movq %rdx, %rbx
addq 0x10(%r14), %rdi
callq 0x20c0
addq %rbx, 0x8(%r14)
cmpq %r15, %r12
setbe %al
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/ke6jjj[P]r-dat/XDR.cc
// Function: XDR::AddU16(unsigned short)
bool
XDR::AddU16(uint16_t i)
{
  if (!SizeCheck(2))
    return false;
  
  mData[mPosition] = (i & 0xff);
  mData[mPosition+1] = (i >> 8) & 0xff;
  mPosition += 2;
  
  return true;
}

// Assembly:
movl %esi, %ecx
movq (%rdi), %rax
movq 0x8(%rdi), %rsi
leaq 0x2(%rsi), %rdx
cmpq %rax, %rdx
ja 0x74e5
pushq %rbx
movq 0x10(%rdi), %r8
movb %cl, (%r8,%rsi)
movq 0x8(%rdi), %rsi
movq 0x10(%rdi), %rbx
movb %ch, 0x1(%rbx,%rsi)
addq $0x2, 0x8(%rdi)
popq %rbx
cmpq %rax, %rdx
setbe %al
retq
// File: /workspace/github_cpp_makefile_star2_O2/ke6jjj[P]r-dat/TimeCode.cc
// Function: TimeCode::TimeCode(unsigned char const*)
TimeCode::TimeCode(const uint8_t *item)
{
  uint8_t pno1 = item[0] & 0x7;
  uint8_t pno23 = item[1];
  
  //
  // Process the program number bits. Certain patterns are
  // special.
  //
  switch (pno23) {
  case 0xaa:
    mProgramId = PROGRAM_NOT_VALID;
    break;
  case 0xbb:
    mProgramId = PROGRAM_LEAD_IN;
    break;
  case 0xee:
    mProgramId = PROGRAM_LEAD_OUT;
    break;
  default:
    mProgramId = ((uint16_t) BCDDecode(pno23)) + 100 * pno1;
    break;
  }
  
  //
  // Process the index id bits.
  //
  uint8_t index_id = item[2];
  if (index_id == 0xaa)
    mIndexId = INDEX_NOT_VALID;
  else
    mIndexId = BCDDecode(item[2]);
  
  mHour = BCDDecode(item[3]);
  mMinute = BCDDecode(item[4]);
  mSecond = BCDDecode(item[5]);
  mFrame = BCDDecode(item[6]);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
movzbl 0x1(%rsi), %eax
cmpl $0xaa, %eax
je 0x75df
cmpl $0xee, %eax
je 0x75d9
cmpl $0xbb, %eax
jne 0x75e5
movw $0x80bb, %ax            # imm = 0x80BB
jmp 0x75fc
movw $0x80ee, %ax            # imm = 0x80EE
jmp 0x75fc
movw $0x80aa, %ax            # imm = 0x80AA
jmp 0x75fc
movzbl (%r14), %ebp
andl $0x7, %ebp
movzwl %ax, %edi
callq 0x7710
movzbl %al, %ecx
imull $0x64, %ebp, %eax
addl %ecx, %eax
movw %ax, (%rbx)
movzbl 0x2(%r14), %ecx
movb $-0x56, %al
cmpw $0xaa, %cx
je 0x7615
movzwl %cx, %edi
callq 0x7710
movb %al, 0x2(%rbx)
movzbl 0x3(%r14), %edi
callq 0x7710
movb %al, 0x3(%rbx)
movzbl 0x4(%r14), %edi
callq 0x7710
movb %al, 0x4(%rbx)
movzbl 0x5(%r14), %edi
callq 0x7710
movb %al, 0x5(%rbx)
movzbl 0x6(%r14), %edi
callq 0x7710
movb %al, 0x6(%rbx)
popq %rbx
popq %r14
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/ke6jjj[P]r-dat/TimeCode.cc
// Function: TimeCode::TimeCode(unsigned int)
TimeCode::TimeCode(uint32_t absoluteFrame)
  : mIndexId(INDEX_NOT_VALID), mProgramId(PROGRAM_NOT_VALID)
{
  //
  // There are 120000 frames an hour.
  //
  mHour = absoluteFrame / 120000;
  absoluteFrame %= 120000;
  
  //
  // There are 2000 frames every minute.
  //
  mMinute = absoluteFrame / 2000;
  absoluteFrame %= 2000;
  
  //
  // There are 100 frames every three seconds.
  //
  uint8_t second = (absoluteFrame / 100) * 3;
  absoluteFrame %= 100;
  second += absoluteFrame / 33;
  uint8_t frame = absoluteFrame % 33;
  second -= absoluteFrame / 99;
  frame += (absoluteFrame / 99) * 33;
  mSecond = second;
  mFrame = frame;
}

// Assembly:
pushq %rbx
movl %esi, %eax
movl $0x1d4c0, %ecx          # imm = 0x1D4C0
xorl %edx, %edx
divl %ecx
movl %eax, %ecx
movl %edx, %eax
movl $0x7d0, %esi            # imm = 0x7D0
xorl %edx, %edx
divl %esi
movl %eax, %esi
movl %edx, %eax
movw $0x64, %r8w
xorl %edx, %edx
divw %r8w
movl %eax, %r8d
movzbl %dl, %eax
movb $0x21, %r9b
divb %r9b
xorl %r9d, %r9d
leal (%r8,%r8,2), %r8d
addb %r8b, %al
cmpw $0x63, %dx
adcb $-0x1, %al
movzbl %ah, %ebx
cmpw $0x63, %dx
movw $0x80aa, (%rdi)         # imm = 0x80AA
movb $-0x56, 0x2(%rdi)
movb %cl, 0x3(%rdi)
movl $0x21, %ecx
cmovbl %r9d, %ecx
movb %sil, 0x4(%rdi)
addb %bl, %cl
movb %al, 0x5(%rdi)
movb %cl, 0x6(%rdi)
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/ke6jjj[P]r-dat/DifferentialClockDetector.cc
// Function: DifferentialClockDetector::Reset()
void
DifferentialClockDetector::Reset()
{
  mLastSample = 0.0;
  mMaximumDiffPos = 0;
  mNextSyncPos = FirePosition(mMaximumDiffPos, mWindowSize);
  mDetected = false;
  mCurrentPos = 0;
  for (size_t i = 0; i < mWindowSize; i++)
    mWindow[i] = 0.0;
}

// Assembly:
andl $0x0, 0x18(%rdi)
andq $0x0, 0x20(%rdi)
movq (%rdi), %rcx
movq 0x10(%rdi), %rsi
leaq -0x1(%rcx), %rax
shrq %rax
xorl %r8d, %r8d
xorl %edx, %edx
divq %rcx
movq %rdx, 0x30(%rdi)
movb $0x0, 0x1c(%rdi)
andq $0x0, 0x38(%rdi)
cmpq %r8, %rcx
je 0x77ab
andl $0x0, (%rsi,%r8,4)
incq %r8
jmp 0x779c
retq