// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/deps/jemalloc/src/arena.c
// Function: arena_dalloc_bin_locked_impl
static void
arena_dalloc_bin_locked_impl(arena_t *arena, arena_chunk_t *chunk, void *ptr,
    arena_chunk_map_bits_t *bitselm, bool junked)
{
	size_t pageind, rpages_ind;
	arena_run_t *run;
	arena_bin_t *bin;
	arena_bin_info_t *bin_info;
	szind_t binind;

	pageind = ((uintptr_t)ptr - (uintptr_t)chunk) >> LG_PAGE;
	rpages_ind = pageind - arena_mapbits_small_runind_get(chunk, pageind);
	run = &arena_miscelm_get(chunk, rpages_ind)->run;
	binind = run->binind;
	bin = &arena->bins[binind];
	bin_info = &arena_bin_info[binind];

	if (!junked && config_fill && unlikely(opt_junk_free))
		arena_dalloc_junk_small(ptr, bin_info);

	arena_run_reg_dalloc(run, ptr);
	if (run->nfree == bin_info->nregs) {
		arena_dissociate_bin_run(chunk, run, bin);
		arena_dalloc_bin_run(arena, chunk, run, bin);
	} else if (run->nfree == 1 && run != bin->runcur)
		arena_bin_lower_run(arena, chunk, run, bin);

	if (config_stats) {
		bin->stats.ndalloc++;
		bin->stats.curregs--;
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, %r13
movq %rdi, 0x10(%rsp)
subq %rsi, %rdx
shrq $0xc, %rdx
movq 0x31fda(%rip), %r10     # 0x5b558
movq %rdx, %rax
subq %r10, %rax
movq 0x68(%rsi,%rax,8), %rax
shrq $0xd, %rax
subq %rax, %rdx
movq 0x31fc9(%rip), %rax     # 0x5b560
movq %rsi, (%rsp)
leaq (%rdx,%rdx,2), %r14
shlq $0x5, %r14
addq %rax, %r14
addq %rsi, %r14
movq %r10, %rdx
negq %rdx
leaq (%rdx,%rdx,2), %rbx
shlq $0x5, %rbx
leaq (%rbx,%r14), %r15
addq $0x10, %r15
movl (%r15), %ebp
leaq (,%rbp,2), %r12
addq %rbp, %r12
shlq $0x5, %r12
leaq 0x310c8(%rip), %rsi     # 0x5a6a0
addq %rsi, %r12
testl %ecx, %ecx
jne 0x295ef
leaq 0x3103c(%rip), %rcx     # 0x5a622
cmpb $0x1, (%rcx)
je 0x297cc
addq %rbx, %r14
leaq 0x320b7(%rip), %rcx     # 0x5b6b0
movq (%rcx), %rdx
notq %rdx
leaq -0x10(%r15), %rcx
andq %rdx, %rcx
andq %r15, %rdx
movq %r13, %rdi
subq %rdx, %rdi
shrq $0xc, %rdi
subq %r10, %rdi
movl 0x68(%rdx,%rdi,8), %edx
shrl $0x5, %edx
movzbl %dl, %edx
leaq (%rdx,%rdx,2), %rdi
movl %edi, %r8d
shll $0x5, %r8d
addq %rcx, %rax
negq %rax
addq %r15, %rax
addq $-0x10, %rax
movabsq $-0x5555555555555555, %rdx # imm = 0xAAAAAAAAAAAAAAAB
mulq %rdx
movq 0x10(%r8,%rsi), %r9
shrl $0x6, %edx
addl %edx, %r10d
addl 0x58(%r8,%rsi), %ecx
shll $0xc, %r10d
addl %ecx, %r10d
subl %r10d, %r13d
bsfl %r9d, %eax
xorl %ecx, %ecx
cmpl $0x1, %r9d
sbbl %ecx, %ecx
orb %al, %cl
shrl %cl, %r13d
shrq %cl, %r9
cmpq $0x1, %r9
je 0x29694
cmpq $0x1f, %r9
ja 0x29814
leaq 0x1ed96(%rip), %rax     # 0x48420
imull -0xc(%rax,%r9,4), %r13d
shrl $0x17, %r13d
imulq $0xe0, %rbp, %rax
movl %r13d, %ecx
shrl $0x6, %ecx
movq 0x18(%r14,%rcx,8), %rdx
movq %rdx, %rsi
btcq %r13, %rsi
movq %rsi, 0x18(%r14,%rcx,8)
testq %rdx, %rdx
jne 0x29716
leaq 0x30fe2(%rip), %rdx     # 0x5a6a0
addq %rdx, %r8
movl 0x30(%r8), %edx
cmpq $0x2, %rdx
jb 0x29716
leaq 0x18(%r14), %rsi
addq $-0x2, %rdx
shll $0x5, %edi
leaq 0x30fc3(%rip), %r8      # 0x5a6a0
addq %r8, %rdi
addq $0x40, %rdi
xorl %r8d, %r8d
movq %rcx, %r9
shrq $0x6, %rcx
movq (%rdi,%r8,8), %r10
leaq (%rsi,%r10,8), %r10
movq (%r10,%rcx,8), %r11
movq %r11, %rbx
btcq %r9, %rbx
movq %rbx, (%r10,%rcx,8)
testq %r11, %r11
jne 0x29716
leaq 0x1(%r8), %r9
cmpq %r8, %rdx
movq %r9, %r8
jne 0x296e7
movq 0x10(%rsp), %rbp
leaq (%rax,%rbp), %r13
addq $0x450, %r13            # imm = 0x450
movl 0x14(%r14), %eax
leal 0x1(%rax), %ecx
movl %ecx, 0x14(%r14)
cmpl 0x20(%r12), %ecx
jne 0x2977b
cmpq %r15, 0x28(%r13)
je 0x29792
movq %r13, %rax
movq (%rsp), %rbx
subq (%rbx), %rax
addq $-0x450, %rax           # imm = 0xFBB0
shrq $0x5, %rax
imull $0xb6db6db7, %eax, %eax # imm = 0xB6DB6DB7
leaq (%rax,%rax,2), %rax
shlq $0x5, %rax
leaq 0x30f39(%rip), %rcx     # 0x5a6a0
cmpl $0x1, 0x20(%rax,%rcx)
je 0x2979e
movq %r13, %rdi
movq %r15, %rsi
callq 0x2d085
jmp 0x2979e
testl %eax, %eax
jne 0x297af
cmpq 0x28(%r13), %r15
je 0x297af
movq %r15, %rdi
movq %r13, %rsi
callq 0x2cfe5
jmp 0x297af
movq $0x0, 0x28(%r13)
movq (%rsp), %rbx
movq %rbp, %rdi
movq %rbx, %rsi
movq %r15, %rdx
movq %r13, %rcx
callq 0x2cf8c
incq 0xa0(%r13)
decq 0xb0(%r13)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r13, %rax
subq 0x8(%r12), %rax
movq %rax, 0x8(%rsp)
movq %r13, %rdi
movq %r12, %rsi
xorl %edx, %edx
callq 0x285cc
movq 0x10(%r12), %rdx
movq 0x8(%rsp), %rdi
movl $0x5a, %esi
callq 0x10270
leaq 0x30e9f(%rip), %rsi     # 0x5a6a0
movq 0x31d50(%rip), %r10     # 0x5b558
movq 0x31d51(%rip), %rax     # 0x5b560
jmp 0x295ef
movl %r13d, %eax
xorl %edx, %edx
divq %r9
movq %rax, %r13
jmp 0x29694