// File: /workspace/github_c_makefile_star2_O0/gplessis[P]dotdeb-redis/deps/jemalloc/src/chunk.c
// Function: chunk_alloc_core
static void *
chunk_alloc_core(arena_t *arena, void *new_addr, size_t size, size_t alignment,
    bool *zero, bool *commit, dss_prec_t dss_prec)
{
	void *ret;
	chunk_hooks_t chunk_hooks = CHUNK_HOOKS_INITIALIZER;

	assert(size != 0);
	assert((size & chunksize_mask) == 0);
	assert(alignment != 0);
	assert((alignment & chunksize_mask) == 0);

	/* Retained. */
	if ((ret = chunk_recycle(arena, &chunk_hooks,
	    &arena->chunks_szad_retained, &arena->chunks_ad_retained, false,
	    new_addr, size, alignment, zero, commit, true)) != NULL)
		return (ret);

	/* "primary" dss. */
	if (have_dss && dss_prec == dss_prec_primary && (ret =
	    chunk_alloc_dss(arena, new_addr, size, alignment, zero, commit)) !=
	    NULL)
		return (ret);
	/*
	 * mmap.  Requesting an address is not implemented for
	 * chunk_alloc_mmap(), so only call it if (new_addr == NULL).
	 */
	if (new_addr == NULL && (ret = chunk_alloc_mmap(size, alignment, zero,
	    commit)) != NULL)
		return (ret);
	/* "secondary" dss. */
	if (have_dss && dss_prec == dss_prec_secondary && (ret =
	    chunk_alloc_dss(arena, new_addr, size, alignment, zero, commit)) !=
	    NULL)
		return (ret);

	/* All strategies for allocation failed. */
	return (NULL);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0xa8, %rsp
movl 0x10(%rbp), %eax
movq %rdi, -0x18(%rbp)
movq %rsi, -0x20(%rbp)
movq %rdx, -0x28(%rbp)
movq %rcx, -0x30(%rbp)
movq %r8, -0x38(%rbp)
movq %r9, -0x40(%rbp)
leaq -0x80(%rbp), %rdi
xorl %esi, %esi
movl $0x38, %edx
callq 0x10250
jmp 0x52039
jmp 0x5203b
jmp 0x5203d
jmp 0x5203f
jmp 0x52041
jmp 0x52043
jmp 0x52045
movq -0x18(%rbp), %rdi
movq -0x18(%rbp), %rdx
addq $0x2e0, %rdx            # imm = 0x2E0
movq -0x18(%rbp), %rcx
addq $0x350, %rcx            # imm = 0x350
movq -0x20(%rbp), %r9
movq -0x28(%rbp), %rbx
movq -0x30(%rbp), %r11
movq -0x38(%rbp), %r10
movq -0x40(%rbp), %rax
leaq -0x80(%rbp), %rsi
xorl %r8d, %r8d
movq %rbx, (%rsp)
movq %r11, 0x8(%rsp)
movq %r10, 0x10(%rsp)
movq %rax, 0x18(%rsp)
movl $0x1, 0x20(%rsp)
callq 0x50580
movq %rax, -0x48(%rbp)
cmpq $0x0, %rax
je 0x520b1
movq -0x48(%rbp), %rax
movq %rax, -0x10(%rbp)
jmp 0x52157
cmpl $0x1, 0x10(%rbp)
jne 0x520e8
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x28(%rbp), %rdx
movq -0x30(%rbp), %rcx
movq -0x38(%rbp), %r8
movq -0x40(%rbp), %r9
callq 0x52360
movq %rax, -0x48(%rbp)
cmpq $0x0, %rax
je 0x520e8
movq -0x48(%rbp), %rax
movq %rax, -0x10(%rbp)
jmp 0x52157
cmpq $0x0, -0x20(%rbp)
jne 0x52118
movq -0x28(%rbp), %rdi
movq -0x30(%rbp), %rsi
movq -0x38(%rbp), %rdx
movq -0x40(%rbp), %rcx
callq 0x52720
movq %rax, -0x48(%rbp)
cmpq $0x0, %rax
je 0x52118
movq -0x48(%rbp), %rax
movq %rax, -0x10(%rbp)
jmp 0x52157
cmpl $0x2, 0x10(%rbp)
jne 0x5214f
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x28(%rbp), %rdx
movq -0x30(%rbp), %rcx
movq -0x38(%rbp), %r8
movq -0x40(%rbp), %r9
callq 0x52360
movq %rax, -0x48(%rbp)
cmpq $0x0, %rax
je 0x5214f
movq -0x48(%rbp), %rax
movq %rax, -0x10(%rbp)
jmp 0x52157
movq $0x0, -0x10(%rbp)
movq -0x10(%rbp), %rax
addq $0xa8, %rsp
popq %rbx
popq %rbp
retq
nopw %cs:(%rax,%rax)