	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_load_metafile                  ## -- Begin function load_metafile
	.p2align	4, 0x90
_load_metafile:                         ## @load_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
	movq	%rdx, %r13
	movq	%rsi, %r15
	movq	%rdi, %rbx
	xorl	%r12d, %r12d
	movl	$0, %edi
	testq	%rdx, %rdx
	js	LBB0_2
## %bb.1:
	movq	_dyn_top@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	_dyn_cur@GOTPCREL(%rip), %rcx
	subq	(%rcx), %rax
	xorl	%edi, %edi
	cmpq	%r13, %rax
	setge	%dil
LBB0_2:
	callq	_assert
	testq	%r15, %r15
	js	LBB0_5
## %bb.3:
	movq	_idx_fsize@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	%r15, %rax
	jl	LBB0_5
## %bb.4:
	leaq	(%r15,%r13), %rcx
	xorl	%r12d, %r12d
	cmpq	%rax, %rcx
	setle	%r12b
LBB0_5:
	movl	%r12d, %edi
	callq	_assert
	cmpq	$-1, %rbx
	je	LBB0_6
## %bb.7:
	testq	%rbx, %rbx
	je	LBB0_8
LBB0_9:
	movq	_Snapshot@GOTPCREL(%rip), %r12
	movq	(%r12), %rax
	movl	(%rax), %edi
	movq	_idx_kfs_headers_size@GOTPCREL(%rip), %r14
	movq	(%r14), %rsi
	addq	%r15, %rsi
	movq	_SEEK_SET@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_lseek
	movq	(%r14), %rcx
	addq	%r15, %rcx
	xorl	%edi, %edi
	cmpq	%rcx, %rax
	sete	%dil
	callq	_assert
	testq	%r13, %r13
	jle	LBB0_15
## %bb.10:
	movq	_idx_loaded_bytes@GOTPCREL(%rip), %r14
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	.p2align	4, 0x90
LBB0_11:                                ## =>This Inner Loop Header: Depth=1
	movq	(%r12), %rdi
	movq	%rbx, %rsi
	movq	%r13, %rdx
	callq	_kfs_read_file
	testq	%rax, %rax
	jle	LBB0_12
## %bb.13:                              ##   in Loop: Header=BB0_11 Depth=1
	addq	%rax, %rbx
	addq	%rax, (%r14)
	subq	%rax, %r13
	jg	LBB0_11
## %bb.14:
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	jmp	LBB0_15
LBB0_6:
	movq	%r13, %rdi
	callq	_zzmalloc
	movq	%rax, %rbx
	testq	%rbx, %rbx
	jne	LBB0_9
LBB0_8:
	movq	%r13, %rdi
	callq	_zmalloc
	movq	%rax, %rbx
	movq	_idx_bytes@GOTPCREL(%rip), %rax
	addq	%r13, (%rax)
	jmp	LBB0_9
LBB0_12:
	subq	-48(%rbp), %r15                 ## 8-byte Folded Reload
	addq	%rbx, %r15
	leaq	L_.str(%rip), %rsi
	xorl	%ebx, %ebx
	xorl	%edi, %edi
	movq	%rax, %rdx
	movq	%r13, %rcx
	movq	%r15, %r8
	callq	_vkprintf
	xorl	%edi, %edi
	callq	_assert
LBB0_15:
	movq	%rbx, %rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_dyn_top,8,3                    ## @dyn_top
	.comm	_dyn_cur,8,3                    ## @dyn_cur
	.comm	_idx_fsize,8,3                  ## @idx_fsize
	.comm	_idx_bytes,8,3                  ## @idx_bytes
	.comm	_Snapshot,8,3                   ## @Snapshot
	.comm	_idx_kfs_headers_size,8,3       ## @idx_kfs_headers_size
	.comm	_SEEK_SET,4,2                   ## @SEEK_SET
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"error reading data from index file: read %lld bytes instead of %lld at position %lld: %m\n"

	.comm	_idx_loaded_bytes,8,3           ## @idx_loaded_bytes
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_load_metafile                  ; -- Begin function load_metafile
	.p2align	2
_load_metafile:                         ; @load_metafile
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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, x2
	mov	x20, x1
	mov	x21, x0
	tbnz	x2, #63, LBB0_2
; %bb.1:
Lloh0:
	adrp	x8, _dyn_top@GOTPAGE
