// File: /workspace/github_c_makefile_star2_O3/johsteffens[P]beth/lib/bcore/bcore_tbman.c
// Function: token_manager_s_free_token
static void token_manager_s_free_token( token_manager_s* o, u1_t token )
{
    #ifdef RTCHECKS
        if( token * o->block_size < sizeof( token_manager_s ) ) ERR( "Attempt to free reserved memory." );
        for( uz_t i = o->stack_index; i < o->stack_size; i++ ) if( o->token_stack[ i ] == token ) ERR( "Attempt to free memory that is declared free." );
    #endif // RTCHECKS

    // reference control
    if( o->rc_count_arr )
    {
        if( o->rc_count_arr[ token ] )
        {
            o->rc_count_arr[ token ]--;
            return;
        }

        if( o->rc_down_arr )
        {
            vd_t down = o->rc_down_arr[ token ];
            if( down )
            {
                bcore_mutex_s_unlock( o->mutex );
                ( ( down_s* )down )->_( down, ( u0_t* )o + token * o->block_size );
                bcore_mutex_s_lock( o->mutex );
                assert( o->down_manager );
                down_s_discard( o->down_manager, down );
                o->rc_down_arr[ token ] = NULL;
            }
        }
    }

    if( o->token_stack[ o->stack_index ] == 0 ) block_manager_s_full_to_free( o->parent, o );
    o->stack_index--;
    o->token_stack[ o->stack_index ] = token;
    if( o->stack_index == 0 ) block_manager_s_free_to_empty( o->parent, o );
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %esi, %ebp
movq %rdi, %rbx
movq 0x30(%rdi), %rax
testq %rax, %rax
je 0x113809
movzwl %bp, %r15d
movq (%rax,%r15,8), %rcx
testq %rcx, %rcx
je 0x1137bc
decq %rcx
movq %rcx, (%rax,%r15,8)
jmp 0x1139a8
movq 0x38(%rbx), %rax
testq %rax, %rax
je 0x113809
movq (%rax,%r15,8), %r14
testq %r14, %r14
je 0x113809
movq 0x18(%rbx), %rdi
callq 0x1142fb
movq 0x8(%rbx), %rsi
imulq %r15, %rsi
addq %rbx, %rsi
movq %r14, %rdi
callq *(%r14)
movq 0x18(%rbx), %rdi
callq 0x1142c9
movq 0x40(%rbx), %rdi
movq %r14, %rsi
callq 0x1139b1
movq 0x38(%rbx), %rax
movq $0x0, (%rax,%r15,8)
movzwl 0x12(%rbx), %eax
cmpw $0x0, 0x48(%rbx,%rax,2)
jne 0x113847
movq 0x20(%rbx), %rcx
movq 0x18(%rcx), %rdx
movq 0x30(%rcx), %rsi
leaq -0x1(%rsi), %rdi
movq %rdi, 0x30(%rcx)
movq 0x28(%rbx), %r8
movq -0x8(%rdx,%rsi,8), %r9
movq %rbx, -0x8(%rdx,%rsi,8)
movq 0x18(%rcx), %rcx
movq %r9, (%rcx,%r8,8)
movq %rdi, 0x28(%rbx)
movq %r8, 0x28(%r9)
decl %eax
movw %ax, 0x12(%rbx)
movzwl %ax, %eax
movw %bp, 0x48(%rbx,%rax,2)
testw %ax, %ax
jne 0x1139a8
movq 0x20(%rbx), %r12
movq 0x20(%r12), %rax
testq %rax, %rax
je 0x11388f
movq 0x18(%r12), %rcx
movq %rax, %rdx
movq -0x8(%rcx,%rdx,8), %rsi
cmpw $0x0, 0x12(%rsi)
jne 0x113887
decq %rdx
jne 0x113874
xorl %edx, %edx
movq %rax, %rcx
subq %rdx, %rcx
jmp 0x113891
xorl %ecx, %ecx
cmpq %rax, %rcx
jae 0x1138ce
movq 0x28(%rbx), %rdx
movq %rcx, %rsi
notq %rsi
addq %rax, %rsi
cmpq %rsi, %rdx
jae 0x1138ce
movq 0x18(%r12), %rax
movq (%rax,%rsi,8), %rdi
movq %rdi, (%rax,%rdx,8)
movq 0x18(%r12), %rax
movq %rbx, (%rax,%rsi,8)
movq %rsi, 0x28(%rbx)
movq %rdx, 0x28(%rdi)
incq %rcx
movq 0x20(%r12), %rax
movq %rcx, %xmm0
movq 0x23a05(%rip), %xmm1    # 0x1372e0
punpckldq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
movapd 0x23a09(%rip), %xmm2    # 0x1372f0
subpd %xmm2, %xmm0
movapd %xmm0, %xmm3
unpckhpd %xmm0, %xmm3            # xmm3 = xmm3[1],xmm0[1]
addsd %xmm0, %xmm3
movq %rax, %rdx
subq %rcx, %rdx
movq %rdx, %xmm0
punpckldq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
subpd %xmm2, %xmm0
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
mulsd 0x38(%r12), %xmm1
ucomisd %xmm1, %xmm3
jbe 0x1139a8
testq %rax, %rax
je 0x1139a8
leaq 0x39921(%rip), %rbx     # 0x14d254
leaq 0x393b3(%rip), %r14     # 0x14cced
leaq 0x39931(%rip), %r15     # 0x14d272
movq 0x18(%r12), %rcx
movq -0x8(%rcx,%rax,8), %rsi
cmpw $0x0, 0x12(%rsi)
jne 0x1139a8
decq %rax
movq %rax, 0x20(%r12)
movq 0x58(%r12), %rdi
callq 0x126996
cmpl $0x1, %eax
je 0x11397e
movq %rbx, %rdi
movq %r14, %rsi
movl $0x3ac, %edx            # imm = 0x3AC
movq %r15, %rcx
xorl %eax, %eax
callq 0xbe592
movq 0x18(%r12), %rax
movq 0x20(%r12), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x11375e
movq 0x18(%r12), %rcx
movq 0x20(%r12), %rax
movq $0x0, (%rcx,%rax,8)
testq %rax, %rax
jne 0x113941
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq