	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function netxen_can_start_firmware
_netxen_can_start_firmware:             ## @netxen_can_start_firmware
	.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	%rdi, %r15
	callq	_netxen_api_lock
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movq	%r15, %rdi
	callq	_nx_incr_dev_ref_cnt
	movl	$-1, %r14d
	jmp	LBB0_5
LBB0_2:
	movq	_NX_CRB_DEV_REF_COUNT@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	movq	%r15, %rdi
	callq	_NXRD32
	movq	_NX_MAX_PCI_FUNC@GOTPCREL(%rip), %rcx
	xorl	%r14d, %r14d
	cmpl	(%rcx), %eax
	movl	$0, %ebx
	cmovll	%eax, %ebx
	testl	%eax, %eax
	cmovsl	%r14d, %ebx
	testl	%ebx, %ebx
	jne	LBB0_4
## %bb.3:
	movq	_NX_CRB_DEV_STATE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_NX_DEV_INITALIZING@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r15, %rdi
	callq	_NXWR32
	movl	$1, %r14d
LBB0_4:
	movl	(%r12), %esi
	incl	%ebx
	movq	%r15, %rdi
	movl	%ebx, %edx
	callq	_NXWR32
	movq	%r15, %rdi
	callq	_netxen_api_unlock
LBB0_5:
	movl	%r14d, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_NX_CRB_DEV_REF_COUNT,4,2       ## @NX_CRB_DEV_REF_COUNT
	.comm	_NX_MAX_PCI_FUNC,4,2            ## @NX_MAX_PCI_FUNC
	.comm	_NX_CRB_DEV_STATE,4,2           ## @NX_CRB_DEV_STATE
	.comm	_NX_DEV_INITALIZING,4,2         ## @NX_DEV_INITALIZING
	.no_dead_strip	_netxen_can_start_firmware
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function netxen_can_start_firmware
_netxen_can_start_firmware:             ; @netxen_can_start_firmware
	.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	x19, x0
	bl	_netxen_api_lock
	cbz	x0, LBB0_2
; %bb.1:
	mov	x0, x19
	bl	_nx_incr_dev_ref_cnt
	mov	w20, #-1
	b	LBB0_5
LBB0_2:
Lloh0:
	adrp	x21, _NX_CRB_DEV_REF_COUNT@GOTPAGE
Lloh1:
	ldr	x21, [x21, _NX_CRB_DEV_REF_COUNT@GOTPAGEOFF]
	ldr	w1, [x21]
	mov	x0, x19
	bl	_NXRD32
	mov	w20, #0
Lloh2:
	adrp	x8, _NX_MAX_PCI_FUNC@GOTPAGE
Lloh3:
	ldr	x8, [x8, _NX_MAX_PCI_FUNC@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	cmp	w0, w8
	mov	w8, #-1
	ccmp	w0, w8, #4, lt
	csel	w22, w0, wzr, gt
	cbnz	w22, LBB0_4
; %bb.3:
Lloh5:
	adrp	x8, _NX_CRB_DEV_STATE@GOTPAGE
Lloh6:
	ldr	x8, [x8, _NX_CRB_DEV_STATE@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
Lloh8:
	adrp	x8, _NX_DEV_INITALIZING@GOTPAGE
Lloh9:
	ldr	x8, [x8, _NX_DEV_INITALIZING@GOTPAGEOFF]
Lloh10:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_NXWR32
	mov	w20, #1
LBB0_4:
	ldr	w1, [x21]
	add	w2, w22, #1
	mov	x0, x19
	bl	_NXWR32
	mov	x0, x19
	bl	_netxen_api_unlock
LBB0_5:
	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
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_NX_CRB_DEV_REF_COUNT,4,2       ; @NX_CRB_DEV_REF_COUNT
	.comm	_NX_MAX_PCI_FUNC,4,2            ; @NX_MAX_PCI_FUNC
	.comm	_NX_CRB_DEV_STATE,4,2           ; @NX_CRB_DEV_STATE
	.comm	_NX_DEV_INITALIZING,4,2         ; @NX_DEV_INITALIZING
	.no_dead_strip	_netxen_can_start_firmware
.subsections_via_symbols
