	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ff_clean_mpeg4_qscales         ## -- Begin function ff_clean_mpeg4_qscales
	.p2align	4, 0x90
_ff_clean_mpeg4_qscales:                ## @ff_clean_mpeg4_qscales
	.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	%rdi, %r14
	movq	32(%rdi), %r15
	callq	_ff_clean_h263_qscales
	movq	(%r14), %rax
	movq	_AV_PICTURE_TYPE_B@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_20
## %bb.1:
	movl	8(%r14), %r9d
	testl	%r9d, %r9d
	jle	LBB0_20
## %bb.2:
	movq	16(%r14), %rsi
	leaq	-1(%r9), %rax
	movl	%r9d, %r8d
	andl	$3, %r8d
	cmpq	$3, %rax
	jae	LBB0_4
## %bb.3:
	xorl	%edi, %edi
	xorl	%ecx, %ecx
	jmp	LBB0_6
LBB0_4:
	movl	%r9d, %eax
	andl	$-4, %eax
	xorl	%edi, %edi
	xorl	%ecx, %ecx
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movslq	(%rsi,%rdi,4), %rdx
	movl	(%r15,%rdx,4), %edx
	andl	$1, %edx
	addl	%ecx, %edx
	movslq	4(%rsi,%rdi,4), %rcx
	movl	(%r15,%rcx,4), %ecx
	andl	$1, %ecx
	addl	%edx, %ecx
	movslq	8(%rsi,%rdi,4), %rdx
	movl	(%r15,%rdx,4), %edx
	andl	$1, %edx
	addl	%ecx, %edx
	movslq	12(%rsi,%rdi,4), %rcx
	movl	(%r15,%rcx,4), %ecx
	andl	$1, %ecx
	addl	%edx, %ecx
	addq	$4, %rdi
	cmpq	%rdi, %rax
	jne	LBB0_5
LBB0_6:
	testq	%r8, %r8
	je	LBB0_9
## %bb.7:
	leaq	(%rsi,%rdi,4), %rax
	xorl	%esi, %esi
	.p2align	4, 0x90
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	movslq	(%rax,%rsi,4), %rdx
	movl	(%r15,%rdx,4), %edx
	andl	$1, %edx
	addl	%edx, %ecx
	incq	%rsi
	cmpq	%rsi, %r8
	jne	LBB0_8
LBB0_9:
	addl	%ecx, %ecx
	movq	16(%r14), %r10
	xorl	%edi, %edi
	movl	$31, %r8d
	movl	%r9d, %r11d
	jmp	LBB0_10
	.p2align	4, 0x90
LBB0_12:                                ##   in Loop: Header=BB0_10 Depth=1
	cmpl	$31, %esi
	cmovgel	%r8d, %esi
	movl	%esi, (%r15,%r12,4)
	movl	8(%r14), %r11d
LBB0_13:                                ##   in Loop: Header=BB0_10 Depth=1
	incq	%rdi
	movslq	%r11d, %rax
	cmpq	%rax, %rdi
	jge	LBB0_14
LBB0_10:                                ## =>This Inner Loop Header: Depth=1
	cmpl	%r9d, %ecx
	setle	%dl
	movslq	(%r10,%rdi,4), %r12
	movl	(%r15,%r12,4), %ebx
	movl	%ebx, %eax
	xorb	%dl, %al
	xorb	$1, %al
	movzbl	%al, %eax
	movl	%eax, %esi
	andl	$1, %esi
	addl	%ebx, %esi
	testb	$1, %al
	jne	LBB0_12
## %bb.11:                              ##   in Loop: Header=BB0_10 Depth=1
	cmpl	$32, %esi
	jl	LBB0_13
	jmp	LBB0_12
LBB0_14:
	cmpl	$2, %r11d
	jl	LBB0_20
## %bb.15:
	movq	16(%r14), %r10
	movl	$1, %ecx
	movq	_CANDIDATE_MB_TYPE_DIRECT@GOTPCREL(%rip), %r9
	movq	_CANDIDATE_MB_TYPE_BIDIR@GOTPCREL(%rip), %r8
	jmp	LBB0_16
	.p2align	4, 0x90
LBB0_19:                                ##   in Loop: Header=BB0_16 Depth=1
	incq	%rcx
	movslq	%r11d, %rax
	cmpq	%rax, %rcx
	jge	LBB0_20
LBB0_16:                                ## =>This Inner Loop Header: Depth=1
	movslq	(%r10,%rcx,4), %rdi
	movl	(%r15,%rdi,4), %eax
	movslq	-4(%r10,%rcx,4), %rdx
	cmpl	(%r15,%rdx,4), %eax
	je	LBB0_19
## %bb.17:                              ##   in Loop: Header=BB0_16 Depth=1
	movq	24(%r14), %rsi
	movl	(%rsi,%rdi,4), %eax
	testl	%eax, (%r9)
	je	LBB0_19
## %bb.18:                              ##   in Loop: Header=BB0_16 Depth=1
	orl	(%r8), %eax
	movl	%eax, (%rsi,%rdi,4)
	movl	8(%r14), %r11d
	jmp	LBB0_19
LBB0_20:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_AV_PICTURE_TYPE_B,8,3          ## @AV_PICTURE_TYPE_B
	.comm	_CANDIDATE_MB_TYPE_DIRECT,4,2   ## @CANDIDATE_MB_TYPE_DIRECT
	.comm	_CANDIDATE_MB_TYPE_BIDIR,4,2    ## @CANDIDATE_MB_TYPE_BIDIR
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ff_clean_mpeg4_qscales         ; -- Begin function ff_clean_mpeg4_qscales
	.p2align	2
