	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_idx_load_next                  ## -- Begin function idx_load_next
	.p2align	4, 0x90
_idx_load_next:                         ## @idx_load_next
	.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, %r12d
	testl	%edi, %edi
	jle	LBB0_1
## %bb.2:
	movq	_RBuffEnd@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_RBuff@GOTPCREL(%rip), %rcx
	subl	(%rcx), %eax
	xorl	%edi, %edi
	cmpl	%r12d, %eax
	setge	%dil
	jmp	LBB0_3
LBB0_1:
	xorl	%edi, %edi
LBB0_3:
	callq	_assert
	xorl	%r15d, %r15d
	xorl	%eax, %eax
	callq	_idx_cur_read_pos
	movq	%rax, %r14
	movslq	%r12d, %rax
	addq	%r14, %rax
	movq	_idx_bytes@GOTPCREL(%rip), %r13
	movslq	(%r13), %rbx
	cmpq	%rbx, %rax
	jle	LBB0_6
## %bb.4:
	subl	%r14d, %ebx
	movl	%ebx, %edi
	notl	%edi
	shrl	$31, %edi
	callq	_assert
	movl	%ebx, %r12d
	testl	%ebx, %ebx
	je	LBB0_5
LBB0_6:
	movq	_idx_rptr@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	_RBuff@GOTPCREL(%rip), %rax
	cmpl	(%rax), %ecx
	jl	LBB0_9
## %bb.7:
	movq	_idx_wptr@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	cmpl	%eax, %ecx
	jg	LBB0_9
## %bb.8:
	movq	_RBuffEnd@GOTPCREL(%rip), %rcx
	xorl	%r15d, %r15d
	cmpl	(%rcx), %eax
	setle	%r15b
LBB0_9:
	movl	%r15d, %edi
	callq	_assert
	movq	_idx_wptr@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movq	_idx_rptr@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	leal	(%rax,%r12), %edx
	cmpl	%edx, %ebx
	jge	LBB0_10
## %bb.11:
	movq	_RBuffEnd@GOTPCREL(%rip), %r15
	movl	(%r15), %ecx
	cmpl	%ecx, %edx
	jle	LBB0_13
## %bb.12:
	xorl	%eax, %eax
	callq	_idx_slide_read_buffer
	movq	_idx_rptr@GOTPCREL(%rip), %rax
	addl	(%rax), %r12d
	xorl	%edi, %edi
	cmpl	(%r15), %r12d
	setle	%dil
	callq	_assert
	movl	(%r15), %ecx
	movq	_idx_wptr@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movq	_idx_rptr@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
LBB0_13:
	subl	%ebx, %ecx
	subl	%eax, %ebx
	movslq	%ebx, %rax
	addq	%rax, %r14
	movslq	%ecx, %rbx
	leaq	(%r14,%rbx), %rax
	movslq	(%r13), %rcx
	movl	%ecx, %edx
	subl	%r14d, %edx
	cmpq	%rcx, %rax
	cmovgl	%edx, %ebx
	xorl	%edi, %edi
	testl	%ebx, %ebx
	setg	%dil
	callq	_assert
	movq	_idx_fd@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_idx_wptr@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	movl	%ebx, %edx
	callq	_read
	movl	%eax, %r14d
	cmpl	%ebx, %eax
	jne	LBB0_14
## %bb.15:
	movq	_verbosity@GOTPCREL(%rip), %rax
	cmpl	$4, (%rax)
	jl	LBB0_17
## %bb.16:
	movq	_stderr@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_idx_read_pos@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	leaq	L_.str.2(%rip), %rsi
	movl	%ebx, %edx
	xorl	%eax, %eax
	callq	_fprintf
	jmp	LBB0_17
LBB0_10:
	subl	%eax, %ebx
	jmp	LBB0_18
LBB0_14:
	movq	_stderr@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_idx_filename@GOTPCREL(%rip), %rax
	movq	(%rax), %rcx
	movq	_idx_read_pos@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	leaq	L_.str.1(%rip), %rsi
	movl	%ebx, %edx
	movl	%r14d, %r9d
	xorl	%eax, %eax
	callq	_fprintf
	xorl	%edi, %edi
	callq	_assert
LBB0_17:
	movq	_idx_read_pos@GOTPCREL(%rip), %rax
	addl	%r14d, (%rax)
	movq	_idx_metafile_pos@GOTPCREL(%rip), %rax
	addl	%r14d, (%rax)
	movl	(%r15), %ebx
	addl	%r14d, %ebx
	movl	%ebx, (%r15)
	movq	_idx_rptr@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
	jmp	LBB0_18
