	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function blk_write
_blk_write:                             ## @blk_write
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rcx, %rbx
	movl	%edx, %r12d
	movq	%rsi, %r15
	movq	%rdi, %r13
	movl	(%rdi), %edi
	movq	_MAXDUMPPGS@GOTPCREL(%rip), %rax
	movq	_PAGE_SIZE@GOTPCREL(%rip), %r14
	movq	(%r14), %rsi
	imulq	(%rax), %rsi
	callq	_min
	testl	%eax, %eax
	movq	(%r14), %rcx
	movl	%ecx, %r14d
	cmovnel	%eax, %r14d
	testq	%r15, %r15
	je	LBB0_3
## %bb.1:
	testl	%r12d, %r12d
	je	LBB0_3
## %bb.2:
	leaq	L_str.6(%rip), %rdi
	jmp	LBB0_10
LBB0_3:
	testl	%r12d, %r12d
	je	LBB0_13
## %bb.4:
	movq	%rbx, %rax
	orq	%rcx, %rax
	shrq	$32, %rax
	je	LBB0_7
## %bb.5:
	movq	%rbx, %rax
	xorl	%edx, %edx
	divq	%rcx
	testq	%rdx, %rdx
	je	LBB0_8
LBB0_6:
	leaq	L_str.5(%rip), %rdi
	jmp	LBB0_10
LBB0_7:
	movl	%ebx, %eax
	xorl	%edx, %edx
	divl	%ecx
                                        ## kill: def $edx killed $edx def $rdx
	testq	%rdx, %rdx
	jne	LBB0_6
LBB0_8:
	movq	_PAGE_MASK@GOTPCREL(%rip), %rax
	testl	%r12d, (%rax)
	je	LBB0_13
## %bb.9:
	leaq	L_str(%rip), %rdi
LBB0_10:
	callq	_puts
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_11:
	movl	(%rax), %eax
LBB0_12:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_13:
	testq	%r15, %r15
	je	LBB0_15
## %bb.14:
	movq	%r13, %rdi
	callq	_blk_flush
	testl	%eax, %eax
	jne	LBB0_12
LBB0_15:
	testq	%rbx, %rbx
	je	LBB0_33
## %bb.16:
	movq	%r13, -64(%rbp)                 ## 8-byte Spill
	movq	_fragsz@GOTPCREL(%rip), %rax
	movl	%r14d, -44(%rbp)                ## 4-byte Spill
	movslq	%r14d, %rcx
	movq	%rcx, -72(%rbp)                 ## 8-byte Spill
	movq	%rax, %r14
	movq	_PAGE_SHIFT@GOTPCREL(%rip), %rdx
	jmp	LBB0_18
	.p2align	4, 0x90
LBB0_17:                                ##   in Loop: Header=BB0_18 Depth=1
	subq	%r13, %rbx
	movq	_PAGE_SHIFT@GOTPCREL(%rip), %rdx
	je	LBB0_33
LBB0_18:                                ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_25 Depth 2
	movslq	(%r14), %rax
	movq	-72(%rbp), %r13                 ## 8-byte Reload
	subq	%rax, %r13
	cmpq	%r13, %rbx
	cmovbq	%rbx, %r13
	movq	_counter@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rax
	addq	%r13, %rax
	movq	%rax, (%rcx)
	movq	_progress@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rdi
	subq	%r13, %rdi
	movq	%rdi, (%rcx)
	cmpq	$4194304, %rax                  ## imm = 0x400000
	jb	LBB0_20
## %bb.19:                              ##   in Loop: Header=BB0_18 Depth=1
	movb	(%rdx), %cl
	shrq	%cl, %rdi
	callq	_PG2MB
	leaq	L_.str.3(%rip), %rdi
	movl	%eax, %esi
	xorl	%eax, %eax
	callq	_printf
	movq	_PAGE_SHIFT@GOTPCREL(%rip), %rdx
	movq	_counter@GOTPCREL(%rip), %rax
	andq	$4194303, (%rax)                ## imm = 0x3FFFFF
LBB0_20:                                ##   in Loop: Header=BB0_18 Depth=1
	testq	%r15, %r15
	je	LBB0_23
