	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function msb_write_block
_msb_write_block:                       ## @msb_write_block
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%r8d, %r14d
	movq	%rcx, %r13
	movq	%rdx, %r15
	movq	%rsi, %r12
	movq	%rdi, %rbx
	movq	(%rcx), %rax
	xorl	%edi, %edi
	cmpq	(%rbx), %rax
	setl	%dil
	callq	_BUG_ON
	cmpq	$0, 96(%rbx)
	je	LBB0_2
LBB0_1:
	movq	_EROFS@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	jmp	LBB0_12
LBB0_2:
	movq	_MS_BLOCK_INVALID@GOTPCREL(%rip), %rax
	cmpq	%r12, (%rax)
	jne	LBB0_4
## %bb.3:
	leaq	L_.str(%rip), %rdi
	jmp	LBB0_11
LBB0_4:
	cmpq	%r12, 8(%rbx)
	jle	LBB0_10
## %bb.5:
	cmpq	%r15, 16(%rbx)
	jle	LBB0_10
## %bb.6:
	movl	%r14d, -44(%rbp)                ## 4-byte Spill
	movq	%r15, %rdi
	callq	_msb_get_zone_from_lba
	movq	%rax, %r14
	movq	%r12, %rdi
	callq	_msb_get_zone_from_pba
	cmpq	%rax, %r14
	jne	LBB0_14
## %bb.7:
	movq	24(%rbx), %rax
	cmpq	%r12, (%rax)
	je	LBB0_9
## %bb.8:
	cmpq	%r12, 8(%rax)
	jne	LBB0_15
LBB0_9:
	leaq	L_.str.3(%rip), %rdi
	jmp	LBB0_11
LBB0_10:
	leaq	L_.str.1(%rip), %rdi
LBB0_11:
	xorl	%r14d, %r14d
	xorl	%eax, %eax
	callq	_pr_err
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_12:
	subl	(%rax), %r14d
LBB0_13:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_14:
	leaq	L_.str.2(%rip), %rdi
	jmp	LBB0_11
LBB0_15:
	xorl	%eax, %eax
LBB0_16:                                ## =>This Inner Loop Header: Depth=1
	cmpq	$0, 96(%rbx)
	jne	LBB0_1
## %bb.17:                              ##   in Loop: Header=BB0_16 Depth=1
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	movq	_MEMSTICK_CP_BLOCK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 88(%rbx)
	movq	$0, 80(%rbx)
	movq	%r12, %rdi
	callq	_cpu_to_be16
	movq	%rax, 72(%rbx)
	movabsq	$1065151889663, %rax            ## imm = 0xF8000000FF
	movq	%rax, 56(%rbx)
	movq	%r15, %rdi
	callq	_cpu_to_be16
	movq	%rax, 64(%rbx)
	movq	%r13, 48(%rbx)
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	movl	%eax, 32(%rbx)
	movq	$0, 40(%rbx)
	movq	_h_msb_write_block@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_msb_run_state_machine
	movl	%eax, %r14d
	testl	%eax, %eax
	jne	LBB0_21
## %bb.18:                              ##   in Loop: Header=BB0_16 Depth=1
	movq	_verify_writes@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	jne	LBB0_20
## %bb.19:                              ##   in Loop: Header=BB0_16 Depth=1
	movl	36(%rbx), %esi
	movq	%r12, %rdi
	callq	_test_bit
	testl	%eax, %eax
	jne	LBB0_24
LBB0_20:                                ##   in Loop: Header=BB0_16 Depth=1
	movq	%rbx, %rdi
	movq	%r12, %rsi
	movq	%r13, %rdx
	movl	-44(%rbp), %ecx                 ## 4-byte Reload
	callq	_msb_verify_block
	movl	%eax, %r14d
LBB0_21:                                ##   in Loop: Header=BB0_16 Depth=1
	testl	%r14d, %r14d
	sete	%al
	movl	-48(%rbp), %ecx                 ## 4-byte Reload
	orb	%al, %cl
	testb	$1, %cl
	jne	LBB0_13
## %bb.22:                              ##   in Loop: Header=BB0_16 Depth=1
	movq	%rbx, %rdi
	movl	$1, %esi
	callq	_msb_reset
	testq	%rax, %rax
	jne	LBB0_13
## %bb.23:                              ##   in Loop: Header=BB0_16 Depth=1
	leaq	L_.str.4(%rip), %rdi
	movq	%r12, %rsi
	xorl	%eax, %eax
	callq	_pr_err
	movq	%rbx, %rdi
	movq	%r12, %rsi
	callq	_msb_erase_block
	movl	%eax, %r14d
	movb	$1, %al
	testl	%r14d, %r14d
	je	LBB0_16
	jmp	LBB0_13
