	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mpc5121_nfc_done
_mpc5121_nfc_done:                      ## @mpc5121_nfc_done
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	callq	_mtd_to_nand
	movq	%rax, %rdi
	callq	_nand_get_controller_data
	movq	%rax, %r14
	movq	_NFC_CONFIG2@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	movq	%rbx, %rdi
	callq	_nfc_read
	movq	_NFC_INT@GOTPCREL(%rip), %r13
	testl	%eax, (%r13)
	jne	LBB0_3
## %bb.1:
	movq	_NFC_CONFIG1@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_NFC_INT_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	callq	_nfc_clear
	movl	4(%r14), %r15d
	movl	(%r12), %esi
	movq	%rbx, %rdi
	callq	_nfc_read
	andl	(%r13), %eax
	movq	_NFC_TIMEOUT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movl	%r15d, %edi
	movl	%eax, %esi
	callq	_wait_event_timeout
	testl	%eax, %eax
	jne	LBB0_3
## %bb.2:
	movl	(%r14), %edi
	leaq	L_.str(%rip), %rsi
	callq	_dev_warn
LBB0_3:
	movl	(%r12), %esi
	movl	(%r13), %edx
	movq	%rbx, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_nfc_clear                      ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_NFC_CONFIG2,4,2                ## @NFC_CONFIG2
	.comm	_NFC_INT,4,2                    ## @NFC_INT
	.comm	_NFC_CONFIG1,4,2                ## @NFC_CONFIG1
	.comm	_NFC_INT_MASK,4,2               ## @NFC_INT_MASK
	.comm	_NFC_TIMEOUT,4,2                ## @NFC_TIMEOUT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Timeout while waiting for interrupt.\n"

	.no_dead_strip	_mpc5121_nfc_done
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mpc5121_nfc_done
_mpc5121_nfc_done:                      ; @mpc5121_nfc_done
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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, x0
	bl	_mtd_to_nand
	bl	_nand_get_controller_data
	mov	x20, x0
Lloh0:
	adrp	x22, _NFC_CONFIG2@GOTPAGE
Lloh1:
	ldr	x22, [x22, _NFC_CONFIG2@GOTPAGEOFF]
	ldr	w1, [x22]
	mov	x0, x19
	bl	_nfc_read
Lloh2:
	adrp	x23, _NFC_INT@GOTPAGE
Lloh3:
	ldr	x23, [x23, _NFC_INT@GOTPAGEOFF]
	ldr	w8, [x23]
	tst	w8, w0
	b.ne	LBB0_3
; %bb.1:
Lloh4:
	adrp	x8, _NFC_CONFIG1@GOTPAGE
Lloh5:
	ldr	x8, [x8, _NFC_CONFIG1@GOTPAGEOFF]
Lloh6:
	ldr	w1, [x8]
Lloh7:
	adrp	x8, _NFC_INT_MASK@GOTPAGE
Lloh8:
	ldr	x8, [x8, _NFC_INT_MASK@GOTPAGEOFF]
Lloh9:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_nfc_clear
	ldr	w21, [x20, #4]
	ldr	w1, [x22]
	mov	x0, x19
	bl	_nfc_read
	ldr	w8, [x23]
	and	w1, w8, w0
Lloh10:
	adrp	x8, _NFC_TIMEOUT@GOTPAGE
Lloh11:
	ldr	x8, [x8, _NFC_TIMEOUT@GOTPAGEOFF]
Lloh12:
	ldr	w2, [x8]
	mov	x0, x21
	bl	_wait_event_timeout
	cbnz	w0, LBB0_3
; %bb.2:
	ldr	w0, [x20]
Lloh13:
	adrp	x1, l_.str@PAGE
Lloh14:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_warn
LBB0_3:
	ldr	w1, [x22]
	ldr	w2, [x23]
	mov	x0, x19
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	b	_nfc_clear
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpAdd	Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_NFC_CONFIG2,4,2                ; @NFC_CONFIG2
	.comm	_NFC_INT,4,2                    ; @NFC_INT
	.comm	_NFC_CONFIG1,4,2                ; @NFC_CONFIG1
	.comm	_NFC_INT_MASK,4,2               ; @NFC_INT_MASK
	.comm	_NFC_TIMEOUT,4,2                ; @NFC_TIMEOUT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Timeout while waiting for interrupt.\n"

	.no_dead_strip	_mpc5121_nfc_done
.subsections_via_symbols