## %bb.21:                              ##   in Loop: Header=BB0_18 Depth=1
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	movq	%r15, %rsi
	xorl	%edx, %edx
	movq	%r13, %rcx
	callq	_dump_append
	testl	%eax, %eax
	jne	LBB0_12
## %bb.22:                              ##   in Loop: Header=BB0_18 Depth=1
	addq	%r13, %r15
	jmp	LBB0_30
	.p2align	4, 0x90
LBB0_23:                                ##   in Loop: Header=BB0_18 Depth=1
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	testq	%r13, %r13
	movq	_PAGE_SIZE@GOTPCREL(%rip), %r15
	je	LBB0_26
## %bb.24:                              ##   in Loop: Header=BB0_18 Depth=1
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_25:                                ##   Parent Loop BB0_18 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	leal	(%rbx,%r12), %edi
	movl	(%r14), %esi
	addl	%ebx, %esi
	movzbl	(%rdx), %ecx
	sarl	%cl, %esi
	callq	_pmap_kenter_temporary
	movq	_PAGE_SHIFT@GOTPCREL(%rip), %rdx
	movq	_dump_va@GOTPCREL(%rip), %rcx
	movl	%eax, (%rcx)
	addl	(%r15), %ebx
	movslq	%ebx, %rax
	cmpq	%rax, %r13
	ja	LBB0_25
LBB0_26:                                ##   in Loop: Header=BB0_18 Depth=1
	addl	%r13d, %r12d
	movl	(%r14), %eax
	addl	%r13d, %eax
	movl	%eax, (%r14)
	cmpl	-44(%rbp), %eax                 ## 4-byte Folded Reload
	jne	LBB0_29
## %bb.27:                              ##   in Loop: Header=BB0_18 Depth=1
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	callq	_blk_flush
	testl	%eax, %eax
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	jne	LBB0_12
## %bb.28:                              ##   in Loop: Header=BB0_18 Depth=1
	xorl	%r15d, %r15d
	jmp	LBB0_30
LBB0_29:                                ##   in Loop: Header=BB0_18 Depth=1
	xorl	%r15d, %r15d
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	.p2align	4, 0x90
LBB0_30:                                ##   in Loop: Header=BB0_18 Depth=1
	xorl	%eax, %eax
	callq	_cncheckc
	cmpl	$-1, %eax
	je	LBB0_17
## %bb.31:                              ##   in Loop: Header=BB0_18 Depth=1
	cmpl	$3, %eax
	je	LBB0_34
## %bb.32:                              ##   in Loop: Header=BB0_18 Depth=1
	leaq	L_.str.4(%rip), %rdi
	xorl	%eax, %eax
	callq	_printf
	jmp	LBB0_17
LBB0_33:
	xorl	%eax, %eax
	jmp	LBB0_12
LBB0_34:
	movq	_ECANCELED@GOTPCREL(%rip), %rax
	jmp	LBB0_11
	.cfi_endproc
                                        ## -- End function
	.comm	_MAXDUMPPGS,8,3                 ## @MAXDUMPPGS
	.comm	_PAGE_SIZE,8,3                  ## @PAGE_SIZE
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_PAGE_MASK,4,2                  ## @PAGE_MASK
	.comm	_fragsz,4,2                     ## @fragsz
	.comm	_counter,8,3                    ## @counter
	.comm	_progress,8,3                   ## @progress
	.section	__TEXT,__cstring,cstring_literals
L_.str.3:                               ## @.str.3
	.asciz	" %lld"

	.comm	_PAGE_SHIFT,8,3                 ## @PAGE_SHIFT
	.comm	_dump_va,4,2                    ## @dump_va
	.comm	_ECANCELED,4,2                  ## @ECANCELED
L_.str.4:                               ## @.str.4
	.asciz	" (CTRL-C to abort) "

	.comm	_WD_LASTVAL,4,2                 ## @WD_LASTVAL
L_str:                                  ## @str
	.asciz	"address not page aligned"

L_str.5:                                ## @str.5
	.asciz	"size not page aligned"

L_str.6:                                ## @str.6
	.asciz	"cant have both va and pa!"

	.no_dead_strip	_blk_write
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function blk_write
_blk_write:                             ; @blk_write
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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
	mov	x19, x3
	mov	x20, x2
	mov	x22, x1
	mov	x21, x0
