	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function transmit_chars_dma
_transmit_chars_dma:                    ## @transmit_chars_dma
	.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, %edx
	movq	%rdi, %r14
	movq	_dma_bytes@GOTPCREL(%rip), %r12
	movl	%esi, (%r12)
	movslq	(%rdi), %rsi
	leal	(%rsi,%rdx), %eax
	movq	_ESP_XMIT_SIZE@GOTPCREL(%rip), %r15
	movl	(%r15), %ebx
	cmpl	%ebx, %eax
	jle	LBB0_1
## %bb.2:
	subl	%esi, %ebx
	movq	_dma_buffer@GOTPCREL(%rip), %r13
	movq	(%r13), %rdi
	shlq	$2, %rsi
	addq	32(%r14), %rsi
	movl	%ebx, %edx
	callq	_memcpy
	movslq	%ebx, %rax
	leaq	(,%rax,4), %rdi
	addq	(%r13), %rdi
	movq	32(%r14), %rsi
	movl	(%r12), %edx
	subl	%eax, %edx
	jmp	LBB0_3
LBB0_1:
	movq	_dma_buffer@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	shlq	$2, %rsi
	addq	32(%r14), %rsi
                                        ## kill: def $edx killed $edx killed $rdx
LBB0_3:
	callq	_memcpy
	movslq	(%r12), %rcx
	movq	8(%r14), %rax
	subq	%rcx, %rax
	movq	%rax, 8(%r14)
	movl	(%r14), %edx
	addl	%ecx, %edx
	movl	(%r15), %ecx
	decl	%ecx
	andl	%edx, %ecx
	movl	%ecx, (%r14)
	movq	_WAKEUP_CHARS@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jge	LBB0_8
## %bb.4:
	movq	24(%r14), %rdi
	testq	%rdi, %rdi
	je	LBB0_6
## %bb.5:
	callq	_tty_wakeup
	movq	8(%r14), %rax
LBB0_6:
	testq	%rax, %rax
	jg	LBB0_8
## %bb.7:
	movq	_UART_IER_THRI@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	notl	%eax
	andl	%eax, 20(%r14)
	movq	_UART_ESI_CMD1@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_ESI_SET_SRV_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r14, %rdi
	callq	_serial_out
	movq	_UART_ESI_CMD2@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	20(%r14), %edx
	movq	%r14, %rdi
	callq	_serial_out
LBB0_8:
	movq	_ESP_STAT_DMA_TX@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, 16(%r14)
	movq	_dma@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	movq	_DMA_MODE_WRITE@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movq	_dma_buffer@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	callq	_isa_virt_to_bus
	movl	(%r12), %ecx
	movl	%r15d, %edi
	movl	%ebx, %esi
	movl	%eax, %edx
	callq	_program_isa_dma
	movq	_UART_ESI_CMD1@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_ESI_START_DMA_TX@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r14, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_serial_out                     ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_dma_bytes,4,2                  ## @dma_bytes
	.comm	_ESP_XMIT_SIZE,4,2              ## @ESP_XMIT_SIZE
	.comm	_dma_buffer,8,3                 ## @dma_buffer
	.comm	_WAKEUP_CHARS,8,3               ## @WAKEUP_CHARS
	.comm	_UART_IER_THRI,4,2              ## @UART_IER_THRI
	.comm	_UART_ESI_CMD1,4,2              ## @UART_ESI_CMD1
	.comm	_ESI_SET_SRV_MASK,4,2           ## @ESI_SET_SRV_MASK
	.comm	_UART_ESI_CMD2,4,2              ## @UART_ESI_CMD2
	.comm	_ESP_STAT_DMA_TX,4,2            ## @ESP_STAT_DMA_TX
	.comm	_dma,4,2                        ## @dma
	.comm	_DMA_MODE_WRITE,4,2             ## @DMA_MODE_WRITE
	.comm	_ESI_START_DMA_TX,4,2           ## @ESI_START_DMA_TX
	.no_dead_strip	_transmit_chars_dma
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function transmit_chars_dma
_transmit_chars_dma:                    ; @transmit_chars_dma
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	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
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x19, x0
Lloh0:
	adrp	x22, _dma_bytes@GOTPAGE
Lloh1:
	ldr	x22, [x22, _dma_bytes@GOTPAGEOFF]
	str	w1, [x22]
Lloh2:
	adrp	x21, _ESP_XMIT_SIZE@GOTPAGE
Lloh3:
	ldr	x21, [x21, _ESP_XMIT_SIZE@GOTPAGEOFF]
	ldrsw	x8, [x0]
	ldr	w9, [x21]
	add	w10, w8, w1
	cmp	w10, w9
Lloh4:
	adrp	x23, _dma_buffer@GOTPAGE
Lloh5:
	ldr	x23, [x23, _dma_buffer@GOTPAGEOFF]
	b.le	LBB0_2
