	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sm_read_sector
_sm_read_sector:                        ## @sm_read_sector
	.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	$104, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%r8, %rbx
	movl	%ecx, -48(%rbp)                 ## 4-byte Spill
	movl	%edx, -44(%rbp)                 ## 4-byte Spill
	cmpl	$-1, %edx
	je	LBB0_3
## %bb.1:
	movl	%esi, %r12d
	movq	16(%rdi), %rcx
	movq	_EIO@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	testq	%r9, %r9
	leaq	-80(%rbp), %rdx
	cmovneq	%r9, %rdx
	movq	%rdx, -56(%rbp)                 ## 8-byte Spill
	cmpq	$0, 8(%rdi)
	jne	LBB0_4
## %bb.2:
	movq	_MTD_OPS_PLACE_OOB@GOTPCREL(%rip), %rdx
	jmp	LBB0_5
LBB0_3:
	movq	_SM_SECTOR_SIZE@GOTPCREL(%rip), %rax
	movq	(%rax), %rdx
	movq	%rbx, %rdi
	movl	$255, %esi
	callq	_memset
	xorl	%r15d, %r15d
	jmp	LBB0_27
LBB0_4:
	movq	_MTD_OPS_RAW@GOTPCREL(%rip), %rdx
LBB0_5:
	movq	%rdi, -64(%rbp)                 ## 8-byte Spill
	movq	(%rcx), %rcx
	movq	%rcx, -72(%rbp)                 ## 8-byte Spill
	subl	(%rax), %r14d
	movl	(%rdx), %eax
	movl	%eax, -88(%rbp)
	movq	$0, -96(%rbp)
	movq	_SM_OOB_SIZE@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -104(%rbp)
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	%rax, -112(%rbp)
	movq	_SM_SECTOR_SIZE@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -120(%rbp)
	movq	%rbx, -128(%rbp)
	movl	$2, %r13d
	cmpl	$2, %r13d
	je	LBB0_14
	.p2align	4, 0x90
LBB0_6:
	testl	%r12d, %r12d
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	jne	LBB0_12
## %bb.7:
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	cmpl	%eax, (%rdi)
	jne	LBB0_12
## %bb.8:
	movl	-48(%rbp), %eax                 ## 4-byte Reload
	cmpl	%eax, 4(%rdi)
	je	LBB0_26
	.p2align	4, 0x90
LBB0_12:
	testl	%r13d, %r13d
	je	LBB0_26
## %bb.13:
	callq	_sm_recheck_media
	movl	%r14d, %r15d
	testq	%rax, %rax
	jne	LBB0_27
LBB0_14:                                ## =>This Inner Loop Header: Depth=1
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	movl	%r12d, %esi
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	movl	-48(%rbp), %ecx                 ## 4-byte Reload
	callq	_sm_mkoffset
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	movl	%eax, %esi
	leaq	-144(%rbp), %rdx
	callq	_mtd_read_oob
	movl	%eax, %r14d
	testl	%eax, %eax
	je	LBB0_16
## %bb.15:                              ##   in Loop: Header=BB0_14 Depth=1
	movl	%r14d, %edi
	callq	_mtd_is_bitflip_or_eccerr
	testl	%eax, %eax
	je	LBB0_23
LBB0_16:                                ##   in Loop: Header=BB0_14 Depth=1
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %edi
	cmpl	$-1, %edi
	je	LBB0_18
## %bb.17:                              ##   in Loop: Header=BB0_14 Depth=1
	notl	%edi
	callq	_is_power_of_2
	testl	%eax, %eax
	je	LBB0_24
LBB0_18:                                ##   in Loop: Header=BB0_14 Depth=1
	testq	%rbx, %rbx
	movq	%rbx, %r15
	setne	%bl
	movq	-144(%rbp), %rax
	xorl	%edi, %edi
	movq	_SM_OOB_SIZE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	setne	%dil
	callq	_WARN_ON
	movq	-136(%rbp), %rax
	movq	_SM_SECTOR_SIZE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	setne	%al
	andb	%bl, %al
	movq	%r15, %rbx
	movzbl	%al, %edi
	callq	_WARN_ON
	xorl	%r15d, %r15d
	testq	%rbx, %rbx
	je	LBB0_27
## %bb.19:                              ##   in Loop: Header=BB0_14 Depth=1
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_sm_sector_valid
	testl	%eax, %eax
	je	LBB0_25
## %bb.20:                              ##   in Loop: Header=BB0_14 Depth=1
	movl	%r14d, %edi
	callq	_mtd_is_eccerr
	testq	%rax, %rax
	jne	LBB0_10
## %bb.21:                              ##   in Loop: Header=BB0_14 Depth=1
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	cmpq	$0, 8(%rax)
	je	LBB0_27
