	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_qib_restart_rc                 ## -- Begin function qib_restart_rc
	.p2align	4, 0x90
_qib_restart_rc:                        ## @qib_restart_rc
	.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
	movl	%edx, %r15d
	movl	%esi, %r14d
	movq	%rdi, %rbx
	movq	(%rdi), %rsi
	callq	_rvt_get_swqe_ptr
	movq	%rax, %r12
	movq	8(%rbx), %rax
	testq	%rax, %rax
	je	LBB0_1
## %bb.5:
	decq	%rax
	jmp	LBB0_6
LBB0_1:
	movq	16(%rbx), %rax
	movq	_IB_MIG_ARMED@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_3
## %bb.2:
	movq	%rbx, %rdi
	callq	_qib_migrate_qp
	movq	24(%rbx), %rax
LBB0_6:
	movq	%rax, 8(%rbx)
	movl	48(%rbx), %esi
	movl	52(%rbx), %edi
	callq	_to_iport
	movq	(%r12), %rdx
	movq	_IB_WR_RDMA_READ@GOTPCREL(%rip), %rsi
	movl	$1, %ecx
	cmpq	(%rsi), %rdx
	je	LBB0_8
## %bb.7:
	movslq	40(%rbx), %rdx
	movslq	%r14d, %rcx
	subq	%rcx, %rdx
	movq	_QIB_PSN_MASK@GOTPCREL(%rip), %rcx
	movslq	(%rcx), %rcx
	andq	%rdx, %rcx
LBB0_8:
	addq	%rcx, (%rax)
	movq	_RVT_S_WAIT_FENCE@GOTPCREL(%rip), %rcx
	movq	_RVT_S_WAIT_RDMAR@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	(%rcx), %eax
	movq	_RVT_S_WAIT_SSN_CREDIT@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movq	_RVT_S_WAIT_PSN@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movq	_RVT_S_WAIT_ACK@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	notl	%eax
	andl	44(%rbx), %eax
	movl	%eax, 44(%rbx)
	testl	%r15d, %r15d
	je	LBB0_10
## %bb.9:
	movq	_RVT_S_SEND_ONE@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movl	%eax, 44(%rbx)
LBB0_10:
	movq	%rbx, %rdi
	movl	%r14d, %esi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_reset_psn                      ## TAILCALL
LBB0_3:
	movq	32(%rbx), %rax
	cmpq	(%rbx), %rax
	jne	LBB0_11
## %bb.4:
	movq	_IB_WC_RETRY_EXC_ERR@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	movq	%r12, %rsi
	callq	_rvt_send_complete
	movq	_IB_WC_WR_FLUSH_ERR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_rvt_error_qp                   ## TAILCALL
LBB0_11:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_IB_MIG_ARMED,8,3               ## @IB_MIG_ARMED
	.comm	_IB_WC_RETRY_EXC_ERR,4,2        ## @IB_WC_RETRY_EXC_ERR
	.comm	_IB_WC_WR_FLUSH_ERR,4,2         ## @IB_WC_WR_FLUSH_ERR
	.comm	_IB_WR_RDMA_READ,8,3            ## @IB_WR_RDMA_READ
	.comm	_QIB_PSN_MASK,4,2               ## @QIB_PSN_MASK
	.comm	_RVT_S_WAIT_FENCE,4,2           ## @RVT_S_WAIT_FENCE
	.comm	_RVT_S_WAIT_RDMAR,4,2           ## @RVT_S_WAIT_RDMAR
	.comm	_RVT_S_WAIT_SSN_CREDIT,4,2      ## @RVT_S_WAIT_SSN_CREDIT
	.comm	_RVT_S_WAIT_PSN,4,2             ## @RVT_S_WAIT_PSN
	.comm	_RVT_S_WAIT_ACK,4,2             ## @RVT_S_WAIT_ACK
	.comm	_RVT_S_SEND_ONE,4,2             ## @RVT_S_SEND_ONE
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_qib_restart_rc                 ; -- Begin function qib_restart_rc
	.p2align	2
