// File: /workspace/github_c_makefile_star2_O0/zhou-yuxin[P]redis-aof-no-cow/deps/jemalloc/src/arena.c
// Function: arena_ralloc_large_shrink
static void
arena_ralloc_large_shrink(tsdn_t *tsdn, arena_t *arena, arena_chunk_t *chunk,
    void *ptr, size_t oldsize, size_t size)
{
	size_t pageind = ((uintptr_t)ptr - (uintptr_t)chunk) >> LG_PAGE;
	arena_chunk_map_misc_t *miscelm = arena_miscelm_get_mutable(chunk,
	    pageind);
	arena_run_t *run = &miscelm->run;

	assert(size < oldsize);

	/*
	 * Shrink the run, and make trailing pages available for other
	 * allocations.
	 */
	malloc_mutex_lock(tsdn, &arena->lock);
	arena_run_trim_tail(tsdn, arena, chunk, run, oldsize + large_pad, size +
	    large_pad, true);
	if (config_stats) {
		szind_t oldindex = size2index(oldsize) - NBINS;
		szind_t index = size2index(size) - NBINS;

		arena->stats.ndalloc_large++;
		arena->stats.allocated_large -= oldsize;
		arena->stats.lstats[oldindex].ndalloc++;
		arena->stats.lstats[oldindex].curruns--;

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

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xb0, %rsp
movq %rdi, -0x58(%rbp)
movq %rsi, -0x60(%rbp)
movq %rdx, -0x68(%rbp)
movq %rcx, -0x70(%rbp)
movq %r8, -0x78(%rbp)
movq %r9, -0x80(%rbp)
movq -0x70(%rbp), %rax
movq -0x68(%rbp), %rcx
subq %rcx, %rax
shrq $0xc, %rax
movq %rax, -0x88(%rbp)
movq -0x68(%rbp), %rcx
movq -0x88(%rbp), %rax
movq %rcx, -0x28(%rbp)
movq %rax, -0x30(%rbp)
movq -0x28(%rbp), %rax
addq 0x54271(%rip), %rax     # 0xa3fa8
imulq $0x60, -0x30(%rbp), %rcx
addq %rcx, %rax
xorl %ecx, %ecx
subq 0x54258(%rip), %rcx     # 0xa3fa0
imulq $0x60, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x90(%rbp)
movq -0x90(%rbp), %rax
addq $0x18, %rax
movq %rax, -0x98(%rbp)
jmp 0x4fd6a
movq -0x58(%rbp), %rdi
movq -0x60(%rbp), %rsi
addq $0x10, %rsi
callq 0x3a660
movq -0x58(%rbp), %rdi
movq -0x60(%rbp), %rsi
movq -0x68(%rbp), %rdx
movq -0x98(%rbp), %rcx
movq -0x78(%rbp), %r8
addq $0x1000, %r8            # imm = 0x1000
movq -0x80(%rbp), %r9
addq $0x1000, %r9            # imm = 0x1000
movl $0x1, (%rsp)
callq 0x4e2b0
movq -0x78(%rbp), %rax
movq %rax, -0x40(%rbp)
cmpq $0x1000, -0x40(%rbp)    # imm = 0x1000
setbe %al
testb $0x1, %al
jne 0x4fdc9
jmp 0x4fdf3
movq -0x40(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rcx
subq $0x1, %rcx
shrq $0x3, %rcx
leaq 0x40c9c(%rip), %rax     # 0x90a80
movzbl (%rax,%rcx), %eax
movl %eax, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
movl %eax, -0x34(%rbp)
jmp 0x4fdff
movq -0x40(%rbp), %rdi
callq 0x4d7d0
movl %eax, -0x34(%rbp)
movl -0x34(%rbp), %eax
subl $0x27, %eax
movl %eax, -0x9c(%rbp)
movq -0x80(%rbp), %rax
movq %rax, -0x50(%rbp)
cmpq $0x1000, -0x50(%rbp)    # imm = 0x1000
setbe %al
testb $0x1, %al
jne 0x4fe24
jmp 0x4fe4e
movq -0x50(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rcx
subq $0x1, %rcx
shrq $0x3, %rcx
leaq 0x40c41(%rip), %rax     # 0x90a80
movzbl (%rax,%rcx), %eax
movl %eax, -0xc(%rbp)
movl -0xc(%rbp), %eax
movl %eax, -0x44(%rbp)
jmp 0x4fe5a
movq -0x50(%rbp), %rdi
callq 0x4d7d0
movl %eax, -0x44(%rbp)
movl -0x44(%rbp), %eax
subl $0x27, %eax
movl %eax, -0xa0(%rbp)
movq -0x60(%rbp), %rax
movq 0xa8(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0xa8(%rax)
movq -0x78(%rbp), %rdx
movq -0x60(%rbp), %rax
movq 0x98(%rax), %rcx
subq %rdx, %rcx
movq %rcx, 0x98(%rax)
movq -0x60(%rbp), %rax
movq 0xd0(%rax), %rax
movl -0x9c(%rbp), %ecx
shlq $0x5, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x8(%rax)
movq -0x60(%rbp), %rax
movq 0xd0(%rax), %rax
movl -0x9c(%rbp), %ecx
shlq $0x5, %rcx
addq %rcx, %rax
movq 0x18(%rax), %rcx
addq $-0x1, %rcx
movq %rcx, 0x18(%rax)
movq -0x60(%rbp), %rax
movq 0xa0(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0xa0(%rax)
movq -0x60(%rbp), %rax
movq 0xb0(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0xb0(%rax)
movq -0x80(%rbp), %rcx
movq -0x60(%rbp), %rax
addq 0x98(%rax), %rcx
movq %rcx, 0x98(%rax)
movq -0x60(%rbp), %rax
movq 0xd0(%rax), %rax
movl -0xa0(%rbp), %ecx
shlq $0x5, %rcx
addq %rcx, %rax
movq (%rax), %rcx
addq $0x1, %rcx
movq %rcx, (%rax)
movq -0x60(%rbp), %rax
movq 0xd0(%rax), %rax
movl -0xa0(%rbp), %ecx
shlq $0x5, %rcx
addq %rcx, %rax
movq 0x10(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x10(%rax)
movq -0x60(%rbp), %rax
movq 0xd0(%rax), %rax
movl -0xa0(%rbp), %ecx
shlq $0x5, %rcx
addq %rcx, %rax
movq 0x18(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x18(%rax)
movq -0x58(%rbp), %rdi
movq -0x60(%rbp), %rsi
addq $0x10, %rsi
callq 0x3a6b0
addq $0xb0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)