	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function msb_update_block
_msb_update_block:                      ## @msb_update_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
	subq	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%ecx, -68(%rbp)                 ## 4-byte Spill
	movq	%rdx, -64(%rbp)                 ## 8-byte Spill
	movq	%rsi, %rbx
	movq	%rdi, %r13
	movq	(%rdi), %rax
	movq	(%rax,%rsi,8), %r15
	leaq	L_.str(%rip), %rdi
	movl	$0, -44(%rbp)                   ## 4-byte Folded Spill
	movq	%r15, %rdx
	xorl	%eax, %eax
	callq	_dbg_verbose
	movq	_MS_BLOCK_INVALID@GOTPCREL(%rip), %r14
	cmpq	(%r14), %r15
	je	LBB0_2
## %bb.1:
	leaq	L_.str.1(%rip), %rdi
	xorl	%eax, %eax
	callq	_dbg_verbose
	movq	_MEMSTICK_OVERWRITE_UDST@GOTPCREL(%rip), %rax
	movzbl	(%rax), %ecx
	xorl	$255, %ecx
	movq	%r13, %rdi
	movq	%r15, %rsi
	xorl	%edx, %edx
	callq	_msb_set_overwrite_flag
LBB0_2:
	movq	%rbx, %rdi
	callq	_msb_get_zone_from_lba
	movq	%r13, %rdi
	movl	%eax, %esi
	callq	_msb_get_free_block
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	cmpq	(%r14), %rax
	jne	LBB0_4
LBB0_3:
	movq	%r13, %rbx
	movq	_EIO@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	testl	%r15d, %r15d
	jne	LBB0_17
LBB0_16:
	xorl	%r15d, %r15d
	jmp	LBB0_18
LBB0_4:
	movq	%rax, %r12
	movq	%r15, -80(%rbp)                 ## 8-byte Spill
	leaq	L_.str.2(%rip), %rdi
	movq	%rax, %rsi
	xorl	%eax, %eax
	callq	_dbg_verbose
	movq	%r13, %rdi
	movq	%r12, %rsi
	movq	-56(%rbp), %r14                 ## 8-byte Reload
	movq	%r14, %rdx
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	movl	-68(%rbp), %ebx                 ## 4-byte Reload
	movl	%ebx, %r8d
	callq	_msb_write_block
	movl	%eax, %r15d
	movq	_EBADMSG@GOTPCREL(%rip), %rcx
	addl	(%rcx), %eax
	jne	LBB0_5
## %bb.6:
	movq	%r13, %rdi
	movq	%r12, %rsi
	callq	_msb_mark_bad
	movq	%r14, %rdi
	callq	_msb_get_zone_from_lba
	movq	%r13, %rdi
	movl	%eax, %esi
	callq	_msb_get_free_block
	movq	%rax, %r12
	movl	$1, -44(%rbp)                   ## 4-byte Folded Spill
	movq	_MS_BLOCK_INVALID@GOTPCREL(%rip), %rax
	cmpq	(%rax), %r12
	je	LBB0_3
## %bb.7:
	leaq	L_.str.2(%rip), %rdi
	movq	%r12, %rsi
	xorl	%eax, %eax
	callq	_dbg_verbose
	movq	%r13, %rdi
	movq	%r12, %rsi
	movq	-56(%rbp), %r14                 ## 8-byte Reload
	movq	%r14, %rdx
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	movl	%ebx, %r8d
	callq	_msb_write_block
	movl	%eax, %r15d
	movq	_EBADMSG@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	addl	%r15d, %eax
	jne	LBB0_8
## %bb.9:
	movq	%r13, %rdi
	movq	%r12, %rsi
	callq	_msb_mark_bad
	movq	%r14, %rdi
	callq	_msb_get_zone_from_lba
	movq	%r13, %rdi
	movl	%eax, %esi
	callq	_msb_get_free_block
	movq	%rax, %r12
	movl	$2, -44(%rbp)                   ## 4-byte Folded Spill
	movq	_MS_BLOCK_INVALID@GOTPCREL(%rip), %rax
	cmpq	(%rax), %r12
	je	LBB0_3
