	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function msmpeg4v2_encode_motion
_msmpeg4v2_encode_motion:               ## @msmpeg4v2_encode_motion
	.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
                                        ## kill: def $esi killed $esi def $rsi
	movq	%rdi, %r14
	testl	%esi, %esi
	je	LBB0_1
## %bb.2:
	movl	(%r14), %r12d
	leal	-64(%rsi), %eax
	cmpl	$64, %esi
	cmovll	%esi, %eax
	leal	64(%rsi), %ecx
	cmpl	$-63, %esi
	cmovll	%ecx, %eax
	leal	-1(%r12), %r15d
	movl	%eax, %ebx
	negl	%ebx
	cmovsl	%eax, %ebx
	decl	%ebx
	movl	%ebx, %edx
	movl	%r15d, %ecx
	sarl	%cl, %edx
	incl	%edx
	addq	$4, %r14
	movq	_ff_mvtab@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	(%rcx,%rdx,8), %rcx
	movl	(%rcx), %edx
	movl	4(%rcx), %esi
	incl	%esi
	shldl	$1, %eax, %edx
	movq	%r14, %rdi
	callq	_put_bits
	cmpl	$2, %r12d
	jl	LBB0_5
## %bb.3:
	movl	$-1, %eax
	movl	%r15d, %ecx
	shll	%cl, %eax
	notl	%eax
	andl	%eax, %ebx
	movq	%r14, %rdi
	movl	%r15d, %esi
	movl	%ebx, %edx
	jmp	LBB0_4
LBB0_1:
	addq	$4, %r14
	movq	_ff_mvtab@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	(%rax), %rax
	movl	(%rax), %edx
	movl	4(%rax), %esi
	movq	%r14, %rdi
LBB0_4:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_put_bits                       ## TAILCALL
LBB0_5:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ff_mvtab,8,3                   ## @ff_mvtab
	.no_dead_strip	_msmpeg4v2_encode_motion
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function msmpeg4v2_encode_motion
_msmpeg4v2_encode_motion:               ; @msmpeg4v2_encode_motion
	.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, x0
	cbz	w1, LBB0_3
; %bb.1:
	ldr	w22, [x19], #4
	sub	w20, w22, #1
	add	w8, w1, #64
	sub	w9, w1, #64
	cmp	w1, #63
	csel	w9, w9, w1, gt
	cmn	w1, #63
	csel	w8, w8, w9, lt
	cmp	w8, #0
	cneg	w9, w8, mi
	sub	w21, w9, #1
	asr	w9, w21, w20
	add	w9, w9, #1
Lloh0:
	adrp	x10, _ff_mvtab@GOTPAGE
Lloh1:
	ldr	x10, [x10, _ff_mvtab@GOTPAGEOFF]
Lloh2:
	ldr	x10, [x10]
	ldr	x9, [x10, w9, uxtw #3]
	ldp	w9, w10, [x9]
	add	w1, w10, #1
	extr	w2, w9, w8, #31
	mov	x0, x19
	bl	_put_bits
	cmp	w22, #2
	b.lt	LBB0_5
; %bb.2:
	mov	w8, #-1
	lsl	w8, w8, w20
	bic	w2, w21, w8
	mov	x0, x19
	mov	x1, x20
	b	LBB0_4
LBB0_3:
	add	x0, x19, #4
Lloh3:
	adrp	x8, _ff_mvtab@GOTPAGE
Lloh4:
	ldr	x8, [x8, _ff_mvtab@GOTPAGEOFF]
Lloh5:
	ldr	x8, [x8]
	ldr	x8, [x8]
	ldp	w2, w1, [x8]
LBB0_4:
	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
	b	_put_bits
LBB0_5:
	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 AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_ff_mvtab,8,3                   ; @ff_mvtab
	.no_dead_strip	_msmpeg4v2_encode_motion
.subsections_via_symbols
