	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function clear_mr_refs
_clear_mr_refs:                         ## @clear_mr_refs
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %ebx
	movq	%rdi, %r14
	movq	_QIB_R_REWIND_SGE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	56(%r14), %rsi
	callq	_test_and_clear_bit
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	leaq	52(%r14), %rdi
	callq	_qib_put_ss
LBB0_2:
	leaq	48(%r14), %rdi
	callq	_qib_put_ss
	testl	%ebx, %ebx
	je	LBB0_15
## %bb.3:
	movq	(%r14), %rsi
	cmpq	8(%r14), %rsi
	jne	LBB0_4
LBB0_13:
	movq	40(%r14), %rdi
	testq	%rdi, %rdi
	je	LBB0_15
## %bb.14:
	callq	_qib_put_mr
	movq	$0, 40(%r14)
LBB0_15:
	movq	32(%r14), %rax
	movq	_IB_QPT_RC@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_22
## %bb.16:
	movq	24(%r14), %rdi
	callq	_ARRAY_SIZE
	testl	%eax, %eax
	je	LBB0_22
## %bb.17:
	movl	$8, %ebx
	xorl	%r12d, %r12d
	movq	_IB_OPCODE_RC_RDMA_READ_REQUEST@GOTPCREL(%rip), %r13
	jmp	LBB0_18
	.p2align	4, 0x90
LBB0_21:                                ##   in Loop: Header=BB0_18 Depth=1
	incq	%r12
	movq	%r15, %rdi
	callq	_ARRAY_SIZE
	movl	%eax, %eax
	addq	$16, %rbx
	cmpq	%rax, %r12
	jae	LBB0_22
LBB0_18:                                ## =>This Inner Loop Header: Depth=1
	movq	24(%r14), %r15
	movq	-8(%r15,%rbx), %rax
	cmpq	(%r13), %rax
	jne	LBB0_21
## %bb.19:                              ##   in Loop: Header=BB0_18 Depth=1
	movq	(%r15,%rbx), %rdi
	testq	%rdi, %rdi
	je	LBB0_21
## %bb.20:                              ##   in Loop: Header=BB0_18 Depth=1
	callq	_qib_put_mr
	movq	$0, (%r15,%rbx)
	movq	24(%r14), %r15
	jmp	LBB0_21
LBB0_22:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_4:
	movq	_IB_QPT_UD@GOTPCREL(%rip), %r15
	xorl	%r13d, %r13d
	jmp	LBB0_5
	.p2align	4, 0x90
LBB0_11:                                ##   in Loop: Header=BB0_5 Depth=1
	movl	4(%rbx), %edi
	callq	_to_iah
	movq	%rax, %rdi
	callq	_atomic_dec
LBB0_12:                                ##   in Loop: Header=BB0_5 Depth=1
	movq	(%r14), %rsi
	incq	%rsi
	cmpq	16(%r14), %rsi
	cmovgeq	%r13, %rsi
	movq	%rsi, (%r14)
	cmpq	8(%r14), %rsi
	je	LBB0_13
LBB0_5:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_7 Depth 2
	movq	%r14, %rdi
	callq	_get_swqe_ptr
	movq	%rax, %rbx
	cmpl	$0, (%rax)
	je	LBB0_8
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=1
	xorl	%r12d, %r12d
	.p2align	4, 0x90
LBB0_7:                                 ##   Parent Loop BB0_5 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	8(%rbx), %rax
	movq	(%rax,%r12,8), %rdi
	callq	_qib_put_mr
	incq	%r12
	movl	(%rbx), %eax
	cmpq	%rax, %r12
	jb	LBB0_7
LBB0_8:                                 ##   in Loop: Header=BB0_5 Depth=1
	movq	32(%r14), %rax
	cmpq	(%r15), %rax
	je	LBB0_11
## %bb.9:                               ##   in Loop: Header=BB0_5 Depth=1
	movq	_IB_QPT_SMI@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_11
## %bb.10:                              ##   in Loop: Header=BB0_5 Depth=1
	movq	_IB_QPT_GSI@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_12
	jmp	LBB0_11
	.cfi_endproc
                                        ## -- End function
	.comm	_QIB_R_REWIND_SGE,4,2           ## @QIB_R_REWIND_SGE
	.comm	_IB_QPT_UD,8,3                  ## @IB_QPT_UD
	.comm	_IB_QPT_SMI,8,3                 ## @IB_QPT_SMI
	.comm	_IB_QPT_GSI,8,3                 ## @IB_QPT_GSI
	.comm	_IB_QPT_RC,8,3                  ## @IB_QPT_RC
	.comm	_IB_OPCODE_RC_RDMA_READ_REQUEST,8,3 ## @IB_OPCODE_RC_RDMA_READ_REQUEST
	.no_dead_strip	_clear_mr_refs
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function clear_mr_refs
_clear_mr_refs:                         ; @clear_mr_refs
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x20, x1
	mov	x19, x0
Lloh0:
	adrp	x8, _QIB_R_REWIND_SGE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _QIB_R_REWIND_SGE@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	add	x1, x19, #56
	bl	_test_and_clear_bit
	cbz	x0, LBB0_2
