	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mthca_cq_clean                 ## -- Begin function mthca_cq_clean
	.p2align	4, 0x90
_mthca_cq_clean:                        ## @mthca_cq_clean
	.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
	movq	%rcx, -56(%rbp)                 ## 8-byte Spill
	movl	%edx, -44(%rbp)                 ## 4-byte Spill
	movq	%rsi, %r13
	movq	%rdi, -64(%rbp)                 ## 8-byte Spill
	leaq	4(%rsi), %rdi
	movq	%rdi, -72(%rbp)                 ## 8-byte Spill
	callq	_spin_lock_irq
	movl	(%r13), %r12d
	movl	8(%r13), %esi
	.p2align	4, 0x90
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	andl	%r12d, %esi
	movq	%r13, %rdi
	callq	_get_cqe
	movq	%rax, %rdi
	callq	_cqe_sw
	testq	%rax, %rax
	je	LBB0_4
## %bb.2:                               ##   in Loop: Header=BB0_1 Depth=1
	movl	8(%r13), %esi
	movl	(%r13), %eax
	addl	%esi, %eax
	cmpl	%eax, %r12d
	je	LBB0_4
## %bb.3:                               ##   in Loop: Header=BB0_1 Depth=1
	incl	%r12d
	jmp	LBB0_1
LBB0_4:
	cmpl	(%r13), %r12d
	jle	LBB0_21
## %bb.5:
	decl	%r12d
	xorl	%r15d, %r15d
	jmp	LBB0_6
	.p2align	4, 0x90
LBB0_10:                                ##   in Loop: Header=BB0_6 Depth=1
	incl	%r15d
LBB0_14:                                ##   in Loop: Header=BB0_6 Depth=1
	movl	(%r13), %esi
	leal	-1(%r12), %eax
	cmpl	%esi, %r12d
	movl	%eax, %r12d
	jle	LBB0_15
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movl	8(%r13), %esi
	andl	%r12d, %esi
	movq	%r13, %rdi
	callq	_get_cqe
	movq	%rax, %r14
	movq	(%rax), %rbx
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	callq	_cpu_to_be32
	cmpq	%rax, %rbx
	jne	LBB0_11
## %bb.7:                               ##   in Loop: Header=BB0_6 Depth=1
	cmpq	$0, -56(%rbp)                   ## 8-byte Folded Reload
	je	LBB0_10
## %bb.8:                               ##   in Loop: Header=BB0_6 Depth=1
	movq	%r14, %rdi
	callq	_is_recv_cqe
	testq	%rax, %rax
	je	LBB0_10
## %bb.9:                               ##   in Loop: Header=BB0_6 Depth=1
	movl	8(%r14), %edi
	callq	_be32_to_cpu
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movl	%eax, %esi
	callq	_mthca_free_srq_wqe
	jmp	LBB0_10
	.p2align	4, 0x90
LBB0_11:                                ##   in Loop: Header=BB0_6 Depth=1
	testl	%r15d, %r15d
	je	LBB0_12
## %bb.13:                              ##   in Loop: Header=BB0_6 Depth=1
	leal	(%r12,%r15), %esi
	andl	8(%r13), %esi
	movq	%r13, %rdi
	callq	_get_cqe
	movq	_MTHCA_CQ_ENTRY_SIZE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movq	%rax, %rdi
	movq	%r14, %rsi
	callq	_memcpy
	jmp	LBB0_14
LBB0_12:                                ##   in Loop: Header=BB0_6 Depth=1
	xorl	%r15d, %r15d
	jmp	LBB0_14
LBB0_15:
	testl	%r15d, %r15d
	je	LBB0_21
## %bb.16:
	jle	LBB0_20
## %bb.17:
	andl	8(%r13), %esi
	movq	%r13, %rdi
	callq	_get_cqe
	movq	%rax, %rdi
	callq	_set_cqe_hw
	cmpl	$1, %r15d
	je	LBB0_20
## %bb.18:
	movl	$1, %ebx
	.p2align	4, 0x90
LBB0_19:                                ## =>This Inner Loop Header: Depth=1
	movl	(%r13), %esi
	addl	%ebx, %esi
	andl	8(%r13), %esi
	movq	%r13, %rdi
	callq	_get_cqe
	movq	%rax, %rdi
	callq	_set_cqe_hw
	incl	%ebx
	cmpl	%ebx, %r15d
	jne	LBB0_19
LBB0_20:
	xorl	%eax, %eax
	callq	_wmb
	addl	%r15d, (%r13)
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	movq	%r13, %rsi
	movl	%r15d, %edx
	callq	_update_cons_index
