	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_isa_dmadone                    ## -- Begin function isa_dmadone
	.p2align	4, 0x90
_isa_dmadone:                           ## @isa_dmadone
	.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	%ecx, %ebx
	movl	%edx, -44(%rbp)                 ## 4-byte Spill
	movl	%esi, %r15d
	movl	%edi, %r12d
	movq	_isa_dma_lock@GOTPCREL(%rip), %rdi
	callq	_mtx_lock
	movq	_dma_busy@GOTPCREL(%rip), %rdx
	movl	(%rdx), %eax
	movl	$1, %r13d
	movl	%ebx, %ecx
	shll	%cl, %r13d
	btl	%ebx, %eax
	jb	LBB0_3
## %bb.1:
	movq	_dma_auto_mode@GOTPCREL(%rip), %rax
	testl	%r13d, (%rax)
	jne	LBB0_3
## %bb.2:
	leaq	L_.str(%rip), %rdi
	movl	%ebx, %esi
	movq	%rdx, %r14
	callq	_printf
	movq	%r14, %rdx
LBB0_3:
	movq	_dma_auto_mode@GOTPCREL(%rip), %rax
	testl	%r13d, (%rax)
	jne	LBB0_8
## %bb.4:
	movq	%rdx, %r14
	testb	$4, %bl
	jne	LBB0_5
## %bb.6:
	movq	_DMA1_SMSK@GOTPCREL(%rip), %rax
	jmp	LBB0_7
LBB0_5:
	movq	_DMA2_SMSK@GOTPCREL(%rip), %rax
LBB0_7:
	movl	(%rax), %edi
	movl	%ebx, %esi
	andl	$3, %esi
	orl	$4, %esi
	callq	_outb
	movq	%r14, %rdx
LBB0_8:
	movq	_dma_bounced@GOTPCREL(%rip), %r14
	movl	(%r14), %eax
	testl	%r13d, %eax
	je	LBB0_9
## %bb.10:
	movq	_ISADMA_READ@GOTPCREL(%rip), %rcx
	testl	%r12d, (%rcx)
	je	LBB0_12
## %bb.11:
	movq	_dma_bouncebuf@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movslq	%ebx, %rcx
	movl	(%rax,%rcx,4), %edi
	movl	%r15d, %esi
	movq	%rdx, %rbx
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	callq	_bcopy
	movq	%rbx, %rdx
	movl	(%r14), %eax
LBB0_12:
	notl	%r13d
	andl	%r13d, %eax
	movl	%eax, (%r14)
	jmp	LBB0_13
LBB0_9:
	notl	%r13d
LBB0_13:
	andl	%r13d, (%rdx)
	movq	_isa_dma_lock@GOTPCREL(%rip), %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_mtx_unlock                     ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_isa_dma_lock,4,2               ## @isa_dma_lock
	.comm	_dma_busy,4,2                   ## @dma_busy
	.comm	_dma_auto_mode,4,2              ## @dma_auto_mode
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"isa_dmadone: channel %d not busy\n"

	.comm	_DMA2_SMSK,4,2                  ## @DMA2_SMSK
	.comm	_DMA1_SMSK,4,2                  ## @DMA1_SMSK
	.comm	_dma_bounced,4,2                ## @dma_bounced
	.comm	_ISADMA_READ,4,2                ## @ISADMA_READ
	.comm	_dma_bouncebuf,8,3              ## @dma_bouncebuf
	.comm	_VALID_DMA_MASK,4,2             ## @VALID_DMA_MASK
	.comm	_dma_inuse,4,2                  ## @dma_inuse
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_isa_dmadone                    ; -- Begin function isa_dmadone
	.p2align	2
_isa_dmadone:                           ; @isa_dmadone
	.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	x21, x3
	mov	x19, x2
	mov	x20, x1
	mov	x22, x0
Lloh0:
	adrp	x0, _isa_dma_lock@GOTPAGE
Lloh1:
	ldr	x0, [x0, _isa_dma_lock@GOTPAGEOFF]
	bl	_mtx_lock
