	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function set_console
_set_console:                           ## @set_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
	movq	%rdi, %rbx
	testq	%rdi, %rdi
	je	LBB0_2
## %bb.1:
	leaq	L_.str(%rip), %rsi
	movq	%rbx, %rdi
	callq	_strspn
	movq	%rax, %r14
	movq	%rbx, %rdi
	callq	_strlen
	cmpq	%rax, %r14
	je	LBB0_3
LBB0_2:
	xorl	%eax, %eax
	callq	_revert
	leaq	L_.str.1(%rip), %rsi
	movl	$1, %edi
	callq	_errx
LBB0_3:
	movq	%rbx, %rdi
	callq	_atoi
                                        ## kill: def $eax killed $eax def $rax
	leal	-17(%rax), %ecx
	cmpl	$-17, %ecx
	ja	LBB0_4
## %bb.6:
	xorl	%eax, %eax
	callq	_revert
	leaq	L_.str.2(%rip), %rsi
	movl	$1, %edi
	popq	%rbx
	popq	%r14
	popq	%rbp
	jmp	_errx                           ## TAILCALL
LBB0_4:
	movq	_VT_ACTIVATE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	xorl	%edi, %edi
	movl	%eax, %edx
	callq	_ioctl
	cmpl	$-1, %eax
	je	LBB0_7
## %bb.5:
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
LBB0_7:
	xorl	%eax, %eax
	callq	_revert
	leaq	L_.str.3(%rip), %rsi
	movl	$1, %edi
	popq	%rbx
	popq	%r14
	popq	%rbp
	jmp	_err                            ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"0123456789"

L_.str.1:                               ## @.str.1
	.asciz	"bad console number"

L_.str.2:                               ## @.str.2
	.asciz	"console number out of range"

	.comm	_VT_ACTIVATE,4,2                ## @VT_ACTIVATE
L_.str.3:                               ## @.str.3
	.asciz	"switching vty"

	.no_dead_strip	_set_console
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function set_console
_set_console:                           ; @set_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
	mov	x19, x0
	cbz	x0, LBB0_2
; %bb.1:
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_strspn
	mov	x20, x0
	mov	x0, x19
	bl	_strlen
	cmp	x20, x0
	b.eq	LBB0_3
LBB0_2:
	bl	_revert
Lloh2:
	adrp	x1, l_.str.1@PAGE
Lloh3:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	w0, #1
	bl	_errx
LBB0_3:
	mov	x0, x19
	bl	_atoi
	sub	w8, w0, #17
	cmn	w8, #17
	b.hi	LBB0_5
; %bb.4:
	bl	_revert
Lloh4:
	adrp	x1, l_.str.2@PAGE
Lloh5:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	w0, #1
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_errx
LBB0_5:
	mov	x2, x0
Lloh6:
	adrp	x8, _VT_ACTIVATE@GOTPAGE
Lloh7:
	ldr	x8, [x8, _VT_ACTIVATE@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	mov	w0, #0
	bl	_ioctl
	cmn	w0, #1
	b.eq	LBB0_7
; %bb.6:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
LBB0_7:
	bl	_revert
Lloh9:
	adrp	x1, l_.str.3@PAGE
Lloh10:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	w0, #1
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_err
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"0123456789"

l_.str.1:                               ; @.str.1
	.asciz	"bad console number"

l_.str.2:                               ; @.str.2
	.asciz	"console number out of range"

	.comm	_VT_ACTIVATE,4,2                ; @VT_ACTIVATE
l_.str.3:                               ; @.str.3
	.asciz	"switching vty"

	.no_dead_strip	_set_console
.subsections_via_symbols
