	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function msrle_decode_frame
_msrle_decode_frame:                    ## @msrle_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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rcx, %r12
	movq	%rdx, -88(%rbp)                 ## 8-byte Spill
	movq	%rsi, -72(%rbp)                 ## 8-byte Spill
	movq	%rdi, %r13
	movq	(%rcx), %r15
	movl	8(%rcx), %ebx
	movq	16(%rdi), %r14
	movl	4(%rdi), %edi
	imull	(%r13), %edi
	movl	$32, %esi
	callq	_FFALIGN
                                        ## kill: def $eax killed $eax def $rax
	leal	7(%rax), %ecx
	testl	%eax, %eax
	cmovnsl	%eax, %ecx
	cmpl	$1, %ebx
	jg	LBB0_2
## %bb.1:
	movq	_AVERROR_INVALIDDATA@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	jmp	LBB0_25
LBB0_2:
	movq	%r15, -64(%rbp)                 ## 8-byte Spill
	movl	%ebx, -52(%rbp)                 ## 4-byte Spill
	movl	%ecx, -48(%rbp)                 ## 4-byte Spill
	movq	8(%r14), %rsi
	movq	%r13, %rdi
	xorl	%edx, %edx
	callq	_ff_reget_buffer
	testl	%eax, %eax
	js	LBB0_25
## %bb.3:
	movl	-48(%rbp), %r15d                ## 4-byte Reload
	sarl	$3, %r15d
	movl	4(%r13), %eax
	addl	$-2, %eax
	cmpl	$6, %eax
	movq	%r12, %rbx
	movl	-52(%rbp), %r12d                ## 4-byte Reload
	ja	LBB0_9
## %bb.4:
	movq	_AV_PKT_DATA_PALETTE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-76(%rbp), %rdx
	movq	%rbx, %rdi
	callq	_av_packet_get_side_data
	testq	%rax, %rax
	je	LBB0_8
## %bb.5:
	movl	-76(%rbp), %ecx
	movq	_AVPALETTE_SIZE@GOTPCREL(%rip), %rdx
	cmpl	(%rdx), %ecx
	jne	LBB0_7
## %bb.6:
	movq	8(%r14), %rcx
	movl	$1, (%rcx)
	movq	(%r14), %rdi
	movl	(%rdx), %edx
	movq	%rax, %rsi
	callq	_memcpy
	jmp	LBB0_8
LBB0_7:
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rdx
	movq	%r13, %rdi
	callq	_av_log
LBB0_8:
	movq	(%r14), %rsi
	movq	8(%r14), %rax
	movq	8(%rax), %rax
	movq	8(%rax), %rdi
	movq	_AVPALETTE_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_memcpy
LBB0_9:
	movl	8(%r13), %eax
	imull	%r15d, %eax
	cmpl	8(%rbx), %eax
	jne	LBB0_22
## %bb.10:
	movl	%r15d, %r12d
	movl	(%r13), %esi
	movl	12(%r13), %edi
	xorl	%edx, %edx
	callq	_av_image_get_linesize
	movl	%eax, %edx
	testl	%eax, %eax
	js	LBB0_11
## %bb.12:
	movq	%r14, -48(%rbp)                 ## 8-byte Spill
	movl	8(%r13), %ecx
	testl	%ecx, %ecx
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	jle	LBB0_23
## %bb.13:
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	8(%rax), %r8
	movq	8(%r8), %rax
	movq	(%rax), %r15
	decl	%ecx
	imull	%r12d, %ecx
	movslq	%ecx, %r14
	shlq	$2, %r14
	addq	(%rbx), %r14
	movslq	%r12d, %r9
	shlq	$2, %r9
	negq	%r9
	xorl	%ebx, %ebx
	movq	%r9, -64(%rbp)                  ## 8-byte Spill
	jmp	LBB0_14
	.p2align	4, 0x90
LBB0_20:                                ##   in Loop: Header=BB0_14 Depth=1
	movq	%r15, %rdi
	movq	%r14, %rsi
	movl	%edx, %r12d
	callq	_memcpy
	movq	-64(%rbp), %r9                  ## 8-byte Reload
	movl	%r12d, %edx
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	8(%rax), %r8
LBB0_21:                                ##   in Loop: Header=BB0_14 Depth=1
	addq	%r9, %r14
	movq	16(%r8), %rcx
	movslq	(%rcx), %rcx
	leaq	(%r15,%rcx,4), %r15
	incl	%ebx
	cmpl	8(%r13), %ebx
	jge	LBB0_23
