	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function set_up_context_variables
_set_up_context_variables:              ## @set_up_context_variables
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movq	_HFI1_NUM_VNIC_CTXT@GOTPCREL(%rip), %rax
	movq	(%rax), %r15
	callq	_chip_send_contexts
	movq	%rax, %r12
	movq	%rbx, %rdi
	callq	_chip_rcv_contexts
	movq	%rax, %rsi
	movq	_n_krcvqs@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	testq	%rax, %rax
	movq	_DEFAULT_KRCVQS@GOTPCREL(%rip), %rcx
	movslq	(%rcx), %r13
	cmovneq	%rax, %r13
	incq	%r13
	movq	_num_vls@GOTPCREL(%rip), %r14
	movslq	(%r14), %rdx
	notq	%rdx
	addq	%r12, %rdx
	cmpq	%rdx, %r13
	movq	%rsi, -48(%rbp)                 ## 8-byte Spill
	jbe	LBB0_2
## %bb.1:
	leaq	L_.str(%rip), %rsi
	movq	%rbx, %rdi
	movq	%r13, %rcx
	xorl	%eax, %eax
	callq	_dd_dev_err
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	movslq	(%r14), %r13
	notq	%r13
	addq	%r12, %r13
LBB0_2:
	leaq	(%r15,%r13), %rax
	cmpq	%rsi, %rax
	jbe	LBB0_4
## %bb.3:
	leaq	L_.str.1(%rip), %rsi
	xorl	%r15d, %r15d
	movq	%rbx, %rdi
	xorl	%eax, %eax
	callq	_dd_dev_err
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
LBB0_4:
	movq	%r15, -64(%rbp)                 ## 8-byte Spill
	leaq	(%r15,%r13), %r14
	movq	_num_user_contexts@GOTPCREL(%rip), %rax
	movq	(%rax), %r15
	testq	%r15, %r15
	jns	LBB0_6
## %bb.5:
	movq	_node_affinity@GOTPCREL(%rip), %rdi
	callq	_cpumask_weight
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	movq	%rax, %r15
LBB0_6:
	movslq	%r14d, %rax
	leaq	(%r15,%rax), %rcx
	cmpq	%rsi, %rcx
	movq	%r12, -56(%rbp)                 ## 8-byte Spill
	jbe	LBB0_8
## %bb.7:
	movq	%rsi, %r12
	subq	%rax, %r12
	leaq	L_.str.2(%rip), %rsi
	movq	%rbx, %rdi
	movq	%r12, %rdx
	movq	%r15, %rcx
	xorl	%eax, %eax
	callq	_dd_dev_err
	movq	%r12, %r15
LBB0_8:
	movq	%rbx, %rdi
	xorl	%esi, %esi
	xorl	%edx, %edx
	callq	_qos_rmt_entries
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	leaq	(%rax,%rcx,2), %r12
	movq	_TID_RDMA@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_HFI1_CAP_IS_KSET
	movl	$4294967295, %ecx               ## imm = 0xFFFFFFFF
	addq	%r13, %rcx
	testq	%rax, %rax
	cmoveq	%rax, %rcx
	addq	%r12, %rcx
	movslq	%ecx, %rax
	addq	%r15, %rax
	movq	_NUM_MAP_ENTRIES@GOTPCREL(%rip), %rdx
	movslq	(%rdx), %r12
	cmpq	%r12, %rax
	jbe	LBB0_10
## %bb.9:
	movslq	%ecx, %rax
	subq	%rax, %r12
	leaq	L_.str.3(%rip), %rsi
	movq	%rbx, %rdi
	movq	%r15, %rdx
	movl	%r12d, %ecx
	xorl	%eax, %eax
	callq	_dd_dev_err
	movq	%r12, %r15
LBB0_10:
	movq	-56(%rbp), %r12                 ## 8-byte Reload
	movq	-48(%rbp), %rdx                 ## 8-byte Reload
	addl	%r15d, %r14d
	movl	%r14d, (%rbx)
	movq	%r13, 8(%rbx)
	movq	%r13, 16(%rbx)
	movq	-64(%rbp), %r9                  ## 8-byte Reload
	movq	%r9, 24(%rbx)
	movq	%r15, 32(%rbx)
	movq	%r15, 40(%rbx)
	subq	$8, %rsp
	leaq	L_.str.4(%rip), %rsi
	movq	%rbx, %rdi
	movl	%r14d, %ecx
	movl	%r13d, %r8d
	xorl	%eax, %eax
	pushq	%r15
	callq	_dd_dev_info
	addq	$16, %rsp
	movq	_RCV_INCREMENT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 64(%rbx)
	movq	%rbx, %rdi
	callq	_chip_rcv_array_count
	xorl	%edx, %edx
	divl	64(%rbx)
	xorl	%edx, %edx
	divl	(%rbx)
	movl	%edx, %ecx
                                        ## kill: def $eax killed $eax def $rax
	movl	%eax, 68(%rbx)
	movl	%edx, 72(%rbx)
	leaq	L_.str.5(%rip), %rsi
	movq	%rbx, %rdi
	movq	%rax, %rdx
	xorl	%eax, %eax
	callq	_dd_dev_info
	movl	64(%rbx), %ecx
	movl	68(%rbx), %edx
	imull	%ecx, %edx
	movq	_MAX_EAGER_ENTRIES@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	addl	%eax, %eax
	cmpl	%eax, %edx
	jbe	LBB0_12
## %bb.11:
	xorl	%edx, %edx
	divl	%ecx
                                        ## kill: def $eax killed $eax def $rax
	movl	%eax, 68(%rbx)
	leaq	L_.str.6(%rip), %rsi
	movq	%rbx, %rdi
	movq	%rax, %rdx
	xorl	%eax, %eax
	callq	_dd_dev_info
	movl	$0, 72(%rbx)
LBB0_12:
	movq	%rbx, %rdi
	callq	_init_sc_pools_and_sizes
	testl	%eax, %eax
	js	LBB0_14
## %bb.13:
	movl	%eax, 48(%rbx)
	movq	56(%rbx), %rcx
	movq	_SC_KERNEL@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rdx
	movl	(%rcx,%rdx,4), %r8d
	movq	_SC_ACK@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rdx
	movl	(%rcx,%rdx,4), %r9d
	movq	_SC_USER@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rdx
	movl	(%rcx,%rdx,4), %r10d
	movq	_SC_VL15@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rdx
	movl	(%rcx,%rdx,4), %r11d
	leaq	L_.str.7(%rip), %rsi
	movq	%rbx, %rdi
	movq	%r12, %rdx
	movl	%eax, %ecx
	xorl	%eax, %eax
	pushq	%r11
	pushq	%r10
	callq	_dd_dev_info
	addq	$16, %rsp
	xorl	%eax, %eax
LBB0_14:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_HFI1_NUM_VNIC_CTXT,8,3         ## @HFI1_NUM_VNIC_CTXT
	.comm	_n_krcvqs,8,3                   ## @n_krcvqs
	.comm	_DEFAULT_KRCVQS,4,2             ## @DEFAULT_KRCVQS
	.comm	_num_vls,4,2                    ## @num_vls
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Reducing # kernel rcv contexts to: %d, from %lu\n"

L_.str.1:                               ## @.str.1
	.asciz	"No receive contexts available for VNIC\n"

	.comm	_num_user_contexts,8,3          ## @num_user_contexts
	.comm	_node_affinity,4,2              ## @node_affinity
L_.str.2:                               ## @.str.2
	.asciz	"Reducing # user receive contexts to: %d, from %u\n"

	.comm	_TID_RDMA,4,2                   ## @TID_RDMA
	.comm	_NUM_MAP_ENTRIES,4,2            ## @NUM_MAP_ENTRIES
L_.str.3:                               ## @.str.3
	.asciz	"RMT size is reducing the number of user receive contexts from %u to %d\n"

