	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function readchar
_readchar:                              ## @readchar
	.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, %r14d
	movq	_e7000_desc@GOTPCREL(%rip), %r15
	.p2align	4, 0x90
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r15), %edi
	movl	%r14d, %esi
	callq	_serial_readchar
	cmpl	$127, %eax
	jg	LBB0_1
## %bb.2:
	movl	%eax, %ebx
	movq	_SERIAL_TIMEOUT@GOTPCREL(%rip), %rax
	cmpl	(%rax), %ebx
	jne	LBB0_5
## %bb.3:
	testl	%r14d, %r14d
	je	LBB0_11
## %bb.4:
	movq	_echo@GOTPCREL(%rip), %rax
	movq	$0, (%rax)
	leaq	L_.str(%rip), %rdi
	jmp	LBB0_7
LBB0_5:
	testl	%ebx, %ebx
	jns	LBB0_8
## %bb.6:
	leaq	L_.str.1(%rip), %rdi
LBB0_7:
	callq	_error
LBB0_8:
	movq	_remote_debug@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_10
## %bb.9:
	movl	%ebx, %edi
	callq	_putchar_unfiltered
	movq	_gdb_stdout@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_gdb_flush
LBB0_10:
	movl	%ebx, %edi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_normal                         ## TAILCALL
LBB0_11:
	movl	$-1, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_e7000_desc,4,2                 ## @e7000_desc
	.comm	_SERIAL_TIMEOUT,4,2             ## @SERIAL_TIMEOUT
	.comm	_echo,8,3                       ## @echo
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Timeout reading from remote system."

L_.str.1:                               ## @.str.1
	.asciz	"Serial communication error"

	.comm	_remote_debug,8,3               ## @remote_debug
	.comm	_gdb_stdout,4,2                 ## @gdb_stdout
	.no_dead_strip	_readchar
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function readchar
_readchar:                              ; @readchar
	.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	x20, x0
Lloh0:
	adrp	x21, _e7000_desc@GOTPAGE
Lloh1:
	ldr	x21, [x21, _e7000_desc@GOTPAGEOFF]
LBB0_1:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x21]
	mov	x1, x20
	bl	_serial_readchar
	cmp	w0, #127
	b.gt	LBB0_1
; %bb.2:
	mov	x19, x0
Lloh2:
	adrp	x8, _SERIAL_TIMEOUT@GOTPAGE
Lloh3:
	ldr	x8, [x8, _SERIAL_TIMEOUT@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	cmp	w0, w8
	b.ne	LBB0_5
; %bb.3:
	cbz	w20, LBB0_11
; %bb.4:
Lloh5:
	adrp	x8, _echo@GOTPAGE
Lloh6:
	ldr	x8, [x8, _echo@GOTPAGEOFF]
Lloh7:
	str	xzr, [x8]
Lloh8:
	adrp	x0, l_.str@PAGE
Lloh9:
	add	x0, x0, l_.str@PAGEOFF
	b	LBB0_7
LBB0_5:
	tbz	w19, #31, LBB0_8
; %bb.6:
Lloh10:
	adrp	x0, l_.str.1@PAGE
Lloh11:
	add	x0, x0, l_.str.1@PAGEOFF
LBB0_7:
	bl	_error
LBB0_8:
Lloh12:
	adrp	x8, _remote_debug@GOTPAGE
Lloh13:
	ldr	x8, [x8, _remote_debug@GOTPAGEOFF]
Lloh14:
	ldr	x8, [x8]
	cbz	x8, LBB0_10
; %bb.9:
	mov	x0, x19
	bl	_putchar_unfiltered
Lloh15:
	adrp	x8, _gdb_stdout@GOTPAGE
Lloh16:
	ldr	x8, [x8, _gdb_stdout@GOTPAGEOFF]
Lloh17:
	ldr	w0, [x8]
	bl	_gdb_flush
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
	b	_normal
LBB0_11:
	mov	w0, #-1
	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 AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotStr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_e7000_desc,4,2                 ; @e7000_desc
	.comm	_SERIAL_TIMEOUT,4,2             ; @SERIAL_TIMEOUT
	.comm	_echo,8,3                       ; @echo
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Timeout reading from remote system."

l_.str.1:                               ; @.str.1
	.asciz	"Serial communication error"

	.comm	_remote_debug,8,3               ; @remote_debug
	.comm	_gdb_stdout,4,2                 ; @gdb_stdout
	.no_dead_strip	_readchar
.subsections_via_symbols
