	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function write_pattern
_write_pattern:                         ## @write_pattern
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r8
	movl	%edi, %r14d
	movq	_mtd@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	movl	(%rdi), %eax
	movq	_pgcnt@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	testl	%ecx, %ecx
	je	LBB0_1
## %bb.2:
	leal	1(%r14), %edx
	imull	%edx, %eax
	movq	_pgsize@GOTPCREL(%rip), %rdx
	imull	(%rdx), %ecx
	subl	%ecx, %eax
	movl	%eax, %esi
	movl	%ecx, %eax
	jmp	LBB0_3
LBB0_1:
	movl	%eax, %esi
	imull	%r14d, %esi
LBB0_3:
	movslq	%eax, %r15
	leaq	-32(%rbp), %rcx
	movq	%r15, %rdx
	callq	_mtd_write
	movq	-32(%rbp), %rcx
	testl	%eax, %eax
	je	LBB0_5
## %bb.4:
	movl	%eax, %ebx
	leaq	L_.str(%rip), %rdi
	movl	%eax, %esi
	movl	%r14d, %edx
	callq	_pr_err
	jmp	LBB0_7
LBB0_5:
	xorl	%ebx, %ebx
	cmpq	%r15, %rcx
	je	LBB0_7
## %bb.6:
	leaq	L_.str.1(%rip), %rdi
	movq	%rcx, %rsi
	movq	%r15, %rdx
	callq	_pr_info
	movq	_EIO@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_7:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_mtd,8,3                        ## @mtd
	.comm	_pgcnt,4,2                      ## @pgcnt
	.comm	_pgsize,4,2                     ## @pgsize
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"error %d while writing EB %d, written %zd bytes\n"

L_.str.1:                               ## @.str.1
	.asciz	"written only %zd bytes of %zd, but no error reported\n"

	.comm	_EIO,4,2                        ## @EIO
	.no_dead_strip	_write_pattern
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function write_pattern
_write_pattern:                         ; @write_pattern
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
	mov	x4, x1
	mov	x19, x0
Lloh0:
	adrp	x8, _mtd@GOTPAGE
Lloh1:
	ldr	x8, [x8, _mtd@GOTPAGEOFF]
Lloh2:
	ldr	x0, [x8]
	ldr	w8, [x0]
Lloh3:
	adrp	x9, _pgcnt@GOTPAGE
Lloh4:
	ldr	x9, [x9, _pgcnt@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	cbz	w9, LBB0_2
; %bb.1:
	madd	w10, w8, w19, w8
Lloh6:
	adrp	x8, _pgsize@GOTPAGE
Lloh7:
	ldr	x8, [x8, _pgsize@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	mul	w8, w8, w9
	sub	w1, w10, w8
	b	LBB0_3
LBB0_2:
	mul	w1, w8, w19
LBB0_3:
	sxtw	x20, w8
	add	x3, sp, #8
	mov	x2, x20
	bl	_mtd_write
	ldr	x3, [sp, #8]
	cbz	w0, LBB0_5
; %bb.4:
	mov	x21, x0
Lloh9:
	adrp	x0, l_.str@PAGE
Lloh10:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x21
	mov	x2, x19
	bl	_pr_err
	b	LBB0_8
LBB0_5:
	cmp	x3, x20
	b.ne	LBB0_7
; %bb.6:
	mov	w21, #0
	b	LBB0_8
LBB0_7:
Lloh11:
	adrp	x0, l_.str.1@PAGE
Lloh12:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	x1, x3
	mov	x2, x20
	bl	_pr_info
Lloh13:
	adrp	x8, _EIO@GOTPAGE
Lloh14:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
	neg	w21, w8
LBB0_8:
	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
	add	sp, sp, #64
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpAdd	Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_mtd,8,3                        ; @mtd
	.comm	_pgcnt,4,2                      ; @pgcnt
	.comm	_pgsize,4,2                     ; @pgsize
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"error %d while writing EB %d, written %zd bytes\n"

l_.str.1:                               ; @.str.1
	.asciz	"written only %zd bytes of %zd, but no error reported\n"

	.comm	_EIO,4,2                        ; @EIO
	.no_dead_strip	_write_pattern
.subsections_via_symbols
