	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function st21nfca_hci_target_from_gate
_st21nfca_hci_target_from_gate:         ## @st21nfca_hci_target_from_gate
	.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
	movq	%rdx, %r15
	movl	%esi, %ebx
	movq	%rdi, %r12
	movq	%rsp, %r13
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	_NFC_NFCID1_MAXSIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	shlq	$2, %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %r14
	cmpl	$128, %ebx
	je	LBB0_11
## %bb.1:
	cmpl	$130, %ebx
	je	LBB0_4
## %bb.2:
	cmpl	$129, %ebx
	jne	LBB0_10
## %bb.3:
	movq	_NFC_PROTO_FELICA_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%r15)
	jmp	LBB0_13
LBB0_11:
	movq	_NFC_PROTO_ISO15693_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%r15)
	movq	%r12, %rdi
	movq	%r15, %rsi
	callq	_st21nfca_get_iso15693_inventory
	testl	%eax, %eax
	jns	LBB0_13
	jmp	LBB0_14
LBB0_4:
	leaq	-56(%rbp), %rsi
	movq	%r12, %rdi
	callq	_st21nfca_get_iso14443_3_atqa
	testl	%eax, %eax
	js	LBB0_14
## %bb.5:
	cmpl	$12, -56(%rbp)
	jne	LBB0_7
## %bb.6:
	movq	_NFC_PROTO_JEWEL_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%r15)
	movl	$3072, 4(%r15)                  ## imm = 0xC00
LBB0_13:
	xorl	%eax, %eax
	jmp	LBB0_14
LBB0_7:
	leaq	-52(%rbp), %rsi
	movq	%r12, %rdi
	callq	_st21nfca_get_iso14443_3_sak
	testl	%eax, %eax
	js	LBB0_14
## %bb.8:
	leaq	-60(%rbp), %rdx
	movq	%r12, %rdi
	movq	%r14, %rsi
	callq	_st21nfca_get_iso14443_3_uid
	testl	%eax, %eax
	js	LBB0_14
## %bb.9:
	movl	-52(%rbp), %edi
	callq	_nfc_hci_sak_to_protocol
	movl	%eax, (%r15)
	cmpl	$-1, %eax
	je	LBB0_10
## %bb.12:
	movl	-56(%rbp), %eax
	movl	%eax, 4(%r15)
	movl	-52(%rbp), %eax
	movl	%eax, 8(%r15)
	movl	16(%r15), %edi
	movl	-60(%rbp), %edx
	movq	%r14, %rsi
	callq	_memcpy
	movl	-60(%rbp), %eax
	movl	%eax, 12(%r15)
	jmp	LBB0_13
LBB0_10:
	movq	_EPROTO@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_14:
	movq	%r13, %rsp
	movq	___stack_chk_guard@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	-48(%rbp), %rcx
	jne	LBB0_16
## %bb.15:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_16:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_NFC_NFCID1_MAXSIZE,4,2         ## @NFC_NFCID1_MAXSIZE
	.comm	_NFC_PROTO_FELICA_MASK,4,2      ## @NFC_PROTO_FELICA_MASK
	.comm	_NFC_PROTO_JEWEL_MASK,4,2       ## @NFC_PROTO_JEWEL_MASK
	.comm	_EPROTO,4,2                     ## @EPROTO
	.comm	_NFC_PROTO_ISO15693_MASK,4,2    ## @NFC_PROTO_ISO15693_MASK
	.no_dead_strip	_st21nfca_hci_target_from_gate
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function st21nfca_hci_target_from_gate
_st21nfca_hci_target_from_gate:         ; @st21nfca_hci_target_from_gate
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	sub	sp, sp, #32
	mov	x19, x2
	mov	x21, x0
	mov	x22, sp
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-40]
Lloh3:
	adrp	x8, _NFC_NFCID1_MAXSIZE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _NFC_NFCID1_MAXSIZE@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	lsl	x8, x8, #2
	mov	x9, x8
