	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_c2_free_cq                     ## -- Begin function c2_free_cq
	.p2align	4, 0x90
_c2_free_cq:                            ## @c2_free_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	%r12
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movq	%rdi, %r12
	xorl	%eax, %eax
	callq	_might_sleep
	leaq	4(%r12), %r15
	movq	%r15, %rdi
	callq	_spin_lock_irq
	movq	8(%r12), %rax
	movq	(%r14), %rcx
	movq	$0, (%rax,%rcx,8)
	leaq	20(%r14), %rbx
	movq	%rbx, %rdi
	callq	_atomic_dec
	movq	%r15, %rdi
	callq	_spin_unlock_irq
	movl	24(%r14), %r15d
	movq	%rbx, %rdi
	callq	_atomic_read
	xorl	%esi, %esi
	testl	%eax, %eax
	sete	%sil
	movl	%r15d, %edi
	callq	_wait_event
	movq	%r12, %rdi
	callq	_vq_req_alloc
	testq	%rax, %rax
	je	LBB0_7
## %bb.1:
	movq	%rax, %r15
	leaq	-48(%rbp), %rbx
	movq	%rbx, %rdi
	xorl	%esi, %esi
	movl	$16, %edx
	callq	_memset
	movq	_CCWR_CQ_DESTROY@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_c2_wr_set_id
	movq	%r15, -40(%rbp)
	movl	(%r12), %eax
	movl	%eax, -44(%rbp)
	movl	16(%r14), %eax
	movl	%eax, -48(%rbp)
	movq	%r12, %rdi
	movq	%r15, %rsi
	callq	_vq_req_get
	movq	%r12, %rdi
	movq	%rbx, %rsi
	callq	_vq_send_wr
	movq	%r12, %rdi
	movq	%r15, %rsi
	testl	%eax, %eax
	je	LBB0_3
## %bb.2:
	callq	_vq_req_put
	jmp	LBB0_6
LBB0_3:
	callq	_vq_wait_for_reply
	testl	%eax, %eax
	jne	LBB0_6
## %bb.4:
	movq	(%r15), %rsi
	testq	%rsi, %rsi
	je	LBB0_6
## %bb.5:
	movq	%r12, %rdi
	callq	_vq_repbuf_free
LBB0_6:
	movq	%r12, %rdi
	movq	%r15, %rsi
	callq	_vq_req_free
LBB0_7:
	cmpq	$0, 8(%r14)
	je	LBB0_9
## %bb.8:
	movq	%r12, %rdi
	movq	%r14, %rsi
	callq	_c2_free_cq_buf
LBB0_9:
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_CCWR_CQ_DESTROY,4,2            ## @CCWR_CQ_DESTROY
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_c2_free_cq                     ; -- Begin function c2_free_cq
	.p2align	2
_c2_free_cq:                            ; @c2_free_cq
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x19, x1
	mov	x20, x0
	bl	_might_sleep
	add	x21, x20, #4
	mov	x0, x21
	bl	_spin_lock_irq
	ldr	x8, [x20, #8]
	ldr	x9, [x19]
	str	xzr, [x8, x9, lsl #3]
	add	x22, x19, #20
	mov	x0, x22
	bl	_atomic_dec
	mov	x0, x21
	bl	_spin_unlock_irq
	ldr	w21, [x19, #24]
	mov	x0, x22
	bl	_atomic_read
	cmp	w0, #0
	cset	w1, eq
	mov	x0, x21
	bl	_wait_event
	mov	x0, x20
	bl	_vq_req_alloc
	cbz	x0, LBB0_7
; %bb.1:
	mov	x21, x0
	mov	x0, sp
	mov	w1, #0
	mov	w2, #16
	bl	_memset
Lloh0:
	adrp	x8, _CCWR_CQ_DESTROY@GOTPAGE
Lloh1:
	ldr	x8, [x8, _CCWR_CQ_DESTROY@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	x0, sp
	bl	_c2_wr_set_id
	str	x21, [sp, #8]
	ldr	w8, [x20]
	ldr	w9, [x19, #16]
	stp	w9, w8, [sp]
	mov	x0, x20
	mov	x1, x21
	bl	_vq_req_get
	mov	x1, sp
	mov	x0, x20
	bl	_vq_send_wr
	cbz	w0, LBB0_3
; %bb.2:
	mov	x0, x20
	mov	x1, x21
	bl	_vq_req_put
	b	LBB0_6
LBB0_3:
	mov	x0, x20
	mov	x1, x21
	bl	_vq_wait_for_reply
	cbnz	w0, LBB0_6
; %bb.4:
	ldr	x1, [x21]
	cbz	x1, LBB0_6
; %bb.5:
	mov	x0, x20
	bl	_vq_repbuf_free
LBB0_6:
	mov	x0, x20
	mov	x1, x21
	bl	_vq_req_free
LBB0_7:
	ldr	x8, [x19, #8]
	cbz	x8, LBB0_9
; %bb.8:
	mov	x0, x20
	mov	x1, x19
	bl	_c2_free_cq_buf
LBB0_9:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_CCWR_CQ_DESTROY,4,2            ; @CCWR_CQ_DESTROY
.subsections_via_symbols
