	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_qib_ruc_check_hdr              ## -- Begin function qib_ruc_check_hdr
	.p2align	4, 0x90
_qib_ruc_check_hdr:                     ## @qib_ruc_check_hdr
	.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	%r8d, %r14d
	movq	%rcx, %rbx
	movq	%rsi, %r12
	movq	%rdi, %r15
	movq	(%rcx), %rax
	movq	_IB_MIG_ARMED@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_12
## %bb.1:
	movq	_IB_BTH_MIG_REQ@GOTPCREL(%rip), %rax
	testl	%r14d, (%rax)
	je	LBB0_12
## %bb.2:
	movq	_IB_AH_GRH@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	andl	48(%rbx), %eax
	movl	$1, %r13d
	testl	%edx, %edx
	je	LBB0_3
## %bb.4:
	testl	%eax, %eax
	je	LBB0_23
## %bb.5:
	movl	72(%rbx), %esi
	movq	%r15, %rdi
	callq	_get_sguid
	leaq	12(%r12), %rdi
	movl	(%r15), %esi
	movl	%eax, %edx
	callq	_gid_ok
	testl	%eax, %eax
	je	LBB0_23
## %bb.6:
	leaq	8(%r12), %rdi
	movl	64(%rbx), %edx
	movl	68(%rbx), %esi
	callq	_gid_ok
	testl	%eax, %eax
	jne	LBB0_7
	jmp	LBB0_23
LBB0_12:
	movq	_IB_AH_GRH@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	andl	16(%rbx), %eax
	movl	$1, %r13d
	testl	%edx, %edx
	je	LBB0_13
## %bb.14:
	testl	%eax, %eax
	je	LBB0_23
## %bb.15:
	movl	32(%rbx), %esi
	movq	%r15, %rdi
	callq	_get_sguid
	leaq	12(%r12), %rdi
	movl	(%r15), %esi
	movl	%eax, %edx
	callq	_gid_ok
	testl	%eax, %eax
	je	LBB0_23
## %bb.16:
	leaq	8(%r12), %rdi
	movl	24(%rbx), %edx
	movl	28(%rbx), %esi
	callq	_gid_ok
	testl	%eax, %eax
	jne	LBB0_17
	jmp	LBB0_23
LBB0_13:
	testl	%eax, %eax
	jne	LBB0_23
LBB0_17:
	movl	40(%rbx), %esi
	movq	%r15, %rdi
	callq	_qib_get_pkey
	movl	%r14d, %edi
	movl	%eax, %esi
	callq	_qib_pkey_ok
	testl	%eax, %eax
	je	LBB0_8
## %bb.18:
	movq	(%r12), %rax
	movl	12(%rax), %edi
	callq	_be16_to_cpu
	movl	$1, %r13d
	cmpl	20(%rbx), %eax
	jne	LBB0_23
## %bb.19:
	movq	%r15, %rdi
	callq	_ppd_from_ibp
	movq	(%rax), %rax
	cmpq	8(%rbx), %rax
	jne	LBB0_23
## %bb.20:
	movq	(%rbx), %rax
	movq	_IB_MIG_REARM@GOTPCREL(%rip), %rcx
	xorl	%r13d, %r13d
	cmpq	(%rcx), %rax
	jne	LBB0_23
## %bb.21:
	movq	_IB_BTH_MIG_REQ@GOTPCREL(%rip), %rax
	testl	%r14d, (%rax)
	jne	LBB0_23
## %bb.22:
	movq	_IB_MIG_ARMED@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, (%rbx)
	jmp	LBB0_23
LBB0_3:
	testl	%eax, %eax
	jne	LBB0_23
LBB0_7:
	movl	80(%rbx), %esi
	movq	%r15, %rdi
	callq	_qib_get_pkey
	movl	%r14d, %edi
	movl	%eax, %esi
	callq	_qib_pkey_ok
	testl	%eax, %eax
	je	LBB0_8
## %bb.9:
	movq	(%r12), %rax
	movl	12(%rax), %edi
	callq	_be16_to_cpu
	movl	$1, %r13d
	cmpl	52(%rbx), %eax
	jne	LBB0_23
