	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function msb_cache_flush
_msb_cache_flush:                       ## @msb_cache_flush
	.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
	cmpq	$0, 40(%rdi)
	je	LBB0_2
## %bb.1:
	movq	_EROFS@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
	jmp	LBB0_20
LBB0_2:
	movq	%rdi, %r13
	movq	(%rdi), %rdx
	movq	_MS_BLOCK_INVALID@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	cmpq	(%rax), %rdx
	je	LBB0_20
## %bb.3:
	movq	8(%r13), %rax
	movq	(%rax,%rdx,8), %rsi
	leaq	L_.str(%rip), %rdi
	movq	%rsi, -64(%rbp)                 ## 8-byte Spill
                                        ## kill: def $esi killed $esi killed $rsi
	movq	%rdx, -72(%rbp)                 ## 8-byte Spill
	callq	_dbg_verbose
	movl	28(%r13), %edx
	movl	32(%r13), %esi
	leaq	-48(%rbp), %rdi
	callq	_sg_init_one
	cmpl	$0, 16(%r13)
	jle	LBB0_13
## %bb.4:
	leaq	24(%r13), %r12
	xorl	%r15d, %r15d
	jmp	LBB0_5
LBB0_7:                                 ##   in Loop: Header=BB0_5 Depth=1
	leaq	L_.str.2(%rip), %rdi
	movl	%r15d, %esi
	callq	_pr_err
	.p2align	4, 0x90
LBB0_12:                                ##   in Loop: Header=BB0_5 Depth=1
	incl	%r15d
	cmpl	16(%r13), %r15d
	jge	LBB0_13
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movl	%r15d, %edi
	movq	%r12, %rsi
	callq	_test_bit
	testq	%rax, %rax
	jne	LBB0_12
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=1
	movl	20(%r13), %ebx
	imull	%r15d, %ebx
	leaq	L_.str.1(%rip), %rdi
	movl	%r15d, %esi
	movq	-72(%rbp), %rdx                 ## 8-byte Reload
	callq	_dbg_verbose
	movq	%r13, %rdi
	movq	-64(%rbp), %rsi                 ## 8-byte Reload
	movl	%r15d, %edx
	leaq	-56(%rbp), %rcx
	leaq	-48(%rbp), %r8
	movl	%ebx, %r9d
	callq	_msb_read_page
	movl	%eax, %r14d
	movq	_EBADMSG@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	addl	%r14d, %eax
	je	LBB0_7
## %bb.8:                               ##   in Loop: Header=BB0_5 Depth=1
	testl	%r14d, %r14d
	jne	LBB0_20
## %bb.9:                               ##   in Loop: Header=BB0_5 Depth=1
	movl	-56(%rbp), %eax
	notl	%eax
	movq	_MEMSTICK_OV_PG_NORMAL@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	jne	LBB0_10
## %bb.11:                              ##   in Loop: Header=BB0_5 Depth=1
	movl	%r15d, %edi
	movq	%r12, %rsi
	callq	_set_bit
	jmp	LBB0_12
LBB0_10:                                ##   in Loop: Header=BB0_5 Depth=1
	leaq	L_.str.3(%rip), %rdi
	movl	%r15d, %esi
	callq	_dbg
	jmp	LBB0_12
LBB0_13:
	movq	(%r13), %rsi
	leaq	-48(%rbp), %rdx
	movq	%r13, %rdi
	xorl	%ecx, %ecx
	callq	_msb_update_block
	movl	%eax, %r14d
	testl	%eax, %eax
	je	LBB0_14
LBB0_19:
	movq	%r13, %rdi
	callq	_msb_cache_discard
LBB0_20:
	movl	%r14d, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_14:
	cmpl	$0, 16(%r13)
	jle	LBB0_19
## %bb.15:
	movq	(%r13), %rax
	movq	8(%r13), %rcx
	movq	(%rcx,%rax,8), %r12
	leaq	24(%r13), %r15
	xorl	%ebx, %ebx
	jmp	LBB0_16
	.p2align	4, 0x90
