	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function encode_mb_hq
_encode_mb_hq:                          ## @encode_mb_hq
	.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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%r9, %r14
	movq	%r8, %r12
	movl	%ecx, %r15d
	movq	%rdx, -88(%rbp)                 ## 8-byte Spill
	movq	%rdi, %rbx
	movq	32(%rbp), %r13
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movl	%ecx, %edx
	callq	_copy_context_before_encode
	movq	72(%rbx), %rax
	movslq	(%r13), %rcx
	movl	(%rax,%rcx,4), %eax
	movl	%eax, 16(%rbx)
	movslq	(%r13), %rax
	movq	(%r12,%rax,8), %rcx
	movq	%rcx, 56(%rbx)
	cmpq	$0, 48(%rbx)
	je	LBB0_2
## %bb.1:
	movq	16(%rbp), %rcx
	movq	(%r14,%rax,8), %rdx
	movq	%rdx, 40(%rbx)
	movq	(%rcx,%rax,8), %rcx
	movq	%rcx, 32(%rbx)
LBB0_2:
	movl	48(%rbp), %r13d
	movl	40(%rbp), %r14d
	leaq	56(%rbx), %r12
	testl	%eax, %eax
	je	LBB0_4
## %bb.3:
	movq	8(%rbx), %rsi
	leaq	-80(%rbp), %rdi
	movl	$8, %edx
	callq	_memcpy
	movq	8(%rbx), %rax
	movq	64(%rbx), %rcx
	movq	%rcx, (%rax)
	movslq	(%rbx), %rax
	xorl	%edi, %edi
	cmpq	$32, %rax
	setge	%dil
	shlq	$6, %rax
	movq	64(%rbx), %rcx
	addq	%rax, %rcx
	movq	8(%rbx), %rdx
	movq	%rcx, 8(%rdx)
	movq	8(%rbx), %rcx
	movq	64(%rbx), %rdx
	addq	%rdx, %rax
	addq	$32, %rax
	movq	%rax, 16(%rcx)
	callq	_av_assert0
LBB0_4:
	movq	%rbx, %rdi
	movl	%r14d, %esi
	movl	%r13d, %edx
	callq	_encode_mb
	movq	%r12, %rdi
	callq	_put_bits_count
	movl	%eax, %r12d
	cmpq	$0, 48(%rbx)
	je	LBB0_6
## %bb.5:
	leaq	40(%rbx), %rdi
	callq	_put_bits_count
	movl	%eax, %r14d
	addl	%r12d, %r14d
	leaq	32(%rbx), %rdi
	callq	_put_bits_count
	movl	%eax, %r12d
	addl	%r14d, %r12d
LBB0_6:
	movq	32(%rbp), %r13
	movq	24(%rbx), %rax
	movq	(%rax), %rax
	movq	_FF_MB_DECISION_RD@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_8
## %bb.7:
	movl	16(%rbx), %esi
	movq	%rbx, %rdi
	callq	_ff_mpv_reconstruct_mb
	imull	4(%rbx), %r12d
	movq	%rbx, %rdi
	callq	_sse_mb
	movq	_FF_LAMBDA_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	shll	%cl, %eax
	addl	%eax, %r12d
LBB0_8:
	movq	24(%rbp), %r14
	cmpl	$0, (%r13)
	je	LBB0_10
## %bb.9:
	movq	8(%rbx), %rdi
	leaq	-80(%rbp), %rsi
	movl	$8, %edx
	callq	_memcpy
LBB0_10:
	cmpl	(%r14), %r12d
	jge	LBB0_12
## %bb.11:
	movl	%r12d, (%r14)
	xorb	$1, (%r13)
	movq	-88(%rbp), %rdi                 ## 8-byte Reload
	movq	%rbx, %rsi
	movl	%r15d, %edx
	callq	_copy_context_after_encode
