	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function vaapi_encode_mpeg2_write_fragment
_vaapi_encode_mpeg2_write_fragment:     ## @vaapi_encode_mpeg2_write_fragment
	.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	%rcx, %rbx
	movq	%rdx, %r14
	movq	%rsi, %r12
	movq	%rdi, %r15
	movq	(%rdi), %rax
	movl	(%rax), %edi
	movq	%rcx, %rsi
	callq	_ff_cbs_write_fragment_data
	testl	%eax, %eax
	js	LBB0_1
## %bb.2:
	movq	(%r14), %rcx
	movslq	(%rbx), %rdx
	leaq	(,%rdx,8), %r8
	movslq	4(%rbx), %rax
	subq	%rax, %r8
	cmpq	%r8, %rcx
	jae	LBB0_3
## %bb.5:
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.1(%rip), %rdx
	movq	%r15, %rdi
                                        ## kill: def $r8d killed $r8d killed $r8
	xorl	%eax, %eax
	callq	_av_log
	movq	_ENOSPC@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_AVERROR                        ## TAILCALL
LBB0_1:
	movl	%eax, %r13d
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rdx
	movq	%r15, %rdi
	xorl	%eax, %eax
	callq	_av_log
	jmp	LBB0_4
LBB0_3:
	movl	8(%rbx), %esi
	movq	%r12, %rdi
                                        ## kill: def $edx killed $edx killed $rdx
	callq	_memcpy
	movslq	(%rbx), %rax
	shlq	$3, %rax
	movslq	4(%rbx), %rcx
	subq	%rcx, %rax
	movq	%rax, (%r14)
	xorl	%r13d, %r13d
LBB0_4:
	movl	%r13d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_AV_LOG_ERROR,4,2               ## @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed to write packed header.\n"

L_.str.1:                               ## @.str.1
	.asciz	"Access unit too large: %zu < %zu.\n"

	.comm	_ENOSPC,4,2                     ## @ENOSPC
	.no_dead_strip	_vaapi_encode_mpeg2_write_fragment
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function vaapi_encode_mpeg2_write_fragment
_vaapi_encode_mpeg2_write_fragment:     ; @vaapi_encode_mpeg2_write_fragment
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.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
	mov	x21, x3
	mov	x20, x2
	mov	x23, x1
	mov	x19, x0
	ldr	x8, [x0]
	ldr	w0, [x8]
	mov	x1, x3
	bl	_ff_cbs_write_fragment_data
	tbnz	w0, #31, LBB0_3
; %bb.1:
	ldr	x8, [x20]
	ldpsw	x2, x9, [x21]
	lsl	x10, x2, #3
	sub	x9, x10, x9
	cmp	x8, x9
	b.hs	LBB0_4
; %bb.2:
Lloh0:
	adrp	x10, _AV_LOG_ERROR@GOTPAGE
Lloh1:
	ldr	x10, [x10, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x10]
                                        ; kill: def $w9 killed $w9 killed $x9 def $x9
	stp	x8, x9, [sp]
Lloh3:
	adrp	x2, l_.str.1@PAGE
Lloh4:
	add	x2, x2, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_av_log
Lloh5:
	adrp	x8, _ENOSPC@GOTPAGE
Lloh6:
	ldr	x8, [x8, _ENOSPC@GOTPAGEOFF]
Lloh7:
	ldr	w0, [x8]
	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
	add	sp, sp, #80
	b	_AVERROR
LBB0_3:
	mov	x22, x0
Lloh8:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh9:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
Lloh11:
	adrp	x2, l_.str@PAGE
Lloh12:
	add	x2, x2, l_.str@PAGEOFF
	mov	x0, x19
	bl	_av_log
	b	LBB0_5
LBB0_4:
	ldr	w1, [x21, #8]
	mov	x0, x23
                                        ; kill: def $w2 killed $w2 killed $x2
	bl	_memcpy
	mov	w22, #0
	ldpsw	x8, x9, [x21]
	lsl	x8, x8, #3
	sub	x8, x8, x9
	str	x8, [x20]
LBB0_5:
	mov	x0, x22
	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
	add	sp, sp, #80
	ret
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_AV_LOG_ERROR,4,2               ; @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed to write packed header.\n"

l_.str.1:                               ; @.str.1
	.asciz	"Access unit too large: %zu < %zu.\n"

	.comm	_ENOSPC,4,2                     ; @ENOSPC
	.no_dead_strip	_vaapi_encode_mpeg2_write_fragment
.subsections_via_symbols
