	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function pn544_hci_check_presence
_pn544_hci_check_presence:              ## @pn544_hci_check_presence
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rsi, %rbx
	movq	%rdi, %r14
	movl	(%rsi), %esi
	leaq	L_.str(%rip), %rdi
	callq	_pr_debug
	movl	(%rbx), %eax
	movq	_NFC_PROTO_ISO14443_MASK@GOTPCREL(%rip), %rcx
	movq	_NFC_PROTO_ISO14443_B_MASK@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	orl	(%rcx), %edx
	testl	%eax, %edx
	je	LBB0_4
## %bb.1:
	movl	8(%rbx), %esi
	movq	_PN544_RF_READER_CMD_PRESENCE_CHECK@GOTPCREL(%rip), %rax
LBB0_2:
	movl	(%rax), %edx
	movq	%r14, %rdi
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	jmp	LBB0_3
LBB0_4:
	movq	_NFC_PROTO_MIFARE_MASK@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_9
## %bb.5:
	movl	4(%rbx), %r8d
	cmpl	$10, %r8d
	ja	LBB0_7
## %bb.6:
	movl	$1168, %eax                     ## imm = 0x490
	btl	%r8d, %eax
	jae	LBB0_7
## %bb.8:
	movq	_NFC_HCI_RF_READER_A_GATE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_PN544_RF_READER_CMD_ACTIVATE_NEXT@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	16(%rbx), %rcx
	movq	%r14, %rdi
LBB0_3:
	xorl	%r9d, %r9d
	popq	%rbx
	popq	%r14
	popq	%rbp
	jmp	_nfc_hci_send_cmd               ## TAILCALL
LBB0_9:
	movq	_NFC_PROTO_JEWEL_MASK@GOTPCREL(%rip), %rcx
	movq	_NFC_PROTO_FELICA_MASK@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	orl	(%rcx), %edx
	testl	%eax, %edx
	je	LBB0_10
LBB0_7:
	movq	_EOPNOTSUPP@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_12:
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
LBB0_10:
	movq	_NFC_PROTO_NFC_DEP_MASK@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_11
## %bb.13:
	movl	8(%rbx), %esi
	movq	_PN544_HCI_CMD_ATTREQUEST@GOTPCREL(%rip), %rax
	jmp	LBB0_2
LBB0_11:
	xorl	%eax, %eax
	jmp	LBB0_12
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"supported protocol %d\b"

	.comm	_NFC_PROTO_ISO14443_MASK,4,2    ## @NFC_PROTO_ISO14443_MASK
	.comm	_NFC_PROTO_ISO14443_B_MASK,4,2  ## @NFC_PROTO_ISO14443_B_MASK
	.comm	_PN544_RF_READER_CMD_PRESENCE_CHECK,4,2 ## @PN544_RF_READER_CMD_PRESENCE_CHECK
	.comm	_NFC_PROTO_MIFARE_MASK,4,2      ## @NFC_PROTO_MIFARE_MASK
	.comm	_EOPNOTSUPP,4,2                 ## @EOPNOTSUPP
	.comm	_NFC_HCI_RF_READER_A_GATE,4,2   ## @NFC_HCI_RF_READER_A_GATE
	.comm	_PN544_RF_READER_CMD_ACTIVATE_NEXT,4,2 ## @PN544_RF_READER_CMD_ACTIVATE_NEXT
	.comm	_NFC_PROTO_JEWEL_MASK,4,2       ## @NFC_PROTO_JEWEL_MASK
	.comm	_NFC_PROTO_FELICA_MASK,4,2      ## @NFC_PROTO_FELICA_MASK
	.comm	_NFC_PROTO_NFC_DEP_MASK,4,2     ## @NFC_PROTO_NFC_DEP_MASK
	.comm	_PN544_HCI_CMD_ATTREQUEST,4,2   ## @PN544_HCI_CMD_ATTREQUEST
	.no_dead_strip	_pn544_hci_check_presence
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function pn544_hci_check_presence
_pn544_hci_check_presence:              ; @pn544_hci_check_presence
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x20, x1
	mov	x19, x0
	ldr	w1, [x1]
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_pr_debug
	ldr	w8, [x20]
Lloh2:
	adrp	x9, _NFC_PROTO_ISO14443_MASK@GOTPAGE
Lloh3:
	ldr	x9, [x9, _NFC_PROTO_ISO14443_MASK@GOTPAGEOFF]
Lloh4:
	ldr	w9, [x9]
Lloh5:
	adrp	x10, _NFC_PROTO_ISO14443_B_MASK@GOTPAGE
Lloh6:
	ldr	x10, [x10, _NFC_PROTO_ISO14443_B_MASK@GOTPAGEOFF]
Lloh7:
	ldr	w10, [x10]
	orr	w9, w10, w9
	tst	w9, w8
	b.eq	LBB0_3
