// File: /workspace/github_c_makefile_star2_O2/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
subq $0x18, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movq %rsi, %rdi
callq 0x1f29f
movq %rax, %rdi
cmpq %r14, %rax
jae 0x20822
addq $-0xfff, %rdi           # imm = 0xF001
callq 0x1f250
movl %eax, %eax
leaq 0x153e7(%rip), %rcx     # 0x35c00
movl $0x1000, %edi           # imm = 0x1000
addq (%rcx,%rax,8), %rdi
callq 0x1f250
leaq 0x2889a(%rip), %rcx     # 0x490c8
movq (%rcx), %rcx
addq $0x2318, %rbx           # imm = 0x2318
leaq 0x153c1(%rip), %rdx     # 0x35c00
movl %eax, %ebp
cmpq %rcx, (%rdx,%rbp,8)
ja 0x208bf
movq (%rbx,%rbp,8), %r14
leal 0x1(%rbp), %eax
testq %r14, %r14
je 0x2083f
movq 0x8(%r14), %r15
testq %r15, %r15
je 0x20a3b
xorps %xmm0, %xmm0
movups %xmm0, (%r14)
andq $0x0, (%r15)
movq 0x8(%r15), %r13
testq %r13, %r13
je 0x209f2
movq %rbx, 0x8(%rsp)
movq 0x8(%r13), %r12
testq %r12, %r12
je 0x2088b
andq $0x0, (%r12)
movups %xmm0, (%r15)
movups %xmm0, (%r13)
movq %r15, %rdi
movq %r13, %rsi
callq 0x1fd5c
testl %eax, %eax
js 0x208c7
movq %r13, (%r15)
movq 0x10(%r13), %rax
movq %rax, 0x8(%r15)
testq %rax, %rax
je 0x208b6
movq %r15, (%rax)
movq %r15, 0x10(%r13)
movq %r13, %r15
jmp 0x208df
xorl %r14d, %r14d
jmp 0x20a3f
movq %r15, (%r13)
movq 0x10(%r15), %rax
movq %rax, 0x8(%r13)
testq %rax, %rax
je 0x208db
movq %r13, (%rax)
movq %r13, 0x10(%r15)
movq %r15, %r13
testq %r12, %r12
je 0x20973
movq %r13, 0x10(%rsp)
movq 0x8(%r12), %r13
testq %r13, %r13
je 0x20941
movq 0x8(%r13), %rbx
testq %rbx, %rbx
je 0x20907
andq $0x0, (%rbx)
xorps %xmm0, %xmm0
movups %xmm0, (%r12)
movups %xmm0, (%r13)
movq %r12, %rdi
movq %r13, %rsi
callq 0x1fd5c
testl %eax, %eax
js 0x20945
movq %r13, (%r12)
movq 0x10(%r13), %rax
movq %rax, 0x8(%r12)
testq %rax, %rax
je 0x20938
movq %r12, (%rax)
movq %r12, 0x10(%r13)
movq %r13, %r12
jmp 0x2095f
xorl %ebx, %ebx
jmp 0x2095f
movq %r12, (%r13)
movq 0x10(%r12), %rax
movq %rax, 0x8(%r13)
testq %rax, %rax
je 0x2095a
movq %r13, (%rax)
movq %r13, 0x10(%r12)
movq 0x10(%rsp), %rax
movq %r12, 0x8(%rax)
movq %r12, %r13
movq %rbx, %r12
jmp 0x208e2
movq 0x8(%r15), %r12
testq %r12, %r12
je 0x209ed
movq 0x8(%r12), %rbx
andq $0x0, 0x8(%r15)
andq $0x0, 0x8(%r12)
movq %r15, %rdi
movq %r12, %rsi
callq 0x1fd5c
testl %eax, %eax
js 0x209b9
movq %r12, (%r15)
movq 0x10(%r12), %rax
movq %rax, 0x8(%r15)
testq %rax, %rax
je 0x209af
movq %r15, (%rax)
movq %r15, 0x10(%r12)
movq %r12, %rax
jmp 0x209d5
movq %r15, (%r12)
movq 0x10(%r15), %rax
movq %rax, 0x8(%r12)
testq %rax, %rax
je 0x209ce
movq %r12, (%rax)
movq %r12, 0x10(%r15)
movq %r15, %rax
testq %rbx, %rbx
je 0x209ea
movq %rax, 0x8(%r13)
movq 0x8(%rbx), %r12
movq %rbx, %r15
movq %rax, %r13
jmp 0x2097c
movq %rax, %r15
movq 0x8(%rsp), %rbx
movq %r14, %rdi
movq %r15, %rsi
callq 0x1fd5c
testl %eax, %eax
js 0x20a21
movq %r15, (%r14)
movq 0x10(%r15), %rax
movq %rax, 0x8(%r14)
testq %rax, %rax
je 0x20a14
movq %r14, (%rax)
leaq (%rbx,%rbp,8), %rax
movq %r14, 0x10(%r15)
movq %r15, %r14
jmp 0x20a38
movq %r14, (%r15)
leaq 0x10(%r14), %rax
movq 0x10(%r14), %rcx
movq %rcx, 0x8(%r15)
testq %rcx, %rcx
je 0x20a38
movq %r15, (%rcx)
movq %r15, (%rax)
addq $0x18, %r14
movq %r14, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq