	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mtdsplit_parse_wrgg
_mtdsplit_parse_wrgg:                   ## @mtdsplit_parse_wrgg
	.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	%rbx
	subq	$40, %rsp
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movq	%rdi, %rbx
	leaq	-48(%rbp), %rcx
	leaq	-32(%rbp), %r8
	movl	$8, %edx
	xorl	%esi, %esi
	callq	_mtd_read
	testl	%eax, %eax
	jne	LBB0_16
## %bb.1:
	cmpq	$8, -48(%rbp)
	jne	LBB0_2
## %bb.4:
	movl	-32(%rbp), %edi
	callq	_le32_to_cpu
	movq	_WRGG03_MAGIC@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jne	LBB0_9
## %bb.5:
	movl	-28(%rbp), %edi
	callq	_be32_to_cpu
	addq	$8, %rax
	movq	(%rbx), %rdx
	cmpq	%rdx, %rax
	jbe	LBB0_7
## %bb.6:
	movl	-28(%rbp), %edi
	callq	_le32_to_cpu
	cltq
	addq	$8, %rax
	movq	(%rbx), %rdx
LBB0_7:
	cmpq	%rdx, %rax
	ja	LBB0_8
## %bb.11:
	cmpq	%rdx, %rax
	ja	LBB0_8
	jmp	LBB0_12
LBB0_2:
	movq	_EIO@GOTPCREL(%rip), %rcx
	jmp	LBB0_3
LBB0_9:
	movl	-32(%rbp), %edi
	callq	_le32_to_cpu
	movq	_WRG_MAGIC@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jne	LBB0_8
## %bb.10:
	movl	-32(%rbp), %edi
	callq	_le32_to_cpu
	cltq
	addq	$4, %rax
	movq	(%rbx), %rdx
	cmpq	%rdx, %rax
	jbe	LBB0_12
LBB0_8:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
LBB0_3:
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_16:
	addq	$40, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_12:
	movq	_WRGG_MIN_ROOTFS_OFFS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-40(%rbp), %rcx
	leaq	-52(%rbp), %r8
	movq	%rbx, %rdi
	callq	_mtd_find_rootfs_from
	testl	%eax, %eax
	jne	LBB0_16
## %bb.13:
	movq	_WRGG_NR_PARTS@GOTPCREL(%rip), %r15
	movl	(%r15), %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_14
## %bb.15:
	movq	_KERNEL_PART_NAME@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, 16(%rax)
	movq	$0, (%rax)
	movq	-40(%rbp), %rcx
	movq	%rcx, 8(%rax)
	movq	_ROOTFS_PART_NAME@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	movl	%edx, 40(%rax)
	movq	%rcx, 24(%rax)
	movq	(%rbx), %rdx
	subq	%rcx, %rdx
	movq	%rdx, 32(%rax)
	movq	%rax, (%r14)
	movl	(%r15), %eax
	jmp	LBB0_16
LBB0_14:
	movq	_ENOMEM@GOTPCREL(%rip), %rcx
	jmp	LBB0_3
	.cfi_endproc
                                        ## -- End function
	.comm	_EIO,4,2                        ## @EIO
	.comm	_WRGG03_MAGIC,4,2               ## @WRGG03_MAGIC
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_WRG_MAGIC,4,2                  ## @WRG_MAGIC
	.comm	_WRGG_MIN_ROOTFS_OFFS,4,2       ## @WRGG_MIN_ROOTFS_OFFS
	.comm	_WRGG_NR_PARTS,4,2              ## @WRGG_NR_PARTS
	.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_parse_wrgg
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mtdsplit_parse_wrgg
_mtdsplit_parse_wrgg:                   ; @mtdsplit_parse_wrgg
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	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
	mov	x19, x1
	mov	x20, x0
	add	x3, sp, #16
	add	x4, sp, #24
	mov	w1, #0
	mov	w2, #8
	bl	_mtd_read
	cbnz	w0, LBB0_12