## %bb.10:
	movq	%r15, %rdi
	callq	_ppd_from_ibp
	movq	(%rax), %rax
	cmpq	56(%rbx), %rax
	jne	LBB0_23
## %bb.11:
	leaq	44(%rbx), %r14
	movq	%r14, %rdi
	callq	_spin_lock_irqsave
	movq	%rbx, %rdi
	callq	_qib_migrate_qp
	movq	%r14, %rdi
	callq	_spin_unlock_irqrestore
	xorl	%r13d, %r13d
	jmp	LBB0_23
LBB0_8:
	movq	_IB_NOTICE_TRAP_BAD_PKEY@GOTPCREL(%rip), %rax
	movl	(%rax), %r13d
	movq	(%r12), %rax
	movl	(%rax), %edi
	callq	_be16_to_cpu
	shrl	$4, %eax
	andl	$15, %eax
	movl	36(%rbx), %r9d
	movq	(%r12), %rcx
	movl	4(%rcx), %ebx
	movl	12(%rcx), %r10d
	movq	%r15, %rdi
	movl	%r13d, %esi
	movl	%r14d, %edx
	movl	%eax, %ecx
	xorl	%r8d, %r8d
	pushq	%rbx
	pushq	%r10
	callq	_qib_bad_pqkey
	addq	$16, %rsp
	movl	$1, %r13d
LBB0_23:
	movl	%r13d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_IB_MIG_ARMED,8,3               ## @IB_MIG_ARMED
	.comm	_IB_BTH_MIG_REQ,4,2             ## @IB_BTH_MIG_REQ
	.comm	_IB_AH_GRH,4,2                  ## @IB_AH_GRH
	.comm	_IB_NOTICE_TRAP_BAD_PKEY,4,2    ## @IB_NOTICE_TRAP_BAD_PKEY
	.comm	_IB_MIG_REARM,8,3               ## @IB_MIG_REARM
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_qib_ruc_check_hdr              ; -- Begin function qib_ruc_check_hdr
	.p2align	2
_qib_ruc_check_hdr:                     ; @qib_ruc_check_hdr
	.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, x4
	mov	x19, x3
	mov	x22, x1
	mov	x21, x0
	ldr	x8, [x3]
Lloh0:
	adrp	x23, _IB_MIG_ARMED@GOTPAGE
Lloh1:
	ldr	x23, [x23, _IB_MIG_ARMED@GOTPAGEOFF]
	ldr	x9, [x23]
	cmp	x8, x9
	b.ne	LBB0_6
; %bb.1:
Lloh2:
	adrp	x8, _IB_BTH_MIG_REQ@GOTPAGE
