	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function vc4_hdmi_write_infoframe
_vc4_hdmi_write_infoframe:              ## @vc4_hdmi_write_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	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$24, %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	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	%rdi, -64(%rbp)                 ## 8-byte Spill
	movq	(%rdi), %rdi
	callq	_to_vc4_dev
	movl	(%r14), %edi
	addl	$-128, %edi
	movl	%edi, -52(%rbp)                 ## 4-byte Spill
	callq	_VC4_HDMI_RAM_PACKET
	movl	%eax, %r13d
	movq	_VC4_HDMI_PACKET_STRIDE@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movq	%rbx, %rax
	shlq	$2, %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %r15
	movq	_VC4_HDMI_RAM_PACKET_CONFIG@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_HDMI_READ
	movq	_VC4_HDMI_RAM_PACKET_ENABLE@GOTPCREL(%rip), %rcx
	xorl	%edi, %edi
	andl	(%rcx), %eax
	sete	%dil
	leaq	L_.str(%rip), %rsi
	callq	_WARN_ONCE
	leal	(,%rbx,4), %edx
	movq	%r14, %rdi
	movq	%r15, %rsi
	callq	_hdmi_infoframe_pack
	testq	%rax, %rax
	js	LBB0_8
## %bb.1:
	movq	%rax, %r12
	movl	(%r14), %esi
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	callq	_vc4_hdmi_stop_packet
	testl	%eax, %eax
	je	LBB0_2
## %bb.10:
	leaq	L_.str.1(%rip), %rdi
	jmp	LBB0_7
LBB0_2:
	testq	%r12, %r12
	je	LBB0_5
## %bb.3:
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movl	4(%r15,%rbx,4), %eax
	movl	8(%r15,%rbx,4), %esi
	shll	$8, %eax
	orl	(%r15,%rbx,4), %eax
	shll	$16, %esi
	orl	%eax, %esi
	movl	%r13d, %edi
	callq	_HDMI_WRITE
	movl	16(%r15,%rbx,4), %eax
	movl	20(%r15,%rbx,4), %ecx
	shll	$8, %eax
	orl	12(%r15,%rbx,4), %eax
	shll	$16, %ecx
	movl	24(%r15,%rbx,4), %esi
	shll	$24, %esi
	orl	%ecx, %esi
	orl	%eax, %esi
	leal	4(%r13), %edi
	callq	_HDMI_WRITE
	addq	$7, %rbx
	addl	$8, %r13d
	cmpq	%r12, %rbx
	jl	LBB0_4
LBB0_5:
	movq	_VC4_HDMI_RAM_PACKET_CONFIG@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	movl	%r14d, %edi
	callq	_HDMI_READ
	movl	%eax, %ebx
	movl	-52(%rbp), %r15d                ## 4-byte Reload
	movl	%r15d, %edi
	callq	_BIT
	orl	%eax, %ebx
	movl	%r14d, %edi
	movl	%ebx, %esi
	callq	_HDMI_WRITE
	movq	_VC4_HDMI_RAM_PACKET_STATUS@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_HDMI_READ
	movl	%eax, %ebx
	movl	%r15d, %edi
	callq	_BIT
	andl	%eax, %ebx
	movl	%ebx, %edi
	movl	$100, %esi
	callq	_wait_for
	testl	%eax, %eax
	je	LBB0_8
## %bb.6:
	leaq	L_.str.2(%rip), %rdi
LBB0_7:
	movl	%eax, %esi
	callq	_DRM_ERROR
LBB0_8:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_11
## %bb.9:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_11:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_VC4_HDMI_PACKET_STRIDE,4,2     ## @VC4_HDMI_PACKET_STRIDE
	.comm	_VC4_HDMI_RAM_PACKET_CONFIG,4,2 ## @VC4_HDMI_RAM_PACKET_CONFIG
	.comm	_VC4_HDMI_RAM_PACKET_ENABLE,4,2 ## @VC4_HDMI_RAM_PACKET_ENABLE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Packet RAM has to be on to store the packet."

L_.str.1:                               ## @.str.1
	.asciz	"Failed to wait for infoframe to go idle: %d\n"

	.comm	_VC4_HDMI_RAM_PACKET_STATUS,4,2 ## @VC4_HDMI_RAM_PACKET_STATUS
L_.str.2:                               ## @.str.2
	.asciz	"Failed to wait for infoframe to start: %d\n"

	.no_dead_strip	_vc4_hdmi_write_infoframe
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function vc4_hdmi_write_infoframe
_vc4_hdmi_write_infoframe:              ; @vc4_hdmi_write_infoframe
	.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	x23, x1
	mov	x22, 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	x0, [x0]
	bl	_to_vc4_dev
	ldr	w8, [x23]
	sub	w19, w8, #128
	mov	x0, x19
	bl	_VC4_HDMI_RAM_PACKET
	mov	x20, x0
