	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cinepak_predecode_check
_cinepak_predecode_check:               ## @cinepak_predecode_check
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movq	(%rdi), %rdi
	addq	$32, %rdi
	callq	_AV_RB16
	movl	%eax, %r15d
	movq	(%rbx), %rdi
	addq	$4, %rdi
	callq	_AV_RB24
	movl	%eax, %r14d
	movq	16(%rbx), %rdi
	movl	$100, %eax
	subl	(%rdi), %eax
	movl	8(%rbx), %ecx
	imull	%r14d, %eax
	cltq
	imulq	$1374389535, %rax, %rax         ## imm = 0x51EB851F
	movq	%rax, %rdx
	shrq	$63, %rdx
	sarq	$37, %rax
	addl	%edx, %eax
	cmpl	%eax, %ecx
	jl	LBB0_15
## %bb.1:
	movl	12(%rbx), %esi
	cmpl	$-1, %esi
	jne	LBB0_14
## %bb.2:
	testl	%r14d, %r14d
	je	LBB0_22
## %bb.3:
	xorl	%esi, %esi
	cmpl	%ecx, %r14d
	je	LBB0_13
## %bb.4:
	movl	%ecx, %eax
	cltd
	idivl	%r14d
	testl	%edx, %edx
	je	LBB0_13
## %bb.5:
	cmpl	$16, %ecx
	jl	LBB0_12
## %bb.6:
	movq	(%rbx), %rax
	cmpl	$254, 40(%rax)
	jne	LBB0_12
## %bb.7:
	cmpl	$0, 44(%rax)
	jne	LBB0_12
## %bb.8:
	cmpl	$0, 48(%rax)
	jne	LBB0_12
## %bb.9:
	cmpl	$6, 52(%rax)
	jne	LBB0_12
## %bb.10:
	cmpl	$0, 56(%rax)
	jne	LBB0_12
## %bb.11:
	cmpl	$0, 60(%rax)
	je	LBB0_23
LBB0_12:
	movl	$2, %esi
LBB0_13:
	movl	%esi, 12(%rbx)
LBB0_14:
	leal	(%r15,%r15,2), %eax
	leal	(%rsi,%rax,4), %eax
	addl	$10, %eax
	cmpl	%eax, %ecx
	jge	LBB0_18
LBB0_15:
	movq	_AVERROR_INVALIDDATA@GOTPCREL(%rip), %rax
LBB0_16:
	movl	(%rax), %eax
LBB0_17:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_18:
	testl	%r15d, %r15d
	je	LBB0_21
## %bb.19:
	movq	(%rbx), %rax
	movslq	%esi, %rcx
	leaq	(%rax,%rcx,4), %rdi
	addq	$44, %rdi
	callq	_AV_RB24
	movl	%eax, %ecx
	movq	_AVERROR_INVALIDDATA@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	cmpl	$12, %ecx
	jl	LBB0_17
## %bb.20:
	cmpl	%r14d, %ecx
	jg	LBB0_17
LBB0_21:
	xorl	%eax, %eax
	jmp	LBB0_17
LBB0_22:
	leaq	L_.str(%rip), %rsi
	callq	_avpriv_request_sample
	movq	_AVERROR_PATCHWELCOME@GOTPCREL(%rip), %rax
	jmp	LBB0_16
