	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_flush_wqes                     ## -- Begin function flush_wqes
	.p2align	4, 0x90
_flush_wqes:                            ## @flush_wqes
	.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	%ecx, %ebx
	movl	%edx, %r12d
	movq	%rsi, %r14
	movq	_NES_IWARP_CQE_MAJOR_FLUSH@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	shll	$16, %r15d
	movq	_NES_IWARP_CQE_MINOR_FLUSH@GOTPCREL(%rip), %rax
	orl	(%rax), %r15d
	movq	%rdi, -56(%rbp)                 ## 8-byte Spill
	callq	_nes_get_cqp_request
	testq	%rax, %rax
	je	LBB0_3
## %bb.1:
	movq	%rax, %r13
	movl	%ebx, -44(%rbp)                 ## 4-byte Spill
	testl	%ebx, %ebx
	je	LBB0_4
## %bb.2:
	movq	%rax, %rbx
	movl	$1, (%rax)
	leaq	40(%r13), %rdi
	movl	$2, %esi
	callq	_atomic_set
	jmp	LBB0_5
LBB0_3:
	movq	_NES_DBG_QP@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	xorl	%eax, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_nes_debug                      ## TAILCALL
LBB0_4:
	movq	%rax, %rbx
	movl	$0, (%rax)
LBB0_5:
	addq	$32, %r13
	movq	%r13, %rdi
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	callq	_nes_fill_init_cqp_wqe
	movl	(%r14), %eax
	testl	%eax, %eax
	je	LBB0_9
## %bb.6:
	movq	_NES_CQP_FLUSH_SQ@GOTPCREL(%rip), %rcx
	testl	%r12d, (%rcx)
	je	LBB0_9
## %bb.7:
	movq	_NES_CQP_FLUSH_MAJ_MIN@GOTPCREL(%rip), %rcx
	orl	(%rcx), %r12d
	movq	_CQE_MAJOR_DRV@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
	shll	$16, %edi
	orl	%eax, %edi
	movl	$0, (%r14)
	jmp	LBB0_10
LBB0_9:
	movl	%r15d, %edi
LBB0_10:
	movl	4(%r14), %eax
	testl	%eax, %eax
	je	LBB0_13
## %bb.11:
	movq	_NES_CQP_FLUSH_RQ@GOTPCREL(%rip), %rcx
	testl	%r12d, (%rcx)
	je	LBB0_13
## %bb.12:
	movq	_NES_CQP_FLUSH_MAJ_MIN@GOTPCREL(%rip), %rcx
	orl	(%rcx), %r12d
	movq	_CQE_MAJOR_DRV@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r15d
	shll	$16, %r15d
	orl	%eax, %r15d
	movl	$0, 4(%r14)
LBB0_13:
	movq	_NES_CQP_FLUSH_MAJ_MIN@GOTPCREL(%rip), %rax
	testl	%r12d, (%rax)
	je	LBB0_15
## %bb.14:
	callq	_cpu_to_le32
	movq	(%r13), %rcx
	movq	_NES_CQP_QP_WQE_FLUSH_SQ_CODE@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rdx
	movq	%rax, (%rcx,%rdx,8)
	movl	%r15d, %edi
	callq	_cpu_to_le32
	movq	(%r13), %rcx
	movq	_NES_CQP_QP_WQE_FLUSH_RQ_CODE@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rdx
	movq	%rax, (%rcx,%rdx,8)
LBB0_15:
	movq	_NES_CQP_FLUSH_WQES@GOTPCREL(%rip), %rax
	orl	(%rax), %r12d
	movl	%r12d, %edi
	callq	_cpu_to_le32
	movq	32(%rbx), %rcx
	movq	_NES_CQP_WQE_OPCODE_IDX@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rdx
	movq	%rax, (%rcx,%rdx,8)
	movl	8(%r14), %edi
	callq	_cpu_to_le32
	movq	32(%rbx), %rcx
	movq	_NES_CQP_WQE_ID_IDX@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rdx
	movq	%rax, (%rcx,%rdx,8)
	movq	-56(%rbp), %r14                 ## 8-byte Reload
	movq	%r14, %rdi
	movq	%rbx, %rsi
	callq	_nes_post_cqp_request
	cmpl	$0, -44(%rbp)                   ## 4-byte Folded Reload
	je	LBB0_17
