	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mtdsplit_fit_parse
_mtdsplit_fit_parse:                    ## @mtdsplit_fit_parse
	.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
	movq	%rsi, -72(%rbp)                 ## 8-byte Spill
	movq	%rdi, %r15
	xorl	%ebx, %ebx
	leaq	-56(%rbp), %r14
	.p2align	4, 0x90
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	movl	$8, %edx
	movq	%r15, %rdi
	movq	%rbx, %rsi
	leaq	-80(%rbp), %rcx
	movq	%r14, %r8
	callq	_mtd_read
	testl	%eax, %eax
	jne	LBB0_5
## %bb.2:                               ##   in Loop: Header=BB0_1 Depth=1
	cmpq	$8, -80(%rbp)
	jne	LBB0_6
## %bb.3:                               ##   in Loop: Header=BB0_1 Depth=1
	movl	-52(%rbp), %edi
	callq	_be32_to_cpu
	movq	_OF_DT_HEADER@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_7
## %bb.4:                               ##   in Loop: Header=BB0_1 Depth=1
	movl	16(%r15), %esi
	leaq	L_.str.2(%rip), %rdi
	movq	%rbx, %rdx
	callq	_pr_debug
	movq	8(%r15), %rax
	leaq	(%rax,%rbx), %r12
	addq	%rbx, %rax
	addq	$8, %rax
	movq	%r12, %rbx
	cmpq	(%r15), %rax
	jbe	LBB0_1
	jmp	LBB0_8
LBB0_5:
	movl	%eax, %r13d
	movl	16(%r15), %esi
	leaq	L_.str(%rip), %rdi
	movq	%rbx, %rdx
	xorl	%eax, %eax
	callq	_pr_err
	jmp	LBB0_16
LBB0_6:
	movl	16(%r15), %esi
	leaq	L_.str.1(%rip), %rdi
	xorl	%r13d, %r13d
	xorl	%eax, %eax
	callq	_pr_err
	movq	_EIO@GOTPCREL(%rip), %rax
	jmp	LBB0_15
LBB0_7:
	movq	%rbx, %r12
LBB0_8:
	movl	-56(%rbp), %edi
	callq	_be32_to_cpu
	testq	%rax, %rax
	je	LBB0_11
## %bb.9:
	movq	%rax, %rbx
	leaq	(%rax,%r12), %rsi
	movq	(%r15), %rdx
	leaq	-48(%rbp), %rcx
	movq	%r15, %rdi
	xorl	%r8d, %r8d
	callq	_mtd_find_rootfs_from
	testl	%eax, %eax
	je	LBB0_12
## %bb.10:
	movl	%eax, %r13d
	movl	16(%r15), %esi
	leaq	L_.str.4(%rip), %rdi
	callq	_pr_info
	jmp	LBB0_16
LBB0_11:
	movl	16(%r15), %esi
	leaq	L_.str.3(%rip), %rdi
	xorl	%r13d, %r13d
	movq	%r12, %rdx
	xorl	%eax, %eax
	callq	_pr_err
	movq	_ENODEV@GOTPCREL(%rip), %rax
LBB0_15:
	subl	(%rax), %r13d
LBB0_16:
	movl	%r13d, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_12:
	movq	(%r15), %r13
	movq	-48(%rbp), %rax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$48, %edi
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_14
## %bb.13:
	movq	%rax, %r14
	subq	-64(%rbp), %r13                 ## 8-byte Folded Reload
	movq	_KERNEL_PART_NAME@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 16(%r14)
	movq	%r12, (%r14)
	movq	%rbx, %rdi
	movq	%r15, %rsi
	callq	_mtd_rounddown_to_eb
	addq	8(%r15), %rax
	movq	%rax, 8(%r14)
	movq	_ROOTFS_PART_NAME@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 40(%r14)
	movq	-48(%rbp), %rax
	movq	%rax, 24(%r14)
	movq	%r13, 32(%r14)
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	movq	%r14, (%rax)
	movl	$2, %r13d
	jmp	LBB0_16
LBB0_14:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r13d, %r13d
	jmp	LBB0_15
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"read error in \"%s\" at offset 0x%llx\n"

L_.str.1:                               ## @.str.1
	.asciz	"short read in \"%s\"\n"

	.comm	_EIO,4,2                        ## @EIO
	.comm	_OF_DT_HEADER,8,3               ## @OF_DT_HEADER
L_.str.2:                               ## @.str.2
	.asciz	"no valid FIT image found in \"%s\" at offset %llx\n"

L_.str.3:                               ## @.str.3
	.asciz	"FIT image in \"%s\" at offset %llx has null size\n"

	.comm	_ENODEV,4,2                     ## @ENODEV
L_.str.4:                               ## @.str.4
	.asciz	"no rootfs found after FIT image in \"%s\"\n"

	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_KERNEL_PART_NAME,4,2           ## @KERNEL_PART_NAME
	.comm	_ROOTFS_PART_NAME,4,2           ## @ROOTFS_PART_NAME
	.no_dead_strip	_mtdsplit_fit_parse
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mtdsplit_fit_parse
_mtdsplit_fit_parse:                    ; @mtdsplit_fit_parse
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	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
	mov	x19, x1
	mov	x20, x0
	mov	x21, #0
Lloh0:
	adrp	x24, _OF_DT_HEADER@GOTPAGE
Lloh1:
	ldr	x24, [x24, _OF_DT_HEADER@GOTPAGEOFF]