Lloh3:
	adrp	x8, _VC4_HDMI_PACKET_STRIDE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _VC4_HDMI_PACKET_STRIDE@GOTPAGEOFF]
Lloh5:
	ldr	w21, [x8]
	lsl	x8, x21, #2
	mov	x9, x8
Lloh6:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh7:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x9, sp
	add	x8, x8, #15
	and	x8, x8, #0x7fffffff0
	sub	x24, x9, x8
	mov	sp, x24
Lloh8:
	adrp	x25, _VC4_HDMI_RAM_PACKET_CONFIG@GOTPAGE
Lloh9:
	ldr	x25, [x25, _VC4_HDMI_RAM_PACKET_CONFIG@GOTPAGEOFF]
	ldr	w0, [x25]
	bl	_HDMI_READ
Lloh10:
	adrp	x8, _VC4_HDMI_RAM_PACKET_ENABLE@GOTPAGE
Lloh11:
	ldr	x8, [x8, _VC4_HDMI_RAM_PACKET_ENABLE@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	tst	w8, w0
	cset	w0, eq
Lloh13:
	adrp	x1, l_.str@PAGE
Lloh14:
	add	x1, x1, l_.str@PAGEOFF
	bl	_WARN_ONCE
	lsl	w2, w21, #2
	mov	x0, x23
	mov	x1, x24
	bl	_hdmi_infoframe_pack
	tbnz	x0, #63, LBB0_9
; %bb.1:
	mov	x21, x0
	ldr	w1, [x23]
	mov	x0, x22
	bl	_vc4_hdmi_stop_packet
	cbz	w0, LBB0_3
; %bb.2:
	mov	x1, x0
Lloh15:
	adrp	x0, l_.str.1@PAGE
Lloh16:
	add	x0, x0, l_.str.1@PAGEOFF
	b	LBB0_8
LBB0_3:
	cbz	x21, LBB0_6
; %bb.4:
	mov	x22, #0
	add	x23, x24, #12
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldp	w8, w9, [x23, #-12]
	orr	w8, w8, w9, lsl #8
	ldur	w9, [x23, #-4]
	orr	w1, w8, w9, lsl #16
	mov	x0, x20
	bl	_HDMI_WRITE
	ldp	w8, w9, [x23]
	orr	w8, w8, w9, lsl #8
	ldp	w9, w10, [x23, #8]
	orr	w8, w8, w9, lsl #16
	orr	w1, w8, w10, lsl #24
	add	w0, w20, #4
	bl	_HDMI_WRITE
	add	x22, x22, #7
	add	x23, x23, #28
	add	w20, w20, #8
	cmp	x22, x21
	b.lt	LBB0_5
LBB0_6:
	ldr	w20, [x25]
	mov	x0, x20
	bl	_HDMI_READ
	mov	x21, x0
	mov	x0, x19
	bl	_BIT
	orr	w1, w0, w21
	mov	x0, x20
	bl	_HDMI_WRITE
Lloh17:
	adrp	x8, _VC4_HDMI_RAM_PACKET_STATUS@GOTPAGE
Lloh18:
	ldr	x8, [x8, _VC4_HDMI_RAM_PACKET_STATUS@GOTPAGEOFF]
Lloh19:
	ldr	w0, [x8]
	bl	_HDMI_READ
	mov	x20, x0
	mov	x0, x19
	bl	_BIT
	and	w0, w0, w20
	mov	w1, #100
	bl	_wait_for
	cbz	w0, LBB0_9
; %bb.7:
	mov	x1, x0
Lloh20:
	adrp	x0, l_.str.2@PAGE
Lloh21:
	add	x0, x0, l_.str.2@PAGEOFF
LBB0_8:
	bl	_DRM_ERROR
LBB0_9:
	ldur	x8, [x29, #-72]
Lloh22:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh23:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh24:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_11
; %bb.10:
	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_11:
	bl	___stack_chk_fail
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.cfi_endproc
                                        ; -- End function
	.comm	_VC4_HDMI_PACKET_STRIDE,4,2     ; @VC4_HDMI_PACKET_STRIDE
	.comm	_VC4_HDMI_RAM_PACKET_CONFIG,4,2 ; @VC4_HDMI_RAM_PACKET_CONFIG
	.comm	_VC4_HDMI_RAM_PACKET_ENABLE,4,2 ; @VC4_HDMI_RAM_PACKET_ENABLE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Packet RAM has to be on to store the packet."

l_.str.1:                               ; @.str.1
	.asciz	"Failed to wait for infoframe to go idle: %d\n"

	.comm	_VC4_HDMI_RAM_PACKET_STATUS,4,2 ; @VC4_HDMI_RAM_PACKET_STATUS
l_.str.2:                               ; @.str.2
	.asciz	"Failed to wait for infoframe to start: %d\n"

	.no_dead_strip	_vc4_hdmi_write_infoframe
.subsections_via_symbols