LBB0_18:                                ##   in Loop: Header=BB0_16 Depth=1
	incl	%ebx
	cmpl	16(%r13), %ebx
	jge	LBB0_19
LBB0_16:                                ## =>This Inner Loop Header: Depth=1
	movl	%ebx, %edi
	movq	%r15, %rsi
	callq	_test_bit
	testq	%rax, %rax
	jne	LBB0_18
## %bb.17:                              ##   in Loop: Header=BB0_16 Depth=1
	leaq	L_.str.4(%rip), %rdi
	movl	%ebx, %esi
	callq	_dbg
	movq	_MEMSTICK_OV_PG_NORMAL@GOTPCREL(%rip), %rax
	movzbl	(%rax), %ecx
	xorl	$255, %ecx
	movq	%r13, %rdi
	movq	%r12, %rsi
	movl	%ebx, %edx
	callq	_msb_set_overwrite_flag
	jmp	LBB0_18
	.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	"Flushing the write cache of pba %d (LBA %d)"

L_.str.1:                               ## @.str.1
	.asciz	"reading non-present sector %d of cache block %d"

	.comm	_EBADMSG,4,2                    ## @EBADMSG
L_.str.2:                               ## @.str.2
	.asciz	"read error on sector %d, contents probably damaged"

	.comm	_MEMSTICK_OV_PG_NORMAL,4,2      ## @MEMSTICK_OV_PG_NORMAL
L_.str.3:                               ## @.str.3
	.asciz	"page %d is marked as bad"

