	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function hva_h264_encode
_hva_h264_encode:                       ## @hva_h264_encode
	.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
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r14
	movq	%rsi, %rdx
	movq	%rdi, %rbx
	movq	8(%rdi), %r12
	movq	8(%r12), %rax
	movq	(%rax), %r15
	movq	%r15, %rsi
	movq	%r14, %rcx
	callq	_hva_h264_prepare_task
	testl	%eax, %eax
	jne	LBB0_5
## %bb.1:
	movq	_H264_ENC@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	8(%r12), %rdx
	movq	%rbx, %rdi
	callq	_hva_hw_execute_task
	testl	%eax, %eax
	je	LBB0_2
LBB0_5:
	movl	$0, (%r14)
LBB0_6:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_2:
	incl	(%rbx)
	movq	%r15, %rdi
	callq	_hva_h264_get_stream_size
	addl	%eax, (%r14)
	movq	%r15, %rdi
	callq	_hva_h264_get_stuffing_bytes
	testq	%rax, %rax
	je	LBB0_4
## %bb.3:
	movq	8(%r14), %rdx
	movl	4(%r14), %ecx
	movq	%rbx, %rdi
	movq	%rax, %rsi
	movq	%r14, %r8
	callq	_hva_h264_fill_data_nal
LBB0_4:
	movl	(%r12), %esi
	movl	4(%r12), %edi
	callq	_swap
	xorl	%eax, %eax
	jmp	LBB0_6
	.cfi_endproc
                                        ## -- End function
	.comm	_H264_ENC,4,2                   ## @H264_ENC
	.no_dead_strip	_hva_h264_encode
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function hva_h264_encode
_hva_h264_encode:                       ; @hva_h264_encode
	.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
	mov	x19, x2
	mov	x2, x1
	mov	x20, x0
	ldr	x22, [x0, #8]
	ldr	x8, [x22, #8]
	ldr	x21, [x8]
	mov	x1, x21
	mov	x3, x19
	bl	_hva_h264_prepare_task
	cbnz	w0, LBB0_2
; %bb.1:
Lloh0:
	adrp	x8, _H264_ENC@GOTPAGE
Lloh1:
	ldr	x8, [x8, _H264_ENC@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	ldr	x2, [x22, #8]
	mov	x0, x20
	bl	_hva_hw_execute_task
	cbz	w0, LBB0_4
LBB0_2:
	str	wzr, [x19]
LBB0_3:
	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
LBB0_4:
	ldr	w8, [x20]
	add	w8, w8, #1
	str	w8, [x20]
	mov	x0, x21
	bl	_hva_h264_get_stream_size
	ldr	w8, [x19]
	add	w8, w8, w0
	str	w8, [x19]
	mov	x0, x21
	bl	_hva_h264_get_stuffing_bytes
	cbz	x0, LBB0_6
; %bb.5:
	mov	x1, x0
	ldr	x2, [x19, #8]
	ldr	w3, [x19, #4]
	mov	x0, x20
	mov	x4, x19
	bl	_hva_h264_fill_data_nal
LBB0_6:
	ldp	w1, w0, [x22]
	bl	_swap
	mov	w0, #0
	b	LBB0_3
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_H264_ENC,4,2                   ; @H264_ENC
	.no_dead_strip	_hva_h264_encode
.subsections_via_symbols
