	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cinepak_decode_frame
_cinepak_decode_frame:                  ## @cinepak_decode_frame
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r13
	movq	8(%rcx), %rdi
	movl	(%rcx), %r12d
	movq	(%r13), %rbx
	movq	%rdi, 32(%rbx)
	movl	%r12d, (%rbx)
	cmpl	$9, %r12d
	jg	LBB0_2
## %bb.1:
	movq	_AVERROR_INVALIDDATA@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	jmp	LBB0_21
LBB0_2:
	movq	%rcx, %r14
	movq	%rdx, %r15
	movq	%rsi, -64(%rbp)                 ## 8-byte Spill
	addq	$32, %rdi
	callq	_AV_RB16
	testl	%eax, %eax
	je	LBB0_9
LBB0_3:
	movq	%r15, -56(%rbp)                 ## 8-byte Spill
	movq	%rbx, %rdi
	callq	_cinepak_predecode_check
	testl	%eax, %eax
	js	LBB0_11
## %bb.4:
	movq	8(%rbx), %rsi
	movq	%r13, %rdi
	xorl	%edx, %edx
	callq	_ff_reget_buffer
	testl	%eax, %eax
	js	LBB0_20
## %bb.5:
	cmpq	$0, 24(%rbx)
	movq	-56(%rbp), %r15                 ## 8-byte Reload
	je	LBB0_14
## %bb.6:
	movq	_AV_PKT_DATA_PALETTE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-44(%rbp), %rdx
	movq	%r14, %rdi
	callq	_av_packet_get_side_data
	testq	%rax, %rax
	je	LBB0_14
## %bb.7:
	movl	-44(%rbp), %ecx
	movq	_AVPALETTE_SIZE@GOTPCREL(%rip), %rdx
	cmpl	(%rdx), %ecx
	jne	LBB0_13
## %bb.8:
	movq	8(%rbx), %rcx
	movl	$1, (%rcx)
	movq	16(%rbx), %rdi
	movl	(%rdx), %edx
	movq	%rax, %rsi
	callq	_memcpy
	jmp	LBB0_14
LBB0_9:
	cmpq	$0, 24(%rbx)
	je	LBB0_21
## %bb.10:
	movq	_AV_PKT_DATA_PALETTE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	xorl	%edx, %edx
	callq	_av_packet_get_side_data
	testq	%rax, %rax
	jne	LBB0_3
	jmp	LBB0_21
LBB0_11:
	movl	%eax, %r15d
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rdx
	movq	%r13, %rdi
	xorl	%eax, %eax
	callq	_av_log
	movl	%r15d, %r12d
	jmp	LBB0_21
LBB0_13:
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.1(%rip), %rdx
	movq	%r13, %rdi
	xorl	%eax, %eax
	callq	_av_log
LBB0_14:
	movq	%rbx, %rdi
	callq	_cinepak_decode
	testl	%eax, %eax
	jns	LBB0_16
## %bb.15:
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.2(%rip), %rdx
	movq	%r13, %rdi
	xorl	%eax, %eax
	callq	_av_log
LBB0_16:
	cmpq	$0, 24(%rbx)
	je	LBB0_18
## %bb.17:
	movq	8(%rbx), %rax
	movq	16(%rbx), %rsi
	movq	8(%rax), %rax
	movq	8(%rax), %rdi
	movq	_AVPALETTE_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_memcpy
LBB0_18:
	movq	8(%rbx), %rsi
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	callq	_av_frame_ref
	testl	%eax, %eax
	js	LBB0_20
## %bb.19:
	movl	$1, (%r15)
	jmp	LBB0_21
LBB0_20:
	movl	%eax, %r12d
LBB0_21:
	movl	%r12d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_AVERROR_INVALIDDATA,4,2        ## @AVERROR_INVALIDDATA
	.comm	_AV_PKT_DATA_PALETTE,4,2        ## @AV_PKT_DATA_PALETTE
	.comm	_AV_LOG_ERROR,4,2               ## @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"cinepak_predecode_check failed\n"

	.comm	_AVPALETTE_SIZE,4,2             ## @AVPALETTE_SIZE
L_.str.1:                               ## @.str.1
	.asciz	"Palette size %d is wrong\n"