Lloh2:
	adrp	x23, _dma_busy@GOTPAGE
Lloh3:
	ldr	x23, [x23, _dma_busy@GOTPAGEOFF]
	ldr	w8, [x23]
	mov	w9, #1
	lsl	w24, w9, w21
Lloh4:
	adrp	x25, _dma_auto_mode@GOTPAGE
Lloh5:
	ldr	x25, [x25, _dma_auto_mode@GOTPAGEOFF]
	tst	w8, w24
	b.ne	LBB0_3
; %bb.1:
	ldr	w8, [x25]
	tst	w8, w24
	b.ne	LBB0_3
; %bb.2:
Lloh6:
	adrp	x0, l_.str@PAGE
Lloh7:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x21
	bl	_printf
LBB0_3:
	ldr	w8, [x25]
	tst	w8, w24
	b.ne	LBB0_5
; %bb.4:
Lloh8:
	adrp	x8, _DMA2_SMSK@GOTPAGE
Lloh9:
	ldr	x8, [x8, _DMA2_SMSK@GOTPAGEOFF]
Lloh10:
	adrp	x9, _DMA1_SMSK@GOTPAGE
Lloh11:
	ldr	x9, [x9, _DMA1_SMSK@GOTPAGEOFF]
	tst	w21, #0x4
	csel	x8, x9, x8, eq
	ldr	w0, [x8]
	mov	w1, #4
	bfxil	w1, w21, #0, #2
	bl	_outb
LBB0_5:
Lloh12:
	adrp	x25, _dma_bounced@GOTPAGE
Lloh13:
	ldr	x25, [x25, _dma_bounced@GOTPAGEOFF]
	ldr	w8, [x25]
	tst	w8, w24
	b.eq	LBB0_9
; %bb.6:
Lloh14:
	adrp	x9, _ISADMA_READ@GOTPAGE
Lloh15:
	ldr	x9, [x9, _ISADMA_READ@GOTPAGEOFF]
Lloh16:
	ldr	w9, [x9]
	tst	w9, w22
	b.eq	LBB0_8
; %bb.7:
Lloh17:
	adrp	x8, _dma_bouncebuf@GOTPAGE
Lloh18:
	ldr	x8, [x8, _dma_bouncebuf@GOTPAGEOFF]
Lloh19:
	ldr	x8, [x8]
	ldr	w0, [x8, w21, sxtw #2]
	mov	x1, x20
	mov	x2, x19
	bl	_bcopy
	ldr	w8, [x25]
LBB0_8:
	mvn	w9, w24
	bic	w8, w8, w24
	str	w8, [x25]
	b	LBB0_10
LBB0_9:
	mvn	w9, w24
LBB0_10:
	ldr	w8, [x23]
	and	w8, w8, w9
	str	w8, [x23]
Lloh20:
	adrp	x0, _isa_dma_lock@GOTPAGE
Lloh21:
	ldr	x0, [x0, _isa_dma_lock@GOTPAGEOFF]
	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	_mtx_unlock
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh20, Lloh21
	.cfi_endproc
                                        ; -- End function
	.comm	_isa_dma_lock,4,2               ; @isa_dma_lock
	.comm	_dma_busy,4,2                   ; @dma_busy
	.comm	_dma_auto_mode,4,2              ; @dma_auto_mode
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"isa_dmadone: channel %d not busy\n"

	.comm	_DMA2_SMSK,4,2                  ; @DMA2_SMSK
	.comm	_DMA1_SMSK,4,2                  ; @DMA1_SMSK
	.comm	_dma_bounced,4,2                ; @dma_bounced
	.comm	_ISADMA_READ,4,2                ; @ISADMA_READ
	.comm	_dma_bouncebuf,8,3              ; @dma_bouncebuf
	.comm	_VALID_DMA_MASK,4,2             ; @VALID_DMA_MASK
	.comm	_dma_inuse,4,2                  ; @dma_inuse
.subsections_via_symbols