_ff_clean_mpeg4_qscales:                ; @ff_clean_mpeg4_qscales
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x0
	ldr	x20, [x0, #32]
	bl	_ff_clean_h263_qscales
	ldr	x8, [x19]
Lloh0:
	adrp	x9, _AV_PICTURE_TYPE_B@GOTPAGE
Lloh1:
	ldr	x9, [x9, _AV_PICTURE_TYPE_B@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_20
; %bb.1:
	ldr	w8, [x19, #8]
	cmp	w8, #1
	b.lt	LBB0_20
; %bb.2:
	ldr	x9, [x19, #16]
	cmp	w8, #4
	b.hs	LBB0_4
; %bb.3:
	mov	x10, #0
	mov	w11, #0
	b	LBB0_7
LBB0_4:
	mov	w13, #0
	mov	w14, #0
	mov	w12, #0
	mov	w11, #0
	and	x10, x8, #0xfffffffc
	add	x15, x9, #8
	mov	x16, x10
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldpsw	x17, x0, [x15, #-8]
	ldpsw	x1, x2, [x15], #16
	ldr	w17, [x20, x17, lsl #2]
	ldr	w0, [x20, x0, lsl #2]
	ldr	w1, [x20, x1, lsl #2]
	ldr	w2, [x20, x2, lsl #2]
	and	w17, w17, #0x1
	and	w0, w0, #0x1
	and	w1, w1, #0x1
	and	w2, w2, #0x1
	add	w13, w17, w13
	add	w14, w0, w14
	add	w12, w1, w12
	add	w11, w2, w11
	subs	x16, x16, #4
	b.ne	LBB0_5
; %bb.6:
	add	w13, w14, w13
	add	w12, w12, w13
	add	w11, w11, w12
	cmp	x10, x8
	b.eq	LBB0_9
LBB0_7:
	add	x9, x9, x10, lsl #2
	sub	x10, x8, x10
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	ldrsw	x12, [x9], #4
	ldr	w12, [x20, x12, lsl #2]
	and	w12, w12, #0x1
	add	w11, w12, w11
	subs	x10, x10, #1
	b.ne	LBB0_8
LBB0_9:
	mov	x10, #0
	lsl	w11, w11, #1
	ldr	x12, [x19, #16]
	mov	w13, #31
	mov	x9, x8
	b	LBB0_12
LBB0_10:                                ;   in Loop: Header=BB0_12 Depth=1
	cmp	w15, #31
	csel	w9, w15, w13, lt
	str	w9, [x20, x14, lsl #2]
	ldr	w9, [x19, #8]
LBB0_11:                                ;   in Loop: Header=BB0_12 Depth=1
	add	x10, x10, #1
	cmp	x10, w9, sxtw
	b.ge	LBB0_14
LBB0_12:                                ; =>This Inner Loop Header: Depth=1
	cmp	w11, w8
	ldrsw	x14, [x12, x10, lsl #2]
	cset	w15, le
	ldr	w16, [x20, x14, lsl #2]
	eon	w17, w15, w16
	and	w15, w17, #0x1
	add	w15, w16, w15
	tbnz	w17, #0, LBB0_10
; %bb.13:                               ;   in Loop: Header=BB0_12 Depth=1
	cmp	w15, #32
	b.lt	LBB0_11
	b	LBB0_10
LBB0_14:
	cmp	w9, #2
	b.lt	LBB0_20
; %bb.15:
	mov	x10, #0
	ldr	x8, [x19, #16]
Lloh3:
	adrp	x11, _CANDIDATE_MB_TYPE_DIRECT@GOTPAGE
Lloh4:
	ldr	x11, [x11, _CANDIDATE_MB_TYPE_DIRECT@GOTPAGEOFF]
Lloh5:
	adrp	x12, _CANDIDATE_MB_TYPE_BIDIR@GOTPAGE
Lloh6:
	ldr	x12, [x12, _CANDIDATE_MB_TYPE_BIDIR@GOTPAGEOFF]
	b	LBB0_17
LBB0_16:                                ;   in Loop: Header=BB0_17 Depth=1
	add	x13, x10, #2
	add	x10, x10, #1
	cmp	x13, w9, sxtw
	b.ge	LBB0_20
LBB0_17:                                ; =>This Inner Loop Header: Depth=1
	add	x14, x8, x10, lsl #2
	ldpsw	x14, x13, [x14]
	ldr	w15, [x20, x13, lsl #2]
	ldr	w14, [x20, x14, lsl #2]
	cmp	w15, w14
	b.eq	LBB0_16
; %bb.18:                               ;   in Loop: Header=BB0_17 Depth=1
	ldr	x14, [x19, #24]
	ldr	w15, [x14, x13, lsl #2]
	ldr	w16, [x11]
	tst	w16, w15
	b.eq	LBB0_16
; %bb.19:                               ;   in Loop: Header=BB0_17 Depth=1
	ldr	w9, [x12]
	orr	w9, w9, w15
	str	w9, [x14, x13, lsl #2]
	ldr	w9, [x19, #8]
	b	LBB0_16
LBB0_20:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_AV_PICTURE_TYPE_B,8,3          ; @AV_PICTURE_TYPE_B
	.comm	_CANDIDATE_MB_TYPE_DIRECT,4,2   ; @CANDIDATE_MB_TYPE_DIRECT
	.comm	_CANDIDATE_MB_TYPE_BIDIR,4,2    ; @CANDIDATE_MB_TYPE_BIDIR
.subsections_via_symbols
