	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function nfp_nsp_command_buf
_nfp_nsp_command_buf:                   ## @nfp_nsp_command_buf
	.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
	pushq	%rax
	.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, %r13
	movq	16(%rdi), %r14
	movl	4(%rdi), %r8d
	cmpl	$12, %r8d
	jg	LBB0_2
## %bb.1:
	movl	16(%r15), %edx
	movl	8(%r13), %ecx
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
	callq	_nfp_err
	movq	_EOPNOTSUPP@GOTPCREL(%rip), %rcx
LBB0_11:
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_13
LBB0_2:
	movl	(%r13), %edi
	callq	_nfp_resource_cpp_id
	movl	%eax, %ebx
	movl	(%r13), %edi
	callq	_nfp_resource_address
	movq	_NSP_DFLT_BUFFER_CONFIG@GOTPCREL(%rip), %rcx
	addq	(%rcx), %rax
	leaq	-44(%rbp), %rcx
	movq	%r14, %rdi
	movl	%ebx, %esi
	movq	%rax, %rdx
	callq	_nfp_cpp_readq
	testl	%eax, %eax
	js	LBB0_13
## %bb.3:
	movq	24(%r15), %rdi
	testq	%rdi, %rdi
	je	LBB0_7
## %bb.4:
	movq	(%r15), %rdx
	testq	%rdx, %rdx
	je	LBB0_7
## %bb.5:
	subq	8(%r15), %rdx
	jle	LBB0_7
## %bb.6:
	xorl	%esi, %esi
	callq	_memset
LBB0_7:
	movq	(%r15), %rsi
	movq	8(%r15), %rdi
	callq	_max
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	movq	_NSP_DFLT_BUFFER_SIZE_MB@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	-44(%rbp), %esi
	callq	_FIELD_GET
	movl	%eax, %r12d
	movq	_SZ_1M@GOTPCREL(%rip), %rax
	imull	(%rax), %r12d
	movq	_NSP_DFLT_BUFFER_SIZE_4KB@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	-44(%rbp), %esi
	callq	_FIELD_GET
	movl	%eax, %ebx
	movq	_SZ_4K@GOTPCREL(%rip), %rax
	imull	(%rax), %ebx
	addl	%r12d, %ebx
	movq	_NSP_DFLT_BUFFER_DMA_CHUNK_ORDER@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	-44(%rbp), %esi
	callq	_FIELD_GET
	movl	-48(%rbp), %r8d                 ## 4-byte Reload
	cmpl	%r8d, %ebx
	jae	LBB0_8
## %bb.9:
	testl	%eax, %eax
	je	LBB0_10
## %bb.12:
	movq	%r13, %rdi
	movq	%r15, %rsi
	movl	%r8d, %edx
	movl	%eax, %ecx
	callq	_nfp_nsp_command_buf_dma
	jmp	LBB0_13
LBB0_8:
	movq	%r13, %rdi
	movq	%r15, %rsi
	callq	_nfp_nsp_command_buf_def
LBB0_13:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_10:
	movl	16(%r15), %edx
	leaq	L_.str.1(%rip), %rsi
	movq	%r14, %rdi
	movl	%ebx, %ecx
	callq	_nfp_err
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	jmp	LBB0_11
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"NSP: Code 0x%04x with buffer not supported (ABI %hu.%hu)\n"

	.comm	_EOPNOTSUPP,4,2                 ## @EOPNOTSUPP
	.comm	_NSP_DFLT_BUFFER_CONFIG,8,3     ## @NSP_DFLT_BUFFER_CONFIG
	.comm	_NSP_DFLT_BUFFER_SIZE_MB,4,2    ## @NSP_DFLT_BUFFER_SIZE_MB
	.comm	_SZ_1M,4,2                      ## @SZ_1M
	.comm	_NSP_DFLT_BUFFER_SIZE_4KB,4,2   ## @NSP_DFLT_BUFFER_SIZE_4KB
	.comm	_SZ_4K,4,2                      ## @SZ_4K
	.comm	_NSP_DFLT_BUFFER_DMA_CHUNK_ORDER,4,2 ## @NSP_DFLT_BUFFER_DMA_CHUNK_ORDER
L_.str.1:                               ## @.str.1
	.asciz	"NSP: default buffer too small for command 0x%04x (%u < %u)\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_nfp_nsp_command_buf
