	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function qib_7322_config_ctxts
_qib_7322_config_ctxts:                 ## @qib_7322_config_ctxts
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r15
	movq	_kr_contextcnt@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_qib_read_kreg32
	movq	%rax, %r14
	movq	32(%r15), %rax
	movl	%r14d, (%rax)
	movq	_qib_n_krcv_queues@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	cmpl	$2, %ebx
	jl	LBB0_3
## %bb.1:
	movl	(%r15), %ecx
	testl	%ecx, %ecx
	je	LBB0_3
## %bb.2:
	movq	_NUM_IB_PORTS@GOTPCREL(%rip), %rax
	decl	%ebx
	imull	%ecx, %ebx
	addl	(%rax), %ebx
	cmpl	%r14d, %ebx
	cmovgel	%r14d, %ebx
	movl	%ebx, 4(%r15)
	movl	%ebx, %eax
	cltd
	idivl	%ecx
	jmp	LBB0_4
LBB0_3:
	movq	_NUM_IB_PORTS@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movl	%ebx, 4(%r15)
	movl	$1, %eax
LBB0_4:
	movl	%eax, 8(%r15)
	movq	_qib_cfgctxts@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, %eax
	je	LBB0_5
## %bb.8:
	movl	(%r15), %ecx
	cmpl	%ecx, %eax
	jl	LBB0_11
## %bb.9:
	movl	%eax, %ecx
	cmpl	%r14d, %eax
	jle	LBB0_11
LBB0_12:
	cmpl	$0, 12(%r15)
	je	LBB0_13
LBB0_14:
	movq	32(%r15), %rdi
	addq	$16, %rdi
	callq	_spin_lock_irqsave
	movl	12(%r15), %eax
	movl	$2, %ebx
	cmpl	$10, %eax
	jg	LBB0_16
## %bb.15:
	movl	$1, %ebx
	cmpl	$7, %eax
	jl	LBB0_17
LBB0_16:
	movq	_RcvCtrl@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_ContextCfg@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_SYM_LSB
	movl	%eax, %ecx
	shlq	%cl, %rbx
	orq	%rbx, 16(%r15)
LBB0_17:
	movq	_RcvCtrl@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_XrcTypeCode@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_SYM_LSB
	movl	$5, %edx
	movl	%eax, %ecx
	shlq	%cl, %rdx
	orq	16(%r15), %rdx
	movq	%rdx, 16(%r15)
	movq	_kr_rcvctrl@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_qib_write_kreg
	movq	32(%r15), %rdi
	addq	$16, %rdi
	callq	_spin_unlock_irqrestore
	movq	_kr_rcvegrcnt@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_qib_read_kreg32
	movq	32(%r15), %rcx
	movq	%rax, 8(%rcx)
	movq	_qib_rcvhdrcnt@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	testl	%esi, %esi
	je	LBB0_19
## %bb.18:
	movq	%rax, %rdi
	callq	_max
	jmp	LBB0_20
LBB0_5:
	xorl	%eax, %eax
	callq	_num_online_cpus
	addl	%ebx, %eax
	movl	$6, %ecx
	cmpl	$7, %eax
	jl	LBB0_11
## %bb.6:
	movl	$10, %ecx
	cmpl	$11, %eax
	jb	LBB0_11
## %bb.7:
	movl	%r14d, %ecx
	cmpl	%r14d, %eax
	jg	LBB0_12
LBB0_11:
	movl	%ecx, 12(%r15)
	cmpl	$0, 12(%r15)
	jne	LBB0_14
LBB0_13:
	movl	%r14d, 12(%r15)
	jmp	LBB0_14
LBB0_19:
	xorl	%esi, %esi
	cmpl	$2, (%r15)
	setl	%sil
	shll	$10, %esi
	addl	$1024, %esi                     ## imm = 0x400
	movq	%rax, %rdi
	callq	_max
	addl	%eax, %eax
