	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mtdsplit_parse_trx
_mtdsplit_parse_trx:                    ## @mtdsplit_parse_trx
	.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, %rbx
	movq	%rdi, %r13
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$48, %edi
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_14
## %bb.1:
	movq	%rax, %r14
	leaq	L_.str.2(%rip), %rdi
	cmpq	$0, (%r13)
	je	LBB0_13
## %bb.2:
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	movq	%r14, -56(%rbp)                 ## 8-byte Spill
	leaq	-80(%rbp), %r14
	movq	_TRX_MAGIC@GOTPCREL(%rip), %r15
	xorl	%ebx, %ebx
	jmp	LBB0_5
LBB0_9:                                 ##   in Loop: Header=BB0_5 Depth=1
	movl	8(%r13), %esi
	leaq	L_.str(%rip), %rdi
	movq	%rbx, %rdx
	xorl	%eax, %eax
	callq	_pr_debug
LBB0_3:                                 ##   in Loop: Header=BB0_5 Depth=1
	xorl	%r12d, %r12d
LBB0_4:                                 ##   in Loop: Header=BB0_5 Depth=1
	addq	16(%r13), %rbx
	movq	(%r13), %rax
	cmpq	%rax, %rbx
	jae	LBB0_10
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r13, %rdi
	movq	%rbx, %rsi
	movq	%r14, %rdx
	callq	_read_trx_header
	testl	%eax, %eax
	jne	LBB0_3
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=1
	movq	-80(%rbp), %r12
	movl	(%r15), %edi
	callq	_cpu_to_le32
	cmpq	%rax, %r12
	jne	LBB0_9
## %bb.7:                               ##   in Loop: Header=BB0_5 Depth=1
	movl	-64(%rbp), %edi
	callq	_le32_to_cpu
	movq	%rax, %r12
	movq	%rax, %rcx
	addq	%rbx, %rcx
	movq	(%r13), %rax
	cmpq	%rax, %rcx
	jbe	LBB0_10
## %bb.8:                               ##   in Loop: Header=BB0_5 Depth=1
	movl	8(%r13), %esi
	leaq	L_.str.1(%rip), %rdi
	xorl	%eax, %eax
	callq	_pr_debug
	jmp	LBB0_4
LBB0_10:
	testq	%r12, %r12
	movq	-56(%rbp), %r14                 ## 8-byte Reload
	leaq	L_.str.2(%rip), %rdi
	je	LBB0_13
## %bb.11:
	movq	-72(%rbp), %rdx
	movq	8(%rdx), %rcx
	addq	%rbx, %rcx
	subq	%rcx, %rax
	jne	LBB0_15
## %bb.12:
	leaq	L_.str.3(%rip), %rdi
LBB0_13:
	movl	8(%r13), %esi
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_pr_debug
	movq	_ENODEV@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
	movq	%r14, %rdi
	callq	_kfree
	jmp	LBB0_16
LBB0_14:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_16
LBB0_15:
	addq	(%rdx), %rbx
	movq	%rcx, %rdx
	subq	%rbx, %rdx
	movq	_KERNEL_PART_NAME@GOTPCREL(%rip), %rsi
	movl	(%rsi), %esi
	movl	%esi, 16(%r14)
	movq	%rbx, (%r14)
	movq	%rdx, 8(%r14)
	movq	_ROOTFS_PART_NAME@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	movl	%edx, 40(%r14)
	movq	%rcx, 24(%r14)
	movq	%rax, 32(%r14)
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	%r14, (%rax)
	movl	$2, %ebx
LBB0_16:
	movl	%ebx, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_TRX_MAGIC,4,2                  ## @TRX_MAGIC
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"no valid trx header found in \"%s\" at offset %llx\n"

L_.str.1:                               ## @.str.1
	.asciz	"trx image exceeds MTD device \"%s\"\n"

L_.str.2:                               ## @.str.2
	.asciz	"no trx header found in \"%s\"\n"

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

	.comm	_KERNEL_PART_NAME,4,2           ## @KERNEL_PART_NAME
	.comm	_ROOTFS_PART_NAME,4,2           ## @ROOTFS_PART_NAME
	.no_dead_strip	_mtdsplit_parse_trx
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mtdsplit_parse_trx
_mtdsplit_parse_trx:                    ; @mtdsplit_parse_trx
	.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	x21, x1
	mov	x20, x0
Lloh0:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	w0, #48
	bl	_kzalloc
	cbz	x0, LBB0_13
; %bb.1:
	mov	x19, x0
	ldr	x8, [x20]
	cbz	x8, LBB0_14
