// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/deps/jemalloc/src/arena.c
// Function: arena_avail_insert
static arena_chunk_t *
arena_chunk_alloc_internal_hard(arena_t *arena, chunk_hooks_t *chunk_hooks,
    bool *zero, bool *commit)
{
	arena_chunk_t *chunk;

	malloc_mutex_unlock(&arena->lock);

	chunk = (arena_chunk_t *)chunk_alloc_wrapper(arena, chunk_hooks, NULL,
	    chunksize, chunksize, zero, commit);
	if (chunk != NULL && !*commit) {
		/* Commit header. */
		if (chunk_hooks->commit(chunk, chunksize, 0, map_bias <<
		    LG_PAGE, arena->ind)) {
			chunk_dalloc_wrapper(arena, chunk_hooks,
			    (void *)chunk, chunksize, *commit);
			chunk = NULL;
		}
	}
	if (chunk != NULL && arena_chunk_register(arena, chunk, *zero)) {
		if (!*commit) {
			/* Undo commit of header. */
			chunk_hooks->decommit(chunk, chunksize, 0, map_bias <<
			    LG_PAGE, arena->ind);
		}
		chunk_dalloc_wrapper(arena, chunk_hooks, (void *)chunk,
		    chunksize, *commit);
		chunk = NULL;
	}

	malloc_mutex_lock(&arena->lock);
	return (chunk);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x838, %rsp            # imm = 0x838
movq 0x2f8cf(%rip), %rcx     # 0x5b560
leaq (%rdx,%rdx,2), %rax
shlq $0x5, %rax
addq %rsi, %rax
movq %rcx, 0x8(%rsp)
addq %rcx, %rax
xorl %ecx, %ecx
subq 0x2f8ab(%rip), %rcx     # 0x5b558
leaq (%rcx,%rcx,2), %rcx
shlq $0x5, %rcx
leaq (%rax,%rcx), %r12
leaq 0xf8(%rdi), %rsi
movq %rsi, (%rcx,%rax)
movq %rsi, %rdx
orq $0x1, %rdx
movq %rdx, 0x8(%rcx,%rax)
movq %rdi, 0x10(%rsp)
movq 0xf0(%rdi), %r14
leaq 0x30(%rsp), %r13
movq %r14, (%r13)
movq %rsi, 0x28(%rsp)
cmpq %rsi, %r14
je 0x2bdeb
leaq 0x2f9b6(%rip), %rax     # 0x5b6b0
movq (%rax), %rbp
notq %rbp
movq %rbp, %rcx
andq %r12, %rcx
movq 0x8(%rsp), %rax
movq %rcx, 0x20(%rsp)
addq %rax, %rcx
movq %r12, %rax
subq %rcx, %rax
movabsq $-0x5555555555555555, %rcx # imm = 0xAAAAAAAAAAAAAAAB
mulq %rcx
shrq $0x6, %rdx
movq %rdx, 0x18(%rsp)
movabsq $0x7ffffffffffff000, %rbx # imm = 0x7FFFFFFFFFFFF000
movq %r12, %rdi
testb $0x1, %r12b
jne 0x2bd51
movq 0x20(%rsp), %rax
movq 0x18(%rsp), %rcx
movq 0x68(%rax,%rcx,8), %rdi
shrq %rdi
andq %rbx, %rdi
callq 0x2bf06
movq %rax, %r15
movq %r14, %rcx
andq %rbp, %rcx
movq 0x8(%rsp), %rax
leaq (%rax,%rcx), %rdx
movq %r14, %rax
subq %rdx, %rax
movabsq $-0x5555555555555555, %rdx # imm = 0xAAAAAAAAAAAAAAAB
mulq %rdx
shrq $0x6, %rdx
movq 0x68(%rcx,%rdx,8), %rdi
shrq %rdi
andq %rbx, %rdi
callq 0x2bf06
xorl %ecx, %ecx
cmpq %rax, %r15
seta %cl
sbbl $0x0, %ecx
cmpq %rax, %r15
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
cmovel %edx, %ecx
testb $0x1, %r12b
jne 0x2bdc3
cmpq %rax, %r15
jne 0x2bdc3
xorl %ecx, %ecx
cmpq %r12, %r14
seta %cl
sbbl $0x0, %ecx
negl %ecx
movl %ecx, 0x8(%r13)
testl %ecx, %ecx
js 0x2bdd5
movq 0x8(%r14), %r14
andq $-0x2, %r14
jmp 0x2bdd8
movq (%r14), %r14
movq %r14, 0x10(%r13)
addq $0x10, %r13
cmpq 0x28(%rsp), %r14
jne 0x2bd39
movq %r12, (%r13)
addq $-0x10, %r13
leaq 0x30(%rsp), %rax
cmpq %rax, %r13
jb 0x2bedf
movq (%r13), %rcx
cmpl $0x0, 0x8(%r13)
js 0x2be5c
movq 0x8(%rcx), %rdx
andl $0x1, %edx
orq %r12, %rdx
movq %rdx, 0x8(%rcx)
testb $0x1, 0x8(%r12)
je 0x2bef4
movq (%rcx), %rsi
movq 0x8(%rsi), %rdi
testb $0x1, %dil
jne 0x2be7e
andl $0x1, %edx
andq $-0x2, %r12
movq (%r12), %rsi
orq %rdx, %rsi
movq %rsi, 0x8(%rcx)
movq %rcx, (%r12)
leaq 0x8(%r12), %rdi
movq 0x8(%r12), %rsi
andq $-0x2, %rsi
orq %rdx, %rsi
jmp 0x2be98
movq %r12, (%rcx)
testb $0x1, 0x8(%r12)
je 0x2bef4
movq (%r12), %rdx
movq 0x8(%rdx), %rsi
testb $0x1, %sil
jne 0x2bea9
movq %rcx, %r12
jmp 0x2bed2
addq $0x8, %r12
andq $-0x2, %rdi
movq %rdi, 0x8(%rsi)
movq (%r12), %rsi
andq $-0x2, %rsi
movq %r12, %rdi
movq %rcx, %r12
movq %rsi, (%rdi)
movq 0x8(%rcx), %rdx
addq $0x8, %rcx
orq $0x1, %rdx
jmp 0x2becc
leaq 0x8(%r12), %rdi
andq $-0x2, %rsi
movq %rsi, 0x8(%rdx)
movq (%rdi), %rdx
movq %rdx, %rsi
andq $-0x2, %rsi
movq %rsi, (%rcx)
andl $0x1, %edx
orq %rcx, %rdx
movq %rdi, %rcx
movq %rdx, (%rcx)
movq %r12, %rcx
movq %rcx, (%r13)
addq $-0x10, %r13
jmp 0x2bdf8
movq 0x30(%rsp), %rax
movq 0x10(%rsp), %rcx
movq %rax, 0xf0(%rcx)
andb $-0x2, 0x8(%rax)
addq $0x838, %rsp            # imm = 0x838
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq