// File: /workspace/github_c_makefile_star2_O0/zhou-yuxin[P]redis-aof-no-cow/deps/jemalloc/src/arena.c
// Function: arena_palloc_large
static void *
arena_palloc_large(tsdn_t *tsdn, arena_t *arena, size_t usize, size_t alignment,
    bool zero)
{
	void *ret;
	size_t alloc_size, leadsize, trailsize;
	arena_run_t *run;
	arena_chunk_t *chunk;
	arena_chunk_map_misc_t *miscelm;
	void *rpages;

	assert(!tsdn_null(tsdn) || arena != NULL);
	assert(usize == PAGE_CEILING(usize));

	if (likely(!tsdn_null(tsdn)))
		arena = arena_choose(tsdn_tsd(tsdn), arena);
	if (unlikely(arena == NULL))
		return (NULL);

	alignment = PAGE_CEILING(alignment);
	alloc_size = usize + large_pad + alignment - PAGE;

	malloc_mutex_lock(tsdn, &arena->lock);
	run = arena_run_alloc_large(tsdn, arena, alloc_size, false);
	if (run == NULL) {
		malloc_mutex_unlock(tsdn, &arena->lock);
		return (NULL);
	}
	chunk = (arena_chunk_t *)CHUNK_ADDR2BASE(run);
	miscelm = arena_run_to_miscelm(run);
	rpages = arena_miscelm_to_rpages(miscelm);

	leadsize = ALIGNMENT_CEILING((uintptr_t)rpages, alignment) -
	    (uintptr_t)rpages;
	assert(alloc_size >= leadsize + usize);
	trailsize = alloc_size - leadsize - usize - large_pad;
	if (leadsize != 0) {
		arena_chunk_map_misc_t *head_miscelm = miscelm;
		arena_run_t *head_run = run;

		miscelm = arena_miscelm_get_mutable(chunk,
		    arena_miscelm_to_pageind(head_miscelm) + (leadsize >>
		    LG_PAGE));
		run = &miscelm->run;

		arena_run_trim_head(tsdn, arena, chunk, head_run, alloc_size,
		    alloc_size - leadsize);
	}
	if (trailsize != 0) {
		arena_run_trim_tail(tsdn, arena, chunk, run, usize + large_pad +
		    trailsize, usize + large_pad, false);
	}
	if (arena_run_init_large(arena, run, usize + large_pad, zero)) {
		size_t run_ind =
		    arena_miscelm_to_pageind(arena_run_to_miscelm(run));
		bool dirty = (arena_mapbits_dirty_get(chunk, run_ind) != 0);
		bool decommitted = (arena_mapbits_decommitted_get(chunk,
		    run_ind) != 0);

		assert(decommitted); /* Cause of OOM. */
		arena_run_dalloc(tsdn, arena, run, dirty, false, decommitted);
		malloc_mutex_unlock(tsdn, &arena->lock);
		return (NULL);
	}
	ret = arena_miscelm_to_rpages(miscelm);

	if (config_stats) {
		szind_t index = size2index(usize) - NBINS;

		arena->stats.nmalloc_large++;
		arena->stats.nrequests_large++;
		arena->stats.allocated_large += usize;
		arena->stats.lstats[index].nmalloc++;
		arena->stats.lstats[index].nrequests++;
		arena->stats.lstats[index].curruns++;
	}
	malloc_mutex_unlock(tsdn, &arena->lock);

	if (config_fill && !zero) {
		if (unlikely(opt_junk_alloc))
			memset(ret, JEMALLOC_ALLOC_JUNK, usize);
		else if (unlikely(opt_zero))
			memset(ret, 0, usize);
	}
	arena_decay_tick(tsdn, arena);
	return (ret);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x290, %rsp            # imm = 0x290
movb %r8b, %al
movq %rdi, -0x208(%rbp)
movq %rsi, -0x210(%rbp)
movq %rdx, -0x218(%rbp)
movq %rcx, -0x220(%rbp)
andb $0x1, %al
movb %al, -0x221(%rbp)
jmp 0x3eb44
jmp 0x3eb46
jmp 0x3eb48
movq -0x208(%rbp), %rax
movq %rax, -0x188(%rbp)
cmpq $0x0, -0x188(%rbp)
sete %al
xorb $-0x1, %al
xorb $-0x1, %al
xorb $-0x1, %al
andb $0x1, %al
movzbl %al, %eax
cltq
cmpq $0x0, %rax
je 0x3eb9c
movq -0x208(%rbp), %rax
movq %rax, -0x180(%rbp)
movq -0x180(%rbp), %rdi
movq -0x210(%rbp), %rsi
callq 0x3d540
movq %rax, -0x210(%rbp)
cmpq $0x0, -0x210(%rbp)
sete %al
xorb $-0x1, %al
xorb $-0x1, %al
andb $0x1, %al
movzbl %al, %eax
cltq
cmpq $0x0, %rax
je 0x3ebc8
movq $0x0, -0x200(%rbp)
jmp 0x3f51d
movq -0x220(%rbp), %rax
addq $0xfff, %rax            # imm = 0xFFF
andq $-0x1000, %rax          # imm = 0xF000
movq %rax, -0x220(%rbp)
movq -0x218(%rbp), %rax
addq $0x1000, %rax           # imm = 0x1000
addq -0x220(%rbp), %rax
subq $0x1000, %rax           # imm = 0x1000
movq %rax, -0x238(%rbp)
movq -0x208(%rbp), %rdi
movq -0x210(%rbp), %rsi
addq $0x10, %rsi
callq 0x3a660
movq -0x208(%rbp), %rdi
movq -0x210(%rbp), %rsi
movq -0x238(%rbp), %rdx
xorl %ecx, %ecx
callq 0x3d2f0
movq %rax, -0x250(%rbp)
cmpq $0x0, -0x250(%rbp)
jne 0x3ec6e
movq -0x208(%rbp), %rdi
movq -0x210(%rbp), %rsi
addq $0x10, %rsi
callq 0x3a6b0
movq $0x0, -0x200(%rbp)
jmp 0x3f51d
movq -0x250(%rbp), %rax
leaq 0x65434(%rip), %rcx     # 0xa40b0
movq (%rcx), %rcx
xorq $-0x1, %rcx
andq %rcx, %rax
movq %rax, -0x258(%rbp)
movq -0x250(%rbp), %rax
movq %rax, -0x1c0(%rbp)
movq -0x1c0(%rbp), %rax
subq $0x18, %rax
movq %rax, -0x1c8(%rbp)
movq -0x1c8(%rbp), %rax
movq %rax, -0x260(%rbp)
movq -0x260(%rbp), %rax
movq %rax, -0x190(%rbp)
movq -0x190(%rbp), %rax
leaq 0x653d9(%rip), %rcx     # 0xa40b0
movq (%rcx), %rcx
xorq $-0x1, %rcx
andq %rcx, %rax
movq %rax, -0x198(%rbp)
movq -0x190(%rbp), %rax
movq %rax, -0x158(%rbp)
movq -0x158(%rbp), %rax
leaq 0x653ac(%rip), %rcx     # 0xa40b0
movq (%rcx), %rcx
xorq $-0x1, %rcx
andq %rcx, %rax
movq %rax, -0x160(%rbp)
movq -0x158(%rbp), %rax
movq -0x160(%rbp), %rcx
addq 0x6527e(%rip), %rcx     # 0xa3fa8
subq %rcx, %rax
movl $0x60, %ecx
xorl %edx, %edx
divq %rcx
addq 0x65262(%rip), %rax     # 0xa3fa0
movq %rax, -0x168(%rbp)
movq -0x168(%rbp), %rax
movq %rax, -0x1a0(%rbp)
movq -0x198(%rbp), %rax
movq -0x1a0(%rbp), %rcx
shlq $0xc, %rcx
addq %rcx, %rax
movq %rax, -0x268(%rbp)
movq -0x268(%rbp), %rax
movq -0x220(%rbp), %rcx
subq $0x1, %rcx
addq %rcx, %rax
movq -0x220(%rbp), %rcx
xorq $-0x1, %rcx
addq $0x1, %rcx
andq %rcx, %rax
movq -0x268(%rbp), %rcx
subq %rcx, %rax
movq %rax, -0x240(%rbp)
jmp 0x3eda9
movq -0x238(%rbp), %rax
subq -0x240(%rbp), %rax
subq -0x218(%rbp), %rax
subq $0x1000, %rax           # imm = 0x1000
movq %rax, -0x248(%rbp)
cmpq $0x0, -0x240(%rbp)
je 0x3eef4
movq -0x260(%rbp), %rax
movq %rax, -0x270(%rbp)
movq -0x250(%rbp), %rax
movq %rax, -0x278(%rbp)
movq -0x258(%rbp), %rcx
movq -0x270(%rbp), %rax
movq %rax, -0x110(%rbp)
movq -0x110(%rbp), %rax
leaq 0x65298(%rip), %rdx     # 0xa40b0
movq (%rdx), %rdx
xorq $-0x1, %rdx
andq %rdx, %rax
movq %rax, -0x118(%rbp)
movq -0x110(%rbp), %rax
movq -0x118(%rbp), %rdx
addq 0x6516a(%rip), %rdx     # 0xa3fa8
subq %rdx, %rax
movl $0x60, %esi
xorl %edx, %edx
divq %rsi
addq 0x6514e(%rip), %rax     # 0xa3fa0
movq %rax, -0x120(%rbp)
movq -0x120(%rbp), %rax
movq -0x240(%rbp), %rdx
shrq $0xc, %rdx
addq %rdx, %rax
movq %rcx, -0x170(%rbp)
movq %rax, -0x178(%rbp)
movq -0x170(%rbp), %rax
addq 0x6511e(%rip), %rax     # 0xa3fa8
imulq $0x60, -0x178(%rbp), %rcx
addq %rcx, %rax
xorl %ecx, %ecx
subq 0x65102(%rip), %rcx     # 0xa3fa0
imulq $0x60, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x260(%rbp)
movq -0x260(%rbp), %rax
addq $0x18, %rax
movq %rax, -0x250(%rbp)
movq -0x208(%rbp), %rdi
movq -0x210(%rbp), %rsi
movq -0x258(%rbp), %rdx
movq -0x278(%rbp), %rcx
movq -0x238(%rbp), %r8
movq -0x238(%rbp), %r9
subq -0x240(%rbp), %r9
callq 0x4da70
cmpq $0x0, -0x248(%rbp)
je 0x3ef4b
movq -0x208(%rbp), %rdi
movq -0x210(%rbp), %rsi
movq -0x258(%rbp), %rdx
movq -0x250(%rbp), %rcx
movq -0x218(%rbp), %r8
addq $0x1000, %r8            # imm = 0x1000
addq -0x248(%rbp), %r8
movq -0x218(%rbp), %r9
addq $0x1000, %r9            # imm = 0x1000
xorl %eax, %eax
movl $0x0, (%rsp)
callq 0x4e2b0
movq -0x210(%rbp), %rdi
movq -0x250(%rbp), %rsi
movq -0x218(%rbp), %rdx
addq $0x1000, %rdx           # imm = 0x1000
movb -0x221(%rbp), %al
andb $0x1, %al
movzbl %al, %ecx
callq 0x4eb70
testb $0x1, %al
jne 0x3ef80
jmp 0x3f1fb
movq -0x250(%rbp), %rax
movq %rax, -0x1d0(%rbp)
movq -0x1d0(%rbp), %rax
subq $0x18, %rax
movq %rax, -0x1d8(%rbp)
movq -0x1d8(%rbp), %rax
movq %rax, -0x128(%rbp)
movq -0x128(%rbp), %rax
leaq 0x650f4(%rip), %rcx     # 0xa40b0
movq (%rcx), %rcx
xorq $-0x1, %rcx
andq %rcx, %rax
movq %rax, -0x130(%rbp)
movq -0x128(%rbp), %rax
movq -0x130(%rbp), %rcx
addq 0x64fc6(%rip), %rcx     # 0xa3fa8
subq %rcx, %rax
movl $0x60, %ecx
xorl %edx, %edx
divq %rcx
addq 0x64faa(%rip), %rax     # 0xa3fa0
movq %rax, -0x138(%rbp)
movq -0x138(%rbp), %rax
movq %rax, -0x280(%rbp)
movq -0x258(%rbp), %rcx
movq -0x280(%rbp), %rax
movq %rcx, -0xf8(%rbp)
movq %rax, -0x100(%rbp)
movq -0xf8(%rbp), %rcx
movq -0x100(%rbp), %rax
movq %rcx, -0xe8(%rbp)
movq %rax, -0xf0(%rbp)
movq -0xe8(%rbp), %rcx
movq -0xf0(%rbp), %rax
movq %rcx, -0xd0(%rbp)
movq %rax, -0xd8(%rbp)
movq -0xd0(%rbp), %rcx
movq -0xd8(%rbp), %rax
movq %rcx, -0xc0(%rbp)
movq %rax, -0xc8(%rbp)
movq -0xc0(%rbp), %rcx
movq -0xc8(%rbp), %rax
movq %rcx, -0xb0(%rbp)
movq %rax, -0xb8(%rbp)
movq -0xb0(%rbp), %rax
addq $0x78, %rax
movq -0xb8(%rbp), %rcx
subq 0x64ef0(%rip), %rcx     # 0xa3fa0
shlq $0x3, %rcx
addq %rcx, %rax
movq %rax, -0xe0(%rbp)
movq -0xe0(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x108(%rbp)
movq -0x108(%rbp), %rax
andq $0x10, %rax
cmpq $0x0, %rax
setne %al
andb $0x1, %al
movb %al, -0x281(%rbp)
movq -0x258(%rbp), %rcx
movq -0x280(%rbp), %rax
movq %rcx, -0x98(%rbp)
movq %rax, -0xa0(%rbp)
movq -0x98(%rbp), %rcx
movq -0xa0(%rbp), %rax
movq %rcx, -0x88(%rbp)
movq %rax, -0x90(%rbp)
movq -0x88(%rbp), %rcx
movq -0x90(%rbp), %rax
movq %rcx, -0x70(%rbp)
movq %rax, -0x78(%rbp)
movq -0x70(%rbp), %rcx
movq -0x78(%rbp), %rax
movq %rcx, -0x60(%rbp)
movq %rax, -0x68(%rbp)
movq -0x60(%rbp), %rcx
movq -0x68(%rbp), %rax
movq %rcx, -0x50(%rbp)
movq %rax, -0x58(%rbp)
movq -0x50(%rbp), %rax
addq $0x78, %rax
movq -0x58(%rbp), %rcx
subq 0x64e36(%rip), %rcx     # 0xa3fa0
shlq $0x3, %rcx
addq %rcx, %rax
movq %rax, -0x80(%rbp)
movq -0x80(%rbp), %rax
movq (%rax), %rax
movq %rax, -0xa8(%rbp)
movq -0xa8(%rbp), %rax
andq $0x4, %rax
cmpq $0x0, %rax
setne %al
andb $0x1, %al
movb %al, -0x282(%rbp)
jmp 0x3f19f
movq -0x208(%rbp), %rdi
movq -0x210(%rbp), %rsi
movq -0x250(%rbp), %rdx
movb -0x281(%rbp), %cl
movb -0x282(%rbp), %al
xorl %r8d, %r8d
andb $0x1, %cl
andb $0x1, %al
movzbl %cl, %ecx
movzbl %al, %r9d
callq 0x49a50
movq -0x208(%rbp), %rdi
movq -0x210(%rbp), %rsi
addq $0x10, %rsi
callq 0x3a6b0
movq $0x0, -0x200(%rbp)
jmp 0x3f51d
movq -0x260(%rbp), %rax
movq %rax, -0x1a8(%rbp)
movq -0x1a8(%rbp), %rax
leaq 0x64e99(%rip), %rcx     # 0xa40b0
movq (%rcx), %rcx
xorq $-0x1, %rcx
andq %rcx, %rax
movq %rax, -0x1b0(%rbp)
movq -0x1a8(%rbp), %rax
movq %rax, -0x140(%rbp)
movq -0x140(%rbp), %rax
leaq 0x64e6c(%rip), %rcx     # 0xa40b0
movq (%rcx), %rcx
xorq $-0x1, %rcx
andq %rcx, %rax
movq %rax, -0x148(%rbp)
movq -0x140(%rbp), %rax
movq -0x148(%rbp), %rcx
addq 0x64d3e(%rip), %rcx     # 0xa3fa8
subq %rcx, %rax
movl $0x60, %ecx
xorl %edx, %edx
divq %rcx
addq 0x64d22(%rip), %rax     # 0xa3fa0
movq %rax, -0x150(%rbp)
movq -0x150(%rbp), %rax
movq %rax, -0x1b8(%rbp)
movq -0x1b0(%rbp), %rax
movq -0x1b8(%rbp), %rcx
shlq $0xc, %rcx
addq %rcx, %rax
movq %rax, -0x230(%rbp)
movq -0x218(%rbp), %rax
movq %rax, -0x1e8(%rbp)
cmpq $0x1000, -0x1e8(%rbp) # imm = 0x1000
setbe %al
testb $0x1, %al
jne 0x3f2d1
jmp 0x3f301
movq -0x1e8(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rcx
subq $0x1, %rcx
shrq $0x3, %rcx
leaq 0x51791(%rip), %rax     # 0x90a80
movzbl (%rax,%rcx), %eax
movl %eax, -0xc(%rbp)
movl -0xc(%rbp), %eax
movl %eax, -0x1dc(%rbp)
jmp 0x3f313
movq -0x1e8(%rbp), %rdi
callq 0x4d7d0
movl %eax, -0x1dc(%rbp)
movl -0x1dc(%rbp), %eax
subl $0x27, %eax
movl %eax, -0x288(%rbp)
movq -0x210(%rbp), %rax
movq 0xa0(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0xa0(%rax)
movq -0x210(%rbp), %rax
movq 0xb0(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0xb0(%rax)
movq -0x218(%rbp), %rcx
movq -0x210(%rbp), %rax
addq 0x98(%rax), %rcx
movq %rcx, 0x98(%rax)
movq -0x210(%rbp), %rax
movq 0xd0(%rax), %rax
movl -0x288(%rbp), %ecx
shlq $0x5, %rcx
addq %rcx, %rax
movq (%rax), %rcx
addq $0x1, %rcx
movq %rcx, (%rax)
movq -0x210(%rbp), %rax
movq 0xd0(%rax), %rax
movl -0x288(%rbp), %ecx
shlq $0x5, %rcx
addq %rcx, %rax
movq 0x10(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x10(%rax)
movq -0x210(%rbp), %rax
movq 0xd0(%rax), %rax
movl -0x288(%rbp), %ecx
shlq $0x5, %rcx
addq %rcx, %rax
movq 0x18(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x18(%rax)
movq -0x208(%rbp), %rdi
movq -0x210(%rbp), %rsi
addq $0x10, %rsi
callq 0x3a6b0
testb $0x1, -0x221(%rbp)
jne 0x3f46a
leaq 0x640f7(%rip), %rax     # 0xa3501
movb (%rax), %al
xorb $-0x1, %al
xorb $-0x1, %al
andb $0x1, %al
movzbl %al, %eax
cltq
cmpq $0x0, %rax
je 0x3f437
movq -0x230(%rbp), %rdi
movq -0x218(%rbp), %rdx
movl $0xa5, %esi
callq 0xb210
jmp 0x3f468
leaq 0x640d5(%rip), %rax     # 0xa3513
movb (%rax), %al
xorb $-0x1, %al
xorb $-0x1, %al
andb $0x1, %al
movzbl %al, %eax
cltq
cmpq $0x0, %rax
je 0x3f466
movq -0x230(%rbp), %rdi
movq -0x218(%rbp), %rdx
xorl %esi, %esi
callq 0xb210
jmp 0x3f468
jmp 0x3f46a
movq -0x208(%rbp), %rcx
movq -0x210(%rbp), %rax
movq %rcx, -0x1f0(%rbp)
movq %rax, -0x1f8(%rbp)
movq -0x1f0(%rbp), %rcx
movq -0x1f8(%rbp), %rax
movq %rcx, -0x28(%rbp)
movq %rax, -0x30(%rbp)
movl $0x1, -0x34(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
sete %al
testb $0x1, %al
jne 0x3f4b9
jmp 0x3f4bb
jmp 0x3f50f
movq -0x28(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rdi
movq -0x30(%rbp), %rax
movl (%rax), %esi
callq 0x4d580
movq %rax, -0x48(%rbp)
cmpq $0x0, -0x48(%rbp)
sete %al
testb $0x1, %al
jne 0x3f4ec
jmp 0x3f4ee
jmp 0x3f50f
movq -0x48(%rbp), %rdi
movl -0x34(%rbp), %esi
callq 0x4d5e0
testb $0x1, %al
jne 0x3f500
jmp 0x3f50f
movq -0x28(%rbp), %rdi
movq -0x30(%rbp), %rsi
xorl %edx, %edx
callq 0x3b8a0
movq -0x230(%rbp), %rax
movq %rax, -0x200(%rbp)
movq -0x200(%rbp), %rax
addq $0x290, %rsp            # imm = 0x290
popq %rbp
retq
nopl (%rax)