	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function __nfp_nsp_command
___nfp_nsp_command:                     ## @__nfp_nsp_command
	.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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, -56(%rbp)                 ## 8-byte Spill
	movq	%rdi, %rbx
	movq	8(%rdi), %rax
	movq	%rax, -88(%rbp)                 ## 8-byte Spill
	movl	(%rdi), %edi
	callq	_nfp_resource_cpp_id
	movl	%eax, -72(%rbp)                 ## 4-byte Spill
	movl	(%rbx), %edi
	callq	_nfp_resource_address
	movl	%eax, %r12d
	movq	_NSP_STATUS@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	addl	%r12d, %r14d
	movq	_NSP_COMMAND@GOTPCREL(%rip), %rax
	movl	(%rax), %r13d
	addl	%r12d, %r13d
	movq	_NSP_BUFFER@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	movq	%rbx, %rdi
	callq	_nfp_nsp_check
	testl	%eax, %eax
	je	LBB0_1
LBB0_19:
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_1:
	movl	%r14d, -68(%rbp)                ## 4-byte Spill
	movl	%r13d, -60(%rbp)                ## 4-byte Spill
	movq	%rbx, -80(%rbp)                 ## 8-byte Spill
	addl	%r12d, %r15d
	movq	-56(%rbp), %r13                 ## 8-byte Reload
	movl	(%r13), %ecx
	movq	-88(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rdi
	movl	-72(%rbp), %r12d                ## 4-byte Reload
	movl	%r12d, %esi
	movl	%r15d, %edx
	callq	_nfp_cpp_writeq
	testl	%eax, %eax
	js	LBB0_19
## %bb.2:
	movq	%rbx, %r15
	movq	_NSP_COMMAND_OPTION@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	4(%r13), %esi
	callq	_FIELD_PREP
	movl	%eax, %r14d
	movq	_NSP_COMMAND_CODE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	8(%r13), %esi
	callq	_FIELD_PREP
	orl	%eax, %r14d
	movq	_NSP_COMMAND_DMA_BUF@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	12(%r13), %esi
	callq	_FIELD_PREP
	movl	%eax, %ebx
	movq	%r15, %r13
	movl	%r12d, %r15d
	movq	_NSP_COMMAND_START@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	$1, %esi
	callq	_FIELD_PREP
	orl	%eax, %ebx
	orl	%r14d, %ebx
	movq	%r13, %rdi
	movl	%r12d, %esi
	movl	-60(%rbp), %r12d                ## 4-byte Reload
	movl	%r12d, %edx
	movl	%ebx, %ecx
	callq	_nfp_cpp_writeq
	testl	%eax, %eax
	js	LBB0_19
## %bb.3:
	movq	_NSP_COMMAND_START@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	movq	_NFP_NSP_TIMEOUT_DEFAULT@GOTPCREL(%rip), %rbx
	movl	(%rbx), %eax
	movl	%eax, (%rsp)
	leaq	-64(%rbp), %rsi
	movq	%r13, %rdi
	movl	%r15d, %edx
	movl	%r12d, %ecx
	xorl	%r9d, %r9d
	callq	_nfp_nsp_wait_reg
	testl	%eax, %eax
	je	LBB0_6
## %bb.4:
	movl	%eax, %edx
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movl	8(%rax), %ecx
	leaq	L_.str(%rip), %rsi
	movq	%r13, %rdi
	movl	%edx, %ebx
	jmp	LBB0_5
LBB0_6:
	movq	_NSP_STATUS_BUSY@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	32(%rax), %rax
	testq	%rax, %rax
	jne	LBB0_8
## %bb.7:
	movl	(%rbx), %eax
LBB0_8:
	movl	%eax, (%rsp)
	leaq	-64(%rbp), %rsi
	movq	%r13, %rdi
	movl	%r15d, %edx
	movl	-68(%rbp), %ecx                 ## 4-byte Reload
	xorl	%r9d, %r9d
	callq	_nfp_nsp_wait_reg
	testl	%eax, %eax
	je	LBB0_10
## %bb.9:
	movl	%eax, %ebx
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movl	8(%rax), %ecx
	leaq	L_.str.1(%rip), %rsi
	movq	%r13, %rdi
	movl	%ebx, %edx
LBB0_5:
	callq	_nfp_err
	movl	%ebx, %eax
	jmp	LBB0_19
LBB0_10:
	leaq	-44(%rbp), %rcx
	movq	%r13, %rdi
	movl	%r15d, %esi
	movl	-60(%rbp), %edx                 ## 4-byte Reload
	callq	_nfp_cpp_readq
	testl	%eax, %eax
	movq	-56(%rbp), %r15                 ## 8-byte Reload
	js	LBB0_19
## %bb.11:
	movq	_NSP_COMMAND_OPTION@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	-44(%rbp), %esi
	callq	_FIELD_GET
	movl	%eax, -44(%rbp)
	movq	_NSP_STATUS_RESULT@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	-64(%rbp), %esi
	callq	_FIELD_GET
	testl	%eax, %eax
	je	LBB0_18
## %bb.12:
	cmpl	$0, 24(%r15)
	jne	LBB0_14
## %bb.13:
	movl	%eax, %ebx
	movl	%eax, %edx
	negl	%edx
	movl	-44(%rbp), %ecx
	movl	8(%r15), %r8d
	leaq	L_.str.2(%rip), %rsi
	movq	%r13, %rdi
	callq	_nfp_warn
	movl	%ebx, %eax
LBB0_14:
	movq	16(%r15), %rcx
	testq	%rcx, %rcx
	movq	-80(%rbp), %rdi                 ## 8-byte Reload
	je	LBB0_17
## %bb.15:
	movl	-44(%rbp), %esi
	movl	%eax, %ebx
	callq	*%rcx
	jmp	LBB0_16
LBB0_18:
	movl	-44(%rbp), %eax
	jmp	LBB0_19
LBB0_17:
	movl	-44(%rbp), %esi
	movl	%eax, %ebx
	callq	_nfp_nsp_print_extended_error
LBB0_16:
	movl	%ebx, %eax
	negl	%eax
	jmp	LBB0_19
	.cfi_endproc
                                        ## -- End function
	.comm	_NSP_STATUS,4,2                 ## @NSP_STATUS
	.comm	_NSP_COMMAND,4,2                ## @NSP_COMMAND
	.comm	_NSP_BUFFER,4,2                 ## @NSP_BUFFER
	.comm	_NSP_COMMAND_OPTION,4,2         ## @NSP_COMMAND_OPTION
	.comm	_NSP_COMMAND_CODE,4,2           ## @NSP_COMMAND_CODE
	.comm	_NSP_COMMAND_DMA_BUF,4,2        ## @NSP_COMMAND_DMA_BUF
	.comm	_NSP_COMMAND_START,4,2          ## @NSP_COMMAND_START
	.comm	_NFP_NSP_TIMEOUT_DEFAULT,4,2    ## @NFP_NSP_TIMEOUT_DEFAULT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Error %d waiting for code 0x%04x to start\n"

	.comm	_NSP_STATUS_BUSY,4,2            ## @NSP_STATUS_BUSY
L_.str.1:                               ## @.str.1
	.asciz	"Error %d waiting for code 0x%04x to complete\n"

	.comm	_NSP_STATUS_RESULT,4,2          ## @NSP_STATUS_RESULT
L_.str.2:                               ## @.str.2
	.asciz	"Result (error) code set: %d (%d) command: %d\n"

	.no_dead_strip	___nfp_nsp_command
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function __nfp_nsp_command
___nfp_nsp_command:                     ; @__nfp_nsp_command
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x20, x1
	mov	x19, x0
	ldr	x21, [x0, #8]
	ldr	w0, [x0]
	bl	_nfp_resource_cpp_id
	mov	x22, x0
	ldr	w0, [x19]
	bl	_nfp_resource_address
	mov	x23, x0
Lloh0:
	adrp	x8, _NSP_STATUS@GOTPAGE
Lloh1:
	ldr	x8, [x8, _NSP_STATUS@GOTPAGEOFF]
Lloh2:
	ldr	w27, [x8]
Lloh3:
	adrp	x8, _NSP_COMMAND@GOTPAGE
Lloh4:
	ldr	x8, [x8, _NSP_COMMAND@GOTPAGEOFF]
Lloh5:
	ldr	w24, [x8]
Lloh6:
	adrp	x8, _NSP_BUFFER@GOTPAGE
Lloh7:
	ldr	x8, [x8, _NSP_BUFFER@GOTPAGEOFF]
Lloh8:
	ldr	w26, [x8]
	mov	x0, x19
	bl	_nfp_nsp_check
	mov	x25, x0
	cbnz	w0, LBB0_15
; %bb.1:
	add	w2, w26, w23
	ldr	w3, [x20]
	mov	x0, x21
	mov	x1, x22
	bl	_nfp_cpp_writeq
	tbnz	w0, #31, LBB0_14
; %bb.2:
	add	w24, w24, w23
Lloh9:
	adrp	x26, _NSP_COMMAND_OPTION@GOTPAGE
Lloh10:
	ldr	x26, [x26, _NSP_COMMAND_OPTION@GOTPAGEOFF]
	ldr	w0, [x26]
	ldr	w1, [x20, #4]
	bl	_FIELD_PREP
	mov	x25, x0
Lloh11:
	adrp	x8, _NSP_COMMAND_CODE@GOTPAGE
Lloh12:
	ldr	x8, [x8, _NSP_COMMAND_CODE@GOTPAGEOFF]
Lloh13:
	ldr	w0, [x8]
	ldr	w1, [x20, #8]
	bl	_FIELD_PREP
	orr	w25, w0, w25
Lloh14:
	adrp	x8, _NSP_COMMAND_DMA_BUF@GOTPAGE
Lloh15:
	ldr	x8, [x8, _NSP_COMMAND_DMA_BUF@GOTPAGEOFF]
Lloh16:
	ldr	w0, [x8]
	ldr	w1, [x20, #12]
	bl	_FIELD_PREP
	orr	w25, w25, w0
Lloh17:
	adrp	x28, _NSP_COMMAND_START@GOTPAGE
Lloh18:
	ldr	x28, [x28, _NSP_COMMAND_START@GOTPAGEOFF]
	ldr	w0, [x28]
	mov	w1, #1
	bl	_FIELD_PREP
	orr	w3, w25, w0
	mov	x0, x21
	mov	x1, x22
	mov	x2, x24
	bl	_nfp_cpp_writeq
	tbnz	w0, #31, LBB0_14
; %bb.3:
	ldr	w4, [x28]
Lloh19:
	adrp	x28, _NFP_NSP_TIMEOUT_DEFAULT@GOTPAGE
Lloh20:
	ldr	x28, [x28, _NFP_NSP_TIMEOUT_DEFAULT@GOTPAGEOFF]
	ldr	w6, [x28]
	add	x1, sp, #12
	mov	x0, x21
	mov	x2, x22
	mov	x3, x24
	mov	w5, #0
	bl	_nfp_nsp_wait_reg
	cbz	w0, LBB0_5
; %bb.4:
	mov	x25, x0
	ldr	w3, [x20, #8]
Lloh21:
	adrp	x1, l_.str@PAGE
Lloh22:
	add	x1, x1, l_.str@PAGEOFF
	b	LBB0_7
LBB0_5:
Lloh23:
	adrp	x8, _NSP_STATUS_BUSY@GOTPAGE
Lloh24:
	ldr	x8, [x8, _NSP_STATUS_BUSY@GOTPAGEOFF]
	add	w3, w27, w23
Lloh25:
	ldr	w4, [x8]
	ldr	x8, [x20, #32]
	ldr	w9, [x28]
	cmp	x8, #0
	csel	w6, w9, w8, eq
	add	x1, sp, #12
	mov	x0, x21
	mov	x2, x22
	mov	w5, #0
	bl	_nfp_nsp_wait_reg
	cbz	w0, LBB0_8
; %bb.6:
	mov	x25, x0
	ldr	w3, [x20, #8]
Lloh26:
	adrp	x1, l_.str.1@PAGE
Lloh27:
	add	x1, x1, l_.str.1@PAGEOFF
LBB0_7:
	mov	x0, x21
	mov	x2, x25
	bl	_nfp_err
	b	LBB0_15
LBB0_8:
	add	x3, sp, #8
	mov	x0, x21
	mov	x1, x22
	mov	x2, x24
	bl	_nfp_cpp_readq
	tbnz	w0, #31, LBB0_14
; %bb.9:
	ldr	w0, [x26]
	ldr	w1, [sp, #8]
	bl	_FIELD_GET
	str	w0, [sp, #8]
Lloh28:
	adrp	x8, _NSP_STATUS_RESULT@GOTPAGE
Lloh29:
	ldr	x8, [x8, _NSP_STATUS_RESULT@GOTPAGEOFF]
Lloh30:
	ldr	w0, [x8]
	ldr	w1, [sp, #12]
	bl	_FIELD_GET
	cbz	w0, LBB0_16
; %bb.10:
	mov	x22, x0
	ldr	w8, [x20, #24]
	cbnz	w8, LBB0_12
; %bb.11:
	neg	w2, w22
	ldr	w3, [sp, #8]
	ldr	w4, [x20, #8]
Lloh31:
	adrp	x1, l_.str.2@PAGE
Lloh32:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x21
	bl	_nfp_warn
LBB0_12:
	ldr	x8, [x20, #16]
	cbz	x8, LBB0_17
; %bb.13:
	ldr	w1, [sp, #8]
	mov	x0, x19
	blr	x8
	b	LBB0_18
LBB0_14:
	mov	x25, x0
LBB0_15:
	mov	x0, x25
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_16:
	ldr	w25, [sp, #8]
	b	LBB0_15
LBB0_17:
	ldr	w1, [sp, #8]
	mov	x0, x19
	bl	_nfp_nsp_print_extended_error
LBB0_18:
	neg	w25, w22
	b	LBB0_15
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpAdd	Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpAdd	Lloh31, Lloh32
	.cfi_endproc
                                        ; -- End function
	.comm	_NSP_STATUS,4,2                 ; @NSP_STATUS
	.comm	_NSP_COMMAND,4,2                ; @NSP_COMMAND
	.comm	_NSP_BUFFER,4,2                 ; @NSP_BUFFER
	.comm	_NSP_COMMAND_OPTION,4,2         ; @NSP_COMMAND_OPTION
	.comm	_NSP_COMMAND_CODE,4,2           ; @NSP_COMMAND_CODE
	.comm	_NSP_COMMAND_DMA_BUF,4,2        ; @NSP_COMMAND_DMA_BUF
	.comm	_NSP_COMMAND_START,4,2          ; @NSP_COMMAND_START
	.comm	_NFP_NSP_TIMEOUT_DEFAULT,4,2    ; @NFP_NSP_TIMEOUT_DEFAULT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Error %d waiting for code 0x%04x to start\n"

	.comm	_NSP_STATUS_BUSY,4,2            ; @NSP_STATUS_BUSY
l_.str.1:                               ; @.str.1
	.asciz	"Error %d waiting for code 0x%04x to complete\n"

	.comm	_NSP_STATUS_RESULT,4,2          ; @NSP_STATUS_RESULT
l_.str.2:                               ; @.str.2
	.asciz	"Result (error) code set: %d (%d) command: %d\n"

	.no_dead_strip	___nfp_nsp_command
.subsections_via_symbols