L_.str.2:                               ## @.str.2
	.asciz	"cinepak_decode failed\n"

	.no_dead_strip	_cinepak_decode_frame
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function cinepak_decode_frame
_cinepak_decode_frame:                  ; @cinepak_decode_frame
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	ldr	x8, [x3, #8]
	ldr	w19, [x3]
	ldr	x22, [x0]
	str	x8, [x22, #32]
	str	w19, [x22]
	cmp	w19, #9
	b.gt	LBB0_2
; %bb.1:
Lloh0:
	adrp	x8, _AVERROR_INVALIDDATA@GOTPAGE
Lloh1:
	ldr	x8, [x8, _AVERROR_INVALIDDATA@GOTPAGEOFF]
Lloh2:
	ldr	w19, [x8]
	b	LBB0_20
LBB0_2:
	mov	x24, x3
	mov	x20, x2
	mov	x21, x1
	mov	x23, x0
	add	x0, x8, #32
	bl	_AV_RB16
	cbz	w0, LBB0_9
LBB0_3:
	mov	x0, x22
	bl	_cinepak_predecode_check
	tbnz	w0, #31, LBB0_11
; %bb.4:
	ldr	x1, [x22, #8]
	mov	x0, x23
	mov	w2, #0
	bl	_ff_reget_buffer
	tbnz	w0, #31, LBB0_19
; %bb.5:
	ldr	x8, [x22, #24]
Lloh3:
	adrp	x25, _AVPALETTE_SIZE@GOTPAGE
Lloh4:
	ldr	x25, [x25, _AVPALETTE_SIZE@GOTPAGEOFF]
	cbz	x8, LBB0_13
; %bb.6:
Lloh5:
	adrp	x8, _AV_PKT_DATA_PALETTE@GOTPAGE
Lloh6:
	ldr	x8, [x8, _AV_PKT_DATA_PALETTE@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
	add	x2, sp, #12
	mov	x0, x24
	bl	_av_packet_get_side_data
	cbz	x0, LBB0_13
; %bb.7:
	ldr	w8, [sp, #12]
	ldr	w9, [x25]
	cmp	w8, w9
	b.ne	LBB0_12
; %bb.8:
	mov	x1, x0
	mov	w8, #1
	ldp	x9, x0, [x22, #8]
	str	w8, [x9]
	ldr	w2, [x25]
	bl	_memcpy
	b	LBB0_13
LBB0_9:
	ldr	x8, [x22, #24]
	cbz	x8, LBB0_20
; %bb.10:
Lloh8:
	adrp	x8, _AV_PKT_DATA_PALETTE@GOTPAGE
Lloh9:
	ldr	x8, [x8, _AV_PKT_DATA_PALETTE@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
	mov	x0, x24
	mov	x2, #0
	bl	_av_packet_get_side_data
	cbnz	x0, LBB0_3
	b	LBB0_20
LBB0_11:
	mov	x25, x0
Lloh11:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh12:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh13:
	ldr	w1, [x8]
Lloh14:
	adrp	x2, l_.str@PAGE
Lloh15:
	add	x2, x2, l_.str@PAGEOFF
	mov	x0, x23
	bl	_av_log
	mov	x19, x25
	b	LBB0_20
LBB0_12:
Lloh16:
	adrp	x9, _AV_LOG_ERROR@GOTPAGE
Lloh17:
	ldr	x9, [x9, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh18:
	ldr	w1, [x9]
	str	x8, [sp]
Lloh19:
	adrp	x2, l_.str.1@PAGE
Lloh20:
	add	x2, x2, l_.str.1@PAGEOFF
	mov	x0, x23
	bl	_av_log
LBB0_13:
	mov	x0, x22
	bl	_cinepak_decode
	tbz	w0, #31, LBB0_15
; %bb.14:
Lloh21:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh22:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh23:
	ldr	w1, [x8]
Lloh24:
	adrp	x2, l_.str.2@PAGE
Lloh25:
	add	x2, x2, l_.str.2@PAGEOFF
	mov	x0, x23
	bl	_av_log
LBB0_15:
	ldr	x8, [x22, #24]
	cbz	x8, LBB0_17
; %bb.16:
	ldp	x8, x1, [x22, #8]
	ldr	x8, [x8, #8]
	ldr	x0, [x8, #8]
	ldr	w2, [x25]
	bl	_memcpy
LBB0_17:
	ldr	x1, [x22, #8]
	mov	x0, x21
	bl	_av_frame_ref
	tbnz	w0, #31, LBB0_19
; %bb.18:
	mov	w8, #1
	str	w8, [x20]
	b	LBB0_20
LBB0_19:
	mov	x19, x0
LBB0_20:
	mov	x0, x19
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.comm	_AVERROR_INVALIDDATA,4,2        ; @AVERROR_INVALIDDATA
	.comm	_AV_PKT_DATA_PALETTE,4,2        ; @AV_PKT_DATA_PALETTE
	.comm	_AV_LOG_ERROR,4,2               ; @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"cinepak_predecode_check failed\n"

	.comm	_AVPALETTE_SIZE,4,2             ; @AVPALETTE_SIZE
l_.str.1:                               ; @.str.1
	.asciz	"Palette size %d is wrong\n"

l_.str.2:                               ; @.str.2
	.asciz	"cinepak_decode failed\n"

	.no_dead_strip	_cinepak_decode_frame
.subsections_via_symbols
