	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mtd_check_rootfs_magic         ## -- Begin function mtd_check_rootfs_magic
	.p2align	4, 0x90
_mtd_check_rootfs_magic:                ## @mtd_check_rootfs_magic
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%rbx
	subq	$24, %rsp
	.cfi_offset %rbx, -24
	movq	%rdx, %rbx
	leaq	-24(%rbp), %rcx
	leaq	-12(%rbp), %r8
	movl	$4, %edx
	callq	_mtd_read
	testl	%eax, %eax
	jne	LBB0_15
## %bb.1:
	cmpq	$4, -24(%rbp)
	jne	LBB0_2
## %bb.3:
	movl	-12(%rbp), %edi
	callq	_le32_to_cpu
	movq	_SQUASHFS_MAGIC@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_7
## %bb.4:
	xorl	%eax, %eax
	testq	%rbx, %rbx
	je	LBB0_15
## %bb.5:
	movq	_MTDSPLIT_PART_TYPE_SQUASHFS@GOTPCREL(%rip), %rcx
	jmp	LBB0_6
LBB0_2:
	movq	_EIO@GOTPCREL(%rip), %rcx
LBB0_14:
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_15
LBB0_7:
	movl	-12(%rbp), %edi
	cmpl	$428154883, %edi                ## imm = 0x19852003
	jne	LBB0_10
## %bb.8:
	xorl	%eax, %eax
	testq	%rbx, %rbx
	je	LBB0_15
## %bb.9:
	movq	_MTDSPLIT_PART_TYPE_JFFS2@GOTPCREL(%rip), %rcx
	jmp	LBB0_6
LBB0_10:
	callq	_be32_to_cpu
	movq	_UBI_EC_MAGIC@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_13
## %bb.11:
	xorl	%eax, %eax
	testq	%rbx, %rbx
	je	LBB0_15
## %bb.12:
	movq	_MTDSPLIT_PART_TYPE_UBI@GOTPCREL(%rip), %rcx
LBB0_6:
	movl	(%rcx), %ecx
	movl	%ecx, (%rbx)
LBB0_15:
	addq	$24, %rsp
	popq	%rbx
	popq	%rbp
	retq
LBB0_13:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	jmp	LBB0_14
	.cfi_endproc
                                        ## -- End function
	.comm	_EIO,4,2                        ## @EIO
	.comm	_SQUASHFS_MAGIC,8,3             ## @SQUASHFS_MAGIC
	.comm	_MTDSPLIT_PART_TYPE_SQUASHFS,4,2 ## @MTDSPLIT_PART_TYPE_SQUASHFS
	.comm	_MTDSPLIT_PART_TYPE_JFFS2,4,2   ## @MTDSPLIT_PART_TYPE_JFFS2
	.comm	_UBI_EC_MAGIC,8,3               ## @UBI_EC_MAGIC
	.comm	_MTDSPLIT_PART_TYPE_UBI,4,2     ## @MTDSPLIT_PART_TYPE_UBI
	.comm	_EINVAL,4,2                     ## @EINVAL
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mtd_check_rootfs_magic         ; -- Begin function mtd_check_rootfs_magic
	.p2align	2
_mtd_check_rootfs_magic:                ; @mtd_check_rootfs_magic
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #48
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x2
	mov	x3, sp
	add	x4, sp, #12
	mov	w2, #4
	bl	_mtd_read
	cbnz	w0, LBB0_14
; %bb.1:
	ldr	x8, [sp]
	cmp	x8, #4
	b.ne	LBB0_5
; %bb.2:
	ldr	w0, [sp, #12]
	bl	_le32_to_cpu
Lloh0:
	adrp	x8, _SQUASHFS_MAGIC@GOTPAGE
Lloh1:
	ldr	x8, [x8, _SQUASHFS_MAGIC@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cmp	x0, x8
	b.ne	LBB0_7
; %bb.3:
	mov	w0, #0
	cbz	x19, LBB0_14
; %bb.4:
Lloh3:
	adrp	x8, _MTDSPLIT_PART_TYPE_SQUASHFS@GOTPAGE
Lloh4:
	ldr	x8, [x8, _MTDSPLIT_PART_TYPE_SQUASHFS@GOTPAGEOFF]
	b	LBB0_13
LBB0_5:
Lloh5:
	adrp	x8, _EIO@GOTPAGE
Lloh6:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
LBB0_6:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_14
LBB0_7:
	ldr	w0, [sp, #12]
	mov	w8, #8195
	movk	w8, #6533, lsl #16
	cmp	w0, w8
	b.ne	LBB0_10
; %bb.8:
	mov	w0, #0
	cbz	x19, LBB0_14
; %bb.9:
Lloh7:
	adrp	x8, _MTDSPLIT_PART_TYPE_JFFS2@GOTPAGE
Lloh8:
	ldr	x8, [x8, _MTDSPLIT_PART_TYPE_JFFS2@GOTPAGEOFF]
	b	LBB0_13
LBB0_10:
	bl	_be32_to_cpu
Lloh9:
	adrp	x8, _UBI_EC_MAGIC@GOTPAGE
Lloh10:
	ldr	x8, [x8, _UBI_EC_MAGIC@GOTPAGEOFF]
Lloh11:
	ldr	x8, [x8]
	cmp	x0, x8
	b.ne	LBB0_15
; %bb.11:
	mov	w0, #0
	cbz	x19, LBB0_14
; %bb.12:
Lloh12:
	adrp	x8, _MTDSPLIT_PART_TYPE_UBI@GOTPAGE
Lloh13:
	ldr	x8, [x8, _MTDSPLIT_PART_TYPE_UBI@GOTPAGEOFF]
LBB0_13:
	ldr	w8, [x8]
	str	w8, [x19]
LBB0_14:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
LBB0_15:
Lloh14:
	adrp	x8, _EINVAL@GOTPAGE
Lloh15:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_6
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.comm	_EIO,4,2                        ; @EIO
	.comm	_SQUASHFS_MAGIC,8,3             ; @SQUASHFS_MAGIC
	.comm	_MTDSPLIT_PART_TYPE_SQUASHFS,4,2 ; @MTDSPLIT_PART_TYPE_SQUASHFS
	.comm	_MTDSPLIT_PART_TYPE_JFFS2,4,2   ; @MTDSPLIT_PART_TYPE_JFFS2
	.comm	_UBI_EC_MAGIC,8,3               ; @UBI_EC_MAGIC
	.comm	_MTDSPLIT_PART_TYPE_UBI,4,2     ; @MTDSPLIT_PART_TYPE_UBI
	.comm	_EINVAL,4,2                     ; @EINVAL
.subsections_via_symbols
