// File: /workspace/github_c_makefile_star2_O1/erikdubbelboer[P]discnt/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)
movq %rdx, %rax
subq %rsi, %rax
shrq $0xc, %rax
movq 0x48e8b(%rip), %rdx     # 0x84548
movq %rax, %rdi
subq %rdx, %rdi
movq 0x68(%rsi,%rdi,8), %rdi
shrq $0xd, %rdi
subq %rdi, %rax
movq 0x48e7a(%rip), %rdi     # 0x84550
movq %rsi, (%rsp)
addq %rsi, %rdi
leaq (%rax,%rax,2), %r14
shlq $0x5, %r14
addq %rdi, %r14
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 0x4809c(%rip), %r9      # 0x837b0
addq %r9, %r12
testl %ecx, %ecx
jne 0x3b72b
leaq 0x48010(%rip), %rax     # 0x83732
cmpb $0x1, (%rax)
je 0x3b913
addq %rbx, %r14
leaq 0x48f6b(%rip), %rax     # 0x846a0
movq (%rax), %rax
notq %rax
leaq -0x10(%r15), %rcx
andq %rax, %rcx
andq %r15, %rax
movq %r13, %rdx
subq %rax, %rdx
shrq $0xc, %rdx
movq 0x48df2(%rip), %r8      # 0x84548
subq %r8, %rdx
movl 0x68(%rax,%rdx,8), %eax
shrl $0x5, %eax
movzbl %al, %eax
leaq (%rax,%rax,2), %rsi
movl %esi, %edi
shll $0x5, %edi
movq 0x48ddd(%rip), %rax     # 0x84550
addq %rcx, %rax
negq %rax
addq %r15, %rax
addq $-0x10, %rax
movabsq $-0x5555555555555555, %rdx # imm = 0xAAAAAAAAAAAAAAAB
mulq %rdx
shrl $0x6, %edx
addl 0x58(%rdi,%r9), %ecx
addl %edx, %r8d
shll $0xc, %r8d
addl %ecx, %r8d
subl %r8d, %r13d
movq 0x10(%rdi,%r9), %r8
bsfl %r8d, %eax
xorl %ecx, %ecx
cmpl $0x1, %r8d
sbbl %ecx, %ecx
orb %al, %cl
shrl %cl, %r13d
shrq %cl, %r8
cmpq $0x1, %r8
je 0x3b7dc
cmpq $0x1f, %r8
ja 0x3b94d
leaq 0x1e45e(%rip), %rax     # 0x59c30
imull -0xc(%rax,%r8,4), %r13d
shrl $0x17, %r13d
imulq $0xe0, %rbp, %rax
movl %r13d, %ecx
shrl $0x6, %ecx
movq 0x18(%r14,%rcx,8), %rdx
movq %rdx, %r8
btcq %r13, %r8
movq %r8, 0x18(%r14,%rcx,8)
testq %rdx, %rdx
jne 0x3b85d
leaq 0x47faa(%rip), %rdx     # 0x837b0
addq %rdx, %rdi
movl 0x30(%rdi), %edx
cmpq $0x2, %rdx
jb 0x3b85d
leaq 0x18(%r14), %rdi
addq $-0x2, %rdx
shll $0x5, %esi
leaq 0x47f8c(%rip), %r8      # 0x837b0
addq %r8, %rsi
addq $0x40, %rsi
xorl %r8d, %r8d
movq %rcx, %r9
shrq $0x6, %rcx
movq (%rsi,%r8,8), %r10
leaq (%rdi,%r10,8), %r10
movq (%r10,%rcx,8), %r11
movq %r11, %rbx
btcq %r9, %rbx
movq %rbx, (%r10,%rcx,8)
testq %r11, %r11
jne 0x3b85d
leaq 0x1(%r8), %r9
cmpq %r8, %rdx
movq %r9, %r8
jne 0x3b82e
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 0x3b8c2
cmpq %r15, 0x28(%r13)
je 0x3b8d9
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 0x47f02(%rip), %rcx     # 0x837b0
cmpl $0x1, 0x20(%rax,%rcx)
je 0x3b8e5
movq %r13, %rdi
movq %r15, %rsi
callq 0x3f14f
jmp 0x3b8e5
testl %eax, %eax
jne 0x3b8f6
cmpq 0x28(%r13), %r15
je 0x3b8f6
movq %r15, %rdi
movq %r13, %rsi
callq 0x3f0b2
jmp 0x3b8f6
movq $0x0, 0x28(%r13)
movq (%rsp), %rbx
movq %rbp, %rdi
movq %rbx, %rsi
movq %r15, %rdx
movq %r13, %rcx
callq 0x3f059
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 0x3b038
movq 0x10(%r12), %rdx
movq 0x8(%rsp), %rdi
movl $0x5a, %esi
callq 0x12380
leaq 0x47e68(%rip), %r9      # 0x837b0
jmp 0x3b72b
movl %r13d, %eax
xorl %edx, %edx
divq %r8
movq %rax, %r13
jmp 0x3b7dc