	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function receive_chars_pio
_receive_chars_pio:                     ## @receive_chars_pio
	.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	%r13
	pushq	%r12
	pushq	%rbx
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r14d
	movq	%rdi, %r12
	xorl	%eax, %eax
	callq	_get_pio_buffer
	testq	%rax, %rax
	je	LBB0_11
## %bb.1:
	movq	%rax, %rbx
	xorl	%eax, %eax
	callq	_get_pio_buffer
	testq	%rax, %rax
	je	LBB0_2
## %bb.4:
	movb	(%r12), %cl
	shrb	$2, %cl
	andb	$7, %cl
	movb	%cl, -48(%rbp)                  ## 1-byte Spill
	leal	-1(%r14), %r13d
	movq	%r14, -64(%rbp)                 ## 8-byte Spill
	cmpl	$2, %r14d
	movq	%rax, %r15
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	jl	LBB0_7
## %bb.5:
	movzbl	-48(%rbp), %ebx                 ## 1-byte Folded Reload
	xorl	%r14d, %r14d
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movq	_UART_ESI_RX@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	32(%r12), %rdi
	callq	_inw
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	movq	(%rcx), %rcx
	movw	%ax, (%rcx,%r14,4)
	movq	_UART_ESI_RWS@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	movq	%r12, %rdi
	callq	_serial_in
	movq	(%r15), %rcx
	movl	%eax, %edx
	shrl	$3, %edx
	andl	%ebx, %edx
	movl	%edx, 4(%rcx,%r14,4)
	andl	%ebx, %eax
	movl	%eax, (%rcx,%r14,4)
	addq	$2, %r14
	cmpl	%r14d, %r13d
	jg	LBB0_6
LBB0_7:
	movq	-64(%rbp), %r14                 ## 8-byte Reload
	testb	$1, %r14b
	movq	%r12, %rbx
	je	LBB0_9
## %bb.8:
	movq	_UART_ESI_RX@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	movq	%rbx, %rdi
	callq	_serial_in
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	movq	(%rcx), %rcx
	movslq	%r13d, %r12
	movl	%eax, (%rcx,%r12,4)
	movq	_UART_ESI_RWS@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	movq	%rbx, %rdi
	callq	_serial_in
	shrl	$3, %eax
	movzbl	-48(%rbp), %ecx                 ## 1-byte Folded Reload
	andl	%eax, %ecx
	movq	(%r15), %rax
	movl	%ecx, (%rax,%r12,4)
LBB0_9:
	movq	24(%rbx), %rax
	testq	%rax, %rax
	je	LBB0_10
## %bb.12:
	movq	%rax, %r12
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	testl	%r14d, %r14d
	jle	LBB0_23
## %bb.13:
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movl	4(%rax), %r13d
	shrl	$2, %r13d
	andl	$7, %r13d
	movl	%r14d, %ecx
	xorl	%r14d, %r14d
	movq	%rcx, -64(%rbp)                 ## 8-byte Spill
	jmp	LBB0_14
LBB0_20:                                ##   in Loop: Header=BB0_14 Depth=1
	andl	$1, %ebx
	negl	%ebx
	movq	_TTY_PARITY@GOTPCREL(%rip), %rax
	andl	(%rax), %ebx
LBB0_21:                                ##   in Loop: Header=BB0_14 Depth=1
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rax
	movl	(%rax,%r14,4), %esi
	movq	%r12, %rdi
	movl	%ebx, %edx
	callq	_tty_insert_flip_char
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
LBB0_22:                                ##   in Loop: Header=BB0_14 Depth=1
	incq	%r14
	cmpq	%r14, %rcx
	je	LBB0_23
LBB0_14:                                ## =>This Inner Loop Header: Depth=1
	movq	(%r15), %rax
	movl	(%rax,%r14,4), %ebx
	testl	%ebx, %r13d
	jne	LBB0_22
## %bb.15:                              ##   in Loop: Header=BB0_14 Depth=1
	testb	$4, %bl
	jne	LBB0_16
## %bb.18:                              ##   in Loop: Header=BB0_14 Depth=1
	testb	$2, %bl
	je	LBB0_20
## %bb.19:                              ##   in Loop: Header=BB0_14 Depth=1
	movq	_TTY_FRAME@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	jmp	LBB0_21
LBB0_16:                                ##   in Loop: Header=BB0_14 Depth=1
	movq	_TTY_BREAK@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movq	_ASYNC_SAK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	testl	%eax, 16(%rcx)
	je	LBB0_21
