// File: /workspace/github_c_makefile_star2_O2/nilyang[P]redis-tdd-annotation/deps/jemalloc/include/jemalloc/internal/arena.h
// Function: arena_dalloc
JEMALLOC_INLINE void
arena_dalloc(arena_t *arena, arena_chunk_t *chunk, void *ptr, bool try_tcache)
{
	size_t pageind, mapbits;
	tcache_t *tcache;

	assert(arena != NULL);
	assert(chunk->arena == arena);
	assert(ptr != NULL);
	assert(CHUNK_ADDR2BASE(ptr) != ptr);

	pageind = ((uintptr_t)ptr - (uintptr_t)chunk) >> LG_PAGE;
	mapbits = arena_mapbits_get(chunk, pageind);
	assert(arena_mapbits_allocated_get(chunk, pageind) != 0);
	if ((mapbits & CHUNK_MAP_LARGE) == 0) {
		/* Small allocation. */
		if (try_tcache && (tcache = tcache_get(false)) != NULL) {
			size_t binind;

			binind = arena_ptr_small_binind_get(ptr, mapbits);
			tcache_dalloc_small(tcache, ptr, binind);
		} else
			arena_dalloc_small(arena, chunk, ptr, pageind);
	} else {
		size_t size = arena_mapbits_large_size_get(chunk, pageind);

		assert(((uintptr_t)ptr & PAGE_MASK) == 0);

		if (try_tcache && size <= tcache_maxclass && (tcache =
		    tcache_get(false)) != NULL) {
			tcache_dalloc_large(tcache, ptr, size);
		} else
			arena_dalloc_large(arena, chunk, ptr);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r15
movq %rdx, %r13
subq %rsi, %r13
shrq $0xc, %r13
leaq 0x6556a(%rip), %rax     # 0xdc928
movq %r13, %rdx
subq (%rax), %rdx
movq %rdi, %r12
imulq $0x18, %rdx, %rax
movq 0x40(%rsi,%rax), %rbp
testb $0x2, %bpl
jne 0x77467
testb %cl, %cl
je 0x77535
xorl %edi, %edi
callq 0x778be
testq %rax, %rax
je 0x77535
movq %rax, %r14
shrl $0x4, %ebp
movzbl %bpl, %r15d
cmpb $0x1, 0x64758(%rip)     # 0xdbb5b
jne 0x77418
imulq $0x68, %r15, %rsi
addq 0x4bbc0(%rip), %rsi     # 0xc2fd0
movq %rbx, %rdi
callq 0x7833d
movl %r15d, %eax
shll $0x5, %eax
leaq (%r14,%rax), %r12
addq $0x28, %r12
leaq 0x76763(%rip), %rcx     # 0xedb90
movq (%rcx), %rcx
movl 0x38(%r14,%rax), %edx
cmpl (%rcx,%r15,4), %edx
jne 0x77450
shrl %edx
movq %r12, %rdi
movq %r15, %rsi
movq %r14, %rcx
callq 0x870f5
movl 0x10(%r12), %edx
movq 0x18(%r12), %rax
movl %edx, %ecx
movq %rbx, (%rax,%rcx,8)
incl %edx
movl %edx, 0x10(%r12)
jmp 0x77503
testb %cl, %cl
je 0x77519
movq %rbp, %r13
andq $-0x1000, %r13          # imm = 0xF000
leaq 0x76728(%rip), %rax     # 0xedba8
cmpq (%rax), %r13
ja 0x77519
xorl %edi, %edi
callq 0x778be
testq %rax, %rax
je 0x77519
movq %rax, %r14
shrq $0xc, %rbp
leaq 0x1b(%rbp), %r12
cmpb $0x1, 0x646b0(%rip)     # 0xdbb5b
jne 0x774bb
pushq $0x5a
popq %rsi
movq %rbx, %rdi
movq %r13, %rdx
callq 0x1f110
movq %r12, %rax
shlq $0x5, %rax
leaq (%r14,%rax), %r15
addq $0x28, %r15
leaq 0x766bf(%rip), %rcx     # 0xedb90
movq (%rcx), %rcx
movl 0x38(%r14,%rax), %edx
cmpl 0x6c(%rcx,%rbp,4), %edx
jne 0x774f3
shrl %edx
movq %r15, %rdi
movq %r12, %rsi
movq %r14, %rcx
callq 0x872d5
movl 0x10(%r15), %edx
movq 0x18(%r15), %rax
movl %edx, %ecx
movq %rbx, (%rax,%rcx,8)
incl %edx
movl %edx, 0x10(%r15)
movq %r14, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x779dc
movq %r12, %rdi
movq %r15, %rsi
movq %rbx, %rdx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x792f7
movq %r12, %rdi
movq %r15, %rsi
movq %rbx, %rdx
movq %r13, %rcx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x78e5d