	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_VGLKeyboardInit                ## -- Begin function VGLKeyboardInit
	.p2align	4, 0x90
_VGLKeyboardInit:                       ## @VGLKeyboardInit
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edi, %r15d
	movq	_KDGKBMODE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_VGLKeyboardMode@GOTPCREL(%rip), %rdx
	xorl	%edi, %edi
	callq	_ioctl
	movq	_VGLKeyboardTty@GOTPCREL(%rip), %rbx
	xorl	%edi, %edi
	movq	%rbx, %rsi
	callq	_tcgetattr
	movups	(%rbx), %xmm0
	movups	%xmm0, _VGLKeyboardInit.term(%rip)
	movq	16(%rbx), %rax
	movq	%rax, _VGLKeyboardInit.term+16(%rip)
	leaq	_VGLKeyboardInit.term(%rip), %r14
	movq	%r14, %rdi
	callq	_cfmakeraw
	movq	_IGNPAR@GOTPCREL(%rip), %rax
	movq	_IGNBRK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	movq	_OPOST@GOTPCREL(%rip), %rax
	movq	_ONLCR@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	orl	(%rax), %edx
	movl	%ecx, _VGLKeyboardInit.term(%rip)
	movl	%edx, _VGLKeyboardInit.term+4(%rip)
	movq	_CREAD@GOTPCREL(%rip), %rax
	movq	_CS8@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	movq	_ICANON@GOTPCREL(%rip), %rax
	movq	_ECHO@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	orl	(%rax), %edx
	movl	%ecx, _VGLKeyboardInit.term+8(%rip)
	movq	_ISIG@GOTPCREL(%rip), %rax
	orl	(%rax), %edx
	notl	%edx
	andl	%edx, _VGLKeyboardInit.term+12(%rip)
	movq	_VGLKeyboardInit.term+16(%rip), %rax
	movq	_VTIME@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	$0, (%rax,%rcx,8)
	movq	_VMIN@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	$0, (%rax,%rcx,8)
	movq	%r14, %rdi
	movl	$9600, %esi                     ## imm = 0x2580
	callq	_cfsetispeed
	movq	%r14, %rdi
	movl	$9600, %esi                     ## imm = 0x2580
	callq	_cfsetospeed
	movq	_TCSANOW@GOTPCREL(%rip), %rax
	movq	_TCSAFLUSH@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	orl	(%rax), %esi
	xorl	%edi, %edi
	movq	%r14, %rdx
	callq	_tcsetattr
	addl	$-128, %r15d
	cmpl	$2, %r15d
	ja	LBB0_2
## %bb.1:
	movslq	%r15d, %rax
	leaq	l_switch.table.VGLKeyboardInit(%rip), %rcx
	movq	(%rcx,%rax,8), %rax
	movq	_KDSKBMODE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movq	(%rax), %rdx
	xorl	%edi, %edi
	callq	_ioctl
LBB0_2:
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
.zerofill __DATA,__bss,_VGLKeyboardInit.term,24,3 ## @VGLKeyboardInit.term
	.comm	_KDGKBMODE,4,2                  ## @KDGKBMODE
	.comm	_VGLKeyboardMode,4,2            ## @VGLKeyboardMode
	.comm	_VGLKeyboardTty,24,3            ## @VGLKeyboardTty
	.comm	_IGNPAR,4,2                     ## @IGNPAR
	.comm	_IGNBRK,4,2                     ## @IGNBRK
	.comm	_OPOST,4,2                      ## @OPOST
	.comm	_ONLCR,4,2                      ## @ONLCR
	.comm	_CREAD,4,2                      ## @CREAD
	.comm	_CS8,4,2                        ## @CS8
	.comm	_ICANON,4,2                     ## @ICANON
	.comm	_ECHO,4,2                       ## @ECHO
	.comm	_ISIG,4,2                       ## @ISIG
	.comm	_VTIME,8,3                      ## @VTIME
	.comm	_VMIN,8,3                       ## @VMIN
	.comm	_TCSANOW,4,2                    ## @TCSANOW
	.comm	_TCSAFLUSH,4,2                  ## @TCSAFLUSH
	.comm	_KDSKBMODE,4,2                  ## @KDSKBMODE
	.comm	_K_RAW,8,3                      ## @K_RAW
	.comm	_K_CODE,8,3                     ## @K_CODE
	.comm	_K_XLATE,8,3                    ## @K_XLATE
	.section	__DATA,__const
	.p2align	3                               ## @switch.table.VGLKeyboardInit
