	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function snd_ali_enable_spdif_out
_snd_ali_enable_spdif_out:              ## @snd_ali_enable_spdif_out
	.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), %rbx
	testq	%rbx, %rbx
	je	LBB0_2
## %bb.1:
	movq	%rdi, %r14
	leaq	-25(%rbp), %r15
	movq	%rbx, %rdi
	movl	$97, %esi
	movq	%r15, %rdx
	callq	_pci_read_config_byte
	movzbl	-25(%rbp), %edx
	orl	$64, %edx
	movb	%dl, -25(%rbp)
	movq	%rbx, %rdi
	movl	$97, %esi
	callq	_pci_write_config_byte
	movq	%rbx, %rdi
	movl	$125, %esi
	movq	%r15, %rdx
	callq	_pci_read_config_byte
	movzbl	-25(%rbp), %edx
	orl	$1, %edx
	movb	%dl, -25(%rbp)
	movq	%rbx, %rdi
	movl	$125, %esi
	callq	_pci_write_config_byte
	movq	%rbx, %rdi
	movl	$126, %esi
	movq	%r15, %rdx
	callq	_pci_read_config_byte
	movb	-25(%rbp), %al
	andb	$-49, %al
	orb	$16, %al
	movb	%al, -25(%rbp)
	movzbl	%al, %edx
	movq	%rbx, %rdi
	movl	$126, %esi
	callq	_pci_write_config_byte
	movq	_ALI_SCTRL@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	movq	%r14, %rdi
	callq	_ALI_REG
	movl	%eax, %edi
	callq	_inb
	movl	%eax, %ebx
	movb	%al, -25(%rbp)
	movq	_ALI_SPDIF_OUT_ENABLE@GOTPCREL(%rip), %rax
	orb	(%rax), %bl
	movl	(%r15), %esi
	movq	%r14, %rdi
	callq	_ALI_REG
	movzbl	%bl, %edi
	movl	%eax, %esi
	callq	_outb
	movq	_ALI_SPDIF_CTRL@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	movq	%r14, %rdi
	callq	_ALI_REG
	movl	%eax, %edi
	callq	_inb
	movl	%eax, %ebx
	movb	%al, -25(%rbp)
	movq	_ALI_SPDIF_OUT_CH_STATUS@GOTPCREL(%rip), %rax
	andb	(%rax), %bl
	movl	(%r15), %esi
	movq	%r14, %rdi
	callq	_ALI_REG
	movzbl	%bl, %edi
	movl	%eax, %esi
	callq	_outb
	movq	_ALI_GLOBAL_CONTROL@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	movq	%r14, %rdi
	callq	_ALI_REG
	movl	%eax, %edi
	callq	_inw
	movl	%eax, %ebx
	movq	_ALI_SPDIF_OUT_SEL_PCM@GOTPCREL(%rip), %rax
	orw	(%rax), %bx
	movl	(%r15), %esi
	movq	%r14, %rdi
	callq	_ALI_REG
	movzwl	%bx, %edi
	movl	%eax, %esi
	callq	_outw
	movq	_ALI_SPDIF_OUT_CHANNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_snd_ali_disable_special_channel
LBB0_2:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ALI_SCTRL,4,2                  ## @ALI_SCTRL
	.comm	_ALI_SPDIF_OUT_ENABLE,1,0       ## @ALI_SPDIF_OUT_ENABLE
	.comm	_ALI_SPDIF_CTRL,4,2             ## @ALI_SPDIF_CTRL
	.comm	_ALI_SPDIF_OUT_CH_STATUS,1,0    ## @ALI_SPDIF_OUT_CH_STATUS
	.comm	_ALI_GLOBAL_CONTROL,4,2         ## @ALI_GLOBAL_CONTROL
	.comm	_ALI_SPDIF_OUT_SEL_PCM,2,1      ## @ALI_SPDIF_OUT_SEL_PCM
	.comm	_ALI_SPDIF_OUT_CHANNEL,4,2      ## @ALI_SPDIF_OUT_CHANNEL
	.no_dead_strip	_snd_ali_enable_spdif_out
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function snd_ali_enable_spdif_out
_snd_ali_enable_spdif_out:              ; @snd_ali_enable_spdif_out
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	ldr	x20, [x0]
	cbz	x20, LBB0_2
