	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function snd_trident_spdif_open
_snd_trident_spdif_open:                ## @snd_trident_spdif_open
	.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	%r13
	pushq	%r12
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r13
	callq	_snd_pcm_substream_chip
	movq	%rax, %r12
	movq	(%r13), %rbx
	movq	_SNDRV_TRIDENT_VOICE_TYPE_PCM@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%r15d, %r15d
	movq	%r12, %rdi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	callq	_snd_trident_alloc_voice
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %r14
	movl	$1, (%rax)
	movq	%r13, 8(%rax)
	movq	%rbx, %r15
	movq	%r12, %rbx
	addq	$20, %rbx
	movq	%rbx, %rdi
	callq	_spin_lock_irq
	movl	24(%r12), %eax
	movl	%eax, 28(%r12)
	movq	%rbx, %rdi
	movq	%r15, %rbx
	callq	_spin_unlock_irq
	movq	%r14, 8(%r15)
	movq	_snd_trident_pcm_free_substream@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 4(%r15)
	movq	(%r12), %rax
	movq	_TRIDENT_DEVICE_ID_SI7018@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_3
## %bb.4:
	movq	_snd_trident_spdif@GOTPCREL(%rip), %rax
	jmp	LBB0_5
LBB0_1:
	movq	_EAGAIN@GOTPCREL(%rip), %rax
	subl	(%rax), %r15d
	jmp	LBB0_6
LBB0_3:
	movq	_snd_trident_spdif_7018@GOTPCREL(%rip), %rax
LBB0_5:
	movl	(%rax), %eax
	movl	%eax, (%rbx)
	movq	_SNDRV_CTL_ELEM_ACCESS_INACTIVE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	notl	%eax
	movq	8(%r12), %rdx
	movq	8(%rdx), %rcx
	andl	%eax, (%rcx)
	movl	16(%r12), %edi
	movq	_SNDRV_CTL_EVENT_MASK_VALUE@GOTPCREL(%rip), %rax
	movq	_SNDRV_CTL_EVENT_MASK_INFO@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	orl	(%rax), %esi
	callq	_snd_ctl_notify
	movq	_SNDRV_PCM_HW_PARAM_BUFFER_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%r15d, %r15d
	movq	%rbx, %rdi
	xorl	%edx, %edx
	movl	$65536, %ecx                    ## imm = 0x10000
	callq	_snd_pcm_hw_constraint_minmax
LBB0_6:
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SNDRV_TRIDENT_VOICE_TYPE_PCM,4,2 ## @SNDRV_TRIDENT_VOICE_TYPE_PCM
	.comm	_EAGAIN,4,2                     ## @EAGAIN
	.comm	_snd_trident_pcm_free_substream,4,2 ## @snd_trident_pcm_free_substream
	.comm	_TRIDENT_DEVICE_ID_SI7018,8,3   ## @TRIDENT_DEVICE_ID_SI7018
	.comm	_snd_trident_spdif,4,2          ## @snd_trident_spdif
	.comm	_snd_trident_spdif_7018,4,2     ## @snd_trident_spdif_7018
	.comm	_SNDRV_CTL_ELEM_ACCESS_INACTIVE,4,2 ## @SNDRV_CTL_ELEM_ACCESS_INACTIVE
	.comm	_SNDRV_CTL_EVENT_MASK_VALUE,4,2 ## @SNDRV_CTL_EVENT_MASK_VALUE
	.comm	_SNDRV_CTL_EVENT_MASK_INFO,4,2  ## @SNDRV_CTL_EVENT_MASK_INFO
	.comm	_SNDRV_PCM_HW_PARAM_BUFFER_SIZE,4,2 ## @SNDRV_PCM_HW_PARAM_BUFFER_SIZE
	.no_dead_strip	_snd_trident_spdif_open
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function snd_trident_spdif_open
_snd_trident_spdif_open:                ; @snd_trident_spdif_open
	.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	x21, x0
	bl	_snd_pcm_substream_chip
	mov	x20, x0
	ldr	x19, [x21]
Lloh0:
	adrp	x8, _SNDRV_TRIDENT_VOICE_TYPE_PCM@GOTPAGE
Lloh1:
	ldr	x8, [x8, _SNDRV_TRIDENT_VOICE_TYPE_PCM@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	w2, #0
	mov	w3, #0
	bl	_snd_trident_alloc_voice
	cbz	x0, LBB0_2
; %bb.1:
	mov	x22, x0
	mov	w8, #1
	str	w8, [x0]
	str	x21, [x0, #8]
	add	x21, x20, #20
	mov	x0, x21
	bl	_spin_lock_irq
	ldr	w8, [x20, #24]
	str	w8, [x20, #28]
	mov	x0, x21
	bl	_spin_unlock_irq
	str	x22, [x19, #8]
Lloh3:
	adrp	x8, _snd_trident_pcm_free_substream@GOTPAGE
Lloh4:
	ldr	x8, [x8, _snd_trident_pcm_free_substream@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	str	w8, [x19, #4]
	ldr	x8, [x20]
Lloh6:
	adrp	x9, _TRIDENT_DEVICE_ID_SI7018@GOTPAGE
Lloh7:
	ldr	x9, [x9, _TRIDENT_DEVICE_ID_SI7018@GOTPAGEOFF]
Lloh8:
	ldr	x9, [x9]
Lloh9:
	adrp	x10, _snd_trident_spdif@GOTPAGE
Lloh10:
	ldr	x10, [x10, _snd_trident_spdif@GOTPAGEOFF]
Lloh11:
	adrp	x11, _snd_trident_spdif_7018@GOTPAGE
Lloh12:
	ldr	x11, [x11, _snd_trident_spdif_7018@GOTPAGEOFF]
	cmp	x8, x9
	csel	x8, x10, x11, eq
	ldr	w8, [x8]
	str	w8, [x19]
Lloh13:
	adrp	x8, _SNDRV_CTL_ELEM_ACCESS_INACTIVE@GOTPAGE
Lloh14:
	ldr	x8, [x8, _SNDRV_CTL_ELEM_ACCESS_INACTIVE@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
	ldr	x2, [x20, #8]
	ldr	x9, [x2, #8]
	ldr	w10, [x9]
	bic	w8, w10, w8
	str	w8, [x9]
Lloh16:
	adrp	x8, _SNDRV_CTL_EVENT_MASK_VALUE@GOTPAGE
Lloh17:
	ldr	x8, [x8, _SNDRV_CTL_EVENT_MASK_VALUE@GOTPAGEOFF]
	ldr	w0, [x20, #16]
Lloh18:
	ldr	w8, [x8]
Lloh19:
	adrp	x9, _SNDRV_CTL_EVENT_MASK_INFO@GOTPAGE
Lloh20:
	ldr	x9, [x9, _SNDRV_CTL_EVENT_MASK_INFO@GOTPAGEOFF]
Lloh21:
	ldr	w9, [x9]
	orr	w1, w9, w8
	bl	_snd_ctl_notify
Lloh22:
	adrp	x8, _SNDRV_PCM_HW_PARAM_BUFFER_SIZE@GOTPAGE
Lloh23:
	ldr	x8, [x8, _SNDRV_PCM_HW_PARAM_BUFFER_SIZE@GOTPAGEOFF]
Lloh24:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #0
	mov	w3, #65536
	bl	_snd_pcm_hw_constraint_minmax
	mov	w0, #0
	b	LBB0_3
LBB0_2:
Lloh25:
	adrp	x8, _EAGAIN@GOTPAGE
Lloh26:
	ldr	x8, [x8, _EAGAIN@GOTPAGEOFF]
Lloh27:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_3:
	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	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.cfi_endproc
                                        ; -- End function
	.comm	_SNDRV_TRIDENT_VOICE_TYPE_PCM,4,2 ; @SNDRV_TRIDENT_VOICE_TYPE_PCM
	.comm	_EAGAIN,4,2                     ; @EAGAIN
	.comm	_snd_trident_pcm_free_substream,4,2 ; @snd_trident_pcm_free_substream
	.comm	_TRIDENT_DEVICE_ID_SI7018,8,3   ; @TRIDENT_DEVICE_ID_SI7018
	.comm	_snd_trident_spdif,4,2          ; @snd_trident_spdif
	.comm	_snd_trident_spdif_7018,4,2     ; @snd_trident_spdif_7018
	.comm	_SNDRV_CTL_ELEM_ACCESS_INACTIVE,4,2 ; @SNDRV_CTL_ELEM_ACCESS_INACTIVE
	.comm	_SNDRV_CTL_EVENT_MASK_VALUE,4,2 ; @SNDRV_CTL_EVENT_MASK_VALUE
	.comm	_SNDRV_CTL_EVENT_MASK_INFO,4,2  ; @SNDRV_CTL_EVENT_MASK_INFO
	.comm	_SNDRV_PCM_HW_PARAM_BUFFER_SIZE,4,2 ; @SNDRV_PCM_HW_PARAM_BUFFER_SIZE
	.no_dead_strip	_snd_trident_spdif_open
.subsections_via_symbols
