	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function vortex_spdif_init
_vortex_spdif_init:                     ## @vortex_spdif_init
	.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
	movl	%edx, -44(%rbp)                 ## 4-byte Spill
	movl	%esi, -48(%rbp)                 ## 4-byte Spill
	movq	%rdi, %r13
	movl	(%rdi), %r15d
	movq	_VORTEX_SPDIF_FLAGS@GOTPCREL(%rip), %rax
	movq	(%rax), %rbx
	movl	%r15d, %edi
	movq	%rbx, %rsi
	callq	_hwread
	andl	$-786435, %eax                  ## imm = 0xFFF3FFFD
	movl	%r15d, %edi
	movq	%rbx, %rsi
	movl	%eax, %edx
	callq	_hwwrite
	movl	(%r13), %edi
	movq	_VORTEX_SPDIF_CFG1@GOTPCREL(%rip), %r14
	movq	(%r14), %rsi
	xorl	%r15d, %r15d
	xorl	%edx, %edx
	callq	_hwwrite
	movl	(%r13), %edi
	movq	(%r14), %rsi
	addq	$4, %rsi
	xorl	%edx, %edx
	callq	_hwwrite
	movl	(%r13), %edi
	movq	(%r14), %rsi
	addq	$8, %rsi
	xorl	%edx, %edx
	callq	_hwwrite
	movl	(%r13), %edi
	movq	(%r14), %rsi
	addq	$12, %rsi
	xorl	%edx, %edx
	callq	_hwwrite
	movl	(%r13), %edi
	movq	(%r14), %rsi
	addq	$16, %rsi
	xorl	%edx, %edx
	callq	_hwwrite
	movl	(%r13), %edi
	movq	(%r14), %rsi
	addq	$20, %rsi
	xorl	%edx, %edx
	callq	_hwwrite
	movl	(%r13), %edi
	movq	(%r14), %rsi
	addq	$24, %rsi
	xorl	%edx, %edx
	callq	_hwwrite
	movl	(%r13), %edi
	movq	(%r14), %rsi
	addq	$28, %rsi
	xorl	%edx, %edx
	callq	_hwwrite
	movl	(%r13), %edi
	movq	(%r14), %rsi
	addq	$32, %rsi
	xorl	%edx, %edx
	callq	_hwwrite
	movl	(%r13), %edi
	movq	(%r14), %rsi
	addq	$36, %rsi
	xorl	%edx, %edx
	callq	_hwwrite
	movl	(%r13), %edi
	movq	(%r14), %rsi
	addq	$40, %rsi
	xorl	%edx, %edx
	callq	_hwwrite
	movl	(%r13), %ebx
	movq	_VORTEX_CODEC_EN@GOTPCREL(%rip), %rax
	movq	(%rax), %r12
	movl	%ebx, %edi
	movq	%r12, %rsi
	callq	_hwread
	movq	_EN_SPDIF@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movl	%ebx, %edi
	movl	-48(%rbp), %ebx                 ## 4-byte Reload
	movq	%r12, %rsi
	movl	%eax, %edx
	callq	_hwwrite
	cmpl	$48000, %ebx                    ## imm = 0xBB80
	je	LBB0_6
## %bb.1:
	cmpl	$44100, %ebx                    ## imm = 0xAC44
	je	LBB0_5
## %bb.2:
	cmpl	$32000, %ebx                    ## imm = 0x7D00
	jne	LBB0_3
## %bb.4:
	movl	$32141, %ebx                    ## imm = 0x7D8D
	movl	$50331648, %r15d                ## imm = 0x3000000
	jmp	LBB0_7
LBB0_6:
	cmpl	$1, -44(%rbp)                   ## 4-byte Folded Reload
	movl	$33554432, %eax                 ## imm = 0x2000000
	movl	$131, %r15d
	cmovel	%eax, %r15d
	movl	$48014, %ebx                    ## imm = 0xBB8E
	jmp	LBB0_7
LBB0_5:
	movl	$44236, %ebx                    ## imm = 0xACCC
	movl	$50331648, %r15d                ## imm = 0x3000000
	jmp	LBB0_7
LBB0_3:
	orl	$140, %ebx
LBB0_7:
	movl	(%r13), %edi
	movq	_VORTEX_SPDIF_CFG0@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	movl	%r15d, %edx
	andl	$131, %edx
	callq	_hwwrite
	movl	(%r13), %edi
	movq	(%r14), %rsi
	shrl	$16, %r15d
	movl	%r15d, %edx
	callq	_hwwrite
	movl	(%r13), %edi
	movq	_VORTEX_SPDIF_SMPRATE@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	movl	%ebx, %edx
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_hwwrite                        ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_VORTEX_SPDIF_FLAGS,8,3         ## @VORTEX_SPDIF_FLAGS
	.comm	_VORTEX_SPDIF_CFG1,8,3          ## @VORTEX_SPDIF_CFG1
	.comm	_VORTEX_CODEC_EN,8,3            ## @VORTEX_CODEC_EN
	.comm	_EN_SPDIF,4,2                   ## @EN_SPDIF
	.comm	_VORTEX_SPDIF_CFG0,8,3          ## @VORTEX_SPDIF_CFG0
	.comm	_VORTEX_SPDIF_SMPRATE,8,3       ## @VORTEX_SPDIF_SMPRATE
	.no_dead_strip	_vortex_spdif_init
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function vortex_spdif_init
_vortex_spdif_init:                     ; @vortex_spdif_init
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x21, x2
	mov	x20, x1
	mov	x19, x0
	ldr	w22, [x0]