LBB0_5:
	movl	(%r13), %ecx
	leaq	L_.str(%rip), %rsi
	xorl	%ebx, %ebx
	movl	$4, %edi
	movq	%r14, %rdx
	xorl	%r8d, %r8d
	callq	_vkprintf
LBB0_18:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_RBuffEnd,4,2                   ## @RBuffEnd
	.comm	_RBuff,4,2                      ## @RBuff
	.comm	_idx_bytes,4,2                  ## @idx_bytes
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"failed at pos %lld, ends at %lld bytes, need %d\n"

	.comm	_idx_rptr,4,2                   ## @idx_rptr
	.comm	_idx_wptr,4,2                   ## @idx_wptr
	.comm	_idx_fd,4,2                     ## @idx_fd
	.comm	_stderr,4,2                     ## @stderr
L_.str.1:                               ## @.str.1
	.asciz	"error reading %d bytes from snapshot %s at position %lld: only %d bytes read: %m\n"

	.comm	_idx_filename,8,3               ## @idx_filename
	.comm	_idx_read_pos,4,2               ## @idx_read_pos
	.comm	_verbosity,4,2                  ## @verbosity
L_.str.2:                               ## @.str.2
	.asciz	"preloaded %d bytes from snapshot at position %lld\n"

	.comm	_idx_metafile_pos,4,2           ## @idx_metafile_pos
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_idx_load_next                  ; -- Begin function idx_load_next
	.p2align	2
_idx_load_next:                         ; @idx_load_next
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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	x20, x0
Lloh0:
	adrp	x22, _RBuff@GOTPAGE
Lloh1:
	ldr	x22, [x22, _RBuff@GOTPAGEOFF]
	cmp	w0, #1
	b.lt	LBB0_2
; %bb.1:
Lloh2:
	adrp	x8, _RBuffEnd@GOTPAGE