Lloh6:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh7:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x9, sp
	add	x8, x8, #15
	and	x8, x8, #0x7fffffff0
	sub	x20, x9, x8
	mov	sp, x20
	cmp	w1, #128
	b.eq	LBB0_4
; %bb.1:
	cmp	w1, #130
	b.eq	LBB0_5
; %bb.2:
	cmp	w1, #129
	b.ne	LBB0_13
; %bb.3:
Lloh8:
	adrp	x8, _NFC_PROTO_FELICA_MASK@GOTPAGE
Lloh9:
	ldr	x8, [x8, _NFC_PROTO_FELICA_MASK@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	str	w8, [x19]
	b	LBB0_8
LBB0_4:
Lloh11:
	adrp	x8, _NFC_PROTO_ISO15693_MASK@GOTPAGE
Lloh12:
	ldr	x8, [x8, _NFC_PROTO_ISO15693_MASK@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	str	w8, [x19]
	mov	x0, x21
	mov	x1, x19
	bl	_st21nfca_get_iso15693_inventory
	tbz	w0, #31, LBB0_8
	b	LBB0_14
LBB0_5:
	sub	x1, x29, #48
	mov	x0, x21
	bl	_st21nfca_get_iso14443_3_atqa
	tbnz	w0, #31, LBB0_14
; %bb.6:
	ldur	w8, [x29, #-48]
	cmp	w8, #12
	b.ne	LBB0_9
; %bb.7:
Lloh14:
	adrp	x8, _NFC_PROTO_JEWEL_MASK@GOTPAGE
Lloh15:
	ldr	x8, [x8, _NFC_PROTO_JEWEL_MASK@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
	mov	w9, #3072
	stp	w8, w9, [x19]
LBB0_8:
	mov	w0, #0
	b	LBB0_14
LBB0_9:
	sub	x1, x29, #52
	mov	x0, x21
	bl	_st21nfca_get_iso14443_3_sak
	tbnz	w0, #31, LBB0_14
; %bb.10:
	sub	x2, x29, #44
	mov	x0, x21
	mov	x1, x20
	bl	_st21nfca_get_iso14443_3_uid
	tbnz	w0, #31, LBB0_14
; %bb.11:
	ldur	w0, [x29, #-52]
	bl	_nfc_hci_sak_to_protocol
	str	w0, [x19]
	cmn	w0, #1
	b.eq	LBB0_13
; %bb.12:
	ldp	w9, w8, [x29, #-52]
	stp	w8, w9, [x19, #4]
	ldr	w0, [x19, #16]
	ldur	w2, [x29, #-44]
	mov	x1, x20
	bl	_memcpy
	ldur	w8, [x29, #-44]
	str	w8, [x19, #12]
	b	LBB0_8
LBB0_13:
Lloh17:
	adrp	x8, _EPROTO@GOTPAGE
Lloh18:
	ldr	x8, [x8, _EPROTO@GOTPAGEOFF]
Lloh19:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_14:
	mov	sp, x22
	ldur	x8, [x29, #-40]
Lloh20:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh21:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh22:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_16
; %bb.15:
	sub	sp, x29, #32
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
LBB0_16:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.cfi_endproc
                                        ; -- End function
	.comm	_NFC_NFCID1_MAXSIZE,4,2         ; @NFC_NFCID1_MAXSIZE
	.comm	_NFC_PROTO_FELICA_MASK,4,2      ; @NFC_PROTO_FELICA_MASK
	.comm	_NFC_PROTO_JEWEL_MASK,4,2       ; @NFC_PROTO_JEWEL_MASK
	.comm	_EPROTO,4,2                     ; @EPROTO
	.comm	_NFC_PROTO_ISO15693_MASK,4,2    ; @NFC_PROTO_ISO15693_MASK
	.no_dead_strip	_st21nfca_hci_target_from_gate
.subsections_via_symbols