Lloh0:
	adrp	x8, _VORTEX_SPDIF_FLAGS@GOTPAGE
Lloh1:
	ldr	x8, [x8, _VORTEX_SPDIF_FLAGS@GOTPAGEOFF]
Lloh2:
	ldr	x23, [x8]
	mov	x0, x22
	mov	x1, x23
	bl	_hwread
	mov	w8, #65533
	movk	w8, #65523, lsl #16
	and	w2, w0, w8
	mov	x0, x22
	mov	x1, x23
	bl	_hwwrite
	ldr	w0, [x19]
Lloh3:
	adrp	x24, _VORTEX_SPDIF_CFG1@GOTPAGE
Lloh4:
	ldr	x24, [x24, _VORTEX_SPDIF_CFG1@GOTPAGEOFF]
	ldr	x1, [x24]
	mov	w2, #0
	bl	_hwwrite
	ldr	w0, [x19]
	ldr	x8, [x24]
	add	x1, x8, #4
	mov	w2, #0
	bl	_hwwrite
	ldr	w0, [x19]
	ldr	x8, [x24]
	add	x1, x8, #8
	mov	w2, #0
	bl	_hwwrite
	ldr	w0, [x19]
	ldr	x8, [x24]
	add	x1, x8, #12
	mov	w2, #0
	bl	_hwwrite
	ldr	w0, [x19]
	ldr	x8, [x24]
	add	x1, x8, #16
	mov	w2, #0
	bl	_hwwrite
	ldr	w0, [x19]
	ldr	x8, [x24]
	add	x1, x8, #20
	mov	w2, #0
	bl	_hwwrite
	ldr	w0, [x19]
	ldr	x8, [x24]
	add	x1, x8, #24
	mov	w2, #0
	bl	_hwwrite
	ldr	w0, [x19]
	ldr	x8, [x24]
	add	x1, x8, #28
	mov	w2, #0
	bl	_hwwrite
	ldr	w0, [x19]
	ldr	x8, [x24]
	add	x1, x8, #32
	mov	w2, #0
	bl	_hwwrite
	ldr	w0, [x19]
	ldr	x8, [x24]
	add	x1, x8, #36
	mov	w2, #0
	bl	_hwwrite
	ldr	w0, [x19]
	ldr	x8, [x24]
	add	x1, x8, #40
	mov	w2, #0
	bl	_hwwrite
	ldr	w22, [x19]
Lloh5:
	adrp	x8, _VORTEX_CODEC_EN@GOTPAGE
Lloh6:
	ldr	x8, [x8, _VORTEX_CODEC_EN@GOTPAGEOFF]
Lloh7:
	ldr	x23, [x8]
	mov	x0, x22
	mov	x1, x23
	bl	_hwread
Lloh8:
	adrp	x8, _EN_SPDIF@GOTPAGE
Lloh9:
	ldr	x8, [x8, _EN_SPDIF@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	orr	w2, w8, w0
	mov	x0, x22
	mov	x1, x23
	bl	_hwwrite
	mov	w8, #48000
	cmp	w20, w8
	b.eq	LBB0_4
; %bb.1:
	mov	w8, #44100
	cmp	w20, w8
	b.eq	LBB0_5
; %bb.2:
	mov	w8, #32000
	cmp	w20, w8
	b.ne	LBB0_6
; %bb.3:
	mov	w20, #32141
	mov	w21, #50331648
	b	LBB0_7
LBB0_4:
	mov	w8, #131
	mov	w9, #33554432
	cmp	w21, #1
	csel	w21, w9, w8, eq
	mov	w20, #48014
	b	LBB0_7
LBB0_5:
	mov	w20, #44236
	mov	w21, #50331648
	b	LBB0_7
LBB0_6:
	mov	w21, #0
	mov	w8, #140
	orr	w20, w20, w8
LBB0_7:
	ldr	w0, [x19]
Lloh11:
	adrp	x8, _VORTEX_SPDIF_CFG0@GOTPAGE
Lloh12:
	ldr	x8, [x8, _VORTEX_SPDIF_CFG0@GOTPAGEOFF]
Lloh13:
	ldr	x1, [x8]
	mov	w8, #131
	and	w2, w21, w8
	bl	_hwwrite
	ldr	w0, [x19]
	ldr	x1, [x24]
	lsr	w2, w21, #16
	bl	_hwwrite
	ldr	w0, [x19]
Lloh14:
	adrp	x8, _VORTEX_SPDIF_SMPRATE@GOTPAGE
Lloh15:
	ldr	x8, [x8, _VORTEX_SPDIF_SMPRATE@GOTPAGEOFF]
Lloh16:
	ldr	x1, [x8]
	mov	x2, x20
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	b	_hwwrite
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_VORTEX_SPDIF_FLAGS,8,3         ; @VORTEX_SPDIF_FLAGS
	.comm	_VORTEX_SPDIF_CFG1,8,3          ; @VORTEX_SPDIF_CFG1
	.comm	_VORTEX_CODEC_EN,8,3            ; @VORTEX_CODEC_EN
	.comm	_EN_SPDIF,4,2                   ; @EN_SPDIF
	.comm	_VORTEX_SPDIF_CFG0,8,3          ; @VORTEX_SPDIF_CFG0
	.comm	_VORTEX_SPDIF_SMPRATE,8,3       ; @VORTEX_SPDIF_SMPRATE
	.no_dead_strip	_vortex_spdif_init
.subsections_via_symbols
