// File: /workspace/github_c_makefile_star2_O0/gplessis[P]dotdeb-redis/deps/jemalloc/src/arena.c
// Function: arena_ralloc_large_shrink
static void
arena_ralloc_large_shrink(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(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(&arena->lock);
	arena_run_trim_tail(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(&arena->lock);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
movq %rdi, -0x58(%rbp)
movq %rsi, -0x60(%rbp)
movq %rdx, -0x68(%rbp)
movq %rcx, -0x70(%rbp)
movq %r8, -0x78(%rbp)
movq -0x68(%rbp), %rax
movq -0x60(%rbp), %rcx
subq %rcx, %rax
shrq $0xc, %rax
movq %rax, -0x80(%rbp)
movq -0x60(%rbp), %rcx
movq -0x80(%rbp), %rax
movq %rcx, -0x28(%rbp)
movq %rax, -0x30(%rbp)
movq -0x28(%rbp), %rax
addq 0x53773(%rip), %rax     # 0xa25e0
imulq $0x60, -0x30(%rbp), %rcx
addq %rcx, %rax
xorl %ecx, %ecx
subq 0x5375a(%rip), %rcx     # 0xa25d8
imulq $0x60, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x88(%rbp)
movq -0x88(%rbp), %rax
addq $0x10, %rax
movq %rax, -0x90(%rbp)
jmp 0x4eea0
movq -0x58(%rbp), %rdi
addq $0x8, %rdi
callq 0x3c3a0
movq -0x58(%rbp), %rdi
movq -0x60(%rbp), %rsi
movq -0x90(%rbp), %rdx
movq -0x70(%rbp), %rcx
addq $0x1000, %rcx           # imm = 0x1000
movq -0x78(%rbp), %r8
addq $0x1000, %r8            # imm = 0x1000
movl $0x1, %r9d
callq 0x4d540
movq -0x70(%rbp), %rax
movq %rax, -0x40(%rbp)
cmpq $0x1000, -0x40(%rbp)    # imm = 0x1000
setbe %al
testb $0x1, %al
jne 0x4eef6
jmp 0x4ef22
movq -0x40(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rcx
subq $0x1, %rcx
shrq $0x3, %rcx
leaq 0x3fd6f(%rip), %rax     # 0x8ec80
movzbl (%rax,%rcx), %eax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movl %eax, -0x34(%rbp)
jmp 0x4ef2e
movq -0x40(%rbp), %rdi
callq 0x4ca20
movl %eax, -0x34(%rbp)
movl -0x34(%rbp), %eax
subl $0x27, %eax
movl %eax, -0x94(%rbp)
movq -0x78(%rbp), %rax
movq %rax, -0x50(%rbp)
cmpq $0x1000, -0x50(%rbp)    # imm = 0x1000
setbe %al
testb $0x1, %al
jne 0x4ef53
jmp 0x4ef7f
movq -0x50(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rcx
subq $0x1, %rcx
shrq $0x3, %rcx
leaq 0x3fd12(%rip), %rax     # 0x8ec80
movzbl (%rax,%rcx), %eax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
movl %eax, -0x44(%rbp)
jmp 0x4ef8b
movq -0x50(%rbp), %rdi
callq 0x4ca20
movl %eax, -0x44(%rbp)
movl -0x44(%rbp), %eax
subl $0x27, %eax
movl %eax, -0x98(%rbp)
movq -0x58(%rbp), %rax
movq 0x70(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x70(%rax)
movq -0x70(%rbp), %rdx
movq -0x58(%rbp), %rax
movq 0x60(%rax), %rcx
subq %rdx, %rcx
movq %rcx, 0x60(%rax)
movq -0x58(%rbp), %rax
movq 0x98(%rax), %rax
movl -0x94(%rbp), %ecx
shlq $0x5, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x8(%rax)
movq -0x58(%rbp), %rax
movq 0x98(%rax), %rax
movl -0x94(%rbp), %ecx
shlq $0x5, %rcx
addq %rcx, %rax
movq 0x18(%rax), %rcx
addq $-0x1, %rcx
movq %rcx, 0x18(%rax)
movq -0x58(%rbp), %rax
movq 0x68(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x68(%rax)
movq -0x58(%rbp), %rax
movq 0x78(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x78(%rax)
movq -0x78(%rbp), %rcx
movq -0x58(%rbp), %rax
addq 0x60(%rax), %rcx
movq %rcx, 0x60(%rax)
movq -0x58(%rbp), %rax
movq 0x98(%rax), %rax
movl -0x98(%rbp), %ecx
shlq $0x5, %rcx
addq %rcx, %rax
movq (%rax), %rcx
addq $0x1, %rcx
movq %rcx, (%rax)
movq -0x58(%rbp), %rax
movq 0x98(%rax), %rax
movl -0x98(%rbp), %ecx
shlq $0x5, %rcx
addq %rcx, %rax
movq 0x10(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x10(%rax)
movq -0x58(%rbp), %rax
movq 0x98(%rax), %rax
movl -0x98(%rbp), %ecx
shlq $0x5, %rcx
addq %rcx, %rax
movq 0x18(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x18(%rax)
movq -0x58(%rbp), %rdi
addq $0x8, %rdi
callq 0x3c3c0
addq $0xa0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)