L_.str.4:                               ## @.str.4
	.asciz	"marking page %d as containing damaged data"

	.no_dead_strip	_msb_cache_flush
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function msb_cache_flush
_msb_cache_flush:                       ; @msb_cache_flush
	.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
	ldr	x8, [x0, #40]
	cbz	x8, LBB0_2
; %bb.1:
Lloh0:
	adrp	x8, _EROFS@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EROFS@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w25, w8
	b	LBB0_16
LBB0_2:
	mov	x19, x0
	ldr	x20, [x0]
Lloh3:
	adrp	x8, _MS_BLOCK_INVALID@GOTPAGE
Lloh4:
	ldr	x8, [x8, _MS_BLOCK_INVALID@GOTPAGEOFF]
Lloh5:
	ldr	x8, [x8]
	cmp	x20, x8
	b.ne	LBB0_4
; %bb.3:
	mov	w25, #0
	b	LBB0_16
LBB0_4:
	ldr	x8, [x19, #8]
	ldr	x21, [x8, x20, lsl #3]
Lloh6:
	adrp	x0, l_.str@PAGE
Lloh7:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x21
	mov	x2, x20
	bl	_dbg_verbose
	ldp	w2, w1, [x19, #28]
	add	x0, sp, #8
	bl	_sg_init_one
	ldr	w8, [x19, #16]
	cmp	w8, #1
	b.lt	LBB0_14
; %bb.5:
	mov	w22, #0
	add	x23, x19, #24
Lloh8:
	adrp	x24, l_.str.1@PAGE
Lloh9:
	add	x24, x24, l_.str.1@PAGEOFF
Lloh10:
	adrp	x28, _EBADMSG@GOTPAGE
Lloh11:
	ldr	x28, [x28, _EBADMSG@GOTPAGEOFF]
Lloh12:
	adrp	x26, l_.str.2@PAGE
Lloh13:
	add	x26, x26, l_.str.2@PAGEOFF
Lloh14:
	adrp	x27, _MEMSTICK_OV_PG_NORMAL@GOTPAGE
Lloh15:
	ldr	x27, [x27, _MEMSTICK_OV_PG_NORMAL@GOTPAGEOFF]
	b	LBB0_8
LBB0_6:                                 ;   in Loop: Header=BB0_8 Depth=1
	mov	x0, x26
	mov	x1, x22
	bl	_pr_err
LBB0_7:                                 ;   in Loop: Header=BB0_8 Depth=1
	add	w22, w22, #1
	ldr	w8, [x19, #16]
	cmp	w22, w8
	b.ge	LBB0_14
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x22
	mov	x1, x23
	bl	_test_bit
	cbnz	x0, LBB0_7
; %bb.9:                                ;   in Loop: Header=BB0_8 Depth=1
	ldr	w8, [x19, #20]
	mul	w25, w8, w22
	mov	x0, x24
	mov	x1, x22
	mov	x2, x20
	bl	_dbg_verbose
	mov	x3, sp
	add	x4, sp, #8
	mov	x0, x19
	mov	x1, x21
	mov	x2, x22
	mov	x5, x25
	bl	_msb_read_page
	ldr	w8, [x28]
	cmn	w0, w8
	b.eq	LBB0_6
; %bb.10:                               ;   in Loop: Header=BB0_8 Depth=1
	mov	x25, x0
	cbnz	w0, LBB0_16
; %bb.11:                               ;   in Loop: Header=BB0_8 Depth=1
	ldr	w8, [sp]
	ldr	w9, [x27]
	bics	wzr, w9, w8
	b.ne	LBB0_13
; %bb.12:                               ;   in Loop: Header=BB0_8 Depth=1
	mov	x0, x22
	mov	x1, x23
	bl	_set_bit
	b	LBB0_7
LBB0_13:                                ;   in Loop: Header=BB0_8 Depth=1
Lloh16:
	adrp	x0, l_.str.3@PAGE
Lloh17:
	add	x0, x0, l_.str.3@PAGEOFF
	mov	x1, x22
	bl	_dbg
	b	LBB0_7
LBB0_14:
	ldr	x1, [x19]
	add	x2, sp, #8
	mov	x0, x19
	mov	w3, #0
	bl	_msb_update_block
	mov	x25, x0
	cbz	w0, LBB0_17
LBB0_15:
	mov	x0, x19
	bl	_msb_cache_discard
LBB0_16:
	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_17:
	ldr	w8, [x19, #16]
	cmp	w8, #1
	b.lt	LBB0_15
; %bb.18:
	mov	w20, #0
	ldp	x9, x8, [x19]
	ldr	x21, [x8, x9, lsl #3]
	add	x22, x19, #24
Lloh18:
	adrp	x23, l_.str.4@PAGE
Lloh19:
	add	x23, x23, l_.str.4@PAGEOFF
Lloh20:
	adrp	x24, _MEMSTICK_OV_PG_NORMAL@GOTPAGE
Lloh21:
	ldr	x24, [x24, _MEMSTICK_OV_PG_NORMAL@GOTPAGEOFF]
	b	LBB0_20
LBB0_19:                                ;   in Loop: Header=BB0_20 Depth=1
	add	w20, w20, #1
	ldr	w8, [x19, #16]
	cmp	w20, w8
	b.ge	LBB0_15
LBB0_20:                                ; =>This Inner Loop Header: Depth=1
	mov	x0, x20
	mov	x1, x22
	bl	_test_bit
	cbnz	x0, LBB0_19
; %bb.21:                               ;   in Loop: Header=BB0_20 Depth=1
	mov	x0, x23
	mov	x1, x20
	bl	_dbg
	ldrb	w8, [x24]
	eor	w3, w8, #0xff
	mov	x0, x19
	mov	x1, x21
	mov	x2, x20
	bl	_msb_set_overwrite_flag
	b	LBB0_19
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpAdd	Lloh18, Lloh19
	.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	"Flushing the write cache of pba %d (LBA %d)"

l_.str.1:                               ; @.str.1
	.asciz	"reading non-present sector %d of cache block %d"

	.comm	_EBADMSG,4,2                    ; @EBADMSG
l_.str.2:                               ; @.str.2
	.asciz	"read error on sector %d, contents probably damaged"

	.comm	_MEMSTICK_OV_PG_NORMAL,4,2      ; @MEMSTICK_OV_PG_NORMAL
l_.str.3:                               ; @.str.3
	.asciz	"page %d is marked as bad"

l_.str.4:                               ; @.str.4
	.asciz	"marking page %d as containing damaged data"

	.no_dead_strip	_msb_cache_flush
.subsections_via_symbols
