	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_prepare_object_metafile        ## -- Begin function prepare_object_metafile
	.p2align	4, 0x90
_prepare_object_metafile:               ## @prepare_object_metafile
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %ebx
	callq	_choose_revlist_metafile
	movq	%rax, %r14
	movq	_tot_revlist_metafiles@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	cmpq	(%rcx), %r14
	jge	LBB0_11
## %bb.1:
	movl	%ebx, -44(%rbp)                 ## 4-byte Spill
	movq	%r14, %rdi
	shrq	$63, %rdi
	xorl	$1, %edi
                                        ## kill: def $edi killed $edi killed $rdi
	callq	_assert
	movq	_tot_metafiles_memory@GOTPCREL(%rip), %r15
	movq	_memory_for_metafiles@GOTPCREL(%rip), %rbx
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r15), %rax
	cmpq	(%rbx), %rax
	jle	LBB0_4
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	xorl	%eax, %eax
	callq	_unload_LRU
	testq	%rax, %rax
	jne	LBB0_2
LBB0_4:
	movq	_Header@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	leal	(%r12,%r14), %r15d
	incl	%r15d
	movq	_head_metafile@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	leaq	L_.str(%rip), %rsi
	movl	$3, %edi
	movl	%r15d, %edx
	xorl	%eax, %eax
	callq	_vkprintf
	movq	_metafiles@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rax
	movslq	%r15d, %r13
	movq	(%rax,%r13,8), %rax
	movl	-44(%rbp), %ebx                 ## 4-byte Reload
	testl	%ebx, %ebx
	js	LBB0_5
## %bb.12:
	testq	%rax, %rax
	jne	LBB0_8
	jmp	LBB0_13
LBB0_5:
	testq	%rax, %rax
	je	LBB0_13
## %bb.6:
	cmpq	$0, 16(%rax)
	je	LBB0_8
## %bb.7:
	addl	%r14d, %r12d
	movl	(%rax), %edi
	callq	_assert
	movq	_Header@GOTPCREL(%rip), %r14
	movl	(%r14), %eax
	movl	%r13d, %edi
	subl	%eax, %edi
	callq	_get_revlist_metafile_offset
	movq	%rax, %rbx
	subl	(%r14), %r12d
	movl	%r12d, %edi
	callq	_get_revlist_metafile_offset
	subl	%eax, %ebx
	movq	_tot_lost_aio_bytes@GOTPCREL(%rip), %rax
	addl	(%rax), %ebx
	movl	%ebx, (%rax)
	leaq	L_.str.1(%rip), %rsi
	xorl	%edi, %edi
	movl	%ebx, %edx
	movl	-44(%rbp), %ebx                 ## 4-byte Reload
	xorl	%eax, %eax
	callq	_vkprintf
	movq	_metafiles@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	(%rax,%r13,8), %rax
	movl	$0, (%rax)
	movq	$0, 16(%rax)
LBB0_8:
	cmpq	$0, 16(%rax)
	jne	LBB0_14
## %bb.9:
	cmpl	$0, (%rax)
	je	LBB0_14
## %bb.10:
	movl	%r15d, %edi
	callq	_update_use
	movl	$1, %eax
LBB0_11:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_13:
	movl	$4, %edi
	movq	%rcx, %r14
	callq	_zmalloc0
	movq	(%r14), %rcx
	movq	%rax, (%rcx,%r13,8)
	movq	(%r14), %rax
	movq	(%rax,%r13,8), %rax
	movq	$-1, 4(%rax)
LBB0_14:
	movl	$1, %esi
	testl	%ebx, %ebx
	jg	LBB0_16
## %bb.15:
	xorl	%esi, %esi
	cmpq	$0, 16(%rax)
	setne	%sil
LBB0_16:
	movl	%r15d, %edi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_load_metafile_aio              ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_tot_revlist_metafiles,8,3      ## @tot_revlist_metafiles
	.comm	_tot_metafiles_memory,8,3       ## @tot_metafiles_memory
	.comm	_memory_for_metafiles,8,3       ## @memory_for_metafiles
	.comm	_Header,8,3                     ## @Header
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"prepare_object_metafile: x = %d, head_metafile = %d\n"

	.comm	_head_metafile,4,2              ## @head_metafile
	.comm	_metafiles,8,3                  ## @metafiles
	.comm	_tot_lost_aio_bytes,4,2         ## @tot_lost_aio_bytes
L_.str.1:                               ## @.str.1
	.asciz	"skipping pending aio query. Total lost memory %lld\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_prepare_object_metafile        ; -- Begin function prepare_object_metafile
	.p2align	2
_prepare_object_metafile:               ; @prepare_object_metafile
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x19, x1
	bl	_choose_revlist_metafile
Lloh0:
	adrp	x8, _tot_revlist_metafiles@GOTPAGE
