	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function complete_subctxt
_complete_subctxt:                      ## @complete_subctxt
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movq	(%rdi), %rsi
	movl	12(%rsi), %ebx
	movq	_HFI1_CTXT_BASE_UNINIT@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	addq	$8, %rsi
	callq	_test_bit
	xorl	%esi, %esi
	testq	%rax, %rax
	sete	%sil
	movl	%ebx, %edi
	callq	_wait_event_interruptible
	movl	%eax, %r12d
	movq	_HFI1_CTXT_BASE_FAILED@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	(%r14), %rsi
	addq	$8, %rsi
	callq	_test_bit
	movq	_ENOMEM@GOTPCREL(%rip), %rcx
	xorl	%r15d, %r15d
	xorl	%ebx, %ebx
	subl	(%rcx), %ebx
	testq	%rax, %rax
	cmovel	%r12d, %ebx
	testl	%ebx, %ebx
	jne	LBB0_2
## %bb.1:
	movq	(%r14), %rax
	movl	4(%rax), %edi
	callq	_hfi1_get_proc_affinity
	movl	%eax, 20(%r14)
	movq	(%r14), %rsi
	movq	%r14, %rdi
	callq	_init_user_ctxt
	movl	%eax, %ebx
	testl	%eax, %eax
	je	LBB0_3
LBB0_2:
	movq	8(%r14), %rdi
	callq	_spin_lock_irqsave
	movl	16(%r14), %edi
	movq	(%r14), %rax
	movl	(%rax), %esi
	callq	___clear_bit
	movq	8(%r14), %rdi
	callq	_spin_unlock_irqrestore
	movq	(%r14), %rdi
	callq	_hfi1_rcd_put
	movq	$0, (%r14)
	movl	%ebx, %r15d
LBB0_3:
	movl	%r15d, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_HFI1_CTXT_BASE_UNINIT,4,2      ## @HFI1_CTXT_BASE_UNINIT
	.comm	_HFI1_CTXT_BASE_FAILED,4,2      ## @HFI1_CTXT_BASE_FAILED
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.no_dead_strip	_complete_subctxt
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function complete_subctxt
_complete_subctxt:                      ; @complete_subctxt
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x0
	ldr	x8, [x0]
	ldr	w20, [x8, #12]
Lloh0:
	adrp	x9, _HFI1_CTXT_BASE_UNINIT@GOTPAGE
Lloh1:
	ldr	x9, [x9, _HFI1_CTXT_BASE_UNINIT@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x9]
	add	x1, x8, #8
	bl	_test_bit
	cmp	x0, #0
	cset	w1, eq
	mov	x0, x20
	bl	_wait_event_interruptible
	mov	x20, x0
Lloh3:
	adrp	x8, _HFI1_CTXT_BASE_FAILED@GOTPAGE
Lloh4:
	ldr	x8, [x8, _HFI1_CTXT_BASE_FAILED@GOTPAGEOFF]
Lloh5:
	ldr	w0, [x8]
	ldr	x8, [x19]
	add	x1, x8, #8
	bl	_test_bit
Lloh6:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh7:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	cmp	x0, #0
	csneg	w20, w20, w8, eq
	cbnz	w20, LBB0_2
; %bb.1:
	ldr	x8, [x19]
	ldr	w0, [x8, #4]
	bl	_hfi1_get_proc_affinity
	str	w0, [x19, #20]
	ldr	x1, [x19]
	mov	x0, x19
	bl	_init_user_ctxt
	mov	x20, x0
	cbz	w0, LBB0_3
LBB0_2:
	ldr	x0, [x19, #8]
	bl	_spin_lock_irqsave
	ldr	w0, [x19, #16]
	ldr	x8, [x19]
	ldr	w1, [x8]
	bl	___clear_bit
	ldr	x0, [x19, #8]
	bl	_spin_unlock_irqrestore
	ldr	x0, [x19]
	bl	_hfi1_rcd_put
	str	xzr, [x19]
LBB0_3:
	mov	x0, x20
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_HFI1_CTXT_BASE_UNINIT,4,2      ; @HFI1_CTXT_BASE_UNINIT
	.comm	_HFI1_CTXT_BASE_FAILED,4,2      ; @HFI1_CTXT_BASE_FAILED
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.no_dead_strip	_complete_subctxt
.subsections_via_symbols
