	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function snd_sb_qsound_build
_snd_sb_qsound_build:                   ## @snd_sb_qsound_build
	.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	%rdi, %r15
	xorl	%edi, %edi
	testq	%r15, %r15
	sete	%dil
	callq	_snd_BUG_ON
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_5
LBB0_2:
	movq	32(%r15), %rax
	movq	(%rax), %r14
	movq	_SNDRV_SB_CSP_QSOUND_MAX_RIGHT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, %ecx
	shrl	$31, %ecx
	addl	%eax, %ecx
	sarl	%ecx
	movl	%ecx, 4(%r15)
	movl	%ecx, (%r15)
	movq	$0, 24(%r15)
	leaq	16(%r15), %rdi
	callq	_spin_lock_init
	movq	_snd_sb_qsound_switch@GOTPCREL(%rip), %rdi
	movq	%r15, %rsi
	callq	_snd_ctl_new1
	movl	%eax, 12(%r15)
	movq	%r14, %rdi
	movl	%eax, %esi
	callq	_snd_ctl_add
	testl	%eax, %eax
	js	LBB0_4
## %bb.3:
	movq	_snd_sb_qsound_space@GOTPCREL(%rip), %rdi
	movq	%r15, %rsi
	callq	_snd_ctl_new1
	movl	%eax, 8(%r15)
	movq	%r14, %rdi
	movl	%eax, %esi
	callq	_snd_ctl_add
	xorl	%ebx, %ebx
	testl	%eax, %eax
	jns	LBB0_5
LBB0_4:
	movl	%eax, %ebx
	movq	%r15, %rdi
	callq	_snd_sb_qsound_destroy
LBB0_5:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_SNDRV_SB_CSP_QSOUND_MAX_RIGHT,4,2 ## @SNDRV_SB_CSP_QSOUND_MAX_RIGHT
	.comm	_snd_sb_qsound_switch,4,2       ## @snd_sb_qsound_switch
	.comm	_snd_sb_qsound_space,4,2        ## @snd_sb_qsound_space
	.no_dead_strip	_snd_sb_qsound_build
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function snd_sb_qsound_build
_snd_sb_qsound_build:                   ; @snd_sb_qsound_build
	.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
	mov	x19, x0
	cmp	x0, #0
	cset	w0, eq
	bl	_snd_BUG_ON
	cbz	x0, LBB0_2
; %bb.1:
Lloh0:
	adrp	x8, _EINVAL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_6
LBB0_2:
	ldr	x8, [x19, #32]
	ldr	x20, [x8]
Lloh3:
	adrp	x8, _SNDRV_SB_CSP_QSOUND_MAX_RIGHT@GOTPAGE
Lloh4:
	ldr	x8, [x8, _SNDRV_SB_CSP_QSOUND_MAX_RIGHT@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	cmp	w8, #0
	cinc	w8, w8, lt
	asr	w8, w8, #1
	stp	w8, w8, [x19]
	str	xzr, [x19, #24]
	add	x0, x19, #16
	bl	_spin_lock_init
Lloh6:
	adrp	x0, _snd_sb_qsound_switch@GOTPAGE
Lloh7:
	ldr	x0, [x0, _snd_sb_qsound_switch@GOTPAGEOFF]
	mov	x1, x19
	bl	_snd_ctl_new1
	mov	x1, x0
	str	w0, [x19, #12]
	mov	x0, x20
	bl	_snd_ctl_add
	tbnz	w0, #31, LBB0_5
; %bb.3:
Lloh8:
	adrp	x0, _snd_sb_qsound_space@GOTPAGE
Lloh9:
	ldr	x0, [x0, _snd_sb_qsound_space@GOTPAGEOFF]
	mov	x1, x19
	bl	_snd_ctl_new1
	mov	x1, x0
	str	w0, [x19, #8]
	mov	x0, x20
	bl	_snd_ctl_add
	tbnz	w0, #31, LBB0_5
; %bb.4:
	mov	w21, #0
	b	LBB0_6
LBB0_5:
	mov	x21, x0
	mov	x0, x19
	bl	_snd_sb_qsound_destroy
LBB0_6:
	mov	x0, x21
	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 AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_SNDRV_SB_CSP_QSOUND_MAX_RIGHT,4,2 ; @SNDRV_SB_CSP_QSOUND_MAX_RIGHT
	.comm	_snd_sb_qsound_switch,4,2       ; @snd_sb_qsound_switch
	.comm	_snd_sb_qsound_space,4,2        ; @snd_sb_qsound_space
	.no_dead_strip	_snd_sb_qsound_build
.subsections_via_symbols
