	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sbpro_audio_prepare_for_input
_sbpro_audio_prepare_for_input:         ## @sbpro_audio_prepare_for_input
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -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_JAZZ@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_5
## %bb.4:
	xorl	%r15d, %r15d
	movq	_MDL_SMW@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_6
LBB0_5:
	movl	16(%rbx), %eax
	movq	_AFMT_S16_LE@GOTPCREL(%rip), %rcx
	xorl	%r15d, %r15d
	cmpl	(%rcx), %eax
	sete	%r15b
	shll	$2, %r15d
LBB0_6:
	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_8
## %bb.7:
	movl	32(%rbx), %esi
	movq	%rbx, %rdi
	callq	_sb_dsp_command
LBB0_8:
	movq	_DSP_CMD_SPKOFF@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_sb_dsp_command
	xorl	%eax, %eax
	cmpl	$1, 36(%rbx)
	setne	%al
	leal	(%r15,%rax,8), %esi
	addl	$160, %esi
	movq	%rbx, %rdi
	callq	_sb_dsp_command
	movq	%r14, %rdi
	callq	_spin_unlock_irqrestore
	movq	$0, 40(%rbx)
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_audio_devs,8,3                 ## @audio_devs
	.comm	_MDL_JAZZ,8,3                   ## @MDL_JAZZ
	.comm	_MDL_SMW,8,3                    ## @MDL_SMW
	.comm	_AFMT_S16_LE,4,2                ## @AFMT_S16_LE
	.comm	_DSP_CMD_SPKOFF,4,2             ## @DSP_CMD_SPKOFF
	.no_dead_strip	_sbpro_audio_prepare_for_input
.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_input
_sbpro_audio_prepare_for_input:         ; @sbpro_audio_prepare_for_input
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
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_JAZZ@GOTPAGE
Lloh4:
	ldr	x9, [x9, _MDL_JAZZ@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
Lloh6:
	adrp	x10, _MDL_SMW@GOTPAGE
Lloh7:
	ldr	x10, [x10, _MDL_SMW@GOTPAGEOFF]
Lloh8:
	ldr	x10, [x10]
	cmp	x8, x9
	ccmp	x8, x10, #4, ne
	b.ne	LBB0_5
; %bb.4:
	ldr	w8, [x19, #16]
Lloh9:
	adrp	x9, _AFMT_S16_LE@GOTPAGE
Lloh10:
	ldr	x9, [x9, _AFMT_S16_LE@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
	cmp	w8, w9
	cset	w8, eq
	lsl	w21, w8, #2
	b	LBB0_6
LBB0_5:
	mov	w21, #0
LBB0_6:
	add	x20, x19, #48
	mov	x0, x20
	bl	_spin_lock_irqsave
	mov	x0, x19
	mov	w1, #64
	bl	_sb_dsp_command
	cbz	x0, LBB0_8
; %bb.7:
	ldr	w1, [x19, #32]
	mov	x0, x19
	bl	_sb_dsp_command
LBB0_8:
Lloh12:
	adrp	x8, _DSP_CMD_SPKOFF@GOTPAGE
Lloh13:
	ldr	x8, [x8, _DSP_CMD_SPKOFF@GOTPAGEOFF]
Lloh14:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_sb_dsp_command
	ldr	w8, [x19, #36]
	mov	w9, #168
	mov	w10, #160
	cmp	w8, #1
	csel	w8, w10, w9, eq
	orr	w1, w21, w8
	mov	x0, x19
	bl	_sb_dsp_command
	mov	x0, x20
	bl	_spin_unlock_irqrestore
	str	xzr, [x19, #40]
	mov	w0, #0
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_audio_devs,8,3                 ; @audio_devs
	.comm	_MDL_JAZZ,8,3                   ; @MDL_JAZZ
	.comm	_MDL_SMW,8,3                    ; @MDL_SMW
	.comm	_AFMT_S16_LE,4,2                ; @AFMT_S16_LE
	.comm	_DSP_CMD_SPKOFF,4,2             ; @DSP_CMD_SPKOFF
	.no_dead_strip	_sbpro_audio_prepare_for_input
.subsections_via_symbols