## %bb.17:                              ##   in Loop: Header=BB0_14 Depth=1
	movq	%r12, %rdi
	callq	_do_SAK
	jmp	LBB0_21
LBB0_23:
	movq	%r12, %rdi
	callq	_tty_schedule_flip
	movq	_ESP_STAT_RX_TIMEOUT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	notl	%eax
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	andl	%eax, 8(%rcx)
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_release_pio_buffer
	movq	%r15, %rdi
	jmp	LBB0_3
LBB0_2:
	movq	%rbx, %rdi
LBB0_3:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_release_pio_buffer             ## TAILCALL
LBB0_10:
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_release_pio_buffer
	movq	%r15, %rdi
	callq	_release_pio_buffer
	movq	_ESP_STAT_RX_TIMEOUT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	notl	%eax
	andl	%eax, 8(%rbx)
LBB0_11:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_UART_ESI_RX,8,3                ## @UART_ESI_RX
	.comm	_UART_ESI_RWS,8,3               ## @UART_ESI_RWS
	.comm	_ESP_STAT_RX_TIMEOUT,4,2        ## @ESP_STAT_RX_TIMEOUT
	.comm	_TTY_BREAK,4,2                  ## @TTY_BREAK
	.comm	_ASYNC_SAK,4,2                  ## @ASYNC_SAK
	.comm	_TTY_FRAME,4,2                  ## @TTY_FRAME
	.comm	_TTY_PARITY,4,2                 ## @TTY_PARITY
	.no_dead_strip	_receive_chars_pio
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function receive_chars_pio
_receive_chars_pio:                     ; @receive_chars_pio
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x22, x1
	mov	x19, x0
	bl	_get_pio_buffer
	cbz	x0, LBB0_23
; %bb.1:
	mov	x20, x0
	bl	_get_pio_buffer
	cbz	x0, LBB0_20
; %bb.2:
	mov	x21, x0
	ldrb	w8, [x19]
	ubfx	w23, w8, #2, #3
	sub	w24, w22, #1
	cmp	w22, #2
	b.lt	LBB0_5
; %bb.3:
	mov	w25, #0
	mov	x26, #0
Lloh0:
	adrp	x27, _UART_ESI_RX@GOTPAGE
Lloh1:
	ldr	x27, [x27, _UART_ESI_RX@GOTPAGEOFF]
Lloh2:
	adrp	x28, _UART_ESI_RWS@GOTPAGE
Lloh3:
	ldr	x28, [x28, _UART_ESI_RWS@GOTPAGEOFF]
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19, #32]
	ldr	x9, [x27]
	add	x0, x9, x8
	bl	_inw
	ldr	x8, [x20]
	strh	w0, [x8, x26]
	ldr	x1, [x28]
	mov	x0, x19
	bl	_serial_in
	ldr	x8, [x21]
	add	x8, x8, x26
	and	w9, w23, w0, lsr #3
	and	w10, w0, w23
	stp	w10, w9, [x8]
	add	x26, x26, #8
	add	w25, w25, #2
	cmp	w24, w25
	b.gt	LBB0_4
LBB0_5:
	tbz	w22, #0, LBB0_7
; %bb.6:
Lloh4:
	adrp	x8, _UART_ESI_RX@GOTPAGE
Lloh5:
	ldr	x8, [x8, _UART_ESI_RX@GOTPAGEOFF]
Lloh6:
	ldr	x1, [x8]
	mov	x0, x19
	bl	_serial_in
	ldr	x8, [x20]
	sbfiz	x24, x24, #2, #32
	str	w0, [x8, x24]
Lloh7:
	adrp	x8, _UART_ESI_RWS@GOTPAGE
Lloh8:
	ldr	x8, [x8, _UART_ESI_RWS@GOTPAGEOFF]
Lloh9:
	ldr	x1, [x8]
	mov	x0, x19
	bl	_serial_in
	and	w8, w23, w0, lsr #3
	ldr	x9, [x21]
	str	w8, [x9, x24]
