	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function tda998x_configure_audio
_tda998x_configure_audio:               ## @tda998x_configure_audio
	.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	%r12
	pushq	%rbx
	subq	$32, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -40(%rbp)
	cmpq	$0, (%rdi)
	je	LBB0_2
## %bb.1:
	movq	%rdi, %rbx
	movl	8(%rdi), %esi
	callq	_tda998x_get_adiv
	movl	%eax, %r14d
	movq	_REG_ENA_AP@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	(%rbx), %edx
	movq	%rbx, %rdi
	callq	_reg_write
	movq	_REG_ENA_ACLK@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	40(%rbx), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	callq	_reg_write
	movq	_REG_MUX_AP@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	40(%rbx), %rax
	movl	4(%rax), %edx
	movq	%rbx, %rdi
	callq	_reg_write
	movq	_REG_I2S_FORMAT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	12(%rbx), %edx
	movq	%rbx, %rdi
	callq	_reg_write
	movq	_REG_AIP_CLKSEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	40(%rbx), %rax
	movl	8(%rax), %edx
	movq	%rbx, %rdi
	callq	_reg_write
	movq	_REG_AIP_CNTRL_0@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	movq	_AIP_CNTRL_0_LAYOUT@GOTPCREL(%rip), %rax
	movq	_AIP_CNTRL_0_ACR_MAN@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	orl	(%rax), %edx
	movq	%rbx, %rdi
	callq	_reg_clear
	movq	_REG_CTS_N@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	16(%rbx), %edx
	movq	%rbx, %rdi
	callq	_reg_write
	movq	_REG_AUDIO_DIV@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	movl	%r14d, %edx
	callq	_reg_write
	movl	8(%rbx), %eax
	shll	$7, %eax
	cltq
	imulq	$274877907, %rax, %rax          ## imm = 0x10624DD3
	movq	%rax, %rcx
	shrq	$63, %rcx
	sarq	$38, %rax
	addl	%ecx, %eax
	movabsq	$283467841604, %rcx             ## imm = 0x4200000044
	movq	%rcx, -64(%rbp)
	movl	$1, -56(%rbp)
	movl	%eax, -52(%rbp)
	movl	%eax, %ecx
	sarl	$8, %ecx
	movl	%ecx, -48(%rbp)
	sarl	$16, %eax
	movl	%eax, -44(%rbp)
	movq	_REG_ACR_CTS_0@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-64(%rbp), %r14
	movq	%rbx, %rdi
	movq	%r14, %rdx
	movl	$6, %ecx
	callq	_reg_write_range
	movl	(%r15), %esi
	movq	_AIP_CNTRL_0_RST_CTS@GOTPCREL(%rip), %r12
	movl	(%r12), %edx
	movq	%rbx, %rdi
	callq	_reg_set
	movl	(%r15), %esi
	movl	(%r12), %edx
	movq	%rbx, %rdi
	callq	_reg_clear
	movq	24(%rbx), %rax
	movsd	(%rax), %xmm0                   ## xmm0 = mem[0],zero
	movsd	12(%rax), %xmm1                 ## xmm1 = mem[0],zero
	movlhps	%xmm1, %xmm0                    ## xmm0 = xmm0[0],xmm1[0]
	movaps	%xmm0, -64(%rbp)
	xorl	%edi, %edi
	callq	_REG_CH_STAT_B
	movq	%rbx, %rdi
	movl	%eax, %esi
	movq	%r14, %rdx
	movl	$4, %ecx
	callq	_reg_write_range
	movq	%rbx, %rdi
	movl	$1, %esi
	callq	_tda998x_audio_mute
	movl	$20, %edi
	callq	_msleep
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_tda998x_audio_mute
	leaq	32(%rbx), %rsi
	movq	%rbx, %rdi
	callq	_tda998x_write_aif
LBB0_2:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-40(%rbp), %rax
	jne	LBB0_4