LBB0_14:                                ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_17 Depth 2
	cmpl	$4, 4(%r13)
	jne	LBB0_20
## %bb.15:                              ##   in Loop: Header=BB0_14 Depth=1
	movl	(%r13), %eax
	xorl	%ecx, %ecx
	cmpl	$2, %eax
	jl	LBB0_18
## %bb.16:                              ##   in Loop: Header=BB0_14 Depth=1
	xorl	%ecx, %ecx
	.p2align	4, 0x90
LBB0_17:                                ##   Parent Loop BB0_14 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movl	(%r14,%rcx,2), %eax
	sarl	$4, %eax
	movl	%eax, (%r15,%rcx,4)
	movl	(%r14,%rcx,2), %eax
	andl	$15, %eax
	movl	%eax, 4(%r15,%rcx,4)
	addq	$2, %rcx
	movslq	(%r13), %rax
	leaq	-1(%rax), %rsi
	cmpq	%rsi, %rcx
	jl	LBB0_17
LBB0_18:                                ##   in Loop: Header=BB0_14 Depth=1
	testb	$1, %al
	je	LBB0_21
## %bb.19:                              ##   in Loop: Header=BB0_14 Depth=1
	movl	%ecx, %eax
	shrl	%ecx
	movl	(%r14,%rcx,4), %ecx
	sarl	$4, %ecx
	movl	%ecx, (%r15,%rax,4)
	jmp	LBB0_21
LBB0_22:
	movl	%r12d, %edx
	leaq	16(%r14), %r15
	movq	%r15, %rdi
	movq	-64(%rbp), %rsi                 ## 8-byte Reload
	callq	_bytestream2_init
	movq	%r14, -48(%rbp)                 ## 8-byte Spill
	movq	8(%r14), %rsi
	movl	4(%r13), %edx
	movq	%r13, %rdi
	movq	%r15, %rcx
	callq	_ff_msrle_decode
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
LBB0_23:
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	8(%rax), %rsi
	callq	_av_frame_ref
	testl	%eax, %eax
	js	LBB0_25
## %bb.24:
	movq	-88(%rbp), %rax                 ## 8-byte Reload
	movl	$1, (%rax)
	movl	-52(%rbp), %eax                 ## 4-byte Reload
	jmp	LBB0_25
LBB0_11:
	movl	%edx, %eax
