	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_metafile_load                  ## -- Begin function metafile_load
	.p2align	4, 0x90
_metafile_load:                         ## @metafile_load
	.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	%edi, %ebx
	movq	_verbosity@GOTPCREL(%rip), %rax
	cmpl	$3, (%rax)
	jl	LBB0_2
## %bb.1:
	movq	_stderr@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	movl	%ebx, %edx
	xorl	%eax, %eax
	callq	_fprintf
LBB0_2:
	testl	%ebx, %ebx
	setns	%al
	movq	_MAX_METAFILES@GOTPCREL(%rip), %rcx
	cmpl	%ebx, (%rcx)
	setg	%cl
	andb	%al, %cl
	movzbl	%cl, %edi
	callq	_assert
	movq	_metafiles@GOTPCREL(%rip), %rax
	movq	(%rax), %r13
	movslq	%ebx, %r14
	shlq	$5, %r14
	leaq	(%r14,%r13), %r12
	cmpq	$0, 24(%r13,%r14)
	movl	%ebx, -44(%rbp)                 ## 4-byte Spill
	je	LBB0_4
## %bb.3:
	leaq	(%r14,%r13), %r15
	addq	$24, %r15
	movq	_stderr@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.1(%rip), %rsi
	xorl	%eax, %eax
	callq	_fprintf
	movq	$0, (%r15)
	xorps	%xmm0, %xmm0
	movups	%xmm0, (%r12)
LBB0_5:
	xorl	%eax, %eax
	callq	_free_metafiles
	movq	_idx_fd@GOTPCREL(%rip), %rbx
	movl	(%rbx), %edi
	leaq	(%r14,%r13), %r15
	addq	$16, %r15
	movq	16(%r13,%r14), %rax
	movq	8(%rax), %rsi
	addq	(%rax), %rsi
	movq	_SEEK_SET@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_lseek
	movq	16(%r13,%r14), %rcx
	movq	8(%rcx), %rdx
	addq	(%rcx), %rdx
	xorl	%edi, %edi
	cmpq	%rdx, %rax
	sete	%dil
	callq	_assert
	xorl	%edi, %edi
	cmpq	$0, 8(%r13,%r14)
	sete	%dil
	callq	_assert
	movq	16(%r13,%r14), %rax
	movq	16(%rax), %rdi
	callq	_zzmalloc
	movq	%rax, 8(%r13,%r14)
	testq	%rax, %rax
	jne	LBB0_10
	.p2align	4, 0x90
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	xorl	%eax, %eax
	callq	_metafile_unload_LRU
	testl	%eax, %eax
	je	LBB0_8
## %bb.9:                               ##   in Loop: Header=BB0_7 Depth=1
	movq	(%r15), %rax
	movq	16(%rax), %rdi
	callq	_zzmalloc
	movq	%rax, -8(%r15)
	testq	%rax, %rax
	je	LBB0_7
LBB0_10:
	movq	(%r15), %rcx
	movq	24(%rcx), %rdx
	addq	%rax, %rdx
	movq	%rdx, (%r12)
	movl	(%rbx), %edi
	movq	16(%rcx), %rdx
	movq	%rax, %rsi
	callq	_read
	movq	(%r15), %rcx
	xorl	%edi, %edi
	cmpq	16(%rcx), %rax
	sete	%dil
	callq	_assert
	movq	_use_metafile_crc32@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_12
## %bb.11:
	movq	-8(%r15), %rdi
	movq	(%r15), %rdx
	movq	16(%rdx), %rsi
	addq	$32, %rdx
	movl	$1, %ecx
	callq	_crc32_check_and_repair
LBB0_12:
	movq	_verbosity@GOTPCREL(%rip), %rax
	cmpl	$4, (%rax)
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	jl	LBB0_17
## %bb.13:
	cmpq	$0, (%r12)
	je	LBB0_17
## %bb.14:
	movq	(%r15), %rax
	cmpq	$0, 24(%rax)
	jle	LBB0_17
## %bb.15:
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_16:                                ## =>This Inner Loop Header: Depth=1
	movq	_stderr@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	movl	%edi, %r12d
	movl	%ebx, %esi
	callq	_metafile_get_entry
	movl	(%rax), %r13d
	movl	%r12d, %edi
	movl	%ebx, %esi
	callq	_metafile_get_entry
	movl	4(%rax), %r14d
	movl	%r12d, %edi
	movl	%ebx, %esi
	callq	_metafile_get_entry
	movq	8(%rax), %r8
	movl	-48(%rbp), %edi                 ## 4-byte Reload
	leaq	L_.str.3(%rip), %rsi
	movl	%r13d, %edx
	movl	%r14d, %ecx
	xorl	%eax, %eax
	callq	_fprintf
	movl	%r12d, %edi
	incq	%rbx
	movq	(%r15), %rax
	cmpq	%rbx, 24(%rax)
	jg	LBB0_16
