	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mthca_poll_cq                  ## -- Begin function mthca_poll_cq
	.p2align	4, 0x90
_mthca_poll_cq:                         ## @mthca_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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, -88(%rbp)                 ## 8-byte Spill
	movl	%esi, %r14d
	movq	%rdi, %rbx
	movl	(%rdi), %edi
	callq	_to_mdev
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movq	%rbx, %rdi
	callq	_to_mcq
	movq	%rax, %rbx
	movq	$0, -96(%rbp)
	movl	$0, -44(%rbp)
	movq	%rax, %rdi
	addq	$4, %rdi
	movq	%rdi, -72(%rbp)                 ## 8-byte Spill
	callq	_spin_lock_irqsave
	movslq	%r14d, %rax
	negq	%rax
	movq	%rax, -80(%rbp)                 ## 8-byte Spill
	movq	_EAGAIN@GOTPCREL(%rip), %r13
	xorl	%r12d, %r12d
	xorl	%r15d, %r15d
	movl	%r14d, -48(%rbp)                ## 4-byte Spill
	cmpl	%r14d, %r12d
	jge	LBB0_7
	.p2align	4, 0x90
LBB0_1:
	movl	%r12d, -60(%rbp)                ## 4-byte Spill
	movslq	%r12d, %r14
	movq	-88(%rbp), %rax                 ## 8-byte Reload
	leaq	(%rax,%r14,4), %r13
	addq	-80(%rbp), %r14                 ## 8-byte Folded Reload
	xorl	%r12d, %r12d
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movq	%rbx, %rsi
	leaq	-96(%rbp), %rdx
	leaq	-44(%rbp), %rcx
	movq	%r13, %r8
	callq	_mthca_poll_one
	testl	%eax, %eax
	jne	LBB0_5
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	decq	%r12
	addq	$4, %r13
	cmpq	%r12, %r14
	jne	LBB0_2
## %bb.4:
	xorl	%r15d, %r15d
	movl	-48(%rbp), %r14d                ## 4-byte Reload
	movl	%r14d, %r12d
	jmp	LBB0_6
	.p2align	4, 0x90
LBB0_5:
	movl	%eax, %r15d
	movl	-60(%rbp), %eax                 ## 4-byte Reload
	subl	%r12d, %eax
	movl	%eax, %r12d
	movl	-48(%rbp), %r14d                ## 4-byte Reload
LBB0_6:
	movq	_EAGAIN@GOTPCREL(%rip), %r13
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	cmpl	$0, -44(%rbp)
	je	LBB0_9
## %bb.8:                               ##   in Loop: Header=BB0_7 Depth=1
	xorl	%eax, %eax
	callq	_wmb
	movl	-44(%rbp), %edx
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movq	%rbx, %rsi
	callq	_update_cons_index
LBB0_9:                                 ##   in Loop: Header=BB0_7 Depth=1
	movl	(%r13), %eax
	addl	%r15d, %eax
	jne	LBB0_13
## %bb.10:                              ##   in Loop: Header=BB0_7 Depth=1
	movq	8(%rbx), %rax
	testq	%rax, %rax
	je	LBB0_13
## %bb.11:                              ##   in Loop: Header=BB0_7 Depth=1
	movq	(%rax), %rax
	movq	_CQ_RESIZE_READY@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	sete	%al
	jmp	LBB0_14
	.p2align	4, 0x90
LBB0_13:                                ##   in Loop: Header=BB0_7 Depth=1
	xorl	%eax, %eax
LBB0_14:                                ##   in Loop: Header=BB0_7 Depth=1
	movzbl	%al, %edi
	callq	_unlikely
	testq	%rax, %rax
	je	LBB0_20
## %bb.15:                              ##   in Loop: Header=BB0_7 Depth=1
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_mthca_is_memfree
	testl	%eax, %eax
	je	LBB0_17
## %bb.16:                              ##   in Loop: Header=BB0_7 Depth=1
	movl	(%rbx), %esi
	jmp	LBB0_18
	.p2align	4, 0x90
LBB0_17:                                ##   in Loop: Header=BB0_7 Depth=1
	movl	(%rbx), %esi
	andl	16(%rbx), %esi
	movl	%esi, (%rbx)
LBB0_18:                                ##   in Loop: Header=BB0_7 Depth=1
	movq	8(%rbx), %rdi
	andl	8(%rdi), %esi
	addq	$12, %rdi
	callq	_get_cqe_from_buf
	movl	%eax, %edi
	callq	_cqe_sw
	testq	%rax, %rax
	je	LBB0_20
## %bb.19:                              ##   in Loop: Header=BB0_7 Depth=1
	movl	20(%rbx), %eax
	movl	16(%rbx), %ecx
	movq	8(%rbx), %rdx
	movl	12(%rdx), %esi
	movl	%esi, 20(%rbx)
	movl	8(%rdx), %esi
	movl	%esi, 16(%rbx)
	movl	%eax, 12(%rdx)
	movq	8(%rbx), %rax
	movl	%ecx, 8(%rax)
	movq	_CQ_RESIZE_SWAPPED@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	%rcx, (%rax)
	cmpl	%r14d, %r12d
	jl	LBB0_1
	jmp	LBB0_7
