	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ctxt_reset
_ctxt_reset:                            ## @ctxt_reset
	.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
	testq	%rdi, %rdi
	je	LBB0_3
## %bb.1:
	movq	%rdi, %r12
	movq	8(%rdi), %r15
	testq	%r15, %r15
	je	LBB0_3
## %bb.2:
	movq	(%r12), %r14
	testq	%r14, %r14
	je	LBB0_3
## %bb.5:
	movl	4(%r14), %r13d
	movq	_SCF_HALTED@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	andl	(%r14), %ebx
	movq	_SEND_CTXT_HALT_TIMEOUT@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_msecs_to_jiffies
	movl	%r13d, %edi
	movl	%ebx, %esi
	movl	%eax, %edx
	callq	_wait_event_interruptible_timeout
	movl	(%r14), %eax
	movq	_SCF_HALTED@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_6
## %bb.7:
	movq	_SCF_FROZEN@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_12
## %bb.8:
	movl	(%r15), %edi
	movl	4(%r15), %r13d
	callq	_READ_ONCE
	movq	_HFI1_FROZEN@GOTPCREL(%rip), %rcx
	xorl	%ebx, %ebx
	andl	(%rcx), %eax
	sete	%bl
	movq	_SEND_CTXT_HALT_TIMEOUT@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_msecs_to_jiffies
	movl	%r13d, %edi
	movl	%ebx, %esi
	movl	%eax, %edx
	callq	_wait_event_interruptible_timeout
	movl	(%r15), %eax
	movq	_HFI1_FROZEN@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_9
LBB0_6:
	movq	_ENOLCK@GOTPCREL(%rip), %rax
	jmp	LBB0_4
LBB0_3:
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_4:
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_15:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_12:
	movq	%r14, %rdi
	callq	_sc_restart
	movl	%eax, %ebx
	testl	%ebx, %ebx
	jne	LBB0_15
LBB0_14:
	movq	%r14, %rdi
	callq	_sc_return_credits
	xorl	%ebx, %ebx
	jmp	LBB0_15
LBB0_9:
	movq	_HFI1_FORCED_FREEZE@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_11
## %bb.10:
	movq	_ENODEV@GOTPCREL(%rip), %rax
	jmp	LBB0_4