LBB0_17:
	movq	_metafiles_loaded@GOTPCREL(%rip), %rax
	incl	(%rax)
	movq	(%r15), %rax
	movl	16(%rax), %eax
	movq	_allocated_metafile_bytes@GOTPCREL(%rip), %rcx
	addl	%eax, (%rcx)
	callq	_add_use
	xorl	%r15d, %r15d
	jmp	LBB0_18
LBB0_4:
	movl	$1, %r15d
	cmpq	$0, (%r12)
	jne	LBB0_18
	jmp	LBB0_5
LBB0_8:
	movq	_stderr@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.2(%rip), %rsi
	xorl	%r15d, %r15d
	xorl	%eax, %eax
	callq	_fprintf
LBB0_18:
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_verbosity,4,2                  ## @verbosity
	.comm	_stderr,4,2                     ## @stderr
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"loading metafile %d\n"

	.comm	_MAX_METAFILES,4,2              ## @MAX_METAFILES
	.comm	_metafiles,8,3                  ## @metafiles
L_.str.1:                               ## @.str.1
	.asciz	"meta->aio != 0. Dropping data\n"

	.comm	_idx_fd,4,2                     ## @idx_fd
	.comm	_SEEK_SET,4,2                   ## @SEEK_SET
L_.str.2:                               ## @.str.2
	.asciz	"No memory\n"

	.comm	_use_metafile_crc32,8,3         ## @use_metafile_crc32
L_.str.3:                               ## @.str.3
	.asciz	"key/data - %d/%d - %s\n"

	.comm	_metafiles_loaded,4,2           ## @metafiles_loaded
	.comm	_allocated_metafile_bytes,4,2   ## @allocated_metafile_bytes
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_metafile_load                  ; -- Begin function metafile_load
	.p2align	2
_metafile_load:                         ; @metafile_load
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x19, x0
Lloh0:
	adrp	x20, _verbosity@GOTPAGE
Lloh1:
	ldr	x20, [x20, _verbosity@GOTPAGEOFF]
	ldr	w8, [x20]
Lloh2:
	adrp	x23, _stderr@GOTPAGE
Lloh3:
	ldr	x23, [x23, _stderr@GOTPAGEOFF]
	cmp	w8, #3
	b.lt	LBB0_2
; %bb.1:
	ldr	w0, [x23]
	mov	x8, x19
	str	x8, [sp]
Lloh4:
	adrp	x1, l_.str@PAGE
Lloh5:
	add	x1, x1, l_.str@PAGEOFF
	bl	_fprintf
LBB0_2:
	cmp	w19, #0
Lloh6:
	adrp	x8, _MAX_METAFILES@GOTPAGE