LBB0_25:
	addq	$56, %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	_AVPALETTE_SIZE,4,2             ## @AVPALETTE_SIZE
	.comm	_AV_LOG_ERROR,4,2               ## @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Palette size %d is wrong\n"

	.no_dead_strip	_msrle_decode_frame
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function msrle_decode_frame
_msrle_decode_frame:                    ; @msrle_decode_frame
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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	x23, x3
	mov	x20, x2
	mov	x21, x1
	mov	x22, x0
	ldr	x24, [x3]
	ldr	w19, [x3, #8]
	ldr	x26, [x0, #16]
	ldp	w8, w9, [x0]
	mul	w0, w9, w8
	mov	w1, #32
	bl	_FFALIGN
	add	w8, w0, #7
	cmp	w0, #0
	csel	w25, w8, w0, lt
	cmp	w19, #1
	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_26
LBB0_2:
	ldr	x1, [x26, #8]
	mov	x0, x22
	mov	w2, #0
	bl	_ff_reget_buffer
	tbnz	w0, #31, LBB0_25
; %bb.3:
	asr	w28, w25, #3
	ldr	w8, [x22, #4]
	sub	w8, w8, #2
	cmp	w8, #6
	b.hi	LBB0_9
; %bb.4:
Lloh3:
	adrp	x8, _AV_PKT_DATA_PALETTE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _AV_PKT_DATA_PALETTE@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	add	x2, sp, #12
	mov	x0, x23
	bl	_av_packet_get_side_data
Lloh6:
	adrp	x25, _AVPALETTE_SIZE@GOTPAGE
Lloh7:
	ldr	x25, [x25, _AVPALETTE_SIZE@GOTPAGEOFF]
	cbz	x0, LBB0_8
; %bb.5:
	ldr	w3, [sp, #12]
	ldr	w8, [x25]
	cmp	w3, w8
	b.ne	LBB0_7
; %bb.6:
	mov	x1, x0
	mov	w8, #1
	ldp	x0, x9, [x26]
	str	w8, [x9]
	ldr	w2, [x25]
	bl	_memcpy
	b	LBB0_8
LBB0_7:
Lloh8:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh9:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
Lloh11:
	adrp	x2, l_.str@PAGE
Lloh12:
	add	x2, x2, l_.str@PAGEOFF
	mov	x0, x22
	bl	_av_log
LBB0_8:
	ldp	x1, x8, [x26]
	ldr	x8, [x8, #8]
	ldr	x0, [x8, #8]
	ldr	w2, [x25]
	bl	_memcpy
LBB0_9:
	ldr	w8, [x22, #8]
	mul	w8, w8, w28
	ldr	w9, [x23, #8]
	cmp	w8, w9
	b.ne	LBB0_22
; %bb.10:
	ldr	w0, [x22, #12]
	ldr	w1, [x22]
	mov	w2, #0
	bl	_av_image_get_linesize
	mov	x24, x0
	tbnz	w0, #31, LBB0_27
; %bb.11:
	ldr	w8, [x22, #8]
	subs	w9, w8, #1
	b.lt	LBB0_23
; %bb.12:
	mov	x10, #0
	mov	w27, #0
	ldr	x8, [x26, #8]
	ldr	x11, [x8, #8]
	ldr	x25, [x11]
	ldr	x11, [x23]
	mul	w9, w9, w28
	add	x23, x11, w9, sxtw #2
	sub	x28, x10, w28, sxtw #2
	b	LBB0_15
LBB0_13:                                ;   in Loop: Header=BB0_15 Depth=1
	mov	x0, x25
	mov	x1, x23
	mov	x2, x24
	bl	_memcpy
	ldr	x8, [x26, #8]
LBB0_14:                                ;   in Loop: Header=BB0_15 Depth=1
	add	x23, x23, x28
	ldr	x9, [x8, #16]
	ldrsw	x9, [x9]
	add	x25, x25, x9, lsl #2
	add	w27, w27, #1
	ldr	w9, [x22, #8]
	cmp	w27, w9
	b.ge	LBB0_23
LBB0_15:                                ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_18 Depth 2
	ldr	w9, [x22, #4]
	cmp	w9, #4
	b.ne	LBB0_13
; %bb.16:                               ;   in Loop: Header=BB0_15 Depth=1
	ldr	w10, [x22]
	cmp	w10, #2
	b.lt	LBB0_20
; %bb.17:                               ;   in Loop: Header=BB0_15 Depth=1
	mov	x11, #0
	mov	x9, #0
LBB0_18:                                ;   Parent Loop BB0_15 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	w10, [x23, x11]
	asr	w10, w10, #4
	add	x12, x25, x9, lsl #2
	str	w10, [x12]
	ldr	w10, [x23, x11]
	and	w10, w10, #0xf
	str	w10, [x12, #4]
	add	x9, x9, #2
	ldrsw	x10, [x22]
	sub	x12, x10, #1
	add	x11, x11, #4
	cmp	x9, x12
	b.lt	LBB0_18
; %bb.19:                               ;   in Loop: Header=BB0_15 Depth=1
	tbz	w10, #0, LBB0_14
	b	LBB0_21
LBB0_20:                                ;   in Loop: Header=BB0_15 Depth=1
	mov	w9, #0
	tbz	w10, #0, LBB0_14
LBB0_21:                                ;   in Loop: Header=BB0_15 Depth=1
	lsr	w10, w9, #1
	ldr	w10, [x23, w10, uxtw #2]
	asr	w10, w10, #4
	str	w10, [x25, w9, uxtw #2]
	b	LBB0_14
LBB0_22:
	add	x23, x26, #16
	mov	x0, x23
	mov	x1, x24
	mov	x2, x19
	bl	_bytestream2_init
	ldr	x1, [x26, #8]
	ldr	w2, [x22, #4]
	mov	x0, x22
	mov	x3, x23
	bl	_ff_msrle_decode
LBB0_23:
	ldr	x1, [x26, #8]
	mov	x0, x21
	bl	_av_frame_ref
	tbnz	w0, #31, LBB0_25
; %bb.24:
	mov	w8, #1
	str	w8, [x20]
	b	LBB0_26
LBB0_25:
	mov	x19, x0
LBB0_26:
	mov	x0, x19
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_27:
	mov	x19, x24
	b	LBB0_26
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_AVERROR_INVALIDDATA,4,2        ; @AVERROR_INVALIDDATA
	.comm	_AV_PKT_DATA_PALETTE,4,2        ; @AV_PKT_DATA_PALETTE
	.comm	_AVPALETTE_SIZE,4,2             ; @AVPALETTE_SIZE
	.comm	_AV_LOG_ERROR,4,2               ; @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Palette size %d is wrong\n"

	.no_dead_strip	_msrle_decode_frame
.subsections_via_symbols
