	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sun4i_hdmi_setup_avi_infoframes
_sun4i_hdmi_setup_avi_infoframes:       ## @sun4i_hdmi_setup_avi_infoframes
	.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	$104, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %rdx
	movq	%rdi, %r15
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	leaq	8(%rdi), %rsi
	leaq	-136(%rbp), %rdi
	callq	_drm_hdmi_avi_infoframe_from_display_mode
	testl	%eax, %eax
	js	LBB0_4
## %bb.1:
	leaq	-136(%rbp), %rdi
	leaq	-128(%rbp), %rsi
	movl	$68, %edx
	callq	_hdmi_avi_infoframe_pack
	testl	%eax, %eax
	js	LBB0_5
## %bb.2:
	xorl	%r14d, %r14d
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movl	-128(%rbp,%rbx,4), %r12d
	movq	(%r15), %r13
	movl	%ebx, %edi
	callq	_SUN4I_HDMI_AVI_INFOFRAME_REG
	addq	%rax, %r13
	movl	%r12d, %edi
	movq	%r13, %rsi
	callq	_writeb
	incq	%rbx
	cmpq	$68, %rbx
	jne	LBB0_3
	jmp	LBB0_7
LBB0_4:
	movl	%eax, %r14d
	leaq	L_.str(%rip), %rdi
	jmp	LBB0_6
LBB0_5:
	movl	%eax, %r14d
	leaq	L_.str.1(%rip), %rdi
LBB0_6:
	callq	_DRM_ERROR
LBB0_7:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_9
## %bb.8:
	movl	%r14d, %eax
	addq	$104, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_9:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed to get infoframes from mode\n"

L_.str.1:                               ## @.str.1
	.asciz	"Failed to pack infoframes\n"

	.no_dead_strip	_sun4i_hdmi_setup_avi_infoframes
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sun4i_hdmi_setup_avi_infoframes
_sun4i_hdmi_setup_avi_infoframes:       ; @sun4i_hdmi_setup_avi_infoframes
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #144
	.cfi_def_cfa_offset 144
	stp	x24, x23, [sp, #80]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #96]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #112]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #128]            ; 16-byte Folded Spill
	add	x29, sp, #128
	.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	x2, x1
	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, #-56]
	add	x1, x0, #8
	mov	x0, sp
	bl	_drm_hdmi_avi_infoframe_from_display_mode
	tbnz	w0, #31, LBB0_5
; %bb.1:
	add	x22, sp, #4
	mov	x0, sp
	add	x1, sp, #4
	mov	w2, #68
	bl	_hdmi_avi_infoframe_pack
	tbnz	w0, #31, LBB0_6
; %bb.2:
	mov	x20, #0
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w21, [x22, x20, lsl #2]
	ldr	x23, [x19]
	mov	x0, x20
	bl	_SUN4I_HDMI_AVI_INFOFRAME_REG
	add	x1, x0, x23
	mov	x0, x21
	bl	_writeb
	add	x20, x20, #1
	cmp	x20, #68
	b.ne	LBB0_3
; %bb.4:
	mov	w20, #0
	b	LBB0_8
LBB0_5:
	mov	x20, x0
Lloh3:
	adrp	x0, l_.str@PAGE
Lloh4:
	add	x0, x0, l_.str@PAGEOFF
	b	LBB0_7
LBB0_6:
	mov	x20, x0
Lloh5:
	adrp	x0, l_.str.1@PAGE
Lloh6:
	add	x0, x0, l_.str.1@PAGEOFF
LBB0_7:
	bl	_DRM_ERROR
LBB0_8:
	ldur	x8, [x29, #-56]
Lloh7:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh8:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh9:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_10
; %bb.9:
	mov	x0, x20
	ldp	x29, x30, [sp, #128]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #112]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #96]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #80]             ; 16-byte Folded Reload
	add	sp, sp, #144
	ret
LBB0_10:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed to get infoframes from mode\n"

l_.str.1:                               ; @.str.1
	.asciz	"Failed to pack infoframes\n"

	.no_dead_strip	_sun4i_hdmi_setup_avi_infoframes
.subsections_via_symbols
