	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function rewrite_page
_rewrite_page:                          ## @rewrite_page
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	subq	$64, %rsp
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	testl	%edi, %edi
	je	LBB0_2
## %bb.1:
	leaq	L_.str(%rip), %rdi
	callq	_pr_info
LBB0_2:
	movq	_MTD_OPS_RAW@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -24(%rbp)
	movq	_mtd@GOTPCREL(%rip), %r14
	movq	(%r14), %rdi
	movq	(%rdi), %rax
	movq	%rax, -80(%rbp)
	xorps	%xmm0, %xmm0
	movups	%xmm0, -72(%rbp)
	movups	%xmm0, -48(%rbp)
	movq	$0, -32(%rbp)
	movq	_wbuffer@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -56(%rbp)
	movq	_offset@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-80(%rbp), %rdx
	callq	_mtd_write_oob
	testl	%eax, %eax
	je	LBB0_3
## %bb.5:
	movl	%eax, %ebx
	leaq	L_.str.1(%rip), %rdi
	movl	%eax, %esi
	callq	_pr_err
	jmp	LBB0_6
LBB0_3:
	movq	-72(%rbp), %rax
	movq	(%r14), %rcx
	xorl	%ebx, %ebx
	cmpq	(%rcx), %rax
	je	LBB0_6
## %bb.4:
	leaq	L_.str.1(%rip), %rdi
	xorl	%ebx, %ebx
	xorl	%esi, %esi
	callq	_pr_err
	movq	_EIO@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
LBB0_6:
	movl	%ebx, %eax
	addq	$64, %rsp
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"rewrite page\n"

	.comm	_MTD_OPS_RAW,4,2                ## @MTD_OPS_RAW
	.comm	_mtd,8,3                        ## @mtd
	.comm	_wbuffer,4,2                    ## @wbuffer
	.comm	_offset,4,2                     ## @offset
L_.str.1:                               ## @.str.1
	.asciz	"error: write_oob failed (%d)\n"

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

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function rewrite_page
_rewrite_page:                          ; @rewrite_page
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	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
	cbz	w0, LBB0_2
; %bb.1:
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_pr_info
LBB0_2:
Lloh2:
	adrp	x8, _MTD_OPS_RAW@GOTPAGE
Lloh3:
	ldr	x8, [x8, _MTD_OPS_RAW@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	str	w8, [sp, #56]
Lloh5:
	adrp	x20, _mtd@GOTPAGE
Lloh6:
	ldr	x20, [x20, _mtd@GOTPAGEOFF]
	ldr	x0, [x20]
	ldr	x8, [x0]
	stp	xzr, xzr, [sp, #8]
	str	x8, [sp]
	str	xzr, [sp, #48]
Lloh7:
	adrp	x8, _wbuffer@GOTPAGE
Lloh8:
	ldr	x8, [x8, _wbuffer@GOTPAGEOFF]
	stp	xzr, xzr, [sp, #32]
Lloh9:
	ldr	w8, [x8]
	str	w8, [sp, #24]
Lloh10:
	adrp	x8, _offset@GOTPAGE
Lloh11:
	ldr	x8, [x8, _offset@GOTPAGEOFF]
Lloh12:
	ldr	w1, [x8]
	mov	x2, sp
	bl	_mtd_write_oob
	cbz	w0, LBB0_4
; %bb.3:
	mov	x19, x0
Lloh13:
	adrp	x0, l_.str.1@PAGE
Lloh14:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	x1, x19
	bl	_pr_err
	b	LBB0_7
LBB0_4:
	ldr	x8, [sp, #8]
	ldr	x9, [x20]
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_6
; %bb.5:
	mov	w19, #0
	b	LBB0_7
LBB0_6:
Lloh15:
	adrp	x0, l_.str.1@PAGE
Lloh16:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	w1, #0
	bl	_pr_err
Lloh17:
	adrp	x8, _EIO@GOTPAGE
Lloh18:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh19:
	ldr	w8, [x8]
	neg	w19, w8
LBB0_7:
	mov	x0, x19
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpAdd	Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"rewrite page\n"

	.comm	_MTD_OPS_RAW,4,2                ; @MTD_OPS_RAW
	.comm	_mtd,8,3                        ; @mtd
	.comm	_wbuffer,4,2                    ; @wbuffer
	.comm	_offset,4,2                     ; @offset
l_.str.1:                               ; @.str.1
	.asciz	"error: write_oob failed (%d)\n"

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