// File: /workspace/github_c_makefile_star2_O1/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 0xa340
movl $0x3, %ebp
cmpq $0x9, %rbx
jb 0xa3c8
cmpq $0x100, %rbx            # imm = 0x100
ja 0xa3a5
leaq 0x107b99(%rip), %rax    # 0x111ed0
movl -0x4(%rax,%rbx,4), %ebp
jmp 0xa3c8
cmpq $0x0, 0x838(%r14)
jne 0xa386
movl $0x2800, %edi           # imm = 0x2800
callq 0x9480
movq %rax, 0x838(%r14)
addq $0x28, %rax
movl $0xff, %ecx
movq %rax, -0x10(%rax)
movl $0x0, -0x20(%rax)
addq $0x28, %rax
decl %ecx
jne 0xa364
movq $0x0, -0x10(%rax)
movl $0x0, -0x20(%rax)
movq 0x838(%r14), %r15
movq 0x18(%r15), %rax
movq %rax, 0x838(%r14)
movl $0x0, 0x8(%r15)
jmp 0xa4c7
movl $0x11, %ebp
cmpq $0x10000, %rbx          # imm = 0x10000
ja 0xa3c8
leaq -0x1(%rbx), %rax
shrq $0x8, %rax
leaq 0x107b0e(%rip), %rcx    # 0x111ed0
movl (%rcx,%rax,4), %ebp
addl $0x8, %ebp
movslq %ebp, %rax
movq 0x838(%r14,%rax,8), %r15
testq %r15, %r15
je 0xa3e9
movq 0x18(%r15), %rcx
movq %rcx, 0x838(%r14,%rax,8)
jmp 0xa4c7
cmpq $0x0, 0x838(%r14)
jne 0xa42f
movl $0x2800, %edi           # imm = 0x2800
callq 0x9480
movq %rax, 0x838(%r14)
addq $0x28, %rax
movl $0xff, %ecx
movq %rax, -0x10(%rax)
movl $0x0, -0x20(%rax)
addq $0x28, %rax
decl %ecx
jne 0xa40d
movq $0x0, -0x10(%rax)
movl $0x0, -0x20(%rax)
movq 0x838(%r14), %r15
movq 0x18(%r15), %rax
movl $0x1, %edx
movl %ebp, %ecx
shll %cl, %edx
movq %rax, 0x838(%r14)
movl $0x0, 0x8(%r15)
cmpl $0x11, %ebp
movslq %edx, %rax
cmovgeq %rbx, %rax
addq $0x7, %rax
movq %rax, %r12
andq $-0x8, %r12
movq 0x8c8(%r14), %rcx
addq %r12, %rcx
cmpq $0x10001, %rcx          # imm = 0x10001
jb 0xa4ab
cmpq $0x200, %rax            # imm = 0x200
jb 0xa48c
movq %r12, %rdi
callq 0x9480
jmp 0xa4c0
movl $0x10000, %edi          # imm = 0x10000
callq 0x9480
movq %rax, 0x8d0(%r14)
movq $0x0, 0x8c8(%r14)
movq %r12, %rcx
movq 0x8d0(%r14), %rax
addq 0x8c8(%r14), %rax
movq %rcx, 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