	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_vt_move_to_console             ## -- Begin function vt_move_to_console
	.p2align	4, 0x90
_vt_move_to_console:                    ## @vt_move_to_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	%r15
	pushq	%r14
	pushq	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %ebx
	movl	%edi, %r14d
	xorl	%r15d, %r15d
	xorl	%eax, %eax
	callq	_acquire_console_sem
	movq	_disable_vt_switch@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_2
## %bb.1:
	xorl	%eax, %eax
	callq	_release_console_sem
	jmp	LBB0_10
LBB0_2:
	movq	_fg_console@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	testl	%ebx, %ebx
	je	LBB0_5
## %bb.3:
	movl	%r14d, %edi
	callq	_vc_allocate
	testq	%rax, %rax
	je	LBB0_5
## %bb.4:
	xorl	%r15d, %r15d
	xorl	%eax, %eax
	callq	_release_console_sem
	movq	_ENOSPC@GOTPCREL(%rip), %rax
	jmp	LBB0_9
LBB0_5:
	movl	%r14d, %edi
	callq	_set_console
	movq	%rax, %r12
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_release_console_sem
	testq	%r12, %r12
	je	LBB0_7
## %bb.6:
	movq	_EIO@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
	movl	%ebx, %r15d
	jmp	LBB0_10
LBB0_7:
	incl	%r14d
	movl	%r14d, %edi
	callq	_vt_waitactive
	testq	%rax, %rax
	je	LBB0_10
## %bb.8:
	leaq	L_.str(%rip), %rdi
	callq	_pr_debug
	movq	_EINTR@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
LBB0_9:
	subl	(%rax), %r15d
LBB0_10:
	movl	%r15d, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_disable_vt_switch,8,3          ## @disable_vt_switch
	.comm	_fg_console,4,2                 ## @fg_console
	.comm	_ENOSPC,4,2                     ## @ENOSPC
	.comm	_EIO,4,2                        ## @EIO
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Suspend: Can't switch VCs."

	.comm	_EINTR,4,2                      ## @EINTR
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_vt_move_to_console             ; -- Begin function vt_move_to_console
	.p2align	2
_vt_move_to_console:                    ; @vt_move_to_console
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x21, x1
	mov	x20, x0
	bl	_acquire_console_sem
Lloh0:
	adrp	x8, _disable_vt_switch@GOTPAGE
Lloh1:
	ldr	x8, [x8, _disable_vt_switch@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cbz	x8, LBB0_2
; %bb.1:
	bl	_release_console_sem
	mov	w19, #0
	b	LBB0_10
LBB0_2:
Lloh3:
	adrp	x8, _fg_console@GOTPAGE
Lloh4:
	ldr	x8, [x8, _fg_console@GOTPAGEOFF]
Lloh5:
	ldr	w19, [x8]
	cbz	w21, LBB0_5
; %bb.3:
	mov	x0, x20
	bl	_vc_allocate
	cbz	x0, LBB0_5
; %bb.4:
	bl	_release_console_sem
Lloh6:
	adrp	x8, _ENOSPC@GOTPAGE
Lloh7:
	ldr	x8, [x8, _ENOSPC@GOTPAGEOFF]
	b	LBB0_9
LBB0_5:
	mov	x0, x20
	bl	_set_console
	mov	x21, x0
	bl	_release_console_sem
	cbz	x21, LBB0_7
; %bb.6:
Lloh8:
	adrp	x8, _EIO@GOTPAGE
Lloh9:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
	b	LBB0_9
LBB0_7:
	add	w0, w20, #1
	bl	_vt_waitactive
	cbz	x0, LBB0_10
; %bb.8:
Lloh10:
	adrp	x0, l_.str@PAGE
Lloh11:
	add	x0, x0, l_.str@PAGEOFF
	bl	_pr_debug
Lloh12:
	adrp	x8, _EINTR@GOTPAGE
Lloh13:
	ldr	x8, [x8, _EINTR@GOTPAGEOFF]
LBB0_9:
	ldr	w8, [x8]
	neg	w19, w8
LBB0_10:
	mov	x0, x19
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpAdd	Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_disable_vt_switch,8,3          ; @disable_vt_switch
	.comm	_fg_console,4,2                 ; @fg_console
	.comm	_ENOSPC,4,2                     ; @ENOSPC
	.comm	_EIO,4,2                        ; @EIO
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Suspend: Can't switch VCs."

	.comm	_EINTR,4,2                      ; @EINTR
.subsections_via_symbols
