	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function writeshovel
_writeshovel:                           ## @writeshovel
	.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, %rbx
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	_BUFSIZE@GOTPCREL(%rip), %r13
	movl	(%r13), %eax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %r12
	movl	$1, %edi
	callq	_rump_pub_lwproc_newlwp
	movl	(%rbx), %r14d
	movl	4(%rbx), %eax
	movl	%eax, -52(%rbp)                 ## 4-byte Spill
LBB0_1:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_2 Depth 2
	xorl	%edi, %edi
	movq	%r13, %r15
	cmpl	$5, (%r13)
	setae	%dil
	callq	_assert
	xorl	%r13d, %r13d
	movl	$4, %edx
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_6:                                 ##   in Loop: Header=BB0_2 Depth=2
	movl	%r13d, %edx
	addq	$-4, %rdx
	testq	%rdx, %rdx
	je	LBB0_8
LBB0_2:                                 ##   Parent Loop BB0_1 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movslq	%r13d, %rsi
	addq	%r12, %rsi
	movl	%r14d, %edi
	callq	_xread
	movl	%eax, %ebx
	testl	%eax, %eax
	jle	LBB0_3
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=2
	addl	%ebx, %r13d
	cmpl	$4, %r13d
	jb	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_2 Depth=2
	movslq	(%r12), %rdx
	movslq	%r13d, %rax
	subq	%rax, %rdx
	testq	%rdx, %rdx
	jne	LBB0_2
LBB0_8:                                 ##   in Loop: Header=BB0_1 Depth=1
	movl	16(%r12), %edi
	callq	_PUFFSOP_OPCLASS
	movq	_PUFFSOP_VFS@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_9
## %bb.10:                              ##   in Loop: Header=BB0_1 Depth=1
	movq	(%r12), %rax
	movq	_PUFFS_VFS_UNMOUNT@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	sete	%al
	jmp	LBB0_11
	.p2align	4, 0x90
LBB0_9:                                 ##   in Loop: Header=BB0_1 Depth=1
	xorl	%eax, %eax
LBB0_11:                                ##   in Loop: Header=BB0_1 Depth=1
	movq	%r15, %r13
	movzbl	%al, %edi
	callq	___predict_false
	testq	%rax, %rax
	je	LBB0_14
## %bb.12:                              ##   in Loop: Header=BB0_1 Depth=1
	cmpq	$0, 8(%r12)
	jne	LBB0_14
## %bb.13:                              ##   in Loop: Header=BB0_1 Depth=1
	movq	_mayquit@GOTPCREL(%rip), %rax
	movl	$1, (%rax)
LBB0_14:                                ##   in Loop: Header=BB0_1 Depth=1
	movl	(%r12), %edx
	movl	-52(%rbp), %edi                 ## 4-byte Reload
	movq	%r12, %rsi
	callq	_rump_sys_write
	cmpl	(%r12), %eax
	je	LBB0_1
## %bb.15:
	movl	%eax, %ebx
	movq	_stderr@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_errno@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	leaq	L_.str.1(%rip), %rsi
	jmp	LBB0_16
LBB0_3:
	movq	_stderr@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_errno@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	leaq	L_.str(%rip), %rsi
LBB0_16:
	movl	%ebx, %edx
	callq	_fprintf
	testl	%ebx, %ebx
	jne	LBB0_19
## %bb.17:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_20
## %bb.18:
	xorl	%eax, %eax
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_19:
	xorl	%eax, %eax
	callq	_abort
LBB0_20:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_BUFSIZE,4,2                    ## @BUFSIZE
	.comm	_stderr,4,2                     ## @stderr
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"writeshovel read %zd / %d\n"

	.comm	_errno,4,2                      ## @errno
	.comm	_PUFFSOP_VFS,8,3                ## @PUFFSOP_VFS
	.comm	_PUFFS_VFS_UNMOUNT,8,3          ## @PUFFS_VFS_UNMOUNT
	.comm	_mayquit,4,2                    ## @mayquit
L_.str.1:                               ## @.str.1
	.asciz	"writeshovel wr %zd / %d\n"

	.no_dead_strip	_writeshovel
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function writeshovel
_writeshovel:                           ; @writeshovel
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	sub	sp, sp, #16
	mov	x21, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-88]
Lloh3:
	adrp	x23, _BUFSIZE@GOTPAGE
Lloh4:
	ldr	x23, [x23, _BUFSIZE@GOTPAGEOFF]
	ldr	w8, [x23]
	mov	x9, x8
Lloh5:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh6:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x9, sp
	add	x8, x8, #15
	and	x8, x8, #0x1fffffff0
	sub	x19, x9, x8
	mov	sp, x19
	mov	w24, #1
	mov	w0, #1
	bl	_rump_pub_lwproc_newlwp
	ldp	w20, w21, [x21]