LBB0_7:
	ldr	x23, [x19, #24]
	cbz	x23, LBB0_22
; %bb.8:
	cmp	w22, #1
	b.lt	LBB0_19
; %bb.9:
	mov	x24, #0
	ldr	w8, [x19, #4]
	ubfx	w25, w8, #2, #3
	mov	w8, w22
	lsl	x26, x8, #2
Lloh10:
	adrp	x27, _TTY_BREAK@GOTPAGE
Lloh11:
	ldr	x27, [x27, _TTY_BREAK@GOTPAGEOFF]
Lloh12:
	adrp	x28, _ASYNC_SAK@GOTPAGE
Lloh13:
	ldr	x28, [x28, _ASYNC_SAK@GOTPAGEOFF]
	b	LBB0_13
LBB0_10:                                ;   in Loop: Header=BB0_13 Depth=1
	sbfx	w8, w8, #0, #1
Lloh14:
	adrp	x9, _TTY_PARITY@GOTPAGE
Lloh15:
	ldr	x9, [x9, _TTY_PARITY@GOTPAGEOFF]
Lloh16:
	ldr	w9, [x9]
	and	w22, w8, w9
LBB0_11:                                ;   in Loop: Header=BB0_13 Depth=1
	ldr	x8, [x20]
	ldr	w1, [x8, x24]
	mov	x0, x23
	mov	x2, x22
	bl	_tty_insert_flip_char
LBB0_12:                                ;   in Loop: Header=BB0_13 Depth=1
	add	x24, x24, #4
	cmp	x26, x24
	b.eq	LBB0_19
LBB0_13:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x21]
	ldr	w8, [x8, x24]
	tst	w25, w8
	b.ne	LBB0_12
; %bb.14:                               ;   in Loop: Header=BB0_13 Depth=1
	tbnz	w8, #2, LBB0_17
; %bb.15:                               ;   in Loop: Header=BB0_13 Depth=1
	tbz	w8, #1, LBB0_10
; %bb.16:                               ;   in Loop: Header=BB0_13 Depth=1
Lloh17:
	adrp	x8, _TTY_FRAME@GOTPAGE
Lloh18:
	ldr	x8, [x8, _TTY_FRAME@GOTPAGEOFF]
Lloh19:
	ldr	w22, [x8]
	b	LBB0_11
LBB0_17:                                ;   in Loop: Header=BB0_13 Depth=1
	ldr	w22, [x27]
	ldr	w8, [x19, #16]
	ldr	w9, [x28]
	tst	w9, w8
	b.eq	LBB0_11
; %bb.18:                               ;   in Loop: Header=BB0_13 Depth=1
	mov	x0, x23
	bl	_do_SAK
	b	LBB0_11
LBB0_19:
	mov	x0, x23
	bl	_tty_schedule_flip
Lloh20:
	adrp	x8, _ESP_STAT_RX_TIMEOUT@GOTPAGE
Lloh21:
	ldr	x8, [x8, _ESP_STAT_RX_TIMEOUT@GOTPAGEOFF]
Lloh22:
	ldr	w8, [x8]
	ldr	w9, [x19, #8]
	bic	w8, w9, w8
	str	w8, [x19, #8]
	mov	x0, x20
	bl	_release_pio_buffer
	mov	x0, x21
	b	LBB0_21
LBB0_20:
	mov	x0, x20
LBB0_21:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	b	_release_pio_buffer
LBB0_22:
	mov	x0, x20
	bl	_release_pio_buffer
	mov	x0, x21
	bl	_release_pio_buffer
Lloh23:
	adrp	x8, _ESP_STAT_RX_TIMEOUT@GOTPAGE
Lloh24:
	ldr	x8, [x8, _ESP_STAT_RX_TIMEOUT@GOTPAGEOFF]
Lloh25:
	ldr	w8, [x8]
	ldr	w9, [x19, #8]
	bic	w8, w9, w8
	str	w8, [x19, #8]
LBB0_23:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.cfi_endproc
                                        ; -- End function
	.comm	_UART_ESI_RX,8,3                ; @UART_ESI_RX
	.comm	_UART_ESI_RWS,8,3               ; @UART_ESI_RWS
	.comm	_ESP_STAT_RX_TIMEOUT,4,2        ; @ESP_STAT_RX_TIMEOUT
	.comm	_TTY_BREAK,4,2                  ; @TTY_BREAK
	.comm	_ASYNC_SAK,4,2                  ; @ASYNC_SAK
	.comm	_TTY_FRAME,4,2                  ; @TTY_FRAME
	.comm	_TTY_PARITY,4,2                 ; @TTY_PARITY
	.no_dead_strip	_receive_chars_pio
.subsections_via_symbols