## %bb.3:
	addq	$32, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_4:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_REG_ENA_AP,4,2                 ## @REG_ENA_AP
	.comm	_REG_ENA_ACLK,4,2               ## @REG_ENA_ACLK
	.comm	_REG_MUX_AP,4,2                 ## @REG_MUX_AP
	.comm	_REG_I2S_FORMAT,4,2             ## @REG_I2S_FORMAT
	.comm	_REG_AIP_CLKSEL,4,2             ## @REG_AIP_CLKSEL
	.comm	_REG_AIP_CNTRL_0,4,2            ## @REG_AIP_CNTRL_0
	.comm	_AIP_CNTRL_0_LAYOUT,4,2         ## @AIP_CNTRL_0_LAYOUT
	.comm	_AIP_CNTRL_0_ACR_MAN,4,2        ## @AIP_CNTRL_0_ACR_MAN
	.comm	_REG_CTS_N,4,2                  ## @REG_CTS_N
	.comm	_REG_AUDIO_DIV,4,2              ## @REG_AUDIO_DIV
	.comm	_REG_ACR_CTS_0,4,2              ## @REG_ACR_CTS_0
	.comm	_AIP_CNTRL_0_RST_CTS,4,2        ## @AIP_CNTRL_0_RST_CTS
	.no_dead_strip	_tda998x_configure_audio
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal8,8byte_literals
	.p2align	3                               ; -- Begin function tda998x_configure_audio
lCPI0_0:
	.long	68                              ; 0x44
	.long	66                              ; 0x42
