	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function nfp_nsp_command_buf_def
_nfp_nsp_command_buf_def:               ## @nfp_nsp_command_buf_def
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r15
	movq	%rdi, %r14
	movq	8(%rdi), %r12
	movl	(%rdi), %edi
	callq	_nfp_resource_cpp_id
	movl	%eax, %ebx
	movl	(%r14), %edi
	callq	_nfp_resource_address
	movq	_NSP_DFLT_BUFFER@GOTPCREL(%rip), %rcx
	addq	(%rcx), %rax
	leaq	-44(%rbp), %rcx
	movq	%r12, %rdi
	movl	%ebx, %esi
	movq	%rax, %rdx
	callq	_nfp_cpp_readq
	testl	%eax, %eax
	js	LBB0_15
## %bb.1:
	movq	%r12, -56(%rbp)                 ## 8-byte Spill
	movq	_NSP_DFLT_BUFFER_CPP@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	-44(%rbp), %esi
	callq	_FIELD_GET
	movl	%eax, %r12d
	shll	$8, %r12d
	movq	_NSP_DFLT_BUFFER_ADDRESS@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	-44(%rbp), %esi
	callq	_FIELD_GET
	movl	%eax, %ebx
	movl	16(%r15), %ecx
	testl	%ecx, %ecx
	je	LBB0_4
## %bb.2:
	movl	(%r15), %r8d
	testl	%r8d, %r8d
	je	LBB0_4
## %bb.3:
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movl	%r12d, %esi
	movl	%ebx, %edx
	callq	_nfp_cpp_write
	testl	%eax, %eax
	js	LBB0_15
LBB0_4:
	movl	8(%r15), %ecx
	testl	%ecx, %ecx
	je	LBB0_8
## %bb.5:
	movl	4(%r15), %r8d
	testl	%r8d, %r8d
	je	LBB0_8
## %bb.6:
	movl	(%r15), %edx
	subl	%edx, %r8d
	jle	LBB0_8
## %bb.7:
	addl	%ebx, %edx
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movl	%r12d, %esi
	callq	_nfp_cpp_write
	testl	%eax, %eax
	js	LBB0_15
LBB0_8:
	movq	_NSP_BUFFER_CPP@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	%ebx, %r13d
	movl	%r12d, %ebx
	sarl	$8, %ebx
	movl	%ebx, %esi
	callq	_FIELD_FIT
	testl	%eax, %eax
	je	LBB0_10
## %bb.9:
	movq	_NSP_BUFFER_ADDRESS@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	%r13d, %esi
	callq	_FIELD_FIT
	testl	%eax, %eax
	je	LBB0_10
## %bb.11:
	movq	_NSP_BUFFER_CPP@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	%ebx, %esi
	callq	_FIELD_PREP
	movl	%eax, %ebx
	movq	_NSP_BUFFER_ADDRESS@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	%r13d, -60(%rbp)                ## 4-byte Spill
	movl	%r13d, %esi
	callq	_FIELD_PREP
	orl	%ebx, %eax
	leaq	12(%r15), %rsi
	movl	%eax, 12(%r15)
	movq	%r14, %rdi
	callq	___nfp_nsp_command
	movl	%eax, %r13d
	testl	%eax, %eax
	js	LBB0_16
## %bb.12:
	movl	8(%r15), %ecx
	testl	%ecx, %ecx
	je	LBB0_16
## %bb.13:
	movl	4(%r15), %r8d
	testl	%r8d, %r8d
	je	LBB0_16
## %bb.14:
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movl	%r12d, %esi
	movl	-60(%rbp), %edx                 ## 4-byte Reload
	callq	_nfp_cpp_read
	testl	%eax, %eax
	jns	LBB0_16
LBB0_15:
	movl	%eax, %r13d
	jmp	LBB0_16
LBB0_10:
	leaq	L_.str(%rip), %rsi
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movl	%r12d, %edx
	movl	%r13d, %ecx
	callq	_nfp_err
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r13d, %r13d
	subl	(%rax), %r13d
