	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sharpsl_nand_read_laddr
_sharpsl_nand_read_laddr:               ## @sharpsl_nand_read_laddr
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%r8, %r15
	movq	%rcx, -48(%rbp)                 ## 8-byte Spill
	movq	%rdx, %r12
	movq	%rdi, %r13
	movslq	%esi, %rbx
	movq	%rbx, %rdi
	movq	%r13, %rsi
	callq	_mtd_div_by_eb
	movl	%eax, %r14d
	leaq	-1(%r12), %rax
	leaq	(%rax,%rbx), %rdi
	movq	%r13, %rsi
	callq	_mtd_div_by_eb
	cmpq	$1, %r12
	jae	LBB0_1
LBB0_3:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_10:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_1:
	cmpl	(%r15), %r14d
	jae	LBB0_3
## %bb.2:
	cmpl	%r14d, %eax
	ja	LBB0_3
## %bb.4:
	movq	8(%r15), %rax
	movl	%r14d, %ecx
	movl	(%r13), %r14d
	imull	(%rax,%rcx,4), %r14d
	movq	%rbx, %rdi
	movq	%r13, %rsi
	callq	_mtd_mod_by_eb
	movl	%eax, %r15d
	addl	%r14d, %r15d
	leaq	-56(%rbp), %rcx
	movq	%r13, %rdi
	movl	%r15d, %esi
	movq	%r12, %rdx
	movq	-48(%rbp), %r8                  ## 8-byte Reload
	callq	_mtd_read
	movl	%eax, %ebx
	movl	%eax, %edi
	callq	_mtd_is_bitflip
	testl	%ebx, %ebx
	je	LBB0_6
## %bb.5:
	testq	%rax, %rax
	je	LBB0_9
LBB0_6:
	xorl	%ebx, %ebx
	cmpq	%r12, -56(%rbp)
	je	LBB0_10
## %bb.7:
	movq	_EIO@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, %eax
	je	LBB0_10
## %bb.8:
	negl	%eax
	movl	%eax, %ebx
LBB0_9:
	leaq	L_.str(%rip), %rdi
	movl	%r15d, %esi
	callq	_pr_err
	jmp	LBB0_10
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_EIO,4,2                        ## @EIO
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"sharpslpart: error, read failed at %#llx\n"

	.no_dead_strip	_sharpsl_nand_read_laddr
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sharpsl_nand_read_laddr
_sharpsl_nand_read_laddr:               ; @sharpsl_nand_read_laddr
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x22, x4
	mov	x20, x3
	mov	x19, x2
                                        ; kill: def $w1 killed $w1 def $x1
	mov	x21, x0
	sxtw	x23, w1
	mov	x0, x23
	mov	x1, x21
	bl	_mtd_div_by_eb
	mov	x24, x0
	add	x8, x19, x23
	sub	x0, x8, #1
	mov	x1, x21
	bl	_mtd_div_by_eb
	cbz	x19, LBB0_2
; %bb.1:
	ldr	w8, [x22]
	cmp	w24, w8
	ccmp	w0, w24, #2, lo
	b.ls	LBB0_3
LBB0_2:
Lloh0:
	adrp	x8, _EINVAL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w20, w8
	b	LBB0_9
LBB0_3:
	ldr	x8, [x22, #8]
	ldr	w22, [x8, w24, uxtw #2]
	ldr	w24, [x21]
	mov	x0, x23
	mov	x1, x21
	bl	_mtd_mod_by_eb
	madd	w22, w24, w22, w0
	add	x3, sp, #8
	mov	x0, x21
	mov	x1, x22
	mov	x2, x19
	mov	x4, x20
	bl	_mtd_read
	mov	x20, x0
	bl	_mtd_is_bitflip
	cmp	w20, #0
	ccmp	x0, #0, #0, ne
	b.eq	LBB0_7
; %bb.4:
	ldr	x8, [sp, #8]
	cmp	x8, x19
	b.eq	LBB0_8
; %bb.5:
Lloh3:
	adrp	x8, _EIO@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	cbz	w8, LBB0_8
; %bb.6:
	neg	w20, w8
LBB0_7:
Lloh6:
	adrp	x0, l_.str@PAGE
Lloh7:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x22
	bl	_pr_err
	b	LBB0_9
LBB0_8:
	mov	w20, #0
LBB0_9:
	mov	x0, x20
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_EIO,4,2                        ; @EIO
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"sharpslpart: error, read failed at %#llx\n"

	.no_dead_strip	_sharpsl_nand_read_laddr
.subsections_via_symbols