lCPI0_1:
	.long	4294967288                      ; 0xfffffff8
	.long	4294967280                      ; 0xfffffff0
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	2
_tda998x_configure_audio:               ; @tda998x_configure_audio
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [sp, #24]
	ldr	x8, [x0]
	cbz	x8, LBB0_2
; %bb.1:
	mov	x19, x0
	ldr	w1, [x0, #8]
	bl	_tda998x_get_adiv
	mov	x20, x0
Lloh3:
	adrp	x8, _REG_ENA_AP@GOTPAGE
Lloh4:
	ldr	x8, [x8, _REG_ENA_AP@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	ldr	w2, [x19]
	mov	x0, x19
	bl	_reg_write
Lloh6:
	adrp	x8, _REG_ENA_ACLK@GOTPAGE
Lloh7:
	ldr	x8, [x8, _REG_ENA_ACLK@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	ldr	x8, [x19, #40]
	ldr	w2, [x8]
	mov	x0, x19
	bl	_reg_write
Lloh9:
	adrp	x8, _REG_MUX_AP@GOTPAGE
Lloh10:
	ldr	x8, [x8, _REG_MUX_AP@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
	ldr	x8, [x19, #40]
	ldr	w2, [x8, #4]
	mov	x0, x19
	bl	_reg_write
Lloh12:
	adrp	x8, _REG_I2S_FORMAT@GOTPAGE
Lloh13:
	ldr	x8, [x8, _REG_I2S_FORMAT@GOTPAGEOFF]
Lloh14:
	ldr	w1, [x8]
	ldr	w2, [x19, #12]
	mov	x0, x19
	bl	_reg_write
Lloh15:
	adrp	x8, _REG_AIP_CLKSEL@GOTPAGE
Lloh16:
	ldr	x8, [x8, _REG_AIP_CLKSEL@GOTPAGEOFF]
Lloh17:
	ldr	w1, [x8]
	ldr	x8, [x19, #40]
	ldr	w2, [x8, #8]
	mov	x0, x19
	bl	_reg_write
Lloh18:
	adrp	x21, _REG_AIP_CNTRL_0@GOTPAGE
Lloh19:
	ldr	x21, [x21, _REG_AIP_CNTRL_0@GOTPAGEOFF]
Lloh20:
	adrp	x8, _AIP_CNTRL_0_LAYOUT@GOTPAGE
Lloh21:
	ldr	x8, [x8, _AIP_CNTRL_0_LAYOUT@GOTPAGEOFF]
	ldr	w1, [x21]
Lloh22:
	ldr	w8, [x8]
Lloh23:
	adrp	x9, _AIP_CNTRL_0_ACR_MAN@GOTPAGE
Lloh24:
	ldr	x9, [x9, _AIP_CNTRL_0_ACR_MAN@GOTPAGEOFF]
Lloh25:
	ldr	w9, [x9]
	orr	w2, w9, w8
	mov	x0, x19
	bl	_reg_clear
Lloh26:
	adrp	x8, _REG_CTS_N@GOTPAGE
Lloh27:
	ldr	x8, [x8, _REG_CTS_N@GOTPAGEOFF]
Lloh28:
	ldr	w1, [x8]
	ldr	w2, [x19, #16]
	mov	x0, x19
	bl	_reg_write
Lloh29:
	adrp	x8, _REG_AUDIO_DIV@GOTPAGE
Lloh30:
	ldr	x8, [x8, _REG_AUDIO_DIV@GOTPAGEOFF]
Lloh31:
	ldr	w1, [x8]
	mov	x0, x19
	mov	x2, x20
	bl	_reg_write
	ldr	w8, [x19, #8]
	lsl	w8, w8, #7
	mov	w9, #19923
	movk	w9, #4194, lsl #16
	smull	x8, w8, w9
	lsr	x9, x8, #32
	lsr	x8, x8, #63
	add	w8, w8, w9, asr #6
Lloh32:
	adrp	x9, lCPI0_0@PAGE
Lloh33:
	ldr	d0, [x9, lCPI0_0@PAGEOFF]
	str	d0, [sp]
	mov	w9, #1
	stp	w9, w8, [sp, #8]
	dup.2s	v0, w8
Lloh34:
	adrp	x8, lCPI0_1@PAGE
Lloh35:
	ldr	d1, [x8, lCPI0_1@PAGEOFF]
	sshl.2s	v0, v0, v1
	str	d0, [sp, #16]
Lloh36:
	adrp	x8, _REG_ACR_CTS_0@GOTPAGE
Lloh37:
	ldr	x8, [x8, _REG_ACR_CTS_0@GOTPAGEOFF]
Lloh38:
	ldr	w1, [x8]
	mov	x2, sp
	mov	x0, x19
	mov	w3, #6
	bl	_reg_write_range
	ldr	w1, [x21]
Lloh39:
	adrp	x20, _AIP_CNTRL_0_RST_CTS@GOTPAGE
Lloh40:
	ldr	x20, [x20, _AIP_CNTRL_0_RST_CTS@GOTPAGEOFF]
	ldr	w2, [x20]
	mov	x0, x19
	bl	_reg_set
	ldr	w1, [x21]
	ldr	w2, [x20]
	mov	x0, x19
	bl	_reg_clear
	ldr	x8, [x19, #24]
	ldr	d0, [x8]
	ldur	d1, [x8, #12]
	mov.d	v0[1], v1[0]
	str	q0, [sp]
	mov	w0, #0
	bl	_REG_CH_STAT_B
	mov	x1, x0
	mov	x2, sp
	mov	x0, x19
	mov	w3, #4
	bl	_reg_write_range
	mov	x0, x19
	mov	w1, #1
	bl	_tda998x_audio_mute
	mov	w0, #20
	bl	_msleep
	mov	x0, x19
	mov	w1, #0
	bl	_tda998x_audio_mute
	add	x1, x19, #32
	mov	x0, x19
	bl	_tda998x_write_aif
LBB0_2:
	ldr	x8, [sp, #24]
Lloh41:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh42:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh43:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_4
; %bb.3:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
LBB0_4:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh39, Lloh40
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh38
	.loh AdrpAdrp	Lloh34, Lloh36
	.loh AdrpLdr	Lloh34, Lloh35
	.loh AdrpLdr	Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh41, Lloh42, Lloh43
	.cfi_endproc
                                        ; -- End function
	.comm	_REG_ENA_AP,4,2                 ; @REG_ENA_AP
	.comm	_REG_ENA_ACLK,4,2               ; @REG_ENA_ACLK
	.comm	_REG_MUX_AP,4,2                 ; @REG_MUX_AP
	.comm	_REG_I2S_FORMAT,4,2             ; @REG_I2S_FORMAT
	.comm	_REG_AIP_CLKSEL,4,2             ; @REG_AIP_CLKSEL
	.comm	_REG_AIP_CNTRL_0,4,2            ; @REG_AIP_CNTRL_0
	.comm	_AIP_CNTRL_0_LAYOUT,4,2         ; @AIP_CNTRL_0_LAYOUT
	.comm	_AIP_CNTRL_0_ACR_MAN,4,2        ; @AIP_CNTRL_0_ACR_MAN
	.comm	_REG_CTS_N,4,2                  ; @REG_CTS_N
	.comm	_REG_AUDIO_DIV,4,2              ; @REG_AUDIO_DIV
	.comm	_REG_ACR_CTS_0,4,2              ; @REG_ACR_CTS_0
	.comm	_AIP_CNTRL_0_RST_CTS,4,2        ; @AIP_CNTRL_0_RST_CTS
	.no_dead_strip	_tda998x_configure_audio
.subsections_via_symbols
