	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_nes_hw_modify_qp               ## -- Begin function nes_hw_modify_qp
	.p2align	4, 0x90
_nes_hw_modify_qp:                      ## @nes_hw_modify_qp
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%r8d, -48(%rbp)                 ## 4-byte Spill
	movl	%ecx, -60(%rbp)                 ## 4-byte Spill
	movl	%edx, -44(%rbp)                 ## 4-byte Spill
	movq	%rsi, %r13
	movq	%rdi, %r12
	movq	_NES_DBG_MOD_QP@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movl	(%rsi), %r14d
	leaq	16(%rsi), %rdi
	callq	_atomic_read
	leaq	L_.str(%rip), %rsi
	xorl	%r15d, %r15d
	movl	%ebx, %edi
	movl	%r14d, %edx
	movq	%r12, %r14
	movl	%eax, %ecx
	xorl	%eax, %eax
	callq	_nes_debug
	movq	%r12, %rdi
	callq	_nes_get_cqp_request
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %rbx
	xorl	%eax, %eax
	cmpl	$0, -48(%rbp)                   ## 4-byte Folded Reload
	setne	%al
	movl	%eax, (%rbx)
	leaq	32(%rbx), %r12
	movq	32(%rbx), %rdi
	movq	_NES_CQP_WQE_OPCODE_IDX@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	movq	_NES_CQP_MODIFY_QP@GOTPCREL(%rip), %rax
	movq	_NES_CQP_QP_TYPE_IWARP@GOTPCREL(%rip), %rcx
	movl	(%rax), %edx
	movl	-44(%rbp), %r15d                ## 4-byte Reload
	orl	%r15d, %edx
	orl	(%rcx), %edx
	callq	_set_wqe_32bit_value
	movq	%r14, -56(%rbp)                 ## 8-byte Spill
	movq	_NES_DBG_MOD_QP@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	movq	32(%rbx), %rax
	movq	_NES_CQP_WQE_OPCODE_IDX@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movl	(%rax,%rcx,4), %edi
	callq	_le32_to_cpu
	leaq	L_.str.2(%rip), %rsi
	movl	%r14d, %edi
	movq	-56(%rbp), %r14                 ## 8-byte Reload
	movl	%r15d, %edx
	movl	%eax, %ecx
	xorl	%eax, %eax
	callq	_nes_debug
	movq	%r12, -72(%rbp)                 ## 8-byte Spill
	movq	%r12, %rdi
	movq	%r14, %rsi
	callq	_nes_fill_init_cqp_wqe
	movq	32(%rbx), %rdi
	movq	_NES_CQP_WQE_ID_IDX@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	movl	(%r13), %edx
	callq	_set_wqe_32bit_value
	movq	32(%rbx), %rdi
	movq	_NES_CQP_QP_WQE_CONTEXT_LOW_IDX@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	8(%r13), %edx
	callq	_set_wqe_64bit_value
	movq	_NES_CQP_QP_IWARP_STATE_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	andl	%r15d, %eax
	movq	_NES_CQP_QP_IWARP_STATE_TERMINATE@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jne	LBB0_5
## %bb.3:
	movq	_NES_CQP_QP_TERM_DONT_SEND_TERM_MSG@GOTPCREL(%rip), %rax
	testl	%r15d, (%rax)
	jne	LBB0_5
## %bb.4:
	movl	-60(%rbp), %edx                 ## 4-byte Reload
	addl	$3, %edx
	sarl	$2, %edx
	movq	_NES_CQP_OP_TERMLEN_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	shll	%cl, %edx
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rdi
	movq	_NES_CQP_QP_WQE_NEW_MSS_IDX@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	callq	_set_wqe_32bit_value
LBB0_5:
	movq	%rbx, %rdi
	addq	$28, %rdi
	movl	$2, %esi
	callq	_atomic_set
	movq	%r14, %rdi
	movq	%rbx, %rsi
	callq	_nes_post_cqp_request
	cmpl	$0, -48(%rbp)                   ## 4-byte Folded Reload
	movl	$0, %r15d
	je	LBB0_12
## %bb.6:
	xorl	%esi, %esi
	cmpq	$0, 8(%rbx)
	movl	24(%rbx), %edi
	setne	%sil
	movq	_NES_EVENT_TIMEOUT@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_wait_event_timeout
	movl	%eax, %r14d
	movq	_NES_DBG_MOD_QP@GOTPCREL(%rip), %r12
	movl	(%r12), %edi
	movl	(%r13), %edx
	movl	16(%rbx), %r8d
	movl	20(%rbx), %r9d
	leaq	L_.str.3(%rip), %rsi
	movl	%eax, %ecx
	xorl	%eax, %eax
	callq	_nes_debug
	movl	16(%rbx), %ecx
	testl	%ecx, %ecx
	je	LBB0_7
