// File: /workspace/github_cpp_makefile_star2_O3/walker-xian[P]teisye/src/teisye.cpp
// Function: teisye::slabs<teisye::heap_large::large_slab, teisye::heap_large::large_unit>::alloc(unsigned long)
inline unit_t* alloc(size_t size)  noexcept
    {
        unit_t *unit{};
        for (auto s = _slabs.top(); s; s = s->_next)
        {
            unit = s->alloc(size);
            if (unit) return unit;
        }

        // need a new slab
        auto s = new slab_t;
        if (s)
        {
            unit = s->alloc(size);
            _slabs.push(s);
        }

        return unit;
    }

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
movq (%rdi), %rax
leaq 0x27(%rsi), %r15
andq $-0x10, %r15
testq %rax, %rax
je 0x1516a
movq 0x18(%rax), %rcx
cmpq %rcx, %r15
ja 0x15161
movb $0x1, %cl
xchgb %cl, 0x20(%rax)
testb %cl, %cl
jne 0x15161
movq (%rax), %rdx
movq 0x8(%rax), %rsi
cmpq %rsi, %rdx
jae 0x1515c
movq %rsi, %r8
movq %rdx, %rcx
cmpq $0x0, 0x8(%rcx)
movq (%rcx), %rdi
jne 0x15154
cmpq %rsi, %rdi
jae 0x15134
cmpq $0x0, 0x8(%rdi)
jne 0x15130
movq (%rdi), %rdi
movq %rdi, (%rcx)
cmpq %rsi, %rdi
jb 0x1511e
movq 0x8(%rax), %r8
cmpq %rdx, %rdi
jbe 0x152ad
cmpq %r8, %rdi
ja 0x152ad
movq %rdi, %r9
subq %rcx, %r9
movq %r9, %r10
subq %r15, %r10
jae 0x151c7
movq %rdi, %rcx
cmpq %rsi, %rdi
jb 0x1510f
xorl %ecx, %ecx
xchgb %cl, 0x20(%rax)
movq 0x10(%rax), %rax
jmp 0x150e6
movl $0x200000, %edi         # imm = 0x200000
callq 0x4550
movq %rax, %rdx
addq $0x200000, %rax         # imm = 0x200000
movq %rax, 0x8(%rdx)
xorl %ecx, %ecx
movq %rcx, 0x10(%rdx)
leaq 0x37(%rdx), %rsi
andq $-0x10, %rsi
leaq 0x8(%rsi), %rdi
movq %rdi, (%rdx)
movq %rcx, 0x10(%rsi)
movq %rax, 0x8(%rsi)
subq %rdi, %rax
xchgq %rax, 0x18(%rdx)
xorl %eax, %eax
xchgb %al, 0x20(%rdx)
movq 0x18(%rdx), %rax
cmpq %rax, %r15
ja 0x15266
movb $0x1, %al
xchgb %al, 0x20(%rdx)
testb %al, %al
je 0x15204
xorl %ecx, %ecx
jmp 0x15266
addq $0x18, %r14
cmpq $0x80, %r10
jb 0x151eb
leaq (%r15,%rcx), %rdx
movq $0x0, 0x8(%r15,%rcx)
movq %rdi, (%r15,%rcx)
movq %rdx, (%rcx)
movq %r15, %r9
movq %rax, 0x8(%rcx)
cmpq %r14, %r9
jb 0x152cc
lock
subq %r9, 0x18(%rax)
xorl %edx, %edx
xchgb %dl, 0x20(%rax)
jmp 0x15274
movq (%rdx), %rax
movq 0x8(%rdx), %rsi
cmpq %rsi, %rax
jae 0x1525f
addq $0x18, %r14
movq %rsi, %r8
movq %rax, %rcx
cmpq $0x0, 0x8(%rcx)
movq (%rcx), %rdi
jne 0x15257
cmpq %rsi, %rdi
jae 0x1523f
cmpq $0x0, 0x8(%rdi)
jne 0x1523b
movq (%rdi), %rdi
movq %rdi, (%rcx)
cmpq %rsi, %rdi
jb 0x15229
movq 0x8(%rdx), %r8
cmpq %rax, %rdi
jbe 0x152ad
cmpq %r8, %rdi
ja 0x152ad
movq %rdi, %r9
subq %rcx, %r9
movq %r9, %r10
subq %r15, %r10
jae 0x1527d
movq %rdi, %rcx
cmpq %rsi, %rdi
jb 0x1521a
xorl %ecx, %ecx
xorl %eax, %eax
xchgb %al, 0x20(%rdx)
movq (%rbx), %rax
movq %rax, 0x10(%rdx)
lock
cmpxchgq %rdx, (%rbx)
jne 0x15269
movq %rcx, %rax
popq %rbx
popq %r14
popq %r15
retq
cmpq $0x80, %r10
jb 0x1529d
leaq (%r15,%rcx), %rax
movq $0x0, 0x8(%r15,%rcx)
movq %rdi, (%r15,%rcx)
movq %rax, (%rcx)
movq %r15, %r9
movq %rdx, 0x8(%rcx)
cmpq %r14, %r9
jb 0x152cc
lock
subq %r9, 0x18(%rdx)
jmp 0x15261
leaq 0x2730(%rip), %rdi      # 0x179e4
leaq 0x2574(%rip), %rsi      # 0x1782f
leaq 0x274f(%rip), %rcx      # 0x17a11
movl $0x1f5, %edx            # imm = 0x1F5
callq 0x4210
leaq 0x2774(%rip), %rdi      # 0x17a47
leaq 0x2555(%rip), %rsi      # 0x1782f
leaq 0x2730(%rip), %rcx      # 0x17a11
movl $0x206, %edx            # imm = 0x206
callq 0x4210
nop