	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_nfcmrvl_nci_register_dev       ## -- Begin function nfcmrvl_nci_register_dev
	.p2align	4, 0x90
_nfcmrvl_nci_register_dev:              ## @nfcmrvl_nci_register_dev
	.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	%r8, -48(%rbp)                  ## 8-byte Spill
	movq	%rcx, %r12
	movq	%rdx, %rbx
	movq	%rsi, %r15
	movl	%edi, %r13d
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$56, %edi
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_1
## %bb.3:
	movq	%rax, %r14
	movq	%r15, 48(%rax)
	movq	%rbx, 40(%rax)
	movq	%r12, 32(%rax)
	movl	%r13d, (%rax)
	movq	%rax, %r15
	addq	$8, %r15
	movq	%r15, %rdi
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	movl	$4, %edx
	callq	_memcpy
	movl	8(%r14), %edi
	callq	_gpio_is_valid
	testq	%rax, %rax
	je	LBB0_6
## %bb.4:
	movl	(%r15), %edi
	movq	_GPIOF_OUT_INIT_LOW@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rdx
	callq	_gpio_request_one
	testl	%eax, %eax
	jns	LBB0_6
## %bb.5:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ecx, %ecx
	subl	(%rax), %ecx
	movl	%ecx, (%r15)
	leaq	L_.str.1(%rip), %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	callq	_nfc_err
LBB0_6:
	movq	_NFCMRVL_PHY_SPI@GOTPCREL(%rip), %rsi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	movl	$0, %eax
	cmpl	%r13d, (%rsi)
	sete	%bl
	jne	LBB0_8
## %bb.7:
	movq	_NCI_SPI_HDR_LEN@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
LBB0_8:
	movb	%bl, %cl
	cmpq	$0, 16(%r14)
	je	LBB0_10
## %bb.9:
	movq	_NFCMRVL_HCI_EVENT_HEADER_SIZE@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
LBB0_10:
	movq	_NFC_PROTO_JEWEL_MASK@GOTPCREL(%rip), %rdi
	movq	_NFC_PROTO_MIFARE_MASK@GOTPCREL(%rip), %rsi
	movl	(%rsi), %esi
	orl	(%rdi), %esi
	movq	_NFC_PROTO_FELICA_MASK@GOTPCREL(%rip), %rdi
	orl	(%rdi), %esi
	movq	_NFC_PROTO_ISO14443_MASK@GOTPCREL(%rip), %rdi
	orl	(%rdi), %esi
	movq	_NFC_PROTO_ISO14443_B_MASK@GOTPCREL(%rip), %rdi
	orl	(%rdi), %esi
	movq	_NFC_PROTO_ISO15693_MASK@GOTPCREL(%rip), %rdi
	orl	(%rdi), %esi
	addl	%eax, %edx
	movq	_NFC_PROTO_NFC_DEP_MASK@GOTPCREL(%rip), %rax
	orl	(%rax), %esi
	movq	_nfcmrvl_nci_ops@GOTPCREL(%rip), %rdi
	callq	_nci_allocate_device
	movl	%eax, 24(%r14)
	testl	%eax, %eax
	movq	%r12, %rbx
	je	LBB0_11
## %bb.12:
	movq	%r14, %rdi
	callq	_nfcmrvl_fw_dnld_init
	testl	%eax, %eax
	je	LBB0_14
## %bb.13:
	movl	%eax, %r12d
	leaq	L_.str.3(%rip), %rsi
	movq	%rbx, %rdi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_nfc_err
	jmp	LBB0_16
LBB0_1:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%edi, %edi
	subl	(%rax), %edi
	jmp	LBB0_2
LBB0_11:
	leaq	L_.str.2(%rip), %rsi
	xorl	%r12d, %r12d
	movq	%rbx, %rdi
	xorl	%eax, %eax
	callq	_nfc_err
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	subl	(%rax), %r12d
	jmp	LBB0_17
LBB0_14:
	movl	24(%r14), %edi
	movq	%r14, %rsi
	callq	_nci_set_drvdata
	movl	24(%r14), %edi
	callq	_nci_register_device
	testl	%eax, %eax
	je	LBB0_20
