	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function dos_readchar
_dos_readchar:                          ## @dos_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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r14d
	movq	_ports@GOTPCREL(%rip), %rax
	movq	(%rdi), %rbx
	shlq	$2, %rbx
	addq	(%rax), %rbx
	xorl	%eax, %eax
	callq	_rawclock
	movq	%rax, %r15
	movq	_RAWHZ@GOTPCREL(%rip), %rax
	movslq	(%rax), %r12
	movq	%rbx, %rdi
	callq	_dos_getc
	testl	%eax, %eax
	jns	LBB0_6
## %bb.1:
	movslq	%r14d, %rax
	imulq	%rax, %r12
	addq	%r12, %r15
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_5:                                 ##   in Loop: Header=BB0_2 Depth=1
	movq	%rbx, %rdi
	callq	_dos_getc
	testl	%eax, %eax
	jns	LBB0_6
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	testl	%r14d, %r14d
	js	LBB0_5
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	xorl	%eax, %eax
	callq	_rawclock
	cmpq	%r15, %rax
	jl	LBB0_5
## %bb.4:
	movq	_SERIAL_TIMEOUT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
LBB0_6:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ports,8,3                      ## @ports
	.comm	_RAWHZ,4,2                      ## @RAWHZ
	.comm	_SERIAL_TIMEOUT,4,2             ## @SERIAL_TIMEOUT
	.no_dead_strip	_dos_readchar
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function dos_readchar
_dos_readchar:                          ; @dos_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	x19, x1
Lloh0:
	adrp	x8, _ports@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ports@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	ldr	x9, [x0]
	add	x20, x8, x9, lsl #2
	bl	_rawclock
	mov	x21, x0
Lloh3:
	adrp	x8, _RAWHZ@GOTPAGE
Lloh4:
	ldr	x8, [x8, _RAWHZ@GOTPAGEOFF]
Lloh5:
	ldrsw	x22, [x8]
	mov	x0, x20
	bl	_dos_getc
	tbz	w0, #31, LBB0_6
; %bb.1:
	sxtw	x8, w19
	madd	x21, x22, x8, x21
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	mov	x0, x20
	bl	_dos_getc
	tbz	w0, #31, LBB0_6
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	tbnz	w19, #31, LBB0_2
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	bl	_rawclock
	cmp	x0, x21
	b.lt	LBB0_2
; %bb.5:
Lloh6:
	adrp	x8, _SERIAL_TIMEOUT@GOTPAGE
Lloh7:
	ldr	x8, [x8, _SERIAL_TIMEOUT@GOTPAGEOFF]
Lloh8:
	ldr	w0, [x8]
LBB0_6:
	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	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_ports,8,3                      ; @ports
	.comm	_RAWHZ,4,2                      ; @RAWHZ
	.comm	_SERIAL_TIMEOUT,4,2             ; @SERIAL_TIMEOUT
	.no_dead_strip	_dos_readchar
.subsections_via_symbols
