	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_i40iw_rem_ref                  ## -- Begin function i40iw_rem_ref
	.p2align	4, 0x90
_i40iw_rem_ref:                         ## @i40iw_rem_ref
	.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
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	callq	_to_iwqp
	movq	%rax, %r12
	movq	24(%rax), %r14
	leaq	4(%r14), %rbx
	movq	%rbx, %rdi
	callq	_spin_lock_irqsave
	leaq	16(%r12), %rdi
	callq	_atomic_dec_and_test
	testl	%eax, %eax
	je	LBB0_4
## %bb.1:
	movq	8(%r12), %r15
	movq	8(%r14), %rax
	movq	$0, (%rax,%r15,8)
	movq	%rbx, %rdi
	callq	_spin_unlock_irqrestore
	movq	%r14, %rdi
	xorl	%esi, %esi
	callq	_i40iw_get_cqp_request
	testq	%rax, %rax
	je	LBB0_3
## %bb.2:
	movq	_i40iw_free_qp@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, 48(%rax)
	movq	%r12, %rcx
	addq	$4, %rcx
	movq	%rcx, 40(%rax)
	movq	_OP_QP_DESTROY@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	movl	%edx, 32(%rax)
	movl	$1, (%rax)
	movq	%rcx, 24(%rax)
	movq	%rax, 8(%rax)
	movl	$1, 16(%rax)
	movq	%r14, %rdi
	movq	%rax, %rsi
	callq	_i40iw_handle_cqp_op
	testl	%eax, %eax
	je	LBB0_3
## %bb.5:
	movl	(%r12), %edi
	movq	%r14, %rsi
	callq	_i40iw_rem_pdusecount
	movq	%r14, %rdi
	movq	%r12, %rsi
	movq	%r15, %rdx
	callq	_i40iw_free_qp_resources
	movq	%r14, %rdi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_i40iw_rem_devusecount          ## TAILCALL
LBB0_4:
	movq	%rbx, %rdi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_spin_unlock_irqrestore         ## TAILCALL
LBB0_3:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_i40iw_free_qp,4,2              ## @i40iw_free_qp
	.comm	_OP_QP_DESTROY,4,2              ## @OP_QP_DESTROY
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_i40iw_rem_ref                  ; -- Begin function i40iw_rem_ref
	.p2align	2
_i40iw_rem_ref:                         ; @i40iw_rem_ref
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	bl	_to_iwqp
	mov	x20, x0
	ldr	x19, [x0, #24]
	add	x22, x19, #4
	mov	x0, x22
	bl	_spin_lock_irqsave
	add	x0, x20, #16
	bl	_atomic_dec_and_test
	cbz	w0, LBB0_4
; %bb.1:
	ldr	x21, [x20, #8]
	ldr	x8, [x19, #8]
	str	xzr, [x8, x21, lsl #3]
	mov	x0, x22
	bl	_spin_unlock_irqrestore
	mov	x0, x19
	mov	w1, #0
	bl	_i40iw_get_cqp_request
	cbz	x0, LBB0_5
; %bb.2:
	mov	x1, x0
Lloh0:
	adrp	x8, _i40iw_free_qp@GOTPAGE
Lloh1:
	ldr	x8, [x8, _i40iw_free_qp@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	str	w8, [x0, #48]
	add	x8, x20, #4
	str	x8, [x0, #40]
Lloh3:
	adrp	x9, _OP_QP_DESTROY@GOTPAGE
Lloh4:
	ldr	x9, [x9, _OP_QP_DESTROY@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	str	w9, [x0, #32]
	mov	w9, #1
	str	w9, [x0]
	str	x8, [x0, #24]
	str	x0, [x0, #8]
	str	w9, [x0, #16]
	mov	x0, x19
	bl	_i40iw_handle_cqp_op
	cbz	w0, LBB0_5
; %bb.3:
	ldr	w0, [x20]
	mov	x1, x19
	bl	_i40iw_rem_pdusecount
	mov	x0, x19
	mov	x1, x20
	mov	x2, x21
	bl	_i40iw_free_qp_resources
	mov	x0, x19
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	b	_i40iw_rem_devusecount
LBB0_4:
	mov	x0, x22
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	b	_spin_unlock_irqrestore
LBB0_5:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_i40iw_free_qp,4,2              ; @i40iw_free_qp
	.comm	_OP_QP_DESTROY,4,2              ; @OP_QP_DESTROY
.subsections_via_symbols