Lloh7:
	ldr	x8, [x8, _MAX_METAFILES@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	ccmp	w8, w19, #4, ge
	cset	w0, gt
	bl	_assert
Lloh9:
	adrp	x8, _metafiles@GOTPAGE
Lloh10:
	ldr	x8, [x8, _metafiles@GOTPAGEOFF]
Lloh11:
	ldr	x22, [x8]
	sxtw	x24, w19
	add	x21, x22, x24, lsl #5
	mov	x25, x21
	ldr	x8, [x25, #24]!
	cbz	x8, LBB0_17
; %bb.3:
	ldr	w0, [x23]
Lloh12:
	adrp	x1, l_.str.1@PAGE
Lloh13:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_fprintf
	str	xzr, [x25]
	stp	xzr, xzr, [x21]
LBB0_4:
	bl	_free_metafiles
Lloh14:
	adrp	x25, _idx_fd@GOTPAGE
Lloh15:
	ldr	x25, [x25, _idx_fd@GOTPAGEOFF]
	ldr	w0, [x25]
	add	x22, x22, x24, lsl #5
	mov	x24, x22
	ldr	x8, [x24, #16]!
	ldp	x9, x8, [x8]
	add	x1, x8, x9
Lloh16:
	adrp	x8, _SEEK_SET@GOTPAGE
Lloh17:
	ldr	x8, [x8, _SEEK_SET@GOTPAGEOFF]
Lloh18:
	ldr	w2, [x8]
	bl	_lseek
	ldr	x8, [x24]
	ldp	x9, x8, [x8]
	add	x8, x8, x9
	cmp	x0, x8
	cset	w0, eq
	bl	_assert
	ldr	x8, [x22, #8]!
	cmp	x8, #0
	cset	w0, eq
	bl	_assert
	ldr	x8, [x24]
	ldr	x0, [x8, #16]
	bl	_zzmalloc
	mov	x1, x0
	str	x0, [x22]
	cbnz	x0, LBB0_8
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	bl	_metafile_unload_LRU
	cbz	w0, LBB0_20
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	x8, [x24]
	ldr	x0, [x8, #16]
	bl	_zzmalloc
	str	x0, [x22]
	cbz	x0, LBB0_5
; %bb.7:
	mov	x1, x0
LBB0_8:
	ldr	x8, [x24]
	ldp	x2, x9, [x8, #16]
	add	x8, x9, x1
	str	x8, [x21]
	ldr	w0, [x25]
	bl	_read
	ldr	x8, [x24]
	ldr	x8, [x8, #16]
	cmp	x0, x8
	cset	w0, eq
	bl	_assert
Lloh19:
	adrp	x8, _use_metafile_crc32@GOTPAGE
Lloh20:
	ldr	x8, [x8, _use_metafile_crc32@GOTPAGEOFF]
Lloh21:
	ldr	x8, [x8]
	cbz	x8, LBB0_10
; %bb.9:
	ldr	x0, [x22]
	ldr	x8, [x24]
	ldr	x1, [x8, #16]
	add	x2, x8, #32
	mov	w3, #1
	bl	_crc32_check_and_repair
LBB0_10:
	ldr	w8, [x20]
	cmp	w8, #4
	b.lt	LBB0_15
; %bb.11:
	ldr	x8, [x21]
	cbz	x8, LBB0_15
; %bb.12:
	ldr	x8, [x24]
	ldr	x8, [x8, #24]
	cmp	x8, #1
	b.lt	LBB0_15
; %bb.13:
	mov	x20, #0
Lloh22:
	adrp	x21, l_.str.3@PAGE
Lloh23:
	add	x21, x21, l_.str.3@PAGEOFF
LBB0_14:                                ; =>This Inner Loop Header: Depth=1
	ldr	w22, [x23]
	mov	x0, x19
	mov	x1, x20
	bl	_metafile_get_entry
	ldr	w25, [x0]
	mov	x0, x19
	mov	x1, x20
	bl	_metafile_get_entry
	ldr	w26, [x0, #4]
	mov	x0, x19
	mov	x1, x20
	bl	_metafile_get_entry
	ldr	x8, [x0, #8]
	stp	x26, x8, [sp, #8]
	str	x25, [sp]
	mov	x0, x22
	mov	x1, x21
	bl	_fprintf
	add	x20, x20, #1
	ldr	x8, [x24]
	ldr	x8, [x8, #24]
	cmp	x8, x20
	b.gt	LBB0_14
LBB0_15:
Lloh24:
	adrp	x8, _metafiles_loaded@GOTPAGE
Lloh25:
	ldr	x8, [x8, _metafiles_loaded@GOTPAGEOFF]
	ldr	w9, [x8]
	add	w9, w9, #1
	str	w9, [x8]
	ldr	x8, [x24]
	ldr	w8, [x8, #16]
Lloh26:
	adrp	x9, _allocated_metafile_bytes@GOTPAGE
Lloh27:
	ldr	x9, [x9, _allocated_metafile_bytes@GOTPAGEOFF]
	ldr	w10, [x9]
	add	w8, w10, w8
	str	w8, [x9]
	mov	x0, x19
	bl	_add_use
LBB0_16:
	mov	w0, #0
	b	LBB0_19
LBB0_17:
	ldr	x8, [x21]
	cbz	x8, LBB0_4
; %bb.18:
	mov	w0, #1
LBB0_19:
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_20:
	ldr	w0, [x23]
Lloh28:
	adrp	x1, l_.str.2@PAGE
Lloh29:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_fprintf
	b	LBB0_16
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh26, Lloh27
	.loh AdrpLdrGot	Lloh24, Lloh25
	.loh AdrpAdd	Lloh28, Lloh29
	.cfi_endproc
                                        ; -- End function
	.comm	_verbosity,4,2                  ; @verbosity
	.comm	_stderr,4,2                     ; @stderr
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"loading metafile %d\n"

	.comm	_MAX_METAFILES,4,2              ; @MAX_METAFILES
	.comm	_metafiles,8,3                  ; @metafiles
l_.str.1:                               ; @.str.1
	.asciz	"meta->aio != 0. Dropping data\n"

	.comm	_idx_fd,4,2                     ; @idx_fd
	.comm	_SEEK_SET,4,2                   ; @SEEK_SET
l_.str.2:                               ; @.str.2
	.asciz	"No memory\n"

	.comm	_use_metafile_crc32,8,3         ; @use_metafile_crc32
l_.str.3:                               ; @.str.3
	.asciz	"key/data - %d/%d - %s\n"

	.comm	_metafiles_loaded,4,2           ; @metafiles_loaded
	.comm	_allocated_metafile_bytes,4,2   ; @allocated_metafile_bytes
.subsections_via_symbols
