	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function nfp_nsp_check
_nfp_nsp_check:                         ## @nfp_nsp_check
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movq	24(%rdi), %r14
	movl	16(%rdi), %edi
	callq	_nfp_resource_cpp_id
	movl	%eax, %r15d
	movl	16(%rbx), %edi
	callq	_nfp_resource_address
	movq	_NSP_STATUS@GOTPCREL(%rip), %rcx
	addl	(%rcx), %eax
	leaq	-28(%rbp), %rcx
	movq	%r14, %rdi
	movl	%r15d, %esi
	movl	%eax, %edx
	callq	_nfp_cpp_readq
	testl	%eax, %eax
	js	LBB0_1
## %bb.2:
	movq	_NSP_STATUS_MAGIC@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	-28(%rbp), %esi
	callq	_FIELD_GET
	movq	_NSP_MAGIC@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_3
## %bb.4:
	movq	_NSP_STATUS_MAJOR@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	-28(%rbp), %esi
	callq	_FIELD_GET
	movq	%rax, (%rbx)
	movq	_NSP_STATUS_MINOR@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	-28(%rbp), %esi
	callq	_FIELD_GET
	movq	%rax, 8(%rbx)
	movq	(%rbx), %rdx
	movq	_NSP_MAJOR@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rdx
	jne	LBB0_5
## %bb.7:
	movq	_NSP_MINOR@GOTPCREL(%rip), %rcx
	movq	(%rcx), %r9
	cmpq	%r9, %rax
	jge	LBB0_9
## %bb.8:
	leaq	L_.str.2(%rip), %rsi
	xorl	%r15d, %r15d
	movq	%r14, %rdi
	movq	%rax, %rcx
	movq	%rdx, %r8
	xorl	%eax, %eax
	callq	_nfp_err
	movq	_EINVAL@GOTPCREL(%rip), %rax
	jmp	LBB0_12
LBB0_1:
	movl	%eax, %r15d
	jmp	LBB0_13
LBB0_3:
	leaq	L_.str(%rip), %rsi
	xorl	%r15d, %r15d
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	_nfp_err
	movq	_ENODEV@GOTPCREL(%rip), %rax
	jmp	LBB0_12
LBB0_5:
	leaq	L_.str.1(%rip), %rsi
	xorl	%r15d, %r15d
	movq	%r14, %rdi
	movq	%rax, %rcx
	xorl	%eax, %eax
	callq	_nfp_err
	movq	_EINVAL@GOTPCREL(%rip), %rax
	jmp	LBB0_12
LBB0_9:
	movq	_NSP_STATUS_BUSY@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, -28(%rbp)
	je	LBB0_10
## %bb.11:
	leaq	L_.str.3(%rip), %rsi
	xorl	%r15d, %r15d
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	_nfp_err
	movq	_EBUSY@GOTPCREL(%rip), %rax
LBB0_12:
	subl	(%rax), %r15d
LBB0_13:
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_10:
	xorl	%r15d, %r15d
	jmp	LBB0_13
	.cfi_endproc
                                        ## -- End function
	.comm	_NSP_STATUS,4,2                 ## @NSP_STATUS
	.comm	_NSP_STATUS_MAGIC,4,2           ## @NSP_STATUS_MAGIC
	.comm	_NSP_MAGIC,8,3                  ## @NSP_MAGIC
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Cannot detect NFP Service Processor\n"

	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_NSP_STATUS_MAJOR,4,2           ## @NSP_STATUS_MAJOR
	.comm	_NSP_STATUS_MINOR,4,2           ## @NSP_STATUS_MINOR
	.comm	_NSP_MAJOR,8,3                  ## @NSP_MAJOR
L_.str.1:                               ## @.str.1
	.asciz	"Unsupported ABI %hu.%hu\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_NSP_MINOR,8,3                  ## @NSP_MINOR
L_.str.2:                               ## @.str.2
	.asciz	"ABI too old to support NIC operation (%u.%hu < %u.%u), please update the management FW on the flash\n"

	.comm	_NSP_STATUS_BUSY,4,2            ## @NSP_STATUS_BUSY