## %bb.22:                              ##   in Loop: Header=BB0_14 Depth=1
	movq	%rbx, %rdi
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	callq	_sm_correct_sector
	testq	%rax, %rax
	je	LBB0_27
LBB0_10:                                ##   in Loop: Header=BB0_14 Depth=1
	leaq	L_.str.2(%rip), %rdi
	jmp	LBB0_11
	.p2align	4, 0x90
LBB0_23:                                ##   in Loop: Header=BB0_14 Depth=1
	leaq	L_.str(%rip), %rdi
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	movl	%r12d, %edx
	movl	%r14d, %ecx
	xorl	%eax, %eax
	callq	_dbg
	jmp	LBB0_24
	.p2align	4, 0x90
LBB0_25:                                ##   in Loop: Header=BB0_14 Depth=1
	leaq	L_.str.1(%rip), %rdi
LBB0_11:                                ##   in Loop: Header=BB0_14 Depth=1
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	movl	%r12d, %edx
	xorl	%eax, %eax
	callq	_dbg
LBB0_24:                                ##   in Loop: Header=BB0_14 Depth=1
	decl	%r13d
	cmpl	$2, %r13d
	jne	LBB0_6
	jmp	LBB0_14
LBB0_26:
	movl	%r14d, %r15d
LBB0_27:
	movl	%r15d, %eax
	addq	$104, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EIO,4,2                        ## @EIO
	.comm	_SM_SECTOR_SIZE,8,3             ## @SM_SECTOR_SIZE
	.comm	_MTD_OPS_RAW,4,2                ## @MTD_OPS_RAW
	.comm	_MTD_OPS_PLACE_OOB,4,2          ## @MTD_OPS_PLACE_OOB
	.comm	_SM_OOB_SIZE,8,3                ## @SM_OOB_SIZE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"read of block %d at zone %d, failed due to error (%d)"

L_.str.1:                               ## @.str.1
	.asciz	"read of block %d at zone %d, failed because it is marked as bad"

