// File: /workspace/github_c_makefile_star2_O1/erikdubbelboer[P]discnt/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 0x3da0b
movq $0x0, 0xc8(%rbx)
jmp 0x3dcd4
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 0x46c5d(%rip), %r13     # 0x84698
movq (%r13), %rcx
movl $0x1, (%rsp)
movq %rbx, %rdi
xorl %edx, %edx
movq %rcx, %r8
callq 0x406a5
testq %rax, %rax
je 0x3daae
movq %rax, %r14
movb 0xf(%rsp), %al
movq (%r13), %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 0x40504
testb %al, %al
je 0x3db2e
movq (%r13), %rcx
leaq 0x10(%rsp), %rsi
movq %rbx, %rdi
movq %r14, %rdx
movl $0x1, %r8d
callq 0x40c92
xorl %r14d, %r14d
jmp 0x3dbcd
leaq 0x8(%rbx), %r15
movq %r15, %rdi
callq 0x125c0
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 0x40b77
testq %rax, %rax
je 0x3db38
movq %rax, %r12
cmpb $0x0, 0xe(%rsp)
jne 0x3db35
movq (%r13), %rsi
movq 0x46a4d(%rip), %rcx     # 0x84548
shlq $0xc, %rcx
movl (%rbx), %r8d
movq %r12, %rdi
xorl %edx, %edx
callq *0x20(%rsp)
testb %al, %al
je 0x3db35
movq (%r13), %rcx
movzbl 0xe(%rsp), %r8d
leaq 0x10(%rsp), %rsi
movq %rbx, %rdi
movq %r12, %rdx
callq 0x4108f
xorl %r14d, %r14d
jmp 0x3db38
movb $0x1, 0xe(%rsp)
jmp 0x3dbb1
movq %r12, %r14
testq %r14, %r14
je 0x3dba6
movb 0xf(%rsp), %al
movq (%r13), %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 0x40504
testb %al, %al
je 0x3dba9
cmpb $0x0, 0xe(%rsp)
jne 0x3db8c
movq (%r13), %rsi
movq 0x469cc(%rip), %rcx     # 0x84548
shlq $0xc, %rcx
movl (%rbx), %r8d
movq %r14, %rdi
xorl %edx, %edx
callq *0x28(%rsp)
movq (%r13), %rcx
movzbl 0xe(%rsp), %r8d
leaq 0x10(%rsp), %rsi
movq %rbx, %rdi
movq %r14, %rdx
callq 0x4108f
xorl %r14d, %r14d
movq %r15, %rdi
callq 0x12960
testq %r14, %r14
je 0x3dbcd
movq (%r13), %rax
addq %rax, 0x30(%rbx)
movq 0x46983(%rip), %rax     # 0x84548
shlq $0xc, %rax
addq %rax, 0x50(%rbx)
testq %r14, %r14
je 0x3dc4d
movzbl 0xe(%rsp), %eax
movl %eax, %ecx
notb %cl
andl $0x1, %eax
shll $0x3, %eax
movb 0xf(%rsp), %dl
xorl %r15d, %r15d
testb %dl, %dl
cmoveq %rax, %r15
movzbl %cl, %eax
andl $0x1, %eax
shll $0x2, %eax
movq 0x4695a(%rip), %rcx     # 0x84558
leaq 0x68(%r14), %r12
addq %rcx, %rcx
orq %rax, %rcx
orq %r15, %rcx
orq $0x1fe0, %rcx           # imm = 0x1FE0
movq 0x4692f(%rip), %rax     # 0x84548
movq %rcx, 0x68(%r14)
leaq 0x45b70(%rip), %rcx     # 0x83794
movb (%rcx), %cl
testb %dl, %dl
je 0x3dc52
testb %cl, %cl
je 0x3dca3
leaq 0x70(%r14), %rdi
leaq 0x46a6f(%rip), %rcx     # 0x846a8
notq %rax
addq (%rcx), %rax
leaq (%r12,%rax,8), %rsi
subq %rdi, %rsi
callq 0x50824
jmp 0x3dca3
xorl %r14d, %r14d
jmp 0x3dccf
testb %cl, %cl
jne 0x3dcfc
movq 0x468e7(%rip), %rdx     # 0x84548
leaq 0x1(%rdx), %rax
leaq 0x46a3c(%rip), %rcx     # 0x846a8
movq (%rcx), %rsi
decq %rsi
cmpq %rsi, %rax
jae 0x3dca3
leaq (%r14,%rdx,8), %rdx
addq $0x70, %rdx
movq 0x468c2(%rip), %rsi     # 0x84548
shlq $0x3, %rsi
negq %rsi
movq %r15, (%rdx,%rsi)
incq %rax
movq (%rcx), %rsi
decq %rsi
addq $0x8, %rdx
cmpq %rsi, %rax
jb 0x3dc7f
leaq 0x469fe(%rip), %rax     # 0x846a8
movq 0x468a7(%rip), %rcx     # 0x84558
movq 0x46890(%rip), %rdx     # 0x84548
notq %rdx
addq (%rax), %rdx
addq %rcx, %rcx
orq %rcx, %r15
orq $0x1fe0, %r15           # imm = 0x1FE0
movq %r15, (%r12,%rdx,8)
testq %r14, %r14
je 0x3dcf7
movq 0x4686d(%rip), %rdx     # 0x84548
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3dd1e
movq %r14, %rax
addq $0x50, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
xorl %r14d, %r14d
jmp 0x3dce6
leaq 0x70(%r14), %rdi
leaq 0x469a1(%rip), %rcx     # 0x846a8
notq %rax
addq (%rcx), %rax
leaq (%r12,%rax,8), %rsi
subq %rdi, %rsi
callq 0x507e2
jmp 0x3dc5a