// File: /workspace/github_c_makefile_star2_O2/gplessis[P]dotdeb-redis/deps/jemalloc/src/arena.c
// Function: arena_chunk_alloc
static arena_chunk_t *
arena_chunk_alloc(arena_t *arena)
{
	arena_chunk_t *chunk;

	if (arena->spare != NULL)
		chunk = arena_chunk_init_spare(arena);
	else {
		chunk = arena_chunk_init_hard(arena);
		if (chunk == NULL)
			return (NULL);
	}

	/* Insert the run into the runs_avail tree. */
	arena_avail_insert(arena, chunk, map_bias, chunk_npages-map_bias);

	return (chunk);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x50, %rsp
movq %rdi, %rbx
movq 0xc8(%rdi), %r14
testq %r14, %r14
je 0x26752
andq $0x0, 0xc8(%rbx)
jmp 0x26965
xorl %eax, %eax
leaq 0xf(%rsp), %r9
movb %al, (%r9)
movb %al, 0xe(%rsp)
xorps %xmm0, %xmm0
leaq 0x10(%rsp), %rsi
movaps %xmm0, 0x20(%rsi)
andq $0x0, 0x30(%rsi)
movaps %xmm0, 0x10(%rsi)
movaps %xmm0, (%rsi)
leaq 0x30f29(%rip), %r13     # 0x576a8
movq (%r13), %rcx
movl $0x1, (%rsp)
movq %rbx, %rdi
xorl %edx, %edx
movq %rcx, %r8
callq 0x28fe6
testq %rax, %rax
je 0x267d4
movq %rax, %r14
movzbl 0xf(%rsp), %edx
movq %rbx, %rdi
movq %rax, %rsi
callq 0x26bad
testb %al, %al
je 0x26845
movq (%r13), %rcx
leaq 0x10(%rsp), %rsi
pushq $0x1
popq %r8
movq %rbx, %rdi
movq %r14, %rdx
callq 0x29533
jmp 0x26988
leaq 0x8(%rbx), %r15
movq %r15, %rdi
callq 0x10440
movq (%r13), %rcx
leaq 0xe(%rsp), %rax
movq %rax, (%rsp)
xorl %r14d, %r14d
leaq 0x10(%rsp), %rsi
leaq 0xf(%rsp), %r9
movq %rbx, %rdi
xorl %edx, %edx
movq %rcx, %r8
callq 0x294b0
testq %rax, %rax
je 0x268ae
movq %rax, %r12
cmpb $0x0, 0xe(%rsp)
jne 0x2684e
movq (%r13), %rsi
movq 0x30d33(%rip), %rcx     # 0x57558
shlq $0xc, %rcx
movl (%rbx), %r8d
movq %r12, %rdi
xorl %edx, %edx
callq *0x20(%rsp)
testb %al, %al
je 0x2684e
movq (%r13), %rcx
movzbl 0xe(%rsp), %r8d
jmp 0x26896
movb $0x1, 0xe(%rsp)
movb $0x1, %dl
jmp 0x268c3
movzbl 0xf(%rsp), %edx
movq %rbx, %rdi
movq %r12, %rsi
callq 0x26bad
testb %al, %al
je 0x268ab
movb $0x1, %al
cmpb $0x0, 0xe(%rsp)
jne 0x2688a
movq (%r13), %rsi
movq 0x30ce2(%rip), %rcx     # 0x57558
shlq $0xc, %rcx
movl (%rbx), %r8d
movq %r12, %rdi
xorl %edx, %edx
callq *0x28(%rsp)
movb 0xe(%rsp), %al
movq (%r13), %rcx
movzbl %al, %r8d
andl $0x1, %r8d
leaq 0x10(%rsp), %rsi
movq %rbx, %rdi
movq %r12, %rdx
callq 0x298f7
xorl %r14d, %r14d
jmp 0x268ae
movq %r12, %r14
movq %r15, %rdi
callq 0x106d0
testq %r14, %r14
je 0x26988
movb 0xe(%rsp), %dl
movq (%r13), %rax
addq %rax, 0x30(%rbx)
movq 0x30c86(%rip), %rax     # 0x57558
movq %rax, %rcx
shlq $0xc, %rcx
addq %rcx, 0x50(%rbx)
movzbl 0xf(%rsp), %ecx
movl %ecx, %esi
xorl $0x1, %esi
shll $0x3, %esi
xorl %r15d, %r15d
testb $0x1, %dl
notb %dl
cmovneq %rsi, %r15
movzbl %dl, %edx
andl $0x1, %edx
shll $0x2, %edx
movq 0x30c62(%rip), %rsi     # 0x57568
leaq 0x68(%r14), %r12
addq %rsi, %rsi
orq %rdx, %rsi
orq %r15, %rsi
orq $0x1fe0, %rsi           # imm = 0x1FE0
movq %rsi, 0x68(%r14)
leaq 0x2fd5f(%rip), %rdx     # 0x56684
movb (%rdx), %sil
testl %ecx, %ecx
je 0x2698d
leaq 0x30d85(%rip), %r13     # 0x576b8
movq (%r13), %rdx
testb %sil, %sil
jne 0x269cb
movq 0x30c21(%rip), %rax     # 0x57568
movq 0x30c0a(%rip), %rcx     # 0x57558
notq %rcx
addq %rdx, %rcx
addq %rax, %rax
orq %rax, %r15
orq $0x1fe0, %r15           # imm = 0x1FE0
movq %r15, (%r12,%rcx,8)
movq 0x30bec(%rip), %rdx     # 0x57558
movq %rbx, %rdi
movq %r14, %rsi
callq 0x26a1b
movq %r14, %rax
addq $0x50, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
xorl %r14d, %r14d
jmp 0x26977
testb %sil, %sil
jne 0x269ea
leaq (%r14,%rax,8), %rcx
addq $0x70, %rcx
incq %rax
leaq 0x30d14(%rip), %rsi     # 0x576b8
movq (%rsi), %rdx
leaq -0x1(%rdx), %rdi
cmpq %rdi, %rax
jae 0x26940
movq 0x30ba1(%rip), %rdx     # 0x57558
shlq $0x3, %rdx
negq %rdx
movq %r15, (%rcx,%rdx)
addq $0x8, %rcx
incq %rax
jmp 0x269a4
leaq 0x70(%r14), %rdi
notq %rax
addq %rax, %rdx
leaq (%r12,%rdx,8), %rsi
subq %rdi, %rsi
callq 0x38fac
movq (%r13), %rdx
jmp 0x26940
leaq 0x70(%r14), %rdi
leaq 0x30cc3(%rip), %rcx     # 0x576b8
notq %rax
addq (%rcx), %rax
leaq (%r12,%rax,8), %rsi
subq %rdi, %rsi
callq 0x38f6a
movq 0x30b4a(%rip), %rax     # 0x57558
jmp 0x26992