Lloh3:
	ldr	x8, [x8, _RBuffEnd@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	ldr	w9, [x22]
	sub	w8, w8, w9
	cmp	w8, w20
	cset	w0, ge
	b	LBB0_3
LBB0_2:
	mov	w0, #0
LBB0_3:
	bl	_assert
	bl	_idx_cur_read_pos
	mov	x19, x0
	add	x9, x0, w20, sxtw
Lloh5:
	adrp	x23, _idx_bytes@GOTPAGE
Lloh6:
	ldr	x23, [x23, _idx_bytes@GOTPAGEOFF]
	ldrsw	x8, [x23]
	cmp	x9, x8
	b.le	LBB0_5
; %bb.4:
	sub	w20, w8, w19
	mvn	w8, w20
	lsr	w0, w8, #31
	bl	_assert
	cbz	w20, LBB0_18
LBB0_5:
Lloh7:
	adrp	x21, _idx_rptr@GOTPAGE
Lloh8:
	ldr	x21, [x21, _idx_rptr@GOTPAGEOFF]
	ldr	w8, [x21]
	ldr	w9, [x22]
Lloh9:
	adrp	x22, _idx_wptr@GOTPAGE
Lloh10:
	ldr	x22, [x22, _idx_wptr@GOTPAGEOFF]
	cmp	w8, w9
	b.lt	LBB0_7
; %bb.6:
	ldr	w9, [x22]
	cmp	w8, w9
	b.le	LBB0_8
LBB0_7:
	mov	w0, #0
	b	LBB0_9
LBB0_8:
Lloh11:
	adrp	x8, _RBuffEnd@GOTPAGE
Lloh12:
	ldr	x8, [x8, _RBuffEnd@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	cmp	w9, w8
	cset	w0, le
LBB0_9:
	bl	_assert
	ldr	w8, [x22]
	ldr	w9, [x21]
	add	w11, w9, w20
	cmp	w8, w11
	b.ge	LBB0_15
; %bb.10:
Lloh14:
	adrp	x24, _RBuffEnd@GOTPAGE
Lloh15:
	ldr	x24, [x24, _RBuffEnd@GOTPAGEOFF]
	ldr	w10, [x24]
	cmp	w11, w10
	b.le	LBB0_12
; %bb.11:
	bl	_idx_slide_read_buffer
	ldr	w8, [x21]
	ldr	w9, [x24]
	add	w8, w8, w20
	cmp	w8, w9
	cset	w0, le
	bl	_assert
	ldr	w10, [x24]
	ldr	w8, [x22]
	ldr	w9, [x21]
LBB0_12:
	sub	w10, w10, w8
	sub	w8, w8, w9
	add	x8, x19, w8, sxtw
	add	x9, x8, w10, sxtw
	ldrsw	x11, [x23]
	sub	w8, w11, w8
	cmp	x9, x11
	csel	w20, w8, w10, gt
	cmp	w20, #0
	cset	w0, gt
	bl	_assert
Lloh16:
	adrp	x8, _idx_fd@GOTPAGE
Lloh17:
	ldr	x8, [x8, _idx_fd@GOTPAGEOFF]
Lloh18:
	ldr	w0, [x8]
	ldr	w1, [x22]
	mov	x2, x20
	bl	_read
	mov	x19, x0
Lloh19:
	adrp	x23, _idx_read_pos@GOTPAGE
Lloh20:
	ldr	x23, [x23, _idx_read_pos@GOTPAGEOFF]
	cmp	w0, w20
	b.ne	LBB0_16
; %bb.13:
Lloh21:
	adrp	x8, _verbosity@GOTPAGE
Lloh22:
	ldr	x8, [x8, _verbosity@GOTPAGEOFF]
Lloh23:
	ldr	w8, [x8]
	cmp	w8, #4
	b.lt	LBB0_17
; %bb.14:
Lloh24:
	adrp	x8, _stderr@GOTPAGE
Lloh25:
	ldr	x8, [x8, _stderr@GOTPAGEOFF]
Lloh26:
	ldr	w0, [x8]
	ldr	w8, [x23]
	str	x8, [sp]
Lloh27:
	adrp	x1, l_.str.2@PAGE
Lloh28:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x2, x20
	bl	_fprintf
	b	LBB0_17
LBB0_15:
	sub	w0, w8, w9
	b	LBB0_19
LBB0_16:
Lloh29:
	adrp	x8, _stderr@GOTPAGE
Lloh30:
	ldr	x8, [x8, _stderr@GOTPAGEOFF]
Lloh31:
	ldr	w0, [x8]
Lloh32:
	adrp	x8, _idx_filename@GOTPAGE
Lloh33:
	ldr	x8, [x8, _idx_filename@GOTPAGEOFF]
Lloh34:
	ldr	x8, [x8]
	ldr	w9, [x23]
	stp	x9, x19, [sp, #8]
	str	x8, [sp]
Lloh35:
	adrp	x1, l_.str.1@PAGE
Lloh36:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x2, x20
	bl	_fprintf
	mov	w0, #0
	bl	_assert
LBB0_17:
	ldr	w8, [x22]
	ldr	w9, [x21]
	add	w8, w8, w19
	sub	w0, w8, w9
	str	w8, [x22]
	ldr	w8, [x23]
	add	w8, w8, w19
	str	w8, [x23]
Lloh37:
	adrp	x8, _idx_metafile_pos@GOTPAGE
Lloh38:
	ldr	x8, [x8, _idx_metafile_pos@GOTPAGEOFF]
	ldr	w9, [x8]
	add	w9, w9, w19
	str	w9, [x8]
	b	LBB0_19
LBB0_18:
	ldr	w3, [x23]
Lloh39:
	adrp	x1, l_.str@PAGE
Lloh40:
	add	x1, x1, l_.str@PAGEOFF
	mov	w0, #4
	mov	x2, x19
	mov	w4, #0
	bl	_vkprintf
	mov	w0, #0
LBB0_19:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpAdd	Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpAdd	Lloh35, Lloh36
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGot	Lloh37, Lloh38
	.loh AdrpAdd	Lloh39, Lloh40
	.cfi_endproc
                                        ; -- End function
	.comm	_RBuffEnd,4,2                   ; @RBuffEnd
	.comm	_RBuff,4,2                      ; @RBuff
	.comm	_idx_bytes,4,2                  ; @idx_bytes
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"failed at pos %lld, ends at %lld bytes, need %d\n"

	.comm	_idx_rptr,4,2                   ; @idx_rptr
	.comm	_idx_wptr,4,2                   ; @idx_wptr
	.comm	_idx_fd,4,2                     ; @idx_fd
	.comm	_stderr,4,2                     ; @stderr
l_.str.1:                               ; @.str.1
	.asciz	"error reading %d bytes from snapshot %s at position %lld: only %d bytes read: %m\n"

	.comm	_idx_filename,8,3               ; @idx_filename
	.comm	_idx_read_pos,4,2               ; @idx_read_pos
	.comm	_verbosity,4,2                  ; @verbosity
l_.str.2:                               ; @.str.2
	.asciz	"preloaded %d bytes from snapshot at position %lld\n"

	.comm	_idx_metafile_pos,4,2           ; @idx_metafile_pos
.subsections_via_symbols
