// File: /workspace/github_c_makefile_star2_O1/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 0x6030b(%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 0x7f65c
testb %cl, %cl
je 0x7f74a
movq 0x46914(%rip), %rax     # 0xc5f58
movq %fs:(%rax), %r12
cmpq $0x3, %r12
ja 0x7f6e7
jae 0x7f6a1
xorl %r12d, %r12d
jmp 0x7f6e7
testb %cl, %cl
je 0x7f84c
movq %rbp, %r13
andq $-0x1000, %r13          # imm = 0xF000
leaq 0x71533(%rip), %rax     # 0xf0ba8
cmpq (%rax), %r13
ja 0x7f84c
movq 0x468d3(%rip), %rax     # 0xc5f58
movq %fs:(%rax), %r12
cmpq $0x3, %r12
ja 0x7f7b3
jae 0x7f769
xorl %r12d, %r12d
jmp 0x7f7b3
jne 0x7f6e7
movq %fs:0x0, %rsi
addq %rax, %rsi
movq $0x2, %fs:(%rax)
leaq 0x714f2(%rip), %rax     # 0xf0bb0
movl (%rax), %edi
callq 0x1f1c0
testl %eax, %eax
je 0x7f654
leaq 0x239c6(%rip), %rdi     # 0xa3096
callq 0x9124c
cmpb $0x1, 0x5f47e(%rip)     # 0xdeb5a
jne 0x7f654
jmp 0x7f7ae
testq %r12, %r12
je 0x7f74a
shrl $0x4, %ebp
movzbl %bpl, %r14d
cmpb $0x1, 0x5f461(%rip)     # 0xdeb5b
jne 0x7f70f
imulq $0x68, %r14, %rsi
addq 0x468c9(%rip), %rsi     # 0xc5fd0
movq %rbx, %rdi
callq 0x8085a
movl %r14d, %eax
shll $0x5, %eax
leaq (%r12,%rax), %r15
addq $0x28, %r15
leaq 0x7146c(%rip), %rax     # 0xf0b90
movq (%rax), %rax
movl (%rax,%r14,4), %edx
cmpl %edx, 0x10(%r15)
jne 0x7f810
shrl %edx
movq %r15, %rdi
movq %r14, %rsi
movq %r12, %rcx
callq 0x908bd
jmp 0x7f810
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 0x8147f
jne 0x7f7b3
movq %fs:0x0, %rsi
addq %rax, %rsi
movq $0x2, %fs:(%rax)
leaq 0x7142a(%rip), %rax     # 0xf0bb0
movl (%rax), %edi
callq 0x1f1c0
testl %eax, %eax
je 0x7f699
leaq 0x238fa(%rip), %rdi     # 0xa3096
callq 0x9124c
cmpb $0x1, 0x5f3b2(%rip)     # 0xdeb5a
jne 0x7f699
callq 0x1f1b0
testq %r12, %r12
je 0x7f84c
shrq $0xc, %rbp
leaq 0x1b(%rbp), %r14
cmpb $0x1, 0x5f390(%rip)     # 0xdeb5b
jne 0x7f7dd
movq %rbx, %rdi
movl $0x5a, %esi
movq %r13, %rdx
callq 0x1f110
movq %r14, %rax
shlq $0x5, %rax
leaq (%r12,%rax), %r15
addq $0x28, %r15
leaq 0x7139d(%rip), %rax     # 0xf0b90
movq (%rax), %rax
movl 0x6c(%rax,%rbp,4), %edx
cmpl %edx, 0x10(%r15)
jne 0x7f810
shrl %edx
movq %r15, %rdi
movq %r14, %rsi
movq %r12, %rcx
callq 0x90ac1
movq 0x18(%r15), %rax
movl 0x10(%r15), %ecx
movq %rbx, (%rax,%rcx,8)
leal 0x1(%rcx), %eax
movl %eax, 0x10(%r15)
movl 0x20(%r12), %eax
incl %eax
movl %eax, 0x20(%r12)
cmpl $0x125, %eax            # imm = 0x125
jne 0x7f868
movq %r12, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x90815
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 0x81920
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq