	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function nes_poll_cq
_nes_poll_cq:                           ## @nes_poll_cq
	.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
	movl	%esi, %r15d
	movq	%rdi, %rbx
	movl	(%rdi), %edi
	callq	_to_nesvnic
	movq	(%rax), %rax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movq	%rbx, %rdi
	callq	_to_nescq
	movq	%rax, %r13
	movq	_NES_DBG_CQ@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	xorl	%eax, %eax
	callq	_nes_debug
	leaq	4(%r13), %r14
	movq	%r14, %rdi
	xorl	%esi, %esi
	callq	_spin_lock_irqsave
	movl	8(%r13), %ebx
	testl	%r15d, %r15d
	movq	%r14, -64(%rbp)                 ## 8-byte Spill
	jle	LBB0_7
## %bb.1:
	movl	12(%r13), %r15d
	movslq	%ebx, %r12
	movq	24(%r13), %rax
	movq	(%rax,%r12,8), %rax
	movq	_NES_CQE_OPCODE_IDX@GOTPCREL(%rip), %r14
	movq	(%r14), %rcx
	movq	(%rax,%rcx,8), %rdi
	callq	_le32_to_cpu
	movq	_NES_CQE_VALID@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_7
## %bb.2:
	movl	%r15d, %eax
	shrl	$31, %eax
	addl	%r15d, %eax
	sarl	%eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	jmp	LBB0_3
	.p2align	4, 0x90
LBB0_5:                                 ##   in Loop: Header=BB0_3 Depth=1
	movq	_NES_DBG_CQ@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	16(%r13), %edx
	leaq	L_.str.4(%rip), %rsi
	movl	%r15d, %r8d
	xorl	%eax, %eax
	callq	_nes_debug
	movq	_NES_CQE_ALLOC@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	addq	(%rax), %rdi
	movl	(%r13), %esi
	shll	$16, %esi
	orl	16(%r13), %esi
	callq	_nes_write32
	movl	$0, (%r13)
LBB0_6:                                 ##   in Loop: Header=BB0_3 Depth=1
	movq	24(%r13), %rax
	movslq	%ebx, %r12
	movq	(%rax,%r12,8), %rax
	movq	(%r14), %rcx
	movq	(%rax,%rcx,8), %rdi
	callq	_le32_to_cpu
	movq	_NES_CQE_VALID@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_7
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movl	%ebx, -48(%rbp)                 ## 4-byte Spill
	xorl	%eax, %eax
	callq	_rmb
	movq	24(%r13), %rax
	movl	%r15d, %ebx
	movq	%r14, %r15
	movq	(%rax,%r12,8), %r14
	movq	_NES_CQE_COMP_COMP_CTX_LOW_IDX@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	(%r14,%rax,8), %rdi
	callq	_le32_to_cpu
	movq	_NES_CQE_COMP_COMP_CTX_HIGH_IDX@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	(%r14,%rax,8), %rdi
	movq	%r15, %r14
	movl	%ebx, %r15d
	movl	-48(%rbp), %ebx                 ## 4-byte Reload
	callq	_le32_to_cpu
	movq	24(%r13), %rax
	movq	(%rax,%r12,8), %rax
	movq	(%r14), %rcx
	movq	$0, (%rax,%rcx,8)
	incl	%ebx
	cmpl	%r15d, %ebx
	movl	$0, %eax
	cmovgel	%eax, %ebx
	movl	(%r13), %eax
	leal	1(%rax), %ecx
	movl	%ecx, (%r13)
	cmpl	-44(%rbp), %eax                 ## 4-byte Folded Reload
	jge	LBB0_5
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	cmpl	$255, %ecx
	jne	LBB0_6
	jmp	LBB0_5
LBB0_7:
	movl	(%r13), %esi
	testl	%esi, %esi
	je	LBB0_9
