	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sbpro_audio_prepare_for_output
_sbpro_audio_prepare_for_output:        ## @sbpro_audio_prepare_for_output
	.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), %rax
	movq	(%rax), %rax
	movslq	%edi, %rcx
	movq	(%rax,%rcx,8), %rax
	movq	16(%rax), %rbx
	movq	(%rbx), %rcx
	testq	%rcx, %rcx
	js	LBB0_3
## %bb.1:
	movq	8(%rbx), %rdx
	cmpq	%rdx, %rcx
	je	LBB0_3
## %bb.2:
	cmpl	$16, 16(%rbx)
	cmoveq	%rcx, %rdx
	movq	(%rax), %rcx
	movq	%rdx, (%rcx)
	movq	8(%rax), %rax
	movq	%rdx, (%rax)
LBB0_3:
	movq	24(%rbx), %rax
	movq	_MDL_SBPRO@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_5
## %bb.4:
	xorl	%esi, %esi
	cmpl	$2, 32(%rbx)
	sete	%sil
	movq	%rbx, %rdi
	callq	_sb_mixer_set_stereo
LBB0_5:
	leaq	48(%rbx), %r14
	movq	%r14, %rdi
	callq	_spin_lock_irqsave
	movq	%rbx, %rdi
	movl	$64, %esi
	callq	_sb_dsp_command
	testq	%rax, %rax
	je	LBB0_7
## %bb.6:
	movl	36(%rbx), %esi
	movq	%rbx, %rdi
	callq	_sb_dsp_command
LBB0_7:
	movq	_DSP_CMD_SPKON@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_sb_dsp_command
	movq	24(%rbx), %rax
	movq	_MDL_JAZZ@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_9
## %bb.8:
	movq	_MDL_SMW@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_9
## %bb.10:
	movq	%r14, %rdi
	callq	_spin_unlock_irqrestore
	movq	%rbx, %rdi
	movl	$14, %esi
	callq	_sb_getmixer
	cmpl	$1, 32(%rbx)
	setne	%cl
	andb	$-3, %al
	addb	%cl, %cl
	orb	%al, %cl
	movzbl	%cl, %edx
	movq	%rbx, %rdi
	movl	$14, %esi
	callq	_sb_setmixer
	jmp	LBB0_11
LBB0_9:
	movq	_AFMT_S16_LE@GOTPCREL(%rip), %rax
	movl	16(%rbx), %ecx
	xorl	%edx, %edx
	cmpl	(%rax), %ecx
	sete	%dl
	shll	$2, %edx
	xorl	%eax, %eax
	cmpl	$1, 32(%rbx)
	setne	%al
	leal	(%rdx,%rax,8), %esi
	addl	$160, %esi
	movq	%rbx, %rdi
	callq	_sb_dsp_command
	movq	%r14, %rdi
	callq	_spin_unlock_irqrestore
LBB0_11:
	movq	$0, 40(%rbx)
	xorl	%eax, %eax
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_audio_devs,8,3                 ## @audio_devs
	.comm	_MDL_SBPRO,8,3                  ## @MDL_SBPRO
	.comm	_DSP_CMD_SPKON,4,2              ## @DSP_CMD_SPKON
	.comm	_MDL_JAZZ,8,3                   ## @MDL_JAZZ
	.comm	_MDL_SMW,8,3                    ## @MDL_SMW
	.comm	_AFMT_S16_LE,4,2                ## @AFMT_S16_LE
	.no_dead_strip	_sbpro_audio_prepare_for_output
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sbpro_audio_prepare_for_output
_sbpro_audio_prepare_for_output:        ; @sbpro_audio_prepare_for_output
	.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
Lloh0:
	adrp	x8, _audio_devs@GOTPAGE
