// File: /workspace/github_c_makefile_star2_O1/zhou-yuxin[P]redis-aof-no-cow/deps/jemalloc/src/arena.c
// Function: arena_run_first_best_fit
static arena_run_t *
arena_run_first_best_fit(arena_t *arena, size_t size)
{
	pszind_t pind, i;

	pind = psz2ind(run_quantize_ceil(size));

	for (i = pind; pind2sz(i) <= chunksize; i++) {
		arena_chunk_map_misc_t *miscelm = arena_run_heap_first(
		    &arena->runs_avail[i]);
		if (miscelm != NULL)
			return (&miscelm->run);
	}

	return (NULL);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r15
movq %rdi, %rbx
movabsq $0x7000000000000000, %r12 # imm = 0x7000000000000000
movl $0xfffffffd, %r14d      # imm = 0xFFFFFFFD
movq %rsi, %rdi
callq 0xf31c
pushq $0xc
popq %rdx
cmpq %r15, %rax
jae 0xfa7e
leaq -0xfff(%rax), %rcx
cmpq %r12, %rcx
ja 0xfdb8
leaq -0x1(,%rcx,2), %rcx
bsrq %rcx, %rsi
xorl %ecx, %ecx
movl %esi, %edi
subl $0xe, %edi
cmovbl %ecx, %edi
leal (%r14,%rsi), %ecx
cmpl $0xf, %esi
cmovbl %edx, %ecx
addq $-0x1000, %rax          # imm = 0xF000
shrq %cl, %rax
shlq %cl, %rax
shrq %cl, %rax
andl $0x3, %eax
leal (%rax,%rdi,4), %ecx
leaq 0x2b58b(%rip), %rsi     # 0x3b000
movl $0x1000, %eax           # imm = 0x1000
addq (%rsi,%rcx,8), %rax
cmpq %r12, %rax
ja 0xfdae
leaq -0x1(,%rax,2), %rcx
bsrq %rcx, %rcx
xorl %esi, %esi
movl %ecx, %edi
subl $0xe, %edi
cmovbl %esi, %edi
addl %ecx, %r14d
cmpl $0xf, %ecx
cmovbl %edx, %r14d
decq %rax
movl %r14d, %ecx
shrq %cl, %rax
shlq %cl, %rax
shrq %cl, %rax
andl $0x3, %eax
leal (%rax,%rdi,4), %ecx
movl %ecx, %r9d
leaq 0x2b53a(%rip), %r14     # 0x3b000
movq (%r14,%r9,8), %rax
leaq 0x3d5f7(%rip), %rsi     # 0x4d0c8
cmpq (%rsi), %rax
ja 0xfd9d
addq $0x2318, %rbx           # imm = 0x2318
xorps %xmm0, %xmm0
leaq 0x3d5e5(%rip), %r12     # 0x4d0d0
movq (%rbx,%r9,8), %r8
testq %r8, %r8
je 0xfb88
leaq (%rbx,%r9,8), %r9
movq 0x8(%r8), %r10
testq %r10, %r10
je 0xfd7b
movups %xmm0, (%r8)
andq $0x0, (%r10)
movq 0x8(%r10), %r15
testq %r15, %r15
je 0xfd0d
movq 0x8(%r15), %r13
testq %r13, %r13
je 0xfb2c
andq $0x0, (%r13)
movups %xmm0, (%r10)
movups %xmm0, (%r15)
movq (%r12), %r11
notq %r11
movq %r11, %r12
andq %r10, %r12
movq 0x18(%r12), %r12
movq %r11, %rdx
andq %r15, %rdx
xorl %ebp, %ebp
cmpq 0x18(%rdx), %r12
seta %bpl
sbbl $0x0, %ebp
jne 0xfb67
xorl %ebp, %ebp
cmpq %r15, %r10
seta %bpl
sbbl $0x0, %ebp
testl %ebp, %ebp
js 0xfb90
movq %r15, (%r10)
movq 0x10(%r15), %r12
movq %r12, 0x8(%r10)
testq %r12, %r12
je 0xfb7f
movq %r10, (%r12)
movq %r10, 0x10(%r15)
movq %r15, %r10
jmp 0xfba8
xorl %r8d, %r8d
jmp 0xfd7e
movq %r10, (%r15)
movq 0x10(%r10), %r12
movq %r12, 0x8(%r15)
testq %r12, %r12
je 0xfba4
movq %r15, (%r12)
movq %r15, 0x10(%r10)
movq %r14, %rsi
movq %r10, %r15
testq %r13, %r13
je 0xfc59
movq %r10, %r12
movq 0x8(%r13), %r14
testq %r14, %r14
je 0xfc26
movq 0x8(%r14), %rdx
testq %rdx, %rdx
je 0xfbd0
andq $0x0, (%rdx)
movups %xmm0, (%r13)
movq %r13, %rbp
andq %r11, %rbp
movups %xmm0, (%r14)
movq 0x18(%rbp), %rdi
movq %r14, %r15
andq %r11, %r15
xorl %ebp, %ebp
cmpq 0x18(%r15), %rdi
seta %bpl
sbbl $0x0, %ebp
jne 0xfc04
xorl %ebp, %ebp
cmpq %r14, %r13
seta %bpl
sbbl $0x0, %ebp
testl %ebp, %ebp
js 0xfc2a
movq %r14, (%r13)
movq 0x10(%r14), %rbp
movq %rbp, 0x8(%r13)
testq %rbp, %rbp
je 0xfc1d
movq %r13, (%rbp)
movq %r13, 0x10(%r14)
movq %r14, %r13
jmp 0xfc42
xorl %edx, %edx
jmp 0xfc42
movq %r13, (%r14)
movq 0x10(%r13), %rbp
movq %rbp, 0x8(%r14)
testq %rbp, %rbp
je 0xfc3e
movq %r14, (%rbp)
movq %r14, 0x10(%r13)
movq %r13, %r15
movq %r13, 0x8(%r12)
movq %r13, %r12
movq %rdx, %r13
testq %rdx, %rdx
jne 0xfbba
movq 0x8(%r10), %r14
testq %r14, %r14
jne 0xfc76
jmp 0xfcfc
movq %r13, 0x8(%r15)
movq 0x8(%r12), %r14
movq %r12, %r10
movq %r13, %r15
movq 0x8(%r14), %r12
andq $0x0, 0x8(%r10)
andq $0x0, 0x8(%r14)
testq %r14, %r14
je 0xfced
movq %r10, %rdx
andq %r11, %rdx
movq 0x18(%rdx), %rdx
movq %r14, %rdi
andq %r11, %rdi
xorl %ebp, %ebp
cmpq 0x18(%rdi), %rdx
seta %bpl
sbbl $0x0, %ebp
jne 0xfcb4
xorl %ebp, %ebp
cmpq %r14, %r10
seta %bpl
sbbl $0x0, %ebp
testl %ebp, %ebp
js 0xfcd5
movq %r14, (%r10)
movq 0x10(%r14), %r13
movq %r13, 0x8(%r10)
testq %r13, %r13
je 0xfccc
movq %r10, (%r13)
movq %r10, 0x10(%r14)
movq %r14, %r13
jmp 0xfcf0
movq %r10, (%r14)
movq 0x10(%r10), %r13
movq %r13, 0x8(%r14)
testq %r13, %r13
je 0xfce9
movq %r14, (%r13)
movq %r14, 0x10(%r10)
movq %r10, %r13
testq %r12, %r12
jne 0xfc67
movq %r13, %r10
movq %rsi, %r14
leaq 0x3d3c2(%rip), %rsi     # 0x4d0c8
leaq 0x3d3c3(%rip), %r12     # 0x4d0d0
movq (%r12), %rdx
notq %rdx
movq %rdx, %rdi
andq %r8, %rdi
movq 0x18(%rdi), %rdi
andq %r10, %rdx
xorl %r11d, %r11d
cmpq 0x18(%rdx), %rdi
seta %r11b
sbbl $0x0, %r11d
jne 0xfd40
xorl %r11d, %r11d
cmpq %r10, %r8
seta %r11b
sbbl $0x0, %r11d
testl %r11d, %r11d
js 0xfd61
movq %r10, (%r8)
movq 0x10(%r10), %r11
movq %r11, 0x8(%r8)
testq %r11, %r11
je 0xfd58
movq %r8, (%r11)
movq %r8, 0x10(%r10)
movq %r9, %r8
jmp 0xfd78
movq %r8, (%r10)
movq 0x10(%r8), %r11
addq $0x10, %r8
movq %r11, 0x8(%r10)
testq %r11, %r11
je 0xfd78
movq %r10, (%r11)
movq %r10, (%r8)
movq (%r9), %r8
leaq 0x18(%r8), %rdx
testq %r8, %r8
cmovneq %rdx, %rax
jne 0xfd9f
incl %ecx
movq (%r14,%rcx,8), %r8
movq %rcx, %r9
cmpq (%rsi), %r8
jbe 0xfaeb
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0xc7, %ecx
jmp 0xfabc
movl $0xc7, %ecx
jmp 0xfa6e