	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_isa_dma_init                   ## -- Begin function isa_dma_init
	.p2align	4, 0x90
_isa_dma_init:                          ## @isa_dma_init
	.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	%edx, %r12d
	movl	%esi, %r15d
	movl	%edi, %r14d
	movq	_M_DEVBUF@GOTPCREL(%rip), %r13
	movl	(%r13), %esi
	movl	%r15d, %edi
	callq	_malloc
	testq	%rax, %rax
	je	LBB0_4
## %bb.1:
	movq	%rax, %rbx
	movq	%rax, %rdi
	movl	%r15d, %esi
	movl	%r14d, %edx
	callq	_isa_dmarangecheck
	testq	%rax, %rax
	je	LBB0_2
## %bb.3:
	movl	(%r13), %esi
	movq	%rbx, %rdi
	callq	_free
LBB0_4:
	movl	(%r13), %esi
	movl	%r14d, %eax
	andl	$4, %eax
	shll	$14, %eax
	addl	$65536, %eax                    ## imm = 0x10000
	movl	%eax, (%rsp)
	movl	$1, %r9d
	movl	%r15d, %edi
	movl	%r12d, %edx
	xorl	%ecx, %ecx
	movl	$16777215, %r8d                 ## imm = 0xFFFFFF
	callq	_contigmalloc
	testq	%rax, %rax
	je	LBB0_13
## %bb.5:
	movq	%rax, %rbx
	movb	$1, %r12b
	jmp	LBB0_6
LBB0_13:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	jmp	LBB0_12
LBB0_2:
	xorl	%r12d, %r12d
LBB0_6:
	movq	_isa_dma_lock@GOTPCREL(%rip), %rdi
	callq	_mtx_lock
	movq	_dma_bouncebuf@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movslq	%r14d, %rcx
	cmpq	$0, (%rax,%rcx,8)
	je	LBB0_10
## %bb.7:
	movl	(%r13), %edx
	movq	%rbx, %rdi
	testb	%r12b, %r12b
	je	LBB0_9
## %bb.8:
	movl	%r15d, %esi
	callq	_contigfree
	jmp	LBB0_11
LBB0_10:
	movq	_dma_bouncebufsize@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rdx
	movl	%r15d, (%rdx,%rcx,4)
	movq	%rbx, (%rax,%rcx,8)
	jmp	LBB0_11
LBB0_9:
	movl	%edx, %esi
	callq	_free
LBB0_11:
	movq	_isa_dma_lock@GOTPCREL(%rip), %rdi
	callq	_mtx_unlock
	xorl	%eax, %eax
LBB0_12:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_M_DEVBUF,4,2                   ## @M_DEVBUF
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_isa_dma_lock,4,2               ## @isa_dma_lock
	.comm	_dma_bouncebuf,8,3              ## @dma_bouncebuf
	.comm	_dma_bouncebufsize,8,3          ## @dma_bouncebufsize
	.comm	_VALID_DMA_MASK,4,2             ## @VALID_DMA_MASK
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_isa_dma_init                   ; -- Begin function isa_dma_init
	.p2align	2
_isa_dma_init:                          ; @isa_dma_init
	.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	x22, x2
	mov	x19, x1
	mov	x20, x0
Lloh0:
	adrp	x23, _M_DEVBUF@GOTPAGE
Lloh1:
	ldr	x23, [x23, _M_DEVBUF@GOTPAGEOFF]
	ldr	w1, [x23]
	mov	x0, x19
	bl	_malloc
	cbz	x0, LBB0_3
; %bb.1:
	mov	x21, x0
	mov	x1, x19
	mov	x2, x20
	bl	_isa_dmarangecheck
	cbz	x0, LBB0_6
; %bb.2:
	ldr	w1, [x23]
	mov	x0, x21
	bl	_free
LBB0_3:
	ldr	w1, [x23]
	tst	w20, #0x4
	mov	w8, #131072
	mov	w9, #65536
	csel	w6, w9, w8, eq
	mov	w24, #1
	mov	x0, x19
	mov	x2, x22
	mov	x3, #0
	mov	w4, #16777215
	mov	w5, #1
	bl	_contigmalloc
	cbz	x0, LBB0_5
; %bb.4:
	mov	x21, x0
	b	LBB0_7
LBB0_5:
Lloh2:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh3:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh4:
	ldr	w0, [x8]
	b	LBB0_13
LBB0_6:
	mov	w24, #0
LBB0_7:
Lloh5:
	adrp	x0, _isa_dma_lock@GOTPAGE
Lloh6:
	ldr	x0, [x0, _isa_dma_lock@GOTPAGEOFF]
	bl	_mtx_lock
Lloh7:
	adrp	x8, _dma_bouncebuf@GOTPAGE
Lloh8:
	ldr	x8, [x8, _dma_bouncebuf@GOTPAGEOFF]
Lloh9:
	ldr	x8, [x8]
	ldr	x9, [x8, w20, sxtw #3]
	cbz	x9, LBB0_10
; %bb.8:
	ldr	w2, [x23]
	mov	x0, x21
	cbz	w24, LBB0_11
; %bb.9:
	mov	x1, x19
	bl	_contigfree
	b	LBB0_12
LBB0_10:
Lloh10:
	adrp	x9, _dma_bouncebufsize@GOTPAGE
Lloh11:
	ldr	x9, [x9, _dma_bouncebufsize@GOTPAGEOFF]
	sxtw	x10, w20
Lloh12:
	ldr	x9, [x9]
	str	w19, [x9, x10, lsl #2]
	str	x21, [x8, x10, lsl #3]
	b	LBB0_12
LBB0_11:
	mov	x1, x2
	bl	_free
LBB0_12:
Lloh13:
	adrp	x0, _isa_dma_lock@GOTPAGE
Lloh14:
	ldr	x0, [x0, _isa_dma_lock@GOTPAGEOFF]
	bl	_mtx_unlock
	mov	w0, #0
LBB0_13:
	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
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_M_DEVBUF,4,2                   ; @M_DEVBUF
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_isa_dma_lock,4,2               ; @isa_dma_lock
	.comm	_dma_bouncebuf,8,3              ; @dma_bouncebuf
	.comm	_dma_bouncebufsize,8,3          ; @dma_bouncebufsize
	.comm	_VALID_DMA_MASK,4,2             ; @VALID_DMA_MASK
.subsections_via_symbols
