// File: sisong[P]ApkDiffPatch/lzma/C/LzFindMt.c
// Function: MatchFinderMt_GetMatches
static UInt32 * MatchFinderMt_GetMatches(void *_p, UInt32 *d)
{
  CMatchFinderMt *p = (CMatchFinderMt *)_p;
  const UInt32 *bt = p->btBufPos;
  UInt32 len = *bt++;
  const UInt32 avail = p->btNumAvailBytes - 1;
  p->btNumAvailBytes = avail;
  p->btBufPos = bt + len;
  if (len == 0)
  {
    #define BT_HASH_BYTES_MAX 5
    if (avail >= (BT_HASH_BYTES_MAX - 1) - 1)
    {
      UInt32 m = p->lzPos;
      if (m > p->historySize)
        m -= p->historySize;
      else
        m = 1;
      d = p->MixMatchesFunc(p, m, d);
    }
  }
  else
  {
    /*
      first match pair from BinTree: (match_len, match_dist),
      (match_len >= numHashBytes).
      MixMatchesFunc() inserts only hash matches that are nearer than (match_dist)
    */
    d = p->MixMatchesFunc(p, p->lzPos - bt[1], d);
    // if (d) // check for failure
    do
    {
      const UInt32 v0 = bt[0];
      const UInt32 v1 = bt[1];
      bt += 2;
      d[0] = v0;
      d[1] = v1;
      d += 2;
    }
    while (len -= 2);
  }
  INCREASE_LZ_POS
  return d;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq %rax, %rcx
addq $0x4, %rcx
movq %rcx, -0x20(%rbp)
movl (%rax), %eax
movl %eax, -0x24(%rbp)
movq -0x18(%rbp), %rax
movl 0x24(%rax), %eax
subl $0x1, %eax
movl %eax, -0x28(%rbp)
movl -0x28(%rbp), %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x24(%rax)
movq -0x20(%rbp), %rcx
movl -0x24(%rbp), %eax
shlq $0x2, %rax
addq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x10(%rax)
cmpl $0x0, -0x24(%rbp)
jne 0x75eda
cmpl $0x3, -0x28(%rbp)
jb 0x75ed8
movq -0x18(%rbp), %rax
movl 0x20(%rax), %eax
movl %eax, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
movq -0x18(%rbp), %rcx
cmpl 0x34(%rcx), %eax
jbe 0x75eb8
movq -0x18(%rbp), %rax
movl 0x34(%rax), %ecx
movl -0x2c(%rbp), %eax
subl %ecx, %eax
movl %eax, -0x2c(%rbp)
jmp 0x75ebf
movl $0x1, -0x2c(%rbp)
movq -0x18(%rbp), %rax
movq 0x40(%rax), %rax
movq -0x18(%rbp), %rdi
movl -0x2c(%rbp), %esi
movq -0x10(%rbp), %rdx
callq *%rax
movq %rax, -0x10(%rbp)
jmp 0x75f4c
movq -0x18(%rbp), %rax
movq 0x40(%rax), %rax
movq -0x18(%rbp), %rdi
movq -0x18(%rbp), %rcx
movl 0x20(%rcx), %esi
movq -0x20(%rbp), %rcx
subl 0x4(%rcx), %esi
movq -0x10(%rbp), %rdx
callq *%rax
movq %rax, -0x10(%rbp)
movq -0x20(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x30(%rbp)
movq -0x20(%rbp), %rax
movl 0x4(%rax), %eax
movl %eax, -0x34(%rbp)
movq -0x20(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x20(%rbp)
movl -0x30(%rbp), %ecx
movq -0x10(%rbp), %rax
movl %ecx, (%rax)
movl -0x34(%rbp), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x4(%rax)
movq -0x10(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x10(%rbp)
movl -0x24(%rbp), %eax
subl $0x2, %eax
movl %eax, -0x24(%rbp)
cmpl $0x0, %eax
jne 0x75efe
jmp 0x75f4c
movq -0x18(%rbp), %rax
movl 0x20(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x20(%rax)
movq -0x18(%rbp), %rax
movq (%rax), %rcx
addq $0x1, %rcx
movq %rcx, (%rax)
movq -0x10(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)