L_.str.2:                               ## @.str.2
	.asciz	"read of block %d at zone %d, failed due to ECC error"

	.no_dead_strip	_sm_read_sector
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sm_read_sector
_sm_read_sector:                        ; @sm_read_sector
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #176
	.cfi_def_cfa_offset 176
	stp	x28, x27, [sp, #80]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #96]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #112]            ; 16-byte Folded Spill
	stp	x22, x21, [sp, #128]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #144]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #160]            ; 16-byte Folded Spill
	add	x29, sp, #160
	.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	x19, x4
	cmn	w2, #1
	b.eq	LBB0_22
; %bb.1:
	mov	x20, x3
	mov	x21, x2
	mov	x22, x1
	mov	x23, x0
	ldp	x9, x8, [x0, #8]
	ldr	x24, [x8]
Lloh0:
	adrp	x8, _EIO@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w25, w8
	add	x8, sp, #8
	cmp	x5, #0
	csel	x26, x8, x5, eq
Lloh3:
	adrp	x8, _MTD_OPS_RAW@GOTPAGE
Lloh4:
	ldr	x8, [x8, _MTD_OPS_RAW@GOTPAGEOFF]
Lloh5:
	adrp	x10, _MTD_OPS_PLACE_OOB@GOTPAGE
Lloh6:
	ldr	x10, [x10, _MTD_OPS_PLACE_OOB@GOTPAGEOFF]
	cmp	x9, #0
	csel	x8, x10, x8, eq
	ldr	w8, [x8]
	str	w8, [sp, #72]
	str	xzr, [sp, #64]
Lloh7:
	adrp	x8, _SM_OOB_SIZE@GOTPAGE
Lloh8:
	ldr	x8, [x8, _SM_OOB_SIZE@GOTPAGEOFF]
Lloh9:
	ldr	x8, [x8]
	stp	x26, x8, [sp, #48]
Lloh10:
	adrp	x28, _SM_SECTOR_SIZE@GOTPAGE
Lloh11:
	ldr	x28, [x28, _SM_SECTOR_SIZE@GOTPAGEOFF]
	ldr	x8, [x28]
	stp	x19, x8, [sp, #32]
	mov	w27, #2
	b	LBB0_5
LBB0_2:                                 ;   in Loop: Header=BB0_5 Depth=1
Lloh12:
	adrp	x0, l_.str.2@PAGE
Lloh13:
	add	x0, x0, l_.str.2@PAGEOFF
LBB0_3:                                 ;   in Loop: Header=BB0_5 Depth=1
	mov	x1, x21
	mov	x2, x22
	bl	_dbg
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=1
	sub	w27, w27, #1
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	cmp	w27, #2
	b.eq	LBB0_11
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	cbnz	w22, LBB0_9
; %bb.7:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	w8, [x23]
	cmp	w8, w21
	b.ne	LBB0_9
; %bb.8:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	w8, [x23, #4]
	cmp	w8, w20
	ccmp	w27, #0, #4, ne
	b.ne	LBB0_10
	b	LBB0_24
LBB0_9:                                 ;   in Loop: Header=BB0_5 Depth=1
	cbz	w27, LBB0_24
LBB0_10:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	x0, x23
	bl	_sm_recheck_media
	cbnz	x0, LBB0_24
LBB0_11:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	x0, x23
	mov	x1, x22
	mov	x2, x21
	mov	x3, x20
	bl	_sm_mkoffset
	mov	x1, x0
	add	x2, sp, #16
	mov	x0, x24
	bl	_mtd_read_oob
	mov	x25, x0
	cbz	w0, LBB0_13
; %bb.12:                               ;   in Loop: Header=BB0_5 Depth=1
	mov	x0, x25
	bl	_mtd_is_bitflip_or_eccerr
	cbz	w0, LBB0_20
LBB0_13:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	w8, [x26]
	cmn	w8, #1
	b.eq	LBB0_15
; %bb.14:                               ;   in Loop: Header=BB0_5 Depth=1
	mvn	w0, w8
	bl	_is_power_of_2
	cbz	w0, LBB0_4
LBB0_15:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	x8, [sp, #16]
Lloh14:
	adrp	x9, _SM_OOB_SIZE@GOTPAGE
Lloh15:
	ldr	x9, [x9, _SM_OOB_SIZE@GOTPAGEOFF]
Lloh16:
	ldr	x9, [x9]
	cmp	x8, x9
	cset	w0, ne
	bl	_WARN_ON
	cmp	x19, #0
	ldr	x8, [sp, #24]
	ldr	x9, [x28]
	ccmp	x8, x9, #4, ne
	cset	w0, ne
	bl	_WARN_ON
	cbz	x19, LBB0_23
; %bb.16:                               ;   in Loop: Header=BB0_5 Depth=1
	mov	x0, x26
	bl	_sm_sector_valid
	cbz	w0, LBB0_21
; %bb.17:                               ;   in Loop: Header=BB0_5 Depth=1
	mov	x0, x25
	bl	_mtd_is_eccerr
	cbnz	x0, LBB0_2
; %bb.18:                               ;   in Loop: Header=BB0_5 Depth=1
	ldr	x8, [x23, #8]
	cbz	x8, LBB0_23
; %bb.19:                               ;   in Loop: Header=BB0_5 Depth=1
	mov	x0, x19
	mov	x1, x26
	bl	_sm_correct_sector
	cbnz	x0, LBB0_2
	b	LBB0_23
LBB0_20:                                ;   in Loop: Header=BB0_5 Depth=1
	str	x25, [sp]
Lloh17:
	adrp	x0, l_.str@PAGE
Lloh18:
	add	x0, x0, l_.str@PAGEOFF
	b	LBB0_3
LBB0_21:                                ;   in Loop: Header=BB0_5 Depth=1
Lloh19:
	adrp	x0, l_.str.1@PAGE
Lloh20:
	add	x0, x0, l_.str.1@PAGEOFF
	b	LBB0_3
LBB0_22:
Lloh21:
	adrp	x8, _SM_SECTOR_SIZE@GOTPAGE
Lloh22:
	ldr	x8, [x8, _SM_SECTOR_SIZE@GOTPAGEOFF]
Lloh23:
	ldr	x2, [x8]
	mov	x0, x19
	mov	w1, #255
	bl	_memset
LBB0_23:
	mov	w25, #0
LBB0_24:
	mov	x0, x25
	ldp	x29, x30, [sp, #160]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #144]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #128]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #112]            ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #96]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #80]             ; 16-byte Folded Reload
	add	sp, sp, #176
	ret
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.comm	_EIO,4,2                        ; @EIO
	.comm	_SM_SECTOR_SIZE,8,3             ; @SM_SECTOR_SIZE
	.comm	_MTD_OPS_RAW,4,2                ; @MTD_OPS_RAW
	.comm	_MTD_OPS_PLACE_OOB,4,2          ; @MTD_OPS_PLACE_OOB
	.comm	_SM_OOB_SIZE,8,3                ; @SM_OOB_SIZE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"read of block %d at zone %d, failed due to error (%d)"

l_.str.1:                               ; @.str.1
	.asciz	"read of block %d at zone %d, failed because it is marked as bad"

l_.str.2:                               ; @.str.2
	.asciz	"read of block %d at zone %d, failed due to ECC error"

	.no_dead_strip	_sm_read_sector
.subsections_via_symbols