; %bb.1:
	add	x0, x19, #52
	bl	_qib_put_ss
LBB0_2:
	add	x0, x19, #48
	bl	_qib_put_ss
	cbz	w20, LBB0_6
; %bb.3:
	ldp	x1, x8, [x19]
	cmp	x1, x8
	b.ne	LBB0_14
LBB0_4:
	ldr	x0, [x19, #40]
	cbz	x0, LBB0_6
; %bb.5:
	bl	_qib_put_mr
	str	xzr, [x19, #40]
LBB0_6:
	ldr	x8, [x19, #32]
Lloh3:
	adrp	x9, _IB_QPT_RC@GOTPAGE
Lloh4:
	ldr	x9, [x9, _IB_QPT_RC@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_13
; %bb.7:
	ldr	x0, [x19, #24]
	bl	_ARRAY_SIZE
	cbz	w0, LBB0_13
; %bb.8:
	mov	x20, #0
	mov	x21, #0
Lloh6:
	adrp	x22, _IB_OPCODE_RC_RDMA_READ_REQUEST@GOTPAGE
Lloh7:
	ldr	x22, [x22, _IB_OPCODE_RC_RDMA_READ_REQUEST@GOTPAGEOFF]
	b	LBB0_10
LBB0_9:                                 ;   in Loop: Header=BB0_10 Depth=1
	add	x21, x21, #1
	bl	_ARRAY_SIZE
	add	x20, x20, #16
	cmp	x21, w0, uxtw
	b.hs	LBB0_13
LBB0_10:                                ; =>This Inner Loop Header: Depth=1
	ldr	x0, [x19, #24]
	ldr	x8, [x0, x20]
	ldr	x9, [x22]
	cmp	x8, x9
	b.ne	LBB0_9
; %bb.11:                               ;   in Loop: Header=BB0_10 Depth=1
	add	x23, x0, x20
	ldr	x8, [x23, #8]
	cbz	x8, LBB0_9
; %bb.12:                               ;   in Loop: Header=BB0_10 Depth=1
	mov	x0, x8
	bl	_qib_put_mr
	str	xzr, [x23, #8]
	ldr	x0, [x19, #24]
	b	LBB0_9
LBB0_13:
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_14:
Lloh8:
	adrp	x21, _IB_QPT_UD@GOTPAGE
Lloh9:
	ldr	x21, [x21, _IB_QPT_UD@GOTPAGEOFF]
Lloh10:
	adrp	x22, _IB_QPT_SMI@GOTPAGE
Lloh11:
	ldr	x22, [x22, _IB_QPT_SMI@GOTPAGEOFF]
Lloh12:
	adrp	x23, _IB_QPT_GSI@GOTPAGE
Lloh13:
	ldr	x23, [x23, _IB_QPT_GSI@GOTPAGEOFF]
	b	LBB0_16
LBB0_15:                                ;   in Loop: Header=BB0_16 Depth=1
	ldp	x8, x9, [x19]
	add	x10, x8, #1
	ldr	x11, [x19, #16]
	cmp	x10, x11
	csinc	x1, xzr, x8, ge
	str	x1, [x19]
	cmp	x1, x9
	b.eq	LBB0_4
LBB0_16:                                ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_18 Depth 2
	mov	x0, x19
	bl	_get_swqe_ptr
	mov	x20, x0
	ldr	w8, [x0]
	cbz	w8, LBB0_19
; %bb.17:                               ;   in Loop: Header=BB0_16 Depth=1
	mov	x24, #0
LBB0_18:                                ;   Parent Loop BB0_16 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	x8, [x20, #8]
	ldr	x0, [x8, x24, lsl #3]
	bl	_qib_put_mr
	add	x24, x24, #1
	ldr	w8, [x20]
	cmp	x24, x8
	b.lo	LBB0_18
LBB0_19:                                ;   in Loop: Header=BB0_16 Depth=1
	ldr	x8, [x19, #32]
	ldr	x9, [x21]
	ldr	x10, [x22]
	ldr	x11, [x23]
	cmp	x8, x9
	ccmp	x8, x10, #4, ne
	ccmp	x8, x11, #4, ne
	b.ne	LBB0_15
; %bb.20:                               ;   in Loop: Header=BB0_16 Depth=1
	ldr	w0, [x20, #4]
	bl	_to_iah
	bl	_atomic_dec
	b	LBB0_15
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_QIB_R_REWIND_SGE,4,2           ; @QIB_R_REWIND_SGE
	.comm	_IB_QPT_UD,8,3                  ; @IB_QPT_UD
	.comm	_IB_QPT_SMI,8,3                 ; @IB_QPT_SMI
	.comm	_IB_QPT_GSI,8,3                 ; @IB_QPT_GSI
	.comm	_IB_QPT_RC,8,3                  ; @IB_QPT_RC
	.comm	_IB_OPCODE_RC_RDMA_READ_REQUEST,8,3 ; @IB_OPCODE_RC_RDMA_READ_REQUEST
	.no_dead_strip	_clear_mr_refs
.subsections_via_symbols
