	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function vaapi_encode_alloc_output_buffer
_vaapi_encode_alloc_output_buffer:      ## @vaapi_encode_alloc_output_buffer
	.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	%r12
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movq	(%rdi), %r12
	movq	8(%r12), %rax
	movl	(%rax), %edi
	movl	16(%r12), %esi
	movq	_VAEncCodedBufferType@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	(%r12), %eax
	imull	4(%r12), %eax
	leal	(%rax,%rax,2), %ecx
	addl	$65536, %ecx                    ## imm = 0x10000
	leaq	-40(%rbp), %rax
	movq	%rax, (%rsp)
	movl	$1, %r8d
	xorl	%r9d, %r9d
	callq	_vaCreateBuffer
	movq	%rax, %rbx
	movq	_VA_STATUS_SUCCESS@GOTPCREL(%rip), %rax
	cmpq	(%rax), %rbx
	jne	LBB0_1
## %bb.2:
	movq	_AV_LOG_DEBUG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	-40(%rbp), %rcx
	leaq	L_.str.1(%rip), %rdx
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	_av_log
	movq	-40(%rbp), %rdi
	movq	_AV_BUFFER_FLAG_READONLY@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	movq	_vaapi_encode_free_output_buffer@GOTPCREL(%rip), %rdx
	movl	$8, %esi
	movq	%r14, %rcx
	callq	_av_buffer_create
	movq	%rax, %r15
	testq	%rax, %rax
	jne	LBB0_4
## %bb.3:
	movq	8(%r12), %rax
	movl	(%rax), %edi
	movq	-40(%rbp), %rsi
	callq	_vaDestroyBuffer
	xorl	%r15d, %r15d
	jmp	LBB0_4
LBB0_1:
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	movq	%rbx, %rdi
	callq	_vaErrorStr
	leaq	L_.str(%rip), %rdx
	xorl	%r15d, %r15d
	movq	%r14, %rdi
	movl	%r12d, %esi
	movq	%rbx, %rcx
	movl	%eax, %r8d
	xorl	%eax, %eax
	callq	_av_log
LBB0_4:
	movq	%r15, %rax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_VAEncCodedBufferType,4,2       ## @VAEncCodedBufferType
	.comm	_VA_STATUS_SUCCESS,8,3          ## @VA_STATUS_SUCCESS
	.comm	_AV_LOG_ERROR,4,2               ## @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed to create bitstream output buffer: %d (%s).\n"

	.comm	_AV_LOG_DEBUG,4,2               ## @AV_LOG_DEBUG
L_.str.1:                               ## @.str.1
	.asciz	"Allocated output buffer %#x\n"

	.comm	_vaapi_encode_free_output_buffer,4,2 ## @vaapi_encode_free_output_buffer
	.comm	_AV_BUFFER_FLAG_READONLY,4,2    ## @AV_BUFFER_FLAG_READONLY
	.no_dead_strip	_vaapi_encode_alloc_output_buffer
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function vaapi_encode_alloc_output_buffer
_vaapi_encode_alloc_output_buffer:      ; @vaapi_encode_alloc_output_buffer
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x19, x0
	ldr	x21, [x0]
	ldr	x8, [x21, #8]
	ldr	w0, [x8]
	ldr	w1, [x21, #16]
Lloh0:
	adrp	x8, _VAEncCodedBufferType@GOTPAGE
Lloh1:
	ldr	x8, [x8, _VAEncCodedBufferType@GOTPAGEOFF]
Lloh2:
	ldr	w2, [x8]
	ldp	w8, w9, [x21]
	mul	w8, w8, w9
	add	w8, w8, w8, lsl #1
	add	w3, w8, #16, lsl #12            ; =65536
	add	x6, sp, #8
	mov	w4, #1
	mov	w5, #0
	bl	_vaCreateBuffer
Lloh3:
	adrp	x8, _VA_STATUS_SUCCESS@GOTPAGE
Lloh4:
	ldr	x8, [x8, _VA_STATUS_SUCCESS@GOTPAGEOFF]
Lloh5:
	ldr	x8, [x8]
	cmp	x0, x8
	b.ne	LBB0_3
; %bb.1:
Lloh6:
	adrp	x8, _AV_LOG_DEBUG@GOTPAGE
Lloh7:
	ldr	x8, [x8, _AV_LOG_DEBUG@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	ldr	x3, [sp, #8]
Lloh9:
	adrp	x2, l_.str.1@PAGE
Lloh10:
	add	x2, x2, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_av_log
	ldr	x0, [sp, #8]
Lloh11:
	adrp	x8, _AV_BUFFER_FLAG_READONLY@GOTPAGE
Lloh12:
	ldr	x8, [x8, _AV_BUFFER_FLAG_READONLY@GOTPAGEOFF]
Lloh13:
	ldr	w4, [x8]
Lloh14:
	adrp	x2, _vaapi_encode_free_output_buffer@GOTPAGE
Lloh15:
	ldr	x2, [x2, _vaapi_encode_free_output_buffer@GOTPAGEOFF]
	mov	w1, #8
	mov	x3, x19
	bl	_av_buffer_create
	cbnz	x0, LBB0_5
; %bb.2:
	ldr	x8, [x21, #8]
	ldr	w0, [x8]
	ldr	x1, [sp, #8]
	bl	_vaDestroyBuffer
	b	LBB0_4
LBB0_3:
	mov	x20, x0
Lloh16:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh17:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh18:
	ldr	w21, [x8]
	bl	_vaErrorStr
                                        ; kill: def $w0 killed $w0 def $x0
	str	x0, [sp]
Lloh19:
	adrp	x2, l_.str@PAGE
Lloh20:
	add	x2, x2, l_.str@PAGEOFF
	mov	x0, x19
	mov	x1, x21
	mov	x3, x20
	bl	_av_log
LBB0_4:
	mov	x0, #0
LBB0_5:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.comm	_VAEncCodedBufferType,4,2       ; @VAEncCodedBufferType
	.comm	_VA_STATUS_SUCCESS,8,3          ; @VA_STATUS_SUCCESS
	.comm	_AV_LOG_ERROR,4,2               ; @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed to create bitstream output buffer: %d (%s).\n"

	.comm	_AV_LOG_DEBUG,4,2               ; @AV_LOG_DEBUG
l_.str.1:                               ; @.str.1
	.asciz	"Allocated output buffer %#x\n"

	.comm	_vaapi_encode_free_output_buffer,4,2 ; @vaapi_encode_free_output_buffer
	.comm	_AV_BUFFER_FLAG_READONLY,4,2    ; @AV_BUFFER_FLAG_READONLY
	.no_dead_strip	_vaapi_encode_alloc_output_buffer
.subsections_via_symbols