Lloh1:
	ldr	x8, [x8, _dyn_top@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
Lloh3:
	adrp	x9, _dyn_cur@GOTPAGE
Lloh4:
	ldr	x9, [x9, _dyn_cur@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	sub	x8, x8, x9
	cmp	x8, x19
	cset	w0, ge
	bl	_assert
	tbz	x20, #63, LBB0_3
	b	LBB0_4
LBB0_2:
	mov	w0, #0
	bl	_assert
	tbnz	x20, #63, LBB0_4
LBB0_3:
Lloh6:
	adrp	x8, _idx_fsize@GOTPAGE
Lloh7:
	ldr	x8, [x8, _idx_fsize@GOTPAGEOFF]
Lloh8:
	ldr	x8, [x8]
	cmp	x8, x20
	b.ge	LBB0_5
LBB0_4:
	mov	w0, #0
	b	LBB0_6
LBB0_5:
	add	x9, x19, x20
	cmp	x9, x8
	cset	w0, le
LBB0_6:
	bl	_assert
	cmn	x21, #1
	b.eq	LBB0_13
; %bb.7:
	cbnz	x21, LBB0_9
LBB0_8:
	mov	x0, x19
	bl	_zmalloc
	mov	x21, x0
Lloh9:
	adrp	x8, _idx_bytes@GOTPAGE
Lloh10:
	ldr	x8, [x8, _idx_bytes@GOTPAGEOFF]
	ldr	x9, [x8]
	add	x9, x9, x19
	str	x9, [x8]
LBB0_9:
Lloh11:
	adrp	x23, _Snapshot@GOTPAGE
Lloh12:
	ldr	x23, [x23, _Snapshot@GOTPAGEOFF]
	ldr	x8, [x23]
Lloh13:
	adrp	x22, _idx_kfs_headers_size@GOTPAGE
Lloh14:
	ldr	x22, [x22, _idx_kfs_headers_size@GOTPAGEOFF]
	ldr	w0, [x8]
	ldr	x8, [x22]
	add	x1, x8, x20
Lloh15:
	adrp	x8, _SEEK_SET@GOTPAGE
Lloh16:
	ldr	x8, [x8, _SEEK_SET@GOTPAGEOFF]
Lloh17:
	ldr	w2, [x8]
	bl	_lseek
	ldr	x8, [x22]
	add	x8, x8, x20
	cmp	x0, x8
	cset	w0, eq
	bl	_assert
	cmp	x19, #1
	b.lt	LBB0_15
; %bb.10:
Lloh18:
	adrp	x24, _idx_loaded_bytes@GOTPAGE
Lloh19:
	ldr	x24, [x24, _idx_loaded_bytes@GOTPAGEOFF]
	mov	x22, x21
LBB0_11:                                ; =>This Inner Loop Header: Depth=1
	ldr	x0, [x23]
	mov	x1, x22
	mov	x2, x19
	bl	_kfs_read_file
	mov	x2, x0
	cmp	x0, #0
	b.le	LBB0_14
; %bb.12:                               ;   in Loop: Header=BB0_11 Depth=1
	add	x22, x22, x2
	sub	x19, x19, x2
	ldr	x8, [x24]
	add	x8, x8, x2
	str	x8, [x24]
	cmp	x19, #0
	b.gt	LBB0_11
	b	LBB0_15
LBB0_13:
	mov	x0, x19
	bl	_zzmalloc
	mov	x21, x0
	cbnz	x21, LBB0_9
	b	LBB0_8
LBB0_14:
	sub	x8, x20, x21
	add	x4, x8, x22
Lloh20:
	adrp	x1, l_.str@PAGE
Lloh21:
	add	x1, x1, l_.str@PAGEOFF
	mov	w0, #0
	mov	x3, x19
	bl	_vkprintf
	mov	w0, #0
	bl	_assert
	mov	x21, #0
LBB0_15:
	mov	x0, x21
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpAdd	Lloh20, Lloh21
	.cfi_endproc
                                        ; -- End function
	.comm	_dyn_top,8,3                    ; @dyn_top
	.comm	_dyn_cur,8,3                    ; @dyn_cur
	.comm	_idx_fsize,8,3                  ; @idx_fsize
	.comm	_idx_bytes,8,3                  ; @idx_bytes
	.comm	_Snapshot,8,3                   ; @Snapshot
	.comm	_idx_kfs_headers_size,8,3       ; @idx_kfs_headers_size
	.comm	_SEEK_SET,4,2                   ; @SEEK_SET
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"error reading data from index file: read %lld bytes instead of %lld at position %lld: %m\n"

	.comm	_idx_loaded_bytes,8,3           ; @idx_loaded_bytes
.subsections_via_symbols
