	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mpc5121_nfc_buf_copy
_mpc5121_nfc_buf_copy:                  ## @mpc5121_nfc_buf_copy
	.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
	movq	%rsi, -56(%rbp)                 ## 8-byte Spill
	movq	%rdi, %r14
	callq	_mtd_to_nand
	movq	%rax, %rdi
	callq	_nand_get_controller_data
	movq	%rax, %rbx
	movq	(%rax), %r12
	cmpq	$0, 16(%rax)
	je	LBB0_1
LBB0_8:
	movq	(%r14), %rax
	xorl	%ecx, %ecx
	cmpq	%rax, %r12
	cmovgeq	%rax, %rcx
	movq	%r12, %rsi
	subq	%rcx, %rsi
	movslq	%r13d, %rcx
	addq	%rcx, %r12
	movq	%r12, (%rbx)
	movq	%r14, %rdi
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
                                        ## kill: def $ecx killed $ecx killed $rcx
	movl	-44(%rbp), %r8d                 ## 4-byte Reload
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_mpc5121_nfc_copy_spare         ## TAILCALL
LBB0_1:
	movq	%r14, -64(%rbp)                 ## 8-byte Spill
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r14), %rsi
	subq	%r12, %rsi
	jle	LBB0_8
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movslq	%r13d, %r15
	movq	%r15, %rdi
	callq	_min
	movq	%rax, %r14
	addq	%rax, (%rbx)
	addq	8(%rbx), %r12
	xorl	%edi, %edi
	callq	_NFC_MAIN_AREA
	addq	%r12, %rax
	cmpl	$0, -44(%rbp)                   ## 4-byte Folded Reload
	je	LBB0_5
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	%rax, %rdi
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rsi
	movq	%r14, %rdx
	callq	_memcpy_toio
	cmpq	%r15, %r14
	jne	LBB0_7
	jmp	LBB0_9
	.p2align	4, 0x90
LBB0_5:                                 ##   in Loop: Header=BB0_2 Depth=1
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rdi
	movq	%rax, %rsi
	movq	%r14, %rdx
	callq	_memcpy_fromio
	cmpq	%r15, %r14
	je	LBB0_9
LBB0_7:                                 ##   in Loop: Header=BB0_2 Depth=1
	leaq	(%rbx,%r14,4), %rbx
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	subl	%r14d, %r13d
	movq	-64(%rbp), %r14                 ## 8-byte Reload
	movq	%r14, %rdi
	callq	_mtd_to_nand
	movq	%rax, %rdi
	callq	_nand_get_controller_data
	movq	%rax, %rbx
	movq	(%rax), %r12
	cmpq	$0, 16(%rax)
	je	LBB0_2
	jmp	LBB0_8
LBB0_9:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_mpc5121_nfc_buf_copy
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mpc5121_nfc_buf_copy
_mpc5121_nfc_buf_copy:                  ; @mpc5121_nfc_buf_copy
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x19, x3
	mov	x20, x2
	mov	x21, x1
	mov	x22, x0
LBB0_1:                                 ; =>This Inner Loop Header: Depth=1
	bl	_mtd_to_nand
	bl	_nand_get_controller_data
	mov	x23, x0
	ldr	x26, [x0]
	ldr	x8, [x0, #16]
	cbnz	x8, LBB0_7
; %bb.2:                                ;   in Loop: Header=BB0_1 Depth=1
	ldr	x8, [x22]
	subs	x1, x8, x26
	b.le	LBB0_7
; %bb.3:                                ;   in Loop: Header=BB0_1 Depth=1
	sxtw	x25, w20
	mov	x0, x25
	bl	_min
	mov	x24, x0
	ldp	x8, x27, [x23]
	add	x8, x8, x0
	str	x8, [x23]
	mov	w0, #0
	bl	_NFC_MAIN_AREA
	add	x8, x27, x26
	add	x1, x8, x0
	cbz	w19, LBB0_5
; %bb.4:                                ;   in Loop: Header=BB0_1 Depth=1
	mov	x0, x1
	mov	x1, x21
	mov	x2, x24
	bl	_memcpy_toio
	cmp	x24, x25
	b.ne	LBB0_6
	b	LBB0_8
LBB0_5:                                 ;   in Loop: Header=BB0_1 Depth=1
	mov	x0, x21
	mov	x2, x24
	bl	_memcpy_fromio
	cmp	x24, x25
	b.eq	LBB0_8
LBB0_6:                                 ;   in Loop: Header=BB0_1 Depth=1
	add	x21, x21, x24, lsl #2
	sub	w20, w20, w24
	mov	x0, x22
	b	LBB0_1
LBB0_7:
	ldr	x8, [x22]
	cmp	x26, x8
	csel	x8, xzr, x8, lt
	sub	x1, x26, x8
	add	x8, x26, w20, sxtw
	str	x8, [x23]
	mov	x0, x22
	mov	x2, x21
	mov	x3, x20
	mov	x4, x19
	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
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	b	_mpc5121_nfc_copy_spare
LBB0_8:
	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
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_mpc5121_nfc_buf_copy
.subsections_via_symbols