## %bb.16:
	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
	movq	_NES_DBG_QP@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
	movl	16(%rbx), %r8d
	movl	20(%rbx), %ecx
	leaq	L_.str.1(%rip), %rsi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_nes_debug
	movq	%r14, %rdi
	movq	%rbx, %rsi
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_nes_put_cqp_request            ## TAILCALL
LBB0_17:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.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	_NES_DBG_QP,4,2                 ## @NES_DBG_QP
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed to get a cqp_request.\n"

	.comm	_NES_CQP_FLUSH_SQ,4,2           ## @NES_CQP_FLUSH_SQ
	.comm	_NES_CQP_FLUSH_MAJ_MIN,4,2      ## @NES_CQP_FLUSH_MAJ_MIN
	.comm	_CQE_MAJOR_DRV,4,2              ## @CQE_MAJOR_DRV
	.comm	_NES_CQP_FLUSH_RQ,4,2           ## @NES_CQP_FLUSH_RQ
	.comm	_NES_CQP_QP_WQE_FLUSH_SQ_CODE,8,3 ## @NES_CQP_QP_WQE_FLUSH_SQ_CODE
	.comm	_NES_CQP_QP_WQE_FLUSH_RQ_CODE,8,3 ## @NES_CQP_QP_WQE_FLUSH_RQ_CODE
	.comm	_NES_CQP_FLUSH_WQES,4,2         ## @NES_CQP_FLUSH_WQES
	.comm	_NES_CQP_WQE_OPCODE_IDX,8,3     ## @NES_CQP_WQE_OPCODE_IDX
	.comm	_NES_CQP_WQE_ID_IDX,8,3         ## @NES_CQP_WQE_ID_IDX
	.comm	_NES_EVENT_TIMEOUT,4,2          ## @NES_EVENT_TIMEOUT
L_.str.1:                               ## @.str.1
	.asciz	"Flush SQ QP WQEs completed, ret=%u, CQP Major:Minor codes = 0x%04X:0x%04X\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_flush_wqes                     ; -- Begin function flush_wqes
	.p2align	2
_flush_wqes:                            ; @flush_wqes
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	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
	mov	x21, x3
	mov	x23, x2
	mov	x22, x1
	mov	x19, x0
Lloh0:
	adrp	x8, _NES_IWARP_CQE_MAJOR_FLUSH@GOTPAGE
Lloh1:
	ldr	x8, [x8, _NES_IWARP_CQE_MAJOR_FLUSH@GOTPAGEOFF]
Lloh2:
	ldr	w24, [x8]
Lloh3:
	adrp	x8, _NES_IWARP_CQE_MINOR_FLUSH@GOTPAGE
Lloh4:
	ldr	x8, [x8, _NES_IWARP_CQE_MINOR_FLUSH@GOTPAGEOFF]
Lloh5:
	ldr	w25, [x8]
	bl	_nes_get_cqp_request
	cbz	x0, LBB0_3
; %bb.1:
	mov	x20, x0
	orr	w24, w25, w24, lsl #16
	cbz	w21, LBB0_4
; %bb.2:
	mov	w8, #1
	mov	x0, x20
	str	w8, [x0], #40
	mov	w1, #2
	bl	_atomic_set
	b	LBB0_5
LBB0_3:
Lloh6:
	adrp	x8, _NES_DBG_QP@GOTPAGE
Lloh7:
	ldr	x8, [x8, _NES_DBG_QP@GOTPAGEOFF]
Lloh8:
	ldr	w0, [x8]
Lloh9:
	adrp	x1, l_.str@PAGE
