	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_sb_audio_close                 ## -- Begin function sb_audio_close
	.p2align	4, 0x90
_sb_audio_close:                        ## @sb_audio_close
	.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	_audio_devs@GOTPCREL(%rip), %r8
	movq	(%r8), %rdx
	movslq	%edi, %rsi
	movq	(%rdx,%rsi,8), %rcx
	movq	16(%rcx), %rbx
	movq	24(%rbx), %rax
	testq	%rax, %rax
	je	LBB0_5
## %bb.1:
	cmpl	$0, 32(%rbx)
	jne	LBB0_5
## %bb.2:
	movl	(%rbx), %r9d
	movq	_OPEN_READ@GOTPCREL(%rip), %rdi
	testl	%r9d, (%rdi)
	je	LBB0_5
## %bb.3:
	movq	_OPEN_WRITE@GOTPCREL(%rip), %rdi
	testl	%r9d, (%rdi)
	je	LBB0_5
## %bb.4:
	movq	(%rcx), %rdi
	movq	8(%rcx), %r9
	movq	%rdi, 8(%rcx)
	movq	(%rdx,%rsi,8), %rcx
	movq	%r9, (%rcx)
	movq	(%r8), %rcx
	movq	(%rcx,%rsi,8), %rcx
LBB0_5:
	xorl	%esi, %esi
	testq	%rax, %rax
	setne	%sil
	movl	4(%rbx), %edx
	movq	8(%rcx), %rdi
	movl	%edx, (%rdi)
	movl	4(%rbx,%rsi,4), %esi
	movq	(%rcx), %rcx
	movl	%esi, (%rcx)
	movl	8(%rbx), %edi
	cmpl	$-1, %edi
	je	LBB0_9
## %bb.6:
	cmpl	%edx, %edi
	je	LBB0_9
## %bb.7:
	testq	%rax, %rax
	jne	LBB0_9
## %bb.8:
	callq	_sound_close_dma
LBB0_9:
	movq	16(%rbx), %rax
	movq	_SUBMDL_ALS007@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_12
## %bb.10:
	movq	_OPEN_READ@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%rbx)
	je	LBB0_12
## %bb.11:
	movq	_ALS007_OUTPUT_CTRL2@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	movq	%rbx, %rdi
	movl	%r14d, %esi
	callq	_sb_getmixer
	orl	$6, %eax
	movq	%rbx, %rdi
	movl	%r14d, %esi
	movl	%eax, %edx
	callq	_sb_setmixer
LBB0_12:
	movl	$0, (%rbx)
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_audio_devs,8,3                 ## @audio_devs
	.comm	_OPEN_READ,4,2                  ## @OPEN_READ
	.comm	_OPEN_WRITE,4,2                 ## @OPEN_WRITE
	.comm	_SUBMDL_ALS007,8,3              ## @SUBMDL_ALS007
	.comm	_ALS007_OUTPUT_CTRL2,4,2        ## @ALS007_OUTPUT_CTRL2
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_sb_audio_close                 ; -- Begin function sb_audio_close
	.p2align	2
_sb_audio_close:                        ; @sb_audio_close
	.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
                                        ; kill: def $w0 killed $w0 def $x0
Lloh0:
	adrp	x10, _audio_devs@GOTPAGE
Lloh1:
	ldr	x10, [x10, _audio_devs@GOTPAGEOFF]
	ldr	x11, [x10]
	ldr	x9, [x11, w0, sxtw #3]
	ldr	x19, [x9, #16]
	ldr	x8, [x19, #24]
	cbz	x8, LBB0_5
; %bb.1:
	ldr	w12, [x19, #32]
	cbnz	w12, LBB0_5
; %bb.2:
	ldr	w12, [x19]
Lloh2:
	adrp	x13, _OPEN_READ@GOTPAGE
Lloh3:
	ldr	x13, [x13, _OPEN_READ@GOTPAGEOFF]
Lloh4:
	ldr	w13, [x13]
	tst	w13, w12
	b.eq	LBB0_5
; %bb.3:
Lloh5:
	adrp	x13, _OPEN_WRITE@GOTPAGE
Lloh6:
	ldr	x13, [x13, _OPEN_WRITE@GOTPAGEOFF]
Lloh7:
	ldr	w13, [x13]
	tst	w13, w12
	b.eq	LBB0_5
; %bb.4:
	sxtw	x12, w0
	ldp	x14, x13, [x9]
	str	x14, [x9, #8]
	lsl	x9, x12, #3
	ldr	x11, [x11, x9]
	str	x13, [x11]
	ldr	x10, [x10]
	ldr	x9, [x10, x9]
LBB0_5:
	ldp	x9, x10, [x9]
	ldp	w11, w0, [x19, #4]
	str	w11, [x10]
	mov	w10, #8
	mov	w12, #4
	cmp	x8, #0
	csel	x10, x12, x10, eq
	ldr	w10, [x19, x10]
	str	w10, [x9]
	cmn	w0, #1
	ccmp	w0, w11, #4, ne
	ccmp	x8, #0, #0, ne
	b.ne	LBB0_7
; %bb.6:
	bl	_sound_close_dma
LBB0_7:
	ldr	x8, [x19, #16]
Lloh8:
	adrp	x9, _SUBMDL_ALS007@GOTPAGE
Lloh9:
	ldr	x9, [x9, _SUBMDL_ALS007@GOTPAGEOFF]
Lloh10:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_10
; %bb.8:
	ldr	w8, [x19]
Lloh11:
	adrp	x9, _OPEN_READ@GOTPAGE
Lloh12:
	ldr	x9, [x9, _OPEN_READ@GOTPAGEOFF]
Lloh13:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_10
; %bb.9:
Lloh14:
	adrp	x8, _ALS007_OUTPUT_CTRL2@GOTPAGE
Lloh15:
	ldr	x8, [x8, _ALS007_OUTPUT_CTRL2@GOTPAGEOFF]
Lloh16:
	ldr	w20, [x8]
	mov	x0, x19
	mov	x1, x20
	bl	_sb_getmixer
	orr	w2, w0, #0x6
	mov	x0, x19
	mov	x1, x20
	bl	_sb_setmixer
LBB0_10:
	str	wzr, [x19]
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_audio_devs,8,3                 ; @audio_devs
	.comm	_OPEN_READ,4,2                  ; @OPEN_READ
	.comm	_OPEN_WRITE,4,2                 ; @OPEN_WRITE
	.comm	_SUBMDL_ALS007,8,3              ; @SUBMDL_ALS007
	.comm	_ALS007_OUTPUT_CTRL2,4,2        ; @ALS007_OUTPUT_CTRL2
.subsections_via_symbols