; %bb.1:
	ldr	w1, [x20, #8]
Lloh8:
	adrp	x8, _PN544_RF_READER_CMD_PRESENCE_CHECK@GOTPAGE
Lloh9:
	ldr	x8, [x8, _PN544_RF_READER_CMD_PRESENCE_CHECK@GOTPAGEOFF]
LBB0_2:
	ldr	w2, [x8]
	mov	x0, x19
	mov	x3, #0
	mov	w4, #0
	b	LBB0_6
LBB0_3:
Lloh10:
	adrp	x9, _NFC_PROTO_MIFARE_MASK@GOTPAGE
Lloh11:
	ldr	x9, [x9, _NFC_PROTO_MIFARE_MASK@GOTPAGEOFF]
Lloh12:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_7
; %bb.4:
	ldr	w4, [x20, #4]
	cmp	w4, #10
	mov	w8, #1
	lsl	w8, w8, w4
	mov	w9, #1168
	and	w8, w8, w9
	ccmp	w8, #0, #4, ls
	b.eq	LBB0_8
; %bb.5:
Lloh13:
	adrp	x8, _NFC_HCI_RF_READER_A_GATE@GOTPAGE
Lloh14:
	ldr	x8, [x8, _NFC_HCI_RF_READER_A_GATE@GOTPAGEOFF]
Lloh15:
	ldr	w1, [x8]
Lloh16:
	adrp	x8, _PN544_RF_READER_CMD_ACTIVATE_NEXT@GOTPAGE
Lloh17:
	ldr	x8, [x8, _PN544_RF_READER_CMD_ACTIVATE_NEXT@GOTPAGEOFF]
Lloh18:
	ldr	w2, [x8]
	ldr	x3, [x20, #16]
	mov	x0, x19
LBB0_6:
	mov	x5, #0
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_nfc_hci_send_cmd
LBB0_7:
Lloh19:
	adrp	x9, _NFC_PROTO_JEWEL_MASK@GOTPAGE
Lloh20:
	ldr	x9, [x9, _NFC_PROTO_JEWEL_MASK@GOTPAGEOFF]
Lloh21:
	ldr	w9, [x9]
Lloh22:
	adrp	x10, _NFC_PROTO_FELICA_MASK@GOTPAGE
Lloh23:
	ldr	x10, [x10, _NFC_PROTO_FELICA_MASK@GOTPAGEOFF]
Lloh24:
	ldr	w10, [x10]
	orr	w9, w10, w9
	tst	w9, w8
	b.eq	LBB0_10
LBB0_8:
Lloh25:
	adrp	x8, _EOPNOTSUPP@GOTPAGE
Lloh26:
	ldr	x8, [x8, _EOPNOTSUPP@GOTPAGEOFF]
Lloh27:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_9:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
LBB0_10:
Lloh28:
	adrp	x9, _NFC_PROTO_NFC_DEP_MASK@GOTPAGE
Lloh29:
	ldr	x9, [x9, _NFC_PROTO_NFC_DEP_MASK@GOTPAGEOFF]
Lloh30:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_12
; %bb.11:
	ldr	w1, [x20, #8]
Lloh31:
	adrp	x8, _PN544_HCI_CMD_ATTREQUEST@GOTPAGE
Lloh32:
	ldr	x8, [x8, _PN544_HCI_CMD_ATTREQUEST@GOTPAGEOFF]
	b	LBB0_2
LBB0_12:
	mov	w0, #0
	b	LBB0_9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGot	Lloh31, Lloh32
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"supported protocol %d\b"

	.comm	_NFC_PROTO_ISO14443_MASK,4,2    ; @NFC_PROTO_ISO14443_MASK
	.comm	_NFC_PROTO_ISO14443_B_MASK,4,2  ; @NFC_PROTO_ISO14443_B_MASK
	.comm	_PN544_RF_READER_CMD_PRESENCE_CHECK,4,2 ; @PN544_RF_READER_CMD_PRESENCE_CHECK
	.comm	_NFC_PROTO_MIFARE_MASK,4,2      ; @NFC_PROTO_MIFARE_MASK
	.comm	_EOPNOTSUPP,4,2                 ; @EOPNOTSUPP
	.comm	_NFC_HCI_RF_READER_A_GATE,4,2   ; @NFC_HCI_RF_READER_A_GATE
	.comm	_PN544_RF_READER_CMD_ACTIVATE_NEXT,4,2 ; @PN544_RF_READER_CMD_ACTIVATE_NEXT
	.comm	_NFC_PROTO_JEWEL_MASK,4,2       ; @NFC_PROTO_JEWEL_MASK
	.comm	_NFC_PROTO_FELICA_MASK,4,2      ; @NFC_PROTO_FELICA_MASK
	.comm	_NFC_PROTO_NFC_DEP_MASK,4,2     ; @NFC_PROTO_NFC_DEP_MASK
	.comm	_PN544_HCI_CMD_ATTREQUEST,4,2   ; @PN544_HCI_CMD_ATTREQUEST
	.no_dead_strip	_pn544_hci_check_presence
.subsections_via_symbols