Lloh2:
	adrp	x22, l_.str.2@PAGE
Lloh3:
	add	x22, x22, l_.str.2@PAGEOFF
LBB0_1:                                 ; =>This Inner Loop Header: Depth=1
	add	x3, sp, #16
	add	x4, sp, #24
	mov	x0, x20
	mov	x1, x21
	mov	w2, #8
	bl	_mtd_read
	cbnz	w0, LBB0_8
; %bb.2:                                ;   in Loop: Header=BB0_1 Depth=1
	ldr	x8, [sp, #16]
	cmp	x8, #8
	b.ne	LBB0_9
; %bb.3:                                ;   in Loop: Header=BB0_1 Depth=1
	ldr	w0, [sp, #28]
	bl	_be32_to_cpu
	ldr	x8, [x24]
	cmp	x0, x8
	b.eq	LBB0_5
; %bb.4:                                ;   in Loop: Header=BB0_1 Depth=1
	ldr	w1, [x20, #16]
	mov	x0, x22
	mov	x2, x21
	bl	_pr_debug
	ldp	x9, x8, [x20]
	add	x21, x8, x21
	add	x8, x21, #8
	cmp	x8, x9
	b.ls	LBB0_1
LBB0_5:
	ldr	w0, [sp, #24]
	bl	_be32_to_cpu
	cbz	x0, LBB0_10
; %bb.6:
	mov	x22, x0
	add	x1, x0, x21
	ldr	x2, [x20]
	add	x3, sp, #8
	mov	x0, x20
	mov	x4, #0
	bl	_mtd_find_rootfs_from
	cbz	w0, LBB0_13
; %bb.7:
	mov	x23, x0
	ldr	w1, [x20, #16]
Lloh4:
	adrp	x0, l_.str.4@PAGE
Lloh5:
	add	x0, x0, l_.str.4@PAGEOFF
	bl	_pr_info
	b	LBB0_12
LBB0_8:
	mov	x23, x0
	ldr	w1, [x20, #16]
	str	x21, [sp]
Lloh6:
	adrp	x0, l_.str@PAGE
Lloh7:
	add	x0, x0, l_.str@PAGEOFF
	bl	_pr_err
	b	LBB0_12
LBB0_9:
	ldr	w1, [x20, #16]
Lloh8:
	adrp	x0, l_.str.1@PAGE
Lloh9:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_pr_err
Lloh10:
	adrp	x8, _EIO@GOTPAGE
Lloh11:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
	b	LBB0_11
LBB0_10:
	ldr	w1, [x20, #16]
	str	x21, [sp]
Lloh12:
	adrp	x0, l_.str.3@PAGE
Lloh13:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_pr_err
Lloh14:
	adrp	x8, _ENODEV@GOTPAGE
Lloh15:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
LBB0_11:
	ldr	w8, [x8]
	neg	w23, w8
LBB0_12:
	mov	x0, x23
	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
	add	sp, sp, #112
	ret
LBB0_13:
	ldr	x24, [x20]
	ldr	x25, [sp, #8]
Lloh16:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh17:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh18:
	ldr	w1, [x8]
	mov	w0, #48
	bl	_kzalloc
	cbz	x0, LBB0_15
; %bb.14:
	mov	x23, x0
	sub	x24, x24, x25
Lloh19:
	adrp	x8, _KERNEL_PART_NAME@GOTPAGE
Lloh20:
	ldr	x8, [x8, _KERNEL_PART_NAME@GOTPAGEOFF]
Lloh21:
	ldr	w8, [x8]
	str	w8, [x0, #16]
	str	x21, [x0]
	mov	x0, x22
	mov	x1, x20
	bl	_mtd_rounddown_to_eb
	ldr	x8, [x20, #8]
	add	x8, x8, x0
	str	x8, [x23, #8]
Lloh22:
	adrp	x8, _ROOTFS_PART_NAME@GOTPAGE
Lloh23:
	ldr	x8, [x8, _ROOTFS_PART_NAME@GOTPAGEOFF]
Lloh24:
	ldr	w8, [x8]
	str	w8, [x23, #40]
	ldr	x8, [sp, #8]
	stp	x8, x24, [x23, #24]
	str	x23, [x19]
	mov	w23, #2
	b	LBB0_12
LBB0_15:
Lloh25:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh26:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
	b	LBB0_11
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh25, Lloh26
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"read error in \"%s\" at offset 0x%llx\n"

l_.str.1:                               ; @.str.1
	.asciz	"short read in \"%s\"\n"

	.comm	_EIO,4,2                        ; @EIO
	.comm	_OF_DT_HEADER,8,3               ; @OF_DT_HEADER
l_.str.2:                               ; @.str.2
	.asciz	"no valid FIT image found in \"%s\" at offset %llx\n"

l_.str.3:                               ; @.str.3
	.asciz	"FIT image in \"%s\" at offset %llx has null size\n"

	.comm	_ENODEV,4,2                     ; @ENODEV
l_.str.4:                               ; @.str.4
	.asciz	"no rootfs found after FIT image in \"%s\"\n"

	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_KERNEL_PART_NAME,4,2           ; @KERNEL_PART_NAME
	.comm	_ROOTFS_PART_NAME,4,2           ; @ROOTFS_PART_NAME
	.no_dead_strip	_mtdsplit_fit_parse
.subsections_via_symbols