LBB0_11:
	movq	%r14, %rdi
	callq	_sc_disable
	movq	%r14, %rdi
	callq	_sc_enable
	movl	%eax, %ebx
	movq	_HFI1_RCVCTRL_CTXT_ENB@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	movq	%r12, %rdx
	callq	_hfi1_rcvctrl
	testl	%ebx, %ebx
	jne	LBB0_15
	jmp	LBB0_14
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_SCF_HALTED,4,2                 ## @SCF_HALTED
	.comm	_SEND_CTXT_HALT_TIMEOUT,4,2     ## @SEND_CTXT_HALT_TIMEOUT
	.comm	_ENOLCK,4,2                     ## @ENOLCK
	.comm	_SCF_FROZEN,4,2                 ## @SCF_FROZEN
	.comm	_HFI1_FROZEN,4,2                ## @HFI1_FROZEN
	.comm	_HFI1_FORCED_FREEZE,4,2         ## @HFI1_FORCED_FREEZE
	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_HFI1_RCVCTRL_CTXT_ENB,4,2      ## @HFI1_RCVCTRL_CTXT_ENB
	.no_dead_strip	_ctxt_reset
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ctxt_reset
_ctxt_reset:                            ; @ctxt_reset
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	cbz	x0, LBB0_7
; %bb.1:
	mov	x20, x0
	ldr	x21, [x0, #8]
	cbz	x21, LBB0_7
; %bb.2:
	ldr	x19, [x20]
	cbz	x19, LBB0_7
; %bb.3:
Lloh0:
	adrp	x25, _SCF_HALTED@GOTPAGE
Lloh1:
	ldr	x25, [x25, _SCF_HALTED@GOTPAGEOFF]
	ldp	w8, w22, [x19]
	ldr	w9, [x25]
	and	w23, w9, w8
Lloh2:
	adrp	x24, _SEND_CTXT_HALT_TIMEOUT@GOTPAGE
Lloh3:
	ldr	x24, [x24, _SEND_CTXT_HALT_TIMEOUT@GOTPAGEOFF]
	ldr	w0, [x24]
	bl	_msecs_to_jiffies
	mov	x2, x0
	mov	x0, x22
	mov	x1, x23
	bl	_wait_event_interruptible_timeout
	ldr	w8, [x19]
	ldr	w9, [x25]
	tst	w9, w8
	b.eq	LBB0_6
; %bb.4:
Lloh4:
	adrp	x9, _SCF_FROZEN@GOTPAGE
Lloh5:
	ldr	x9, [x9, _SCF_FROZEN@GOTPAGEOFF]
Lloh6:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_10
; %bb.5:
	ldp	w0, w22, [x21]
	bl	_READ_ONCE
Lloh7:
	adrp	x25, _HFI1_FROZEN@GOTPAGE
Lloh8:
	ldr	x25, [x25, _HFI1_FROZEN@GOTPAGEOFF]
	ldr	w8, [x25]
	tst	w8, w0
	cset	w23, eq
	ldr	w0, [x24]
	bl	_msecs_to_jiffies
	mov	x2, x0
	mov	x0, x22
	mov	x1, x23
	bl	_wait_event_interruptible_timeout
	ldr	w8, [x21]
	ldr	w9, [x25]
	tst	w9, w8
	b.eq	LBB0_12
LBB0_6:
Lloh9:
	adrp	x8, _ENOLCK@GOTPAGE
Lloh10:
	ldr	x8, [x8, _ENOLCK@GOTPAGEOFF]
	b	LBB0_8
LBB0_7:
Lloh11:
	adrp	x8, _EINVAL@GOTPAGE
Lloh12:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_8:
	ldr	w8, [x8]
	neg	w22, w8
LBB0_9:
	mov	x0, x22
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
LBB0_10:
	mov	x0, x19
	bl	_sc_restart
	mov	x22, x0
	cbnz	w22, LBB0_9
LBB0_11:
	mov	x0, x19
	bl	_sc_return_credits
	b	LBB0_9
LBB0_12:
Lloh13:
	adrp	x9, _HFI1_FORCED_FREEZE@GOTPAGE
Lloh14:
	ldr	x9, [x9, _HFI1_FORCED_FREEZE@GOTPAGEOFF]
Lloh15:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_14
; %bb.13:
Lloh16:
	adrp	x8, _ENODEV@GOTPAGE
Lloh17:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
	b	LBB0_8
LBB0_14:
	mov	x0, x19
	bl	_sc_disable
	mov	x0, x19
	bl	_sc_enable
	mov	x22, x0
Lloh18:
	adrp	x8, _HFI1_RCVCTRL_CTXT_ENB@GOTPAGE
Lloh19:
	ldr	x8, [x8, _HFI1_RCVCTRL_CTXT_ENB@GOTPAGEOFF]
Lloh20:
	ldr	w1, [x8]
	mov	x0, x21
	mov	x2, x20
	bl	_hfi1_rcvctrl
	cbnz	w22, LBB0_9
	b	LBB0_11
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_SCF_HALTED,4,2                 ; @SCF_HALTED
	.comm	_SEND_CTXT_HALT_TIMEOUT,4,2     ; @SEND_CTXT_HALT_TIMEOUT
	.comm	_ENOLCK,4,2                     ; @ENOLCK
	.comm	_SCF_FROZEN,4,2                 ; @SCF_FROZEN
	.comm	_HFI1_FROZEN,4,2                ; @HFI1_FROZEN
	.comm	_HFI1_FORCED_FREEZE,4,2         ; @HFI1_FORCED_FREEZE
	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_HFI1_RCVCTRL_CTXT_ENB,4,2      ; @HFI1_RCVCTRL_CTXT_ENB
	.no_dead_strip	_ctxt_reset
.subsections_via_symbols