Lloh1:
	ldr	x8, [x8, _audio_devs@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	ldr	x8, [x8, w0, sxtw #3]
	ldr	x19, [x8, #16]
	ldr	x9, [x19]
	tbnz	x9, #63, LBB0_3
; %bb.1:
	ldr	x10, [x19, #8]
	cmp	x9, x10
	b.eq	LBB0_3
; %bb.2:
	ldr	w11, [x19, #16]
	cmp	w11, #16
	csel	x9, x9, x10, eq
	ldp	x10, x8, [x8]
	str	x9, [x10]
	str	x9, [x8]
LBB0_3:
	ldr	x8, [x19, #24]
Lloh3:
	adrp	x9, _MDL_SBPRO@GOTPAGE
Lloh4:
	ldr	x9, [x9, _MDL_SBPRO@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_5
; %bb.4:
	ldr	w8, [x19, #32]
	cmp	w8, #2
	cset	w1, eq
	mov	x0, x19
	bl	_sb_mixer_set_stereo
LBB0_5:
	add	x20, x19, #48
	mov	x0, x20
	bl	_spin_lock_irqsave
	mov	x0, x19
	mov	w1, #64
	bl	_sb_dsp_command
	cbz	x0, LBB0_7
; %bb.6:
	ldr	w1, [x19, #36]
	mov	x0, x19
	bl	_sb_dsp_command
LBB0_7:
Lloh6:
	adrp	x8, _DSP_CMD_SPKON@GOTPAGE
Lloh7:
	ldr	x8, [x8, _DSP_CMD_SPKON@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_sb_dsp_command
	ldr	x8, [x19, #24]
Lloh9:
	adrp	x9, _MDL_JAZZ@GOTPAGE
Lloh10:
	ldr	x9, [x9, _MDL_JAZZ@GOTPAGEOFF]
Lloh11:
	ldr	x9, [x9]
Lloh12:
	adrp	x10, _MDL_SMW@GOTPAGE
Lloh13:
	ldr	x10, [x10, _MDL_SMW@GOTPAGEOFF]
Lloh14:
	ldr	x10, [x10]
	cmp	x8, x9
	ccmp	x8, x10, #4, ne
	b.ne	LBB0_9
; %bb.8:
	ldr	w8, [x19, #16]
Lloh15:
	adrp	x9, _AFMT_S16_LE@GOTPAGE
Lloh16:
	ldr	x9, [x9, _AFMT_S16_LE@GOTPAGEOFF]
Lloh17:
	ldr	w9, [x9]
	cmp	w8, w9
	cset	w8, eq
	ldr	w9, [x19, #32]
	mov	w10, #168
	mov	w11, #160
	cmp	w9, #1
	csel	w1, w11, w10, eq
	bfi	w1, w8, #2, #1
	mov	x0, x19
	bl	_sb_dsp_command
	mov	x0, x20
	bl	_spin_unlock_irqrestore
	b	LBB0_10
LBB0_9:
	mov	x0, x20
	bl	_spin_unlock_irqrestore
	mov	x0, x19
	mov	w1, #14
	bl	_sb_getmixer
	ldr	w8, [x19, #32]
	cmp	w8, #1
	cset	w8, ne
	and	w9, w0, #0xfffffffd
	orr	w2, w9, w8, lsl #1
	mov	x0, x19
	mov	w1, #14
	bl	_sb_setmixer
LBB0_10:
	str	xzr, [x19, #40]
	mov	w0, #0
	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	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_audio_devs,8,3                 ; @audio_devs
	.comm	_MDL_SBPRO,8,3                  ; @MDL_SBPRO
	.comm	_DSP_CMD_SPKON,4,2              ; @DSP_CMD_SPKON
	.comm	_MDL_JAZZ,8,3                   ; @MDL_JAZZ
	.comm	_MDL_SMW,8,3                    ; @MDL_SMW
	.comm	_AFMT_S16_LE,4,2                ; @AFMT_S16_LE
	.no_dead_strip	_sbpro_audio_prepare_for_output
.subsections_via_symbols