; %bb.2:
	mov	x22, #0
Lloh3:
	adrp	x26, _TRX_MAGIC@GOTPAGE
Lloh4:
	ldr	x26, [x26, _TRX_MAGIC@GOTPAGEOFF]
Lloh5:
	adrp	x23, l_.str.1@PAGE
Lloh6:
	add	x23, x23, l_.str.1@PAGEOFF
Lloh7:
	adrp	x24, l_.str@PAGE
Lloh8:
	add	x24, x24, l_.str@PAGEOFF
	b	LBB0_6
LBB0_3:                                 ;   in Loop: Header=BB0_6 Depth=1
	ldr	w1, [x20, #8]
	str	x22, [sp]
	mov	x0, x24
	bl	_pr_debug
LBB0_4:                                 ;   in Loop: Header=BB0_6 Depth=1
	mov	x25, #0
LBB0_5:                                 ;   in Loop: Header=BB0_6 Depth=1
	ldr	x9, [x20, #16]
	ldr	x8, [x20]
	add	x22, x9, x22
	cmp	x22, x8
	b.hs	LBB0_10
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	add	x2, sp, #8
	mov	x0, x20
	mov	x1, x22
	bl	_read_trx_header
	cbnz	w0, LBB0_4
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	ldr	x25, [sp, #8]
	ldr	w0, [x26]
	bl	_cpu_to_le32
	cmp	x25, x0
	b.ne	LBB0_3
; %bb.8:                                ;   in Loop: Header=BB0_6 Depth=1
	ldr	w0, [sp, #24]
	bl	_le32_to_cpu
	mov	x25, x0
	ldr	x8, [x20]
	add	x9, x0, x22
	cmp	x9, x8
	b.ls	LBB0_10
; %bb.9:                                ;   in Loop: Header=BB0_6 Depth=1
	ldr	w1, [x20, #8]
	mov	x0, x23
	bl	_pr_debug
	b	LBB0_5
LBB0_10:
	cbz	x25, LBB0_14
; %bb.11:
	ldr	x10, [sp, #16]
	ldr	x9, [x10, #8]
	add	x9, x9, x22
	subs	x8, x8, x9
	b.ne	LBB0_17
; %bb.12:
Lloh9:
	adrp	x0, l_.str.3@PAGE
Lloh10:
	add	x0, x0, l_.str.3@PAGEOFF
	b	LBB0_15
LBB0_13:
Lloh11:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh12:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	neg	w20, w8
	b	LBB0_16
LBB0_14:
Lloh14:
	adrp	x0, l_.str.2@PAGE
Lloh15:
	add	x0, x0, l_.str.2@PAGEOFF
LBB0_15:
	ldr	w1, [x20, #8]
	bl	_pr_debug
Lloh16:
	adrp	x8, _ENODEV@GOTPAGE
Lloh17:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh18:
	ldr	w8, [x8]
	neg	w20, w8
	mov	x0, x19
	bl	_kfree
LBB0_16:
	mov	x0, x20
	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_17:
	ldr	x10, [x10]
	add	x10, x10, x22
	sub	x11, x9, x10
Lloh19:
	adrp	x12, _KERNEL_PART_NAME@GOTPAGE
Lloh20:
	ldr	x12, [x12, _KERNEL_PART_NAME@GOTPAGEOFF]
Lloh21:
	ldr	w12, [x12]
	str	w12, [x19, #16]
	stp	x10, x11, [x19]
Lloh22:
	adrp	x10, _ROOTFS_PART_NAME@GOTPAGE
Lloh23:
	ldr	x10, [x10, _ROOTFS_PART_NAME@GOTPAGEOFF]
Lloh24:
	ldr	w10, [x10]
	str	w10, [x19, #40]
	stp	x9, x8, [x19, #24]
	str	x19, [x21]
	mov	w20, #2
	b	LBB0_16
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_TRX_MAGIC,4,2                  ; @TRX_MAGIC
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"no valid trx header found in \"%s\" at offset %llx\n"

l_.str.1:                               ; @.str.1
	.asciz	"trx image exceeds MTD device \"%s\"\n"

l_.str.2:                               ; @.str.2
	.asciz	"no trx header found in \"%s\"\n"

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

	.comm	_KERNEL_PART_NAME,4,2           ; @KERNEL_PART_NAME
	.comm	_ROOTFS_PART_NAME,4,2           ; @ROOTFS_PART_NAME
	.no_dead_strip	_mtdsplit_parse_trx
.subsections_via_symbols