## %bb.8:
	movl	(%r12), %edi
	movl	(%r13), %edx
	movl	20(%rbx), %r8d
	leaq	L_.str.4(%rip), %rsi
	xorl	%r15d, %r15d
	movl	-44(%rbp), %r9d                 ## 4-byte Reload
	xorl	%eax, %eax
	callq	_nes_debug
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movq	%rbx, %rsi
	callq	_nes_put_cqp_request
	testl	%r14d, %r14d
	je	LBB0_9
## %bb.10:
	movq	_EIO@GOTPCREL(%rip), %rax
	jmp	LBB0_11
LBB0_1:
	movq	_NES_DBG_MOD_QP@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.1(%rip), %rsi
	xorl	%eax, %eax
	callq	_nes_debug
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	jmp	LBB0_11
LBB0_7:
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movq	%rbx, %rsi
	callq	_nes_put_cqp_request
	testl	%r14d, %r14d
	movl	$0, %r15d
	jne	LBB0_12
LBB0_9:
	movq	_ETIME@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
LBB0_11:
	subl	(%rax), %r15d
LBB0_12:
	movl	%r15d, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_NES_DBG_MOD_QP,4,2             ## @NES_DBG_MOD_QP
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"QP%u, refcount=%d\n"

L_.str.1:                               ## @.str.1
	.asciz	"Failed to get a cqp_request.\n"

	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_NES_CQP_WQE_OPCODE_IDX,8,3     ## @NES_CQP_WQE_OPCODE_IDX
	.comm	_NES_CQP_MODIFY_QP,4,2          ## @NES_CQP_MODIFY_QP
	.comm	_NES_CQP_QP_TYPE_IWARP,4,2      ## @NES_CQP_QP_TYPE_IWARP
L_.str.2:                               ## @.str.2
	.asciz	"using next_iwarp_state=%08x, wqe_words=%08x\n"

	.comm	_NES_CQP_WQE_ID_IDX,8,3         ## @NES_CQP_WQE_ID_IDX
	.comm	_NES_CQP_QP_WQE_CONTEXT_LOW_IDX,4,2 ## @NES_CQP_QP_WQE_CONTEXT_LOW_IDX
	.comm	_NES_CQP_QP_IWARP_STATE_MASK,4,2 ## @NES_CQP_QP_IWARP_STATE_MASK
	.comm	_NES_CQP_QP_IWARP_STATE_TERMINATE,4,2 ## @NES_CQP_QP_IWARP_STATE_TERMINATE
	.comm	_NES_CQP_QP_TERM_DONT_SEND_TERM_MSG,4,2 ## @NES_CQP_QP_TERM_DONT_SEND_TERM_MSG
	.comm	_NES_CQP_OP_TERMLEN_SHIFT,4,2   ## @NES_CQP_OP_TERMLEN_SHIFT
	.comm	_NES_CQP_QP_WQE_NEW_MSS_IDX,8,3 ## @NES_CQP_QP_WQE_NEW_MSS_IDX
	.comm	_NES_EVENT_TIMEOUT,4,2          ## @NES_EVENT_TIMEOUT
L_.str.3:                               ## @.str.3
	.asciz	"Modify iwarp QP%u completed, wait_event_timeout ret=%u, CQP Major:Minor codes = 0x%04X:0x%04X.\n"

L_.str.4:                               ## @.str.4
	.asciz	"Modify iwarp QP%u failedCQP Major:Minor codes = 0x%04X:0x%04X, intended next state = 0x%08X.\n"

	.comm	_ETIME,4,2                      ## @ETIME
	.comm	_EIO,4,2                        ## @EIO
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_nes_hw_modify_qp               ; -- Begin function nes_hw_modify_qp
	.p2align	2
_nes_hw_modify_qp:                      ; @nes_hw_modify_qp
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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	x23, x4
	mov	x24, x3
	mov	x21, x2
	mov	x20, x1
	mov	x19, x0
	mov	x0, x1
Lloh0:
	adrp	x27, _NES_DBG_MOD_QP@GOTPAGE
Lloh1:
	ldr	x27, [x27, _NES_DBG_MOD_QP@GOTPAGEOFF]
	ldr	w22, [x27]
	ldr	w25, [x0], #16
	bl	_atomic_read
                                        ; kill: def $w0 killed $w0 def $x0
	stp	x25, x0, [sp]
Lloh2:
	adrp	x1, l_.str@PAGE
Lloh3:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x22
	bl	_nes_debug
	mov	x0, x19
	bl	_nes_get_cqp_request
	cbz	x0, LBB0_8