L_.str.3:                               ## @.str.3
	.asciz	"Service processor busy!\n"

	.comm	_EBUSY,4,2                      ## @EBUSY
	.no_dead_strip	_nfp_nsp_check
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function nfp_nsp_check
_nfp_nsp_check:                         ; @nfp_nsp_check
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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, x0
	ldr	x19, [x0, #24]
	ldr	w0, [x0, #16]
	bl	_nfp_resource_cpp_id
	mov	x21, x0
	ldr	w0, [x20, #16]
	bl	_nfp_resource_address
Lloh0:
	adrp	x8, _NSP_STATUS@GOTPAGE
Lloh1:
	ldr	x8, [x8, _NSP_STATUS@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	add	w2, w8, w0
	sub	x3, x29, #36
	mov	x0, x19
	mov	x1, x21
	bl	_nfp_cpp_readq
	tbnz	w0, #31, LBB0_9
; %bb.1:
Lloh3:
	adrp	x8, _NSP_STATUS_MAGIC@GOTPAGE
Lloh4:
	ldr	x8, [x8, _NSP_STATUS_MAGIC@GOTPAGEOFF]
Lloh5:
	ldr	w0, [x8]
	ldur	w1, [x29, #-36]
	bl	_FIELD_GET
Lloh6:
	adrp	x8, _NSP_MAGIC@GOTPAGE
Lloh7:
	ldr	x8, [x8, _NSP_MAGIC@GOTPAGEOFF]
Lloh8:
	ldr	x8, [x8]
	cmp	x0, x8
	b.ne	LBB0_5
; %bb.2:
Lloh9:
	adrp	x8, _NSP_STATUS_MAJOR@GOTPAGE
Lloh10:
	ldr	x8, [x8, _NSP_STATUS_MAJOR@GOTPAGEOFF]
Lloh11:
	ldr	w0, [x8]
	ldur	w1, [x29, #-36]
	bl	_FIELD_GET
	str	x0, [x20]
Lloh12:
	adrp	x8, _NSP_STATUS_MINOR@GOTPAGE
Lloh13:
	ldr	x8, [x8, _NSP_STATUS_MINOR@GOTPAGEOFF]
Lloh14:
	ldr	w0, [x8]
	ldur	w1, [x29, #-36]
	bl	_FIELD_GET
	str	x0, [x20, #8]
	ldr	x8, [x20]
Lloh15:
	adrp	x9, _NSP_MAJOR@GOTPAGE
Lloh16:
	ldr	x9, [x9, _NSP_MAJOR@GOTPAGEOFF]
Lloh17:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_6
; %bb.3:
Lloh18:
	adrp	x9, _NSP_MINOR@GOTPAGE
Lloh19:
	ldr	x9, [x9, _NSP_MINOR@GOTPAGEOFF]
Lloh20:
	ldr	x9, [x9]
	cmp	x0, x9
	b.ge	LBB0_10
; %bb.4:
	stp	x8, x9, [sp, #16]
	stp	x8, x0, [sp]
Lloh21:
	adrp	x1, l_.str.2@PAGE
Lloh22:
	add	x1, x1, l_.str.2@PAGEOFF
	b	LBB0_7
LBB0_5:
Lloh23:
	adrp	x1, l_.str@PAGE
Lloh24:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_nfp_err
Lloh25:
	adrp	x8, _ENODEV@GOTPAGE
Lloh26:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
	b	LBB0_8
LBB0_6:
	stp	x8, x0, [sp]
Lloh27:
	adrp	x1, l_.str.1@PAGE
Lloh28:
	add	x1, x1, l_.str.1@PAGEOFF
LBB0_7:
	mov	x0, x19
	bl	_nfp_err
Lloh29:
	adrp	x8, _EINVAL@GOTPAGE
Lloh30:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_8:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_9:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
LBB0_10:
	ldur	w8, [x29, #-36]
Lloh31:
	adrp	x9, _NSP_STATUS_BUSY@GOTPAGE
Lloh32:
	ldr	x9, [x9, _NSP_STATUS_BUSY@GOTPAGEOFF]
Lloh33:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_12
; %bb.11:
Lloh34:
	adrp	x1, l_.str.3@PAGE
Lloh35:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x0, x19
	bl	_nfp_err
Lloh36:
	adrp	x8, _EBUSY@GOTPAGE
Lloh37:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
	b	LBB0_8
LBB0_12:
	mov	w0, #0
	b	LBB0_9
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpLdrGot	Lloh25, Lloh26
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpAdd	Lloh27, Lloh28
	.loh AdrpLdrGot	Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGot	Lloh36, Lloh37
	.loh AdrpAdd	Lloh34, Lloh35
	.cfi_endproc
                                        ; -- End function
	.comm	_NSP_STATUS,4,2                 ; @NSP_STATUS
	.comm	_NSP_STATUS_MAGIC,4,2           ; @NSP_STATUS_MAGIC
	.comm	_NSP_MAGIC,8,3                  ; @NSP_MAGIC
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Cannot detect NFP Service Processor\n"

	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_NSP_STATUS_MAJOR,4,2           ; @NSP_STATUS_MAJOR
	.comm	_NSP_STATUS_MINOR,4,2           ; @NSP_STATUS_MINOR
	.comm	_NSP_MAJOR,8,3                  ; @NSP_MAJOR
l_.str.1:                               ; @.str.1
	.asciz	"Unsupported ABI %hu.%hu\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_NSP_MINOR,8,3                  ; @NSP_MINOR
l_.str.2:                               ; @.str.2
	.asciz	"ABI too old to support NIC operation (%u.%hu < %u.%u), please update the management FW on the flash\n"

	.comm	_NSP_STATUS_BUSY,4,2            ; @NSP_STATUS_BUSY
l_.str.3:                               ; @.str.3
	.asciz	"Service processor busy!\n"

	.comm	_EBUSY,4,2                      ; @EBUSY
	.no_dead_strip	_nfp_nsp_check
.subsections_via_symbols
