// File: /workspace/github_c_makefile_star2_O3/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, %r14
movq %rdx, %r13
subq %rsi, %r13
shrq $0xc, %r13
leaq 0x60097(%rip), %rax     # 0xdf928
movq %r13, %rdx
subq (%rax), %rdx
movq %rdi, %r15
leaq (%rdx,%rdx,2), %rax
movq 0x40(%rsi,%rax,8), %rbp
testb $0x2, %bpl
jne 0x7f91a
testb %cl, %cl
je 0x7fa18
movq 0x466a0(%rip), %rax     # 0xc5f58
movq %fs:0x0, %rsi
addq %rax, %rsi
movq %fs:(%rax), %r12
cmpq $0x3, %r12
ja 0x7f9a5
jb 0x7fa18
jne 0x7f9aa
movq $0x2, %fs:(%rax)
leaq 0x712c3(%rip), %rax     # 0xf0bb0
movl (%rax), %edi
callq 0x1f1c0
testl %eax, %eax
je 0x7fa18
leaq 0x2386b(%rip), %rdi     # 0xa316e
callq 0x915d4
cmpb $0x1, 0x5f24b(%rip)     # 0xdeb5a
jne 0x7fa18
jmp 0x7f9a0
testb %cl, %cl
je 0x7face
movq %rbp, %rdx
andq $-0x1000, %rdx          # imm = 0xF000
leaq 0x71275(%rip), %rax     # 0xf0ba8
cmpq (%rax), %rdx
ja 0x7face
movq 0x46615(%rip), %rax     # 0xc5f58
movq %fs:0x0, %rsi
addq %rax, %rsi
movq %fs:(%rax), %r12
cmpq $0x3, %r12
ja 0x7fa37
jb 0x7face
jne 0x7fa40
movq $0x2, %fs:(%rax)
leaq 0x71238(%rip), %rax     # 0xf0bb0
movl (%rax), %edi
callq 0x1f1c0
testl %eax, %eax
je 0x7face
leaq 0x237e0(%rip), %rdi     # 0xa316e
callq 0x915d4
cmpb $0x1, 0x5f1c0(%rip)     # 0xdeb5a
jne 0x7face
callq 0x1f1b0
testq %r12, %r12
je 0x7fa18
shrl $0x4, %ebp
movzbl %bpl, %r14d
cmpb $0x1, 0x5f1a3(%rip)     # 0xdeb5b
jne 0x7f9cd
imulq $0x68, %r14, %rsi
addq 0x4660b(%rip), %rsi     # 0xc5fd0
movq %rbx, %rdi
callq 0x80b41
movl %r14d, %eax
shll $0x5, %eax
leaq (%r12,%rax), %r15
addq $0x28, %r15
leaq 0x711ae(%rip), %rax     # 0xf0b90
movq (%rax), %rax
movl 0x10(%r15), %edx
cmpl (%rax,%r14,4), %edx
jne 0x7fa03
shrl %edx
movq %r15, %rdi
movq %r14, %rsi
movq %r12, %rcx
callq 0x90bee
movl 0x10(%r15), %edx
movq 0x18(%r15), %rax
movl %edx, %ecx
movq %rbx, (%rax,%rcx,8)
incl %edx
movl %edx, 0x10(%r15)
jmp 0x7faa5
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
movq %r13, %rcx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x817a1
testq %r12, %r12
je 0x7face
shrq $0xc, %rbp
leaq 0x1b(%rbp), %r15
cmpb $0x1, 0x5f10c(%rip)     # 0xdeb5b
jne 0x7fa5e
movq %rbx, %rdi
movl $0x5a, %esi
callq 0x1f110
movq %r15, %rax
shlq $0x5, %rax
leaq (%r12,%rax), %r14
addq $0x28, %r14
leaq 0x7111c(%rip), %rax     # 0xf0b90
movq (%rax), %rax
movl 0x10(%r14), %edx
cmpl 0x6c(%rax,%rbp,4), %edx
jne 0x7fa95
shrl %edx
movq %r14, %rdi
movq %r15, %rsi
movq %r12, %rcx
callq 0x90dea
movl 0x10(%r14), %edx
movq 0x18(%r14), %rax
movl %edx, %ecx
movq %rbx, (%rax,%rcx,8)
incl %edx
movl %edx, 0x10(%r14)
movl 0x20(%r12), %eax
incl %eax
movl %eax, 0x20(%r12)
cmpl $0x125, %eax            # imm = 0x125
jne 0x7faea
movq %r12, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x90b49
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x81c48
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq