// File: sisong[P]ApkDiffPatch/lzma/C/LzFindMt.c
// Function: MixMatches3
static UInt32 * MixMatches3(CMatchFinderMt *p, UInt32 matchMinPos, UInt32 *d)
{
  UInt32 h2, h3, c2, c3;
  UInt32 *hash = p->hash;
  const Byte *cur = p->pointerToCurPos;
  const UInt32 m = p->lzPos;
  MT_HASH3_CALC

  c2 = hash[h2];
  c3 = (hash + kFix3HashSize)[h3];
  
  hash[h2] = m;
  (hash + kFix3HashSize)[h3] = m;

  if (c2 >= matchMinPos)
  {
    CHECK_FAILURE_LZ(c2, m)
    if (cur[(ptrdiff_t)c2 - (ptrdiff_t)m] == cur[0])
    {
      d[1] = m - c2 - 1;
      if (cur[(ptrdiff_t)c2 - (ptrdiff_t)m + 2] == cur[2])
      {
        d[0] = 3;
        return d + 2;
      }
      d[0] = 2;
      d += 2;
    }
  }
  
  if (c3 >= matchMinPos)
  {
    CHECK_FAILURE_LZ(c3, m)
    if (cur[(ptrdiff_t)c3 - (ptrdiff_t)m] == cur[0])
    {
      *d++ = 3;
      *d++ = m - c3 - 1;
    }
  }
  
  return d;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
movq %rax, -0x38(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x40(%rbp)
movq -0x10(%rbp), %rax
movl 0x20(%rax), %eax
movl %eax, -0x44(%rbp)
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rax
movq -0x40(%rbp), %rcx
movzbl (%rcx), %ecx
movl (%rax,%rcx,4), %eax
movq -0x40(%rbp), %rcx
movzbl 0x1(%rcx), %ecx
xorl %ecx, %eax
movl %eax, -0x48(%rbp)
movl -0x48(%rbp), %eax
andl $0x3ff, %eax            # imm = 0x3FF
movl %eax, -0x24(%rbp)
movl -0x48(%rbp), %eax
movq -0x40(%rbp), %rcx
movzbl 0x2(%rcx), %ecx
shll $0x8, %ecx
xorl %ecx, %eax
andl $0xffff, %eax           # imm = 0xFFFF
movl %eax, -0x28(%rbp)
movq -0x38(%rbp), %rax
movl -0x24(%rbp), %ecx
movl (%rax,%rcx,4), %eax
movl %eax, -0x2c(%rbp)
movq -0x38(%rbp), %rax
movl -0x28(%rbp), %ecx
movl 0x1000(%rax,%rcx,4), %eax
movl %eax, -0x30(%rbp)
movl -0x44(%rbp), %edx
movq -0x38(%rbp), %rax
movl -0x24(%rbp), %ecx
movl %edx, (%rax,%rcx,4)
movl -0x44(%rbp), %edx
movq -0x38(%rbp), %rax
movl -0x28(%rbp), %ecx
movl %edx, 0x1000(%rax,%rcx,4)
movl -0x2c(%rbp), %eax
cmpl -0x14(%rbp), %eax
jb 0x76790
movq -0x40(%rbp), %rax
movl -0x2c(%rbp), %ecx
movl -0x44(%rbp), %edx
subq %rdx, %rcx
movzbl (%rax,%rcx), %eax
movq -0x40(%rbp), %rcx
movzbl (%rcx), %ecx
cmpl %ecx, %eax
jne 0x7678e
movl -0x44(%rbp), %ecx
subl -0x2c(%rbp), %ecx
subl $0x1, %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0x4(%rax)
movq -0x40(%rbp), %rax
movl -0x2c(%rbp), %ecx
movl -0x44(%rbp), %edx
subq %rdx, %rcx
movzbl 0x2(%rax,%rcx), %eax
movq -0x40(%rbp), %rcx
movzbl 0x2(%rcx), %ecx
cmpl %ecx, %eax
jne 0x76778
movq -0x20(%rbp), %rax
movl $0x3, (%rax)
movq -0x20(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x8(%rbp)
jmp 0x767ed
movq -0x20(%rbp), %rax
movl $0x2, (%rax)
movq -0x20(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x20(%rbp)
jmp 0x76790
movl -0x30(%rbp), %eax
cmpl -0x14(%rbp), %eax
jb 0x767e5
movq -0x40(%rbp), %rax
movl -0x30(%rbp), %ecx
movl -0x44(%rbp), %edx
subq %rdx, %rcx
movzbl (%rax,%rcx), %eax
movq -0x40(%rbp), %rcx
movzbl (%rcx), %ecx
cmpl %ecx, %eax
jne 0x767e3
movq -0x20(%rbp), %rax
movq %rax, %rcx
addq $0x4, %rcx
movq %rcx, -0x20(%rbp)
movl $0x3, (%rax)
movl -0x44(%rbp), %ecx
subl -0x30(%rbp), %ecx
subl $0x1, %ecx
movq -0x20(%rbp), %rax
movq %rax, %rdx
addq $0x4, %rdx
movq %rdx, -0x20(%rbp)
movl %ecx, (%rax)
jmp 0x767e5
movq -0x20(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
popq %rbp
retq
nopw %cs:(%rax,%rax)