// File: /workspace/github_c_makefile_star2_O0/wkoszek[P]mini_gzip/miniz.c
// Function: tdefl_find_match
static __forceinline void tdefl_find_match(tdefl_compressor *d, mz_uint lookahead_pos, mz_uint max_dist, mz_uint max_match_len, mz_uint *pMatch_dist, mz_uint *pMatch_len)

{
  mz_uint dist, pos = lookahead_pos & TDEFL_LZ_DICT_SIZE_MASK, match_len = *pMatch_len, probe_pos = pos, next_probe_pos, probe_len;
  mz_uint num_probes_left = d->m_max_probes[match_len >= 32];
  const mz_uint16 *s = (const mz_uint16*)(d->m_dict + pos), *p, *q;
  mz_uint16 c01 = TDEFL_READ_UNALIGNED_WORD(&d->m_dict[pos + match_len - 1]), s01 = TDEFL_READ_UNALIGNED_WORD(s);
  MZ_ASSERT(max_match_len <= TDEFL_MAX_MATCH_LEN); if (max_match_len <= match_len) return;
  for ( ; ; )
  {
    for ( ; ; )
    {
      if (--num_probes_left == 0) return;
      #define TDEFL_PROBE \
        next_probe_pos = d->m_next[probe_pos]; \
        if ((!next_probe_pos) || ((dist = (mz_uint16)(lookahead_pos - next_probe_pos)) > max_dist)) return; \
        probe_pos = next_probe_pos & TDEFL_LZ_DICT_SIZE_MASK; \
        if (TDEFL_READ_UNALIGNED_WORD(&d->m_dict[probe_pos + match_len - 1]) == c01) break;
      TDEFL_PROBE; TDEFL_PROBE; TDEFL_PROBE;
    }
    if (!dist) break; q = (const mz_uint16*)(d->m_dict + probe_pos); if (TDEFL_READ_UNALIGNED_WORD(q) != s01) continue; p = s; probe_len = 32;
    do { } while ( (TDEFL_READ_UNALIGNED_WORD(++p) == TDEFL_READ_UNALIGNED_WORD(++q)) && (TDEFL_READ_UNALIGNED_WORD(++p) == TDEFL_READ_UNALIGNED_WORD(++q)) &&
                   (TDEFL_READ_UNALIGNED_WORD(++p) == TDEFL_READ_UNALIGNED_WORD(++q)) && (TDEFL_READ_UNALIGNED_WORD(++p) == TDEFL_READ_UNALIGNED_WORD(++q)) && (--probe_len > 0) );
    if (!probe_len)
    {
      *pMatch_dist = dist; *pMatch_len = MZ_MIN(max_match_len, TDEFL_MAX_MATCH_LEN); break;
    }
    else if ((probe_len = ((mz_uint)(p - s) * 2) + (mz_uint)(*(const mz_uint8*)p == *(const mz_uint8*)q)) > match_len)
    {
      *pMatch_dist = dist; if ((*pMatch_len = match_len = MZ_MIN(max_match_len, probe_len)) == max_match_len) break;
      c01 = TDEFL_READ_UNALIGNED_WORD(&d->m_dict[pos + match_len - 1]);
    }
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movl %ecx, -0x14(%rbp)
movq %r8, -0x20(%rbp)
movq %r9, -0x28(%rbp)
movl -0xc(%rbp), %eax
andl $0x7fff, %eax           # imm = 0x7FFF
movl %eax, -0x30(%rbp)
movq -0x28(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x34(%rbp)
movl -0x30(%rbp), %eax
movl %eax, -0x38(%rbp)
movq -0x8(%rbp), %rax
cmpl $0x20, -0x34(%rbp)
setae %cl
andb $0x1, %cl
movzbl %cl, %ecx
movslq %ecx, %rcx
movl 0x14(%rax,%rcx,4), %eax
movl %eax, -0x44(%rbp)
movq -0x8(%rbp), %rax
addq $0xd0, %rax
movl -0x30(%rbp), %ecx
addq %rcx, %rax
movq %rax, -0x50(%rbp)
movq -0x8(%rbp), %rax
movl -0x30(%rbp), %ecx
addl -0x34(%rbp), %ecx
subl $0x1, %ecx
movl %ecx, %ecx
movw 0xd0(%rax,%rcx), %ax
movw %ax, -0x62(%rbp)
movq -0x50(%rbp), %rax
movw (%rax), %ax
movw %ax, -0x64(%rbp)
cmpl $0x102, -0x14(%rbp)     # imm = 0x102
ja 0x91f7
jmp 0x9216
leaq 0x3dbd(%rip), %rdi      # 0xcfbb
leaq 0x3c45(%rip), %rsi      # 0xce4a
movl $0x786, %edx            # imm = 0x786
leaq 0x3dcf(%rip), %rcx      # 0xcfe0
callq 0x1080
movl -0x14(%rbp), %eax
cmpl -0x34(%rbp), %eax
ja 0x9223
jmp 0x9530
jmp 0x9225
jmp 0x9227
movl -0x44(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x44(%rbp)
cmpl $0x0, %eax
jne 0x923a
jmp 0x9530
movq -0x8(%rbp), %rax
movl -0x38(%rbp), %ecx
movzwl 0x192b2(%rax,%rcx,2), %eax
movl %eax, -0x3c(%rbp)
cmpl $0x0, -0x3c(%rbp)
je 0x9263
movl -0xc(%rbp), %eax
subl -0x3c(%rbp), %eax
movzwl %ax, %eax
movl %eax, -0x2c(%rbp)
cmpl -0x10(%rbp), %eax
jbe 0x9268
jmp 0x9530
movl -0x3c(%rbp), %eax
andl $0x7fff, %eax           # imm = 0x7FFF
movl %eax, -0x38(%rbp)
movq -0x8(%rbp), %rax
movl -0x38(%rbp), %ecx
addl -0x34(%rbp), %ecx
subl $0x1, %ecx
movl %ecx, %ecx
movzwl 0xd0(%rax,%rcx), %eax
movzwl -0x62(%rbp), %ecx
cmpl %ecx, %eax
jne 0x9297
jmp 0x9350
movq -0x8(%rbp), %rax
movl -0x38(%rbp), %ecx
movzwl 0x192b2(%rax,%rcx,2), %eax
movl %eax, -0x3c(%rbp)
cmpl $0x0, -0x3c(%rbp)
je 0x92c0
movl -0xc(%rbp), %eax
subl -0x3c(%rbp), %eax
movzwl %ax, %eax
movl %eax, -0x2c(%rbp)
cmpl -0x10(%rbp), %eax
jbe 0x92c5
jmp 0x9530
movl -0x3c(%rbp), %eax
andl $0x7fff, %eax           # imm = 0x7FFF
movl %eax, -0x38(%rbp)
movq -0x8(%rbp), %rax
movl -0x38(%rbp), %ecx
addl -0x34(%rbp), %ecx
subl $0x1, %ecx
movl %ecx, %ecx
movzwl 0xd0(%rax,%rcx), %eax
movzwl -0x62(%rbp), %ecx
cmpl %ecx, %eax
jne 0x92f1
jmp 0x9350
movq -0x8(%rbp), %rax
movl -0x38(%rbp), %ecx
movzwl 0x192b2(%rax,%rcx,2), %eax
movl %eax, -0x3c(%rbp)
cmpl $0x0, -0x3c(%rbp)
je 0x931a
movl -0xc(%rbp), %eax
subl -0x3c(%rbp), %eax
movzwl %ax, %eax
movl %eax, -0x2c(%rbp)
cmpl -0x10(%rbp), %eax
jbe 0x931f
jmp 0x9530
movl -0x3c(%rbp), %eax
andl $0x7fff, %eax           # imm = 0x7FFF
movl %eax, -0x38(%rbp)
movq -0x8(%rbp), %rax
movl -0x38(%rbp), %ecx
addl -0x34(%rbp), %ecx
subl $0x1, %ecx
movl %ecx, %ecx
movzwl 0xd0(%rax,%rcx), %eax
movzwl -0x62(%rbp), %ecx
cmpl %ecx, %eax
jne 0x934b
jmp 0x9350
jmp 0x9227
cmpl $0x0, -0x2c(%rbp)
jne 0x935b
jmp 0x9530
movq -0x8(%rbp), %rax
addq $0xd0, %rax
movl -0x38(%rbp), %ecx
addq %rcx, %rax
movq %rax, -0x60(%rbp)
movq -0x60(%rbp), %rax
movzwl (%rax), %eax
movzwl -0x64(%rbp), %ecx
cmpl %ecx, %eax
je 0x9383
jmp 0x9225
movq -0x50(%rbp), %rax
movq %rax, -0x58(%rbp)
movl $0x20, -0x40(%rbp)
jmp 0x9394
movq -0x58(%rbp), %rax
movq %rax, %rcx
addq $0x2, %rcx
movq %rcx, -0x58(%rbp)
movzwl 0x2(%rax), %ecx
movq -0x60(%rbp), %rax
movq %rax, %rdx
addq $0x2, %rdx
movq %rdx, -0x60(%rbp)
movzwl 0x2(%rax), %edx
xorl %eax, %eax
cmpl %edx, %ecx
movb %al, -0x65(%rbp)
jne 0x9466
movq -0x58(%rbp), %rax
movq %rax, %rcx
addq $0x2, %rcx
movq %rcx, -0x58(%rbp)
movzwl 0x2(%rax), %ecx
movq -0x60(%rbp), %rax
movq %rax, %rdx
addq $0x2, %rdx
movq %rdx, -0x60(%rbp)
movzwl 0x2(%rax), %edx
xorl %eax, %eax
cmpl %edx, %ecx
movb %al, -0x65(%rbp)
jne 0x9466
movq -0x58(%rbp), %rax
movq %rax, %rcx
addq $0x2, %rcx
movq %rcx, -0x58(%rbp)
movzwl 0x2(%rax), %ecx
movq -0x60(%rbp), %rax
movq %rax, %rdx
addq $0x2, %rdx
movq %rdx, -0x60(%rbp)
movzwl 0x2(%rax), %edx
xorl %eax, %eax
cmpl %edx, %ecx
movb %al, -0x65(%rbp)
jne 0x9466
movq -0x58(%rbp), %rax
movq %rax, %rcx
addq $0x2, %rcx
movq %rcx, -0x58(%rbp)
movzwl 0x2(%rax), %ecx
movq -0x60(%rbp), %rax
movq %rax, %rdx
addq $0x2, %rdx
movq %rdx, -0x60(%rbp)
movzwl 0x2(%rax), %edx
xorl %eax, %eax
cmpl %edx, %ecx
movb %al, -0x65(%rbp)
jne 0x9466
movl -0x40(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x40(%rbp)
cmpl $0x0, %eax
seta %al
movb %al, -0x65(%rbp)
movb -0x65(%rbp), %al
testb $0x1, %al
jne 0x9392
cmpl $0x0, -0x40(%rbp)
jne 0x94a9
movl -0x2c(%rbp), %ecx
movq -0x20(%rbp), %rax
movl %ecx, (%rax)
cmpl $0x102, -0x14(%rbp)     # imm = 0x102
jae 0x9491
movl -0x14(%rbp), %eax
movl %eax, -0x6c(%rbp)
jmp 0x949b
movl $0x102, %eax            # imm = 0x102
movl %eax, -0x6c(%rbp)
jmp 0x949b
movl -0x6c(%rbp), %ecx
movq -0x28(%rbp), %rax
movl %ecx, (%rax)
jmp 0x9530
movq -0x58(%rbp), %rax
movq -0x50(%rbp), %rcx
subq %rcx, %rax
sarq %rax
shll %eax
movq -0x58(%rbp), %rcx
movzbl (%rcx), %ecx
movq -0x60(%rbp), %rdx
movzbl (%rdx), %edx
cmpl %edx, %ecx
sete %cl
andb $0x1, %cl
movzbl %cl, %ecx
addl %ecx, %eax
movl %eax, -0x40(%rbp)
cmpl -0x34(%rbp), %eax
jbe 0x9529
movl -0x2c(%rbp), %ecx
movq -0x20(%rbp), %rax
movl %ecx, (%rax)
movl -0x14(%rbp), %eax
cmpl -0x40(%rbp), %eax
jae 0x94f5
movl -0x14(%rbp), %eax
movl %eax, -0x70(%rbp)
jmp 0x94fb
movl -0x40(%rbp), %eax
movl %eax, -0x70(%rbp)
movl -0x70(%rbp), %eax
movl %eax, -0x34(%rbp)
movq -0x28(%rbp), %rcx
movl %eax, (%rcx)
cmpl -0x14(%rbp), %eax
jne 0x950e
jmp 0x9530
movq -0x8(%rbp), %rax
movl -0x30(%rbp), %ecx
addl -0x34(%rbp), %ecx
subl $0x1, %ecx
movl %ecx, %ecx
movw 0xd0(%rax,%rcx), %ax
movw %ax, -0x62(%rbp)
jmp 0x952b
jmp 0x9225
addq $0x70, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)