	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_nxp_nci_fw_download            ## -- Begin function nxp_nci_fw_download
	.p2align	4, 0x90
_nxp_nci_fw_download:                   ## @nxp_nci_fw_download
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r15
	movq	%rdi, %rbx
	callq	_nci_get_drvdata
	movq	%rax, %r14
	movq	%rax, %rdi
	callq	_mutex_lock
	movq	16(%r14), %rax
	cmpq	$0, (%rax)
	je	LBB0_2
## %bb.1:
	cmpl	$0, 8(%rax)
	je	LBB0_2
## %bb.4:
	testq	%r15, %r15
	je	LBB0_6
## %bb.5:
	cmpb	$0, (%r15)
	je	LBB0_6
## %bb.7:
	movl	72(%r14), %edi
	movq	%r15, %rsi
	callq	_strcpy
	leaq	56(%r14), %r12
	movq	(%rbx), %rax
	movl	(%rax), %edx
	movq	%r12, %rdi
	movq	%r15, %rsi
	callq	_request_firmware
	testl	%eax, %eax
	js	LBB0_8
## %bb.9:
	movq	16(%r14), %rax
	movl	8(%r14), %edi
	movq	_NXP_NCI_MODE_FW@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	callq	*(%rax)
	movl	%eax, %ebx
	testl	%eax, %eax
	js	LBB0_10
## %bb.11:
	movl	(%r15), %eax
	movl	%eax, 4(%r14)
	movq	56(%r14), %rax
	movl	4(%rax), %ecx
	movq	%r14, %rdi
	addq	$24, %rdi
	movl	%ecx, 68(%r14)
	movl	(%rax), %eax
	movl	%eax, 64(%r14)
	xorps	%xmm0, %xmm0
	movups	%xmm0, 32(%r14)
	movq	$0, 48(%r14)
	callq	_schedule_work
	jmp	LBB0_12
LBB0_2:
	movq	_ENOTSUPP@GOTPCREL(%rip), %rax
	jmp	LBB0_3
LBB0_6:
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_3:
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_12:
	movq	%r14, %rdi
	callq	_mutex_unlock
	movl	%ebx, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	movl	%eax, %ebx
	jmp	LBB0_12
LBB0_10:
	movq	(%r12), %rdi
	callq	_release_firmware
	jmp	LBB0_12
	.cfi_endproc
                                        ## -- End function
	.comm	_ENOTSUPP,4,2                   ## @ENOTSUPP
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_NXP_NCI_MODE_FW,4,2            ## @NXP_NCI_MODE_FW
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_nxp_nci_fw_download            ; -- Begin function nxp_nci_fw_download
	.p2align	2
_nxp_nci_fw_download:                   ; @nxp_nci_fw_download
	.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
	mov	x20, x1
	mov	x21, x0
	bl	_nci_get_drvdata
	mov	x19, x0
	bl	_mutex_lock
	ldr	x8, [x19, #16]
	ldr	x9, [x8]
	cbz	x9, LBB0_7
; %bb.1:
	ldr	w8, [x8, #8]
	cbz	w8, LBB0_7
; %bb.2:
	cbz	x20, LBB0_8
; %bb.3:
	ldrb	w8, [x20]
	cbz	w8, LBB0_8
; %bb.4:
	ldr	w0, [x19, #72]
	mov	x1, x20
	bl	_strcpy
	add	x22, x19, #56
	ldr	x8, [x21]
	ldr	w2, [x8]
	mov	x0, x22
	mov	x1, x20
	bl	_request_firmware
	tbnz	w0, #31, LBB0_11
; %bb.5:
	ldr	x8, [x19, #16]
	ldr	x8, [x8]
	ldr	w0, [x19, #8]
Lloh0:
	adrp	x21, _NXP_NCI_MODE_FW@GOTPAGE
Lloh1:
	ldr	x21, [x21, _NXP_NCI_MODE_FW@GOTPAGEOFF]
	ldr	w1, [x21]
	blr	x8
	mov	x20, x0
	tbnz	w0, #31, LBB0_12
; %bb.6:
	ldr	w8, [x21]
	str	w8, [x19, #4]
	ldr	x8, [x19, #56]
	add	x0, x19, #24
	ldr	d0, [x8]
	str	d0, [x19, #64]
	stp	xzr, xzr, [x19, #40]
	str	xzr, [x19, #32]
	bl	_schedule_work
	b	LBB0_10
LBB0_7:
Lloh2:
	adrp	x8, _ENOTSUPP@GOTPAGE
Lloh3:
	ldr	x8, [x8, _ENOTSUPP@GOTPAGEOFF]
	b	LBB0_9
LBB0_8:
Lloh4:
	adrp	x8, _EINVAL@GOTPAGE
Lloh5:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_9:
	ldr	w8, [x8]
	neg	w20, w8
LBB0_10:
	mov	x0, x19
	bl	_mutex_unlock
	mov	x0, x20
	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_11:
	mov	x20, x0
	b	LBB0_10
LBB0_12:
	ldr	x0, [x22]
	bl	_release_firmware
	b	LBB0_10
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_ENOTSUPP,4,2                   ; @ENOTSUPP
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_NXP_NCI_MODE_FW,4,2            ; @NXP_NCI_MODE_FW
.subsections_via_symbols