Lloh0:
	adrp	x8, _MAXDUMPPGS@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MAXDUMPPGS@GOTPAGEOFF]
	ldr	w0, [x0]
Lloh2:
	ldr	x8, [x8]
Lloh3:
	adrp	x26, _PAGE_SIZE@GOTPAGE
Lloh4:
	ldr	x26, [x26, _PAGE_SIZE@GOTPAGEOFF]
	ldr	x9, [x26]
	mul	x1, x9, x8
	bl	_min
	ldr	x8, [x26]
	cmp	w0, #0
	csel	w23, w8, w0, eq
	cbz	x22, LBB0_3
; %bb.1:
	cbz	w20, LBB0_3
; %bb.2:
Lloh5:
	adrp	x0, l_str.6@PAGE
Lloh6:
	add	x0, x0, l_str.6@PAGEOFF
	b	LBB0_8
LBB0_3:
	cbz	w20, LBB0_11
; %bb.4:
	udiv	x9, x19, x8
	msub	x8, x9, x8, x19
	cbz	x8, LBB0_6
; %bb.5:
Lloh7:
	adrp	x0, l_str.5@PAGE
Lloh8:
	add	x0, x0, l_str.5@PAGEOFF
	b	LBB0_8
LBB0_6:
Lloh9:
	adrp	x8, _PAGE_MASK@GOTPAGE