L_.str.4:                               ## @.str.4
	.asciz	"rcv contexts: chip %d, used %d (kernel %d, vnic %u, user %u)\n"

	.comm	_RCV_INCREMENT,4,2              ## @RCV_INCREMENT
L_.str.5:                               ## @.str.5
	.asciz	"RcvArray groups %u, ctxts extra %u\n"

	.comm	_MAX_EAGER_ENTRIES,4,2          ## @MAX_EAGER_ENTRIES
L_.str.6:                               ## @.str.6
	.asciz	"RcvArray group count too high, change to %u\n"

L_.str.7:                               ## @.str.7
	.asciz	"send contexts: chip %d, used %d (kernel %d, ack %d, user %d, vl15 %d)\n"

	.comm	_SC_KERNEL,8,3                  ## @SC_KERNEL
	.comm	_SC_ACK,8,3                     ## @SC_ACK
	.comm	_SC_USER,8,3                    ## @SC_USER
	.comm	_SC_VL15,8,3                    ## @SC_VL15
	.no_dead_strip	_set_up_context_variables
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function set_up_context_variables
_set_up_context_variables:              ; @set_up_context_variables
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	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
	mov	x19, x0
Lloh0:
	adrp	x8, _HFI1_NUM_VNIC_CTXT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _HFI1_NUM_VNIC_CTXT@GOTPAGEOFF]
Lloh2:
	ldr	x23, [x8]
	bl	_chip_send_contexts
	mov	x20, x0
	mov	x0, x19
	bl	_chip_rcv_contexts
	mov	x21, x0
Lloh3:
	adrp	x8, _n_krcvqs@GOTPAGE
Lloh4:
	ldr	x8, [x8, _n_krcvqs@GOTPAGEOFF]
Lloh5:
	ldr	x8, [x8]
Lloh6:
	adrp	x9, _DEFAULT_KRCVQS@GOTPAGE
Lloh7:
	ldr	x9, [x9, _DEFAULT_KRCVQS@GOTPAGEOFF]
Lloh8:
	ldrsw	x9, [x9]
	add	x9, x9, #1
	cmp	x8, #0
	csinc	x24, x9, x8, eq
Lloh9:
	adrp	x22, _num_vls@GOTPAGE
Lloh10:
	ldr	x22, [x22, _num_vls@GOTPAGEOFF]
	ldr	w8, [x22]
	mvn	w8, w8
	add	x8, x20, w8, sxtw
	cmp	x24, x8
	b.ls	LBB0_2
; %bb.1:
	stp	x8, x24, [sp]
Lloh11:
	adrp	x1, l_.str@PAGE
Lloh12:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_dd_dev_err
	ldr	w8, [x22]
	mvn	w8, w8
	add	x24, x20, w8, sxtw
LBB0_2:
	add	x8, x24, x23
	cmp	x8, x21
	b.ls	LBB0_4
; %bb.3:
Lloh13:
	adrp	x1, l_.str.1@PAGE
Lloh14:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_dd_dev_err
	mov	x23, #0
LBB0_4:
	add	x25, x23, x24
Lloh15:
	adrp	x8, _num_user_contexts@GOTPAGE
Lloh16:
	ldr	x8, [x8, _num_user_contexts@GOTPAGEOFF]
Lloh17:
	ldr	x22, [x8]
	tbz	x22, #63, LBB0_6
; %bb.5:
Lloh18:
	adrp	x0, _node_affinity@GOTPAGE
Lloh19:
	ldr	x0, [x0, _node_affinity@GOTPAGEOFF]
	bl	_cpumask_weight
	mov	x22, x0
LBB0_6:
	sxtw	x8, w25
	add	x9, x22, x8
	cmp	x9, x21
	b.ls	LBB0_8
; %bb.7:
	sub	x26, x21, x8
	stp	x26, x22, [sp]
Lloh20:
	adrp	x1, l_.str.2@PAGE
Lloh21:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x19
	bl	_dd_dev_err
	mov	x22, x26
LBB0_8:
	mov	x0, x19
	mov	x1, #0
	mov	x2, #0
	bl	_qos_rmt_entries
	add	x26, x0, x23, lsl #1