l_switch.table.VGLKeyboardInit:
	.quad	_K_XLATE
	.quad	_K_RAW
	.quad	_K_CODE

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_VGLKeyboardInit                ; -- Begin function VGLKeyboardInit
	.p2align	2
_VGLKeyboardInit:                       ; @VGLKeyboardInit
	.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	x19, x0
Lloh0:
	adrp	x8, _KDGKBMODE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _KDGKBMODE@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
Lloh3:
	adrp	x2, _VGLKeyboardMode@GOTPAGE
Lloh4:
	ldr	x2, [x2, _VGLKeyboardMode@GOTPAGEOFF]
	mov	w0, #0
	bl	_ioctl
Lloh5:
	adrp	x21, _VGLKeyboardTty@GOTPAGE
Lloh6:
	ldr	x21, [x21, _VGLKeyboardTty@GOTPAGEOFF]
	mov	w0, #0
	mov	x1, x21
	bl	_tcgetattr
	ldr	q0, [x21]
Lloh7:
	adrp	x20, _VGLKeyboardInit.term@PAGE
Lloh8:
	add	x20, x20, _VGLKeyboardInit.term@PAGEOFF
	str	q0, [x20]
	ldr	x8, [x21, #16]
	str	x8, [x20, #16]
	mov	x0, x20
	bl	_cfmakeraw
Lloh9:
	adrp	x8, _IGNPAR@GOTPAGE
Lloh10:
	ldr	x8, [x8, _IGNPAR@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
Lloh12:
	adrp	x9, _IGNBRK@GOTPAGE
Lloh13:
	ldr	x9, [x9, _IGNBRK@GOTPAGEOFF]
Lloh14:
	ldr	w9, [x9]
	orr	w8, w9, w8
Lloh15:
	adrp	x9, _OPOST@GOTPAGE
Lloh16:
	ldr	x9, [x9, _OPOST@GOTPAGEOFF]
Lloh17:
	ldr	w9, [x9]
Lloh18:
	adrp	x10, _ONLCR@GOTPAGE
Lloh19:
	ldr	x10, [x10, _ONLCR@GOTPAGEOFF]
Lloh20:
	ldr	w10, [x10]
	orr	w9, w10, w9
	stp	w8, w9, [x20]
Lloh21:
	adrp	x8, _CREAD@GOTPAGE
Lloh22:
	ldr	x8, [x8, _CREAD@GOTPAGEOFF]
Lloh23:
	ldr	w8, [x8]
Lloh24:
	adrp	x9, _CS8@GOTPAGE
Lloh25:
	ldr	x9, [x9, _CS8@GOTPAGEOFF]
Lloh26:
	ldr	w9, [x9]
	orr	w8, w9, w8
Lloh27:
	adrp	x9, _ICANON@GOTPAGE
Lloh28:
	ldr	x9, [x9, _ICANON@GOTPAGEOFF]
Lloh29:
	ldr	w9, [x9]
Lloh30:
	adrp	x10, _ECHO@GOTPAGE
Lloh31:
	ldr	x10, [x10, _ECHO@GOTPAGEOFF]
Lloh32:
	ldr	w10, [x10]
Lloh33:
	adrp	x11, _ISIG@GOTPAGE
Lloh34:
	ldr	x11, [x11, _ISIG@GOTPAGEOFF]
	orr	w9, w10, w9
Lloh35:
	ldr	w10, [x11]
	orr	w9, w9, w10
	ldr	w10, [x20, #12]
	bic	w9, w10, w9
	ldr	x10, [x20, #16]
Lloh36:
	adrp	x11, _VTIME@GOTPAGE
Lloh37:
	ldr	x11, [x11, _VTIME@GOTPAGEOFF]
Lloh38:
	ldr	x11, [x11]
	str	xzr, [x10, x11, lsl #3]
	stp	w8, w9, [x20, #8]
Lloh39:
	adrp	x8, _VMIN@GOTPAGE
Lloh40:
	ldr	x8, [x8, _VMIN@GOTPAGEOFF]
Lloh41:
	ldr	x8, [x8]
	str	xzr, [x10, x8, lsl #3]
	mov	x0, x20
	mov	w1, #9600
	bl	_cfsetispeed
	mov	x0, x20
	mov	w1, #9600
	bl	_cfsetospeed
Lloh42:
	adrp	x8, _TCSANOW@GOTPAGE
Lloh43:
	ldr	x8, [x8, _TCSANOW@GOTPAGEOFF]
Lloh44:
	ldr	w8, [x8]
Lloh45:
	adrp	x9, _TCSAFLUSH@GOTPAGE
Lloh46:
	ldr	x9, [x9, _TCSAFLUSH@GOTPAGEOFF]
Lloh47:
	ldr	w9, [x9]
	orr	w1, w9, w8
	mov	w0, #0
	mov	x2, x20
	bl	_tcsetattr
	sub	w8, w19, #128
	cmp	w8, #2
	b.hi	LBB0_2
; %bb.1:
Lloh48:
	adrp	x9, l_switch.table.VGLKeyboardInit@PAGE
Lloh49:
	add	x9, x9, l_switch.table.VGLKeyboardInit@PAGEOFF
	ldr	x8, [x9, w8, sxtw #3]
Lloh50:
	adrp	x9, _KDSKBMODE@GOTPAGE
Lloh51:
	ldr	x9, [x9, _KDSKBMODE@GOTPAGEOFF]
Lloh52:
	ldr	w1, [x9]
	ldr	x2, [x8]
	mov	w0, #0
	bl	_ioctl
LBB0_2:
	mov	w0, #0
	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	Lloh45, Lloh46, Lloh47
	.loh AdrpLdrGotLdr	Lloh42, Lloh43, Lloh44
	.loh AdrpLdrGotLdr	Lloh39, Lloh40, Lloh41
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh38
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh50, Lloh51, Lloh52
	.loh AdrpAdd	Lloh48, Lloh49
	.cfi_endproc
                                        ; -- End function
.zerofill __DATA,__bss,_VGLKeyboardInit.term,24,3 ; @VGLKeyboardInit.term
	.comm	_KDGKBMODE,4,2                  ; @KDGKBMODE
	.comm	_VGLKeyboardMode,4,2            ; @VGLKeyboardMode
	.comm	_VGLKeyboardTty,24,3            ; @VGLKeyboardTty
	.comm	_IGNPAR,4,2                     ; @IGNPAR
	.comm	_IGNBRK,4,2                     ; @IGNBRK
	.comm	_OPOST,4,2                      ; @OPOST
	.comm	_ONLCR,4,2                      ; @ONLCR
	.comm	_CREAD,4,2                      ; @CREAD
	.comm	_CS8,4,2                        ; @CS8
	.comm	_ICANON,4,2                     ; @ICANON
	.comm	_ECHO,4,2                       ; @ECHO
	.comm	_ISIG,4,2                       ; @ISIG
	.comm	_VTIME,8,3                      ; @VTIME
	.comm	_VMIN,8,3                       ; @VMIN
	.comm	_TCSANOW,4,2                    ; @TCSANOW
	.comm	_TCSAFLUSH,4,2                  ; @TCSAFLUSH
	.comm	_KDSKBMODE,4,2                  ; @KDSKBMODE
	.comm	_K_RAW,8,3                      ; @K_RAW
	.comm	_K_CODE,8,3                     ; @K_CODE
	.comm	_K_XLATE,8,3                    ; @K_XLATE
	.section	__DATA,__const
	.p2align	3                               ; @switch.table.VGLKeyboardInit
l_switch.table.VGLKeyboardInit:
	.quad	_K_XLATE
	.quad	_K_RAW
	.quad	_K_CODE

.subsections_via_symbols
