// File: /workspace/github_c_makefile_star2_O0/dolphinking[P]slimox/src/slimox-match.h
// Function: matcher_update
static inline void matcher_update(matcher_t* matcher, unsigned char* data, uint32_t pos, int encode) {
    uint32_t context4;

    if(pos >= 12) { /* avoid overflow */
        context4 = *(uint32_t*)(data + pos - 4);

        matcher->m_lzp8[M_hash8_(data + pos - 8)] = pos | (uint64_t)context4 << 32;
        matcher->m_lzp4[M_hash4_(data + pos - 4)] = pos | (uint64_t)context4 << 32;
        matcher->m_lzp2[M_hash2_(data + pos - 2)] = pos;

        /* prefetch for next round */
        if(encode) {
            __builtin_prefetch(matcher->m_lzp8 + M_hash8_(data + pos - 6), 1, 3);
            __builtin_prefetch(matcher->m_lzp4 + M_hash4_(data + pos - 2), 1, 3);
            __builtin_prefetch(matcher->m_lzp2 + M_hash2_(data + pos + 0), 1, 3);
        } else {
            __builtin_prefetch(matcher->m_lzp8 + M_hash8_(data + pos - 7), 1, 3);
            __builtin_prefetch(matcher->m_lzp4 + M_hash4_(data + pos - 3), 1, 3);
            __builtin_prefetch(matcher->m_lzp2 + M_hash2_(data + pos - 1), 1, 3);
        }
    }
    return;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movl %ecx, -0x18(%rbp)
cmpl $0xc, -0x14(%rbp)
jb 0x15645
movq -0x10(%rbp), %rax
movl -0x14(%rbp), %ecx
movl -0x4(%rax,%rcx), %eax
movl %eax, -0x1c(%rbp)
movl -0x14(%rbp), %eax
movl %eax, %edx
movl -0x1c(%rbp), %eax
shlq $0x20, %rax
orq %rax, %rdx
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq -0x10(%rbp), %rcx
movl -0x14(%rbp), %esi
movq -0x8(%rcx,%rsi), %rcx
movq -0x10(%rbp), %rsi
movl -0x14(%rbp), %edi
movq -0x8(%rsi,%rdi), %rsi
shrq $0x16, %rsi
xorq %rsi, %rcx
movq -0x10(%rbp), %rsi
movl -0x14(%rbp), %edi
movq -0x8(%rsi,%rdi), %rsi
shrq $0x2c, %rsi
xorq %rsi, %rcx
andq $0xfffff, %rcx          # imm = 0xFFFFF
movq %rdx, (%rax,%rcx,8)
movl -0x14(%rbp), %eax
movl %eax, %edx
movl -0x1c(%rbp), %eax
shlq $0x20, %rax
orq %rax, %rdx
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x10(%rbp), %rcx
movl -0x14(%rbp), %esi
movl -0x4(%rcx,%rsi), %ecx
movq -0x10(%rbp), %rsi
movl -0x14(%rbp), %edi
movl -0x4(%rsi,%rdi), %esi
shrl $0x6, %esi
xorl %esi, %ecx
movq -0x10(%rbp), %rsi
movl -0x14(%rbp), %edi
movl -0x4(%rsi,%rdi), %esi
shrl $0xc, %esi
xorl %esi, %ecx
andl $0xfffff, %ecx          # imm = 0xFFFFF
movl %ecx, %ecx
movq %rdx, (%rax,%rcx,8)
movl -0x14(%rbp), %edx
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x10(%rbp), %rcx
movl -0x14(%rbp), %esi
movzwl -0x2(%rcx,%rsi), %ecx
movl %edx, (%rax,%rcx,4)
cmpl $0x0, -0x18(%rbp)
je 0x15593
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq -0x10(%rbp), %rcx
movl -0x14(%rbp), %edx
movq -0x6(%rcx,%rdx), %rcx
movq -0x10(%rbp), %rdx
movl -0x14(%rbp), %esi
movq -0x6(%rdx,%rsi), %rdx
shrq $0x16, %rdx
xorq %rdx, %rcx
movq -0x10(%rbp), %rdx
movl -0x14(%rbp), %esi
movq -0x6(%rdx,%rsi), %rdx
shrq $0x2c, %rdx
xorq %rdx, %rcx
andq $0xfffff, %rcx          # imm = 0xFFFFF
shlq $0x3, %rcx
addq %rcx, %rax
prefetcht0 (%rax)
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x10(%rbp), %rcx
movl -0x14(%rbp), %edx
movl -0x2(%rcx,%rdx), %ecx
movq -0x10(%rbp), %rdx
movl -0x14(%rbp), %esi
movl -0x2(%rdx,%rsi), %edx
shrl $0x6, %edx
xorl %edx, %ecx
movq -0x10(%rbp), %rdx
movl -0x14(%rbp), %esi
movl -0x2(%rdx,%rsi), %edx
shrl $0xc, %edx
xorl %edx, %ecx
andl $0xfffff, %ecx          # imm = 0xFFFFF
movl %ecx, %ecx
shlq $0x3, %rcx
addq %rcx, %rax
prefetcht0 (%rax)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x10(%rbp), %rcx
movl -0x14(%rbp), %edx
movzwl (%rcx,%rdx), %ecx
movslq %ecx, %rcx
shlq $0x2, %rcx
addq %rcx, %rax
prefetcht0 (%rax)
jmp 0x15643
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq -0x10(%rbp), %rcx
movl -0x14(%rbp), %edx
movq -0x7(%rcx,%rdx), %rcx
movq -0x10(%rbp), %rdx
movl -0x14(%rbp), %esi
movq -0x7(%rdx,%rsi), %rdx
shrq $0x16, %rdx
xorq %rdx, %rcx
movq -0x10(%rbp), %rdx
movl -0x14(%rbp), %esi
movq -0x7(%rdx,%rsi), %rdx
shrq $0x2c, %rdx
xorq %rdx, %rcx
andq $0xfffff, %rcx          # imm = 0xFFFFF
shlq $0x3, %rcx
addq %rcx, %rax
prefetcht0 (%rax)
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x10(%rbp), %rcx
movl -0x14(%rbp), %edx
movl -0x3(%rcx,%rdx), %ecx
movq -0x10(%rbp), %rdx
movl -0x14(%rbp), %esi
movl -0x3(%rdx,%rsi), %edx
shrl $0x6, %edx
xorl %edx, %ecx
movq -0x10(%rbp), %rdx
movl -0x14(%rbp), %esi
movl -0x3(%rdx,%rsi), %edx
shrl $0xc, %edx
xorl %edx, %ecx
andl $0xfffff, %ecx          # imm = 0xFFFFF
movl %ecx, %ecx
shlq $0x3, %rcx
addq %rcx, %rax
prefetcht0 (%rax)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x10(%rbp), %rcx
movl -0x14(%rbp), %edx
movzwl -0x1(%rcx,%rdx), %ecx
movslq %ecx, %rcx
shlq $0x2, %rcx
addq %rcx, %rax
prefetcht0 (%rax)
jmp 0x15645
popq %rbp
retq
nopw (%rax,%rax)