Lloh10:
	add	x1, x1, l_.str@PAGEOFF
	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
	add	sp, sp, #112
	b	_nes_debug
LBB0_4:
	str	wzr, [x20]
LBB0_5:
	add	x25, x20, #32
	mov	x0, x25
	mov	x1, x19
	bl	_nes_fill_init_cqp_wqe
	ldr	w9, [x22]
Lloh11:
	adrp	x8, _NES_CQP_FLUSH_MAJ_MIN@GOTPAGE
Lloh12:
	ldr	x8, [x8, _NES_CQP_FLUSH_MAJ_MIN@GOTPAGEOFF]
	cbz	w9, LBB0_8
; %bb.6:
Lloh13:
	adrp	x10, _NES_CQP_FLUSH_SQ@GOTPAGE
Lloh14:
	ldr	x10, [x10, _NES_CQP_FLUSH_SQ@GOTPAGEOFF]
Lloh15:
	ldr	w10, [x10]
	tst	w10, w23
	b.eq	LBB0_8
; %bb.7:
	ldr	w10, [x8]
	orr	w23, w10, w23
Lloh16:
	adrp	x10, _CQE_MAJOR_DRV@GOTPAGE
Lloh17:
	ldr	x10, [x10, _CQE_MAJOR_DRV@GOTPAGEOFF]
Lloh18:
	ldr	w10, [x10]
	orr	w0, w9, w10, lsl #16
	str	wzr, [x22]
	ldr	w9, [x22, #4]
	cbnz	w9, LBB0_9
	b	LBB0_11
LBB0_8:
	mov	x0, x24
	ldr	w9, [x22, #4]
	cbz	w9, LBB0_11
LBB0_9:
Lloh19:
	adrp	x10, _NES_CQP_FLUSH_RQ@GOTPAGE
Lloh20:
	ldr	x10, [x10, _NES_CQP_FLUSH_RQ@GOTPAGEOFF]
Lloh21:
	ldr	w10, [x10]
	tst	w10, w23
	b.eq	LBB0_11
; %bb.10:
	ldr	w10, [x8]
	orr	w23, w10, w23
Lloh22:
	adrp	x10, _CQE_MAJOR_DRV@GOTPAGE
Lloh23:
	ldr	x10, [x10, _CQE_MAJOR_DRV@GOTPAGEOFF]
Lloh24:
	ldr	w10, [x10]
	orr	w24, w9, w10, lsl #16
	str	wzr, [x22, #4]
LBB0_11:
	ldr	w8, [x8]
	tst	w8, w23
	b.eq	LBB0_13
; %bb.12:
	bl	_cpu_to_le32
	ldr	x8, [x25]
Lloh25:
	adrp	x9, _NES_CQP_QP_WQE_FLUSH_SQ_CODE@GOTPAGE
Lloh26:
	ldr	x9, [x9, _NES_CQP_QP_WQE_FLUSH_SQ_CODE@GOTPAGEOFF]
Lloh27:
	ldr	x9, [x9]
	str	x0, [x8, x9, lsl #3]
	mov	x0, x24
	bl	_cpu_to_le32
	ldr	x8, [x25]
Lloh28:
	adrp	x9, _NES_CQP_QP_WQE_FLUSH_RQ_CODE@GOTPAGE
Lloh29:
	ldr	x9, [x9, _NES_CQP_QP_WQE_FLUSH_RQ_CODE@GOTPAGEOFF]
Lloh30:
	ldr	x9, [x9]
	str	x0, [x8, x9, lsl #3]
LBB0_13:
Lloh31:
	adrp	x8, _NES_CQP_FLUSH_WQES@GOTPAGE
Lloh32:
	ldr	x8, [x8, _NES_CQP_FLUSH_WQES@GOTPAGEOFF]
Lloh33:
	ldr	w8, [x8]
	orr	w0, w8, w23
	bl	_cpu_to_le32
	ldr	x8, [x20, #32]
Lloh34:
	adrp	x9, _NES_CQP_WQE_OPCODE_IDX@GOTPAGE
Lloh35:
	ldr	x9, [x9, _NES_CQP_WQE_OPCODE_IDX@GOTPAGEOFF]
Lloh36:
	ldr	x9, [x9]
	str	x0, [x8, x9, lsl #3]
	ldr	w0, [x22, #8]
	bl	_cpu_to_le32
	ldr	x8, [x20, #32]
Lloh37:
	adrp	x9, _NES_CQP_WQE_ID_IDX@GOTPAGE
Lloh38:
	ldr	x9, [x9, _NES_CQP_WQE_ID_IDX@GOTPAGEOFF]
Lloh39:
	ldr	x9, [x9]
	str	x0, [x8, x9, lsl #3]
	mov	x0, x19
	mov	x1, x20
	bl	_nes_post_cqp_request
	cbz	w21, LBB0_15
; %bb.14:
	ldr	w0, [x20, #24]
	ldr	x8, [x20, #8]
	cmp	x8, #0
	cset	w1, ne
Lloh40:
	adrp	x8, _NES_EVENT_TIMEOUT@GOTPAGE
Lloh41:
	ldr	x8, [x8, _NES_EVENT_TIMEOUT@GOTPAGEOFF]
Lloh42:
	ldr	w2, [x8]
	bl	_wait_event_timeout
                                        ; kill: def $w0 killed $w0 def $x0
Lloh43:
	adrp	x8, _NES_DBG_QP@GOTPAGE
Lloh44:
	ldr	x8, [x8, _NES_DBG_QP@GOTPAGEOFF]
Lloh45:
	ldr	w8, [x8]
	ldp	w10, w9, [x20, #16]
	stp	x9, x10, [sp, #8]
	str	x0, [sp]
Lloh46:
	adrp	x1, l_.str.1@PAGE
Lloh47:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x8
	bl	_nes_debug
	mov	x0, x19
	mov	x1, x20
	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
	add	sp, sp, #112
	b	_nes_put_cqp_request
LBB0_15:
	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
	add	sp, sp, #112
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh37, Lloh38, Lloh39
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpAdd	Lloh46, Lloh47
	.loh AdrpLdrGotLdr	Lloh43, Lloh44, Lloh45
	.loh AdrpLdrGotLdr	Lloh40, Lloh41, Lloh42
	.cfi_endproc
                                        ; -- End function
	.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	_NES_DBG_QP,4,2                 ; @NES_DBG_QP
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed to get a cqp_request.\n"

	.comm	_NES_CQP_FLUSH_SQ,4,2           ; @NES_CQP_FLUSH_SQ
	.comm	_NES_CQP_FLUSH_MAJ_MIN,4,2      ; @NES_CQP_FLUSH_MAJ_MIN
	.comm	_CQE_MAJOR_DRV,4,2              ; @CQE_MAJOR_DRV
	.comm	_NES_CQP_FLUSH_RQ,4,2           ; @NES_CQP_FLUSH_RQ
	.comm	_NES_CQP_QP_WQE_FLUSH_SQ_CODE,8,3 ; @NES_CQP_QP_WQE_FLUSH_SQ_CODE
	.comm	_NES_CQP_QP_WQE_FLUSH_RQ_CODE,8,3 ; @NES_CQP_QP_WQE_FLUSH_RQ_CODE
	.comm	_NES_CQP_FLUSH_WQES,4,2         ; @NES_CQP_FLUSH_WQES
	.comm	_NES_CQP_WQE_OPCODE_IDX,8,3     ; @NES_CQP_WQE_OPCODE_IDX
	.comm	_NES_CQP_WQE_ID_IDX,8,3         ; @NES_CQP_WQE_ID_IDX
	.comm	_NES_EVENT_TIMEOUT,4,2          ; @NES_EVENT_TIMEOUT
l_.str.1:                               ; @.str.1
	.asciz	"Flush SQ QP WQEs completed, ret=%u, CQP Major:Minor codes = 0x%04X:0x%04X\n"

.subsections_via_symbols
