// File: /workspace/github_c_makefile_star2_O2/zhou-yuxin[P]redis-aof-no-cow/deps/jemalloc/src/arena.c
// Function: arena_chunk_alloc
static arena_chunk_t *
arena_chunk_alloc(tsdn_t *tsdn, arena_t *arena)
{
	arena_chunk_t *chunk;

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

	ql_elm_new(&chunk->node, ql_link);
	ql_tail_insert(&arena->achunks, &chunk->node, ql_link);
	arena_avail_insert(arena, chunk, map_bias, chunk_npages-map_bias);

	return (chunk);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rsi, %rbx
movq 0x110(%rsi), %r14
testq %r14, %r14
je 0x1ee42
andq $0x0, 0x110(%rbx)
jmp 0x1f0bf
movq %rdi, %r15
xorl %eax, %eax
leaq 0x7(%rsp), %r13
movb %al, (%r13)
leaq 0x6(%rsp), %r12
movb %al, (%r12)
xorps %xmm0, %xmm0
leaq 0x20(%rsp), %rdx
movaps %xmm0, 0x20(%rdx)
andq $0x0, 0x30(%rdx)
movaps %xmm0, 0x10(%rdx)
movaps %xmm0, (%rdx)
leaq 0x2a250(%rip), %rbp     # 0x490c8
movq (%rbp), %r8
leaq 0x10(%rsp), %rax
movq %rbx, %rsi
xorl %ecx, %ecx
movq %r8, %r9
pushq $0x1
pushq %r12
pushq %r13
pushq %rax
callq 0x2146e
addq $0x20, %rsp
testq %rax, %rax
je 0x1eeeb
movq %rax, %r14
movq 0x10(%rsp), %rcx
movzbl 0x7(%rsp), %r8d
movq %r15, %rdi
movq %rbx, %rsi
movq %rax, %rdx
callq 0x1f225
testb %al, %al
je 0x1f00d
movq (%rbp), %r8
movq 0x10(%rsp), %r9
subq $0x8, %rsp
leaq 0x28(%rsp), %rdx
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rcx
pushq $0x1
callq 0x21b37
popq %rax
popq %rcx
jmp 0x1f127
leaq 0x10(%rbx), %rdi
movq %rdi, 0x18(%rsp)
callq 0xb380
movq (%rbp), %r8
subq $0x8, %rsp
leaq 0x10(%rsp), %rax
xorl %r14d, %r14d
leaq 0x28(%rsp), %rdx
movq %r15, %rdi
movq %rbx, %rsi
xorl %ecx, %ecx
movq %r8, %r9
pushq %r12
pushq %r13
pushq %rax
callq 0x21943
addq $0x20, %rsp
testq %rax, %rax
je 0x1effa
movq %rax, %r13
cmpb $0x0, 0x6(%rsp)
jne 0x1ef80
movq (%rbp), %rsi
movq 0x2a07b(%rip), %rcx     # 0x48fc0
shlq $0xc, %rcx
movl (%rbx), %r8d
movq %r13, %rdi
xorl %edx, %edx
callq *0x30(%rsp)
testb %al, %al
je 0x1ef80
movq (%rbp), %r8
movq 0x8(%rsp), %r9
movzbl 0x7(%rsp), %eax
movzbl 0x6(%rsp), %r10d
leaq 0x20(%rsp), %rdx
movq %r15, %rdi
movq %rbx, %rsi
movq %r13, %rcx
pushq %r10
pushq %rax
jmp 0x1efeb
movq 0x8(%rsp), %rcx
movzbl 0x7(%rsp), %r8d
movq %r15, %rdi
movq %rbx, %rsi
movq %r13, %rdx
callq 0x1f225
testb %al, %al
je 0x1eff7
movb $0x1, %al
cmpb $0x0, 0x6(%rsp)
jne 0x1efc5
movq (%rbp), %rsi
movq 0x2a00f(%rip), %rcx     # 0x48fc0
shlq $0xc, %rcx
movl (%rbx), %r8d
movq %r13, %rdi
xorl %edx, %edx
callq *0x38(%rsp)
movb 0x6(%rsp), %al
movq (%rbp), %r8
movq 0x8(%rsp), %r9
movzbl 0x7(%rsp), %r10d
movzbl %al, %eax
andl $0x1, %eax
leaq 0x20(%rsp), %rdx
movq %r15, %rdi
movq %rbx, %rsi
movq %r13, %rcx
pushq %rax
pushq %r10
callq 0x21eb3
popq %rax
popq %rcx
xorl %r14d, %r14d
jmp 0x1effa
movq %r13, %r14
movq 0x18(%rsp), %rdi
callq 0xb5a0
testq %r14, %r14
je 0x1f127
movq (%rbp), %rax
addq %rax, 0x60(%rbx)
movq 0x29fa4(%rip), %rax     # 0x48fc0
movq %rax, %rcx
shlq $0xc, %rcx
addq %rcx, 0x88(%rbx)
movb $0x1, 0x70(%r14)
movzbl 0x6(%rsp), %ecx
movl %ecx, %edx
notb %dl
andl $0x1, %ecx
shll $0x3, %ecx
movb 0x7(%rsp), %sil
xorl %r15d, %r15d
testb %sil, %sil
cmoveq %rcx, %r15
movzbl %dl, %ecx
andl $0x1, %ecx
shll $0x2, %ecx
movq 0x29f73(%rip), %rdx     # 0x48fd0
leaq 0x78(%r14), %r12
addq %rdx, %rdx
orq %rcx, %rdx
orq %r15, %rdx
orq $0x1fe0, %rdx           # imm = 0x1FE0
movq %rdx, 0x78(%r14)
leaq 0x29520(%rip), %rcx     # 0x4859c
movb (%rcx), %cl
testb %sil, %sil
je 0x1f12c
leaq 0x2a04a(%rip), %r13     # 0x490d8
movq (%r13), %rdx
testb %cl, %cl
jne 0x1f170
movq 0x29f2f(%rip), %rax     # 0x48fd0
movq 0x29f18(%rip), %rcx     # 0x48fc0
notq %rcx
addq %rdx, %rcx
addq %rax, %rax
orq %rax, %r15
orq $0x1fe0, %r15           # imm = 0x1FE0
movq %r15, (%r12,%rcx,8)
movq %r14, 0x50(%r14)
movq %r14, 0x58(%r14)
movq 0x100(%rbx), %rcx
movq %r14, %rax
testq %rcx, %rcx
je 0x1f0fc
movq 0x58(%rcx), %rax
movq %rax, 0x58(%r14)
movq 0x100(%rbx), %rcx
movq %rcx, 0x50(%r14)
movq %r14, 0x50(%rax)
movq 0x100(%rbx), %rax
movq %r14, 0x58(%rax)
movq 0x50(%r14), %rax
movq %rax, 0x100(%rbx)
movq 0x29eb6(%rip), %rdx     # 0x48fc0
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1f1c9
movq %r14, %rax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %r14d, %r14d
jmp 0x1f115
testb %cl, %cl
jne 0x1f192
leaq (%r14,%rax,8), %rcx
addq $0x80, %rcx
incq %rax
leaq 0x29f93(%rip), %rsi     # 0x490d8
movq (%rsi), %rdx
leaq -0x1(%rdx), %rdi
cmpq %rdi, %rax
jae 0x1f09a
movq 0x29e64(%rip), %rdx     # 0x48fc0
shlq $0x3, %rdx
negq %rdx
movq %r15, (%rcx,%rdx)
addq $0x8, %rcx
incq %rax
jmp 0x1f145
leaq 0x80(%r14), %rdi
notq %rax
addq %rax, %rdx
leaq (%r12,%rdx,8), %rsi
subq %rdi, %rsi
callq 0x324d8
movq (%r13), %rdx
jmp 0x1f09a
leaq 0x80(%r14), %rdi
leaq 0x29f38(%rip), %rcx     # 0x490d8
notq %rax
addq (%rcx), %rax
leaq (%r12,%rax,8), %rsi
subq %rdi, %rsi
callq 0x32496
movq 0x29e07(%rip), %rax     # 0x48fc0
jmp 0x1f130