	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sunxi_nfc_wait_events
_sunxi_nfc_wait_events:                 ## @sunxi_nfc_wait_events
	.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	_NFC_INT_MASK@GOTPCREL(%rip), %r13
	movl	(%r13), %eax
	notl	%eax
	testl	%esi, %eax
	je	LBB0_2
## %bb.1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_10
LBB0_2:
	movl	%ecx, %ebx
	movl	%esi, %r15d
	movq	%rdi, %r14
	testl	%ecx, %ecx
	jne	LBB0_4
## %bb.3:
	movq	_NFC_DEFAULT_TIMEOUT_MS@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
LBB0_4:
	testl	%edx, %edx
	je	LBB0_5
## %bb.6:
	movq	_NFC_REG_ST@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	8(%r14), %rdi
	xorl	%edx, %edx
	testl	%r15d, %r15d
	sete	%dl
	imull	$1000, %ebx, %r8d               ## imm = 0x3E8
	movl	$1, %ecx
	callq	_readl_poll_timeout
	movl	%eax, %ebx
	jmp	LBB0_7
LBB0_5:
	leaq	16(%r14), %r12
	movq	%r12, %rdi
	callq	_init_completion
	movq	_NFC_REG_INT@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	8(%r14), %rsi
	movl	%r15d, %edi
	callq	_writel
	movl	%ebx, %edi
	callq	_msecs_to_jiffies
	movq	%r12, %rdi
	movl	%eax, %esi
	callq	_wait_for_completion_timeout
	movl	%eax, %r12d
	movq	_ETIMEDOUT@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	movq	_NFC_REG_INT@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	8(%r14), %rsi
	xorl	%edi, %edi
	callq	_writel
	testl	%r12d, %r12d
	movl	$0, %eax
	cmovnel	%eax, %ebx
LBB0_7:
	andl	(%r13), %r15d
	movq	_NFC_REG_ST@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	8(%r14), %rsi
	movl	%r15d, %edi
	callq	_writel
	testl	%ebx, %ebx
	je	LBB0_8
## %bb.9:
	movl	(%r14), %edi
	leaq	L_.str(%rip), %rsi
	callq	_dev_err
	jmp	LBB0_10
LBB0_8:
	xorl	%ebx, %ebx
LBB0_10:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_NFC_INT_MASK,4,2               ## @NFC_INT_MASK
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_NFC_DEFAULT_TIMEOUT_MS,4,2     ## @NFC_DEFAULT_TIMEOUT_MS
	.comm	_NFC_REG_INT,8,3                ## @NFC_REG_INT
	.comm	_ETIMEDOUT,4,2                  ## @ETIMEDOUT
	.comm	_NFC_REG_ST,8,3                 ## @NFC_REG_ST
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"wait interrupt timedout\n"

	.no_dead_strip	_sunxi_nfc_wait_events
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sunxi_nfc_wait_events
_sunxi_nfc_wait_events:                 ; @sunxi_nfc_wait_events
	.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
Lloh0:
	adrp	x23, _NFC_INT_MASK@GOTPAGE
Lloh1:
	ldr	x23, [x23, _NFC_INT_MASK@GOTPAGEOFF]
	ldr	w8, [x23]
	bics	wzr, w1, w8
	b.eq	LBB0_2
; %bb.1:
Lloh2:
	adrp	x8, _EINVAL@GOTPAGE
Lloh3:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_7
LBB0_2:
	mov	x20, x1
	mov	x19, x0
Lloh5:
	adrp	x8, _NFC_DEFAULT_TIMEOUT_MS@GOTPAGE
Lloh6:
	ldr	x8, [x8, _NFC_DEFAULT_TIMEOUT_MS@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	cmp	w3, #0
	csel	w21, w8, w3, eq
Lloh8:
	adrp	x24, _NFC_REG_ST@GOTPAGE
Lloh9:
	ldr	x24, [x24, _NFC_REG_ST@GOTPAGEOFF]
	cbz	w2, LBB0_4
; %bb.3:
	ldr	x8, [x19, #8]
	ldr	x9, [x24]
	add	x0, x9, x8
	cmp	w20, #0
	cset	w2, eq
	mov	w8, #1000
	mul	w4, w21, w8
	mov	w3, #1
	bl	_readl_poll_timeout
	mov	x21, x0
	b	LBB0_5
LBB0_4:
	add	x22, x19, #16
	mov	x0, x22
	bl	_init_completion
	ldr	x8, [x19, #8]
Lloh10:
	adrp	x25, _NFC_REG_INT@GOTPAGE
Lloh11:
	ldr	x25, [x25, _NFC_REG_INT@GOTPAGEOFF]
	ldr	x9, [x25]
	add	x1, x9, x8
	mov	x0, x20
	bl	_writel
	mov	x0, x21
	bl	_msecs_to_jiffies
	mov	x1, x0
	mov	x0, x22
	bl	_wait_for_completion_timeout
	mov	x21, x0
Lloh12:
	adrp	x8, _ETIMEDOUT@GOTPAGE
Lloh13:
	ldr	x8, [x8, _ETIMEDOUT@GOTPAGEOFF]
Lloh14:
	ldr	w22, [x8]
	ldr	x8, [x19, #8]
	ldr	x9, [x25]
	add	x1, x9, x8
	mov	w0, #0
	bl	_writel
	cmp	w21, #0
	csneg	w21, wzr, w22, ne
LBB0_5:
	ldr	w8, [x23]
	and	w0, w8, w20
	ldr	x8, [x19, #8]
	ldr	x9, [x24]
	add	x1, x9, x8
	bl	_writel
	cbz	w21, LBB0_7
; %bb.6:
	ldr	w0, [x19]
Lloh15:
	adrp	x1, l_.str@PAGE
Lloh16:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
LBB0_7:
	mov	x0, x21
	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 AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpAdd	Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_NFC_INT_MASK,4,2               ; @NFC_INT_MASK
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_NFC_DEFAULT_TIMEOUT_MS,4,2     ; @NFC_DEFAULT_TIMEOUT_MS
	.comm	_NFC_REG_INT,8,3                ; @NFC_REG_INT
	.comm	_ETIMEDOUT,4,2                  ; @ETIMEDOUT
	.comm	_NFC_REG_ST,8,3                 ; @NFC_REG_ST
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"wait interrupt timedout\n"

	.no_dead_strip	_sunxi_nfc_wait_events
.subsections_via_symbols