## %bb.8:
	movq	_NES_CQE_ALLOC@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	addq	(%rax), %rdi
	shll	$16, %esi
	orl	16(%r13), %esi
	callq	_nes_write32
	movl	$0, (%r13)
LBB0_9:
	movl	%ebx, 8(%r13)
	movq	_NES_DBG_CQ@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	16(%r13), %ecx
	leaq	L_.str.5(%rip), %rsi
	xorl	%edx, %edx
	xorl	%eax, %eax
	callq	_nes_debug
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	xorl	%esi, %esi
	callq	_spin_unlock_irqrestore
	xorl	%eax, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_NES_DBG_CQ,4,2                 ## @NES_DBG_CQ
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"\n"

	.comm	_NES_CQE_OPCODE_IDX,8,3         ## @NES_CQE_OPCODE_IDX
	.comm	_NES_CQE_VALID,4,2              ## @NES_CQE_VALID
	.comm	_NES_CQE_COMP_COMP_CTX_LOW_IDX,8,3 ## @NES_CQE_COMP_COMP_CTX_LOW_IDX
	.comm	_NES_SW_CONTEXT_ALIGN,4,2       ## @NES_SW_CONTEXT_ALIGN
	.comm	_NES_CQE_COMP_COMP_CTX_HIGH_IDX,8,3 ## @NES_CQE_COMP_COMP_CTX_HIGH_IDX
	.comm	_NES_CQE_ERROR_CODE_IDX,8,3     ## @NES_CQE_ERROR_CODE_IDX
	.comm	_IB_WC_SUCCESS,4,2              ## @IB_WC_SUCCESS
	.comm	_NES_IWARP_CQE_MAJOR_DRV,4,2    ## @NES_IWARP_CQE_MAJOR_DRV
	.comm	_NES_IWARP_CQE_MAJOR_FLUSH,4,2  ## @NES_IWARP_CQE_MAJOR_FLUSH
	.comm	_NES_IWARP_CQE_MINOR_FLUSH,4,2  ## @NES_IWARP_CQE_MINOR_FLUSH
	.comm	_IB_WC_WR_FLUSH_ERR,4,2         ## @IB_WC_WR_FLUSH_ERR
	.comm	_NES_CQE_SQ,4,2                 ## @NES_CQE_SQ
	.comm	_NES_IWARP_SQ_WQE_COMP_SCRATCH_HIGH_IDX,8,3 ## @NES_IWARP_SQ_WQE_COMP_SCRATCH_HIGH_IDX
	.comm	_NES_IWARP_SQ_WQE_COMP_SCRATCH_LOW_IDX,8,3 ## @NES_IWARP_SQ_WQE_COMP_SCRATCH_LOW_IDX
	.comm	_NES_IWARP_SQ_WQE_TOTAL_PAYLOAD_IDX,8,3 ## @NES_IWARP_SQ_WQE_TOTAL_PAYLOAD_IDX
	.comm	_NES_IWARP_SQ_WQE_MISC_IDX,8,3  ## @NES_IWARP_SQ_WQE_MISC_IDX
	.comm	_IB_WC_RDMA_WRITE,4,2           ## @IB_WC_RDMA_WRITE
	.comm	_IB_WC_RDMA_READ,4,2            ## @IB_WC_RDMA_READ
	.comm	_NES_IWARP_SQ_WQE_RDMA_LENGTH_IDX,8,3 ## @NES_IWARP_SQ_WQE_RDMA_LENGTH_IDX
	.comm	_IB_WC_SEND,4,2                 ## @IB_WC_SEND
	.comm	_IB_WC_LOCAL_INV,4,2            ## @IB_WC_LOCAL_INV
	.comm	_IB_WC_FAST_REG_MR,4,2          ## @IB_WC_FAST_REG_MR
	.comm	_NES_CQE_PAYLOAD_LENGTH_IDX,8,3 ## @NES_CQE_PAYLOAD_LENGTH_IDX
	.comm	_NES_IWARP_RQ_WQE_COMP_SCRATCH_LOW_IDX,8,3 ## @NES_IWARP_RQ_WQE_COMP_SCRATCH_LOW_IDX
	.comm	_NES_IWARP_RQ_WQE_COMP_SCRATCH_HIGH_IDX,8,3 ## @NES_IWARP_RQ_WQE_COMP_SCRATCH_HIGH_IDX
	.comm	_IB_WC_RECV,4,2                 ## @IB_WC_RECV
