	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_change_console                 ## -- Begin function change_console
	.p2align	4, 0x90
_change_console:                        ## @change_console
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	testq	%rdi, %rdi
	je	LBB0_7
## %bb.1:
	movq	%rdi, %rbx
	movq	(%rdi), %rax
	movq	_fg_console@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	%rcx, %rax
	je	LBB0_7
## %bb.2:
	movq	_vt_dont_switch@GOTPCREL(%rip), %rdx
	cmpq	$0, (%rdx)
	jne	LBB0_7
## %bb.3:
	movq	_vc_cons@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rdx
	movq	(%rdx,%rcx,8), %r14
	movq	24(%r14), %rcx
	movq	_VT_PROCESS@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rcx
	jne	LBB0_6
## %bb.4:
	movq	%rax, 8(%r14)
	movl	32(%r14), %esi
	movl	40(%r14), %edi
	movl	$1, %edx
	callq	_kill_pid
	testq	%rax, %rax
	je	LBB0_7
## %bb.5:
	movq	%r14, %rdi
	callq	_reset_vc
LBB0_6:
	movq	16(%r14), %rax
	movq	_KD_GRAPHICS@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_8
LBB0_7:
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
LBB0_8:
	movq	%rbx, %rdi
	popq	%rbx
	popq	%r14
	popq	%rbp
	jmp	_complete_change_console        ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_fg_console,8,3                 ## @fg_console
	.comm	_vt_dont_switch,8,3             ## @vt_dont_switch
	.comm	_vc_cons,8,3                    ## @vc_cons
	.comm	_VT_PROCESS,8,3                 ## @VT_PROCESS
	.comm	_KD_GRAPHICS,8,3                ## @KD_GRAPHICS
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_change_console                 ; -- Begin function change_console
	.p2align	2
_change_console:                        ; @change_console
	.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
	cbz	x0, LBB0_6
; %bb.1:
	mov	x19, x0
	ldr	x8, [x0]
Lloh0:
	adrp	x9, _fg_console@GOTPAGE
Lloh1:
	ldr	x9, [x9, _fg_console@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
Lloh3:
	adrp	x10, _vt_dont_switch@GOTPAGE
Lloh4:
	ldr	x10, [x10, _vt_dont_switch@GOTPAGEOFF]
Lloh5:
	ldr	x10, [x10]
	cmp	x8, x9
	ccmp	x10, #0, #0, ne
	b.ne	LBB0_6
; %bb.2:
Lloh6:
	adrp	x10, _vc_cons@GOTPAGE
Lloh7:
	ldr	x10, [x10, _vc_cons@GOTPAGEOFF]
Lloh8:
	ldr	x10, [x10]
	ldr	x20, [x10, x9, lsl #3]
	ldr	x9, [x20, #24]
Lloh9:
	adrp	x10, _VT_PROCESS@GOTPAGE
Lloh10:
	ldr	x10, [x10, _VT_PROCESS@GOTPAGEOFF]
Lloh11:
	ldr	x10, [x10]
	cmp	x9, x10
	b.ne	LBB0_5
; %bb.3:
	str	x8, [x20, #8]
	ldr	w0, [x20, #40]
	ldr	w1, [x20, #32]
	mov	w2, #1
	bl	_kill_pid
	cbz	x0, LBB0_6
; %bb.4:
	mov	x0, x20
	bl	_reset_vc
LBB0_5:
	ldr	x8, [x20, #16]
Lloh12:
	adrp	x9, _KD_GRAPHICS@GOTPAGE
Lloh13:
	ldr	x9, [x9, _KD_GRAPHICS@GOTPAGEOFF]
Lloh14:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_7
LBB0_6:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
LBB0_7:
	mov	x0, x19
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_complete_change_console
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_fg_console,8,3                 ; @fg_console
	.comm	_vt_dont_switch,8,3             ; @vt_dont_switch
	.comm	_vc_cons,8,3                    ; @vc_cons
	.comm	_VT_PROCESS,8,3                 ; @VT_PROCESS
	.comm	_KD_GRAPHICS,8,3                ; @KD_GRAPHICS
.subsections_via_symbols
