	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mtdsplit_parse_seama
_mtdsplit_parse_seama:                  ## @mtdsplit_parse_seama
	.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	%r12
	pushq	%rbx
	subq	$32, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movq	%rdi, %rbx
	leaq	-64(%rbp), %rcx
	leaq	-48(%rbp), %r8
	movl	$12, %edx
	xorl	%esi, %esi
	callq	_mtd_read
	testl	%eax, %eax
	jne	LBB0_16
## %bb.1:
	cmpq	$12, -64(%rbp)
	jne	LBB0_2
## %bb.4:
	movl	-40(%rbp), %edi
	callq	_be32_to_cpu
	movq	_SEAMA_MAGIC@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_5
## %bb.6:
	movl	-44(%rbp), %edi
	callq	_be32_to_cpu
	movq	%rax, %r15
	movl	-48(%rbp), %edi
	callq	_be16_to_cpu
	cltq
	addq	%rax, %r15
	addq	$12, %r15
	cmpq	(%rbx), %r15
	jbe	LBB0_7
LBB0_5:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	jmp	LBB0_3
LBB0_2:
	movq	_EIO@GOTPCREL(%rip), %rcx
LBB0_3:
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_16:
	addq	$32, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	leaq	-36(%rbp), %rdx
	movq	%rbx, %rdi
	movq	%r15, %rsi
	callq	_mtd_check_rootfs_magic
	testl	%eax, %eax
	je	LBB0_8
## %bb.9:
	movq	_SEAMA_MIN_ROOTFS_OFFS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	(%rbx), %rdx
	leaq	-56(%rbp), %rcx
	leaq	-36(%rbp), %r8
	movq	%rbx, %rdi
	callq	_mtd_find_rootfs_from
	testl	%eax, %eax
	jne	LBB0_16
	jmp	LBB0_10
LBB0_8:
	movq	%r15, -56(%rbp)
LBB0_10:
	movq	_SEAMA_NR_PARTS@GOTPCREL(%rip), %r12
	movl	(%r12), %eax
	shll	$3, %eax
	leal	(%rax,%rax,2), %edi
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_11
## %bb.12:
	movq	%rax, %r15
	movq	_KERNEL_PART_NAME@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 16(%r15)
	movl	-48(%rbp), %edi
	callq	_be16_to_cpu
	addl	$12, %eax
	movl	%eax, (%r15)
	movq	-56(%rbp), %rcx
	cltq
	movq	%rcx, %rdx
	subq	%rax, %rdx
	movq	%rdx, 8(%r15)
	movl	-36(%rbp), %eax
	movq	_MTDSPLIT_PART_TYPE_UBI@GOTPCREL(%rip), %rdx
	cmpl	(%rdx), %eax
	jne	LBB0_13
## %bb.14:
	movq	_UBI_PART_NAME@GOTPCREL(%rip), %rax
	jmp	LBB0_15
LBB0_11:
	movq	_ENOMEM@GOTPCREL(%rip), %rcx
	jmp	LBB0_3
LBB0_13:
	movq	_ROOTFS_PART_NAME@GOTPCREL(%rip), %rax
LBB0_15:
	movl	(%rax), %eax
	movl	%eax, 40(%r15)
	movl	%ecx, 24(%r15)
	movq	(%rbx), %rax
	subq	%rcx, %rax
	movq	%rax, 32(%r15)
	movq	%r15, (%r14)
	movl	(%r12), %eax
	jmp	LBB0_16
	.cfi_endproc
                                        ## -- End function
	.comm	_EIO,4,2                        ## @EIO
	.comm	_SEAMA_MAGIC,8,3                ## @SEAMA_MAGIC
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_SEAMA_MIN_ROOTFS_OFFS,4,2      ## @SEAMA_MIN_ROOTFS_OFFS
	.comm	_SEAMA_NR_PARTS,4,2             ## @SEAMA_NR_PARTS
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_KERNEL_PART_NAME,4,2           ## @KERNEL_PART_NAME
	.comm	_MTDSPLIT_PART_TYPE_UBI,4,2     ## @MTDSPLIT_PART_TYPE_UBI
	.comm	_UBI_PART_NAME,4,2              ## @UBI_PART_NAME
	.comm	_ROOTFS_PART_NAME,4,2           ## @ROOTFS_PART_NAME
	.no_dead_strip	_mtdsplit_parse_seama
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mtdsplit_parse_seama
_mtdsplit_parse_seama:                  ; @mtdsplit_parse_seama
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	mov	x19, x1
	mov	x20, x0
	add	x3, sp, #24
	add	x4, sp, #32
	mov	w1, #0
	mov	w2, #12
	bl	_mtd_read
	cbnz	w0, LBB0_7
