// File: /workspace/github_c_makefile_star2_O0/zhou-yuxin[P]redis-aof-no-cow/deps/jemalloc/src/arena.c
// Function: arena_chunk_alloc_internal_hard
static arena_chunk_t *
arena_chunk_alloc_internal_hard(tsdn_t *tsdn, arena_t *arena,
    chunk_hooks_t *chunk_hooks, bool *zero, bool *commit)
{
	arena_chunk_t *chunk;
	size_t sn;

	malloc_mutex_unlock(tsdn, &arena->lock);

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

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

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
addq $0x10, %rsi
callq 0x3a6b0
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
leaq 0x5d728(%rip), %rax     # 0xa40a8
movq (%rax), %r8
leaq 0x5d71e(%rip), %rax     # 0xa40a8
movq (%rax), %r9
movq -0x20(%rbp), %r10
movq -0x28(%rbp), %rax
xorl %ecx, %ecx
leaq -0x38(%rbp), %r11
movq %r11, (%rsp)
movq %r10, 0x8(%rsp)
movq %rax, 0x10(%rsp)
callq 0x52090
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
je 0x46a4b
movq -0x28(%rbp), %rax
testb $0x1, (%rax)
jne 0x46a4b
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x30(%rbp), %rdi
leaq 0x5d6cb(%rip), %rcx     # 0xa40a8
movq (%rcx), %rsi
movq 0x5d5b9(%rip), %rcx     # 0xa3fa0
shlq $0xc, %rcx
movq -0x10(%rbp), %rdx
movl (%rdx), %r8d
xorl %edx, %edx
callq *%rax
testb $0x1, %al
jne 0x469fc
jmp 0x46a49
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x30(%rbp), %rcx
leaq 0x5d695(%rip), %rax     # 0xa40a8
movq (%rax), %r8
movq -0x38(%rbp), %r9
movq -0x20(%rbp), %rax
movb (%rax), %r10b
movq -0x28(%rbp), %rax
movb (%rax), %al
andb $0x1, %r10b
andb $0x1, %al
movzbl %r10b, %r10d
movl %r10d, (%rsp)
movzbl %al, %eax
movl %eax, 0x8(%rsp)
callq 0x52a50
movq $0x0, -0x30(%rbp)
jmp 0x46a4b
cmpq $0x0, -0x30(%rbp)
je 0x46b02
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x30(%rbp), %rdx
movq -0x38(%rbp), %rcx
movq -0x20(%rbp), %rax
movb (%rax), %al
andb $0x1, %al
movzbl %al, %r8d
callq 0x468c0
testb $0x1, %al
jne 0x46a80
jmp 0x46b02
movq -0x28(%rbp), %rax
testb $0x1, (%rax)
jne 0x46ab5
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x30(%rbp), %rdi
leaq 0x5d60c(%rip), %rcx     # 0xa40a8
movq (%rcx), %rsi
movq 0x5d4fa(%rip), %rcx     # 0xa3fa0
shlq $0xc, %rcx
movq -0x10(%rbp), %rdx
movl (%rdx), %r8d
xorl %edx, %edx
callq *%rax
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x30(%rbp), %rcx
leaq 0x5d5dc(%rip), %rax     # 0xa40a8
movq (%rax), %r8
movq -0x38(%rbp), %r9
movq -0x20(%rbp), %rax
movb (%rax), %r10b
movq -0x28(%rbp), %rax
movb (%rax), %al
andb $0x1, %r10b
andb $0x1, %al
movzbl %r10b, %r10d
movl %r10d, (%rsp)
movzbl %al, %eax
movl %eax, 0x8(%rsp)
callq 0x52a50
movq $0x0, -0x30(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
addq $0x10, %rsi
callq 0x3a660
movq -0x30(%rbp), %rax
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax)