	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function allocate_ctxt
_allocate_ctxt:                         ## @allocate_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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	_HFI1_FROZEN@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%rsi)
	je	LBB0_3
## %bb.1:
	movq	_EIO@GOTPCREL(%rip), %rax
LBB0_2:
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_20:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_3:
	movq	%rsi, %r12
	cmpl	$0, 16(%rsi)
	je	LBB0_4
## %bb.5:
	movq	%rcx, %r14
	movq	%rdx, %r15
	movq	%rdi, %r13
	movl	20(%r12), %edi
	callq	_hfi1_get_proc_affinity
	movl	%eax, (%r13)
	cmpl	$-1, %eax
	je	LBB0_7
## %bb.6:
	movl	%eax, %edi
	callq	_cpu_to_node
	jmp	LBB0_8
LBB0_4:
	movq	_EBUSY@GOTPCREL(%rip), %rax
	jmp	LBB0_2
LBB0_7:
	xorl	%eax, %eax
	callq	_numa_node_id
LBB0_8:
	movl	%eax, %esi
	movl	24(%r12), %edi
	leaq	-48(%rbp), %rdx
	callq	_hfi1_create_ctxtdata
	testl	%eax, %eax
	js	LBB0_9
## %bb.10:
	movq	_PROC@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	-48(%rbp), %rax
	movl	44(%rax), %esi
	movl	48(%rax), %edx
	movl	(%r13), %r9d
	movl	4(%r13), %ecx
	movq	_current@GOTPCREL(%rip), %r13
	movq	(%r13), %rax
	movl	4(%rax), %r8d
	movl	%esi, (%rsp)
	leaq	L_.str.1(%rip), %rsi
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_hfi1_cdbg
	movq	_SC_USER@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	-48(%rbp), %rax
	movl	40(%rax), %edx
	movl	20(%r12), %ecx
	movq	%r12, %rdi
	callq	_sc_alloc
	movq	-48(%rbp), %rdi
	movq	%rax, 32(%rdi)
	testq	%rax, %rax
	je	LBB0_11
## %bb.13:
	movq	_PROC@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
	movl	(%rax), %ecx
	movl	4(%rax), %edx
	leaq	L_.str.2(%rip), %rsi
	xorl	%eax, %eax
	callq	_hfi1_cdbg
	movq	-48(%rbp), %rax
	movq	32(%rax), %rdi
	callq	_sc_enable
	movq	-48(%rbp), %rdi
	testl	%eax, %eax
	je	LBB0_15
## %bb.14:
	movl	%eax, %ebx
	callq	_hfi1_free_ctxt
	jmp	LBB0_20
LBB0_9:
	movl	%eax, %ebx
	leaq	L_.str(%rip), %rsi
	movq	%r12, %rdi
	callq	_dd_dev_err
	jmp	LBB0_20
LBB0_11:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
	callq	_hfi1_free_ctxt
	jmp	LBB0_20
LBB0_15:
	movl	24(%rdi), %esi
	xorl	%edi, %edi
	callq	___set_bit
	cmpq	$0, 8(%r15)
	je	LBB0_17
## %bb.16:
	movq	-48(%rbp), %rdi
	movq	%r15, %rsi
	callq	_init_subctxts
LBB0_17:
	movl	4(%r15), %eax
	movq	-48(%rbp), %rdi
	movl	%eax, 20(%rdi)
	movq	_hfi1_cap_mask@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 16(%rdi)
	addq	$12, %rdi
	callq	_init_waitqueue_head
	movq	-48(%rbp), %rax
	movl	8(%rax), %edi
	movq	(%r13), %rax
	movl	(%rax), %esi
	movl	$4, %edx
	callq	_strlcpy
	movq	-48(%rbp), %rax
	movl	4(%rax), %edi
	movl	(%r15), %esi
	movl	$4, %edx
	callq	_memcpy
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_current_uid
	movl	%eax, %edi
	callq	_generate_jkey
	movq	-48(%rbp), %rcx
	movl	%eax, (%rcx)
	movq	_hfi1_stats@GOTPCREL(%rip), %rax
	incl	(%rax)
	movslq	16(%r12), %rax
	leal	-1(%rax), %edx
	movl	%edx, 16(%r12)
	cmpq	%rax, 8(%r12)
	jne	LBB0_19
## %bb.18:
	movq	%r12, %rdi
	callq	_aspm_disable_all
	movq	-48(%rbp), %rcx
LBB0_19:
	movq	%rcx, (%r14)
	jmp	LBB0_20
	.cfi_endproc
                                        ## -- End function
	.comm	_HFI1_FROZEN,4,2                ## @HFI1_FROZEN
	.comm	_EIO,4,2                        ## @EIO
	.comm	_EBUSY,4,2                      ## @EBUSY
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"user ctxtdata allocation failed\n"

	.comm	_PROC,4,2                       ## @PROC
L_.str.1:                               ## @.str.1
	.asciz	"[%u:%u] pid %u assigned to CPU %d (NUMA %u)"

	.comm	_current,8,3                    ## @current
	.comm	_SC_USER,4,2                    ## @SC_USER
	.comm	_ENOMEM,4,2                     ## @ENOMEM
L_.str.2:                               ## @.str.2
	.asciz	"allocated send context %u(%u)\n"

	.comm	_hfi1_cap_mask,4,2              ## @hfi1_cap_mask
	.comm	_hfi1_stats,4,2                 ## @hfi1_stats
	.no_dead_strip	_allocate_ctxt
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function allocate_ctxt
_allocate_ctxt:                         ; @allocate_ctxt
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	ldr	w8, [x1]
Lloh0:
	adrp	x9, _HFI1_FROZEN@GOTPAGE
Lloh1:
	ldr	x9, [x9, _HFI1_FROZEN@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_4
; %bb.1:
Lloh3:
	adrp	x8, _EIO@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
LBB0_2:
	ldr	w8, [x8]
	neg	w23, w8
LBB0_3:
	mov	x0, x23
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
LBB0_4:
	mov	x20, x1
	ldr	w8, [x1, #16]
	cbz	w8, LBB0_7
; %bb.5:
	mov	x19, x3
	mov	x21, x2
	mov	x22, x0
	ldr	w0, [x20, #20]
	bl	_hfi1_get_proc_affinity
	str	w0, [x22]
	cmn	w0, #1
	b.eq	LBB0_8
; %bb.6:
	bl	_cpu_to_node
	b	LBB0_9
LBB0_7:
Lloh5:
	adrp	x8, _EBUSY@GOTPAGE
Lloh6:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
	b	LBB0_2
LBB0_8:
	bl	_numa_node_id
LBB0_9:
	mov	x1, x0
	ldr	w0, [x20, #24]
	add	x2, sp, #24
	bl	_hfi1_create_ctxtdata
	tbnz	w0, #31, LBB0_17
; %bb.10:
Lloh7:
	adrp	x23, _PROC@GOTPAGE
Lloh8:
	ldr	x23, [x23, _PROC@GOTPAGEOFF]
	ldr	w0, [x23]
	ldr	x8, [sp, #24]
Lloh9:
	adrp	x24, _current@GOTPAGE
Lloh10:
	ldr	x24, [x24, _current@GOTPAGEOFF]
	ldr	x9, [x24]
	ldr	w9, [x9, #4]
	ldp	w10, w3, [x22]
	ldp	w8, w2, [x8, #44]
	stp	x10, x8, [sp, #8]
	str	x9, [sp]
Lloh11:
	adrp	x1, l_.str.1@PAGE
Lloh12:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_hfi1_cdbg
Lloh13:
	adrp	x8, _SC_USER@GOTPAGE
Lloh14:
	ldr	x8, [x8, _SC_USER@GOTPAGEOFF]
Lloh15:
	ldr	w1, [x8]
	ldr	x8, [sp, #24]
	ldr	w2, [x8, #40]
	ldr	w3, [x20, #20]
	mov	x0, x20
	bl	_sc_alloc
	mov	x8, x0
	ldr	x0, [sp, #24]
	str	x8, [x0, #32]
	cbz	x8, LBB0_18
; %bb.11:
	ldr	w0, [x23]
	ldp	w3, w2, [x8]
Lloh16:
	adrp	x1, l_.str.2@PAGE
Lloh17:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_hfi1_cdbg
	ldr	x8, [sp, #24]
	ldr	x0, [x8, #32]
	bl	_sc_enable
	mov	x23, x0
	ldr	x0, [sp, #24]
	cbnz	w23, LBB0_19
; %bb.12:
	ldr	w1, [x0, #24]
	mov	w0, #0
	bl	___set_bit
	ldr	x8, [x21, #8]
	cbz	x8, LBB0_14
; %bb.13:
	ldr	x0, [sp, #24]
	mov	x1, x21
	bl	_init_subctxts
LBB0_14:
	ldr	w8, [x21, #4]
	ldr	x9, [sp, #24]
Lloh18:
	adrp	x10, _hfi1_cap_mask@GOTPAGE
Lloh19:
	ldr	x10, [x10, _hfi1_cap_mask@GOTPAGEOFF]
Lloh20:
	ldr	w10, [x10]
	stp	w10, w8, [x9, #16]
	add	x0, x9, #12
	bl	_init_waitqueue_head
	ldr	x8, [sp, #24]
	ldr	w0, [x8, #8]
	ldr	x8, [x24]
	ldr	w1, [x8]
	mov	w2, #4
	bl	_strlcpy
	ldr	x8, [sp, #24]
	ldr	w0, [x8, #4]
	ldr	w1, [x21]
	mov	w2, #4
	bl	_memcpy
	bl	_current_uid
	bl	_generate_jkey
	ldr	x8, [sp, #24]
	str	w0, [x8]
Lloh21:
	adrp	x9, _hfi1_stats@GOTPAGE
Lloh22:
	ldr	x9, [x9, _hfi1_stats@GOTPAGEOFF]
	ldr	w10, [x9]
	add	w10, w10, #1
	str	w10, [x9]
	ldrsw	x9, [x20, #16]
	sub	w10, w9, #1
	str	w10, [x20, #16]
	ldr	x10, [x20, #8]
	cmp	x10, x9
	b.ne	LBB0_16
; %bb.15:
	mov	x0, x20
	bl	_aspm_disable_all
	ldr	x8, [sp, #24]
LBB0_16:
	mov	w23, #0
	str	x8, [x19]
	b	LBB0_3
LBB0_17:
	mov	x23, x0
Lloh23:
	adrp	x1, l_.str@PAGE
Lloh24:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x20
	bl	_dd_dev_err
	b	LBB0_3
LBB0_18:
Lloh25:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh26:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh27:
	ldr	w8, [x8]
	neg	w23, w8
LBB0_19:
	bl	_hfi1_free_ctxt
	b	LBB0_3
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.cfi_endproc
                                        ; -- End function
	.comm	_HFI1_FROZEN,4,2                ; @HFI1_FROZEN
	.comm	_EIO,4,2                        ; @EIO
	.comm	_EBUSY,4,2                      ; @EBUSY
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"user ctxtdata allocation failed\n"

	.comm	_PROC,4,2                       ; @PROC
l_.str.1:                               ; @.str.1
	.asciz	"[%u:%u] pid %u assigned to CPU %d (NUMA %u)"

	.comm	_current,8,3                    ; @current
	.comm	_SC_USER,4,2                    ; @SC_USER
	.comm	_ENOMEM,4,2                     ; @ENOMEM
l_.str.2:                               ; @.str.2
	.asciz	"allocated send context %u(%u)\n"

	.comm	_hfi1_cap_mask,4,2              ; @hfi1_cap_mask
	.comm	_hfi1_stats,4,2                 ; @hfi1_stats
	.no_dead_strip	_allocate_ctxt
.subsections_via_symbols
