// File: /workspace/github_c_makefile_star2_O1/zhou-yuxin[P]redis-aof-no-cow/deps/jemalloc/src/huge.c
// Function: je_huge_dalloc
void
huge_dalloc(tsdn_t *tsdn, void *ptr)
{
	extent_node_t *node;
	arena_t *arena;

	node = huge_node_get(ptr);
	arena = extent_node_arena_get(node);
	huge_node_unset(ptr, node);
	malloc_mutex_lock(tsdn, &arena->huge_mtx);
	ql_remove(&arena->huge, node, ql_link);
	malloc_mutex_unlock(tsdn, &arena->huge_mtx);

	huge_dalloc_junk(extent_node_addr_get(node),
	    extent_node_size_get(node));
	arena_chunk_dalloc_huge(tsdn, extent_node_arena_get(node),
	    extent_node_addr_get(node), extent_node_size_get(node),
	    extent_node_sn_get(node));
	idalloctm(tsdn, node, NULL, true, true);

	arena_decay_tick(tsdn, arena);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r12
movq %rdi, %rbx
movq %rsi, %rdi
callq 0x2e3aa
movq %rax, %r15
movq (%rax), %r14
movq %r12, %rdi
movq %rax, %rsi
callq 0x26812
leaq 0x830(%r14), %r13
movq %r13, %rdi
callq 0xb5a0
movq 0x828(%r14), %rax
cmpq %r15, %rax
jne 0x11277
movq 0x50(%rax), %rax
movq %rax, 0x828(%r14)
movq %r15, %r12
cmpq %r15, 0x828(%r14)
je 0x112ab
movq 0x50(%r12), %rax
movq 0x58(%r12), %rcx
movq %rax, 0x50(%rcx)
movq 0x50(%r12), %rax
movq 0x58(%r12), %rcx
movq %rcx, 0x58(%rax)
movq %r12, 0x50(%r12)
movq %r12, 0x58(%r12)
jmp 0x112b3
andq $0x0, 0x828(%r14)
movq %r13, %rdi
callq 0xb380
leaq 0x3b260(%rip), %rax     # 0x4c522
cmpb $0x1, (%rax)
je 0x113df
movq (%r12), %rsi
movq 0x8(%r12), %rdx
movq 0x10(%r12), %rcx
movq 0x18(%r12), %r8
movq %rbx, %rdi
callq 0x21d63
leaq 0x3bde3(%rip), %rsi     # 0x4d0d0
movq (%rsi), %r13
notq %r13
andq %r15, %r13
movq %r13, %rax
cmpq %r13, %r15
je 0x113f6
movq %r15, %rcx
movq (%rax), %rbp
subq %r13, %rcx
je 0x11409
shrq $0xc, %rcx
leaq 0x3bca4(%rip), %rax     # 0x4cfc0
subq (%rax), %rcx
movq 0x78(%r13,%rcx,8), %rax
movl %eax, %ecx
shrl $0x5, %ecx
movl $0xff, %edx
andl %edx, %ecx
cmpl %edx, %ecx
je 0x1142c
movl %ecx, %eax
leaq 0x2a2ff(%rip), %rcx     # 0x3b640
movq (%rcx,%rax,8), %rax
negq %rax
lock
xaddq %rax, 0x90(%rbp)
movq (%rsi), %rdx
notq %rdx
andq %r15, %rdx
subq %rdx, %r15
je 0x1141c
shrq $0xc, %r15
leaq 0x3bc52(%rip), %rax     # 0x4cfc0
movq %r15, %rcx
subq (%rax), %rcx
testb $0x2, 0x78(%rdx,%rcx,8)
movq (%rdx), %rsi
movq %rbx, %rdi
movq %r12, %rcx
jne 0x11440
movq %r15, %r8
callq 0xdf6b
testq %rbx, %rbx
je 0x113c6
movl (%r14), %esi
movq 0x38(%rbx), %rax
testq %rax, %rax
je 0x113d5
cmpl %esi, 0x40(%rbx)
jbe 0x113d5
leaq (%rax,%rsi,8), %rax
testq %rax, %rax
je 0x113c6
movl (%rax), %ecx
testl %ecx, %ecx
jle 0x1144a
leal -0x1(%rcx), %edx
movl %edx, (%rax)
testl %ecx, %ecx
jle 0x11452
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rbx, %rdi
callq 0x1afa2
jmp 0x113aa
movq 0x8(%r12), %rdi
movq 0x10(%r12), %rdx
pushq $0x5a
popq %rsi
callq 0xb230
jmp 0x112cb
movq %r12, %rdi
movq %rsi, %rbp
callq 0x2e3aa
movq %rbp, %rsi
jmp 0x11302
movq %rsi, %r13
movq %r12, %rsi
callq 0x2e4e2
movq %r13, %rsi
jmp 0x11345
movq %rbx, %rdi
movq %r12, %rsi
callq 0x11227
jmp 0x11390
shrq %rax
andq $-0x1000, %rax          # imm = 0xF000
addq $-0x1000, %rax          # imm = 0xF000
jmp 0x11345
callq 0xdfd3
jmp 0x11390
movl 0x4(%rax), %edx
jmp 0x113bc
movq %rbx, %rdi
movq %r14, %rsi
xorl %edx, %edx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x226c8