.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
_nfp_nsp_command_buf:                   ; @nfp_nsp_command_buf
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x19, x1
	mov	x21, x0
	ldr	x20, [x0, #16]
	ldr	w4, [x0, #4]
	cmp	w4, #12
	b.gt	LBB0_3
; %bb.1:
	ldr	w2, [x19, #16]
	ldr	w3, [x21, #8]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x20
	bl	_nfp_err
Lloh2:
	adrp	x8, _EOPNOTSUPP@GOTPAGE
Lloh3:
	ldr	x8, [x8, _EOPNOTSUPP@GOTPAGEOFF]
LBB0_2:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_12
LBB0_3:
	ldr	w0, [x21]
	bl	_nfp_resource_cpp_id
	mov	x22, x0
	ldr	w0, [x21]
	bl	_nfp_resource_address
Lloh4:
	adrp	x8, _NSP_DFLT_BUFFER_CONFIG@GOTPAGE
Lloh5:
	ldr	x8, [x8, _NSP_DFLT_BUFFER_CONFIG@GOTPAGEOFF]
Lloh6:
	ldr	x8, [x8]
	add	x2, x8, x0
	add	x3, sp, #12
	mov	x0, x20
	mov	x1, x22
	bl	_nfp_cpp_readq
	tbnz	w0, #31, LBB0_12
; %bb.4:
	ldr	x0, [x19, #24]
	cbz	x0, LBB0_8
; %bb.5:
	ldr	x8, [x19]
	cbz	x8, LBB0_8
; %bb.6:
	ldr	x9, [x19, #8]
	subs	x2, x8, x9
	b.le	LBB0_8
; %bb.7:
	mov	w1, #0
	bl	_memset
LBB0_8:
	ldp	x1, x0, [x19]
	bl	_max
	mov	x22, x0
Lloh7:
	adrp	x8, _NSP_DFLT_BUFFER_SIZE_MB@GOTPAGE
Lloh8:
	ldr	x8, [x8, _NSP_DFLT_BUFFER_SIZE_MB@GOTPAGEOFF]
Lloh9:
	ldr	w0, [x8]
	ldr	w1, [sp, #12]
	bl	_FIELD_GET
Lloh10:
	adrp	x8, _SZ_1M@GOTPAGE
Lloh11:
	ldr	x8, [x8, _SZ_1M@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	mul	w23, w8, w0
Lloh13:
	adrp	x8, _NSP_DFLT_BUFFER_SIZE_4KB@GOTPAGE
Lloh14:
	ldr	x8, [x8, _NSP_DFLT_BUFFER_SIZE_4KB@GOTPAGEOFF]
Lloh15:
	ldr	w0, [x8]
	ldr	w1, [sp, #12]
	bl	_FIELD_GET
Lloh16:
	adrp	x8, _SZ_4K@GOTPAGE
Lloh17:
	ldr	x8, [x8, _SZ_4K@GOTPAGEOFF]
Lloh18:
	ldr	w8, [x8]
	madd	w23, w8, w0, w23
Lloh19:
	adrp	x8, _NSP_DFLT_BUFFER_DMA_CHUNK_ORDER@GOTPAGE
Lloh20:
	ldr	x8, [x8, _NSP_DFLT_BUFFER_DMA_CHUNK_ORDER@GOTPAGEOFF]
Lloh21:
	ldr	w0, [x8]
	ldr	w1, [sp, #12]
	bl	_FIELD_GET
	cmp	w23, w22
	b.hs	LBB0_11
; %bb.9:
	mov	x3, x0
	cbz	w0, LBB0_13
; %bb.10:
	mov	x0, x21
	mov	x1, x19
	mov	x2, x22
	bl	_nfp_nsp_command_buf_dma
	b	LBB0_12
LBB0_11:
	mov	x0, x21
	mov	x1, x19
	bl	_nfp_nsp_command_buf_def
LBB0_12:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
LBB0_13:
	ldr	w2, [x19, #16]
Lloh22:
	adrp	x1, l_.str.1@PAGE
Lloh23:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x20
	mov	x3, x23
	mov	x4, x22
	bl	_nfp_err
Lloh24:
	adrp	x8, _EINVAL@GOTPAGE
Lloh25:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_2
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh24, Lloh25
	.loh AdrpAdd	Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"NSP: Code 0x%04x with buffer not supported (ABI %hu.%hu)\n"

	.comm	_EOPNOTSUPP,4,2                 ; @EOPNOTSUPP
	.comm	_NSP_DFLT_BUFFER_CONFIG,8,3     ; @NSP_DFLT_BUFFER_CONFIG
	.comm	_NSP_DFLT_BUFFER_SIZE_MB,4,2    ; @NSP_DFLT_BUFFER_SIZE_MB
	.comm	_SZ_1M,4,2                      ; @SZ_1M
	.comm	_NSP_DFLT_BUFFER_SIZE_4KB,4,2   ; @NSP_DFLT_BUFFER_SIZE_4KB
	.comm	_SZ_4K,4,2                      ; @SZ_4K
	.comm	_NSP_DFLT_BUFFER_DMA_CHUNK_ORDER,4,2 ; @NSP_DFLT_BUFFER_DMA_CHUNK_ORDER
l_.str.1:                               ; @.str.1
	.asciz	"NSP: default buffer too small for command 0x%04x (%u < %u)\n"

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