Lloh1:
	ldr	x8, [x8, _tot_revlist_metafiles@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cmp	x0, x8
	b.ge	LBB0_6
; %bb.1:
	mov	x20, x0
	lsr	x8, x0, #63
	eor	w0, w8, #0x1
	bl	_assert
Lloh3:
	adrp	x21, _tot_metafiles_memory@GOTPAGE
Lloh4:
	ldr	x21, [x21, _tot_metafiles_memory@GOTPAGEOFF]
Lloh5:
	adrp	x22, _memory_for_metafiles@GOTPAGE
Lloh6:
	ldr	x22, [x22, _memory_for_metafiles@GOTPAGEOFF]
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x21]
	ldr	x9, [x22]
	cmp	x8, x9
	b.le	LBB0_4
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	bl	_unload_LRU
	cbnz	x0, LBB0_2
LBB0_4:
Lloh7:
	adrp	x23, _Header@GOTPAGE
Lloh8:
	ldr	x23, [x23, _Header@GOTPAGEOFF]
	ldr	w8, [x23]
	add	w24, w8, w20
	add	w21, w24, #1
Lloh9:
	adrp	x8, _head_metafile@GOTPAGE
Lloh10:
	ldr	x8, [x8, _head_metafile@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	str	x8, [sp]
Lloh12:
	adrp	x1, l_.str@PAGE
Lloh13:
	add	x1, x1, l_.str@PAGEOFF
	mov	w0, #3
	mov	x2, x21
	bl	_vkprintf
Lloh14:
	adrp	x22, _metafiles@GOTPAGE
Lloh15:
	ldr	x22, [x22, _metafiles@GOTPAGEOFF]
	ldr	x8, [x22]
	sxtw	x20, w21
	ldr	x8, [x8, w21, sxtw #3]
	tbnz	w19, #31, LBB0_8
; %bb.5:
	cbnz	x8, LBB0_11
	b	LBB0_14
LBB0_6:
	mov	w0, #0
LBB0_7:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
LBB0_8:
	cbz	x8, LBB0_14
; %bb.9:
	ldr	x9, [x8, #16]
	cbz	x9, LBB0_11
; %bb.10:
	ldr	w0, [x8]
	bl	_assert
	ldr	w8, [x23]
	sub	w0, w20, w8
	bl	_get_revlist_metafile_offset
	mov	x21, x0
	ldr	w8, [x23]
	sub	w0, w24, w8
	bl	_get_revlist_metafile_offset
Lloh16:
	adrp	x8, _tot_lost_aio_bytes@GOTPAGE
Lloh17:
	ldr	x8, [x8, _tot_lost_aio_bytes@GOTPAGEOFF]
	ldr	w9, [x8]
	sub	w10, w21, w0
	add	w2, w9, w10
	str	w2, [x8]
Lloh18:
	adrp	x1, l_.str.1@PAGE
Lloh19:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	w0, #0
	bl	_vkprintf
	ldr	x8, [x22]
	ldr	x8, [x8, x20, lsl #3]
	str	wzr, [x8]
	str	xzr, [x8, #16]
LBB0_11:
	ldr	x9, [x8, #16]
	cbnz	x9, LBB0_15
; %bb.12:
	ldr	w9, [x8]
	cbz	w9, LBB0_15
; %bb.13:
	mov	x0, x20
	bl	_update_use
	mov	w0, #1
	b	LBB0_7
LBB0_14:
	mov	w0, #4
	bl	_zmalloc0
	ldr	x8, [x22]
	lsl	x9, x20, #3
	str	x0, [x8, x9]
	ldr	x8, [x22]
	ldr	x8, [x8, x9]
	movi.2d	v0, #0xffffffffffffffff
	stur	d0, [x8, #4]
LBB0_15:
	cmp	w19, #0
	b.le	LBB0_17
; %bb.16:
	mov	w1, #1
	b	LBB0_18
LBB0_17:
	ldr	x8, [x8, #16]
	cmp	x8, #0
	cset	w1, ne
LBB0_18:
	mov	x0, x20
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	b	_load_metafile_aio
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_tot_revlist_metafiles,8,3      ; @tot_revlist_metafiles
	.comm	_tot_metafiles_memory,8,3       ; @tot_metafiles_memory
	.comm	_memory_for_metafiles,8,3       ; @memory_for_metafiles
	.comm	_Header,8,3                     ; @Header
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"prepare_object_metafile: x = %d, head_metafile = %d\n"

	.comm	_head_metafile,4,2              ; @head_metafile
	.comm	_metafiles,8,3                  ; @metafiles
	.comm	_tot_lost_aio_bytes,4,2         ; @tot_lost_aio_bytes
l_.str.1:                               ; @.str.1
	.asciz	"skipping pending aio query. Total lost memory %lld\n"

.subsections_via_symbols
