	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function parser_trx_parse
_parser_trx_parse:                      ## @parser_trx_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, %r14
	movq	%rdi, %r15
	movq	_TRX_PARSER_MAX_PARTS@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	$24, %esi
	callq	_kcalloc
	testq	%rax, %rax
	je	LBB0_1
## %bb.3:
	movq	%rax, %r12
	leaq	-72(%rbp), %rcx
	leaq	-64(%rbp), %r8
	movq	%r15, %rdi
	xorl	%esi, %esi
	movl	$16, %edx
	callq	_mtd_read
	testl	%eax, %eax
	je	LBB0_5
## %bb.4:
	movl	%eax, %ebx
	leaq	L_.str(%rip), %rdi
	movl	%eax, %esi
	callq	_pr_err
	movq	%r12, %rdi
	callq	_kfree
	jmp	LBB0_16
LBB0_1:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	jmp	LBB0_2
LBB0_5:
	movq	-64(%rbp), %rax
	movq	_TRX_MAGIC@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_6
## %bb.7:
	movq	-56(%rbp), %rax
	cmpq	$0, 16(%rax)
	je	LBB0_8
## %bb.9:
	leaq	L_.str.1(%rip), %rcx
	movq	%rcx, (%r12)
	movq	(%rax), %rcx
	movq	%rcx, 8(%r12)
	movq	8(%rax), %rcx
	movl	$1, %r13d
	movl	$1, %ebx
	testq	%rcx, %rcx
	jne	LBB0_10
	jmp	LBB0_12
LBB0_6:
	movq	%r12, %rdi
	callq	_kfree
	movq	_ENOENT@GOTPCREL(%rip), %rax
LBB0_2:
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_16:
	movl	%ebx, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	movq	(%rax), %rcx
	xorl	%r13d, %r13d
	movl	$0, %ebx
	testq	%rcx, %rcx
	je	LBB0_15
LBB0_10:
	leaq	1(%r13), %rbx
	leaq	(,%r13,2), %rdx
	addq	%r13, %rdx
	leaq	L_.str.2(%rip), %rsi
	movq	%rsi, (%r12,%rdx,8)
	movq	%rcx, 8(%r12,%rdx,8)
	movq	8(%rax,%r13,8), %rsi
	testq	%rsi, %rsi
	je	LBB0_12
## %bb.11:
	leaq	2(%r13), %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movq	%r15, %rdi
	callq	_parser_trx_data_part_name
	leaq	(%rbx,%rbx,2), %rcx
	movq	%rax, (%r12,%rcx,8)
	movq	-56(%rbp), %rax
	movq	8(%rax,%r13,8), %rax
	movq	%rax, 8(%r12,%rcx,8)
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
LBB0_12:
	leaq	32(%r12), %rcx
	movq	%rbx, %rax
	decq	%rax
	cmoveq	%r15, %rcx
	movq	(%rcx), %rcx
	subq	8(%r12), %rcx
	movq	%rcx, 16(%r12)
	cmpq	$1, %rbx
	je	LBB0_15
## %bb.13:
	leaq	56(%r12), %rcx
	cmpq	$2, %rax
	cmovbq	%r15, %rcx
	movq	(%rcx), %rcx
	subq	32(%r12), %rcx
	movq	%rcx, 40(%r12)
	cmpl	$2, %ebx
	je	LBB0_15
## %bb.14:
	movq	%r12, %rcx
	addq	$80, %rcx
	cmpq	$3, %rax
	cmovaeq	%rcx, %r15
	movq	(%r15), %rax
	subq	56(%r12), %rax
	movq	%rax, 64(%r12)
LBB0_15:
	movq	%r12, (%r14)
	jmp	LBB0_16
	.cfi_endproc
                                        ## -- End function
	.comm	_TRX_PARSER_MAX_PARTS,4,2       ## @TRX_PARSER_MAX_PARTS
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"MTD reading error: %d\n"

	.comm	_TRX_MAGIC,8,3                  ## @TRX_MAGIC
	.comm	_ENOENT,4,2                     ## @ENOENT
L_.str.1:                               ## @.str.1
	.asciz	"loader"

L_.str.2:                               ## @.str.2
	.asciz	"linux"

	.no_dead_strip	_parser_trx_parse
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function parser_trx_parse
_parser_trx_parse:                      ; @parser_trx_parse
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x19, x1
	mov	x21, x0
Lloh0:
	adrp	x8, _TRX_PARSER_MAX_PARTS@GOTPAGE
Lloh1:
	ldr	x8, [x8, _TRX_PARSER_MAX_PARTS@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
Lloh3:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh5:
	ldr	w2, [x8]
	mov	w1, #24
	bl	_kcalloc
	cbz	x0, LBB0_3
; %bb.1:
	mov	x20, x0
	add	x3, sp, #8
	add	x4, sp, #16
	mov	x0, x21
	mov	w1, #0
	mov	w2, #16
	bl	_mtd_read
	cbz	w0, LBB0_4
; %bb.2:
	mov	x22, x0
Lloh6:
	adrp	x0, l_.str@PAGE
Lloh7:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x22
	bl	_pr_err
	mov	x0, x20
	bl	_kfree
	b	LBB0_9
LBB0_3:
Lloh8:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh9:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
	b	LBB0_8
LBB0_4:
	ldr	x8, [sp, #16]
Lloh10:
	adrp	x9, _TRX_MAGIC@GOTPAGE
Lloh11:
	ldr	x9, [x9, _TRX_MAGIC@GOTPAGEOFF]
Lloh12:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_7
; %bb.5:
	ldr	x8, [sp, #24]
	ldr	x9, [x8, #16]
	cbz	x9, LBB0_10
; %bb.6:
Lloh13:
	adrp	x9, l_.str.1@PAGE
Lloh14:
	add	x9, x9, l_.str.1@PAGEOFF
	str	x9, [x20]
	ldr	x9, [x8]
	str	x9, [x20, #8]
	ldr	x10, [x8, #8]
	mov	w9, #1
	mov	w22, #1
	cbnz	x10, LBB0_11
	b	LBB0_13
LBB0_7:
	mov	x0, x20
	bl	_kfree
Lloh15:
	adrp	x8, _ENOENT@GOTPAGE
Lloh16:
	ldr	x8, [x8, _ENOENT@GOTPAGEOFF]
LBB0_8:
	ldr	w8, [x8]
	neg	w22, w8
LBB0_9:
	mov	x0, x22
	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
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
LBB0_10:
	mov	x22, #0
	ldr	x10, [x8]
	cbz	x10, LBB0_16
LBB0_11:
	add	x22, x9, #1
	mov	w11, #24
	madd	x11, x9, x11, x20
Lloh17:
	adrp	x12, l_.str.2@PAGE
Lloh18:
	add	x12, x12, l_.str.2@PAGEOFF
	stp	x12, x10, [x11]
	ldr	x1, [x8, x22, lsl #3]
	cbz	x1, LBB0_13
; %bb.12:
	orr	x23, x9, #0x2
	mov	x0, x21
	bl	_parser_trx_data_part_name
	mov	w8, #24
	madd	x8, x22, x8, x20
	str	x0, [x8]
	ldr	x9, [sp, #24]
	ldr	x9, [x9, x22, lsl #3]
	str	x9, [x8, #8]
	mov	x22, x23
LBB0_13:
	add	x8, x20, #32
	cmp	x22, #1
	csel	x8, x21, x8, eq
	ldr	x8, [x8]
	ldr	x9, [x20, #8]
	sub	x8, x8, x9
	str	x8, [x20, #16]
	subs	x8, x22, #1
	b.eq	LBB0_16
; %bb.14:
	add	x9, x20, #56
	cmp	x8, #1
	csel	x9, x9, x21, hi
	ldr	x9, [x9]
	ldr	x10, [x20, #32]
	sub	x9, x9, x10
	str	x9, [x20, #40]
	cmp	x22, #2
	b.eq	LBB0_16
; %bb.15:
	add	x9, x20, #80
	cmp	x8, #2
	csel	x8, x9, x21, hi
	ldr	x8, [x8]
	ldr	x9, [x20, #56]
	sub	x8, x8, x9
	str	x8, [x20, #64]
LBB0_16:
	str	x20, [x19]
	b	LBB0_9
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpAdd	Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.comm	_TRX_PARSER_MAX_PARTS,4,2       ; @TRX_PARSER_MAX_PARTS
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"MTD reading error: %d\n"

	.comm	_TRX_MAGIC,8,3                  ; @TRX_MAGIC
	.comm	_ENOENT,4,2                     ; @ENOENT
l_.str.1:                               ; @.str.1
	.asciz	"loader"

l_.str.2:                               ; @.str.2
	.asciz	"linux"

	.no_dead_strip	_parser_trx_parse
.subsections_via_symbols