; %bb.1:
	ldr	x8, [sp, #24]
	cmp	x8, #12
	b.ne	LBB0_5
; %bb.2:
	ldr	w0, [sp, #40]
	bl	_be32_to_cpu
Lloh0:
	adrp	x8, _SEAMA_MAGIC@GOTPAGE
Lloh1:
	ldr	x8, [x8, _SEAMA_MAGIC@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cmp	x0, x8
	b.ne	LBB0_4
; %bb.3:
	ldr	w0, [sp, #36]
	bl	_be32_to_cpu
	mov	x21, x0
	ldr	w0, [sp, #32]
	bl	_be16_to_cpu
	add	x8, x21, w0, sxtw
	add	x21, x8, #12
	ldr	x8, [x20]
	cmp	x21, x8
	b.ls	LBB0_8
LBB0_4:
Lloh3:
	adrp	x8, _EINVAL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_6
LBB0_5:
Lloh5:
	adrp	x8, _EIO@GOTPAGE
Lloh6:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
LBB0_6:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_7:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
LBB0_8:
	add	x2, sp, #12
	mov	x0, x20
	mov	x1, x21
	bl	_mtd_check_rootfs_magic
	cbz	w0, LBB0_10
; %bb.9:
Lloh7:
	adrp	x8, _SEAMA_MIN_ROOTFS_OFFS@GOTPAGE
Lloh8:
	ldr	x8, [x8, _SEAMA_MIN_ROOTFS_OFFS@GOTPAGEOFF]
Lloh9:
	ldr	w1, [x8]
	ldr	x2, [x20]
	add	x3, sp, #16
	add	x4, sp, #12
	mov	x0, x20
	bl	_mtd_find_rootfs_from
	cbnz	w0, LBB0_7
	b	LBB0_11
LBB0_10:
	str	x21, [sp, #16]
LBB0_11:
Lloh10:
	adrp	x22, _SEAMA_NR_PARTS@GOTPAGE
Lloh11:
	ldr	x22, [x22, _SEAMA_NR_PARTS@GOTPAGEOFF]
	ldr	w8, [x22]
	add	w8, w8, w8, lsl #1
	lsl	w0, w8, #3
Lloh12:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh13:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh14:
	ldr	w1, [x8]
	bl	_kzalloc
	cbz	x0, LBB0_13
; %bb.12:
	mov	x21, x0
Lloh15:
	adrp	x8, _KERNEL_PART_NAME@GOTPAGE
Lloh16:
	ldr	x8, [x8, _KERNEL_PART_NAME@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	str	w8, [x0, #16]
	ldr	w0, [sp, #32]
	bl	_be16_to_cpu
	add	w8, w0, #12
	str	w8, [x21]
	ldr	x9, [sp, #16]
	sub	x8, x9, w8, sxtw
	str	x8, [x21, #8]
	ldr	w8, [sp, #12]
Lloh18:
	adrp	x10, _MTDSPLIT_PART_TYPE_UBI@GOTPAGE
Lloh19:
	ldr	x10, [x10, _MTDSPLIT_PART_TYPE_UBI@GOTPAGEOFF]
Lloh20:
	ldr	w10, [x10]
Lloh21:
	adrp	x11, _UBI_PART_NAME@GOTPAGE
Lloh22:
	ldr	x11, [x11, _UBI_PART_NAME@GOTPAGEOFF]
Lloh23:
	adrp	x12, _ROOTFS_PART_NAME@GOTPAGE
Lloh24:
	ldr	x12, [x12, _ROOTFS_PART_NAME@GOTPAGEOFF]
	cmp	w8, w10
	csel	x8, x11, x12, eq
	ldr	w8, [x8]
	str	w8, [x21, #40]
	str	w9, [x21, #24]
	ldr	x8, [x20]
	sub	x8, x8, x9
	str	x8, [x21, #32]
	str	x21, [x19]
	ldr	w0, [x22]
	b	LBB0_7
LBB0_13:
Lloh25:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh26:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
	b	LBB0_6
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh23, Lloh24
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh25, Lloh26
	.cfi_endproc
                                        ; -- End function
	.comm	_EIO,4,2                        ; @EIO
	.comm	_SEAMA_MAGIC,8,3                ; @SEAMA_MAGIC
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_SEAMA_MIN_ROOTFS_OFFS,4,2      ; @SEAMA_MIN_ROOTFS_OFFS
	.comm	_SEAMA_NR_PARTS,4,2             ; @SEAMA_NR_PARTS
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_KERNEL_PART_NAME,4,2           ; @KERNEL_PART_NAME
	.comm	_MTDSPLIT_PART_TYPE_UBI,4,2     ; @MTDSPLIT_PART_TYPE_UBI
	.comm	_UBI_PART_NAME,4,2              ; @UBI_PART_NAME
	.comm	_ROOTFS_PART_NAME,4,2           ; @ROOTFS_PART_NAME
	.no_dead_strip	_mtdsplit_parse_seama
.subsections_via_symbols