Lloh10:
	ldr	x8, [x8, _PAGE_MASK@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	tst	w8, w20
	b.eq	LBB0_11
; %bb.7:
Lloh12:
	adrp	x0, l_str@PAGE
Lloh13:
	add	x0, x0, l_str@PAGEOFF
LBB0_8:
	bl	_puts
Lloh14:
	adrp	x8, _EINVAL@GOTPAGE
Lloh15:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_9:
	ldr	w0, [x8]
LBB0_10:
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
LBB0_11:
	cbz	x22, LBB0_13
; %bb.12:
	mov	x0, x21
	bl	_blk_flush
	cbnz	w0, LBB0_10
LBB0_13:
	cbz	x19, LBB0_30
; %bb.14:
Lloh16:
	adrp	x28, _fragsz@GOTPAGE
Lloh17:
	ldr	x28, [x28, _fragsz@GOTPAGEOFF]
	sxtw	x8, w23
	stp	x23, x8, [sp, #16]              ; 16-byte Folded Spill
Lloh18:
	adrp	x24, _counter@GOTPAGE
Lloh19:
	ldr	x24, [x24, _counter@GOTPAGEOFF]
Lloh20:
	adrp	x27, _PAGE_SHIFT@GOTPAGE
Lloh21:
	ldr	x27, [x27, _PAGE_SHIFT@GOTPAGEOFF]
Lloh22:
	adrp	x23, _dump_va@GOTPAGE
Lloh23:
	ldr	x23, [x23, _dump_va@GOTPAGEOFF]
	b	LBB0_16
LBB0_15:                                ;   in Loop: Header=BB0_16 Depth=1
	sub	x19, x19, x25
	cbz	x19, LBB0_30
LBB0_16:                                ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_23 Depth 2
	ldrsw	x8, [x28]
	ldr	x9, [sp, #24]                   ; 8-byte Folded Reload
	sub	x8, x9, x8
	cmp	x19, x8
	csel	x25, x19, x8, lo
	ldr	x8, [x24]
	add	x9, x25, x8
	str	x9, [x24]
Lloh24:
	adrp	x10, _progress@GOTPAGE
Lloh25:
	ldr	x10, [x10, _progress@GOTPAGEOFF]
	ldr	x8, [x10]
	sub	x8, x8, x25
	str	x8, [x10]
	cmp	x9, #1024, lsl #12              ; =4194304
	b.lo	LBB0_18
; %bb.17:                               ;   in Loop: Header=BB0_16 Depth=1
	ldr	x9, [x27]
	lsr	x0, x8, x9
	bl	_PG2MB
                                        ; kill: def $w0 killed $w0 def $x0
	str	x0, [sp]
Lloh26:
	adrp	x0, l_.str.3@PAGE
Lloh27:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_printf
	ldr	x8, [x24]
	and	x8, x8, #0x3fffff
	str	x8, [x24]
LBB0_18:                                ;   in Loop: Header=BB0_16 Depth=1
	cbz	x22, LBB0_21
; %bb.19:                               ;   in Loop: Header=BB0_16 Depth=1
	mov	x0, x21
	mov	x1, x22
	mov	w2, #0
	mov	x3, x25
	bl	_dump_append
	cbnz	w0, LBB0_10
; %bb.20:                               ;   in Loop: Header=BB0_16 Depth=1
	add	x22, x22, x25
	b	LBB0_27
LBB0_21:                                ;   in Loop: Header=BB0_16 Depth=1
	cbz	x25, LBB0_24
; %bb.22:                               ;   in Loop: Header=BB0_16 Depth=1
	mov	w22, #0
LBB0_23:                                ;   Parent Loop BB0_16 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	add	w0, w22, w20
	ldr	w8, [x28]
	add	w8, w8, w22
	ldr	w9, [x27]
	asr	w1, w8, w9
	bl	_pmap_kenter_temporary
	str	w0, [x23]
	ldr	w8, [x26]
	add	w22, w22, w8
	cmp	x25, w22, sxtw
	b.hi	LBB0_23
LBB0_24:                                ;   in Loop: Header=BB0_16 Depth=1
	ldr	w8, [x28]
	add	w8, w8, w25
	ldr	x9, [sp, #16]                   ; 8-byte Folded Reload
	cmp	w8, w9
	str	w8, [x28]
	add	w20, w20, w25
	b.ne	LBB0_26
; %bb.25:                               ;   in Loop: Header=BB0_16 Depth=1
	mov	x0, x21
	bl	_blk_flush
	cbnz	w0, LBB0_10
LBB0_26:                                ;   in Loop: Header=BB0_16 Depth=1
	mov	x22, #0
LBB0_27:                                ;   in Loop: Header=BB0_16 Depth=1
	bl	_cncheckc
	cmn	w0, #1
	b.eq	LBB0_15
; %bb.28:                               ;   in Loop: Header=BB0_16 Depth=1
	cmp	w0, #3
	b.eq	LBB0_31
; %bb.29:                               ;   in Loop: Header=BB0_16 Depth=1
Lloh28:
	adrp	x0, l_.str.4@PAGE
Lloh29:
	add	x0, x0, l_.str.4@PAGEOFF
	bl	_printf
	b	LBB0_15
LBB0_30:
	mov	w0, #0
	b	LBB0_10
LBB0_31:
Lloh30:
	adrp	x8, _ECANCELED@GOTPAGE
Lloh31:
	ldr	x8, [x8, _ECANCELED@GOTPAGEOFF]
	b	LBB0_9
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh24, Lloh25
	.loh AdrpAdd	Lloh26, Lloh27
	.loh AdrpAdd	Lloh28, Lloh29
	.loh AdrpLdrGot	Lloh30, Lloh31
	.cfi_endproc
                                        ; -- End function
	.comm	_MAXDUMPPGS,8,3                 ; @MAXDUMPPGS
	.comm	_PAGE_SIZE,8,3                  ; @PAGE_SIZE
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_PAGE_MASK,4,2                  ; @PAGE_MASK
	.comm	_fragsz,4,2                     ; @fragsz
	.comm	_counter,8,3                    ; @counter
	.comm	_progress,8,3                   ; @progress
	.section	__TEXT,__cstring,cstring_literals
l_.str.3:                               ; @.str.3
	.asciz	" %lld"

	.comm	_PAGE_SHIFT,8,3                 ; @PAGE_SHIFT
	.comm	_dump_va,4,2                    ; @dump_va
	.comm	_ECANCELED,4,2                  ; @ECANCELED
l_.str.4:                               ; @.str.4
	.asciz	" (CTRL-C to abort) "

	.comm	_WD_LASTVAL,4,2                 ; @WD_LASTVAL
l_str:                                  ; @str
	.asciz	"address not page aligned"

l_str.5:                                ; @str.5
	.asciz	"size not page aligned"

l_str.6:                                ; @str.6
	.asciz	"cant have both va and pa!"

	.no_dead_strip	_blk_write
.subsections_via_symbols