LBB0_20:
	movl	%eax, 24(%r15)
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_kr_contextcnt,4,2              ## @kr_contextcnt
	.comm	_qib_n_krcv_queues,4,2          ## @qib_n_krcv_queues
	.comm	_NUM_IB_PORTS,4,2               ## @NUM_IB_PORTS
	.comm	_qib_cfgctxts,4,2               ## @qib_cfgctxts
	.comm	_RcvCtrl,4,2                    ## @RcvCtrl
	.comm	_ContextCfg,4,2                 ## @ContextCfg
	.comm	_XrcTypeCode,4,2                ## @XrcTypeCode
	.comm	_kr_rcvctrl,4,2                 ## @kr_rcvctrl
	.comm	_kr_rcvegrcnt,4,2               ## @kr_rcvegrcnt
	.comm	_qib_rcvhdrcnt,4,2              ## @qib_rcvhdrcnt
	.no_dead_strip	_qib_7322_config_ctxts
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function qib_7322_config_ctxts
_qib_7322_config_ctxts:                 ; @qib_7322_config_ctxts
	.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	x19, x0
Lloh0:
	adrp	x8, _kr_contextcnt@GOTPAGE
Lloh1:
	ldr	x8, [x8, _kr_contextcnt@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	bl	_qib_read_kreg32
	mov	x20, x0
	ldr	x8, [x19, #32]
	str	w20, [x8]
Lloh3:
	adrp	x8, _qib_n_krcv_queues@GOTPAGE
Lloh4:
	ldr	x8, [x8, _qib_n_krcv_queues@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x8]
	cmp	w9, #2
	b.lt	LBB0_3
; %bb.1:
	ldr	w8, [x19]
	cbz	w8, LBB0_3
; %bb.2:
Lloh6:
	adrp	x10, _NUM_IB_PORTS@GOTPAGE
Lloh7:
	ldr	x10, [x10, _NUM_IB_PORTS@GOTPAGEOFF]
Lloh8:
	ldr	w10, [x10]
	sub	w9, w9, #1
	madd	w9, w8, w9, w10
	cmp	w9, w20
	csel	w21, w9, w20, lt
	str	w21, [x19, #4]
	sdiv	w8, w21, w8
	b	LBB0_4
LBB0_3:
Lloh9:
	adrp	x8, _NUM_IB_PORTS@GOTPAGE
Lloh10:
	ldr	x8, [x8, _NUM_IB_PORTS@GOTPAGEOFF]
Lloh11:
	ldr	w21, [x8]
	str	w21, [x19, #4]
	mov	w8, #1
LBB0_4:
	str	w8, [x19, #8]
Lloh12:
	adrp	x8, _qib_cfgctxts@GOTPAGE
Lloh13:
	ldr	x8, [x8, _qib_cfgctxts@GOTPAGEOFF]
Lloh14:
	ldr	w9, [x8]
	cbz	w9, LBB0_15
; %bb.5:
	ldr	w8, [x19]
	cmp	w9, w8
	b.lt	LBB0_22
; %bb.6:
	mov	x8, x9
	cmp	w9, w20
	b.le	LBB0_22
LBB0_7:
	ldr	w8, [x19, #12]
	cbz	w8, LBB0_23
LBB0_8:
	ldr	x8, [x19, #32]
	add	x0, x8, #16
	bl	_spin_lock_irqsave
	ldr	w8, [x19, #12]
Lloh15:
	adrp	x20, _RcvCtrl@GOTPAGE
Lloh16:
	ldr	x20, [x20, _RcvCtrl@GOTPAGEOFF]
	cmp	w8, #10
	b.le	LBB0_10
; %bb.9:
	mov	w21, #2
	b	LBB0_12
LBB0_10:
	cmp	w8, #7
	b.lt	LBB0_13
; %bb.11:
	mov	w21, #1
LBB0_12:
	ldr	w0, [x20]
Lloh17:
	adrp	x8, _ContextCfg@GOTPAGE
Lloh18:
	ldr	x8, [x8, _ContextCfg@GOTPAGEOFF]
Lloh19:
	ldr	w1, [x8]
	bl	_SYM_LSB
	lsl	x8, x21, x0
	ldr	x9, [x19, #16]
	orr	x8, x9, x8
	str	x8, [x19, #16]
LBB0_13:
	ldr	w0, [x20]
Lloh20:
	adrp	x8, _XrcTypeCode@GOTPAGE
Lloh21:
	ldr	x8, [x8, _XrcTypeCode@GOTPAGEOFF]
Lloh22:
	ldr	w1, [x8]
	bl	_SYM_LSB
	mov	w8, #5
	lsl	x8, x8, x0
	ldr	x9, [x19, #16]
	orr	x2, x9, x8
	str	x2, [x19, #16]
Lloh23:
	adrp	x8, _kr_rcvctrl@GOTPAGE
Lloh24:
	ldr	x8, [x8, _kr_rcvctrl@GOTPAGEOFF]
Lloh25:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_qib_write_kreg
	ldr	x8, [x19, #32]
	add	x0, x8, #16
	bl	_spin_unlock_irqrestore
Lloh26:
	adrp	x8, _kr_rcvegrcnt@GOTPAGE
Lloh27:
	ldr	x8, [x8, _kr_rcvegrcnt@GOTPAGEOFF]
Lloh28:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_qib_read_kreg32
	ldr	x8, [x19, #32]
	str	x0, [x8, #8]
Lloh29:
	adrp	x8, _qib_rcvhdrcnt@GOTPAGE
Lloh30:
	ldr	x8, [x8, _qib_rcvhdrcnt@GOTPAGEOFF]
Lloh31:
	ldr	w1, [x8]
	cbz	w1, LBB0_17
; %bb.14:
	bl	_max
	b	LBB0_18
LBB0_15:
	bl	_num_online_cpus
	add	w9, w0, w21
	cmp	w9, #7
	b.ge	LBB0_19
; %bb.16:
	mov	w8, #6
	b	LBB0_22
LBB0_17:
	ldr	w8, [x19]
	mov	w9, #2048
	mov	w10, #1024
	cmp	w8, #1
	csel	w1, w10, w9, gt
	bl	_max
	lsl	w0, w0, #1
LBB0_18:
	str	w0, [x19, #24]
	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
LBB0_19:
	cmp	w9, #11
	b.hs	LBB0_21
; %bb.20:
	mov	w8, #10
	b	LBB0_22
LBB0_21:
	mov	x8, x20
	cmp	w9, w20
	b.gt	LBB0_7
LBB0_22:
	str	w8, [x19, #12]
	ldr	w8, [x19, #12]
	cbnz	w8, LBB0_8
LBB0_23:
	str	w20, [x19, #12]
	b	LBB0_8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.cfi_endproc
                                        ; -- End function
	.comm	_kr_contextcnt,4,2              ; @kr_contextcnt
	.comm	_qib_n_krcv_queues,4,2          ; @qib_n_krcv_queues
	.comm	_NUM_IB_PORTS,4,2               ; @NUM_IB_PORTS
	.comm	_qib_cfgctxts,4,2               ; @qib_cfgctxts
	.comm	_RcvCtrl,4,2                    ; @RcvCtrl
	.comm	_ContextCfg,4,2                 ; @ContextCfg
	.comm	_XrcTypeCode,4,2                ; @XrcTypeCode
	.comm	_kr_rcvctrl,4,2                 ; @kr_rcvctrl
	.comm	_kr_rcvegrcnt,4,2               ; @kr_rcvegrcnt
	.comm	_qib_rcvhdrcnt,4,2              ; @qib_rcvhdrcnt
	.no_dead_strip	_qib_7322_config_ctxts
.subsections_via_symbols
