// File: /workspace/github_c_makefile_star2_O3/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
jne 0x24d43
movq %rdi, %r15
xorl %eax, %eax
leaq 0x7(%rsp), %rbp
movb %al, (%rbp)
leaq 0x6(%rsp), %r12
movb %al, (%r12)
xorps %xmm0, %xmm0
leaq 0x20(%rsp), %rdx
movaps %xmm0, 0x20(%rdx)
movaps %xmm0, 0x10(%rdx)
movaps %xmm0, (%rdx)
movq $0x0, 0x30(%rdx)
leaq 0x2855c(%rip), %r13     # 0x4d0c8
movq (%r13), %r8
leaq 0x18(%rsp), %rax
movq %rbx, %rsi
xorl %ecx, %ecx
movq %r8, %r9
pushq $0x1
pushq %r12
pushq %rbp
pushq %rax
callq 0x26812
addq $0x20, %rsp
testq %rax, %rax
je 0x24bfc
movq %rax, %r14
movq 0x18(%rsp), %rax
movb 0x7(%rsp), %cl
movq (%r13), %rdx
movq %rbx, (%r14)
movq %r14, 0x8(%r14)
movq %rdx, 0x10(%r14)
movq %rax, 0x18(%r14)
movb %cl, 0x20(%r14)
movw $0x101, 0x21(%r14)      # imm = 0x101
movq %r15, %rdi
movq %r14, %rsi
movq %r14, %rdx
callq 0x26668
testb %al, %al
je 0x24d5d
movq (%r13), %r8
movq 0x18(%rsp), %r9
subq $0x8, %rsp
leaq 0x28(%rsp), %rdx
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rcx
pushq $0x1
callq 0x26fb0
addq $0x10, %rsp
jmp 0x24d2e
leaq 0x10(%rbx), %rdi
movq %rdi, 0x10(%rsp)
callq 0xb380
movq (%r13), %r8
subq $0x8, %rsp
leaq 0x10(%rsp), %rax
leaq 0x28(%rsp), %rdx
movq %r15, %rdi
movq %rbx, %rsi
xorl %ecx, %ecx
movq %r8, %r9
pushq %r12
pushq %rbp
pushq %rax
callq 0x26d04
addq $0x20, %rsp
testq %rax, %rax
je 0x24d24
movq %rax, %r14
cmpb $0x0, 0x6(%rsp)
jne 0x24c90
movq (%r13), %rsi
movq 0x2836e(%rip), %rcx     # 0x4cfc0
shlq $0xc, %rcx
movl (%rbx), %r8d
movq %r14, %rdi
xorl %edx, %edx
callq *0x30(%rsp)
testb %al, %al
je 0x24c90
movq (%r13), %r8
movq 0x8(%rsp), %r9
movzbl 0x7(%rsp), %eax
movzbl 0x6(%rsp), %r10d
leaq 0x20(%rsp), %rdx
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rcx
pushq %r10
pushq %rax
jmp 0x24d1b
movq 0x8(%rsp), %rax
movb 0x7(%rsp), %cl
movq (%r13), %rdx
movq %rbx, (%r14)
movq %r14, 0x8(%r14)
movq %rdx, 0x10(%r14)
movq %rax, 0x18(%r14)
movb %cl, 0x20(%r14)
movw $0x101, 0x21(%r14)      # imm = 0x101
movq %r15, %rdi
movq %r14, %rsi
movq %r14, %rdx
callq 0x26668
testb %al, %al
je 0x24d53
movb $0x1, %al
cmpb $0x0, 0x6(%rsp)
jne 0x24cf5
movq (%r13), %rsi
movq 0x282df(%rip), %rcx     # 0x4cfc0
shlq $0xc, %rcx
movl (%rbx), %r8d
movq %r14, %rdi
xorl %edx, %edx
callq *0x38(%rsp)
movb 0x6(%rsp), %al
movq (%r13), %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 %r14, %rcx
pushq %rax
pushq %r10
callq 0x27376
addq $0x10, %rsp
movq 0x10(%rsp), %rdi
callq 0xb5a0
xorl %r14d, %r14d
movq %r14, %rax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq $0x0, 0x110(%rbx)
jmp 0x24e74
movq 0x10(%rsp), %rdi
callq 0xb5a0
movq (%r13), %rax
addq %rax, 0x60(%rbx)
movq 0x28254(%rip), %rax     # 0x4cfc0
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 0x28223(%rip), %rdx     # 0x4cfd0
leaq 0x78(%r14), %r12
addq %rdx, %rdx
orq %rcx, %rdx
orq %r15, %rdx
orq $0x1fe0, %rdx           # imm = 0x1FE0
movq %rdx, 0x78(%r14)
leaq 0x277d0(%rip), %rcx     # 0x4c59c
movb (%rcx), %dl
testb %sil, %sil
je 0x24e01
leaq 0x282fe(%rip), %r13     # 0x4d0d8
movq (%r13), %rcx
testb %dl, %dl
je 0x24e4f
leaq 0x80(%r14), %rdi
notq %rax
addq %rax, %rcx
leaq (%r12,%rcx,8), %rsi
subq %rdi, %rsi
callq 0x37704
movq (%r13), %rcx
jmp 0x24e4f
testb %dl, %dl
jne 0x24ecf
leaq 0x1(%rax), %rdx
leaq 0x282c4(%rip), %rsi     # 0x4d0d8
movq (%rsi), %rcx
leaq -0x1(%rcx), %rdi
cmpq %rdi, %rdx
jae 0x24e4f
leaq (%r14,%rax,8), %rax
addq $0x80, %rax
movq 0x2818f(%rip), %rcx     # 0x4cfc0
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 0x24e2a
movq 0x2817a(%rip), %rax     # 0x4cfd0
movq 0x28163(%rip), %rdx     # 0x4cfc0
notq %rdx
addq %rcx, %rdx
addq %rax, %rax
orq %rax, %r15
orq $0x1fe0, %r15           # imm = 0x1FE0
movq %r15, (%r12,%rdx,8)
movq %r14, 0x50(%r14)
movq %r14, 0x58(%r14)
movq 0x100(%rbx), %rcx
movq %r14, %rax
testq %rcx, %rcx
je 0x24eb1
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 0x28101(%rip), %rdx     # 0x4cfc0
movq %rbx, %rdi
movq %r14, %rsi
callq 0xebde
jmp 0x24d31
leaq 0x80(%r14), %rdi
leaq 0x281fb(%rip), %rcx     # 0x4d0d8
notq %rax
addq (%rcx), %rax
leaq (%r12,%rax,8), %rsi
subq %rdi, %rsi
callq 0x376c2
movq 0x280ca(%rip), %rax     # 0x4cfc0
jmp 0x24e09