// File: /workspace/github_c_makefile_star2_O1/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 0x24f7e
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)
movaps %xmm0, 0x10(%rdx)
movaps %xmm0, (%rdx)
movq $0x0, 0x30(%rdx)
leaq 0x2846a(%rip), %rbp     # 0x4d0c8
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 0x2687b
addq $0x20, %rsp
testq %rax, %rax
je 0x24cf2
movq %rax, %r14
movq 0x10(%rsp), %rax
movb 0x7(%rsp), %cl
movq (%rbp), %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 0x266bc
testb %al, %al
je 0x24e31
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 0x27026
addq $0x10, %rsp
xorl %r14d, %r14d
jmp 0x24e50
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 0x26d69
addq $0x20, %rsp
testq %rax, %rax
je 0x24d92
movq %rax, %r13
cmpb $0x0, 0x6(%rsp)
jne 0x24d8f
movq (%rbp), %rsi
movq 0x28278(%rip), %rcx     # 0x4cfc0
shlq $0xc, %rcx
movl (%rbx), %r8d
movq %r13, %rdi
xorl %edx, %edx
callq *0x30(%rsp)
testb %al, %al
je 0x24d8f
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
callq 0x273ec
addq $0x10, %rsp
xorl %r14d, %r14d
jmp 0x24d92
movq %r13, %r14
testq %r14, %r14
je 0x24e24
movq 0x8(%rsp), %rax
movb 0x7(%rsp), %cl
movq (%rbp), %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 0x266bc
testb %al, %al
je 0x24e27
cmpb $0x0, 0x6(%rsp)
jne 0x24df6
movq (%rbp), %rsi
movq 0x281da(%rip), %rcx     # 0x4cfc0
shlq $0xc, %rcx
movl (%rbx), %r8d
movq %r14, %rdi
xorl %edx, %edx
callq *0x38(%rsp)
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 %r14, %rcx
pushq %r10
pushq %rax
callq 0x273ec
addq $0x10, %rsp
xorl %r14d, %r14d
movq 0x18(%rsp), %rdi
callq 0xb5a0
testq %r14, %r14
je 0x24e50
movq (%rbp), %rax
addq %rax, 0x60(%rbx)
movq 0x2817b(%rip), %rax     # 0x4cfc0
shlq $0xc, %rax
addq %rax, 0x88(%rbx)
testq %r14, %r14
je 0x24edc
movb $0x1, 0x70(%r14)
movzbl 0x6(%rsp), %eax
movl %eax, %ecx
notb %cl
andl $0x1, %eax
shll $0x3, %eax
movb 0x7(%rsp), %dl
xorl %r15d, %r15d
testb %dl, %dl
cmoveq %rax, %r15
movzbl %cl, %eax
andl $0x1, %eax
shll $0x2, %eax
movq 0x28146(%rip), %rcx     # 0x4cfd0
leaq 0x78(%r14), %r12
addq %rcx, %rcx
orq %rax, %rcx
orq %r15, %rcx
orq $0x1fe0, %rcx           # imm = 0x1FE0
movq 0x2811b(%rip), %rax     # 0x4cfc0
movq %rcx, 0x78(%r14)
leaq 0x276ec(%rip), %rcx     # 0x4c59c
movb (%rcx), %cl
testb %dl, %dl
je 0x24ee4
testb %cl, %cl
je 0x24f38
leaq 0x80(%r14), %rdi
leaq 0x28210(%rip), %rcx     # 0x4d0d8
notq %rax
addq (%rcx), %rax
leaq (%r12,%rax,8), %rsi
subq %rdi, %rsi
callq 0x37158
jmp 0x24f38
xorl %r14d, %r14d
jmp 0x24f64
testb %cl, %cl
jne 0x24fde
movq 0x280cd(%rip), %rdx     # 0x4cfc0
leaq 0x1(%rdx), %rax
leaq 0x281da(%rip), %rcx     # 0x4d0d8
movq (%rcx), %rsi
decq %rsi
cmpq %rsi, %rax
jae 0x24f38
leaq (%r14,%rdx,8), %rdx
addq $0x80, %rdx
movq 0x280a5(%rip), %rsi     # 0x4cfc0
shlq $0x3, %rsi
negq %rsi
movq %r15, (%rdx,%rsi)
incq %rax
movq (%rcx), %rsi
decq %rsi
addq $0x8, %rdx
cmpq %rsi, %rax
jb 0x24f14
leaq 0x28199(%rip), %rax     # 0x4d0d8
movq 0x2808a(%rip), %rcx     # 0x4cfd0
movq 0x28073(%rip), %rdx     # 0x4cfc0
notq %rdx
addq (%rax), %rdx
addq %rcx, %rcx
orq %rcx, %r15
orq $0x1fe0, %r15           # imm = 0x1FE0
movq %r15, (%r12,%rdx,8)
testq %r14, %r14
jne 0x24f89
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)
movq %r14, 0x50(%r14)
movq %r14, 0x58(%r14)
movq 0x100(%rbx), %rax
testq %rax, %rax
je 0x24fbf
movq 0x58(%rax), %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 0x27fef(%rip), %rdx     # 0x4cfc0
movq %rbx, %rdi
movq %r14, %rsi
callq 0xf21e
jmp 0x24f6c
leaq 0x80(%r14), %rdi
leaq 0x280ec(%rip), %rcx     # 0x4d0d8
notq %rax
addq (%rcx), %rax
leaq (%r12,%rax,8), %rsi
subq %rdi, %rsi
callq 0x37116
jmp 0x24eec