## %bb.15:
	movl	%eax, %r12d
	leaq	L_.str.4(%rip), %rsi
	movq	%rbx, %rdi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_nfc_err
	movq	%r14, %rdi
	callq	_nfcmrvl_fw_dnld_deinit
LBB0_16:
	movl	24(%r14), %edi
	callq	_nci_free_device
LBB0_17:
	movl	(%r15), %edi
	callq	_gpio_is_valid
	testq	%rax, %rax
	je	LBB0_19
## %bb.18:
	movl	(%r15), %edi
	callq	_gpio_free
LBB0_19:
	movq	%r14, %rdi
	callq	_kfree
	movl	%r12d, %edi
LBB0_2:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_ERR_PTR                        ## TAILCALL
LBB0_20:
	movq	%r14, %rdi
	callq	_nfcmrvl_chip_halt
	leaq	L_.str.5(%rip), %rsi
	movq	%rbx, %rdi
	callq	_nfc_info
	movq	%r14, %rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_GPIOF_OUT_INIT_LOW,4,2         ## @GPIOF_OUT_INIT_LOW
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"nfcmrvl_reset_n"

	.comm	_EINVAL,4,2                     ## @EINVAL
L_.str.1:                               ## @.str.1
	.asciz	"failed to request reset_n io\n"

	.comm	_NFCMRVL_PHY_SPI,4,2            ## @NFCMRVL_PHY_SPI
	.comm	_NCI_SPI_HDR_LEN,4,2            ## @NCI_SPI_HDR_LEN
	.comm	_NFCMRVL_HCI_EVENT_HEADER_SIZE,8,3 ## @NFCMRVL_HCI_EVENT_HEADER_SIZE
	.comm	_NFC_PROTO_JEWEL_MASK,4,2       ## @NFC_PROTO_JEWEL_MASK
	.comm	_NFC_PROTO_MIFARE_MASK,4,2      ## @NFC_PROTO_MIFARE_MASK
	.comm	_NFC_PROTO_FELICA_MASK,4,2      ## @NFC_PROTO_FELICA_MASK
	.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	_NFC_PROTO_ISO15693_MASK,4,2    ## @NFC_PROTO_ISO15693_MASK
	.comm	_NFC_PROTO_NFC_DEP_MASK,4,2     ## @NFC_PROTO_NFC_DEP_MASK
	.comm	_nfcmrvl_nci_ops,4,2            ## @nfcmrvl_nci_ops
L_.str.2:                               ## @.str.2
	.asciz	"nci_allocate_device failed\n"

L_.str.3:                               ## @.str.3
	.asciz	"failed to initialize FW download %d\n"

L_.str.4:                               ## @.str.4
	.asciz	"nci_register_device failed %d\n"

L_.str.5:                               ## @.str.5
	.asciz	"registered with nci successfully\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_nfcmrvl_nci_register_dev       ; -- Begin function nfcmrvl_nci_register_dev
	.p2align	2
_nfcmrvl_nci_register_dev:              ; @nfcmrvl_nci_register_dev
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.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
	mov	x23, x4
	mov	x21, x3
	mov	x20, x2
	mov	x24, x1
	mov	x22, x0
Lloh0:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	w0, #56
	bl	_kzalloc
	cbz	x0, LBB0_7
