	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function radeon_audio_set_avi_packet
_radeon_audio_set_avi_packet:           ## @radeon_audio_set_avi_packet
	.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
	subq	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movq	%rdi, %rbx
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	(%rdi), %rax
	movq	(%rax), %rax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	callq	_to_radeon_encoder
	movq	%rax, %r15
	movq	16(%rax), %rax
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	movq	%rbx, %rdi
	callq	_radeon_get_connector_for_encoder
	movq	%rax, %r12
	movq	_HDMI_INFOFRAME_HEADER_SIZE@GOTPCREL(%rip), %rax
	movq	_HDMI_AVI_INFOFRAME_SIZE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r13d
	addl	(%rax), %r13d
	leaq	(,%r13,4), %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, -80(%rbp)                 ## 8-byte Spill
	testq	%r12, %r12
	je	LBB0_1
## %bb.2:
	leaq	-56(%rbp), %rdi
	movq	%r12, %rsi
	movq	%r14, %rdx
	callq	_drm_hdmi_avi_infoframe_from_display_mode
	testl	%eax, %eax
	js	LBB0_3
## %bb.5:
	movq	(%r15), %rax
	movq	_RADEON_OUTPUT_CSC_BYPASS@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_10
## %bb.6:
	movq	_RADEON_OUTPUT_CSC_TVRGB@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_7
## %bb.8:
	movq	_HDMI_QUANTIZATION_RANGE_LIMITED@GOTPCREL(%rip), %rax
	jmp	LBB0_9
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_17
LBB0_3:
	movl	%eax, %ebx
	leaq	L_.str(%rip), %rdi
	jmp	LBB0_4
LBB0_7:
	movq	_HDMI_QUANTIZATION_RANGE_FULL@GOTPCREL(%rip), %rax
LBB0_9:
	movl	(%rax), %ecx
	leaq	-56(%rbp), %rdi
	movq	%r12, %rsi
	movq	%r14, %rdx
	callq	_drm_hdmi_avi_infoframe_quant_range
LBB0_10:
	shll	$2, %r13d
	leaq	-56(%rbp), %rdi
	movq	-80(%rbp), %r14                 ## 8-byte Reload
	movq	%r14, %rsi
	movl	%r13d, %edx
	callq	_hdmi_avi_infoframe_pack
	testl	%eax, %eax
	js	LBB0_11
## %bb.12:
	xorl	%ebx, %ebx
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	testq	%rax, %rax
	je	LBB0_17
## %bb.13:
	movq	(%rax), %rax
	testq	%rax, %rax
	je	LBB0_17
## %bb.14:
	movq	8(%r15), %rcx
	testq	%rcx, %rcx
	je	LBB0_17
## %bb.15:
	movq	(%rcx), %r8
	testq	%r8, %r8
	je	LBB0_17
## %bb.16:
	movl	(%rax), %esi
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	movq	%r14, %rdx
	movl	%r13d, %ecx
	callq	*%r8
	jmp	LBB0_17
LBB0_11:
	movl	%eax, %ebx
	leaq	L_.str.1(%rip), %rdi
LBB0_4:
	movl	%ebx, %esi
	callq	_DRM_ERROR
LBB0_17:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_19
## %bb.18:
	movl	%ebx, %eax
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_19:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_HDMI_INFOFRAME_HEADER_SIZE,4,2 ## @HDMI_INFOFRAME_HEADER_SIZE
	.comm	_HDMI_AVI_INFOFRAME_SIZE,4,2    ## @HDMI_AVI_INFOFRAME_SIZE
	.comm	_EINVAL,4,2                     ## @EINVAL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"failed to setup AVI infoframe: %d\n"

	.comm	_RADEON_OUTPUT_CSC_BYPASS,8,3   ## @RADEON_OUTPUT_CSC_BYPASS
	.comm	_RADEON_OUTPUT_CSC_TVRGB,8,3    ## @RADEON_OUTPUT_CSC_TVRGB
	.comm	_HDMI_QUANTIZATION_RANGE_LIMITED,4,2 ## @HDMI_QUANTIZATION_RANGE_LIMITED
	.comm	_HDMI_QUANTIZATION_RANGE_FULL,4,2 ## @HDMI_QUANTIZATION_RANGE_FULL
L_.str.1:                               ## @.str.1
	.asciz	"failed to pack AVI infoframe: %d\n"

	.no_dead_strip	_radeon_audio_set_avi_packet
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function radeon_audio_set_avi_packet
_radeon_audio_set_avi_packet:           ; @radeon_audio_set_avi_packet
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	sub	sp, sp, #16
	mov	x22, x1
	mov	x21, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-72]
	ldr	x8, [x0]
	ldr	x19, [x8]
	bl	_to_radeon_encoder
	mov	x20, x0
	ldr	x25, [x0, #16]
	mov	x0, x21
	bl	_radeon_get_connector_for_encoder
	mov	x23, x0
Lloh3:
	adrp	x8, _HDMI_INFOFRAME_HEADER_SIZE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _HDMI_INFOFRAME_HEADER_SIZE@GOTPAGEOFF]
Lloh5:
	adrp	x9, _HDMI_AVI_INFOFRAME_SIZE@GOTPAGE
