// File: /workspace/github_c_makefile_star2_O3/BernardTatin[P]s7sh/s7.c
// Function: mallocate
static inline block_t *mallocate(s7_scheme *sc, size_t bytes)
    {
        block_t *p;
        if (bytes > 0)
        {
            int32_t index;
            if (bytes <= 8)
                index = 3;
            else
            {
                if (bytes <= 256)
                    index = bits[bytes - 1];
                else
                {
                    if (bytes <= 65536)
                        index = 8 + bits[(bytes - 1) >> 8];
                    else index = TOP_BLOCK_LIST; /* expansion to (1 << 17) made no difference */
                }
            }
            p = sc->block_lists[index];
            if (p)
            {
                sc->block_lists[index] = (block_t *)block_next(p);
                /* block_next(p) = NULL; */
            }
            else
            {
                p = mallocate_block(sc);
                block_data(p) = (void *)alloc_permanent_string(sc, (index < TOP_BLOCK_LIST) ? (size_t)(1 << index) : bytes);
                block_set_index(p, index);
            }
        }
        else p = mallocate_block(sc);
        block_set_size(p, bytes);
        return(p);
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
testq %rsi, %rsi
je 0x9392
movl $0x3, %ebp
cmpq $0x9, %rbx
jb 0x9418
cmpq $0x100, %rbx            # imm = 0x100
ja 0x93f5
leaq 0xffba7(%rip), %rax     # 0x108f30
movl -0x4(%rax,%rbx,4), %ebp
jmp 0x9418
movq 0x838(%r14), %r15
testq %r15, %r15
jne 0x93dd
movl $0x2800, %edi           # imm = 0x2800
callq 0x8480
movq %rax, %r15
movq %rax, 0x838(%r14)
addq $0x28, %rax
movl $0xff, %ecx
movq %rax, -0x10(%rax)
movl $0x0, -0x20(%rax)
addq $0x28, %rax
decl %ecx
jne 0x93bb
movq $0x0, -0x10(%rax)
movl $0x0, -0x20(%rax)
movq 0x18(%r15), %rax
movq %rax, 0x838(%r14)
movl $0x0, 0x8(%r15)
jmp 0x9507
movl $0x11, %ebp
cmpq $0x10000, %rbx          # imm = 0x10000
ja 0x9418
leaq -0x1(%rbx), %rax
shrq $0x8, %rax
leaq 0xffb1e(%rip), %rcx     # 0x108f30
movl (%rcx,%rax,4), %ebp
addl $0x8, %ebp
movslq %ebp, %rax
movq 0x838(%r14,%rax,8), %r15
testq %r15, %r15
je 0x9439
movq 0x18(%r15), %rcx
movq %rcx, 0x838(%r14,%rax,8)
jmp 0x9507
movq 0x838(%r14), %r15
testq %r15, %r15
jne 0x9484
movl $0x2800, %edi           # imm = 0x2800
callq 0x8480
movq %rax, %r15
movq %rax, 0x838(%r14)
addq $0x28, %rax
movl $0xff, %ecx
movq %rax, -0x10(%rax)
movl $0x0, -0x20(%rax)
addq $0x28, %rax
decl %ecx
jne 0x9462
movq $0x0, -0x10(%rax)
movl $0x0, -0x20(%rax)
movl $0x1, %eax
movl %ebp, %ecx
shll %cl, %eax
movq 0x18(%r15), %rcx
movq %rcx, 0x838(%r14)
cmpl $0x11, %ebp
movslq %eax, %rcx
cmovgeq %rbx, %rcx
addq $0x7, %rcx
movq %rcx, %r12
andq $-0x8, %r12
movq 0x8c8(%r14), %rax
leaq (%rax,%r12), %rdx
cmpq $0x10000, %rdx          # imm = 0x10000
jbe 0x94d4
cmpq $0x200, %rcx            # imm = 0x200
jb 0x94dd
movq %r12, %rdi
callq 0x8480
jmp 0x9500
movq 0x8d0(%r14), %rcx
jmp 0x94f6
movl $0x10000, %edi          # imm = 0x10000
callq 0x8480
movq %rax, %rcx
movq %rax, 0x8d0(%r14)
xorl %eax, %eax
movq %r12, %rdx
addq %rcx, %rax
movq %rdx, 0x8c8(%r14)
movq %rax, (%r15)
movl %ebp, 0x8(%r15)
movq %rbx, 0x10(%r15)
movq %r15, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq