	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mpc5121_nfc_command
_mpc5121_nfc_command:                   ## @mpc5121_nfc_command
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%ecx, -44(%rbp)                 ## 4-byte Spill
	movl	%edx, %r13d
	movl	%esi, %r12d
	movq	%rdi, %rbx
	callq	_nand_to_mtd
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movq	%rbx, %rdi
	callq	_nand_get_controller_data
	movq	%rax, %r14
	xorl	%r15d, %r15d
	testl	%r13d, %r13d
	cmovgl	%r13d, %r15d
	movl	%r15d, (%rax)
	movl	$0, 4(%rax)
	leal	-128(%r12), %eax
	cmpl	$8, %eax
	ja	LBB0_20
## %bb.1:
	leaq	LJTI0_0(%rip), %rcx
	movslq	(%rcx,%rax,4), %rax
	addq	%rcx, %rax
	jmpq	*%rax
LBB0_10:
	movq	-56(%rbp), %r15                 ## 8-byte Reload
	movq	%r15, %rdi
	movl	%r12d, %esi
	callq	_mpc5121_nfc_send_cmd
	movq	%r15, %rdi
	movl	%r13d, %esi
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	callq	_mpc5121_nfc_addr_cycle
	cmpl	$128, %r12d
	je	LBB0_17
## %bb.11:
	cmpl	$131, %r12d
	je	LBB0_16
## %bb.12:
	cmpl	$133, %r12d
	je	LBB0_13
	jmp	LBB0_20
LBB0_3:
	movq	%rbx, %rdi
	callq	_nand_to_mtd
	movq	%rax, %r14
	movq	%rbx, %rdi
	callq	_nand_get_controller_data
	movl	%r15d, (%rax)
	movl	$0, 4(%rax)
	movq	%r14, %rdi
	movl	$133, %esi
	callq	_mpc5121_nfc_send_cmd
	xorl	%r13d, %r13d
	movq	%r14, %rdi
	xorl	%esi, %esi
	movl	-44(%rbp), %r15d                ## 4-byte Reload
	movl	%r15d, %edx
	callq	_mpc5121_nfc_addr_cycle
	cmpl	$513, (%r14)                    ## imm = 0x201
	jl	LBB0_5
## %bb.4:
	movq	_NAND_CMD_READSTART@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_mpc5121_nfc_send_cmd
LBB0_5:
	movq	%r14, %rdi
	callq	_mpc5121_nfc_send_read_page
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	jmp	LBB0_9
LBB0_2:
	movl	$1, 4(%r14)
	jmp	LBB0_7
LBB0_6:
	addl	$256, %r15d                     ## imm = 0x100
	movl	%r15d, (%r14)
LBB0_7:
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rdi
	movl	$133, %esi
	callq	_mpc5121_nfc_send_cmd
	movq	%rbx, %rdi
	xorl	%esi, %esi
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	callq	_mpc5121_nfc_addr_cycle
LBB0_13:
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	cmpl	$513, (%rbx)                    ## imm = 0x201
	jl	LBB0_15
## %bb.14:
	movq	_NAND_CMD_READSTART@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_mpc5121_nfc_send_cmd
LBB0_15:
	movq	%rbx, %rdi
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_mpc5121_nfc_send_read_page     ## TAILCALL
LBB0_8:
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rdi
	callq	_mpc5121_nfc_send_prog_page
	movl	-44(%rbp), %r15d                ## 4-byte Reload
LBB0_9:
	movq	%rbx, %rdi
	movl	%r12d, %esi
	callq	_mpc5121_nfc_send_cmd
	movq	%rbx, %rdi
	movl	%r13d, %esi
	movl	%r15d, %edx
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_mpc5121_nfc_addr_cycle         ## TAILCALL
LBB0_17:
	movq	%r15, %rdi
	callq	_mpc5121_nfc_send_read_status
	movq	_NAND_BUSWIDTH_16@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%rbx)
	je	LBB0_19
## %bb.18:
	movl	$1, (%r14)
	jmp	LBB0_20
LBB0_16:
	movq	%r15, %rdi
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_mpc5121_nfc_send_read_id       ## TAILCALL
LBB0_19:
	movl	$0, (%r14)
LBB0_20:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
	.p2align	2, 0x90
	.data_region jt32
.set L0_0_set_10, LBB0_10-LJTI0_0
.set L0_0_set_3, LBB0_3-LJTI0_0
.set L0_0_set_2, LBB0_2-LJTI0_0
.set L0_0_set_6, LBB0_6-LJTI0_0
.set L0_0_set_7, LBB0_7-LJTI0_0
.set L0_0_set_8, LBB0_8-LJTI0_0
LJTI0_0:
	.long	L0_0_set_10
	.long	L0_0_set_3
	.long	L0_0_set_2
	.long	L0_0_set_10
	.long	L0_0_set_6
	.long	L0_0_set_7
	.long	L0_0_set_8
	.long	L0_0_set_10
	.long	L0_0_set_10
	.end_data_region
                                        ## -- End function
	.comm	_NAND_CMD_READSTART,4,2         ## @NAND_CMD_READSTART
	.comm	_NAND_BUSWIDTH_16,4,2           ## @NAND_BUSWIDTH_16
	.no_dead_strip	_mpc5121_nfc_command
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mpc5121_nfc_command
_mpc5121_nfc_command:                   ; @mpc5121_nfc_command
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x20, x3
	mov	x23, x2
	mov	x21, x1
	mov	x22, x0
	bl	_nand_to_mtd
	mov	x19, x0
	mov	x0, x22
	bl	_nand_get_controller_data
	cmp	w23, #0
	csel	w25, w23, wzr, gt
	stp	w25, wzr, [x0]
	sub	w8, w21, #128
	cmp	w8, #8
	b.hi	LBB0_20
; %bb.1:
	mov	x24, x0
Lloh0:
	adrp	x9, lJTI0_0@PAGE
Lloh1:
	add	x9, x9, lJTI0_0@PAGEOFF
	adr	x10, LBB0_2
	ldrb	w11, [x9, x8]
	add	x10, x10, x11, lsl #2
	br	x10
LBB0_2:
	mov	x0, x19
	mov	x1, x21
	bl	_mpc5121_nfc_send_cmd
	mov	x0, x19
	mov	x1, x23
	mov	x2, x20
	bl	_mpc5121_nfc_addr_cycle
	cmp	w21, #128
	b.eq	LBB0_16
; %bb.3:
	cmp	w21, #131
	b.eq	LBB0_18
; %bb.4:
	cmp	w21, #133
	b.eq	LBB0_11
	b	LBB0_20
LBB0_5:
	mov	x0, x22
	bl	_nand_to_mtd
	mov	x23, x0
	mov	x0, x22
	bl	_nand_get_controller_data
	stp	w25, wzr, [x0]
	mov	x0, x23
	mov	w1, #133
	bl	_mpc5121_nfc_send_cmd
	mov	x0, x23
	mov	w1, #0
	mov	x2, x20
	bl	_mpc5121_nfc_addr_cycle
	ldr	w8, [x23]
	cmp	w8, #513
	b.lt	LBB0_7
; %bb.6:
Lloh2:
	adrp	x8, _NAND_CMD_READSTART@GOTPAGE
Lloh3:
	ldr	x8, [x8, _NAND_CMD_READSTART@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
	mov	x0, x23
	bl	_mpc5121_nfc_send_cmd
LBB0_7:
	mov	x0, x23
	bl	_mpc5121_nfc_send_read_page
	mov	w23, #0
	b	LBB0_15
LBB0_8:
	mov	w8, #1
	str	w8, [x24, #4]
	b	LBB0_10
LBB0_9:
	add	w8, w25, #256
	str	w8, [x24]
LBB0_10:
	mov	x0, x19
	mov	w1, #133
	bl	_mpc5121_nfc_send_cmd
	mov	x0, x19
	mov	w1, #0
	mov	x2, x20
	bl	_mpc5121_nfc_addr_cycle
LBB0_11:
	ldr	w8, [x19]
	cmp	w8, #513
	b.lt	LBB0_13
; %bb.12:
Lloh5:
	adrp	x8, _NAND_CMD_READSTART@GOTPAGE
Lloh6:
	ldr	x8, [x8, _NAND_CMD_READSTART@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_mpc5121_nfc_send_cmd
LBB0_13:
	mov	x0, x19
	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
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	b	_mpc5121_nfc_send_read_page
LBB0_14:
	mov	x0, x19
	bl	_mpc5121_nfc_send_prog_page
LBB0_15:
	mov	x0, x19
	mov	x1, x21
	bl	_mpc5121_nfc_send_cmd
	mov	x0, x19
	mov	x1, x23
	mov	x2, x20
	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
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	b	_mpc5121_nfc_addr_cycle
LBB0_16:
	mov	x0, x19
	bl	_mpc5121_nfc_send_read_status
	ldr	w8, [x22]
Lloh8:
	adrp	x9, _NAND_BUSWIDTH_16@GOTPAGE
Lloh9:
	ldr	x9, [x9, _NAND_BUSWIDTH_16@GOTPAGEOFF]
Lloh10:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_19
; %bb.17:
	mov	w8, #1
	str	w8, [x24]
	b	LBB0_20
LBB0_18:
	mov	x0, x19
	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
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	b	_mpc5121_nfc_send_read_id
LBB0_19:
	str	wzr, [x24]
LBB0_20:
	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
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.cfi_endproc
	.section	__TEXT,__const
lJTI0_0:
	.byte	(LBB0_2-LBB0_2)>>2
	.byte	(LBB0_5-LBB0_2)>>2
	.byte	(LBB0_8-LBB0_2)>>2
	.byte	(LBB0_2-LBB0_2)>>2
	.byte	(LBB0_9-LBB0_2)>>2
	.byte	(LBB0_10-LBB0_2)>>2
	.byte	(LBB0_14-LBB0_2)>>2
	.byte	(LBB0_2-LBB0_2)>>2
	.byte	(LBB0_2-LBB0_2)>>2
                                        ; -- End function
	.comm	_NAND_CMD_READSTART,4,2         ; @NAND_CMD_READSTART
	.comm	_NAND_BUSWIDTH_16,4,2           ; @NAND_BUSWIDTH_16
	.no_dead_strip	_mpc5121_nfc_command
.subsections_via_symbols
