	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function receive_chars_dma_done
_receive_chars_dma_done:                ## @receive_chars_dma_done
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %ebx
	movq	%rdi, %r15
	movq	32(%rdi), %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	xorl	%eax, %eax
	callq	_claim_dma_lock
	movq	%rax, %r12
	movq	_dma@GOTPCREL(%rip), %r14
	movl	(%r14), %edi
	callq	_disable_dma
	movl	(%r14), %edi
	callq	_clear_dma_ff
	movq	_ESP_STAT_DMA_RX@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	notl	%eax
	andl	%eax, 40(%r15)
	movq	_dma_bytes@GOTPCREL(%rip), %rax
	movl	(%rax), %r13d
	movl	(%r14), %edi
	callq	_get_dma_residue
	subl	%eax, %r13d
	movq	%r12, %rdi
	callq	_release_dma_lock
	addl	%r13d, 8(%r15)
	testl	%r13d, %r13d
	jle	LBB0_12
## %bb.1:
	movq	_dma_buffer@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	leal	-1(%r13), %r12d
	movq	-48(%rbp), %r14                 ## 8-byte Reload
	movq	%r14, %rdi
	movl	%r12d, %edx
	callq	_tty_insert_flip_string
	andl	(%r15), %ebx
	andl	$28, %ebx
	testl	%ebx, 4(%r15)
	jne	LBB0_11
## %bb.2:
	testb	$16, %bl
	jne	LBB0_6
## %bb.3:
	testb	$8, %bl
	jne	LBB0_8
## %bb.4:
	testb	$4, %bl
	movl	$0, %ebx
	movq	_dma_buffer@GOTPCREL(%rip), %rcx
	je	LBB0_10
## %bb.5:
	movq	_TTY_PARITY@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	incl	12(%r15)
	jmp	LBB0_10
LBB0_6:
	movq	_TTY_BREAK@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	incl	20(%r15)
	movq	_ASYNC_SAK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, 24(%r15)
	je	LBB0_9
## %bb.7:
	movq	%r14, %rdi
	callq	_do_SAK
	jmp	LBB0_9
LBB0_8:
	movq	_TTY_FRAME@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	incl	16(%r15)
LBB0_9:
	movq	_dma_buffer@GOTPCREL(%rip), %rcx
LBB0_10:
	movq	(%rcx), %rax
	movl	%r12d, %ecx
	movl	(%rax,%rcx,4), %esi
	movq	%r14, %rdi
	movl	%ebx, %edx
	callq	_tty_insert_flip_char
LBB0_11:
	movq	%r14, %rdi
	callq	_tty_schedule_flip
LBB0_12:
	movq	_dma_bytes@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	subl	%r13d, %esi
	jne	LBB0_14
## %bb.13:
	movl	$0, (%rax)
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_14:
	movl	$0, (%rax)
	movq	%r15, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_receive_chars_dma              ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_dma,4,2                        ## @dma
	.comm	_ESP_STAT_DMA_RX,4,2            ## @ESP_STAT_DMA_RX
	.comm	_dma_bytes,4,2                  ## @dma_bytes
	.comm	_dma_buffer,8,3                 ## @dma_buffer
	.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_dma_done
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function receive_chars_dma_done
_receive_chars_dma_done:                ; @receive_chars_dma_done
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x22, x1
	mov	x19, x0
	ldr	x20, [x0, #32]
	bl	_claim_dma_lock
	mov	x21, x0
Lloh0:
	adrp	x24, _dma@GOTPAGE
Lloh1:
	ldr	x24, [x24, _dma@GOTPAGEOFF]
	ldr	w0, [x24]
	bl	_disable_dma
	ldr	w0, [x24]
	bl	_clear_dma_ff
Lloh2:
	adrp	x8, _ESP_STAT_DMA_RX@GOTPAGE
Lloh3:
	ldr	x8, [x8, _ESP_STAT_DMA_RX@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	ldr	w9, [x19, #40]
	bic	w8, w9, w8
	str	w8, [x19, #40]
Lloh5:
	adrp	x23, _dma_bytes@GOTPAGE
Lloh6:
	ldr	x23, [x23, _dma_bytes@GOTPAGEOFF]
	ldr	w25, [x23]
	ldr	w0, [x24]
	bl	_get_dma_residue
	sub	w24, w25, w0
	mov	x0, x21
	bl	_release_dma_lock
	ldr	w8, [x19, #8]
	add	w8, w8, w24
	str	w8, [x19, #8]
	subs	w21, w24, #1
	b.lt	LBB0_12
; %bb.1:
Lloh7:
	adrp	x25, _dma_buffer@GOTPAGE
Lloh8:
	ldr	x25, [x25, _dma_buffer@GOTPAGEOFF]
	ldr	x1, [x25]
	mov	x0, x20
	mov	x2, x21
	bl	_tty_insert_flip_string
	ldp	w8, w9, [x19]
	and	w8, w22, w8
	and	w8, w8, #0x1c
	tst	w8, w9
	b.ne	LBB0_11
; %bb.2:
	tbnz	w8, #4, LBB0_6
; %bb.3:
	tbnz	w8, #3, LBB0_8
; %bb.4:
	tbnz	w8, #2, LBB0_9
; %bb.5:
	mov	w22, #0
	b	LBB0_10
LBB0_6:
Lloh9:
	adrp	x8, _TTY_BREAK@GOTPAGE
Lloh10:
	ldr	x8, [x8, _TTY_BREAK@GOTPAGEOFF]
Lloh11:
	ldr	w22, [x8]
	ldp	w8, w9, [x19, #20]
	add	w8, w8, #1
	str	w8, [x19, #20]
Lloh12:
	adrp	x8, _ASYNC_SAK@GOTPAGE
Lloh13:
	ldr	x8, [x8, _ASYNC_SAK@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	tst	w8, w9
	b.eq	LBB0_10
; %bb.7:
	mov	x0, x20
	bl	_do_SAK
	b	LBB0_10
LBB0_8:
Lloh15:
	adrp	x8, _TTY_FRAME@GOTPAGE
Lloh16:
	ldr	x8, [x8, _TTY_FRAME@GOTPAGEOFF]
Lloh17:
	ldr	w22, [x8]
	ldr	w8, [x19, #16]
	add	w8, w8, #1
	str	w8, [x19, #16]
	b	LBB0_10
LBB0_9:
Lloh18:
	adrp	x8, _TTY_PARITY@GOTPAGE
Lloh19:
	ldr	x8, [x8, _TTY_PARITY@GOTPAGEOFF]
Lloh20:
	ldr	w22, [x8]
	ldr	w8, [x19, #12]
	add	w8, w8, #1
	str	w8, [x19, #12]
LBB0_10:
	ldr	x8, [x25]
	ldr	w1, [x8, w21, uxtw #2]
	mov	x0, x20
	mov	x2, x22
	bl	_tty_insert_flip_char
LBB0_11:
	mov	x0, x20
	bl	_tty_schedule_flip
LBB0_12:
	ldr	w8, [x23]
	subs	w1, w8, w24
	b.ne	LBB0_14
; %bb.13:
	str	wzr, [x23]
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
LBB0_14:
	str	wzr, [x23]
	mov	x0, x19
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	b	_receive_chars_dma
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
	.comm	_dma,4,2                        ; @dma
	.comm	_ESP_STAT_DMA_RX,4,2            ; @ESP_STAT_DMA_RX
	.comm	_dma_bytes,4,2                  ; @dma_bytes
	.comm	_dma_buffer,8,3                 ; @dma_buffer
	.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_dma_done
.subsections_via_symbols
