// File: sisong[P]ApkDiffPatch/lzma/C/LzFind.c
// Function: Bt3_MatchFinder_GetMatches
static UInt32* Bt3_MatchFinder_GetMatches(void *_p, UInt32 *distances)
{
  CMatchFinder *p = (CMatchFinder *)_p;
  UInt32 mmm;
  UInt32 h2, d2, pos;
  unsigned maxLen;
  UInt32 *hash;
  GET_MATCHES_HEADER(3)

  HASH3_CALC

  hash = p->hash;
  pos = p->pos;

  d2 = pos - hash[h2];

  curMatch = (hash + kFix3HashSize)[hv];
  
  hash[h2] = pos;
  (hash + kFix3HashSize)[hv] = pos;

  SET_mmm

  maxLen = 2;

  if (d2 < mmm && *(cur - d2) == *cur)
  {
    UPDATE_maxLen
    distances[0] = (UInt32)maxLen;
    distances[1] = d2 - 1;
    distances += 2;
    if (maxLen == lenLimit)
    {
      SkipMatchesSpec(MF_PARAMS(p));
      MOVE_POS_RET
    }
  }
  
  GET_MATCHES_FOOTER_BT(maxLen)
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0x138, %rsp            # imm = 0x138
movq %rdi, -0x98(%rbp)
movq %rsi, -0xa0(%rbp)
movq -0x98(%rbp), %rax
movq %rax, -0xa8(%rbp)
movq -0xa8(%rbp), %rax
movl 0x14(%rax), %eax
movl %eax, -0xe0(%rbp)
cmpl $0x3, -0xe0(%rbp)
jae 0x72b70
movq -0xa8(%rbp), %rdi
callq 0x707d0
movq -0xa0(%rbp), %rax
movq %rax, -0x90(%rbp)
jmp 0x73269
movq -0xa8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0xd8(%rbp)
movq -0xa8(%rbp), %rax
movq -0xd8(%rbp), %rcx
movzbl (%rcx), %ecx
movl 0x78(%rax,%rcx,4), %eax
movq -0xd8(%rbp), %rcx
movzbl 0x1(%rcx), %ecx
xorl %ecx, %eax
movl %eax, -0xe4(%rbp)
movl -0xe4(%rbp), %eax
andl $0x3ff, %eax            # imm = 0x3FF
movl %eax, -0xb0(%rbp)
movl -0xe4(%rbp), %eax
movq -0xd8(%rbp), %rcx
movzbl 0x2(%rcx), %ecx
shll $0x8, %ecx
xorl %ecx, %eax
movq -0xa8(%rbp), %rcx
andl 0x38(%rcx), %eax
movl %eax, -0xcc(%rbp)
movq -0xa8(%rbp), %rax
movq 0x28(%rax), %rax
movq %rax, -0xc8(%rbp)
movq -0xa8(%rbp), %rax
movl 0x8(%rax), %eax
movl %eax, -0xb8(%rbp)
movl -0xb8(%rbp), %eax
movq -0xc8(%rbp), %rcx
movl -0xb0(%rbp), %edx
subl (%rcx,%rdx,4), %eax
movl %eax, -0xb4(%rbp)
movq -0xc8(%rbp), %rax
movl -0xcc(%rbp), %ecx
movl 0x1000(%rax,%rcx,4), %eax
movl %eax, -0xdc(%rbp)
movl -0xb8(%rbp), %edx
movq -0xc8(%rbp), %rax
movl -0xb0(%rbp), %ecx
movl %edx, (%rax,%rcx,4)
movl -0xb8(%rbp), %edx
movq -0xc8(%rbp), %rax
movl -0xcc(%rbp), %ecx
movl %edx, 0x1000(%rax,%rcx,4)
movq -0xa8(%rbp), %rax
movl 0x1c(%rax), %eax
movl %eax, -0xac(%rbp)
movl -0xb8(%rbp), %eax
cmpl -0xac(%rbp), %eax
jae 0x72c92
movl -0xb8(%rbp), %eax
movl %eax, -0xac(%rbp)
movl $0x2, -0xbc(%rbp)
movl -0xb4(%rbp), %eax
cmpl -0xac(%rbp), %eax
jae 0x72e90
movq -0xd8(%rbp), %rax
movl -0xb4(%rbp), %ecx
movl %ecx, %edx
xorl %ecx, %ecx
subq %rdx, %rcx
movzbl (%rax,%rcx), %eax
movq -0xd8(%rbp), %rcx
movzbl (%rcx), %ecx
cmpl %ecx, %eax
jne 0x72e90
movl -0xb4(%rbp), %eax
movl %eax, %ecx
xorl %eax, %eax
subq %rcx, %rax
movq %rax, -0xf0(%rbp)
movq -0xd8(%rbp), %rax
movl -0xbc(%rbp), %ecx
addq %rcx, %rax
movq %rax, -0xf8(%rbp)
movq -0xd8(%rbp), %rax
movl -0xe0(%rbp), %ecx
addq %rcx, %rax
movq %rax, -0x100(%rbp)
movq -0xf8(%rbp), %rax
cmpq -0x100(%rbp), %rax
je 0x72d62
movq -0xf8(%rbp), %rax
movq -0xf0(%rbp), %rcx
movzbl (%rax,%rcx), %eax
movq -0xf8(%rbp), %rcx
movzbl (%rcx), %ecx
cmpl %ecx, %eax
je 0x72d4c
jmp 0x72d62
jmp 0x72d4e
movq -0xf8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0xf8(%rbp)
jmp 0x72d1a
movq -0xf8(%rbp), %rax
movq -0xd8(%rbp), %rcx
subq %rcx, %rax
movl %eax, -0xbc(%rbp)
movl -0xbc(%rbp), %ecx
movq -0xa0(%rbp), %rax
movl %ecx, (%rax)
movl -0xb4(%rbp), %ecx
subl $0x1, %ecx
movq -0xa0(%rbp), %rax
movl %ecx, 0x4(%rax)
movq -0xa0(%rbp), %rax
addq $0x8, %rax
movq %rax, -0xa0(%rbp)
movl -0xbc(%rbp), %eax
cmpl -0xe0(%rbp), %eax
jne 0x72e8e
movl -0xe0(%rbp), %edi
movl -0xdc(%rbp), %esi
movq -0xa8(%rbp), %rax
movl 0x8(%rax), %edx
movq -0xa8(%rbp), %rax
movq (%rax), %rcx
movq -0xa8(%rbp), %rax
movq 0x30(%rax), %r8
movq -0xa8(%rbp), %rax
movl 0x18(%rax), %eax
movl %eax, %r9d
movq -0xa8(%rbp), %rax
movl 0x1c(%rax), %r10d
movq -0xa8(%rbp), %rax
movl 0x3c(%rax), %eax
movl %r10d, (%rsp)
movl %eax, 0x8(%rsp)
callq 0x70db0
movq -0xa8(%rbp), %rax
movl 0x18(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x18(%rax)
movq -0xa8(%rbp), %rax
movq (%rax), %rcx
addq $0x1, %rcx
movq %rcx, (%rax)
movq -0xa8(%rbp), %rax
movl 0x8(%rax), %eax
addl $0x1, %eax
movl %eax, -0x104(%rbp)
movl -0x104(%rbp), %ecx
movq -0xa8(%rbp), %rax
movl %ecx, 0x8(%rax)
movl -0x104(%rbp), %eax
movq -0xa8(%rbp), %rcx
cmpl 0xc(%rcx), %eax
jne 0x72e7b
movq -0xa8(%rbp), %rdi
callq 0x70830
movq -0xa0(%rbp), %rax
movq %rax, -0x90(%rbp)
jmp 0x73269
jmp 0x72e90
movl -0xe0(%rbp), %ebx
movl -0xdc(%rbp), %r11d
movq -0xa8(%rbp), %rax
movl 0x8(%rax), %r10d
movq -0xa8(%rbp), %rax
movq (%rax), %r9
movq -0xa8(%rbp), %rax
movq 0x30(%rax), %r8
movq -0xa8(%rbp), %rax
movl 0x18(%rax), %eax
movl %eax, %edi
movq -0xa8(%rbp), %rax
movl 0x1c(%rax), %esi
movq -0xa8(%rbp), %rax
movl 0x3c(%rax), %edx
movq -0xa0(%rbp), %rcx
movl -0xbc(%rbp), %eax
movl %ebx, -0x14(%rbp)
movl %r11d, -0x18(%rbp)
movl %r10d, -0x1c(%rbp)
movq %r9, -0x28(%rbp)
movq %r8, -0x30(%rbp)
movq %rdi, -0x38(%rbp)
movl %esi, -0x3c(%rbp)
movl %edx, -0x40(%rbp)
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
movq -0x30(%rbp), %rax
movq -0x38(%rbp), %rcx
shlq %rcx
shlq $0x2, %rcx
addq %rcx, %rax
addq $0x4, %rax
movq %rax, -0x58(%rbp)
movq -0x30(%rbp), %rax
movq -0x38(%rbp), %rcx
shlq %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq %rax, -0x60(%rbp)
movl $0x0, -0x64(%rbp)
movl $0x0, -0x68(%rbp)
movl -0x1c(%rbp), %eax
subl -0x3c(%rbp), %eax
movl %eax, -0x6c(%rbp)
movl -0x1c(%rbp), %eax
cmpl -0x3c(%rbp), %eax
ja 0x72f64
movl $0x0, -0x6c(%rbp)
movl -0x6c(%rbp), %eax
cmpl -0x18(%rbp), %eax
jae 0x731d2
jmp 0x72f72
movl -0x1c(%rbp), %eax
subl -0x18(%rbp), %eax
movl %eax, -0x70(%rbp)
movq -0x30(%rbp), %rax
movq %rax, -0x118(%rbp)
movq -0x38(%rbp), %rax
movl -0x70(%rbp), %ecx
subq %rcx, %rax
movq %rax, -0x110(%rbp)
movl -0x70(%rbp), %eax
cmpq -0x38(%rbp), %rax
jbe 0x72fab
movl -0x3c(%rbp), %eax
movl %eax, -0x11c(%rbp)
jmp 0x72fb5
xorl %eax, %eax
movl %eax, -0x11c(%rbp)
jmp 0x72fb5
movq -0x118(%rbp), %rax
movq -0x110(%rbp), %rcx
movl -0x11c(%rbp), %edx
movl %edx, %edx
addq %rdx, %rcx
shlq %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq %rax, -0x78(%rbp)
movq -0x28(%rbp), %rax
movl -0x70(%rbp), %ecx
movl %ecx, %edx
xorl %ecx, %ecx
subq %rdx, %rcx
addq %rcx, %rax
movq %rax, -0x80(%rbp)
movl -0x64(%rbp), %eax
cmpl -0x68(%rbp), %eax
jae 0x73004
movl -0x64(%rbp), %eax
movl %eax, -0x120(%rbp)
jmp 0x7300d
movl -0x68(%rbp), %eax
movl %eax, -0x120(%rbp)
movl -0x120(%rbp), %eax
movl %eax, -0x84(%rbp)
movq -0x78(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x88(%rbp)
movq -0x80(%rbp), %rax
movl -0x84(%rbp), %ecx
movzbl (%rax,%rcx), %eax
movq -0x28(%rbp), %rcx
movl -0x84(%rbp), %edx
movzbl (%rcx,%rdx), %ecx
cmpl %ecx, %eax
jne 0x73130
movl -0x84(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x84(%rbp)
cmpl -0x14(%rbp), %eax
je 0x730b9
movq -0x80(%rbp), %rax
movl -0x84(%rbp), %ecx
movzbl (%rax,%rcx), %eax
movq -0x28(%rbp), %rcx
movl -0x84(%rbp), %edx
movzbl (%rcx,%rdx), %ecx
cmpl %ecx, %eax
jne 0x730b9
jmp 0x7307f
movl -0x84(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x84(%rbp)
cmpl -0x14(%rbp), %eax
je 0x730b7
movq -0x80(%rbp), %rax
movl -0x84(%rbp), %ecx
movzbl (%rax,%rcx), %eax
movq -0x28(%rbp), %rcx
movl -0x84(%rbp), %edx
movzbl (%rcx,%rdx), %ecx
cmpl %ecx, %eax
je 0x730b5
jmp 0x730b7
jmp 0x7307f
jmp 0x730b9
movl -0x4c(%rbp), %eax
cmpl -0x84(%rbp), %eax
jae 0x7312e
movl -0x84(%rbp), %eax
movl %eax, -0x4c(%rbp)
movl -0x84(%rbp), %ecx
movq -0x48(%rbp), %rax
movq %rax, %rdx
addq $0x4, %rdx
movq %rdx, -0x48(%rbp)
movl %ecx, (%rax)
movl -0x70(%rbp), %ecx
subl $0x1, %ecx
movq -0x48(%rbp), %rax
movq %rax, %rdx
addq $0x4, %rdx
movq %rdx, -0x48(%rbp)
movl %ecx, (%rax)
movl -0x84(%rbp), %eax
cmpl -0x14(%rbp), %eax
jne 0x7312c
movl -0x88(%rbp), %ecx
movq -0x60(%rbp), %rax
movl %ecx, (%rax)
movq -0x78(%rbp), %rax
movl 0x4(%rax), %ecx
movq -0x58(%rbp), %rax
movl %ecx, (%rax)
movq -0x48(%rbp), %rax
movq %rax, -0x10(%rbp)
jmp 0x731ee
jmp 0x7312e
jmp 0x73130
movq -0x80(%rbp), %rax
movl -0x84(%rbp), %ecx
movzbl (%rax,%rcx), %eax
movq -0x28(%rbp), %rcx
movl -0x84(%rbp), %edx
movzbl (%rcx,%rdx), %ecx
cmpl %ecx, %eax
jge 0x7317a
movl -0x18(%rbp), %ecx
movq -0x60(%rbp), %rax
movl %ecx, (%rax)
movq -0x78(%rbp), %rax
movl 0x4(%rax), %eax
movl %eax, -0x18(%rbp)
movq -0x78(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x60(%rbp)
movl -0x84(%rbp), %eax
movl %eax, -0x68(%rbp)
jmp 0x7319d
movl -0x18(%rbp), %ecx
movq -0x58(%rbp), %rax
movl %ecx, (%rax)
movq -0x78(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x18(%rbp)
movq -0x78(%rbp), %rax
movq %rax, -0x58(%rbp)
movl -0x84(%rbp), %eax
movl %eax, -0x64(%rbp)
movl -0x40(%rbp), %ecx
addl $-0x1, %ecx
movl %ecx, -0x40(%rbp)
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0x121(%rbp)
je 0x731c2
movl -0x6c(%rbp), %eax
cmpl -0x18(%rbp), %eax
setb %al
movb %al, -0x121(%rbp)
movb -0x121(%rbp), %al
testb $0x1, %al
jne 0x72f72
jmp 0x731d2
movq -0x60(%rbp), %rax
movl $0x0, (%rax)
movq -0x58(%rbp), %rax
movl $0x0, (%rax)
movq -0x48(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0xa0(%rbp)
movq -0xa8(%rbp), %rax
movl 0x18(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x18(%rax)
movq -0xa8(%rbp), %rax
movq (%rax), %rcx
addq $0x1, %rcx
movq %rcx, (%rax)
movq -0xa8(%rbp), %rax
movl 0x8(%rax), %eax
addl $0x1, %eax
movl %eax, -0x108(%rbp)
movl -0x108(%rbp), %ecx
movq -0xa8(%rbp), %rax
movl %ecx, 0x8(%rax)
movl -0x108(%rbp), %eax
movq -0xa8(%rbp), %rcx
cmpl 0xc(%rcx), %eax
jne 0x7325b
movq -0xa8(%rbp), %rdi
callq 0x70830
movq -0xa0(%rbp), %rax
movq %rax, -0x90(%rbp)
movq -0x90(%rbp), %rax
addq $0x138, %rsp            # imm = 0x138
popq %rbx
popq %rbp
retq
nopw (%rax,%rax)