LBB0_24:
	xorl	%r14d, %r14d
	jmp	LBB0_13
	.cfi_endproc
                                        ## -- End function
	.comm	_EROFS,4,2                      ## @EROFS
	.comm	_MS_BLOCK_INVALID,8,3           ## @MS_BLOCK_INVALID
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"BUG: write: attempt to write MS_BLOCK_INVALID block"

	.comm	_EINVAL,4,2                     ## @EINVAL
L_.str.1:                               ## @.str.1
	.asciz	"BUG: write: attempt to write beyond the end of device"

L_.str.2:                               ## @.str.2
	.asciz	"BUG: write: lba zone mismatch"

L_.str.3:                               ## @.str.3
	.asciz	"BUG: write: attempt to write to boot blocks!"

	.comm	_MEMSTICK_CP_BLOCK,4,2          ## @MEMSTICK_CP_BLOCK
	.comm	_h_msb_write_block,4,2          ## @h_msb_write_block
	.comm	_verify_writes,8,3              ## @verify_writes
L_.str.4:                               ## @.str.4
	.asciz	"write failed, trying to erase the pba %d"

	.no_dead_strip	_msb_write_block
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal8,8byte_literals
	.p2align	3                               ; -- Begin function msb_write_block
lCPI0_0:
	.long	255                             ; 0xff
	.long	248                             ; 0xf8
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	2
_msb_write_block:                       ; @msb_write_block
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	d9, d8, [sp, #16]               ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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 b8, -88
	.cfi_offset b9, -96
	mov	x19, x4
	mov	x20, x3
	mov	x23, x2
	mov	x21, x1
	mov	x22, x0
	ldr	x8, [x3]
	ldr	x9, [x0]
	cmp	x8, x9
	cset	w0, lt
	bl	_BUG_ON
	ldr	x8, [x22, #96]
	cbz	x8, LBB0_2
LBB0_1:
Lloh0:
	adrp	x8, _EROFS@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EROFS@GOTPAGEOFF]
	b	LBB0_12
LBB0_2:
Lloh2:
	adrp	x8, _MS_BLOCK_INVALID@GOTPAGE
Lloh3:
	ldr	x8, [x8, _MS_BLOCK_INVALID@GOTPAGEOFF]
Lloh4:
	ldr	x8, [x8]
	cmp	x8, x21
	b.ne	LBB0_4
; %bb.3:
Lloh5:
	adrp	x0, l_.str@PAGE
Lloh6:
	add	x0, x0, l_.str@PAGEOFF
	b	LBB0_11
LBB0_4:
	ldr	x8, [x22, #8]
	cmp	x8, x21
	b.le	LBB0_10
; %bb.5:
	ldr	x8, [x22, #16]
	cmp	x8, x23
	b.le	LBB0_10
; %bb.6:
	mov	x0, x23
	bl	_msb_get_zone_from_lba
	mov	x24, x0
	mov	x0, x21
	bl	_msb_get_zone_from_pba
	cmp	x24, x0
	b.ne	LBB0_14
; %bb.7:
	ldr	x8, [x22, #24]
	ldr	x9, [x8]
	cmp	x9, x21
	b.eq	LBB0_9
; %bb.8:
	ldr	x8, [x8, #8]
	cmp	x8, x21
	b.ne	LBB0_15
LBB0_9:
Lloh7:
	adrp	x0, l_.str.3@PAGE
Lloh8:
	add	x0, x0, l_.str.3@PAGEOFF
	b	LBB0_11
LBB0_10:
Lloh9:
	adrp	x0, l_.str.1@PAGE
Lloh10:
	add	x0, x0, l_.str.1@PAGEOFF
LBB0_11:
	bl	_pr_err
Lloh11:
	adrp	x8, _EINVAL@GOTPAGE
Lloh12:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_12:
	ldr	w8, [x8]
	neg	w24, w8
LBB0_13:
	mov	x0, x24
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	d9, d8, [sp, #16]               ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_14:
Lloh13:
	adrp	x0, l_.str.2@PAGE
Lloh14:
	add	x0, x0, l_.str.2@PAGEOFF
	b	LBB0_11
LBB0_15:
	ldr	x8, [x22, #96]
	cbnz	x8, LBB0_1
; %bb.16:
Lloh15:
	adrp	x25, _MEMSTICK_CP_BLOCK@GOTPAGE
Lloh16:
	ldr	x25, [x25, _MEMSTICK_CP_BLOCK@GOTPAGEOFF]
	ldr	w8, [x25]
	str	w8, [x22, #88]
	str	xzr, [x22, #80]
	mov	x0, x21
	bl	_cpu_to_be16
	str	x0, [x22, #72]
Lloh17:
	adrp	x8, lCPI0_0@PAGE
Lloh18:
	ldr	d8, [x8, lCPI0_0@PAGEOFF]
	str	d8, [x22, #56]
	mov	x0, x23
	bl	_cpu_to_be16
	str	x0, [x22, #64]
	str	w19, [x22, #32]
	stp	xzr, x20, [x22, #40]
Lloh19:
	adrp	x26, _h_msb_write_block@GOTPAGE
Lloh20:
	ldr	x26, [x26, _h_msb_write_block@GOTPAGEOFF]
	ldr	w1, [x26]
	mov	x0, x22
	bl	_msb_run_state_machine
	mov	x24, x0
	cbnz	w0, LBB0_19
; %bb.17:
Lloh21:
	adrp	x8, _verify_writes@GOTPAGE
Lloh22:
	ldr	x8, [x8, _verify_writes@GOTPAGEOFF]
Lloh23:
	ldr	x8, [x8]
	cbz	x8, LBB0_27
LBB0_18:
	mov	x0, x22
	mov	x1, x21
	mov	x2, x20
	mov	x3, x19
	bl	_msb_verify_block
	mov	x24, x0
LBB0_19:
	cbz	w24, LBB0_13
; %bb.20:
	mov	x0, x22
	mov	w1, #1
	bl	_msb_reset
	cbnz	x0, LBB0_13
; %bb.21:
	str	x21, [sp]
Lloh24:
	adrp	x0, l_.str.4@PAGE
Lloh25:
	add	x0, x0, l_.str.4@PAGEOFF
	bl	_pr_err
	mov	x0, x22
	mov	x1, x21
	bl	_msb_erase_block
	mov	x24, x0
	cbnz	w0, LBB0_13
; %bb.22:
	ldr	x8, [x22, #96]
	cbnz	x8, LBB0_1
; %bb.23:
	ldr	w8, [x25]
	str	w8, [x22, #88]
	str	xzr, [x22, #80]
	mov	x0, x21
	bl	_cpu_to_be16
	str	x0, [x22, #72]
	str	d8, [x22, #56]
	mov	x0, x23
	bl	_cpu_to_be16
	str	x0, [x22, #64]
	str	w19, [x22, #32]
	stp	xzr, x20, [x22, #40]
	ldr	w1, [x26]
	mov	x0, x22
	bl	_msb_run_state_machine
	mov	x24, x0
	cbnz	w0, LBB0_13
; %bb.24:
Lloh26:
	adrp	x8, _verify_writes@GOTPAGE
Lloh27:
	ldr	x8, [x8, _verify_writes@GOTPAGEOFF]
Lloh28:
	ldr	x8, [x8]
	cbnz	x8, LBB0_26
; %bb.25:
	ldr	w1, [x22, #36]
	mov	x0, x21
	bl	_test_bit
	cbnz	w0, LBB0_28
LBB0_26:
	mov	x0, x22
	mov	x1, x21
	mov	x2, x20
	mov	x3, x19
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	d9, d8, [sp, #16]               ; 16-byte Folded Reload
	add	sp, sp, #112
	b	_msb_verify_block
LBB0_27:
	ldr	w1, [x22, #36]
	mov	x0, x21
	bl	_test_bit
	cbz	w0, LBB0_18
LBB0_28:
	mov	w24, #0
	b	LBB0_13
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdr	Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.cfi_endproc
                                        ; -- End function
	.comm	_EROFS,4,2                      ; @EROFS
	.comm	_MS_BLOCK_INVALID,8,3           ; @MS_BLOCK_INVALID
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"BUG: write: attempt to write MS_BLOCK_INVALID block"

	.comm	_EINVAL,4,2                     ; @EINVAL
l_.str.1:                               ; @.str.1
	.asciz	"BUG: write: attempt to write beyond the end of device"

l_.str.2:                               ; @.str.2
	.asciz	"BUG: write: lba zone mismatch"

l_.str.3:                               ; @.str.3
	.asciz	"BUG: write: attempt to write to boot blocks!"

	.comm	_MEMSTICK_CP_BLOCK,4,2          ; @MEMSTICK_CP_BLOCK
	.comm	_h_msb_write_block,4,2          ; @h_msb_write_block
	.comm	_verify_writes,8,3              ; @verify_writes
l_.str.4:                               ; @.str.4
	.asciz	"write failed, trying to erase the pba %d"

	.no_dead_strip	_msb_write_block
.subsections_via_symbols