LBB0_20:
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	callq	_spin_unlock_irqrestore
	movl	(%r13), %eax
	addl	%r15d, %eax
	movl	%r15d, %eax
	cmovel	%r12d, %eax
	testl	%r15d, %r15d
	cmovel	%r12d, %eax
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EAGAIN,4,2                     ## @EAGAIN
	.comm	_CQ_RESIZE_READY,8,3            ## @CQ_RESIZE_READY
	.comm	_CQ_RESIZE_SWAPPED,8,3          ## @CQ_RESIZE_SWAPPED
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mthca_poll_cq                  ; -- Begin function mthca_poll_cq
	.p2align	2
_mthca_poll_cq:                         ; @mthca_poll_cq
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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
	str	x2, [sp, #8]                    ; 8-byte Folded Spill
	mov	x20, x1
	mov	x22, x0
	ldr	w0, [x0]
	bl	_to_mdev
	mov	x21, x0
	mov	x0, x22
	bl	_to_mcq
	mov	x22, x0
	str	xzr, [sp, #24]
	str	wzr, [sp, #20]
	add	x0, x0, #4
	str	x0, [sp]                        ; 8-byte Folded Spill
	bl	_spin_lock_irqsave
	mov	w26, #0
	mov	w24, #0
	sxtw	x28, w20
Lloh0:
	adrp	x27, _EAGAIN@GOTPAGE
Lloh1:
	ldr	x27, [x27, _EAGAIN@GOTPAGEOFF]
Lloh2:
	adrp	x23, _CQ_RESIZE_SWAPPED@GOTPAGE
Lloh3:
	ldr	x23, [x23, _CQ_RESIZE_SWAPPED@GOTPAGEOFF]
	cmp	w26, w20
	b.ge	LBB0_6
LBB0_1:
	ldr	x8, [sp, #8]                    ; 8-byte Folded Reload
	add	x25, x8, w26, sxtw #2
	sub	x19, x28, w26, sxtw
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	add	x2, sp, #24
	add	x3, sp, #20
	mov	x0, x21
	mov	x1, x22
	mov	x4, x25
	bl	_mthca_poll_one
	cbnz	w0, LBB0_5
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	add	w26, w26, #1
	add	x25, x25, #4
	subs	x19, x19, #1
	b.ne	LBB0_2
; %bb.4:
	mov	w24, #0
	mov	x26, x20
	b	LBB0_6
LBB0_5:
	mov	x24, x0
	ldr	w8, [sp, #20]
	cbnz	w8, LBB0_7
	b	LBB0_8
LBB0_6:
	ldr	w8, [sp, #20]
	cbz	w8, LBB0_8
LBB0_7:
	bl	_wmb
	ldr	w2, [sp, #20]
	mov	x0, x21
	mov	x1, x22
	bl	_update_cons_index
LBB0_8:
	ldr	w8, [x27]
	cmn	w24, w8
	b.ne	LBB0_11
; %bb.9:
	ldr	x8, [x22, #8]
	cbz	x8, LBB0_11
; %bb.10:
	ldr	x8, [x8]
Lloh4:
	adrp	x9, _CQ_RESIZE_READY@GOTPAGE
Lloh5:
	ldr	x9, [x9, _CQ_RESIZE_READY@GOTPAGEOFF]
Lloh6:
	ldr	x9, [x9]
	cmp	x8, x9
	cset	w0, eq
	bl	_unlikely
	cbnz	x0, LBB0_12
	b	LBB0_17
LBB0_11:
	mov	w0, #0
	bl	_unlikely
	cbz	x0, LBB0_17
LBB0_12:
	mov	x0, x21
	bl	_mthca_is_memfree
	cbz	w0, LBB0_14
; %bb.13:
	ldr	w8, [x22]
	b	LBB0_15
LBB0_14:
	ldr	w8, [x22, #16]
	ldr	w9, [x22]
	and	w8, w9, w8
	str	w8, [x22]
LBB0_15:
	ldr	x9, [x22, #8]
	add	x0, x9, #12
	ldr	w9, [x9, #8]
	and	w1, w9, w8
	bl	_get_cqe_from_buf
	bl	_cqe_sw
	cbz	x0, LBB0_17
; %bb.16:
	ldp	w9, w8, [x22, #16]
	ldr	x10, [x22, #8]
	ldr	w11, [x10, #12]
	str	w11, [x22, #20]
	ldr	w11, [x10, #8]
	str	w11, [x22, #16]
	str	w8, [x10, #12]
	ldr	x8, [x22, #8]
	str	w9, [x8, #8]
	ldr	x9, [x23]
	str	x9, [x8]
	cmp	w26, w20
	b.lt	LBB0_1
	b	LBB0_6
LBB0_17:
	ldr	x0, [sp]                        ; 8-byte Folded Reload
	bl	_spin_unlock_irqrestore
	ldr	w8, [x27]
	cmn	w24, w8
	ccmp	w24, #0, #4, ne
	csel	w0, w26, w24, eq
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.comm	_EAGAIN,4,2                     ; @EAGAIN
	.comm	_CQ_RESIZE_READY,8,3            ; @CQ_RESIZE_READY
	.comm	_CQ_RESIZE_SWAPPED,8,3          ; @CQ_RESIZE_SWAPPED
.subsections_via_symbols