; %bb.1:
	mov	x22, x0
	cmp	w23, #0
	cset	w8, ne
	mov	x25, x0
	ldr	x0, [x25, #32]!
	str	w8, [x22]
Lloh4:
	adrp	x28, _NES_CQP_WQE_OPCODE_IDX@GOTPAGE
Lloh5:
	ldr	x28, [x28, _NES_CQP_WQE_OPCODE_IDX@GOTPAGEOFF]
	ldr	x1, [x28]
Lloh6:
	adrp	x8, _NES_CQP_MODIFY_QP@GOTPAGE
Lloh7:
	ldr	x8, [x8, _NES_CQP_MODIFY_QP@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
Lloh9:
	adrp	x9, _NES_CQP_QP_TYPE_IWARP@GOTPAGE
Lloh10:
	ldr	x9, [x9, _NES_CQP_QP_TYPE_IWARP@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
	orr	w8, w8, w21
	orr	w2, w8, w9
	bl	_set_wqe_32bit_value
	ldr	w26, [x27]
	ldr	x8, [x25]
	ldr	x9, [x28]
	ldr	w0, [x8, x9, lsl #2]
	bl	_le32_to_cpu
                                        ; kill: def $w0 killed $w0 def $x0
	stp	x21, x0, [sp]
Lloh12:
	adrp	x1, l_.str.2@PAGE
Lloh13:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x26
	bl	_nes_debug
	mov	x0, x25
	mov	x1, x19
	bl	_nes_fill_init_cqp_wqe
	ldr	x0, [x25]
Lloh14:
	adrp	x8, _NES_CQP_WQE_ID_IDX@GOTPAGE
Lloh15:
	ldr	x8, [x8, _NES_CQP_WQE_ID_IDX@GOTPAGEOFF]
Lloh16:
	ldr	x1, [x8]
	ldr	w2, [x20]
	bl	_set_wqe_32bit_value
	ldr	x0, [x25]
Lloh17:
	adrp	x8, _NES_CQP_QP_WQE_CONTEXT_LOW_IDX@GOTPAGE
Lloh18:
	ldr	x8, [x8, _NES_CQP_QP_WQE_CONTEXT_LOW_IDX@GOTPAGEOFF]
Lloh19:
	ldr	w1, [x8]
	ldr	w2, [x20, #8]
	bl	_set_wqe_64bit_value
Lloh20:
	adrp	x8, _NES_CQP_QP_IWARP_STATE_MASK@GOTPAGE
Lloh21:
	ldr	x8, [x8, _NES_CQP_QP_IWARP_STATE_MASK@GOTPAGEOFF]
Lloh22:
	ldr	w8, [x8]
	and	w8, w8, w21
Lloh23:
	adrp	x9, _NES_CQP_QP_IWARP_STATE_TERMINATE@GOTPAGE
Lloh24:
	ldr	x9, [x9, _NES_CQP_QP_IWARP_STATE_TERMINATE@GOTPAGEOFF]
Lloh25:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ne	LBB0_4
; %bb.2:
Lloh26:
	adrp	x8, _NES_CQP_QP_TERM_DONT_SEND_TERM_MSG@GOTPAGE
Lloh27:
	ldr	x8, [x8, _NES_CQP_QP_TERM_DONT_SEND_TERM_MSG@GOTPAGEOFF]
Lloh28:
	ldr	w8, [x8]
	tst	w8, w21
	b.ne	LBB0_4
; %bb.3:
	add	w8, w24, #3
	asr	w8, w8, #2
Lloh29:
	adrp	x9, _NES_CQP_OP_TERMLEN_SHIFT@GOTPAGE
Lloh30:
	ldr	x9, [x9, _NES_CQP_OP_TERMLEN_SHIFT@GOTPAGEOFF]
Lloh31:
	ldr	w9, [x9]
	lsl	w2, w8, w9
	ldr	x0, [x25]
Lloh32:
	adrp	x8, _NES_CQP_QP_WQE_NEW_MSS_IDX@GOTPAGE
Lloh33:
	ldr	x8, [x8, _NES_CQP_QP_WQE_NEW_MSS_IDX@GOTPAGEOFF]
Lloh34:
	ldr	x1, [x8]
	bl	_set_wqe_32bit_value
LBB0_4:
	add	x0, x22, #28
	mov	w1, #2
	bl	_atomic_set
	mov	x0, x19
	mov	x1, x22
	bl	_nes_post_cqp_request
	cbz	w23, LBB0_10
; %bb.5:
	ldr	w0, [x22, #24]
	ldr	x8, [x22, #8]
	cmp	x8, #0
	cset	w1, ne
Lloh35:
	adrp	x8, _NES_EVENT_TIMEOUT@GOTPAGE
Lloh36:
	ldr	x8, [x8, _NES_EVENT_TIMEOUT@GOTPAGEOFF]
Lloh37:
	ldr	w2, [x8]
	bl	_wait_event_timeout
	mov	x23, x0
	ldr	w0, [x27]
	ldr	w8, [x20]
	ldp	w9, w10, [x22, #16]
	stp	x9, x10, [sp, #16]
	stp	x8, x23, [sp]
Lloh38:
	adrp	x1, l_.str.3@PAGE
Lloh39:
	add	x1, x1, l_.str.3@PAGEOFF
	bl	_nes_debug
	ldr	w8, [x22, #16]
	cbz	w8, LBB0_9
; %bb.6:
	ldr	w0, [x27]
                                        ; kill: def $w21 killed $w21 killed $x21 def $x21
	ldr	w9, [x20]
	ldr	w10, [x22, #20]
	stp	x10, x21, [sp, #16]
	stp	x9, x8, [sp]
Lloh40:
	adrp	x1, l_.str.4@PAGE
Lloh41:
	add	x1, x1, l_.str.4@PAGEOFF
	bl	_nes_debug
	mov	x0, x19
	mov	x1, x22
	bl	_nes_put_cqp_request
	cbz	w23, LBB0_11
; %bb.7:
Lloh42:
	adrp	x8, _EIO@GOTPAGE
Lloh43:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
	b	LBB0_12
LBB0_8:
	ldr	w0, [x27]
Lloh44:
	adrp	x1, l_.str.1@PAGE
Lloh45:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_nes_debug
Lloh46:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh47:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
	b	LBB0_12
LBB0_9:
	mov	x0, x19
	mov	x1, x22
	bl	_nes_put_cqp_request
	cbz	w23, LBB0_11
LBB0_10:
	mov	w0, #0
	b	LBB0_13
LBB0_11:
Lloh48:
	adrp	x8, _ETIME@GOTPAGE
Lloh49:
	ldr	x8, [x8, _ETIME@GOTPAGEOFF]
LBB0_12:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_13:
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpAdd	Lloh38, Lloh39
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.loh AdrpAdd	Lloh40, Lloh41
	.loh AdrpLdrGot	Lloh42, Lloh43
	.loh AdrpLdrGot	Lloh46, Lloh47
	.loh AdrpAdd	Lloh44, Lloh45
	.loh AdrpLdrGot	Lloh48, Lloh49
	.cfi_endproc
                                        ; -- End function
	.comm	_NES_DBG_MOD_QP,4,2             ; @NES_DBG_MOD_QP
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"QP%u, refcount=%d\n"

l_.str.1:                               ; @.str.1
	.asciz	"Failed to get a cqp_request.\n"

	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_NES_CQP_WQE_OPCODE_IDX,8,3     ; @NES_CQP_WQE_OPCODE_IDX
	.comm	_NES_CQP_MODIFY_QP,4,2          ; @NES_CQP_MODIFY_QP
	.comm	_NES_CQP_QP_TYPE_IWARP,4,2      ; @NES_CQP_QP_TYPE_IWARP
l_.str.2:                               ; @.str.2
	.asciz	"using next_iwarp_state=%08x, wqe_words=%08x\n"

	.comm	_NES_CQP_WQE_ID_IDX,8,3         ; @NES_CQP_WQE_ID_IDX
	.comm	_NES_CQP_QP_WQE_CONTEXT_LOW_IDX,4,2 ; @NES_CQP_QP_WQE_CONTEXT_LOW_IDX
	.comm	_NES_CQP_QP_IWARP_STATE_MASK,4,2 ; @NES_CQP_QP_IWARP_STATE_MASK
	.comm	_NES_CQP_QP_IWARP_STATE_TERMINATE,4,2 ; @NES_CQP_QP_IWARP_STATE_TERMINATE
	.comm	_NES_CQP_QP_TERM_DONT_SEND_TERM_MSG,4,2 ; @NES_CQP_QP_TERM_DONT_SEND_TERM_MSG
	.comm	_NES_CQP_OP_TERMLEN_SHIFT,4,2   ; @NES_CQP_OP_TERMLEN_SHIFT
	.comm	_NES_CQP_QP_WQE_NEW_MSS_IDX,8,3 ; @NES_CQP_QP_WQE_NEW_MSS_IDX
	.comm	_NES_EVENT_TIMEOUT,4,2          ; @NES_EVENT_TIMEOUT
l_.str.3:                               ; @.str.3
	.asciz	"Modify iwarp QP%u completed, wait_event_timeout ret=%u, CQP Major:Minor codes = 0x%04X:0x%04X.\n"

l_.str.4:                               ; @.str.4
	.asciz	"Modify iwarp QP%u failedCQP Major:Minor codes = 0x%04X:0x%04X, intended next state = 0x%08X.\n"

	.comm	_ETIME,4,2                      ; @ETIME
	.comm	_EIO,4,2                        ; @EIO
.subsections_via_symbols