Lloh7:
	adrp	x25, _PUFFSOP_VFS@GOTPAGE
Lloh8:
	ldr	x25, [x25, _PUFFSOP_VFS@GOTPAGEOFF]
Lloh9:
	adrp	x26, _PUFFS_VFS_UNMOUNT@GOTPAGE
Lloh10:
	ldr	x26, [x26, _PUFFS_VFS_UNMOUNT@GOTPAGEOFF]
Lloh11:
	adrp	x27, _mayquit@GOTPAGE
Lloh12:
	ldr	x27, [x27, _mayquit@GOTPAGEOFF]
LBB0_1:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_3 Depth 2
	ldr	w8, [x23]
	cmp	w8, #4
	cset	w0, hi
	bl	_assert
	mov	w28, #0
	mov	w2, #4
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=2
	sub	x2, x28, #4
	cbz	x2, LBB0_6
LBB0_3:                                 ;   Parent Loop BB0_1 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	add	x1, x19, w28, sxtw
	mov	x0, x20
	bl	_xread
	mov	x22, x0
	cmp	w0, #0
	b.le	LBB0_13
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=2
	add	w28, w22, w28
	cmp	w28, #4
	b.lo	LBB0_2
; %bb.5:                                ;   in Loop: Header=BB0_3 Depth=2
	ldrsw	x8, [x19]
	sub	x2, x8, w28, sxtw
	cbnz	x2, LBB0_3
LBB0_6:                                 ;   in Loop: Header=BB0_1 Depth=1
	ldr	w0, [x19, #16]
	bl	_PUFFSOP_OPCLASS
	ldr	x8, [x25]
	cmp	x0, x8
	b.ne	LBB0_8
; %bb.7:                                ;   in Loop: Header=BB0_1 Depth=1
	ldr	x8, [x19]
	ldr	x9, [x26]
	cmp	x8, x9
	cset	w0, eq
	bl	___predict_false
	cbnz	x0, LBB0_9
	b	LBB0_11
LBB0_8:                                 ;   in Loop: Header=BB0_1 Depth=1
	mov	w0, #0
	bl	___predict_false
	cbz	x0, LBB0_11
LBB0_9:                                 ;   in Loop: Header=BB0_1 Depth=1
	ldr	x8, [x19, #8]
	cbnz	x8, LBB0_11
; %bb.10:                               ;   in Loop: Header=BB0_1 Depth=1
	str	w24, [x27]
LBB0_11:                                ;   in Loop: Header=BB0_1 Depth=1
	ldr	w2, [x19]
	mov	x0, x21
	mov	x1, x19
	bl	_rump_sys_write
	ldr	w8, [x19]
	cmp	w0, w8
	b.eq	LBB0_1
; %bb.12:
	mov	x22, x0
Lloh13:
	adrp	x8, _stderr@GOTPAGE
Lloh14:
	ldr	x8, [x8, _stderr@GOTPAGEOFF]
Lloh15:
	ldr	w0, [x8]
Lloh16:
	adrp	x8, _errno@GOTPAGE
Lloh17:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh18:
	ldr	w3, [x8]
Lloh19:
	adrp	x1, l_.str.1@PAGE
Lloh20:
	add	x1, x1, l_.str.1@PAGEOFF
	b	LBB0_14
LBB0_13:
Lloh21:
	adrp	x8, _stderr@GOTPAGE
Lloh22:
	ldr	x8, [x8, _stderr@GOTPAGEOFF]
Lloh23:
	ldr	w0, [x8]
Lloh24:
	adrp	x8, _errno@GOTPAGE
Lloh25:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh26:
	ldr	w3, [x8]
Lloh27:
	adrp	x1, l_.str@PAGE
Lloh28:
	add	x1, x1, l_.str@PAGEOFF
LBB0_14:
	mov	x2, x22
	bl	_fprintf
	cbnz	w22, LBB0_17
; %bb.15:
	ldur	x8, [x29, #-88]
Lloh29:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh30:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh31:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_18
; %bb.16:
	mov	x0, #0
	sub	sp, x29, #80
	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
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
LBB0_17:
	bl	_abort
LBB0_18:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpAdd	Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.cfi_endproc
                                        ; -- End function
	.comm	_BUFSIZE,4,2                    ; @BUFSIZE
	.comm	_stderr,4,2                     ; @stderr
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"writeshovel read %zd / %d\n"

	.comm	_errno,4,2                      ; @errno
	.comm	_PUFFSOP_VFS,8,3                ; @PUFFSOP_VFS
	.comm	_PUFFS_VFS_UNMOUNT,8,3          ; @PUFFS_VFS_UNMOUNT
	.comm	_mayquit,4,2                    ; @mayquit
l_.str.1:                               ; @.str.1
	.asciz	"writeshovel wr %zd / %d\n"

	.no_dead_strip	_writeshovel
.subsections_via_symbols
