	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_hdmi_audio_infoframe_pack      ## -- Begin function hdmi_audio_infoframe_pack
	.p2align	4, 0x90
_hdmi_audio_infoframe_pack:             ## @hdmi_audio_infoframe_pack
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	_HDMI_INFOFRAME_HEADER_SIZE@GOTPCREL(%rip), %r12
	movq	(%rdi), %r14
	addq	(%r12), %r14
	cmpq	%rdx, %r14
	jbe	LBB0_2
## %bb.1:
	movq	_ENOSPC@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	subq	(%rax), %r14
	jmp	LBB0_5
LBB0_2:
	movq	%rsi, %r15
	movq	%rdi, %rbx
	xorl	%r13d, %r13d
	movq	%rsi, %rdi
	xorl	%esi, %esi
	callq	_memset
	movl	8(%rbx), %eax
	movl	12(%rbx), %ecx
	leal	-1(%rax), %edx
	andl	$7, %edx
	cmpl	$2, %eax
	cmovll	%r13d, %edx
	movl	%ecx, (%r15)
	movl	16(%rbx), %eax
	movl	%eax, 4(%r15)
	movl	(%rbx), %eax
	movl	%eax, 8(%r15)
	movl	$0, 12(%r15)
	movq	(%r12), %r12
	movl	20(%rbx), %eax
	shll	$4, %eax
	movzbl	%al, %eax
	orl	%edx, %eax
	movl	%eax, (%r15,%r12,4)
	movl	24(%rbx), %eax
	movl	28(%rbx), %ecx
	andl	$7, %eax
	andl	$3, %ecx
	leal	(%rcx,%rax,4), %eax
	movl	%eax, 4(%r15,%r12,4)
	movl	32(%rbx), %eax
	andl	$31, %eax
	movl	%eax, 8(%r15,%r12,4)
	movl	36(%rbx), %eax
	movl	%eax, 12(%r15,%r12,4)
	movl	40(%rbx), %eax
	shll	$3, %eax
	andl	$120, %eax
	movl	%eax, 16(%r15,%r12,4)
	cmpq	$0, 48(%rbx)
	je	LBB0_4
## %bb.3:
	movl	$7, %edi
	callq	_BIT
	orl	%eax, 16(%r15,%r12,4)
LBB0_4:
	movq	%r15, %rdi
	movq	%r14, %rsi
	callq	_hdmi_infoframe_set_checksum
LBB0_5:
	movq	%r14, %rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_HDMI_INFOFRAME_HEADER_SIZE,8,3 ## @HDMI_INFOFRAME_HEADER_SIZE
	.comm	_ENOSPC,8,3                     ## @ENOSPC
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_hdmi_audio_infoframe_pack      ; -- Begin function hdmi_audio_infoframe_pack
	.p2align	2
_hdmi_audio_infoframe_pack:             ; @hdmi_audio_infoframe_pack
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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	x22, _HDMI_INFOFRAME_HEADER_SIZE@GOTPAGE
Lloh1:
	ldr	x22, [x22, _HDMI_INFOFRAME_HEADER_SIZE@GOTPAGEOFF]
	ldr	x8, [x22]
	ldr	x9, [x0]
	add	x19, x9, x8
	cmp	x19, x2
	b.ls	LBB0_2
; %bb.1:
Lloh2:
	adrp	x8, _ENOSPC@GOTPAGE
Lloh3:
	ldr	x8, [x8, _ENOSPC@GOTPAGEOFF]
Lloh4:
	ldr	x8, [x8]
	neg	x19, x8
	b	LBB0_5
LBB0_2:
	mov	x20, x1
	mov	x21, x0
	mov	x0, x1
	mov	w1, #0
	bl	_memset
	ldp	w8, w9, [x21, #8]
	subs	w8, w8, #1
	and	w8, w8, #0x7
	csel	w8, w8, wzr, gt
	str	w9, [x20]
	ldr	w9, [x21, #16]
	ldr	x10, [x21]
	stp	w9, w10, [x20, #4]
	str	wzr, [x20, #12]
	ldr	x9, [x22]
	add	x22, x20, x9, lsl #2
	ldr	w9, [x21, #20]
	bfi	w8, w9, #4, #4
	str	w8, [x22]
	ldp	w8, w9, [x21, #24]
	and	w9, w9, #0x3
	bfi	w9, w8, #2, #3
	str	w9, [x22, #4]
	ldr	w8, [x21, #32]
	and	w8, w8, #0x1f
	str	w8, [x22, #8]
	ldr	w8, [x21, #36]
	str	w8, [x22, #12]
	ldr	w8, [x21, #40]
	ubfiz	w8, w8, #3, #4
	str	w8, [x22, #16]
	ldr	x8, [x21, #48]
	cbz	x8, LBB0_4
; %bb.3:
	mov	w0, #7
	bl	_BIT
	ldr	w8, [x22, #16]
	orr	w8, w8, w0
	str	w8, [x22, #16]
LBB0_4:
	mov	x0, x20
	mov	x1, x19
	bl	_hdmi_infoframe_set_checksum
LBB0_5:
	mov	x0, x19
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_HDMI_INFOFRAME_HEADER_SIZE,8,3 ; @HDMI_INFOFRAME_HEADER_SIZE
	.comm	_ENOSPC,8,3                     ; @ENOSPC
.subsections_via_symbols
