	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function close_dmap
_close_dmap:                            ## @close_dmap
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rsi, %rbx
	movq	(%rsi), %rdi
	testq	%rdi, %rdi
	js	LBB0_2
## %bb.1:
	callq	_sound_close_dma
	xorl	%eax, %eax
	callq	_claim_dma_lock
	movq	%rax, %r14
	movq	(%rbx), %rdi
	callq	_disable_dma
	movq	%r14, %rdi
	callq	_release_dma_lock
LBB0_2:
	movl	8(%rbx), %eax
	movq	_DMA_BUSY@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	testl	%eax, %ecx
	je	LBB0_4
## %bb.3:
	movq	_DMODE_NONE@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	movl	%edx, 12(%rbx)
LBB0_4:
	notl	%ecx
	andl	%ecx, %eax
	movl	%eax, 8(%rbx)
	movq	_sound_dmap_flag@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	_DMAP_FREE_ON_CLOSE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_5
## %bb.6:
	movq	%rbx, %rdi
	popq	%rbx
	popq	%r14
	popq	%rbp
	jmp	_sound_free_dmap                ## TAILCALL
LBB0_5:
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_DMA_BUSY,4,2                   ## @DMA_BUSY
	.comm	_DMODE_NONE,4,2                 ## @DMODE_NONE
	.comm	_sound_dmap_flag,8,3            ## @sound_dmap_flag
	.comm	_DMAP_FREE_ON_CLOSE,8,3         ## @DMAP_FREE_ON_CLOSE
	.no_dead_strip	_close_dmap
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function close_dmap
_close_dmap:                            ; @close_dmap
	.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, x1
	ldr	x0, [x1]
	tbnz	x0, #63, LBB0_2
; %bb.1:
	bl	_sound_close_dma
	bl	_claim_dma_lock
	mov	x20, x0
	ldr	x0, [x19]
	bl	_disable_dma
	mov	x0, x20
	bl	_release_dma_lock
LBB0_2:
	ldr	w8, [x19, #8]
Lloh0:
	adrp	x9, _DMA_BUSY@GOTPAGE
Lloh1:
	ldr	x9, [x9, _DMA_BUSY@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_4
; %bb.3:
Lloh3:
	adrp	x10, _DMODE_NONE@GOTPAGE
Lloh4:
	ldr	x10, [x10, _DMODE_NONE@GOTPAGEOFF]
Lloh5:
	ldr	w10, [x10]
	str	w10, [x19, #12]
LBB0_4:
	bic	w8, w8, w9
Lloh6:
	adrp	x9, _sound_dmap_flag@GOTPAGE
Lloh7:
	ldr	x9, [x9, _sound_dmap_flag@GOTPAGEOFF]
	str	w8, [x19, #8]
Lloh8:
	ldr	x8, [x9]
Lloh9:
	adrp	x9, _DMAP_FREE_ON_CLOSE@GOTPAGE
Lloh10:
	ldr	x9, [x9, _DMAP_FREE_ON_CLOSE@GOTPAGEOFF]
Lloh11:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_6
; %bb.5:
	mov	x0, x19
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_sound_free_dmap
LBB0_6:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_DMA_BUSY,4,2                   ; @DMA_BUSY
	.comm	_DMODE_NONE,4,2                 ; @DMODE_NONE
	.comm	_sound_dmap_flag,8,3            ; @sound_dmap_flag
	.comm	_DMAP_FREE_ON_CLOSE,8,3         ; @DMAP_FREE_ON_CLOSE
	.no_dead_strip	_close_dmap
.subsections_via_symbols