Lloh6:
	ldr	x9, [x9, _HDMI_AVI_INFOFRAME_SIZE@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
Lloh8:
	ldr	w9, [x9]
	add	w26, w9, w8
	lsl	x9, x26, #2
	add	x8, x9, #15
	and	x8, x8, #0x7fffffff0
Lloh9:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh10:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x9, sp
	sub	x21, x9, x8
	mov	sp, x21
	cbz	x0, LBB0_11
; %bb.1:
	sub	x0, x29, #80
	mov	x1, x23
	mov	x2, x22
	bl	_drm_hdmi_avi_infoframe_from_display_mode
	tbnz	w0, #31, LBB0_12
; %bb.2:
	ldr	x8, [x20]
Lloh11:
	adrp	x9, _RADEON_OUTPUT_CSC_BYPASS@GOTPAGE
Lloh12:
	ldr	x9, [x9, _RADEON_OUTPUT_CSC_BYPASS@GOTPAGEOFF]
Lloh13:
	ldr	x9, [x9]
	cmp	x8, x9
	b.eq	LBB0_4
; %bb.3:
Lloh14:
	adrp	x9, _RADEON_OUTPUT_CSC_TVRGB@GOTPAGE
Lloh15:
	ldr	x9, [x9, _RADEON_OUTPUT_CSC_TVRGB@GOTPAGEOFF]
Lloh16:
	adrp	x10, _HDMI_QUANTIZATION_RANGE_LIMITED@GOTPAGE
Lloh17:
	ldr	x10, [x10, _HDMI_QUANTIZATION_RANGE_LIMITED@GOTPAGEOFF]
Lloh18:
	ldr	x9, [x9]
Lloh19:
	adrp	x11, _HDMI_QUANTIZATION_RANGE_FULL@GOTPAGE
Lloh20:
	ldr	x11, [x11, _HDMI_QUANTIZATION_RANGE_FULL@GOTPAGEOFF]
	cmp	x8, x9
	csel	x8, x10, x11, eq
	ldr	w3, [x8]
	sub	x0, x29, #80
	mov	x1, x23
	mov	x2, x22
	bl	_drm_hdmi_avi_infoframe_quant_range
LBB0_4:
	lsl	w22, w26, #2
	sub	x0, x29, #80
	mov	x1, x21
	mov	x2, x22
	bl	_hdmi_avi_infoframe_pack
	tbnz	w0, #31, LBB0_13
; %bb.5:
	cbz	x25, LBB0_10
; %bb.6:
	ldr	x8, [x25]
	cbz	x8, LBB0_10
; %bb.7:
	ldr	x9, [x20, #8]
	cbz	x9, LBB0_10
; %bb.8:
	ldr	x9, [x9]
	cbz	x9, LBB0_10
; %bb.9:
	ldr	w1, [x8]
	mov	x0, x19
	mov	x2, x21
	mov	x3, x22
	blr	x9
LBB0_10:
	mov	w24, #0
	b	LBB0_15
LBB0_11:
Lloh21:
	adrp	x8, _EINVAL@GOTPAGE
Lloh22:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh23:
	ldr	w8, [x8]
	neg	w24, w8
	b	LBB0_15
LBB0_12:
	mov	x24, x0
Lloh24:
	adrp	x0, l_.str@PAGE
Lloh25:
	add	x0, x0, l_.str@PAGEOFF
	b	LBB0_14
LBB0_13:
	mov	x24, x0
Lloh26:
	adrp	x0, l_.str.1@PAGE
Lloh27:
	add	x0, x0, l_.str.1@PAGEOFF
LBB0_14:
	mov	x1, x24
	bl	_DRM_ERROR
LBB0_15:
	ldur	x8, [x29, #-72]
Lloh28:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh29:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh30:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_17
; %bb.16:
	mov	x0, x24
	sub	sp, x29, #64
	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
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
LBB0_17:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh7
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh18
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpAdd	Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.cfi_endproc
                                        ; -- End function
	.comm	_HDMI_INFOFRAME_HEADER_SIZE,4,2 ; @HDMI_INFOFRAME_HEADER_SIZE
	.comm	_HDMI_AVI_INFOFRAME_SIZE,4,2    ; @HDMI_AVI_INFOFRAME_SIZE
	.comm	_EINVAL,4,2                     ; @EINVAL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"failed to setup AVI infoframe: %d\n"

	.comm	_RADEON_OUTPUT_CSC_BYPASS,8,3   ; @RADEON_OUTPUT_CSC_BYPASS
	.comm	_RADEON_OUTPUT_CSC_TVRGB,8,3    ; @RADEON_OUTPUT_CSC_TVRGB
	.comm	_HDMI_QUANTIZATION_RANGE_LIMITED,4,2 ; @HDMI_QUANTIZATION_RANGE_LIMITED
	.comm	_HDMI_QUANTIZATION_RANGE_FULL,4,2 ; @HDMI_QUANTIZATION_RANGE_FULL
l_.str.1:                               ; @.str.1
	.asciz	"failed to pack AVI infoframe: %d\n"

	.no_dead_strip	_radeon_audio_set_avi_packet
.subsections_via_symbols