; %bb.1:
	sub	w20, w9, w8
	ldr	x0, [x23]
	ldr	x9, [x19, #32]
	add	x1, x9, x8, lsl #2
	mov	x2, x20
	bl	_memcpy
	ldr	x8, [x23]
	add	x0, x8, w20, sxtw #2
	ldr	x1, [x19, #32]
	ldr	w8, [x22]
	sub	w2, w8, w20
	b	LBB0_3
LBB0_2:
	mov	x2, x1
	ldr	x0, [x23]
	ldr	x9, [x19, #32]
	add	x1, x9, x8, lsl #2
LBB0_3:
	bl	_memcpy
	ldrsw	x9, [x22]
	ldr	x8, [x19, #8]
Lloh6:
	adrp	x10, _WAKEUP_CHARS@GOTPAGE
Lloh7:
	ldr	x10, [x10, _WAKEUP_CHARS@GOTPAGEOFF]
Lloh8:
	ldr	x10, [x10]
	sub	x8, x8, x9
	cmp	x8, x10
	str	x8, [x19, #8]
	ldr	w10, [x19]
	ldr	w11, [x21]
	sub	w11, w11, #1
	add	w9, w10, w9
	and	w9, w11, w9
	str	w9, [x19]
Lloh9:
	adrp	x24, _UART_ESI_CMD1@GOTPAGE
Lloh10:
	ldr	x24, [x24, _UART_ESI_CMD1@GOTPAGEOFF]
	b.ge	LBB0_8
; %bb.4:
	ldr	x0, [x19, #24]
	cbz	x0, LBB0_6
; %bb.5:
	bl	_tty_wakeup
	ldr	x8, [x19, #8]
LBB0_6:
	cmp	x8, #0
	b.gt	LBB0_8
; %bb.7:
Lloh11:
	adrp	x8, _UART_IER_THRI@GOTPAGE
Lloh12:
	ldr	x8, [x8, _UART_IER_THRI@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	ldr	w9, [x19, #20]
	bic	w8, w9, w8
	str	w8, [x19, #20]
	ldr	w1, [x24]
Lloh14:
	adrp	x8, _ESI_SET_SRV_MASK@GOTPAGE
Lloh15:
	ldr	x8, [x8, _ESI_SET_SRV_MASK@GOTPAGEOFF]
Lloh16:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_serial_out
Lloh17:
	adrp	x8, _UART_ESI_CMD2@GOTPAGE
Lloh18:
	ldr	x8, [x8, _UART_ESI_CMD2@GOTPAGEOFF]
Lloh19:
	ldr	w1, [x8]
	ldr	w2, [x19, #20]
	mov	x0, x19
	bl	_serial_out
LBB0_8:
Lloh20:
	adrp	x8, _ESP_STAT_DMA_TX@GOTPAGE
Lloh21:
	ldr	x8, [x8, _ESP_STAT_DMA_TX@GOTPAGEOFF]
Lloh22:
	ldr	w8, [x8]
	ldr	w9, [x19, #16]
	orr	w8, w9, w8
Lloh23:
	adrp	x9, _dma@GOTPAGE
Lloh24:
	ldr	x9, [x9, _dma@GOTPAGEOFF]
	str	w8, [x19, #16]
Lloh25:
	ldr	w20, [x9]
Lloh26:
	adrp	x8, _DMA_MODE_WRITE@GOTPAGE
Lloh27:
	ldr	x8, [x8, _DMA_MODE_WRITE@GOTPAGEOFF]
Lloh28:
	ldr	w21, [x8]
	ldr	x0, [x23]
	bl	_isa_virt_to_bus
	mov	x2, x0
	ldr	w3, [x22]
	mov	x0, x20
	mov	x1, x21
	bl	_program_isa_dma
	ldr	w1, [x24]
Lloh29:
	adrp	x8, _ESI_START_DMA_TX@GOTPAGE
Lloh30:
	ldr	x8, [x8, _ESI_START_DMA_TX@GOTPAGEOFF]
Lloh31:
	ldr	w2, [x8]
	mov	x0, x19
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	b	_serial_out
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.cfi_endproc
                                        ; -- End function
	.comm	_dma_bytes,4,2                  ; @dma_bytes
	.comm	_ESP_XMIT_SIZE,4,2              ; @ESP_XMIT_SIZE
	.comm	_dma_buffer,8,3                 ; @dma_buffer
	.comm	_WAKEUP_CHARS,8,3               ; @WAKEUP_CHARS
	.comm	_UART_IER_THRI,4,2              ; @UART_IER_THRI
	.comm	_UART_ESI_CMD1,4,2              ; @UART_ESI_CMD1
	.comm	_ESI_SET_SRV_MASK,4,2           ; @ESI_SET_SRV_MASK
	.comm	_UART_ESI_CMD2,4,2              ; @UART_ESI_CMD2
	.comm	_ESP_STAT_DMA_TX,4,2            ; @ESP_STAT_DMA_TX
	.comm	_dma,4,2                        ; @dma
	.comm	_DMA_MODE_WRITE,4,2             ; @DMA_MODE_WRITE
	.comm	_ESI_START_DMA_TX,4,2           ; @ESI_START_DMA_TX
	.no_dead_strip	_transmit_chars_dma
.subsections_via_symbols