## %bb.10:
	leaq	L_.str.2(%rip), %rdi
	movq	%r12, %rsi
	xorl	%eax, %eax
	callq	_dbg_verbose
	movq	%r13, %rdi
	movq	%r12, %rsi
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
	movq	%rdx, %r14
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	movl	%ebx, %r8d
	callq	_msb_write_block
	movl	%eax, %r15d
	movl	$2, %esi
	movq	_EBADMSG@GOTPCREL(%rip), %rcx
	addl	(%rcx), %eax
	jne	LBB0_11
## %bb.14:
	movq	%r13, %rbx
	movq	%r13, %rdi
	movq	%r12, %rsi
	callq	_msb_mark_bad
	movl	$3, %esi
	testl	%r15d, %r15d
	jne	LBB0_17
	jmp	LBB0_16
LBB0_5:
	movq	%r13, %rbx
	xorl	%esi, %esi
LBB0_12:
	testl	%r15d, %r15d
	je	LBB0_13
LBB0_17:
	leaq	L_.str.4(%rip), %rdi
	callq	_pr_err
	movl	$1, 8(%rbx)
LBB0_18:
	movl	%r15d, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_13:
	leaq	L_.str.3(%rip), %rdi
	xorl	%r15d, %r15d
	xorl	%eax, %eax
	callq	_dbg_verbose
	movq	%rbx, %rdi
	movq	-80(%rbp), %rsi                 ## 8-byte Reload
	callq	_msb_erase_block
	movq	(%rbx), %rax
	movq	%r12, (%rax,%r14,8)
	jmp	LBB0_18
LBB0_8:
	movq	%r13, %rbx
	movl	$1, %esi
	jmp	LBB0_12
LBB0_11:
	movq	%r13, %rbx
	jmp	LBB0_12
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"start of a block update at lba  %d, pba %d"

	.comm	_MS_BLOCK_INVALID,8,3           ## @MS_BLOCK_INVALID
L_.str.1:                               ## @.str.1
	.asciz	"setting the update flag on the block"

	.comm	_MEMSTICK_OVERWRITE_UDST,4,2    ## @MEMSTICK_OVERWRITE_UDST
	.comm	_EIO,4,2                        ## @EIO
L_.str.2:                               ## @.str.2
	.asciz	"block update: writing updated block to the pba %d"

	.comm	_EBADMSG,4,2                    ## @EBADMSG
L_.str.3:                               ## @.str.3
	.asciz	"block update: erasing the old block"

