	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sharpsl_parse_mtd_partitions
_sharpsl_parse_mtd_partitions:          ## @sharpsl_parse_mtd_partitions
	.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	%rsi, -64(%rbp)                 ## 8-byte Spill
	movq	%rdi, %r15
	movq	%rsp, %r14
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	_SHARPSL_NAND_PARTS@GOTPCREL(%rip), %rax
	movl	(%rax), %r13d
	leaq	(,%r13,8), %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %r12
	movq	%r15, %rdi
	callq	_sharpsl_nand_check_ooblayout
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_9
## %bb.1:
	leaq	-56(%rbp), %rsi
	movq	%r15, %rdi
	callq	_sharpsl_nand_init_ftl
	movl	%eax, %ebx
	testl	%eax, %eax
	je	LBB0_2
LBB0_9:
	movq	%r14, %rsp
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_11
## %bb.10:
	movl	%ebx, %eax
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_2:
	leaq	L_.str(%rip), %rdi
	callq	_pr_info
	movq	_SHARPSL_PARTINFO1_LADDR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	shll	$3, %r13d
	leaq	-56(%rbp), %r8
	movq	%r15, %rdi
	movl	%r13d, %edx
	movq	%r12, %rcx
	callq	_sharpsl_nand_read_partinfo
	testl	%eax, %eax
	je	LBB0_3
## %bb.6:
	leaq	L_.str.1(%rip), %rdi
	callq	_pr_warn
	movq	_SHARPSL_PARTINFO2_LADDR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-56(%rbp), %rax
	movq	%r15, %rdi
	movl	%r13d, %edx
	movq	%r12, %rcx
	movq	%rax, %r15
	movq	%rax, %r8
	callq	_sharpsl_nand_read_partinfo
	movl	%eax, %ebx
	movq	%r15, %rdi
	callq	_sharpsl_nand_cleanup_ftl
	testl	%ebx, %ebx
	je	LBB0_4
## %bb.7:
	leaq	L_.str.2(%rip), %rdi
	callq	_pr_err
	jmp	LBB0_9
LBB0_3:
	leaq	-56(%rbp), %rdi
	callq	_sharpsl_nand_cleanup_ftl
LBB0_4:
	movq	_SHARPSL_NAND_PARTS@GOTPCREL(%rip), %r13
	movl	(%r13), %edi
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	$24, %esi
	callq	_kcalloc
	testq	%rax, %rax
	je	LBB0_5
## %bb.8:
	movq	%rax, %r15
	leaq	L_.str.3(%rip), %rax
	movq	%rax, (%r15)
	movl	(%r12), %edi
	callq	_le32_to_cpu
	movq	%rax, 16(%r15)
	movl	4(%r12), %edi
	callq	_le32_to_cpu
	movq	%rax, %rbx
	movl	(%r12), %edi
	callq	_le32_to_cpu
	subq	%rax, %rbx
	movq	%rbx, 8(%r15)
	leaq	L_.str.4(%rip), %rax
	movq	%rax, 24(%r15)
	movl	8(%r12), %edi
	callq	_le32_to_cpu
	movq	%rax, 40(%r15)
	movl	12(%r12), %edi
	callq	_le32_to_cpu
	movq	%rax, %rbx
	movl	8(%r12), %edi
	callq	_le32_to_cpu
	subq	%rax, %rbx
	movq	%rbx, 32(%r15)
	leaq	L_.str.5(%rip), %rax
	movq	%rax, 48(%r15)
	movl	16(%r12), %edi
	callq	_le32_to_cpu
	movq	%rax, 64(%r15)
	movl	20(%r12), %edi
	callq	_le32_to_cpu
	movq	%rax, %rbx
	movl	16(%r12), %edi
	callq	_le32_to_cpu
	subq	%rax, %rbx
	movq	%rbx, 56(%r15)
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movq	%r15, (%rax)
	movl	(%r13), %ebx
	jmp	LBB0_9
LBB0_5:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_9
LBB0_11:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_SHARPSL_NAND_PARTS,4,2         ## @SHARPSL_NAND_PARTS
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"sharpslpart: try reading first partition table\n"

	.comm	_SHARPSL_PARTINFO1_LADDR,4,2    ## @SHARPSL_PARTINFO1_LADDR
L_.str.1:                               ## @.str.1
	.asciz	"sharpslpart: first partition table is invalid, retry using the second\n"

	.comm	_SHARPSL_PARTINFO2_LADDR,4,2    ## @SHARPSL_PARTINFO2_LADDR
L_.str.2:                               ## @.str.2
	.asciz	"sharpslpart: both partition tables are invalid\n"

	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
L_.str.3:                               ## @.str.3
	.asciz	"smf"

L_.str.4:                               ## @.str.4
	.asciz	"root"

L_.str.5:                               ## @.str.5
	.asciz	"home"

	.no_dead_strip	_sharpsl_parse_mtd_partitions
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sharpsl_parse_mtd_partitions
_sharpsl_parse_mtd_partitions:          ; @sharpsl_parse_mtd_partitions
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	sub	sp, sp, #16
	mov	x19, x1
	mov	x21, x0
	mov	x23, sp
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-72]
Lloh3:
	adrp	x24, _SHARPSL_NAND_PARTS@GOTPAGE
Lloh4:
	ldr	x24, [x24, _SHARPSL_NAND_PARTS@GOTPAGEOFF]
	ldr	w25, [x24]
	lsl	x8, x25, #3
	mov	x9, x8
