// File: /workspace/github_c_makefile_star2_O3/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 %r15
pushq %r14
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 0x24efb
pushq $0xc
popq %rdx
cmpq %r15, %rax
jae 0xf3bc
leaq -0xfff(%rax), %rcx
cmpq %r12, %rcx
ja 0xf6c7
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 0x2bccd(%rip), %rsi     # 0x3b080
movl $0x1000, %eax           # imm = 0x1000
addq (%rsi,%rcx,8), %rax
cmpq %r12, %rax
ja 0xf6bd
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), %eax
leaq 0x3dcc7(%rip), %rcx     # 0x4d0c8
movq (%rcx), %rdx
movl %eax, %ecx
leaq 0x2bc73(%rip), %rsi     # 0x3b080
cmpq %rdx, (%rsi,%rcx,8)
ja 0xf430
addq $0x2318, %rbx           # imm = 0x2318
leal 0x1(%rcx), %edi
movq (%rbx,%rcx,8), %rax
testq %rax, %rax
jne 0xf437
movl %edi, %ecx
incl %edi
cmpq %rdx, (%rsi,%rcx,8)
jbe 0xf41d
xorl %eax, %eax
jmp 0xf6b1
movq 0x8(%rax), %rdx
testq %rdx, %rdx
je 0xf6ad
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
andq $0x0, (%rdx)
movq 0x8(%rdx), %r8
testq %r8, %r8
je 0xf4c8
movq 0x8(%r8), %rdi
testq %rdi, %rdi
je 0xf464
andq $0x0, (%rdi)
movups %xmm0, (%rdx)
movups %xmm0, (%r8)
leaq 0x3dc5e(%rip), %rsi     # 0x4d0d0
movq (%rsi), %rsi
notq %rsi
movq %rsi, %r9
andq %rdx, %r9
movq 0x18(%r9), %r10
movq %rsi, %r11
andq %r8, %r11
xorl %r9d, %r9d
cmpq 0x18(%r11), %r10
seta %r9b
sbbl $0x0, %r9d
jne 0xf4a7
xorl %r9d, %r9d
cmpq %r8, %rdx
seta %r9b
sbbl $0x0, %r9d
testl %r9d, %r9d
js 0xf4da
movq %r8, (%rdx)
movq 0x10(%r8), %r9
movq %r9, 0x8(%rdx)
testq %r9, %r9
je 0xf4bf
movq %rdx, (%r9)
movq %rdx, 0x10(%r8)
movq %r8, %rdx
jmp 0xf4f1
leaq 0x3dc01(%rip), %rsi     # 0x4d0d0
movq (%rsi), %rsi
notq %rsi
jmp 0xf647
movq %rdx, (%r8)
movq 0x10(%rdx), %r9
movq %r9, 0x8(%r8)
testq %r9, %r9
je 0xf4ed
movq %r8, (%r9)
movq %r8, 0x10(%rdx)
movq %rdx, %r8
testq %rdi, %rdi
je 0xf5a7
movq %rdx, %r9
movq 0x8(%rdi), %r8
testq %r8, %r8
je 0xf5a0
movq 0x8(%r8), %r10
testq %r10, %r10
je 0xf51a
andq $0x0, (%r10)
movups %xmm0, (%rdi)
movq %rdi, %r11
andq %rsi, %r11
movups %xmm0, (%r8)
movq 0x18(%r11), %r14
movq %r8, %r15
andq %rsi, %r15
xorl %r11d, %r11d
cmpq 0x18(%r15), %r14
seta %r11b
sbbl $0x0, %r11d
jne 0xf550
xorl %r11d, %r11d
cmpq %r8, %rdi
seta %r11b
sbbl $0x0, %r11d
testl %r11d, %r11d
js 0xf571
movq %r8, (%rdi)
movq 0x10(%r8), %r11
movq %r11, 0x8(%rdi)
testq %r11, %r11
je 0xf568
movq %rdi, (%r11)
movq %rdi, 0x10(%r8)
movq %r8, %rdi
jmp 0xf588
movq %rdi, (%r8)
movq 0x10(%rdi), %r11
movq %r11, 0x8(%r8)
testq %r11, %r11
je 0xf584
movq %r8, (%r11)
movq %r8, 0x10(%rdi)
movq %rdi, %r8
movq %rdi, 0x8(%r9)
movq %rdi, %r9
movq %r10, %rdi
testq %r10, %r10
jne 0xf500
jmp 0xf5a7
movq %rdi, 0x8(%r9)
movq %rdi, %r8
movq 0x8(%rdx), %rdi
testq %rdi, %rdi
je 0xf647
movq 0x8(%rdi), %r9
andq $0x0, 0x8(%rdx)
andq $0x0, 0x8(%rdi)
movq %rdx, %r10
andq %rsi, %r10
movq 0x18(%r10), %r11
movq %rdi, %r14
andq %rsi, %r14
xorl %r10d, %r10d
cmpq 0x18(%r14), %r11
seta %r10b
sbbl $0x0, %r10d
jne 0xf5f1
xorl %r10d, %r10d
cmpq %rdi, %rdx
seta %r10b
sbbl $0x0, %r10d
testl %r10d, %r10d
js 0xf612
movq %rdi, (%rdx)
movq 0x10(%rdi), %r10
movq %r10, 0x8(%rdx)
testq %r10, %r10
je 0xf609
movq %rdx, (%r10)
movq %rdx, 0x10(%rdi)
movq %rdi, %r10
jmp 0xf62c
movq %rdx, (%rdi)
movq 0x10(%rdx), %r10
movq %r10, 0x8(%rdi)
testq %r10, %r10
je 0xf625
movq %rdi, (%r10)
movq %rdi, 0x10(%rdx)
movq %rdx, %r10
testq %r9, %r9
je 0xf644
movq %r10, 0x8(%r8)
movq 0x8(%r9), %rdi
movq %r9, %rdx
movq %r10, %r8
jmp 0xf5b4
movq %r10, %rdx
movq %rsi, %rdi
andq %rax, %rdi
movq 0x18(%rdi), %r8
andq %rdx, %rsi
xorl %edi, %edi
cmpq 0x18(%rsi), %r8
seta %dil
sbbl $0x0, %edi
jne 0xf66f
xorl %edi, %edi
cmpq %rdx, %rax
seta %dil
sbbl $0x0, %edi
testl %edi, %edi
js 0xf693
movq %rdx, (%rax)
movq 0x10(%rdx), %rsi
movq %rsi, 0x8(%rax)
testq %rsi, %rsi
je 0xf686
movq %rax, (%rsi)
leaq (%rbx,%rcx,8), %rcx
movq %rax, 0x10(%rdx)
movq %rdx, %rax
jmp 0xf6aa
movq %rax, (%rdx)
leaq 0x10(%rax), %rcx
movq 0x10(%rax), %rsi
movq %rsi, 0x8(%rdx)
testq %rsi, %rsi
je 0xf6aa
movq %rdx, (%rsi)
movq %rdx, (%rcx)
addq $0x18, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movl $0xc7, %eax
jmp 0xf3fa
movl $0xc7, %ecx
jmp 0xf3ac