L_.str.4:                               ## @.str.4
	.asciz	"block update error after %d tries,  switching to r/o mode"

	.no_dead_strip	_msb_update_block
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function msb_update_block
_msb_update_block:                      ; @msb_update_block
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [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 w27, -88
	.cfi_offset w28, -96
	mov	x22, x3
	mov	x23, x2
	mov	x20, x1
	mov	x19, x0
	ldr	x8, [x0]
	ldr	x21, [x8, x1, lsl #3]
	stp	x1, x21, [sp]
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_dbg_verbose
Lloh2:
	adrp	x26, _MS_BLOCK_INVALID@GOTPAGE
Lloh3:
	ldr	x26, [x26, _MS_BLOCK_INVALID@GOTPAGEOFF]
	ldr	x8, [x26]
	cmp	x21, x8
	b.eq	LBB0_2
; %bb.1:
Lloh4:
	adrp	x0, l_.str.1@PAGE
Lloh5:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_dbg_verbose
Lloh6:
	adrp	x8, _MEMSTICK_OVERWRITE_UDST@GOTPAGE
Lloh7:
	ldr	x8, [x8, _MEMSTICK_OVERWRITE_UDST@GOTPAGEOFF]
	ldrb	w8, [x8]
	eor	w3, w8, #0xff
	mov	x0, x19
	mov	x1, x21
	mov	w2, #0
	bl	_msb_set_overwrite_flag
LBB0_2:
	mov	x0, x20
	bl	_msb_get_zone_from_lba
	mov	x1, x0
	mov	x0, x19
	bl	_msb_get_free_block
	ldr	x8, [x26]
	cmp	x0, x8
	b.ne	LBB0_5
; %bb.3:
	mov	w1, #0
LBB0_4:
Lloh8:
	adrp	x8, _EIO@GOTPAGE
Lloh9:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	neg	w25, w8
	cbnz	w25, LBB0_10
	b	LBB0_11
LBB0_5:
	mov	x24, x0
	str	x0, [sp]
Lloh11:
	adrp	x0, l_.str.2@PAGE
Lloh12:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_dbg_verbose
	mov	x0, x19
	mov	x1, x24
	mov	x2, x20
	mov	x3, x23
	mov	x4, x22
	bl	_msb_write_block
Lloh13:
	adrp	x27, _EBADMSG@GOTPAGE
Lloh14:
	ldr	x27, [x27, _EBADMSG@GOTPAGEOFF]
	ldr	w8, [x27]
	cmn	w0, w8
	b.ne	LBB0_8
; %bb.6:
	mov	x0, x19
	mov	x1, x24
	bl	_msb_mark_bad
	mov	x0, x20
	bl	_msb_get_zone_from_lba
	mov	x1, x0
	mov	x0, x19
	bl	_msb_get_free_block
	ldr	x8, [x26]
	cmp	x0, x8
	b.ne	LBB0_12
; %bb.7:
	mov	w1, #1
	b	LBB0_4
LBB0_8:
	mov	x25, x0
	mov	w1, #0
LBB0_9:
	cbz	w25, LBB0_15
LBB0_10:
Lloh15:
	adrp	x0, l_.str.4@PAGE
Lloh16:
	add	x0, x0, l_.str.4@PAGEOFF
	bl	_pr_err
	mov	w8, #1
	str	w8, [x19, #8]
LBB0_11:
	mov	x0, x25
	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	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_12:
	mov	x24, x0
	str	x0, [sp]
Lloh17:
	adrp	x0, l_.str.2@PAGE
Lloh18:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_dbg_verbose
	mov	x0, x19
	mov	x1, x24
	mov	x2, x20
	mov	x3, x23
	mov	x4, x22
	bl	_msb_write_block
	ldr	w8, [x27]
	cmn	w0, w8
	b.ne	LBB0_16
; %bb.13:
	mov	x0, x19
	mov	x1, x24
	bl	_msb_mark_bad
	mov	x0, x20
	bl	_msb_get_zone_from_lba
	mov	x1, x0
	mov	x0, x19
	bl	_msb_get_free_block
	ldr	x8, [x26]
	cmp	x0, x8
	b.ne	LBB0_17
; %bb.14:
	mov	w1, #2
	b	LBB0_4
LBB0_15:
Lloh19:
	adrp	x0, l_.str.3@PAGE
Lloh20:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_dbg_verbose
	mov	x0, x19
	mov	x1, x21
	bl	_msb_erase_block
	ldr	x8, [x19]
	str	x24, [x8, x20, lsl #3]
	b	LBB0_11
LBB0_16:
	mov	x25, x0
	mov	w1, #1
	b	LBB0_9
LBB0_17:
	mov	x24, x0
	str	x0, [sp]
Lloh21:
	adrp	x0, l_.str.2@PAGE
Lloh22:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_dbg_verbose
	mov	x0, x19
	mov	x1, x24
	mov	x2, x20
	mov	x3, x23
	mov	x4, x22
	bl	_msb_write_block
	mov	x25, x0
	ldr	w8, [x27]
	cmn	w0, w8
	b.ne	LBB0_19
; %bb.18:
	mov	x0, x19
	mov	x1, x24
	bl	_msb_mark_bad
	mov	w1, #3
	cbnz	w25, LBB0_10
	b	LBB0_11
LBB0_19:
	mov	w1, #2
	b	LBB0_9
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpAdd	Lloh21, Lloh22
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"start of a block update at lba  %d, pba %d"

	.comm	_MS_BLOCK_INVALID,8,3           ; @MS_BLOCK_INVALID
l_.str.1:                               ; @.str.1
	.asciz	"setting the update flag on the block"

	.comm	_MEMSTICK_OVERWRITE_UDST,4,2    ; @MEMSTICK_OVERWRITE_UDST
	.comm	_EIO,4,2                        ; @EIO
l_.str.2:                               ; @.str.2
	.asciz	"block update: writing updated block to the pba %d"

	.comm	_EBADMSG,4,2                    ; @EBADMSG
l_.str.3:                               ; @.str.3
	.asciz	"block update: erasing the old block"

l_.str.4:                               ; @.str.4
	.asciz	"block update error after %d tries,  switching to r/o mode"

	.no_dead_strip	_msb_update_block
.subsections_via_symbols
