// File: /workspace/github_c_makefile_star2_O3/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 0x2b998
movq $0x0, 0xc8(%rbx)
movq 0x2fbd0(%rip), %rdx     # 0x5b558
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2bc79
jmp 0x2bb2e
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)
movaps %xmm0, 0x10(%rsi)
movaps %xmm0, (%rsi)
movq $0x0, 0x30(%rsi)
leaq 0x2fce0(%rip), %r12     # 0x5b6a8
movq (%r12), %rcx
movl $0x1, (%rsp)
movq %rbx, %rdi
xorl %edx, %edx
movq %rcx, %r8
callq 0x2e5fb
testq %rax, %rax
je 0x2ba38
movq %rax, %r14
movb 0xf(%rsp), %al
movq (%r12), %rcx
movq %rbx, (%r14)
movq %r14, 0x8(%r14)
movq %rcx, 0x10(%r14)
movb %al, 0x18(%r14)
movw $0x101, 0x19(%r14)      # imm = 0x101
movq %r14, %rdi
movq %r14, %rsi
callq 0x2e465
testb %al, %al
je 0x2baa6
movq (%r12), %rcx
leaq 0x10(%rsp), %rsi
movq %rbx, %rdi
movq %r14, %rdx
movl $0x1, %r8d
callq 0x2ebea
jmp 0x2bb2b
leaq 0x8(%rbx), %r15
movq %r15, %rdi
callq 0x10440
movq (%r12), %rcx
leaq 0xe(%rsp), %rax
movq %rax, (%rsp)
leaq 0x10(%rsp), %rsi
leaq 0xf(%rsp), %r9
movq %rbx, %rdi
xorl %edx, %edx
movq %rcx, %r8
callq 0x2ead2
testq %rax, %rax
je 0x2bb23
movq %rax, %r14
cmpb $0x0, 0xe(%rsp)
jne 0x2bab2
movq (%r12), %rsi
movq 0x2fad2(%rip), %rcx     # 0x5b558
shlq $0xc, %rcx
movl (%rbx), %r8d
movq %r14, %rdi
xorl %edx, %edx
callq *0x20(%rsp)
testb %al, %al
je 0x2bab2
movq (%r12), %rcx
movzbl 0xe(%rsp), %r8d
jmp 0x2bb13
movb $0x1, 0xe(%rsp)
movb $0x1, %dl
jmp 0x2bb4b
movb 0xf(%rsp), %al
movq (%r12), %rcx
movq %rbx, (%r14)
movq %r14, 0x8(%r14)
movq %rcx, 0x10(%r14)
movb %al, 0x18(%r14)
movw $0x101, 0x19(%r14)      # imm = 0x101
movq %r14, %rdi
movq %r14, %rsi
callq 0x2e465
testb %al, %al
je 0x2bb3f
movb $0x1, %al
cmpb $0x0, 0xe(%rsp)
jne 0x2bb07
movq (%r12), %rsi
movq 0x2fa65(%rip), %rcx     # 0x5b558
shlq $0xc, %rcx
movl (%rbx), %r8d
movq %r14, %rdi
xorl %edx, %edx
callq *0x28(%rsp)
movb 0xe(%rsp), %al
movq (%r12), %rcx
movzbl %al, %r8d
andl $0x1, %r8d
leaq 0x10(%rsp), %rsi
movq %rbx, %rdi
movq %r14, %rdx
callq 0x2f001
movq %r15, %rdi
callq 0x106d0
xorl %r14d, %r14d
movq %r14, %rax
addq $0x50, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq %r15, %rdi
callq 0x106d0
movb 0xe(%rsp), %dl
movq (%r12), %rax
addq %rax, 0x30(%rbx)
movq 0x2f9fe(%rip), %rax     # 0x5b558
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 0x2f9da(%rip), %rsi     # 0x5b568
leaq 0x68(%r14), %r12
addq %rsi, %rsi
orq %rdx, %rsi
orq %r15, %rsi
orq $0x1fe0, %rsi           # imm = 0x1FE0
movq %rsi, 0x68(%r14)
leaq 0x2ead7(%rip), %rdx     # 0x5a684
movb (%rdx), %dl
testl %ecx, %ecx
je 0x2bbde
leaq 0x2fafe(%rip), %r13     # 0x5b6b8
movq (%r13), %rcx
testb %dl, %dl
je 0x2bc26
leaq 0x70(%r14), %rdi
notq %rax
addq %rax, %rcx
leaq (%r12,%rcx,8), %rsi
subq %rdi, %rsi
callq 0x3e7e8
movq (%r13), %rcx
jmp 0x2bc26
testb %dl, %dl
jne 0x2bc50
leaq 0x1(%rax), %rdx
leaq 0x2facb(%rip), %rsi     # 0x5b6b8
movq (%rsi), %rcx
leaq -0x1(%rcx), %rdi
cmpq %rdi, %rdx
jae 0x2bc26
leaq (%r14,%rax,8), %rax
addq $0x70, %rax
movq 0x2f950(%rip), %rcx     # 0x5b558
shlq $0x3, %rcx
negq %rcx
movq %r15, (%rax,%rcx)
incq %rdx
movq (%rsi), %rcx
leaq -0x1(%rcx), %rdi
addq $0x8, %rax
cmpq %rdi, %rdx
jb 0x2bc01
movq 0x2f93b(%rip), %rax     # 0x5b568
movq 0x2f924(%rip), %rdx     # 0x5b558
notq %rdx
addq %rcx, %rdx
addq %rax, %rax
orq %rax, %r15
orq $0x1fe0, %r15           # imm = 0x1FE0
movq %r15, (%r12,%rdx,8)
jmp 0x2b981
leaq 0x70(%r14), %rdi
leaq 0x2fa5d(%rip), %rcx     # 0x5b6b8
notq %rax
addq (%rcx), %rax
leaq (%r12,%rax,8), %rsi
subq %rdi, %rsi
callq 0x3e7a6
movq 0x2f8e4(%rip), %rax     # 0x5b558
jmp 0x2bbe2