	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mtk_hdmi_setup_audio_infoframe
_mtk_hdmi_setup_audio_infoframe:        ## @mtk_hdmi_setup_audio_infoframe
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	subq	$80, %rsp
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %r14
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -24(%rbp)
	leaq	-96(%rbp), %rdi
	callq	_hdmi_audio_infoframe_init
	testq	%rax, %rax
	js	LBB0_1
## %bb.3:
	movq	_HDMI_AUDIO_CODING_TYPE_STREAM@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -84(%rbp)
	movq	_HDMI_AUDIO_SAMPLE_FREQUENCY_STREAM@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -88(%rbp)
	movq	_HDMI_AUDIO_SAMPLE_SIZE_STREAM@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -92(%rbp)
	movl	4(%r14), %edi
	callq	_mtk_hdmi_aud_get_chnl_count
	movl	%eax, -96(%rbp)
	leaq	-96(%rbp), %rdi
	leaq	-80(%rbp), %rsi
	movl	$56, %edx
	callq	_hdmi_audio_infoframe_pack
	testq	%rax, %rax
	js	LBB0_4
## %bb.5:
	leaq	-80(%rbp), %rsi
	movq	%r14, %rdi
	movl	$56, %edx
	callq	_mtk_hdmi_hw_send_info_frame
	xorl	%ebx, %ebx
	jmp	LBB0_6
LBB0_1:
	movq	%rax, %rbx
	movl	(%r14), %edi
	leaq	L_.str(%rip), %rsi
	jmp	LBB0_2
LBB0_4:
	movq	%rax, %rbx
	movl	(%r14), %edi
	leaq	L_.str.1(%rip), %rsi
LBB0_2:
	movq	%rbx, %rdx
	callq	_dev_err
LBB0_6:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-24(%rbp), %rax
	jne	LBB0_8
## %bb.7:
	movl	%ebx, %eax
	addq	$80, %rsp
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
LBB0_8:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed to setup audio infoframe: %zd\n"

	.comm	_HDMI_AUDIO_CODING_TYPE_STREAM,4,2 ## @HDMI_AUDIO_CODING_TYPE_STREAM
	.comm	_HDMI_AUDIO_SAMPLE_FREQUENCY_STREAM,4,2 ## @HDMI_AUDIO_SAMPLE_FREQUENCY_STREAM
	.comm	_HDMI_AUDIO_SAMPLE_SIZE_STREAM,4,2 ## @HDMI_AUDIO_SAMPLE_SIZE_STREAM
L_.str.1:                               ## @.str.1
	.asciz	"Failed to pack audio infoframe: %zd\n"

	.no_dead_strip	_mtk_hdmi_setup_audio_infoframe
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mtk_hdmi_setup_audio_infoframe
_mtk_hdmi_setup_audio_infoframe:        ; @mtk_hdmi_setup_audio_infoframe
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-24]
	mov	x0, sp
	bl	_hdmi_audio_infoframe_init
	tbnz	x0, #63, LBB0_3
; %bb.1:
Lloh3:
	adrp	x8, _HDMI_AUDIO_CODING_TYPE_STREAM@GOTPAGE
Lloh4:
	ldr	x8, [x8, _HDMI_AUDIO_CODING_TYPE_STREAM@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	str	w8, [sp, #12]
Lloh6:
	adrp	x8, _HDMI_AUDIO_SAMPLE_FREQUENCY_STREAM@GOTPAGE
Lloh7:
	ldr	x8, [x8, _HDMI_AUDIO_SAMPLE_FREQUENCY_STREAM@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
Lloh9:
	adrp	x9, _HDMI_AUDIO_SAMPLE_SIZE_STREAM@GOTPAGE
Lloh10:
	ldr	x9, [x9, _HDMI_AUDIO_SAMPLE_SIZE_STREAM@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
	stp	w9, w8, [sp, #4]
	ldr	w0, [x19, #4]
	bl	_mtk_hdmi_aud_get_chnl_count
	str	w0, [sp]
	mov	x0, sp
	add	x1, sp, #16
	mov	w2, #56
	bl	_hdmi_audio_infoframe_pack
	tbnz	x0, #63, LBB0_4
; %bb.2:
	add	x1, sp, #16
	mov	x0, x19
	mov	w2, #56
	bl	_mtk_hdmi_hw_send_info_frame
	mov	w20, #0
	b	LBB0_5
LBB0_3:
	mov	x20, x0
	ldr	w0, [x19]
Lloh12:
	adrp	x1, l_.str@PAGE
Lloh13:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x20
	bl	_dev_err
	b	LBB0_5
LBB0_4:
	mov	x20, x0
	ldr	w0, [x19]
Lloh14:
	adrp	x1, l_.str.1@PAGE
Lloh15:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x2, x20
	bl	_dev_err
                                        ; kill: def $w20 killed $w20 killed $x20 def $x20
LBB0_5:
	ldur	x8, [x29, #-24]
Lloh16:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh17:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh18:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_7
; %bb.6:
	mov	x0, x20
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_7:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed to setup audio infoframe: %zd\n"

	.comm	_HDMI_AUDIO_CODING_TYPE_STREAM,4,2 ; @HDMI_AUDIO_CODING_TYPE_STREAM
	.comm	_HDMI_AUDIO_SAMPLE_FREQUENCY_STREAM,4,2 ; @HDMI_AUDIO_SAMPLE_FREQUENCY_STREAM
	.comm	_HDMI_AUDIO_SAMPLE_SIZE_STREAM,4,2 ; @HDMI_AUDIO_SAMPLE_SIZE_STREAM
l_.str.1:                               ; @.str.1
	.asciz	"Failed to pack audio infoframe: %zd\n"

	.no_dead_strip	_mtk_hdmi_setup_audio_infoframe
.subsections_via_symbols
