	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_Sys_ConsoleInput               ## -- Begin function Sys_ConsoleInput
	.p2align	4, 0x90
_Sys_ConsoleInput:                      ## @Sys_ConsoleInput
	.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
	subq	$40, %rsp
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	_ttycon@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	testq	%rax, %rax
	je	LBB0_8
## %bb.1:
	cmpq	$0, (%rax)
	je	LBB0_8
## %bb.2:
	xorl	%ebx, %ebx
	leaq	-48(%rbp), %rsi
	xorl	%edi, %edi
	movl	$1, %edx
	callq	_read
	cmpl	$-1, %eax
	je	LBB0_44
## %bb.3:
	movb	-48(%rbp), %al
	movq	_tty_erase@GOTPCREL(%rip), %rbx
	cmpb	(%rbx), %al
	je	LBB0_6
## %bb.4:
	cmpb	$127, %al
	je	LBB0_6
## %bb.5:
	cmpb	$8, %al
	jne	LBB0_17
LBB0_6:
	movq	_tty_con@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rax
	testq	%rax, %rax
	je	LBB0_16
## %bb.7:
	leaq	-1(%rax), %rdx
	movq	%rdx, (%rcx)
	movq	8(%rcx), %rcx
	movb	$0, -1(%rcx,%rax)
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_tty_Back
	jmp	LBB0_44
LBB0_8:
	movq	_com_dedicated@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	xorl	%ebx, %ebx
	testq	%rax, %rax
	je	LBB0_44
## %bb.9:
	cmpl	$0, (%rax)
	je	LBB0_44
## %bb.10:
	movq	_stdin_active@GOTPCREL(%rip), %r15
	cmpq	$0, (%r15)
	je	LBB0_44
## %bb.11:
	leaq	-52(%rbp), %r14
	movq	%r14, %rdi
	callq	_FD_ZERO
	xorl	%ebx, %ebx
	xorl	%edi, %edi
	movq	%r14, %rsi
	callq	_FD_SET
	xorps	%xmm0, %xmm0
	movaps	%xmm0, -48(%rbp)
	leaq	-48(%rbp), %r8
	movl	$1, %edi
	movq	%r14, %rsi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	callq	_select
	cmpl	$-1, %eax
	je	LBB0_44
## %bb.12:
	xorl	%ebx, %ebx
	leaq	-52(%rbp), %rsi
	xorl	%edi, %edi
	callq	_FD_ISSET
	testl	%eax, %eax
	je	LBB0_44
## %bb.13:
	leaq	_Sys_ConsoleInput.text(%rip), %rbx
	xorl	%edi, %edi
	movq	%rbx, %rsi
	movl	$256, %edx                      ## imm = 0x100
	callq	_read
                                        ## kill: def $eax killed $eax def $rax
	testl	%eax, %eax
	je	LBB0_22
## %bb.14:
	jle	LBB0_16
## %bb.15:
	decl	%eax
	movb	$0, (%rax,%rbx)
	jmp	LBB0_44
LBB0_17:
	testb	%al, %al
	je	LBB0_23
## %bb.18:
	cmpb	$31, %al
	jg	LBB0_23
## %bb.19:
	cmpb	$9, %al
	je	LBB0_25
## %bb.20:
	cmpb	$10, %al
	jne	LBB0_32
## %bb.21:
	movq	_tty_con@GOTPCREL(%rip), %r14
	movq	%r14, %rdi
	callq	_Hist_Add
	movq	8(%r14), %rsi
	leaq	_Sys_ConsoleInput.text(%rip), %rbx
	movq	%rbx, %rdi
	callq	_strcpy
	movq	%r14, %rdi
	callq	_Field_Clear
	movb	$10, -48(%rbp)
	leaq	-48(%rbp), %rsi
	movl	$1, %edi
	movl	$1, %edx
	callq	_write
	jmp	LBB0_44
LBB0_22:
	movq	_qfalse@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, (%r15)
	xorl	%ebx, %ebx
	jmp	LBB0_44
LBB0_23:
	movq	_tty_con@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rdx
	movq	8(%rcx), %rsi
	movb	%al, (%rsi,%rdx)
	incq	(%rcx)
	leaq	-48(%rbp), %rsi
	movl	$1, %edi
	movl	$1, %edx
	callq	_write
LBB0_16:
	xorl	%ebx, %ebx
LBB0_44:
	movq	%rbx, %rax
	addq	$40, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_25:
	xorl	%eax, %eax
	callq	_tty_Hide
	movq	_tty_con@GOTPCREL(%rip), %rbx
	movq	%rbx, %rdi
	callq	_Field_CompleteCommand
	movq	8(%rbx), %r14
	movq	%r14, %rdi
	callq	_strlen
	movq	%rax, (%rbx)
	testq	%rax, %rax
	je	LBB0_31
## %bb.26:
	cmpb	$92, (%r14)
	jne	LBB0_31
## %bb.27:
	movb	1(%r14), %al
	movb	%al, (%r14)
	movq	(%rbx), %rax
	testq	%rax, %rax
	je	LBB0_30
## %bb.28:
	xorl	%ecx, %ecx
LBB0_29:                                ## =>This Inner Loop Header: Depth=1
	movq	8(%rbx), %rax
	movzbl	2(%rax,%rcx), %edx
	movb	%dl, 1(%rax,%rcx)
	movq	(%rbx), %rax
	incq	%rcx
	cmpq	%rcx, %rax
	ja	LBB0_29
LBB0_30:
	decq	%rax
	movq	%rax, (%rbx)
LBB0_31:
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_tty_Show
	jmp	LBB0_44
LBB0_32:
	leaq	-48(%rbp), %rsi
	xorl	%edi, %edi
	movl	$1, %edx
	callq	_read
	cmpl	$-1, %eax
	je	LBB0_41
## %bb.33:
	movb	-48(%rbp), %al
	cmpb	$91, %al
	je	LBB0_35
## %bb.34:
	cmpb	$79, %al
	jne	LBB0_41
LBB0_35:
	leaq	-48(%rbp), %rsi
	xorl	%edi, %edi
	movl	$1, %edx
	callq	_read
	cmpl	$-1, %eax
	je	LBB0_41
## %bb.36:
	movsbl	-48(%rbp), %eax
	leal	-67(%rax), %ecx
	cmpl	$2, %ecx
	jb	LBB0_16
## %bb.37:
	cmpl	$66, %eax
	je	LBB0_46
## %bb.38:
	cmpl	$65, %eax
	jne	LBB0_41
## %bb.39:
	xorl	%eax, %eax
	callq	_Hist_Prev
	testq	%rax, %rax
	je	LBB0_42
## %bb.40:
	movq	%rax, %rbx
	xorl	%eax, %eax
	callq	_tty_Hide
	movups	(%rbx), %xmm0
	movq	_tty_con@GOTPCREL(%rip), %rax
	movups	%xmm0, (%rax)
	xorl	%eax, %eax
	callq	_tty_Show
	jmp	LBB0_42
LBB0_41:
	movsbl	-48(%rbp), %esi
	movsbl	(%rbx), %edx
	leaq	L_.str(%rip), %rdi
	callq	_Com_DPrintf
LBB0_42:
	xorl	%ebx, %ebx
LBB0_43:
	xorl	%eax, %eax
	callq	_tty_FlushIn
	jmp	LBB0_44
LBB0_46:
	xorl	%eax, %eax
	callq	_Hist_Next
	movq	%rax, %rbx
	xorl	%eax, %eax
	callq	_tty_Hide
	testq	%rbx, %rbx
	je	LBB0_48
## %bb.47:
	movups	(%rbx), %xmm0
	movq	_tty_con@GOTPCREL(%rip), %rax
	movups	%xmm0, (%rax)
	jmp	LBB0_49
LBB0_48:
	movq	_tty_con@GOTPCREL(%rip), %rdi
	callq	_Field_Clear
LBB0_49:
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_tty_Show
	jmp	LBB0_43
	.cfi_endproc
                                        ## -- End function
.zerofill __DATA,__bss,_Sys_ConsoleInput.text,256,4 ## @Sys_ConsoleInput.text
	.comm	_ttycon,8,3                     ## @ttycon
	.comm	_tty_erase,1,0                  ## @tty_erase
	.comm	_tty_con,16,3                   ## @tty_con
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"droping ISCTL sequence: %d, tty_erase: %d\n"

	.comm	_com_dedicated,8,3              ## @com_dedicated
	.comm	_stdin_active,8,3               ## @stdin_active
	.comm	_qfalse,8,3                     ## @qfalse
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_Sys_ConsoleInput               ; -- Begin function Sys_ConsoleInput
	.p2align	2
_Sys_ConsoleInput:                      ; @Sys_ConsoleInput
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
Lloh0:
	adrp	x8, _ttycon@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ttycon@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cbz	x8, LBB0_8
; %bb.1:
	ldr	x8, [x8]
	cbz	x8, LBB0_8
; %bb.2:
	add	x1, sp, #8
	mov	w0, #0
	mov	w2, #1
	bl	_read
	cmn	w0, #1
	b.eq	LBB0_40
; %bb.3:
	ldrb	w8, [sp, #8]
Lloh3:
	adrp	x19, _tty_erase@GOTPAGE
Lloh4:
	ldr	x19, [x19, _tty_erase@GOTPAGEOFF]
	ldrb	w9, [x19]
	cmp	w8, w9
	b.eq	LBB0_6
; %bb.4:
	cmp	w8, #127
	b.eq	LBB0_6
; %bb.5:
	cmp	w8, #8
	b.ne	LBB0_15
LBB0_6:
Lloh5:
	adrp	x8, _tty_con@GOTPAGE
Lloh6:
	ldr	x8, [x8, _tty_con@GOTPAGEOFF]
	ldr	x9, [x8]
	cbz	x9, LBB0_40
; %bb.7:
	sub	x9, x9, #1
	str	x9, [x8]
	ldr	x8, [x8, #8]
	strb	wzr, [x8, x9]
	bl	_tty_Back
	b	LBB0_40
LBB0_8:
Lloh7:
	adrp	x8, _com_dedicated@GOTPAGE
Lloh8:
	ldr	x8, [x8, _com_dedicated@GOTPAGEOFF]
Lloh9:
	ldr	x8, [x8]
	cbz	x8, LBB0_40
; %bb.9:
	ldr	w8, [x8]
Lloh10:
	adrp	x20, _stdin_active@GOTPAGE
Lloh11:
	ldr	x20, [x20, _stdin_active@GOTPAGEOFF]
	ldr	x9, [x20]
	cmp	w8, #0
	ccmp	x9, #0, #4, ne
	b.eq	LBB0_40
; %bb.10:
	sub	x0, x29, #20
	bl	_FD_ZERO
	sub	x1, x29, #20
	mov	w0, #0
	bl	_FD_SET
	stp	xzr, xzr, [sp, #8]
	sub	x1, x29, #20
	add	x4, sp, #8
	mov	w0, #1
	mov	x2, #0
	mov	x3, #0
	bl	_select
	cmn	w0, #1
	b.eq	LBB0_40
; %bb.11:
	sub	x1, x29, #20
	mov	w0, #0
	bl	_FD_ISSET
	cbz	w0, LBB0_40
; %bb.12:
Lloh12:
	adrp	x19, _Sys_ConsoleInput.text@PAGE
Lloh13:
	add	x19, x19, _Sys_ConsoleInput.text@PAGEOFF
	mov	w0, #0
	mov	x1, x19
	mov	w2, #256
	bl	_read
	cbz	w0, LBB0_20
; %bb.13:
	subs	w8, w0, #1
	b.lt	LBB0_40
; %bb.14:
	strb	wzr, [x19, w8, uxtw]
	b	LBB0_41
LBB0_15:
	cbz	w8, LBB0_21
; %bb.16:
	sxtb	w9, w8
	cmp	w9, #31
	b.gt	LBB0_21
; %bb.17:
	cmp	w8, #9
	b.eq	LBB0_22
; %bb.18:
	cmp	w8, #10
	b.ne	LBB0_29
; %bb.19:
Lloh14:
	adrp	x20, _tty_con@GOTPAGE
Lloh15:
	ldr	x20, [x20, _tty_con@GOTPAGEOFF]
	mov	x0, x20
	bl	_Hist_Add
	ldr	x1, [x20, #8]
Lloh16:
	adrp	x19, _Sys_ConsoleInput.text@PAGE
Lloh17:
	add	x19, x19, _Sys_ConsoleInput.text@PAGEOFF
	mov	x0, x19
	bl	_strcpy
	mov	x0, x20
	bl	_Field_Clear
	mov	w8, #10
	strb	w8, [sp, #8]
	add	x1, sp, #8
	mov	w0, #1
	mov	w2, #1
	bl	_write
	b	LBB0_41
LBB0_20:
	mov	x19, #0
Lloh18:
	adrp	x8, _qfalse@GOTPAGE
Lloh19:
	ldr	x8, [x8, _qfalse@GOTPAGEOFF]
Lloh20:
	ldr	x8, [x8]
	str	x8, [x20]
	b	LBB0_41
LBB0_21:
Lloh21:
	adrp	x9, _tty_con@GOTPAGE
Lloh22:
	ldr	x9, [x9, _tty_con@GOTPAGEOFF]
	ldp	x11, x10, [x9]
	strb	w8, [x10, x11]
	ldr	x8, [x9]
	add	x8, x8, #1
	str	x8, [x9]
	add	x1, sp, #8
	mov	w0, #1
	mov	w2, #1
	bl	_write
	b	LBB0_40
LBB0_22:
	bl	_tty_Hide
Lloh23:
	adrp	x19, _tty_con@GOTPAGE
Lloh24:
	ldr	x19, [x19, _tty_con@GOTPAGEOFF]
	mov	x0, x19
	bl	_Field_CompleteCommand
	ldr	x20, [x19, #8]
	mov	x0, x20
	bl	_strlen
	str	x0, [x19]
	cbz	x0, LBB0_28
; %bb.23:
	ldrb	w8, [x20]
	cmp	w8, #92
	b.ne	LBB0_28
; %bb.24:
	ldrb	w8, [x20, #1]
	strb	w8, [x20]
	ldr	x8, [x19]
	cbz	x8, LBB0_27
; %bb.25:
	mov	x9, #0
LBB0_26:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19, #8]
	add	x8, x8, x9
	ldrb	w10, [x8, #2]
	strb	w10, [x8, #1]
	ldr	x8, [x19]
	add	x9, x9, #1
	cmp	x8, x9
	b.hi	LBB0_26
LBB0_27:
	sub	x8, x8, #1
	str	x8, [x19]
LBB0_28:
	bl	_tty_Show
	b	LBB0_40
LBB0_29:
	add	x1, sp, #8
	mov	w0, #0
	mov	w2, #1
	bl	_read
	cmn	w0, #1
	b.eq	LBB0_38
; %bb.30:
	ldrb	w8, [sp, #8]
	cmp	w8, #91
	b.eq	LBB0_32
; %bb.31:
	cmp	w8, #79
	b.ne	LBB0_38
LBB0_32:
	add	x1, sp, #8
	mov	w0, #0
	mov	w2, #1
	bl	_read
	cmn	w0, #1
	b.eq	LBB0_38
; %bb.33:
	ldrsb	w8, [sp, #8]
	sub	w9, w8, #67
	cmp	w9, #2
	b.lo	LBB0_40
; %bb.34:
	cmp	w8, #66
	b.eq	LBB0_42
; %bb.35:
	cmp	w8, #65
	b.ne	LBB0_38
; %bb.36:
	bl	_Hist_Prev
	cbz	x0, LBB0_39
; %bb.37:
	mov	x19, x0
	bl	_tty_Hide
	b	LBB0_43
LBB0_38:
	ldrsb	w1, [sp, #8]
	ldrsb	w2, [x19]
Lloh25:
	adrp	x0, l_.str@PAGE
Lloh26:
	add	x0, x0, l_.str@PAGEOFF
	bl	_Com_DPrintf
LBB0_39:
	bl	_tty_FlushIn
LBB0_40:
	mov	x19, #0
LBB0_41:
	mov	x0, x19
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
LBB0_42:
	bl	_Hist_Next
	mov	x19, x0
	bl	_tty_Hide
	cbz	x19, LBB0_44
LBB0_43:
	ldr	q0, [x19]
Lloh27:
	adrp	x8, _tty_con@GOTPAGE
Lloh28:
	ldr	x8, [x8, _tty_con@GOTPAGEOFF]
Lloh29:
	str	q0, [x8]
	b	LBB0_45
LBB0_44:
Lloh30:
	adrp	x0, _tty_con@GOTPAGE
Lloh31:
	ldr	x0, [x0, _tty_con@GOTPAGEOFF]
	bl	_Field_Clear
LBB0_45:
	bl	_tty_Show
	b	LBB0_39
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpLdrGot	Lloh23, Lloh24
	.loh AdrpAdd	Lloh25, Lloh26
	.loh AdrpLdrGotStr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGot	Lloh30, Lloh31
	.cfi_endproc
                                        ; -- End function
.zerofill __DATA,__bss,_Sys_ConsoleInput.text,256,0 ; @Sys_ConsoleInput.text
	.comm	_ttycon,8,3                     ; @ttycon
	.comm	_tty_erase,1,0                  ; @tty_erase
	.comm	_tty_con,16,3                   ; @tty_con
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"droping ISCTL sequence: %d, tty_erase: %d\n"

	.comm	_com_dedicated,8,3              ; @com_dedicated
	.comm	_stdin_active,8,3               ; @stdin_active
	.comm	_qfalse,8,3                     ; @qfalse
.subsections_via_symbols
