	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function qib_assign_ctxt
_qib_assign_ctxt:                       ## @qib_assign_ctxt
	.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
	movq	%rsi, %r12
	movq	%rdi, %r14
	movq	_QIB_PORT_ALG_ACROSS@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	callq	_ctxt_fp
	testq	%rax, %rax
	je	LBB0_3
## %bb.1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	jmp	LBB0_2
LBB0_3:
	movl	(%r12), %eax
	movl	%eax, %ebx
	sarl	$16, %ebx
	movq	_QIB_USER_SWMAJOR@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %ebx
	jne	LBB0_4
## %bb.5:
	movzwl	%ax, %r13d
	cmpl	$11, %r13d
	jb	LBB0_7
## %bb.6:
	movl	4(%r12), %eax
	movq	_QIB_PORT_ALG_COUNT@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	cmovbl	%eax, %r15d
LBB0_7:
	movq	_qib_mutex@GOTPCREL(%rip), %rdi
	callq	_mutex_lock
	movl	%ebx, %edi
	movl	%r13d, %esi
	callq	_qib_compatible_subctxts
	testq	%rax, %rax
	je	LBB0_11
## %bb.8:
	cmpq	$0, 8(%r12)
	je	LBB0_11
## %bb.9:
	movq	%r14, %rdi
	movq	%r12, %rsi
	callq	_find_shared_ctxt
	testl	%eax, %eax
	je	LBB0_11
## %bb.10:
	movl	%eax, %ebx
	sarl	$31, %ebx
	andl	%eax, %ebx
	testl	%ebx, %ebx
	jne	LBB0_26
	jmp	LBB0_16
LBB0_4:
	movq	_ENODEV@GOTPCREL(%rip), %rax
LBB0_2:
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_27:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_11:
	movq	8(%r14), %rax
	movl	(%rax), %edi
	callq	_iminor
	movq	_QIB_USER_MINOR_BASE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	cmpl	%ecx, %eax
	jne	LBB0_12
## %bb.13:
	movq	%r14, %rdi
	movq	%r12, %rsi
	movl	%r15d, %edx
	callq	_get_a_ctxt
	jmp	LBB0_14
LBB0_12:
	notl	%ecx
	addl	%ecx, %eax
	movl	%eax, %edi
	movq	%r14, %rsi
	movq	%r12, %rdx
	callq	_find_free_ctxt
LBB0_14:
	movl	%eax, %ebx
	testl	%ebx, %ebx
	jne	LBB0_26
LBB0_16:
	movq	(%r14), %r15
	movq	16(%r15), %rax
	movq	8(%rax), %r14
	movq	_QIB_HAS_SEND_DMA@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	xorl	%ebx, %ebx
	testl	%ecx, (%r14)
	je	LBB0_19
## %bb.17:
	movq	8(%r14), %rdi
	movl	16(%r14), %esi
	movl	(%rax), %edx
	movl	8(%r15), %ecx
	callq	_qib_user_sdma_queue_create
	movl	%eax, 4(%r15)
	testl	%eax, %eax
	jne	LBB0_19
## %bb.18:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_19:
	movq	_current@GOTPCREL(%rip), %r12
	movq	(%r12), %rdi
	callq	_tsk_cpus_allowed
	movl	%eax, %edi
	callq	_cpumask_weight
	testl	%ebx, %ebx
	jne	LBB0_23
## %bb.20:
	movq	_qib_cpulist_count@GOTPCREL(%rip), %r13
	movl	(%r13), %esi
	cmpl	%esi, %eax
	jae	LBB0_21
LBB0_23:
	cmpl	$1, %eax
	jne	LBB0_26
## %bb.24:
	movq	(%r12), %rdi
	callq	_tsk_cpus_allowed
	movl	%eax, %edi
	callq	_cpumask_first
	movq	_qib_cpulist@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movl	%eax, %edi
	callq	_test_bit
	testq	%rax, %rax
	je	LBB0_26
## %bb.25:
	movq	8(%r14), %r14
	movq	(%r12), %rdi
	movl	(%rdi), %r15d
	movl	4(%rdi), %r12d
	callq	_tsk_cpus_allowed
	movl	%eax, %edi
	callq	_cpumask_first
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
	movl	%r12d, %edx
	movl	%r15d, %ecx
	movl	%eax, %r8d
	callq	_qib_devinfo
	jmp	LBB0_26
LBB0_21:
	movq	_qib_cpulist@GOTPCREL(%rip), %r12
	movl	(%r12), %edi
	callq	_find_first_zero_bit
	xorl	%ebx, %ebx
	cmpl	(%r13), %eax
	je	LBB0_26
## %bb.22:
	movl	%eax, %r14d
	movl	(%r12), %esi
	movl	%eax, %edi
	callq	___set_bit
	movl	%r14d, (%r15)
LBB0_26:
	movq	_qib_mutex@GOTPCREL(%rip), %rdi
	callq	_mutex_unlock
	jmp	LBB0_27
	.cfi_endproc
                                        ## -- End function
	.comm	_QIB_PORT_ALG_ACROSS,4,2        ## @QIB_PORT_ALG_ACROSS
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_QIB_USER_SWMAJOR,4,2           ## @QIB_USER_SWMAJOR
	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_QIB_PORT_ALG_COUNT,4,2         ## @QIB_PORT_ALG_COUNT
	.comm	_qib_mutex,4,2                  ## @qib_mutex
	.comm	_QIB_USER_MINOR_BASE,4,2        ## @QIB_USER_MINOR_BASE
	.comm	_QIB_HAS_SEND_DMA,4,2           ## @QIB_HAS_SEND_DMA
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_current,8,3                    ## @current
	.comm	_qib_cpulist_count,4,2          ## @qib_cpulist_count
	.comm	_qib_cpulist,4,2                ## @qib_cpulist
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%s PID %u affinity set to cpu %d; already allocated\n"

	.no_dead_strip	_qib_assign_ctxt
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function qib_assign_ctxt
_qib_assign_ctxt:                       ; @qib_assign_ctxt
	.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	x19, x1
	mov	x20, x0
Lloh0:
	adrp	x8, _QIB_PORT_ALG_ACROSS@GOTPAGE
Lloh1:
	ldr	x8, [x8, _QIB_PORT_ALG_ACROSS@GOTPAGEOFF]
Lloh2:
	ldr	w21, [x8]
	bl	_ctxt_fp
	cbz	x0, LBB0_2
; %bb.1:
Lloh3:
	adrp	x8, _EINVAL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_10
LBB0_2:
	ldr	w8, [x19]
	asr	w22, w8, #16
Lloh5:
	adrp	x9, _QIB_USER_SWMAJOR@GOTPAGE