LBB0_21:
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_spin_unlock_irq                ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_MTHCA_CQ_ENTRY_SIZE,4,2        ## @MTHCA_CQ_ENTRY_SIZE
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mthca_cq_clean                 ; -- Begin function mthca_cq_clean
	.p2align	2
_mthca_cq_clean:                        ; @mthca_cq_clean
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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	x22, x3
	mov	x23, x2
	mov	x20, x1
	mov	x21, x0
	add	x19, x1, #4
	mov	x0, x19
	bl	_spin_lock_irq
	ldr	w25, [x20]
	ldr	w8, [x20, #8]
LBB0_1:                                 ; =>This Inner Loop Header: Depth=1
	and	w1, w8, w25
	mov	x0, x20
	bl	_get_cqe
	bl	_cqe_sw
	cbz	x0, LBB0_4
; %bb.2:                                ;   in Loop: Header=BB0_1 Depth=1
	ldr	w9, [x20]
	ldr	w8, [x20, #8]
	add	w9, w8, w9
	cmp	w25, w9
	b.eq	LBB0_4
; %bb.3:                                ;   in Loop: Header=BB0_1 Depth=1
	add	w25, w25, #1
	b	LBB0_1
LBB0_4:
	ldr	w8, [x20]
	cmp	w25, w8
	b.le	LBB0_20
; %bb.5:
	mov	w24, #0
	sub	w26, w25, #1
Lloh0:
	adrp	x27, _MTHCA_CQ_ENTRY_SIZE@GOTPAGE
Lloh1:
	ldr	x27, [x27, _MTHCA_CQ_ENTRY_SIZE@GOTPAGEOFF]
	b	LBB0_8
LBB0_6:                                 ;   in Loop: Header=BB0_8 Depth=1
	add	w24, w24, #1
LBB0_7:                                 ;   in Loop: Header=BB0_8 Depth=1
	ldr	w8, [x20]
	sub	w9, w26, #1
	cmp	w26, w8
	mov	x26, x9
	b.le	LBB0_14
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w8, [x20, #8]
	and	w1, w8, w26
	mov	x0, x20
	bl	_get_cqe
	mov	x25, x0
	ldr	x28, [x0]
	mov	x0, x23
	bl	_cpu_to_be32
	cmp	x28, x0
	b.ne	LBB0_12
; %bb.9:                                ;   in Loop: Header=BB0_8 Depth=1
	cbz	x22, LBB0_6
; %bb.10:                               ;   in Loop: Header=BB0_8 Depth=1
	mov	x0, x25
	bl	_is_recv_cqe
	cbz	x0, LBB0_6
; %bb.11:                               ;   in Loop: Header=BB0_8 Depth=1
	ldr	w0, [x25, #8]
	bl	_be32_to_cpu
	mov	x1, x0
	mov	x0, x22
	bl	_mthca_free_srq_wqe
	b	LBB0_6
LBB0_12:                                ;   in Loop: Header=BB0_8 Depth=1
	cbz	w24, LBB0_7
; %bb.13:                               ;   in Loop: Header=BB0_8 Depth=1
	ldr	w8, [x20, #8]
	add	w9, w26, w24
	and	w1, w8, w9
	mov	x0, x20
	bl	_get_cqe
	ldr	w2, [x27]
	mov	x1, x25
	bl	_memcpy
	b	LBB0_7
LBB0_14:
	cbz	w24, LBB0_20
; %bb.15:
	cmp	w24, #1
	b.lt	LBB0_19
; %bb.16:
	ldr	w9, [x20, #8]
	and	w1, w8, w9
	mov	x0, x20
	bl	_get_cqe
	bl	_set_cqe_hw
	cmp	w24, #1
	b.eq	LBB0_19
; %bb.17:
	mov	w22, #1
LBB0_18:                                ; =>This Inner Loop Header: Depth=1
	ldr	w8, [x20]
	ldr	w9, [x20, #8]
	add	w8, w22, w8
	and	w1, w8, w9
	mov	x0, x20
	bl	_get_cqe
	bl	_set_cqe_hw
	add	w22, w22, #1
	cmp	w24, w22
	b.ne	LBB0_18
LBB0_19:
	bl	_wmb
	ldr	w8, [x20]
	add	w8, w8, w24
	str	w8, [x20]
	mov	x0, x21
	mov	x1, x20
	mov	x2, x24
	bl	_update_cons_index
LBB0_20:
	mov	x0, x19
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	b	_spin_unlock_irq
	.loh AdrpLdrGot	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.comm	_MTHCA_CQ_ENTRY_SIZE,4,2        ; @MTHCA_CQ_ENTRY_SIZE
.subsections_via_symbols