L_.str.4:                               ## @.str.4
	.asciz	"CQ%u Issuing CQE Allocate since more than half of cqes are pending %u of %u.\n"

	.comm	_NES_CQE_ALLOC,8,3              ## @NES_CQE_ALLOC
L_.str.5:                               ## @.str.5
	.asciz	"Reporting %u completions for CQ%u.\n"

	.no_dead_strip	_nes_poll_cq
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function nes_poll_cq
_nes_poll_cq:                           ; @nes_poll_cq
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #144
	.cfi_def_cfa_offset 144
	stp	x28, x27, [sp, #48]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #64]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #80]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #96]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #112]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #128]            ; 16-byte Folded Spill
	add	x29, sp, #128
	.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	x21, x1
	mov	x19, x0
	ldr	w0, [x0]
	bl	_to_nesvnic
	ldr	x8, [x0]
	str	x8, [sp, #40]                   ; 8-byte Folded Spill
	mov	x0, x19
	bl	_to_nescq
	mov	x20, x0
Lloh0:
	adrp	x8, _NES_DBG_CQ@GOTPAGE
Lloh1:
	ldr	x8, [x8, _NES_DBG_CQ@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	bl	_nes_debug
	add	x19, x20, #4
	mov	x0, x19
	mov	x1, #0
	bl	_spin_lock_irqsave
	ldr	w24, [x20, #8]
	cmp	w21, #1
	str	x19, [sp, #32]                  ; 8-byte Folded Spill
	b.lt	LBB0_7
; %bb.1:
	mov	x8, x24
	sxtw	x21, w8
	ldr	w26, [x20, #12]
	cmp	w26, #0
	ldr	x8, [x20, #24]
	ldr	x8, [x8, x21, lsl #3]
	cinc	w19, w26, lt
Lloh5:
	adrp	x27, _NES_CQE_OPCODE_IDX@GOTPAGE
Lloh6:
	ldr	x27, [x27, _NES_CQE_OPCODE_IDX@GOTPAGEOFF]
	ldr	x9, [x27]
	ldr	x0, [x8, x9, lsl #3]
	bl	_le32_to_cpu
Lloh7:
	adrp	x28, _NES_CQE_VALID@GOTPAGE
Lloh8:
	ldr	x28, [x28, _NES_CQE_VALID@GOTPAGEOFF]
	ldr	w8, [x28]
	tst	w8, w0
	b.eq	LBB0_7
; %bb.2:
	asr	w19, w19, #1
Lloh9:
	adrp	x22, _NES_CQE_COMP_COMP_CTX_LOW_IDX@GOTPAGE
Lloh10:
	ldr	x22, [x22, _NES_CQE_COMP_COMP_CTX_LOW_IDX@GOTPAGEOFF]
Lloh11:
	adrp	x25, _NES_CQE_COMP_COMP_CTX_HIGH_IDX@GOTPAGE
Lloh12:
	ldr	x25, [x25, _NES_CQE_COMP_COMP_CTX_HIGH_IDX@GOTPAGEOFF]
	b	LBB0_5
LBB0_3:                                 ;   in Loop: Header=BB0_5 Depth=1
Lloh13:
	adrp	x9, _NES_DBG_CQ@GOTPAGE
Lloh14:
	ldr	x9, [x9, _NES_DBG_CQ@GOTPAGEOFF]
Lloh15:
	ldr	w0, [x9]
	ldr	w9, [x20, #16]
	stp	x8, x26, [sp, #8]
	str	x9, [sp]
Lloh16:
	adrp	x1, l_.str.4@PAGE
Lloh17:
	add	x1, x1, l_.str.4@PAGEOFF
	bl	_nes_debug
	ldr	x8, [sp, #40]                   ; 8-byte Folded Reload
	ldr	x8, [x8]
Lloh18:
	adrp	x9, _NES_CQE_ALLOC@GOTPAGE
Lloh19:
	ldr	x9, [x9, _NES_CQE_ALLOC@GOTPAGEOFF]
Lloh20:
	ldr	x9, [x9]
	add	x0, x9, x8
	ldr	w8, [x20, #16]
	ldr	w9, [x20]
	orr	w1, w8, w9, lsl #16
	bl	_nes_write32
	str	wzr, [x20]
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=1
	ldr	x8, [x20, #24]
	sxtw	x21, w24
	ldr	x8, [x8, w24, sxtw #3]
	ldr	x9, [x27]
	ldr	x0, [x8, x9, lsl #3]
	bl	_le32_to_cpu
	ldr	w8, [x28]
	tst	w8, w0
	b.eq	LBB0_7
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	bl	_rmb
	ldr	x8, [x20, #24]
	lsl	x21, x21, #3
	ldr	x23, [x8, x21]
	ldr	x8, [x22]
	ldr	x0, [x23, x8, lsl #3]
	bl	_le32_to_cpu
	ldr	x8, [x25]
	ldr	x0, [x23, x8, lsl #3]
	bl	_le32_to_cpu
	ldr	x8, [x20, #24]
	ldr	x8, [x8, x21]
	ldr	x9, [x27]
	str	xzr, [x8, x9, lsl #3]
	add	w8, w24, #1
	cmp	w8, w26
	csinc	w24, wzr, w24, ge
	ldr	w9, [x20]
	add	w8, w9, #1
	str	w8, [x20]
	cmp	w9, w19
	b.ge	LBB0_3
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	cmp	w8, #255
	b.ne	LBB0_4
	b	LBB0_3
LBB0_7:
	ldr	w8, [x20]
	cbz	w8, LBB0_9
; %bb.8:
	ldr	x9, [sp, #40]                   ; 8-byte Folded Reload
	ldr	x9, [x9]
Lloh21:
	adrp	x10, _NES_CQE_ALLOC@GOTPAGE
Lloh22:
	ldr	x10, [x10, _NES_CQE_ALLOC@GOTPAGEOFF]
Lloh23:
	ldr	x10, [x10]
	add	x0, x10, x9
	ldr	w9, [x20, #16]
	orr	w1, w9, w8, lsl #16
	bl	_nes_write32
	str	wzr, [x20]
LBB0_9:
	str	w24, [x20, #8]
Lloh24:
	adrp	x8, _NES_DBG_CQ@GOTPAGE
Lloh25:
	ldr	x8, [x8, _NES_DBG_CQ@GOTPAGEOFF]
Lloh26:
	ldr	w0, [x8]
	ldr	w8, [x20, #16]
	stp	xzr, x8, [sp]
Lloh27:
	adrp	x1, l_.str.5@PAGE
Lloh28:
	add	x1, x1, l_.str.5@PAGEOFF
	bl	_nes_debug
	ldr	x0, [sp, #32]                   ; 8-byte Folded Reload
	mov	x1, #0
	bl	_spin_unlock_irqrestore
	mov	w0, #0
	ldp	x29, x30, [sp, #128]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #112]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #96]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #80]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #64]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #144
	ret
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpAdd	Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.cfi_endproc
                                        ; -- End function
	.comm	_NES_DBG_CQ,4,2                 ; @NES_DBG_CQ
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"\n"

	.comm	_NES_CQE_OPCODE_IDX,8,3         ; @NES_CQE_OPCODE_IDX
	.comm	_NES_CQE_VALID,4,2              ; @NES_CQE_VALID
	.comm	_NES_CQE_COMP_COMP_CTX_LOW_IDX,8,3 ; @NES_CQE_COMP_COMP_CTX_LOW_IDX
	.comm	_NES_SW_CONTEXT_ALIGN,4,2       ; @NES_SW_CONTEXT_ALIGN
	.comm	_NES_CQE_COMP_COMP_CTX_HIGH_IDX,8,3 ; @NES_CQE_COMP_COMP_CTX_HIGH_IDX
	.comm	_NES_CQE_ERROR_CODE_IDX,8,3     ; @NES_CQE_ERROR_CODE_IDX
	.comm	_IB_WC_SUCCESS,4,2              ; @IB_WC_SUCCESS
	.comm	_NES_IWARP_CQE_MAJOR_DRV,4,2    ; @NES_IWARP_CQE_MAJOR_DRV
	.comm	_NES_IWARP_CQE_MAJOR_FLUSH,4,2  ; @NES_IWARP_CQE_MAJOR_FLUSH
	.comm	_NES_IWARP_CQE_MINOR_FLUSH,4,2  ; @NES_IWARP_CQE_MINOR_FLUSH
	.comm	_IB_WC_WR_FLUSH_ERR,4,2         ; @IB_WC_WR_FLUSH_ERR
	.comm	_NES_CQE_SQ,4,2                 ; @NES_CQE_SQ
	.comm	_NES_IWARP_SQ_WQE_COMP_SCRATCH_HIGH_IDX,8,3 ; @NES_IWARP_SQ_WQE_COMP_SCRATCH_HIGH_IDX
	.comm	_NES_IWARP_SQ_WQE_COMP_SCRATCH_LOW_IDX,8,3 ; @NES_IWARP_SQ_WQE_COMP_SCRATCH_LOW_IDX
	.comm	_NES_IWARP_SQ_WQE_TOTAL_PAYLOAD_IDX,8,3 ; @NES_IWARP_SQ_WQE_TOTAL_PAYLOAD_IDX
	.comm	_NES_IWARP_SQ_WQE_MISC_IDX,8,3  ; @NES_IWARP_SQ_WQE_MISC_IDX
	.comm	_IB_WC_RDMA_WRITE,4,2           ; @IB_WC_RDMA_WRITE
	.comm	_IB_WC_RDMA_READ,4,2            ; @IB_WC_RDMA_READ
	.comm	_NES_IWARP_SQ_WQE_RDMA_LENGTH_IDX,8,3 ; @NES_IWARP_SQ_WQE_RDMA_LENGTH_IDX
	.comm	_IB_WC_SEND,4,2                 ; @IB_WC_SEND
	.comm	_IB_WC_LOCAL_INV,4,2            ; @IB_WC_LOCAL_INV
	.comm	_IB_WC_FAST_REG_MR,4,2          ; @IB_WC_FAST_REG_MR
	.comm	_NES_CQE_PAYLOAD_LENGTH_IDX,8,3 ; @NES_CQE_PAYLOAD_LENGTH_IDX
	.comm	_NES_IWARP_RQ_WQE_COMP_SCRATCH_LOW_IDX,8,3 ; @NES_IWARP_RQ_WQE_COMP_SCRATCH_LOW_IDX
	.comm	_NES_IWARP_RQ_WQE_COMP_SCRATCH_HIGH_IDX,8,3 ; @NES_IWARP_RQ_WQE_COMP_SCRATCH_HIGH_IDX
	.comm	_IB_WC_RECV,4,2                 ; @IB_WC_RECV
l_.str.4:                               ; @.str.4
	.asciz	"CQ%u Issuing CQE Allocate since more than half of cqes are pending %u of %u.\n"

	.comm	_NES_CQE_ALLOC,8,3              ; @NES_CQE_ALLOC
l_.str.5:                               ; @.str.5
	.asciz	"Reporting %u completions for CQ%u.\n"

	.no_dead_strip	_nes_poll_cq
.subsections_via_symbols