; %bb.1:
	mov	x19, x0
	stp	x20, x24, [x0, #40]
	str	x21, [x0, #32]
	add	x20, x0, #8
	str	w22, [x0]
	mov	x0, x20
	mov	x1, x23
	mov	w2, #4
	bl	_memcpy
	ldr	w0, [x19, #8]
	bl	_gpio_is_valid
	cbz	x0, LBB0_4
; %bb.2:
	ldr	w0, [x20]
Lloh3:
	adrp	x8, _GPIOF_OUT_INIT_LOW@GOTPAGE
Lloh4:
	ldr	x8, [x8, _GPIOF_OUT_INIT_LOW@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
Lloh6:
	adrp	x2, l_.str@PAGE
Lloh7:
	add	x2, x2, l_.str@PAGEOFF
	bl	_gpio_request_one
	tbz	w0, #31, LBB0_4
; %bb.3:
Lloh8:
	adrp	x8, _EINVAL@GOTPAGE
Lloh9:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	neg	w8, w8
	str	w8, [x20]
Lloh11:
	adrp	x1, l_.str.1@PAGE
Lloh12:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x21
	bl	_nfc_err
LBB0_4:
Lloh13:
	adrp	x8, _NFCMRVL_PHY_SPI@GOTPAGE
Lloh14:
	ldr	x8, [x8, _NFCMRVL_PHY_SPI@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
Lloh16:
	adrp	x9, _NCI_SPI_HDR_LEN@GOTPAGE
Lloh17:
	ldr	x9, [x9, _NCI_SPI_HDR_LEN@GOTPAGEOFF]
Lloh18:
	ldr	w9, [x9]
	cmp	w8, w22
	csel	w8, w9, wzr, eq
	cset	w3, eq
	ldr	x9, [x19, #16]
Lloh19:
	adrp	x10, _NFCMRVL_HCI_EVENT_HEADER_SIZE@GOTPAGE
Lloh20:
	ldr	x10, [x10, _NFCMRVL_HCI_EVENT_HEADER_SIZE@GOTPAGEOFF]
Lloh21:
	ldr	w10, [x10]
	cmp	x9, #0
	csel	w9, wzr, w10, eq
	add	w2, w9, w8
Lloh22:
	adrp	x8, _NFC_PROTO_JEWEL_MASK@GOTPAGE
Lloh23:
	ldr	x8, [x8, _NFC_PROTO_JEWEL_MASK@GOTPAGEOFF]
Lloh24:
	ldr	w8, [x8]
Lloh25:
	adrp	x9, _NFC_PROTO_MIFARE_MASK@GOTPAGE
Lloh26:
	ldr	x9, [x9, _NFC_PROTO_MIFARE_MASK@GOTPAGEOFF]
Lloh27:
	ldr	w9, [x9]
	orr	w8, w9, w8
Lloh28:
	adrp	x9, _NFC_PROTO_FELICA_MASK@GOTPAGE
Lloh29:
	ldr	x9, [x9, _NFC_PROTO_FELICA_MASK@GOTPAGEOFF]
Lloh30:
	ldr	w9, [x9]
	orr	w8, w8, w9
Lloh31:
	adrp	x9, _NFC_PROTO_ISO14443_MASK@GOTPAGE
Lloh32:
	ldr	x9, [x9, _NFC_PROTO_ISO14443_MASK@GOTPAGEOFF]
Lloh33:
	ldr	w9, [x9]
	orr	w8, w8, w9
Lloh34:
	adrp	x9, _NFC_PROTO_ISO14443_B_MASK@GOTPAGE
Lloh35:
	ldr	x9, [x9, _NFC_PROTO_ISO14443_B_MASK@GOTPAGEOFF]
Lloh36:
	ldr	w9, [x9]
	orr	w8, w8, w9
Lloh37:
	adrp	x9, _NFC_PROTO_ISO15693_MASK@GOTPAGE
Lloh38:
	ldr	x9, [x9, _NFC_PROTO_ISO15693_MASK@GOTPAGEOFF]
Lloh39:
	ldr	w9, [x9]
	orr	w8, w8, w9
Lloh40:
	adrp	x9, _NFC_PROTO_NFC_DEP_MASK@GOTPAGE
Lloh41:
	ldr	x9, [x9, _NFC_PROTO_NFC_DEP_MASK@GOTPAGEOFF]
Lloh42:
	ldr	w9, [x9]
	orr	w1, w8, w9
Lloh43:
	adrp	x0, _nfcmrvl_nci_ops@GOTPAGE
Lloh44:
	ldr	x0, [x0, _nfcmrvl_nci_ops@GOTPAGEOFF]
	bl	_nci_allocate_device
	str	w0, [x19, #24]
	cbz	w0, LBB0_8
; %bb.5:
	mov	x0, x19
	bl	_nfcmrvl_fw_dnld_init
	cbz	w0, LBB0_9
; %bb.6:
	mov	x22, x0
	str	x22, [sp]
Lloh45:
	adrp	x1, l_.str.3@PAGE
Lloh46:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x0, x21
	bl	_nfc_err
	b	LBB0_11
LBB0_7:
Lloh47:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh48:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh49:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_15
LBB0_8:
Lloh50:
	adrp	x1, l_.str.2@PAGE
Lloh51:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x21
	bl	_nfc_err
Lloh52:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh53:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh54:
	ldr	w8, [x8]
	neg	w22, w8
	b	LBB0_12
LBB0_9:
	ldr	w0, [x19, #24]
	mov	x1, x19
	bl	_nci_set_drvdata
	ldr	w0, [x19, #24]
	bl	_nci_register_device
	cbz	w0, LBB0_16
; %bb.10:
	mov	x22, x0
	str	x22, [sp]
Lloh55:
	adrp	x1, l_.str.4@PAGE
Lloh56:
	add	x1, x1, l_.str.4@PAGEOFF
	mov	x0, x21
	bl	_nfc_err
	mov	x0, x19
	bl	_nfcmrvl_fw_dnld_deinit
                                        ; kill: def $w22 killed $w22 killed $x22 def $x22
LBB0_11:
	ldr	w0, [x19, #24]
	bl	_nci_free_device
LBB0_12:
	ldr	w0, [x20]
	bl	_gpio_is_valid
	cbz	x0, LBB0_14
; %bb.13:
	ldr	w0, [x20]
	bl	_gpio_free
LBB0_14:
	mov	x0, x19
	bl	_kfree
	mov	x0, x22
LBB0_15:
	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
	add	sp, sp, #80
	b	_ERR_PTR
LBB0_16:
	mov	x0, x19
	bl	_nfcmrvl_chip_halt
Lloh57:
	adrp	x1, l_.str.5@PAGE
Lloh58:
	add	x1, x1, l_.str.5@PAGEOFF
	mov	x0, x21
	bl	_nfc_info
	mov	x0, x19
	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
	add	sp, sp, #80
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh43, Lloh44
	.loh AdrpLdrGotLdr	Lloh40, Lloh41, Lloh42
	.loh AdrpLdrGotLdr	Lloh37, Lloh38, Lloh39
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpAdd	Lloh45, Lloh46
	.loh AdrpLdrGotLdr	Lloh47, Lloh48, Lloh49
	.loh AdrpLdrGotLdr	Lloh52, Lloh53, Lloh54
	.loh AdrpAdd	Lloh50, Lloh51
	.loh AdrpAdd	Lloh55, Lloh56
	.loh AdrpAdd	Lloh57, Lloh58
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_GPIOF_OUT_INIT_LOW,4,2         ; @GPIOF_OUT_INIT_LOW
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"nfcmrvl_reset_n"

	.comm	_EINVAL,4,2                     ; @EINVAL
l_.str.1:                               ; @.str.1
	.asciz	"failed to request reset_n io\n"

	.comm	_NFCMRVL_PHY_SPI,4,2            ; @NFCMRVL_PHY_SPI
	.comm	_NCI_SPI_HDR_LEN,4,2            ; @NCI_SPI_HDR_LEN
	.comm	_NFCMRVL_HCI_EVENT_HEADER_SIZE,8,3 ; @NFCMRVL_HCI_EVENT_HEADER_SIZE
	.comm	_NFC_PROTO_JEWEL_MASK,4,2       ; @NFC_PROTO_JEWEL_MASK
	.comm	_NFC_PROTO_MIFARE_MASK,4,2      ; @NFC_PROTO_MIFARE_MASK
	.comm	_NFC_PROTO_FELICA_MASK,4,2      ; @NFC_PROTO_FELICA_MASK
	.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	_NFC_PROTO_ISO15693_MASK,4,2    ; @NFC_PROTO_ISO15693_MASK
	.comm	_NFC_PROTO_NFC_DEP_MASK,4,2     ; @NFC_PROTO_NFC_DEP_MASK
	.comm	_nfcmrvl_nci_ops,4,2            ; @nfcmrvl_nci_ops
l_.str.2:                               ; @.str.2
	.asciz	"nci_allocate_device failed\n"

l_.str.3:                               ; @.str.3
	.asciz	"failed to initialize FW download %d\n"

l_.str.4:                               ; @.str.4
	.asciz	"nci_register_device failed %d\n"

l_.str.5:                               ; @.str.5
	.asciz	"registered with nci successfully\n"

.subsections_via_symbols