_qib_restart_rc:                        ; @qib_restart_rc
	.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
	mov	x21, x2
	mov	x20, x1
	mov	x19, x0
	ldr	x1, [x0]
	bl	_rvt_get_swqe_ptr
	mov	x22, x0
	ldr	x8, [x19, #8]
	cbz	x8, LBB0_2
; %bb.1:
	sub	x8, x8, #1
	b	LBB0_4
LBB0_2:
	ldr	x8, [x19, #16]
Lloh0:
	adrp	x9, _IB_MIG_ARMED@GOTPAGE
Lloh1:
	ldr	x9, [x9, _IB_MIG_ARMED@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_10
; %bb.3:
	mov	x0, x19
	bl	_qib_migrate_qp
	ldr	x8, [x19, #24]
LBB0_4:
	str	x8, [x19, #8]
	ldp	w1, w0, [x19, #48]
	bl	_to_iport
	ldr	x8, [x22]
Lloh3:
	adrp	x9, _IB_WR_RDMA_READ@GOTPAGE
Lloh4:
	ldr	x9, [x9, _IB_WR_RDMA_READ@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_6
; %bb.5:
	mov	w8, #1
	b	LBB0_7
LBB0_6:
	ldrsw	x8, [x19, #40]
	sub	x8, x8, w20, sxtw
Lloh6:
	adrp	x9, _QIB_PSN_MASK@GOTPAGE
Lloh7:
	ldr	x9, [x9, _QIB_PSN_MASK@GOTPAGEOFF]
Lloh8:
	ldrsw	x9, [x9]
	and	x8, x8, x9
LBB0_7:
	ldr	x9, [x0]
	add	x8, x9, x8
	str	x8, [x0]
Lloh9:
	adrp	x8, _RVT_S_WAIT_FENCE@GOTPAGE
Lloh10:
	ldr	x8, [x8, _RVT_S_WAIT_FENCE@GOTPAGEOFF]
Lloh11:
	adrp	x9, _RVT_S_WAIT_RDMAR@GOTPAGE
Lloh12:
	ldr	x9, [x9, _RVT_S_WAIT_RDMAR@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
Lloh14:
	ldr	w9, [x9]
	orr	w8, w9, w8
Lloh15:
	adrp	x9, _RVT_S_WAIT_SSN_CREDIT@GOTPAGE
Lloh16:
	ldr	x9, [x9, _RVT_S_WAIT_SSN_CREDIT@GOTPAGEOFF]
Lloh17:
	ldr	w9, [x9]
	orr	w8, w8, w9
Lloh18:
	adrp	x9, _RVT_S_WAIT_PSN@GOTPAGE
Lloh19:
	ldr	x9, [x9, _RVT_S_WAIT_PSN@GOTPAGEOFF]
Lloh20:
	ldr	w9, [x9]
Lloh21:
	adrp	x10, _RVT_S_WAIT_ACK@GOTPAGE
Lloh22:
	ldr	x10, [x10, _RVT_S_WAIT_ACK@GOTPAGEOFF]
	orr	w8, w8, w9
Lloh23:
	ldr	w9, [x10]
	orr	w8, w8, w9
	ldr	w9, [x19, #44]
	bic	w8, w9, w8
	str	w8, [x19, #44]
	cbz	w21, LBB0_9
; %bb.8:
Lloh24:
	adrp	x9, _RVT_S_SEND_ONE@GOTPAGE
Lloh25:
	ldr	x9, [x9, _RVT_S_SEND_ONE@GOTPAGEOFF]
Lloh26:
	ldr	w9, [x9]
	orr	w8, w9, w8
	str	w8, [x19, #44]
LBB0_9:
	mov	x0, x19
	mov	x1, x20
	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	_reset_psn
LBB0_10:
	ldr	x8, [x19, #32]
	ldr	x9, [x19]
	cmp	x8, x9
	b.ne	LBB0_12
; %bb.11:
Lloh27:
	adrp	x8, _IB_WC_RETRY_EXC_ERR@GOTPAGE
Lloh28:
	ldr	x8, [x8, _IB_WC_RETRY_EXC_ERR@GOTPAGEOFF]
Lloh29:
	ldr	w2, [x8]
	mov	x0, x19
	mov	x1, x22
	bl	_rvt_send_complete
Lloh30:
	adrp	x8, _IB_WC_WR_FLUSH_ERR@GOTPAGE
Lloh31:
	ldr	x8, [x8, _IB_WC_WR_FLUSH_ERR@GOTPAGEOFF]
Lloh32:
	ldr	w1, [x8]
	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	_rvt_error_qp
LBB0_12:
	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	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh13
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.cfi_endproc
                                        ; -- End function
	.comm	_IB_MIG_ARMED,8,3               ; @IB_MIG_ARMED
	.comm	_IB_WC_RETRY_EXC_ERR,4,2        ; @IB_WC_RETRY_EXC_ERR
	.comm	_IB_WC_WR_FLUSH_ERR,4,2         ; @IB_WC_WR_FLUSH_ERR
	.comm	_IB_WR_RDMA_READ,8,3            ; @IB_WR_RDMA_READ
	.comm	_QIB_PSN_MASK,4,2               ; @QIB_PSN_MASK
	.comm	_RVT_S_WAIT_FENCE,4,2           ; @RVT_S_WAIT_FENCE
	.comm	_RVT_S_WAIT_RDMAR,4,2           ; @RVT_S_WAIT_RDMAR
	.comm	_RVT_S_WAIT_SSN_CREDIT,4,2      ; @RVT_S_WAIT_SSN_CREDIT
	.comm	_RVT_S_WAIT_PSN,4,2             ; @RVT_S_WAIT_PSN
	.comm	_RVT_S_WAIT_ACK,4,2             ; @RVT_S_WAIT_ACK
	.comm	_RVT_S_SEND_ONE,4,2             ; @RVT_S_SEND_ONE
.subsections_via_symbols