; %bb.1:
	ldr	x8, [sp, #16]
	cmp	x8, #8
	b.ne	LBB0_7
; %bb.2:
	ldr	w0, [sp, #24]
	bl	_le32_to_cpu
Lloh0:
	adrp	x8, _WRGG03_MAGIC@GOTPAGE
Lloh1:
	ldr	x8, [x8, _WRGG03_MAGIC@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w0, w8
	b.ne	LBB0_8
; %bb.3:
	ldr	w0, [sp, #28]
	bl	_be32_to_cpu
	add	x8, x0, #8
	ldr	x2, [x20]
	cmp	x8, x2
	b.ls	LBB0_5
; %bb.4:
	ldr	w0, [sp, #28]
	bl	_le32_to_cpu
                                        ; kill: def $w0 killed $w0 def $x0
	sxtw	x8, w0
	add	x8, x8, #8
	ldr	x2, [x20]
LBB0_5:
	cmp	x8, x2
	b.hi	LBB0_10
; %bb.6:
	cmp	x8, x2
	b.hi	LBB0_10
	b	LBB0_13
LBB0_7:
Lloh3:
	adrp	x8, _EIO@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
	b	LBB0_11
LBB0_8:
	ldr	w0, [sp, #24]
	bl	_le32_to_cpu
Lloh5:
	adrp	x8, _WRG_MAGIC@GOTPAGE
Lloh6:
	ldr	x8, [x8, _WRG_MAGIC@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	cmp	w0, w8
	b.ne	LBB0_10
; %bb.9:
	ldr	w0, [sp, #24]
	bl	_le32_to_cpu
                                        ; kill: def $w0 killed $w0 def $x0
	sxtw	x8, w0
	add	x8, x8, #4
	ldr	x2, [x20]
	cmp	x8, x2
	b.ls	LBB0_13
LBB0_10:
Lloh8:
	adrp	x8, _EINVAL@GOTPAGE
Lloh9:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_11:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_12:
	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
	add	sp, sp, #80
	ret
LBB0_13:
Lloh10:
	adrp	x8, _WRGG_MIN_ROOTFS_OFFS@GOTPAGE
Lloh11:
	ldr	x8, [x8, _WRGG_MIN_ROOTFS_OFFS@GOTPAGEOFF]
Lloh12:
	ldr	w1, [x8]
	add	x3, sp, #8
	add	x4, sp, #4
	mov	x0, x20
	bl	_mtd_find_rootfs_from
	cbnz	w0, LBB0_12
; %bb.14:
Lloh13:
	adrp	x21, _WRGG_NR_PARTS@GOTPAGE
Lloh14:
	ldr	x21, [x21, _WRGG_NR_PARTS@GOTPAGEOFF]
	ldr	w8, [x21]
	add	w8, w8, w8, lsl #1
	lsl	w0, w8, #3
Lloh15:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh16:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh17:
	ldr	w1, [x8]
	bl	_kzalloc
	cbz	x0, LBB0_16
; %bb.15:
Lloh18:
	adrp	x8, _KERNEL_PART_NAME@GOTPAGE
Lloh19:
	ldr	x8, [x8, _KERNEL_PART_NAME@GOTPAGEOFF]
Lloh20:
	ldr	w8, [x8]
	str	w8, [x0, #16]
	str	xzr, [x0]
	ldr	x8, [sp, #8]
	str	x8, [x0, #8]
Lloh21:
	adrp	x9, _ROOTFS_PART_NAME@GOTPAGE
Lloh22:
	ldr	x9, [x9, _ROOTFS_PART_NAME@GOTPAGEOFF]
Lloh23:
	ldr	w9, [x9]
	str	w9, [x0, #40]
	str	x8, [x0, #24]
	ldr	x9, [x20]
	sub	x8, x9, x8
	str	x8, [x0, #32]
	str	x0, [x19]
	ldr	w0, [x21]
	b	LBB0_12
LBB0_16:
Lloh24:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh25:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
	b	LBB0_11
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh24, Lloh25
	.cfi_endproc
                                        ; -- End function
	.comm	_EIO,4,2                        ; @EIO
	.comm	_WRGG03_MAGIC,4,2               ; @WRGG03_MAGIC
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_WRG_MAGIC,4,2                  ; @WRG_MAGIC
	.comm	_WRGG_MIN_ROOTFS_OFFS,4,2       ; @WRGG_MIN_ROOTFS_OFFS
	.comm	_WRGG_NR_PARTS,4,2              ; @WRGG_NR_PARTS
	.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_parse_wrgg
.subsections_via_symbols