Lloh22:
	adrp	x8, _TID_RDMA@GOTPAGE
Lloh23:
	ldr	x8, [x8, _TID_RDMA@GOTPAGEOFF]
Lloh24:
	ldr	w0, [x8]
	bl	_HFI1_CAP_IS_KSET
	mov	w8, #-1
	add	x8, x24, x8
	cmp	x0, #0
	csel	x8, xzr, x8, eq
	add	x8, x26, x8
	add	x10, x22, w8, sxtw
Lloh25:
	adrp	x9, _NUM_MAP_ENTRIES@GOTPAGE
Lloh26:
	ldr	x9, [x9, _NUM_MAP_ENTRIES@GOTPAGEOFF]
Lloh27:
	ldrsw	x9, [x9]
	cmp	x10, x9
	b.ls	LBB0_10
; %bb.9:
	sub	x26, x9, w8, sxtw
	stp	x22, x26, [sp]
Lloh28:
	adrp	x1, l_.str.3@PAGE
Lloh29:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x0, x19
	bl	_dd_dev_err
	mov	x22, x26
LBB0_10:
	add	x8, x22, x25
	str	w8, [x19]
	stp	x24, x24, [x19, #8]
	stp	x23, x22, [x19, #24]
	str	x22, [x19, #40]
	stp	x23, x22, [sp, #16]
	stp	x8, x24, [sp]
Lloh30:
	adrp	x1, l_.str.4@PAGE
Lloh31:
	add	x1, x1, l_.str.4@PAGEOFF
	mov	x0, x19
	mov	x2, x21
	bl	_dd_dev_info
Lloh32:
	adrp	x8, _RCV_INCREMENT@GOTPAGE
Lloh33:
	ldr	x8, [x8, _RCV_INCREMENT@GOTPAGEOFF]
Lloh34:
	ldr	w8, [x8]
	str	w8, [x19, #64]
	mov	x0, x19
	bl	_chip_rcv_array_count
	ldr	w8, [x19, #64]
	udiv	w8, w0, w8
	ldr	w9, [x19]
	udiv	w2, w8, w9
	msub	w8, w2, w9, w8
	stp	w2, w8, [x19, #68]
	str	x8, [sp]
Lloh35:
	adrp	x1, l_.str.5@PAGE
Lloh36:
	add	x1, x1, l_.str.5@PAGEOFF
	mov	x0, x19
	bl	_dd_dev_info
	ldp	w8, w9, [x19, #64]
	mul	w10, w8, w9
Lloh37:
	adrp	x9, _MAX_EAGER_ENTRIES@GOTPAGE
Lloh38:
	ldr	x9, [x9, _MAX_EAGER_ENTRIES@GOTPAGEOFF]
Lloh39:
	ldr	w9, [x9]
	lsl	w9, w9, #1
	cmp	w10, w9
	b.ls	LBB0_12
; %bb.11:
	udiv	w2, w9, w8
	str	w2, [x19, #68]
Lloh40:
	adrp	x1, l_.str.6@PAGE
Lloh41:
	add	x1, x1, l_.str.6@PAGEOFF
	mov	x0, x19
	bl	_dd_dev_info
	str	wzr, [x19, #72]
LBB0_12:
	mov	x0, x19
	bl	_init_sc_pools_and_sizes
                                        ; kill: def $w0 killed $w0 def $x0
	tbnz	w0, #31, LBB0_14
; %bb.13:
	str	w0, [x19, #48]
	ldr	x8, [x19, #56]
Lloh42:
	adrp	x9, _SC_KERNEL@GOTPAGE
Lloh43:
	ldr	x9, [x9, _SC_KERNEL@GOTPAGEOFF]
Lloh44:
	ldr	x9, [x9]
Lloh45:
	adrp	x10, _SC_ACK@GOTPAGE
Lloh46:
	ldr	x10, [x10, _SC_ACK@GOTPAGEOFF]
Lloh47:
	ldr	x10, [x10]
Lloh48:
	adrp	x11, _SC_USER@GOTPAGE
Lloh49:
	ldr	x11, [x11, _SC_USER@GOTPAGEOFF]
Lloh50:
	ldr	x11, [x11]
Lloh51:
	adrp	x12, _SC_VL15@GOTPAGE
Lloh52:
	ldr	x12, [x12, _SC_VL15@GOTPAGEOFF]
Lloh53:
	ldr	x12, [x12]
	ldr	w9, [x8, x9, lsl #2]
	ldr	w10, [x8, x10, lsl #2]
	ldr	w11, [x8, x11, lsl #2]
	ldr	w8, [x8, x12, lsl #2]
	stp	x11, x8, [sp, #24]
	stp	x9, x10, [sp, #8]
	str	x0, [sp]
Lloh54:
	adrp	x1, l_.str.7@PAGE
Lloh55:
	add	x1, x1, l_.str.7@PAGEOFF
	mov	x0, x19
	mov	x2, x20
	bl	_dd_dev_info
	mov	w0, #0
LBB0_14:
                                        ; kill: def $w0 killed $w0 killed $x0
	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
	add	sp, sp, #128
	ret
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpAdd	Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh37, Lloh38, Lloh39
	.loh AdrpAdd	Lloh35, Lloh36
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpAdd	Lloh30, Lloh31
	.loh AdrpAdd	Lloh40, Lloh41
	.loh AdrpAdd	Lloh54, Lloh55
	.loh AdrpLdrGotLdr	Lloh51, Lloh52, Lloh53
	.loh AdrpLdrGotLdr	Lloh48, Lloh49, Lloh50
	.loh AdrpLdrGotLdr	Lloh45, Lloh46, Lloh47
	.loh AdrpLdrGotLdr	Lloh42, Lloh43, Lloh44
	.cfi_endproc
                                        ; -- End function
	.comm	_HFI1_NUM_VNIC_CTXT,8,3         ; @HFI1_NUM_VNIC_CTXT
	.comm	_n_krcvqs,8,3                   ; @n_krcvqs
	.comm	_DEFAULT_KRCVQS,4,2             ; @DEFAULT_KRCVQS
	.comm	_num_vls,4,2                    ; @num_vls
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Reducing # kernel rcv contexts to: %d, from %lu\n"

l_.str.1:                               ; @.str.1
	.asciz	"No receive contexts available for VNIC\n"

	.comm	_num_user_contexts,8,3          ; @num_user_contexts
	.comm	_node_affinity,4,2              ; @node_affinity
l_.str.2:                               ; @.str.2
	.asciz	"Reducing # user receive contexts to: %d, from %u\n"

	.comm	_TID_RDMA,4,2                   ; @TID_RDMA
	.comm	_NUM_MAP_ENTRIES,4,2            ; @NUM_MAP_ENTRIES
l_.str.3:                               ; @.str.3
	.asciz	"RMT size is reducing the number of user receive contexts from %u to %d\n"

l_.str.4:                               ; @.str.4
	.asciz	"rcv contexts: chip %d, used %d (kernel %d, vnic %u, user %u)\n"

	.comm	_RCV_INCREMENT,4,2              ; @RCV_INCREMENT
l_.str.5:                               ; @.str.5
	.asciz	"RcvArray groups %u, ctxts extra %u\n"

	.comm	_MAX_EAGER_ENTRIES,4,2          ; @MAX_EAGER_ENTRIES
l_.str.6:                               ; @.str.6
	.asciz	"RcvArray group count too high, change to %u\n"

l_.str.7:                               ; @.str.7
	.asciz	"send contexts: chip %d, used %d (kernel %d, ack %d, user %d, vl15 %d)\n"

	.comm	_SC_KERNEL,8,3                  ; @SC_KERNEL
	.comm	_SC_ACK,8,3                     ; @SC_ACK
	.comm	_SC_USER,8,3                    ; @SC_USER
	.comm	_SC_VL15,8,3                    ; @SC_VL15
	.no_dead_strip	_set_up_context_variables
.subsections_via_symbols
