// File: /workspace/github_c_makefile_star2_O0/dolphinking[P]slimox/src/slimox-ppm.h
// Function: _ppm_see_context_o4
static inline see_model_t* __ppm_see_context_o4(ppm_model_t* model, o4_context_t* o4) {
    int curcnt = o4->m_cnt;
    int lowsum = __o2(model)->m_sum;
    int lowcnt = __o2(model)->m_cnt;
    uint32_t context = 0;

    if(curcnt == 0) return &model->m_see_01; /* no symbols under current context -- always escape */
    if(curcnt == 1) {
        /* QUANTIZE(binary) = (last_esc[1] | sum[3] | lowcnt[2] | lowsum[1] | bin_symbol[3] | previous symbols[6]) */
        context |= ((model->m_context >>  6) & 0x03);
        context |= ((model->m_context >> 14) & 0x03) << 2;
        context |= ((model->m_context >> 22) & 0x03) << 4;
        context |= (__context_sym(o4, 0) >> 6) << 6;
        context |= (lowsum >= 4) << 9;
        context |= min2(__fast_log2(lowcnt / 2), 3) << 10;
        context |= min2(__fast_log2(o4->m_sum / 3), 7) << 12;
        context |= model->m_sse_last_esc << 15;
        context |= 1 << 16;
        return &model->m_see[context];
    } else {
        /* QUANTIZE = (last_esc[1] | sum[3] | curcnt[2] | lowsum[1] | (lowcnt - curcnt)[3] | previous symbols[6]) */
        context |= ((model->m_context >>  6) & 0x03);
        context |= ((model->m_context >> 14) & 0x03) << 2;
        context |= ((model->m_context >> 22) & 0x03) << 4;
        context |= min2(__fast_log2(max2(lowcnt - curcnt, 0) / 2), 3) << 6;
        context |= (lowsum >= 4) << 9;
        context |= min2(__fast_log2(curcnt / 2), 3) << 10;
        context |= min2(__fast_log2(o4->m_sum / 8), 7) << 12;
        context |= model->m_sse_last_esc << 15;
        context |= 0 << 16;
        return &model->m_see[context];
    }
    return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x18(%rbp), %rax
movzbl 0xe(%rax), %eax
movl %eax, -0x1c(%rbp)
movq -0x10(%rbp), %rax
movq -0x10(%rbp), %rcx
movl (%rcx), %ecx
andl $0xffff, %ecx           # imm = 0xFFFF
movl %ecx, %ecx
movq 0x200010(%rax,%rcx,8), %rax
movzwl (%rax), %eax
movl %eax, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq -0x10(%rbp), %rcx
movl (%rcx), %ecx
andl $0xffff, %ecx           # imm = 0xFFFF
movl %ecx, %ecx
movq 0x200010(%rax,%rcx,8), %rax
movzwl 0x2(%rax), %eax
movl %eax, -0x24(%rbp)
movl $0x0, -0x28(%rbp)
cmpl $0x0, -0x1c(%rbp)
jne 0xe43c
movq -0x10(%rbp), %rax
addq $0x32082a, %rax         # imm = 0x32082A
movq %rax, -0x8(%rbp)
jmp 0xe70f
cmpl $0x1, -0x1c(%rbp)
jne 0xe579
movq -0x10(%rbp), %rax
movl (%rax), %eax
shrl $0x6, %eax
andl $0x3, %eax
orl -0x28(%rbp), %eax
movl %eax, -0x28(%rbp)
movq -0x10(%rbp), %rax
movl (%rax), %eax
shrl $0xe, %eax
andl $0x3, %eax
shll $0x2, %eax
orl -0x28(%rbp), %eax
movl %eax, -0x28(%rbp)
movq -0x10(%rbp), %rax
movl (%rax), %eax
shrl $0x16, %eax
andl $0x3, %eax
shll $0x4, %eax
orl -0x28(%rbp), %eax
movl %eax, -0x28(%rbp)
movq -0x18(%rbp), %rax
movzbl 0x10(%rax), %eax
sarl $0x6, %eax
shll $0x6, %eax
orl -0x28(%rbp), %eax
movl %eax, -0x28(%rbp)
cmpl $0x4, -0x20(%rbp)
setge %al
andb $0x1, %al
movzbl %al, %eax
shll $0x9, %eax
orl -0x28(%rbp), %eax
movl %eax, -0x28(%rbp)
movl -0x24(%rbp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, %edi
callq 0x15740
cmpl $0x3, %eax
jg 0xe4d9
movl -0x24(%rbp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, %edi
callq 0x15740
movl %eax, -0x2c(%rbp)
jmp 0xe4e3
movl $0x3, %eax
movl %eax, -0x2c(%rbp)
jmp 0xe4e3
movl -0x2c(%rbp), %eax
shll $0xa, %eax
orl -0x28(%rbp), %eax
movl %eax, -0x28(%rbp)
movq -0x18(%rbp), %rax
movzwl 0xc(%rax), %eax
movl $0x3, %ecx
cltd
idivl %ecx
movl %eax, %edi
callq 0x15740
cmpl $0x7, %eax
jg 0xe527
movq -0x18(%rbp), %rax
movzwl 0xc(%rax), %eax
movl $0x3, %ecx
cltd
idivl %ecx
movl %eax, %edi
callq 0x15740
movl %eax, -0x30(%rbp)
jmp 0xe531
movl $0x7, %eax
movl %eax, -0x30(%rbp)
jmp 0xe531
movl -0x30(%rbp), %eax
shll $0xc, %eax
orl -0x28(%rbp), %eax
movl %eax, -0x28(%rbp)
movq -0x10(%rbp), %rax
movzbl 0x2a0829(%rax), %eax
shll $0xf, %eax
orl -0x28(%rbp), %eax
movl %eax, -0x28(%rbp)
movl -0x28(%rbp), %eax
orl $0x10000, %eax          # imm = 0x10000
movl %eax, -0x28(%rbp)
movq -0x10(%rbp), %rax
addq $0x2a082a, %rax         # imm = 0x2A082A
movl -0x28(%rbp), %ecx
shlq $0x2, %rcx
addq %rcx, %rax
movq %rax, -0x8(%rbp)
jmp 0xe70f
movq -0x10(%rbp), %rax
movl (%rax), %eax
shrl $0x6, %eax
andl $0x3, %eax
orl -0x28(%rbp), %eax
movl %eax, -0x28(%rbp)
movq -0x10(%rbp), %rax
movl (%rax), %eax
shrl $0xe, %eax
andl $0x3, %eax
shll $0x2, %eax
orl -0x28(%rbp), %eax
movl %eax, -0x28(%rbp)
movq -0x10(%rbp), %rax
movl (%rax), %eax
shrl $0x16, %eax
andl $0x3, %eax
shll $0x4, %eax
orl -0x28(%rbp), %eax
movl %eax, -0x28(%rbp)
movl -0x24(%rbp), %eax
subl -0x1c(%rbp), %eax
cmpl $0x0, %eax
jl 0xe5cb
movl -0x24(%rbp), %eax
subl -0x1c(%rbp), %eax
movl %eax, -0x34(%rbp)
jmp 0xe5d2
xorl %eax, %eax
movl %eax, -0x34(%rbp)
jmp 0xe5d2
movl -0x34(%rbp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, %edi
callq 0x15740
cmpl $0x3, %eax
jg 0xe61d
movl -0x24(%rbp), %eax
subl -0x1c(%rbp), %eax
cmpl $0x0, %eax
jl 0xe5ff
movl -0x24(%rbp), %eax
subl -0x1c(%rbp), %eax
movl %eax, -0x38(%rbp)
jmp 0xe606
xorl %eax, %eax
movl %eax, -0x38(%rbp)
jmp 0xe606
movl -0x38(%rbp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, %edi
callq 0x15740
movl %eax, -0x3c(%rbp)
jmp 0xe627
movl $0x3, %eax
movl %eax, -0x3c(%rbp)
jmp 0xe627
movl -0x3c(%rbp), %eax
shll $0x6, %eax
orl -0x28(%rbp), %eax
movl %eax, -0x28(%rbp)
cmpl $0x4, -0x20(%rbp)
setge %al
andb $0x1, %al
movzbl %al, %eax
shll $0x9, %eax
orl -0x28(%rbp), %eax
movl %eax, -0x28(%rbp)
movl -0x1c(%rbp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, %edi
callq 0x15740
cmpl $0x3, %eax
jg 0xe676
movl -0x1c(%rbp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, %edi
callq 0x15740
movl %eax, -0x40(%rbp)
jmp 0xe680
movl $0x3, %eax
movl %eax, -0x40(%rbp)
jmp 0xe680
movl -0x40(%rbp), %eax
shll $0xa, %eax
orl -0x28(%rbp), %eax
movl %eax, -0x28(%rbp)
movq -0x18(%rbp), %rax
movzwl 0xc(%rax), %eax
movl $0x8, %ecx
cltd
idivl %ecx
movl %eax, %edi
callq 0x15740
cmpl $0x7, %eax
jg 0xe6c4
movq -0x18(%rbp), %rax
movzwl 0xc(%rax), %eax
movl $0x8, %ecx
cltd
idivl %ecx
movl %eax, %edi
callq 0x15740
movl %eax, -0x44(%rbp)
jmp 0xe6ce
movl $0x7, %eax
movl %eax, -0x44(%rbp)
jmp 0xe6ce
movl -0x44(%rbp), %eax
shll $0xc, %eax
orl -0x28(%rbp), %eax
movl %eax, -0x28(%rbp)
movq -0x10(%rbp), %rax
movzbl 0x2a0829(%rax), %eax
shll $0xf, %eax
orl -0x28(%rbp), %eax
movl %eax, -0x28(%rbp)
movl -0x28(%rbp), %eax
orl $0x0, %eax
movl %eax, -0x28(%rbp)
movq -0x10(%rbp), %rax
addq $0x2a082a, %rax         # imm = 0x2A082A
movl -0x28(%rbp), %ecx
shlq $0x2, %rcx
addq %rcx, %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax)