// File: /workspace/github_c_makefile_star2_O2/zhou-yuxin[P]redis-aof-no-cow/deps/jemalloc/src/arena.c
// Function: je_arena_malloc_large
void *
arena_malloc_large(tsdn_t *tsdn, arena_t *arena, szind_t binind, bool zero)
{
	void *ret;
	size_t usize;
	uintptr_t random_offset;
	arena_run_t *run;
	arena_chunk_map_misc_t *miscelm;
	UNUSED bool idump JEMALLOC_CC_SILENCE_INIT(false);

	/* Large allocation. */
	usize = index2size(binind);
	malloc_mutex_lock(tsdn, &arena->lock);
	if (config_cache_oblivious) {
		uint64_t r;

		/*
		 * Compute a uniformly distributed offset within the first page
		 * that is a multiple of the cacheline size, e.g. [0 .. 63) * 64
		 * for 4 KiB pages and 64-byte cachelines.
		 */
		r = prng_lg_range_zu(&arena->offset_state, LG_PAGE -
		    LG_CACHELINE, false);
		random_offset = ((uintptr_t)r) << LG_CACHELINE;
	} else
		random_offset = 0;
	run = arena_run_alloc_large(tsdn, arena, usize + large_pad, zero);
	if (run == NULL) {
		malloc_mutex_unlock(tsdn, &arena->lock);
		return (NULL);
	}
	miscelm = arena_run_to_miscelm(run);
	ret = (void *)((uintptr_t)arena_miscelm_to_rpages(miscelm) +
	    random_offset);
	if (config_stats) {
		szind_t index = binind - 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++;
	}
	if (config_prof)
		idump = arena_prof_accum_locked(arena, usize);
	malloc_mutex_unlock(tsdn, &arena->lock);
	if (config_prof && idump)
		prof_idump(tsdn);

	if (!zero) {
		if (config_fill) {
			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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %ecx, %r14d
movl %edx, %r13d
movq %rsi, %rbx
movq %rdi, %r15
movl %edx, %eax
leaq 0x1a844(%rip), %rcx     # 0x36240
movq (%rcx,%rax,8), %rbp
leaq 0x10(%rsi), %rdi
movq %rdi, 0x8(%rsp)
callq 0xb5a0
movabsq $0x5851f42d4c957f2d, %rax # imm = 0x5851F42D4C957F2D
imulq 0xf0(%rbx), %rax
movabsq $0x14057b7ef767814f, %r12 # imm = 0x14057B7EF767814F
addq %rax, %r12
movq %r12, 0xf0(%rbx)
leaq 0x1000(%rbp), %rdx
movq %r15, 0x10(%rsp)
movq %r15, %rdi
movq %rbx, %rsi
movl %r14d, 0x4(%rsp)
movl %r14d, %ecx
callq 0x1bb8a
testq %rax, %rax
je 0x1bb3e
shrq $0x34, %r12
andl $-0x40, %r12d
addq $-0x18, %rax
leaq 0x2d661(%rip), %rcx     # 0x490d0
movq (%rcx), %r15
notq %r15
andq %rax, %r15
movq 0x2d549(%rip), %rcx     # 0x48fc8
addq %r15, %rcx
subq %rcx, %rax
pushq $0x60
popq %rcx
xorl %edx, %edx
divq %rcx
addq 0x2d52c(%rip), %rax     # 0x48fc0
shlq $0xc, %rax
addq %r12, %r15
addq %rax, %r15
incq 0xb0(%rbx)
addl $-0x27, %r13d
movq %rbp, %xmm0
shufpd $0x2, 0x1b349(%rip), %xmm0 # xmm0 = xmm0[0],mem[1]
movdqu 0x98(%rbx), %xmm1
paddq %xmm1, %xmm0
movdqu %xmm0, 0x98(%rbx)
movq 0xd0(%rbx), %rax
shlq $0x5, %r13
incq (%rax,%r13)
movdqu 0x10(%rax,%r13), %xmm0
pcmpeqd %xmm1, %xmm1
psubq %xmm1, %xmm0
movdqu %xmm0, 0x10(%rax,%r13)
movq 0x8(%rsp), %rdi
callq 0xb380
cmpb $0x0, 0x4(%rsp)
movq 0x10(%rsp), %r14
jne 0x1bb1e
leaq 0x2ca14(%rip), %rax     # 0x48521
cmpb $0x1, (%rax)
je 0x1bb71
leaq 0x2ca1a(%rip), %rax     # 0x48533
cmpb $0x1, (%rax)
je 0x1bb7b
testq %r14, %r14
je 0x1bb4b
movl (%rbx), %esi
movq %r14, %rdi
callq 0x20a5e
testq %rax, %rax
je 0x1bb4b
movl (%rax), %ecx
testl %ecx, %ecx
jle 0x1bb5d
decl %ecx
movl %ecx, (%rax)
jmp 0x1bb4b
movq 0x8(%rsp), %rdi
callq 0xb380
xorl %r15d, %r15d
movq %r15, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl 0x4(%rax), %ecx
movl %ecx, (%rax)
movq %r14, %rdi
movq %rbx, %rsi
xorl %edx, %edx
callq 0x1aac4
jmp 0x1bb4b
movq %r15, %rdi
movl $0xa5, %esi
jmp 0x1bb80
movq %r15, %rdi
xorl %esi, %esi
movq %rbp, %rdx
callq 0xb230
jmp 0x1bb1e