	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_check_snapshot_is_readable     ## -- Begin function check_snapshot_is_readable
	.p2align	4, 0x90
_check_snapshot_is_readable:            ## @check_snapshot_is_readable
	.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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	xorl	%eax, %eax
	callq	_reset_max_errors_limit
	leaq	-64(%rbp), %rdi
	xorl	%esi, %esi
	movq	%r14, %rdx
	movl	$2, %ecx
	callq	_stream_open
	testq	%rax, %rax
	js	LBB0_6
## %bb.1:
	leaq	-64(%rbp), %rdi
	callq	_stream_eof
	testl	%eax, %eax
	jne	LBB0_5
## %bb.2:
	leaq	-64(%rbp), %r12
	leaq	L_.str.2(%rip), %r15
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movq	-64(%rbp), %r13
	movq	-56(%rbp), %rbx
	subq	%r13, %rbx
	movq	-48(%rbp), %rax
	cmpq	%rax, %rbx
	cmovgeq	%rax, %rbx
	movq	_PREVSIZE@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	movq	_io_buff@GOTPCREL(%rip), %rax
	addq	(%rax), %rsi
	movq	%r12, %rdi
	movq	%rbx, %rdx
	callq	_stream_read_limited
	testq	%rax, %rax
	js	LBB0_7
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	movl	$2, %edi
	movq	%r15, %rsi
	movq	%rbx, %rdx
	movq	%r14, %rcx
	movq	%r13, %r8
	callq	_vkprintf
	movq	%r12, %rdi
	callq	_stream_eof
	testl	%eax, %eax
	je	LBB0_3
LBB0_5:
	leaq	-64(%rbp), %rdi
	callq	_stream_close
	xorl	%eax, %eax
	jmp	LBB0_9
LBB0_6:
	leaq	L_.str(%rip), %rdi
	movq	%r14, %rsi
	xorl	%eax, %eax
	callq	_log_error
	jmp	LBB0_8
LBB0_7:
	leaq	L_.str.1(%rip), %rdi
	movq	%r14, %rsi
	movq	%r13, %rdx
	xorl	%eax, %eax
	callq	_log_error
	leaq	-64(%rbp), %rdi
	callq	_stream_close
LBB0_8:
	movl	$-1, %eax
LBB0_9:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"fail to open snapshot '%s'"

	.comm	_io_buff,8,3                    ## @io_buff
	.comm	_PREVSIZE,8,3                   ## @PREVSIZE
L_.str.1:                               ## @.str.1
	.asciz	"reading shapshot '%s' from offset %lld fail."

L_.str.2:                               ## @.str.2
	.asciz	"read %lld bytes from snapshot '%s', offset: %lld\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_check_snapshot_is_readable     ; -- Begin function check_snapshot_is_readable
	.p2align	2
_check_snapshot_is_readable:            ; @check_snapshot_is_readable
	.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	x19, x0
	bl	_reset_max_errors_limit
	add	x0, sp, #8
	mov	w1, #0
	mov	x2, x19
	mov	w3, #2
	bl	_stream_open
	tbnz	x0, #63, LBB0_6
; %bb.1:
	add	x0, sp, #8
	bl	_stream_eof
	cbnz	w0, LBB0_5
; %bb.2:
Lloh0:
	adrp	x23, _io_buff@GOTPAGE
Lloh1:
	ldr	x23, [x23, _io_buff@GOTPAGEOFF]
Lloh2:
	adrp	x24, _PREVSIZE@GOTPAGE
Lloh3:
	ldr	x24, [x24, _PREVSIZE@GOTPAGEOFF]
Lloh4:
	adrp	x20, l_.str.2@PAGE
Lloh5:
	add	x20, x20, l_.str.2@PAGEOFF
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldp	x21, x8, [sp, #8]
	ldr	x9, [sp, #24]
	sub	x8, x8, x21
	cmp	x8, x9
	csel	x22, x8, x9, lt
	ldr	x8, [x23]
	ldr	x9, [x24]
	add	x1, x9, x8
	add	x0, sp, #8
	mov	x2, x22
	bl	_stream_read_limited
	tbnz	x0, #63, LBB0_7
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	w0, #2
	mov	x1, x20
	mov	x2, x22
	mov	x3, x19
	mov	x4, x21
	bl	_vkprintf
	add	x0, sp, #8
	bl	_stream_eof
	cbz	w0, LBB0_3
LBB0_5:
	add	x0, sp, #8
	bl	_stream_close
	mov	w0, #0
	b	LBB0_9
LBB0_6:
Lloh6:
	adrp	x0, l_.str@PAGE
Lloh7:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x19
	bl	_log_error
	b	LBB0_8
LBB0_7:
	str	x21, [sp]
Lloh8:
	adrp	x0, l_.str.1@PAGE
Lloh9:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	x1, x19
	bl	_log_error
	add	x0, sp, #8
	bl	_stream_close
LBB0_8:
	mov	w0, #-1
LBB0_9:
	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 AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"fail to open snapshot '%s'"

	.comm	_io_buff,8,3                    ; @io_buff
	.comm	_PREVSIZE,8,3                   ; @PREVSIZE
l_.str.1:                               ; @.str.1
	.asciz	"reading shapshot '%s' from offset %lld fail."

l_.str.2:                               ; @.str.2
	.asciz	"read %lld bytes from snapshot '%s', offset: %lld\n"

.subsections_via_symbols