; %bb.1:
	mov	x19, x0
	add	x2, sp, #15
	mov	x0, x20
	mov	w1, #97
	bl	_pci_read_config_byte
	ldrb	w8, [sp, #15]
	orr	w2, w8, #0x40
	strb	w2, [sp, #15]
	mov	x0, x20
	mov	w1, #97
	bl	_pci_write_config_byte
	add	x2, sp, #15
	mov	x0, x20
	mov	w1, #125
	bl	_pci_read_config_byte
	ldrb	w8, [sp, #15]
	orr	w2, w8, #0x1
	strb	w2, [sp, #15]
	mov	x0, x20
	mov	w1, #125
	bl	_pci_write_config_byte
	add	x2, sp, #15
	mov	x0, x20
	mov	w1, #126
	bl	_pci_read_config_byte
	ldrb	w8, [sp, #15]
	and	w8, w8, #0xffffffcf
	orr	w8, w8, #0x10
	strb	w8, [sp, #15]
	and	w2, w8, #0xff
	mov	x0, x20
	mov	w1, #126
	bl	_pci_write_config_byte
Lloh0:
	adrp	x20, _ALI_SCTRL@GOTPAGE
Lloh1:
	ldr	x20, [x20, _ALI_SCTRL@GOTPAGEOFF]
	ldr	w1, [x20]
	mov	x0, x19
	bl	_ALI_REG
	bl	_inb
	strb	w0, [sp, #15]
Lloh2:
	adrp	x8, _ALI_SPDIF_OUT_ENABLE@GOTPAGE
Lloh3:
	ldr	x8, [x8, _ALI_SPDIF_OUT_ENABLE@GOTPAGEOFF]
	ldrb	w8, [x8]
	orr	w21, w8, w0
	ldr	w1, [x20]
	mov	x0, x19
	bl	_ALI_REG
	mov	x1, x0
	and	w0, w21, #0xff
	bl	_outb
Lloh4:
	adrp	x21, _ALI_SPDIF_CTRL@GOTPAGE
Lloh5:
	ldr	x21, [x21, _ALI_SPDIF_CTRL@GOTPAGEOFF]
	ldr	w1, [x21]
	mov	x0, x19
	bl	_ALI_REG
	bl	_inb
	strb	w0, [sp, #15]
Lloh6:
	adrp	x8, _ALI_SPDIF_OUT_CH_STATUS@GOTPAGE
Lloh7:
	ldr	x8, [x8, _ALI_SPDIF_OUT_CH_STATUS@GOTPAGEOFF]
	ldrb	w8, [x8]
	and	w20, w8, w0
	ldr	w1, [x21]
	mov	x0, x19
	bl	_ALI_REG
	mov	x1, x0
	mov	x0, x20
	bl	_outb
Lloh8:
	adrp	x21, _ALI_GLOBAL_CONTROL@GOTPAGE
Lloh9:
	ldr	x21, [x21, _ALI_GLOBAL_CONTROL@GOTPAGEOFF]
	ldr	w1, [x21]
	mov	x0, x19
	bl	_ALI_REG
	bl	_inw
Lloh10:
	adrp	x8, _ALI_SPDIF_OUT_SEL_PCM@GOTPAGE
Lloh11:
	ldr	x8, [x8, _ALI_SPDIF_OUT_SEL_PCM@GOTPAGEOFF]
	ldrh	w8, [x8]
	orr	w20, w8, w0
	ldr	w1, [x21]
	mov	x0, x19
	bl	_ALI_REG
	mov	x1, x0
	mov	x0, x20
	bl	_outw
Lloh12:
	adrp	x8, _ALI_SPDIF_OUT_CHANNEL@GOTPAGE
Lloh13:
	ldr	x8, [x8, _ALI_SPDIF_OUT_CHANNEL@GOTPAGEOFF]
Lloh14:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_snd_ali_disable_special_channel
LBB0_2:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.comm	_ALI_SCTRL,4,2                  ; @ALI_SCTRL
	.comm	_ALI_SPDIF_OUT_ENABLE,1,0       ; @ALI_SPDIF_OUT_ENABLE
	.comm	_ALI_SPDIF_CTRL,4,2             ; @ALI_SPDIF_CTRL
	.comm	_ALI_SPDIF_OUT_CH_STATUS,1,0    ; @ALI_SPDIF_OUT_CH_STATUS
	.comm	_ALI_GLOBAL_CONTROL,4,2         ; @ALI_GLOBAL_CONTROL
	.comm	_ALI_SPDIF_OUT_SEL_PCM,2,1      ; @ALI_SPDIF_OUT_SEL_PCM
	.comm	_ALI_SPDIF_OUT_CHANNEL,4,2      ; @ALI_SPDIF_OUT_CHANNEL
	.no_dead_strip	_snd_ali_enable_spdif_out
.subsections_via_symbols
