// File: /workspace/github_c_makefile_star2_O0/dolphinking[P]slimox/src/slimox-ppm.h
// Function: _o4_context_node
static inline o4_context_t* __o4_context_node(ppm_model_t* model) {
    o4_context_t* o4;
    o4_context_t* o4_prev;
    int i;

    if(model->m_o4_counts >= 1048576) { /* too many o4-context/symbol nodes */
        model->m_o4_counts = 0;
        for(i = 0; i < 262144; i++) {
            while(model->m_o4_buckets[i] && model->m_o4_buckets[i]->m_visited / 2 == 0) {
                o4 = model->m_o4_buckets[i];
                model->m_o4_buckets[i] = model->m_o4_buckets[i]->m_next;
                allocator_free(model->m_o4_allocator, o4);
            }
            for(o4 = model->m_o4_buckets[i]; o4 != NULL; o4 = o4->m_next) {
                if((o4->m_visited /= 2) == 0) {
                    o4_prev->m_next = o4->m_next;
                    allocator_free(model->m_o4_allocator, o4);
                    o4 = o4_prev;
                } else {
                    model->m_o4_counts += 1;
                    o4_prev = o4;
                }
            }
        }
    }

    o4 = model->m_o4_buckets[__o4_hash(model->m_context)];
    o4_prev = NULL;
    while(o4 && o4->m_context != model->m_context) { /* search for o4 context */
        o4_prev = o4;
        o4 = o4->m_next;
    }
    if(o4 != NULL) { /* found -- bring to front of linked-list */
        if(o4_prev != NULL) {
            o4_prev->m_next = o4->m_next;
            o4->m_next = model->m_o4_buckets[__o4_hash(model->m_context)];
            model->m_o4_buckets[__o4_hash(model->m_context)] = o4;
        }
    } else { /* not found -- create new node for context */
        o4 = allocator_alloc(model->m_o4_allocator, sizeof(o4_context_t), 8192);
        memset(o4->m_symbols, 0, sizeof(o4->m_symbols));
        o4->m_context = model->m_context;
        o4->m_sum = 0;
        o4->m_cnt = 0;
        o4->m_visited = 0;
        o4->m_next = model->m_o4_buckets[__o4_hash(model->m_context)];
        model->m_o4_counts += 1;
        model->m_o4_buckets[__o4_hash(model->m_context)] = o4;
    }
    o4->m_visited += (o4->m_visited < 255);
    return o4;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
cmpl $0x100000, 0x8(%rax)    # imm = 0x100000
jb 0xe0fa
movq -0x8(%rbp), %rax
movl $0x0, 0x8(%rax)
movl $0x0, -0x1c(%rbp)
cmpl $0x40000, -0x1c(%rbp)   # imm = 0x40000
jge 0xe0f8
jmp 0xdfde
movq -0x8(%rbp), %rcx
movslq -0x1c(%rbp), %rdx
xorl %eax, %eax
cmpq $0x0, 0x10(%rcx,%rdx,8)
movb %al, -0x1d(%rbp)
je 0xe015
movq -0x8(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movq 0x10(%rax,%rcx,8), %rax
movzbl 0xf(%rax), %eax
movl $0x2, %ecx
cltd
idivl %ecx
cmpl $0x0, %eax
sete %al
movb %al, -0x1d(%rbp)
movb -0x1d(%rbp), %al
testb $0x1, %al
jne 0xe01e
jmp 0xe065
movq -0x8(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movq 0x10(%rax,%rcx,8), %rax
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movq 0x10(%rax,%rcx,8), %rax
movq (%rax), %rdx
movq -0x8(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movq %rdx, 0x10(%rax,%rcx,8)
movq -0x8(%rbp), %rax
movq 0x2a0820(%rax), %rdi
movq -0x10(%rbp), %rsi
callq 0x15700
jmp 0xdfde
movq -0x8(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movq 0x10(%rax,%rcx,8), %rax
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0xe0e8
movq -0x10(%rbp), %rcx
movzbl 0xf(%rcx), %eax
movl $0x2, %esi
cltd
idivl %esi
movb %al, 0xf(%rcx)
movzbl %al, %eax
cmpl $0x0, %eax
jne 0xe0c4
movq -0x10(%rbp), %rax
movq (%rax), %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
movq -0x8(%rbp), %rax
movq 0x2a0820(%rax), %rdi
movq -0x10(%rbp), %rsi
callq 0x15700
movq -0x18(%rbp), %rax
movq %rax, -0x10(%rbp)
jmp 0xe0d9
movq -0x8(%rbp), %rax
movl 0x8(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x8(%rax)
movq -0x10(%rbp), %rax
movq %rax, -0x18(%rbp)
jmp 0xe0db
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x10(%rbp)
jmp 0xe076
jmp 0xe0ea
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0xdfcf
jmp 0xe0fa
movq -0x8(%rbp), %rax
movq -0x8(%rbp), %rcx
movl (%rcx), %ecx
movq -0x8(%rbp), %rdx
movl (%rdx), %edx
shrl $0xe, %edx
xorl %edx, %ecx
andl $0x3ffff, %ecx          # imm = 0x3FFFF
movl %ecx, %ecx
movq 0x10(%rax,%rcx,8), %rax
movq %rax, -0x10(%rbp)
movq $0x0, -0x18(%rbp)
xorl %eax, %eax
cmpq $0x0, -0x10(%rbp)
movb %al, -0x1e(%rbp)
je 0xe147
movq -0x10(%rbp), %rax
movl 0x8(%rax), %eax
movq -0x8(%rbp), %rcx
cmpl (%rcx), %eax
setne %al
movb %al, -0x1e(%rbp)
movb -0x1e(%rbp), %al
testb $0x1, %al
jne 0xe150
jmp 0xe165
movq -0x10(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x10(%rbp)
jmp 0xe128
cmpq $0x0, -0x10(%rbp)
je 0xe1d5
cmpq $0x0, -0x18(%rbp)
je 0xe1d0
movq -0x10(%rbp), %rax
movq (%rax), %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
movq -0x8(%rbp), %rax
movq -0x8(%rbp), %rcx
movl (%rcx), %ecx
movq -0x8(%rbp), %rdx
movl (%rdx), %edx
shrl $0xe, %edx
xorl %edx, %ecx
andl $0x3ffff, %ecx          # imm = 0x3FFFF
movl %ecx, %ecx
movq 0x10(%rax,%rcx,8), %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
movq -0x10(%rbp), %rdx
movq -0x8(%rbp), %rax
movq -0x8(%rbp), %rcx
movl (%rcx), %ecx
movq -0x8(%rbp), %rsi
movl (%rsi), %esi
shrl $0xe, %esi
xorl %esi, %ecx
andl $0x3ffff, %ecx          # imm = 0x3FFFF
movl %ecx, %ecx
movq %rdx, 0x10(%rax,%rcx,8)
jmp 0xe28a
movq -0x8(%rbp), %rax
movq 0x2a0820(%rax), %rdi
movl $0x94, %esi
movl $0x2000, %edx           # imm = 0x2000
callq 0xe2c0
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rdi
addq $0x10, %rdi
xorl %esi, %esi
movl $0x84, %edx
callq 0x10e0
movq -0x8(%rbp), %rax
movl (%rax), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x8(%rax)
movq -0x10(%rbp), %rax
movw $0x0, 0xc(%rax)
movq -0x10(%rbp), %rax
movb $0x0, 0xe(%rax)
movq -0x10(%rbp), %rax
movb $0x0, 0xf(%rax)
movq -0x8(%rbp), %rax
movq -0x8(%rbp), %rcx
movl (%rcx), %ecx
movq -0x8(%rbp), %rdx
movl (%rdx), %edx
shrl $0xe, %edx
xorl %edx, %ecx
andl $0x3ffff, %ecx          # imm = 0x3FFFF
movl %ecx, %ecx
movq 0x10(%rax,%rcx,8), %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
movq -0x8(%rbp), %rax
movl 0x8(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x8(%rax)
movq -0x10(%rbp), %rdx
movq -0x8(%rbp), %rax
movq -0x8(%rbp), %rcx
movl (%rcx), %ecx
movq -0x8(%rbp), %rsi
movl (%rsi), %esi
shrl $0xe, %esi
xorl %esi, %ecx
andl $0x3ffff, %ecx          # imm = 0x3FFFF
movl %ecx, %ecx
movq %rdx, 0x10(%rax,%rcx,8)
movq -0x10(%rbp), %rax
movzbl 0xf(%rax), %eax
cmpl $0xff, %eax
setl %al
andb $0x1, %al
movzbl %al, %edx
movq -0x10(%rbp), %rax
movzbl 0xf(%rax), %ecx
addl %edx, %ecx
movb %cl, 0xf(%rax)
movq -0x10(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)