LBB0_12:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_14
## %bb.13:
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_14:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_FF_MB_DECISION_RD,8,3          ## @FF_MB_DECISION_RD
	.comm	_FF_LAMBDA_SHIFT,4,2            ## @FF_LAMBDA_SHIFT
	.no_dead_strip	_encode_mb_hq
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function encode_mb_hq
_encode_mb_hq:                          ; @encode_mb_hq
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x21, x7
	mov	x26, x6
	mov	x27, x5
	mov	x25, x4
	mov	x19, x3
	mov	x20, x2
	mov	x22, x0
	ldp	w24, w23, [x29, #24]
	ldr	x28, [x29, #16]
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [sp, #24]
	mov	x2, x3
	bl	_copy_context_before_encode
	ldr	x8, [x22, #72]
	ldrsw	x9, [x28]
	ldr	w8, [x8, x9, lsl #2]
	str	w8, [x22, #16]
	ldrsw	x8, [x28]
	ldr	x9, [x25, x8, lsl #3]
	mov	x25, x22
	str	x9, [x25, #56]!
	ldur	x9, [x25, #-8]
	cbz	x9, LBB0_2
; %bb.1:
	lsl	x9, x8, #3
	ldr	x10, [x27, x9]
	str	x10, [x22, #40]
	ldr	x9, [x26, x9]
	str	x9, [x22, #32]
LBB0_2:
	cbz	w8, LBB0_4
; %bb.3:
	ldr	x1, [x22, #8]
	mov	x0, sp
	mov	w2, #8
	bl	_memcpy
	ldr	x8, [x22, #64]
	ldr	x9, [x22, #8]
	str	x8, [x9]
	ldr	x8, [x22, #64]
	ldrsw	x9, [x22]
	cmp	x9, #31
	cset	w0, gt
	lsl	x9, x9, #6
	add	x8, x8, x9
	ldr	x10, [x22, #8]
	str	x8, [x10, #8]
	ldr	x8, [x22, #64]
	add	x8, x8, x9
	add	x8, x8, #32
	ldr	x9, [x22, #8]
	str	x8, [x9, #16]
	bl	_av_assert0
LBB0_4:
	mov	x0, x22
	mov	x1, x24
	mov	x2, x23
	bl	_encode_mb
	mov	x0, x25
	bl	_put_bits_count
	mov	x23, x0
	ldr	x8, [x22, #48]
	cbz	x8, LBB0_6
; %bb.5:
	add	x0, x22, #40
	bl	_put_bits_count
	add	w23, w0, w23
	add	x0, x22, #32
	bl	_put_bits_count
	add	w23, w23, w0
LBB0_6:
	ldr	x8, [x22, #24]
	ldr	x8, [x8]
Lloh3:
	adrp	x9, _FF_MB_DECISION_RD@GOTPAGE
Lloh4:
	ldr	x9, [x9, _FF_MB_DECISION_RD@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_8
; %bb.7:
	ldr	w1, [x22, #16]
	mov	x0, x22
	bl	_ff_mpv_reconstruct_mb
	ldr	w24, [x22, #4]
	mov	x0, x22
	bl	_sse_mb
Lloh6:
	adrp	x8, _FF_LAMBDA_SHIFT@GOTPAGE
Lloh7:
	ldr	x8, [x8, _FF_LAMBDA_SHIFT@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	lsl	w8, w0, w8
	madd	w23, w24, w23, w8
LBB0_8:
	ldr	w8, [x28]
	cbz	w8, LBB0_10
; %bb.9:
	ldr	x0, [x22, #8]
	mov	x1, sp
	mov	w2, #8
	bl	_memcpy
LBB0_10:
	ldr	w8, [x21]
	cmp	w23, w8
	b.ge	LBB0_12
; %bb.11:
	str	w23, [x21]
	ldr	w8, [x28]
	eor	w8, w8, #0x1
	str	w8, [x28]
	mov	x0, x20
	mov	x1, x22
	mov	x2, x19
	bl	_copy_context_after_encode
LBB0_12:
	ldr	x8, [sp, #24]
Lloh9:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh10:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh11:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_14
; %bb.13:
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
LBB0_14:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_FF_MB_DECISION_RD,8,3          ; @FF_MB_DECISION_RD
	.comm	_FF_LAMBDA_SHIFT,4,2            ; @FF_LAMBDA_SHIFT
	.no_dead_strip	_encode_mb_hq
.subsections_via_symbols
