	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_isa_dma_acquire                ## -- Begin function isa_dma_acquire
	.p2align	4, 0x90
_isa_dma_acquire:                       ## @isa_dma_acquire
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -24
	movl	%edi, %ebx
	movq	_isa_dma_lock@GOTPCREL(%rip), %rdi
	callq	_mtx_lock
	movq	_dma_inuse@GOTPCREL(%rip), %rdx
	movl	(%rdx), %esi
	movl	$1, %eax
	movl	%ebx, %ecx
	shll	%cl, %eax
	btl	%ebx, %esi
	jae	LBB0_2
## %bb.1:
	leaq	L_.str(%rip), %rdi
	movl	%ebx, %esi
	callq	_printf
	movq	_isa_dma_lock@GOTPCREL(%rip), %rdi
	callq	_mtx_unlock
	movq	_EBUSY@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	jmp	LBB0_3
LBB0_2:
	orl	%eax, %esi
	movl	%esi, (%rdx)
	notl	%eax
	movq	_dma_auto_mode@GOTPCREL(%rip), %rcx
	andl	%eax, (%rcx)
	movq	_isa_dma_lock@GOTPCREL(%rip), %rdi
	callq	_mtx_unlock
	xorl	%eax, %eax
LBB0_3:
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_isa_dma_lock,4,2               ## @isa_dma_lock
	.comm	_dma_inuse,4,2                  ## @dma_inuse
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"isa_dma_acquire: channel %d already in use\n"

	.comm	_EBUSY,4,2                      ## @EBUSY
	.comm	_dma_auto_mode,4,2              ## @dma_auto_mode
	.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_acquire                ; -- Begin function isa_dma_acquire
	.p2align	2
_isa_dma_acquire:                       ; @isa_dma_acquire
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x0
Lloh0:
	adrp	x0, _isa_dma_lock@GOTPAGE
Lloh1:
	ldr	x0, [x0, _isa_dma_lock@GOTPAGEOFF]
	bl	_mtx_lock
Lloh2:
	adrp	x8, _dma_inuse@GOTPAGE
Lloh3:
	ldr	x8, [x8, _dma_inuse@GOTPAGEOFF]
	ldr	w10, [x8]
	mov	w9, #1
	lsl	w9, w9, w19
	tst	w10, w9
	b.eq	LBB0_2
; %bb.1:
Lloh4:
	adrp	x0, l_.str@PAGE
Lloh5:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x19
	bl	_printf
Lloh6:
	adrp	x0, _isa_dma_lock@GOTPAGE
Lloh7:
	ldr	x0, [x0, _isa_dma_lock@GOTPAGEOFF]
	bl	_mtx_unlock
Lloh8:
	adrp	x8, _EBUSY@GOTPAGE
Lloh9:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
Lloh10:
	ldr	w0, [x8]
	b	LBB0_3
LBB0_2:
	orr	w10, w10, w9
	str	w10, [x8]
Lloh11:
	adrp	x8, _dma_auto_mode@GOTPAGE
Lloh12:
	ldr	x8, [x8, _dma_auto_mode@GOTPAGEOFF]
	ldr	w10, [x8]
	bic	w9, w10, w9
	str	w9, [x8]
Lloh13:
	adrp	x0, _isa_dma_lock@GOTPAGE
Lloh14:
	ldr	x0, [x0, _isa_dma_lock@GOTPAGEOFF]
	bl	_mtx_unlock
	mov	w0, #0
LBB0_3:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_isa_dma_lock,4,2               ; @isa_dma_lock
	.comm	_dma_inuse,4,2                  ; @dma_inuse
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"isa_dma_acquire: channel %d already in use\n"

	.comm	_EBUSY,4,2                      ; @EBUSY
	.comm	_dma_auto_mode,4,2              ; @dma_auto_mode
	.comm	_VALID_DMA_MASK,4,2             ; @VALID_DMA_MASK
.subsections_via_symbols