LBB0_16:
	movl	%r13d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_NSP_DFLT_BUFFER,8,3            ## @NSP_DFLT_BUFFER
	.comm	_NSP_DFLT_BUFFER_CPP,4,2        ## @NSP_DFLT_BUFFER_CPP
	.comm	_NSP_DFLT_BUFFER_ADDRESS,4,2    ## @NSP_DFLT_BUFFER_ADDRESS
	.comm	_NSP_BUFFER_CPP,4,2             ## @NSP_BUFFER_CPP
	.comm	_NSP_BUFFER_ADDRESS,4,2         ## @NSP_BUFFER_ADDRESS
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Buffer out of reach %08x %016llx\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_nfp_nsp_command_buf_def
.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_buf_def
_nfp_nsp_command_buf_def:               ; @nfp_nsp_command_buf_def
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x20, x1
	mov	x21, x0
	ldr	x19, [x0, #8]
	ldr	w0, [x0]
	bl	_nfp_resource_cpp_id
	mov	x22, x0
	ldr	w0, [x21]
	bl	_nfp_resource_address
Lloh0:
	adrp	x8, _NSP_DFLT_BUFFER@GOTPAGE
Lloh1:
	ldr	x8, [x8, _NSP_DFLT_BUFFER@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	add	x2, x8, x0
	add	x3, sp, #12
	mov	x0, x19
	mov	x1, x22
	bl	_nfp_cpp_readq
	tbnz	w0, #31, LBB0_14
; %bb.1:
Lloh3:
	adrp	x8, _NSP_DFLT_BUFFER_CPP@GOTPAGE
Lloh4:
	ldr	x8, [x8, _NSP_DFLT_BUFFER_CPP@GOTPAGEOFF]
Lloh5:
	ldr	w0, [x8]
	ldr	w1, [sp, #12]
	bl	_FIELD_GET
	lsl	w22, w0, #8
Lloh6:
	adrp	x8, _NSP_DFLT_BUFFER_ADDRESS@GOTPAGE
Lloh7:
	ldr	x8, [x8, _NSP_DFLT_BUFFER_ADDRESS@GOTPAGEOFF]
Lloh8:
	ldr	w0, [x8]
	ldr	w1, [sp, #12]
	bl	_FIELD_GET
	mov	x23, x0
	ldr	w3, [x20, #16]
	cbz	w3, LBB0_4
; %bb.2:
	ldr	w4, [x20]
	cbz	w4, LBB0_4
; %bb.3:
	mov	x0, x19
	mov	x1, x22
	mov	x2, x23
	bl	_nfp_cpp_write
	tbnz	w0, #31, LBB0_14
LBB0_4:
	ldr	w3, [x20, #8]
	cbz	w3, LBB0_8
; %bb.5:
	ldr	w9, [x20, #4]
	cbz	w9, LBB0_8
; %bb.6:
	ldr	w8, [x20]
	subs	w4, w9, w8
	b.le	LBB0_8
; %bb.7:
	add	w2, w8, w23
	mov	x0, x19
	mov	x1, x22
	bl	_nfp_cpp_write
	tbnz	w0, #31, LBB0_14
LBB0_8:
Lloh9:
	adrp	x25, _NSP_BUFFER_CPP@GOTPAGE
Lloh10:
	ldr	x25, [x25, _NSP_BUFFER_CPP@GOTPAGEOFF]
	ldr	w0, [x25]
	asr	w24, w22, #8
	mov	x1, x24
	bl	_FIELD_FIT
	cbz	w0, LBB0_15
; %bb.9:
Lloh11:
	adrp	x26, _NSP_BUFFER_ADDRESS@GOTPAGE
Lloh12:
	ldr	x26, [x26, _NSP_BUFFER_ADDRESS@GOTPAGEOFF]
	ldr	w0, [x26]
	mov	x1, x23
	bl	_FIELD_FIT
	cbz	w0, LBB0_15
; %bb.10:
	ldr	w0, [x25]
	mov	x1, x24
	bl	_FIELD_PREP
	mov	x24, x0
	ldr	w0, [x26]
	mov	x1, x23
	bl	_FIELD_PREP
	orr	w8, w0, w24
	mov	x1, x20
	str	w8, [x1, #12]!
	mov	x0, x21
	bl	___nfp_nsp_command
	mov	x24, x0
	tbnz	w0, #31, LBB0_16
; %bb.11:
	ldr	w3, [x20, #8]
	cbz	w3, LBB0_16
; %bb.12:
	ldr	w4, [x20, #4]
	cbz	w4, LBB0_16
; %bb.13:
	mov	x0, x19
	mov	x1, x22
	mov	x2, x23
	bl	_nfp_cpp_read
	tbz	w0, #31, LBB0_16
LBB0_14:
	mov	x24, x0
	b	LBB0_16
LBB0_15:
Lloh13:
	adrp	x1, l_.str@PAGE
Lloh14:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	mov	x2, x22
	mov	x3, x23
	bl	_nfp_err
Lloh15:
	adrp	x8, _EINVAL@GOTPAGE
Lloh16:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	neg	w24, w8
LBB0_16:
	mov	x0, x24
	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
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpAdd	Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_NSP_DFLT_BUFFER,8,3            ; @NSP_DFLT_BUFFER
	.comm	_NSP_DFLT_BUFFER_CPP,4,2        ; @NSP_DFLT_BUFFER_CPP
	.comm	_NSP_DFLT_BUFFER_ADDRESS,4,2    ; @NSP_DFLT_BUFFER_ADDRESS
	.comm	_NSP_BUFFER_CPP,4,2             ; @NSP_BUFFER_CPP
	.comm	_NSP_BUFFER_ADDRESS,4,2         ; @NSP_BUFFER_ADDRESS
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Buffer out of reach %08x %016llx\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_nfp_nsp_command_buf_def
.subsections_via_symbols