Lloh3:
	ldr	x8, [x8, _IB_BTH_MIG_REQ@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	tst	w8, w20
	b.eq	LBB0_6
; %bb.2:
	ldr	w8, [x19, #48]
Lloh5:
	adrp	x9, _IB_AH_GRH@GOTPAGE
Lloh6:
	ldr	x9, [x9, _IB_AH_GRH@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
	and	w8, w9, w8
	cbz	w2, LBB0_17
; %bb.3:
	cbz	w8, LBB0_22
; %bb.4:
	ldr	w1, [x19, #72]
	mov	x0, x21
	bl	_get_sguid
	mov	x2, x0
	add	x0, x22, #12
	ldr	w1, [x21]
	bl	_gid_ok
	cbz	w0, LBB0_22
; %bb.5:
	add	x0, x22, #8
	ldp	w2, w1, [x19, #64]
	bl	_gid_ok
	cbnz	w0, LBB0_18
	b	LBB0_22
LBB0_6:
	ldr	w8, [x19, #16]
Lloh8:
	adrp	x9, _IB_AH_GRH@GOTPAGE
Lloh9:
	ldr	x9, [x9, _IB_AH_GRH@GOTPAGEOFF]
Lloh10:
	ldr	w9, [x9]
	and	w8, w9, w8
	cbz	w2, LBB0_10
; %bb.7:
	cbz	w8, LBB0_22
; %bb.8:
	ldr	w1, [x19, #32]
	mov	x0, x21
	bl	_get_sguid
	mov	x2, x0
	add	x0, x22, #12
	ldr	w1, [x21]
	bl	_gid_ok
	cbz	w0, LBB0_22
; %bb.9:
	add	x0, x22, #8
	ldp	w2, w1, [x19, #24]
	bl	_gid_ok
	cbnz	w0, LBB0_11
	b	LBB0_22
LBB0_10:
	cbnz	w8, LBB0_22
LBB0_11:
	ldr	w1, [x19, #40]
	mov	x0, x21
	bl	_qib_get_pkey
	mov	x1, x0
	mov	x0, x20
	bl	_qib_pkey_ok
	cbz	w0, LBB0_24
; %bb.12:
	ldr	x8, [x22]
	ldr	w0, [x8, #12]
	bl	_be16_to_cpu
	ldr	w8, [x19, #20]
	cmp	w0, w8
	b.ne	LBB0_22
; %bb.13:
	mov	x0, x21
	bl	_ppd_from_ibp
	ldr	x8, [x0]
	ldr	x9, [x19, #8]
	cmp	x8, x9
	b.ne	LBB0_22
; %bb.14:
	ldr	x8, [x19]
Lloh11:
	adrp	x9, _IB_MIG_REARM@GOTPAGE
Lloh12:
	ldr	x9, [x9, _IB_MIG_REARM@GOTPAGEOFF]
Lloh13:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_16
; %bb.15:
Lloh14:
	adrp	x8, _IB_BTH_MIG_REQ@GOTPAGE
Lloh15:
	ldr	x8, [x8, _IB_BTH_MIG_REQ@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
	tst	w8, w20
	b.eq	LBB0_25
LBB0_16:
	mov	w0, #0
	b	LBB0_23
LBB0_17:
	cbnz	w8, LBB0_22
LBB0_18:
	ldr	w1, [x19, #80]
	mov	x0, x21
	bl	_qib_get_pkey
	mov	x1, x0
	mov	x0, x20
	bl	_qib_pkey_ok
	cbz	w0, LBB0_24
; %bb.19:
	ldr	x8, [x22]
	ldr	w0, [x8, #12]
	bl	_be16_to_cpu
	ldr	w8, [x19, #52]
	cmp	w0, w8
	b.ne	LBB0_22
; %bb.20:
	mov	x0, x21
	bl	_ppd_from_ibp
	ldr	x8, [x0]
	ldr	x9, [x19, #56]
	cmp	x8, x9
	b.ne	LBB0_22
; %bb.21:
	add	x20, x19, #44
	mov	x0, x20
	bl	_spin_lock_irqsave
	mov	x0, x19
	bl	_qib_migrate_qp
	mov	x0, x20
	bl	_spin_unlock_irqrestore
	mov	w0, #0
	b	LBB0_23
LBB0_22:
	mov	w0, #1
LBB0_23:
	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_24:
Lloh17:
	adrp	x8, _IB_NOTICE_TRAP_BAD_PKEY@GOTPAGE
Lloh18:
	ldr	x8, [x8, _IB_NOTICE_TRAP_BAD_PKEY@GOTPAGEOFF]
Lloh19:
	ldr	w23, [x8]
	ldr	x8, [x22]
	ldr	w0, [x8]
	bl	_be16_to_cpu
	ubfx	w3, w0, #4, #4
	ldr	w5, [x19, #36]
	ldr	x8, [x22]
	ldr	w6, [x8, #12]
	ldr	w7, [x8, #4]
	mov	x0, x21
	mov	x1, x23
	mov	x2, x20
	mov	w4, #0
	bl	_qib_bad_pqkey
	mov	w0, #1
	b	LBB0_23
LBB0_25:
	mov	w0, #0
	ldr	x8, [x23]
	str	x8, [x19]
	b	LBB0_23
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.comm	_IB_MIG_ARMED,8,3               ; @IB_MIG_ARMED
	.comm	_IB_BTH_MIG_REQ,4,2             ; @IB_BTH_MIG_REQ
	.comm	_IB_AH_GRH,4,2                  ; @IB_AH_GRH
	.comm	_IB_NOTICE_TRAP_BAD_PKEY,4,2    ; @IB_NOTICE_TRAP_BAD_PKEY
	.comm	_IB_MIG_REARM,8,3               ; @IB_MIG_REARM
.subsections_via_symbols