LBB0_23:
	movl	$6, %esi
	jmp	LBB0_13
	.cfi_endproc
                                        ## -- End function
	.comm	_AVERROR_INVALIDDATA,4,2        ## @AVERROR_INVALIDDATA
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"encoded_buf_size 0"

	.comm	_AVERROR_PATCHWELCOME,4,2       ## @AVERROR_PATCHWELCOME
	.no_dead_strip	_cinepak_predecode_check
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function cinepak_predecode_check
_cinepak_predecode_check:               ; @cinepak_predecode_check
	.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
	ldr	x8, [x0]
	add	x0, x8, #32
	bl	_AV_RB16
	mov	x21, x0
	ldr	x8, [x19]
	add	x0, x8, #4
	bl	_AV_RB24
	mov	x20, x0
	ldr	w8, [x19, #8]
	ldr	x0, [x19, #16]
	ldr	w9, [x0]
	mov	w10, #100
	sub	w9, w10, w9
	mul	w9, w9, w20
	mov	w10, #34079
	movk	w10, #20971, lsl #16
	smull	x9, w9, w10
	lsr	x10, x9, #32
	lsr	x9, x9, #63
	add	w9, w9, w10, asr #5
	cmp	w8, w9
	b.lt	LBB0_17
; %bb.1:
	ldr	w9, [x19, #12]
	cmn	w9, #1
	b.ne	LBB0_16
; %bb.2:
	cbz	w20, LBB0_5
; %bb.3:
	cmp	w20, w8
	b.ne	LBB0_6
; %bb.4:
	mov	w9, #0
	b	LBB0_15
LBB0_5:
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	bl	_avpriv_request_sample
Lloh2:
	adrp	x8, _AVERROR_PATCHWELCOME@GOTPAGE
Lloh3:
	ldr	x8, [x8, _AVERROR_PATCHWELCOME@GOTPAGEOFF]
	b	LBB0_18
LBB0_6:
	sdiv	w9, w8, w20
	msub	w9, w9, w20, w8
	cbz	w9, LBB0_15
; %bb.7:
	cmp	w8, #16
	b.lt	LBB0_14
; %bb.8:
	ldr	x9, [x19]
	ldr	w10, [x9, #40]
	cmp	w10, #254
	b.ne	LBB0_14
; %bb.9:
	ldr	w10, [x9, #44]
	cbnz	w10, LBB0_14
; %bb.10:
	ldr	w10, [x9, #48]
	cbnz	w10, LBB0_14
; %bb.11:
	ldr	w10, [x9, #52]
	cmp	w10, #6
	b.ne	LBB0_14
; %bb.12:
	ldr	w10, [x9, #56]
	cbnz	w10, LBB0_14
; %bb.13:
	ldr	w9, [x9, #60]
	cbz	w9, LBB0_24
LBB0_14:
	mov	w9, #2
LBB0_15:
	str	w9, [x19, #12]
LBB0_16:
	mov	w10, #12
	madd	w10, w21, w10, w9
	add	w10, w10, #10
	cmp	w8, w10
	b.ge	LBB0_20
LBB0_17:
Lloh4:
	adrp	x8, _AVERROR_INVALIDDATA@GOTPAGE
Lloh5:
	ldr	x8, [x8, _AVERROR_INVALIDDATA@GOTPAGEOFF]
LBB0_18:
	ldr	w0, [x8]
LBB0_19:
	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_20:
	cbz	w21, LBB0_23
; %bb.21:
	ldr	x8, [x19]
	add	x8, x8, w9, sxtw #2
	add	x0, x8, #44
	bl	_AV_RB24
	mov	x8, x0
Lloh6:
	adrp	x9, _AVERROR_INVALIDDATA@GOTPAGE
Lloh7:
	ldr	x9, [x9, _AVERROR_INVALIDDATA@GOTPAGEOFF]
Lloh8:
	ldr	w0, [x9]
	cmp	w8, #12
	b.lt	LBB0_19
; %bb.22:
	cmp	w8, w20
	b.gt	LBB0_19
LBB0_23:
	mov	w0, #0
	b	LBB0_19
LBB0_24:
	mov	w9, #6
	b	LBB0_15
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_AVERROR_INVALIDDATA,4,2        ; @AVERROR_INVALIDDATA
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"encoded_buf_size 0"

	.comm	_AVERROR_PATCHWELCOME,4,2       ; @AVERROR_PATCHWELCOME
	.no_dead_strip	_cinepak_predecode_check
.subsections_via_symbols
