	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function transmit_chars_dma_done
_transmit_chars_dma_done:               ## @transmit_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
	movq	%rdi, %r14
	xorl	%eax, %eax
	callq	_claim_dma_lock
	movq	%rax, %r15
	movq	_dma@GOTPCREL(%rip), %r12
	movl	(%r12), %edi
	callq	_disable_dma
	movl	(%r12), %edi
	callq	_clear_dma_ff
	movq	_dma_bytes@GOTPCREL(%rip), %r13
	movslq	(%r13), %rbx
	movl	(%r12), %edi
	callq	_get_dma_residue
	cltq
	subq	%rax, %rbx
	movl	(%r13), %eax
	addl	%eax, 4(%r14)
	movq	%r15, %rdi
	callq	_release_dma_lock
	movl	(%r13), %edx
	subl	%ebx, %edx
	jne	LBB0_2
## %bb.1:
	movl	$0, (%r13)
	movq	_ESP_STAT_DMA_TX@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	notl	%eax
	andl	%eax, (%r14)
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_2:
	movl	%edx, (%r13)
	movq	_dma_buffer@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	%rdi, %rbx
	movq	%rbx, %rsi
	callq	_memmove
	movl	(%r12), %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	(%r13), %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,4,2                        ## @dma
	.comm	_dma_bytes,4,2                  ## @dma_bytes
	.comm	_dma_buffer,8,3                 ## @dma_buffer
	.comm	_DMA_MODE_WRITE,4,2             ## @DMA_MODE_WRITE
	.comm	_UART_ESI_CMD1,4,2              ## @UART_ESI_CMD1
	.comm	_ESI_START_DMA_TX,4,2           ## @ESI_START_DMA_TX
	.comm	_ESP_STAT_DMA_TX,4,2            ## @ESP_STAT_DMA_TX
	.no_dead_strip	_transmit_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 transmit_chars_dma_done
_transmit_chars_dma_done:               ; @transmit_chars_dma_done
	.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
	bl	_claim_dma_lock
	mov	x20, x0
Lloh0:
	adrp	x21, _dma@GOTPAGE
Lloh1:
	ldr	x21, [x21, _dma@GOTPAGEOFF]
	ldr	w0, [x21]
	bl	_disable_dma
	ldr	w0, [x21]
	bl	_clear_dma_ff
Lloh2:
	adrp	x22, _dma_bytes@GOTPAGE
Lloh3:
	ldr	x22, [x22, _dma_bytes@GOTPAGEOFF]
	ldrsw	x23, [x22]
	ldr	w0, [x21]
	bl	_get_dma_residue
	sub	x23, x23, w0, sxtw
	ldr	w8, [x22]
	ldr	w9, [x19, #4]
	add	w8, w9, w8
	str	w8, [x19, #4]
	mov	x0, x20
	bl	_release_dma_lock
	ldr	w8, [x22]
	subs	w2, w8, w23
	b.ne	LBB0_2
; %bb.1:
	str	wzr, [x22]
Lloh4:
	adrp	x8, _ESP_STAT_DMA_TX@GOTPAGE
Lloh5:
	ldr	x8, [x8, _ESP_STAT_DMA_TX@GOTPAGEOFF]
Lloh6:
	ldr	w8, [x8]
	ldr	w9, [x19]
	bic	w8, w9, w8
	str	w8, [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
	ret
LBB0_2:
	str	w2, [x22]
Lloh7:
	adrp	x24, _dma_buffer@GOTPAGE
Lloh8:
	ldr	x24, [x24, _dma_buffer@GOTPAGEOFF]
	ldr	x0, [x24]
	add	x1, x0, x23
	bl	_memmove
	ldr	w20, [x21]
Lloh9:
	adrp	x8, _DMA_MODE_WRITE@GOTPAGE
Lloh10:
	ldr	x8, [x8, _DMA_MODE_WRITE@GOTPAGEOFF]
Lloh11:
	ldr	w21, [x8]
	ldr	x0, [x24]
	bl	_isa_virt_to_bus
	mov	x2, x0
	ldr	w3, [x22]
	mov	x0, x20
	mov	x1, x21
	bl	_program_isa_dma
Lloh12:
	adrp	x8, _UART_ESI_CMD1@GOTPAGE
Lloh13:
	ldr	x8, [x8, _UART_ESI_CMD1@GOTPAGEOFF]
Lloh14:
	ldr	w1, [x8]
Lloh15:
	adrp	x8, _ESI_START_DMA_TX@GOTPAGE
Lloh16:
	ldr	x8, [x8, _ESI_START_DMA_TX@GOTPAGEOFF]
Lloh17:
	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	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_dma,4,2                        ; @dma
	.comm	_dma_bytes,4,2                  ; @dma_bytes
	.comm	_dma_buffer,8,3                 ; @dma_buffer
	.comm	_DMA_MODE_WRITE,4,2             ; @DMA_MODE_WRITE
	.comm	_UART_ESI_CMD1,4,2              ; @UART_ESI_CMD1
	.comm	_ESI_START_DMA_TX,4,2           ; @ESI_START_DMA_TX
	.comm	_ESP_STAT_DMA_TX,4,2            ; @ESP_STAT_DMA_TX
	.no_dead_strip	_transmit_chars_dma_done
.subsections_via_symbols
