	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mtdsplit_parse_tplink
_mtdsplit_parse_tplink:                 ## @mtdsplit_parse_tplink
	.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	$48, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movq	%rdi, %rbx
	leaq	-80(%rbp), %rcx
	leaq	-72(%rbp), %r8
	movl	$28, %edx
	xorl	%esi, %esi
	callq	_mtd_read
	testl	%eax, %eax
	jne	LBB0_17
## %bb.1:
	cmpq	$28, -80(%rbp)
	jne	LBB0_2
## %bb.4:
	movl	-48(%rbp), %edi
	callq	_le32_to_cpu
                                        ## kill: def $eax killed $eax def $rax
	leal	-2(%rax), %ecx
	cmpl	$2, %ecx
	jae	LBB0_5
## %bb.8:
	movl	-64(%rbp), %edi
	callq	_be32_to_cpu
	cmpl	$28, %eax
	jne	LBB0_7
## %bb.9:
	movl	-68(%rbp), %edi
	callq	_be32_to_cpu
	movl	%eax, %r15d
	movl	-72(%rbp), %edi
	jmp	LBB0_11
LBB0_2:
	movq	_EIO@GOTPCREL(%rip), %rcx
	jmp	LBB0_3
LBB0_5:
	cmpl	$1, %eax
	jne	LBB0_7
## %bb.6:
	movl	-52(%rbp), %edi
	callq	_be32_to_cpu
	cmpl	$28, %eax
	jne	LBB0_7
## %bb.10:
	movl	-56(%rbp), %edi
	callq	_be32_to_cpu
	movl	%eax, %r15d
	movl	-60(%rbp), %edi
LBB0_11:
	callq	_be32_to_cpu
	movslq	%r15d, %r15
	addq	$28, %r15
	movslq	%eax, %rsi
	movq	%rsi, -40(%rbp)
	cmpq	(%rbx), %r15
	jbe	LBB0_12
LBB0_7:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
LBB0_3:
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_17:
	addq	$48, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_12:
	movq	%rbx, %rdi
	xorl	%edx, %edx
	callq	_mtd_check_rootfs_magic
	testl	%eax, %eax
	je	LBB0_14
## %bb.13:
	movq	_TPLINK_MIN_ROOTFS_OFFS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	(%rbx), %rdx
	leaq	-40(%rbp), %rcx
	movq	%rbx, %rdi
	xorl	%r8d, %r8d
	callq	_mtd_find_rootfs_from
	testl	%eax, %eax
	jne	LBB0_17
LBB0_14:
	movq	_TPLINK_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_15
## %bb.16:
	movq	_KERNEL_PART_NAME@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, 16(%rax)
	movq	$0, (%rax)
	movq	%r15, 8(%rax)
	movq	_ROOTFS_PART_NAME@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, 40(%rax)
	movq	-40(%rbp), %rcx
	movq	%rcx, 24(%rax)
	movq	(%rbx), %rdx
	subq	%rcx, %rdx
	movq	%rdx, 32(%rax)
	movq	%rax, (%r14)
	movl	(%r12), %eax
	jmp	LBB0_17
LBB0_15:
	movq	_ENOMEM@GOTPCREL(%rip), %rcx
	jmp	LBB0_3
	.cfi_endproc
                                        ## -- End function
	.comm	_EIO,4,2                        ## @EIO
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_TPLINK_MIN_ROOTFS_OFFS,4,2     ## @TPLINK_MIN_ROOTFS_OFFS
	.comm	_TPLINK_NR_PARTS,4,2            ## @TPLINK_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_tplink
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mtdsplit_parse_tplink
_mtdsplit_parse_tplink:                 ; @mtdsplit_parse_tplink
	.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, #8
	add	x4, sp, #16
	mov	w1, #0
	mov	w2, #28
	bl	_mtd_read
	cbnz	w0, LBB0_12
; %bb.1:
	ldr	x8, [sp, #8]
	cmp	x8, #28
	b.ne	LBB0_5
; %bb.2:
	ldr	w0, [sp, #40]
	bl	_le32_to_cpu
	sub	w8, w0, #2
	cmp	w8, #2
	b.hs	LBB0_6
; %bb.3:
	ldr	w0, [sp, #24]
	bl	_be32_to_cpu
	cmp	w0, #28
	b.ne	LBB0_10
; %bb.4:
	ldr	w0, [sp, #20]
	bl	_be32_to_cpu
	mov	x21, x0
	ldr	w0, [sp, #16]
	b	LBB0_9
LBB0_5:
Lloh0:
	adrp	x8, _EIO@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
	b	LBB0_11
LBB0_6:
	cmp	w0, #1
	b.ne	LBB0_10
; %bb.7:
	ldr	w0, [sp, #36]
	bl	_be32_to_cpu
	cmp	w0, #28
	b.ne	LBB0_10
; %bb.8:
	ldr	w0, [sp, #32]
	bl	_be32_to_cpu
	mov	x21, x0
	ldr	w0, [sp, #28]
LBB0_9:
	bl	_be32_to_cpu
                                        ; kill: def $w0 killed $w0 def $x0
	sxtw	x8, w21
	add	x21, x8, #28
	sxtw	x1, w0
	str	x1, [sp]
	ldr	x8, [x20]
	cmp	x21, x8
	b.ls	LBB0_13
LBB0_10:
Lloh2:
	adrp	x8, _EINVAL@GOTPAGE
Lloh3:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_11:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_12:
	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_13:
	mov	x0, x20
	mov	x2, #0
	bl	_mtd_check_rootfs_magic
	cbz	w0, LBB0_15
; %bb.14:
Lloh4:
	adrp	x8, _TPLINK_MIN_ROOTFS_OFFS@GOTPAGE
Lloh5:
	ldr	x8, [x8, _TPLINK_MIN_ROOTFS_OFFS@GOTPAGEOFF]
Lloh6:
	ldr	w1, [x8]
	ldr	x2, [x20]
	mov	x3, sp
	mov	x0, x20
	mov	x4, #0
	bl	_mtd_find_rootfs_from
	cbnz	w0, LBB0_12
LBB0_15:
Lloh7:
	adrp	x22, _TPLINK_NR_PARTS@GOTPAGE
Lloh8:
	ldr	x22, [x22, _TPLINK_NR_PARTS@GOTPAGEOFF]
	ldr	w8, [x22]
	add	w8, w8, w8, lsl #1
	lsl	w0, w8, #3
Lloh9:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh10:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
	bl	_kzalloc
	cbz	x0, LBB0_17
; %bb.16:
Lloh12:
	adrp	x8, _KERNEL_PART_NAME@GOTPAGE
Lloh13:
	ldr	x8, [x8, _KERNEL_PART_NAME@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	str	w8, [x0, #16]
	stp	xzr, x21, [x0]
Lloh15:
	adrp	x8, _ROOTFS_PART_NAME@GOTPAGE
Lloh16:
	ldr	x8, [x8, _ROOTFS_PART_NAME@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	str	w8, [x0, #40]
	ldr	x8, [sp]
	str	x8, [x0, #24]
	ldr	x9, [x20]
	sub	x8, x9, x8
	str	x8, [x0, #32]
	str	x0, [x19]
	ldr	w0, [x22]
	b	LBB0_12
LBB0_17:
Lloh18:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh19:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
	b	LBB0_11
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.comm	_EIO,4,2                        ; @EIO
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_TPLINK_MIN_ROOTFS_OFFS,4,2     ; @TPLINK_MIN_ROOTFS_OFFS
	.comm	_TPLINK_NR_PARTS,4,2            ; @TPLINK_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_tplink
.subsections_via_symbols