Lloh5:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh6:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x9, sp
	add	x8, x8, #15
	and	x8, x8, #0xffffffff0
	sub	x20, x9, x8
	mov	sp, x20
	bl	_sharpsl_nand_check_ooblayout
	mov	x22, x0
	cbnz	w0, LBB0_2
; %bb.1:
	sub	x1, x29, #80
	mov	x0, x21
	bl	_sharpsl_nand_init_ftl
	mov	x22, x0
	cbz	w0, LBB0_4
LBB0_2:
	mov	sp, x23
	ldur	x8, [x29, #-72]
Lloh7:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh8:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh9:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_11
; %bb.3:
	mov	x0, x22
	sub	sp, x29, #64
	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
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
LBB0_4:
Lloh10:
	adrp	x0, l_.str@PAGE
Lloh11:
	add	x0, x0, l_.str@PAGEOFF
	bl	_pr_info
Lloh12:
	adrp	x8, _SHARPSL_PARTINFO1_LADDR@GOTPAGE
Lloh13:
	ldr	x8, [x8, _SHARPSL_PARTINFO1_LADDR@GOTPAGEOFF]
Lloh14:
	ldr	w1, [x8]
	lsl	w22, w25, #3
	sub	x4, x29, #80
	mov	x0, x21
	mov	x2, x22
	mov	x3, x20
	bl	_sharpsl_nand_read_partinfo
	cbz	w0, LBB0_7
; %bb.5:
Lloh15:
	adrp	x0, l_.str.1@PAGE
Lloh16:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_pr_warn
Lloh17:
	adrp	x8, _SHARPSL_PARTINFO2_LADDR@GOTPAGE
Lloh18:
	ldr	x8, [x8, _SHARPSL_PARTINFO2_LADDR@GOTPAGEOFF]
Lloh19:
	ldr	w1, [x8]
	sub	x4, x29, #80
	mov	x0, x21
	mov	x2, x22
	mov	x3, x20
	bl	_sharpsl_nand_read_partinfo
	mov	x22, x0
	sub	x0, x29, #80
	bl	_sharpsl_nand_cleanup_ftl
	cbz	w22, LBB0_8
; %bb.6:
Lloh20:
	adrp	x0, l_.str.2@PAGE
Lloh21:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_pr_err
	b	LBB0_2
LBB0_7:
	sub	x0, x29, #80
	bl	_sharpsl_nand_cleanup_ftl
LBB0_8:
	ldr	w0, [x24]
Lloh22:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh23:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh24:
	ldr	w2, [x8]
	mov	w1, #24
	bl	_kcalloc
	cbz	x0, LBB0_10
; %bb.9:
	mov	x21, x0
Lloh25:
	adrp	x8, l_.str.3@PAGE
Lloh26:
	add	x8, x8, l_.str.3@PAGEOFF
	str	x8, [x0]
	ldr	w0, [x20]
	bl	_le32_to_cpu
	str	x0, [x21, #16]
	ldr	w0, [x20, #4]
	bl	_le32_to_cpu
	mov	x22, x0
	ldr	w0, [x20]
	bl	_le32_to_cpu
	sub	x8, x22, x0
	str	x8, [x21, #8]
Lloh27:
	adrp	x8, l_.str.4@PAGE
Lloh28:
	add	x8, x8, l_.str.4@PAGEOFF
	str	x8, [x21, #24]
	ldr	w0, [x20, #8]
	bl	_le32_to_cpu
	str	x0, [x21, #40]
	ldr	w0, [x20, #12]
	bl	_le32_to_cpu
	mov	x22, x0
	ldr	w0, [x20, #8]
	bl	_le32_to_cpu
	sub	x8, x22, x0
	str	x8, [x21, #32]
Lloh29:
	adrp	x8, l_.str.5@PAGE
Lloh30:
	add	x8, x8, l_.str.5@PAGEOFF
	str	x8, [x21, #48]
	ldr	w0, [x20, #16]
	bl	_le32_to_cpu
	str	x0, [x21, #64]
	ldr	w0, [x20, #20]
	bl	_le32_to_cpu
	mov	x22, x0
	ldr	w0, [x20, #16]
	bl	_le32_to_cpu
	sub	x8, x22, x0
	str	x8, [x21, #56]
	str	x21, [x19]
	ldr	w22, [x24]
	b	LBB0_2
LBB0_10:
Lloh31:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh32:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh33:
	ldr	w8, [x8]
	neg	w22, w8
	b	LBB0_2
LBB0_11:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpAdd	Lloh29, Lloh30
	.loh AdrpAdd	Lloh27, Lloh28
	.loh AdrpAdd	Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.cfi_endproc
                                        ; -- End function
	.comm	_SHARPSL_NAND_PARTS,4,2         ; @SHARPSL_NAND_PARTS
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"sharpslpart: try reading first partition table\n"

	.comm	_SHARPSL_PARTINFO1_LADDR,4,2    ; @SHARPSL_PARTINFO1_LADDR
l_.str.1:                               ; @.str.1
	.asciz	"sharpslpart: first partition table is invalid, retry using the second\n"

	.comm	_SHARPSL_PARTINFO2_LADDR,4,2    ; @SHARPSL_PARTINFO2_LADDR
l_.str.2:                               ; @.str.2
	.asciz	"sharpslpart: both partition tables are invalid\n"

	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
l_.str.3:                               ; @.str.3
	.asciz	"smf"

l_.str.4:                               ; @.str.4
	.asciz	"root"

l_.str.5:                               ; @.str.5
	.asciz	"home"

	.no_dead_strip	_sharpsl_parse_mtd_partitions
.subsections_via_symbols