Lloh6:
	ldr	x9, [x9, _QIB_USER_SWMAJOR@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
	cmp	w22, w9
	b.ne	LBB0_9
; %bb.3:
	and	w23, w8, #0xffff
	cmp	w23, #11
	b.lo	LBB0_5
; %bb.4:
	ldr	w8, [x19, #4]
Lloh8:
	adrp	x9, _QIB_PORT_ALG_COUNT@GOTPAGE
Lloh9:
	ldr	x9, [x9, _QIB_PORT_ALG_COUNT@GOTPAGEOFF]
Lloh10:
	ldr	w9, [x9]
	cmp	w8, w9
	csel	w21, w8, w21, lo
LBB0_5:
Lloh11:
	adrp	x0, _qib_mutex@GOTPAGE
Lloh12:
	ldr	x0, [x0, _qib_mutex@GOTPAGEOFF]
	bl	_mutex_lock
	mov	x0, x22
	mov	x1, x23
	bl	_qib_compatible_subctxts
	cbz	x0, LBB0_12
; %bb.6:
	ldr	x8, [x19, #8]
	cbz	x8, LBB0_12
; %bb.7:
	mov	x0, x20
	mov	x1, x19
	bl	_find_shared_ctxt
	cbz	w0, LBB0_12
; %bb.8:
	cmp	w0, #0
	csel	w19, w0, wzr, lt
	cbnz	w19, LBB0_27
	b	LBB0_15
LBB0_9:
Lloh13:
	adrp	x8, _ENODEV@GOTPAGE
Lloh14:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
LBB0_10:
	ldr	w8, [x8]
	neg	w19, w8
LBB0_11:
	mov	x0, x19
	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_12:
	ldr	x8, [x20, #8]
	ldr	w0, [x8]
	bl	_iminor
Lloh15:
	adrp	x8, _QIB_USER_MINOR_BASE@GOTPAGE
Lloh16:
	ldr	x8, [x8, _QIB_USER_MINOR_BASE@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	cmp	w0, w8
	b.ne	LBB0_14
; %bb.13:
	mov	x0, x20
	mov	x1, x19
	mov	x2, x21
	bl	_get_a_ctxt
	mov	x19, x0
	cbnz	w19, LBB0_27
	b	LBB0_15
LBB0_14:
	mvn	w8, w8
	add	w0, w0, w8
	mov	x1, x20
	mov	x2, x19
	bl	_find_free_ctxt
	mov	x19, x0
	cbnz	w19, LBB0_27
LBB0_15:
	ldr	x21, [x20]
	ldr	x8, [x21, #16]
	ldr	x20, [x8, #8]
	ldr	w9, [x20]
Lloh18:
	adrp	x10, _QIB_HAS_SEND_DMA@GOTPAGE
Lloh19:
	ldr	x10, [x10, _QIB_HAS_SEND_DMA@GOTPAGEOFF]
Lloh20:
	ldr	w10, [x10]
	tst	w10, w9
	b.eq	LBB0_17
; %bb.16:
	ldr	x0, [x20, #8]
	ldr	w1, [x20, #16]
	ldr	w2, [x8]
	ldr	w3, [x21, #8]
	bl	_qib_user_sdma_queue_create
	str	w0, [x21, #4]
	cbz	w0, LBB0_18
LBB0_17:
	mov	w19, #0
	b	LBB0_19
LBB0_18:
Lloh21:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh22:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh23:
	ldr	w8, [x8]
	neg	w19, w8
LBB0_19:
Lloh24:
	adrp	x22, _current@GOTPAGE
Lloh25:
	ldr	x22, [x22, _current@GOTPAGEOFF]
	ldr	x0, [x22]
	bl	_tsk_cpus_allowed
	bl	_cpumask_weight
	cbnz	w19, LBB0_21
; %bb.20:
Lloh26:
	adrp	x23, _qib_cpulist_count@GOTPAGE
Lloh27:
	ldr	x23, [x23, _qib_cpulist_count@GOTPAGEOFF]
	ldr	w1, [x23]
	cmp	w0, w1
	b.hs	LBB0_24
LBB0_21:
	cmp	w0, #1
	b.ne	LBB0_27
; %bb.22:
	ldr	x0, [x22]
	bl	_tsk_cpus_allowed
	bl	_cpumask_first
Lloh28:
	adrp	x8, _qib_cpulist@GOTPAGE
Lloh29:
	ldr	x8, [x8, _qib_cpulist@GOTPAGEOFF]
Lloh30:
	ldr	w1, [x8]
	bl	_test_bit
	cbz	x0, LBB0_27
; %bb.23:
	ldr	x20, [x20, #8]
	ldr	x0, [x22]
	ldp	w22, w21, [x0]
	bl	_tsk_cpus_allowed
	bl	_cpumask_first
	mov	x4, x0
Lloh31:
	adrp	x1, l_.str@PAGE
Lloh32:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x20
	mov	x2, x21
	mov	x3, x22
	bl	_qib_devinfo
	b	LBB0_27
LBB0_24:
Lloh33:
	adrp	x19, _qib_cpulist@GOTPAGE
Lloh34:
	ldr	x19, [x19, _qib_cpulist@GOTPAGEOFF]
	ldr	w0, [x19]
	bl	_find_first_zero_bit
	ldr	w8, [x23]
	cmp	w0, w8
	b.ne	LBB0_26
; %bb.25:
	mov	w19, #0
	b	LBB0_27
LBB0_26:
	mov	x20, x0
	ldr	w1, [x19]
	bl	___set_bit
	mov	w19, #0
	str	w20, [x21]
LBB0_27:
Lloh35:
	adrp	x0, _qib_mutex@GOTPAGE
Lloh36:
	ldr	x0, [x0, _qib_mutex@GOTPAGEOFF]
	bl	_mutex_unlock
	b	LBB0_11
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh24, Lloh25
	.loh AdrpLdrGot	Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpAdd	Lloh31, Lloh32
	.loh AdrpLdrGot	Lloh33, Lloh34
	.loh AdrpLdrGot	Lloh35, Lloh36
	.cfi_endproc
                                        ; -- End function
	.comm	_QIB_PORT_ALG_ACROSS,4,2        ; @QIB_PORT_ALG_ACROSS
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_QIB_USER_SWMAJOR,4,2           ; @QIB_USER_SWMAJOR
	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_QIB_PORT_ALG_COUNT,4,2         ; @QIB_PORT_ALG_COUNT
	.comm	_qib_mutex,4,2                  ; @qib_mutex
	.comm	_QIB_USER_MINOR_BASE,4,2        ; @QIB_USER_MINOR_BASE
	.comm	_QIB_HAS_SEND_DMA,4,2           ; @QIB_HAS_SEND_DMA
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_current,8,3                    ; @current
	.comm	_qib_cpulist_count,4,2          ; @qib_cpulist_count
	.comm	_qib_cpulist,4,2                ; @qib_cpulist
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%s PID %u affinity set to cpu %d; already allocated\n"

	.no_dead_strip	_qib_assign_ctxt
.subsections_via_symbols
