	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function msvideo1_decode_frame
_msvideo1_decode_frame:                 ## @msvideo1_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	%rcx, %r14
	movq	%rdi, %rbx
	movq	8(%rcx), %rax
	movl	(%rcx), %r12d
	movq	8(%rdi), %r13
	movq	%rax, 32(%r13)
	movl	%r12d, (%r13)
	movq	(%rdi), %xmm0                   ## xmm0 = mem[0],zero
	movdqa	%xmm0, %xmm1
	psrad	$31, %xmm1
	psrld	$30, %xmm1
	paddd	%xmm0, %xmm1
	psrad	$2, %xmm1
	pextrd	$1, %xmm1, %eax
	movd	%xmm1, %ecx
	imull	%ecx, %eax
	leal	511(%rax), %ecx
	testl	%eax, %eax
	cmovnsl	%eax, %ecx
	sarl	$9, %ecx
	cmpl	%ecx, %r12d
	jge	LBB0_2
## %bb.1:
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rdx
	movq	%rbx, %rdi
	xorl	%eax, %eax
	callq	_av_log
	movq	_AVERROR_INVALIDDATA@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	jmp	LBB0_15
LBB0_2:
	movq	%rsi, %r15
	movq	%rdx, -56(%rbp)                 ## 8-byte Spill
	movq	8(%r13), %rsi
	movq	%rbx, %rdi
	xorl	%edx, %edx
	callq	_ff_reget_buffer
	testl	%eax, %eax
	js	LBB0_14
## %bb.3:
	cmpq	$0, 16(%r13)
	je	LBB0_11
## %bb.4:
	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_7
## %bb.5:
	movl	-44(%rbp), %ecx
	movq	_AVPALETTE_SIZE@GOTPCREL(%rip), %rdx
	cmpl	(%rdx), %ecx
	jne	LBB0_10
## %bb.6:
	movl	24(%r13), %edi
	movq	%rax, %rsi
	movl	%ecx, %edx
	callq	_memcpy
	movq	8(%r13), %rax
	movl	$1, (%rax)
LBB0_7:
	cmpq	$0, 16(%r13)
	je	LBB0_11
LBB0_8:
	movq	%r13, %rdi
	callq	_msvideo1_decode_8bit
	jmp	LBB0_12
LBB0_10:
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.1(%rip), %rdx
	movq	%rbx, %rdi
	xorl	%eax, %eax
	callq	_av_log
	cmpq	$0, 16(%r13)
	jne	LBB0_8
LBB0_11:
	movq	%r13, %rdi
	callq	_msvideo1_decode_16bit
LBB0_12:
	movq	8(%r13), %rsi
	movq	%r15, %rdi
	callq	_av_frame_ref
	testl	%eax, %eax
	js	LBB0_14
## %bb.13:
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movl	$1, (%rax)
	jmp	LBB0_15
LBB0_14:
	movl	%eax, %r12d
LBB0_15:
	movl	%r12d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_AV_LOG_ERROR,4,2               ## @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Packet is too small\n"

	.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
L_.str.1:                               ## @.str.1
	.asciz	"Palette size %d is wrong\n"

	.no_dead_strip	_msvideo1_decode_frame
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function msvideo1_decode_frame
_msvideo1_decode_frame:                 ; @msvideo1_decode_frame
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x22, x0
	ldr	x8, [x3, #8]
	ldr	w24, [x3]
	ldr	x21, [x0, #8]
	str	x8, [x21, #32]
	str	w24, [x21]
	ldp	w8, w9, [x0]
	add	w10, w8, #3
	cmp	w8, #0
	csel	w8, w10, w8, lt
	asr	w8, w8, #2
	add	w10, w9, #3
	cmp	w9, #0
	csel	w9, w10, w9, lt
	asr	w9, w9, #2
	mul	w8, w9, w8
	add	w9, w8, #511
	cmp	w8, #0
	csel	w8, w9, w8, lt
	cmp	w24, w8, asr #9
	b.ge	LBB0_2
; %bb.1:
Lloh0:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh1:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
Lloh3:
	adrp	x2, l_.str@PAGE
Lloh4:
	add	x2, x2, l_.str@PAGEOFF
	mov	x0, x22
	bl	_av_log
Lloh5:
	adrp	x8, _AVERROR_INVALIDDATA@GOTPAGE
Lloh6:
	ldr	x8, [x8, _AVERROR_INVALIDDATA@GOTPAGEOFF]
Lloh7:
	ldr	w0, [x8]
	b	LBB0_13
LBB0_2:
	mov	x23, x3
	mov	x19, x2
	mov	x20, x1
	ldr	x1, [x21, #8]
	mov	x0, x22
	mov	w2, #0
	bl	_ff_reget_buffer
	tbnz	w0, #31, LBB0_13
; %bb.3:
	ldr	x8, [x21, #16]
	cbz	x8, LBB0_10
; %bb.4:
Lloh8:
	adrp	x8, _AV_PKT_DATA_PALETTE@GOTPAGE
Lloh9:
	ldr	x8, [x8, _AV_PKT_DATA_PALETTE@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
	add	x2, sp, #12
	mov	x0, x23
	bl	_av_packet_get_side_data
	cbz	x0, LBB0_7
; %bb.5:
	ldr	w2, [sp, #12]
Lloh11:
	adrp	x8, _AVPALETTE_SIZE@GOTPAGE
Lloh12:
	ldr	x8, [x8, _AVPALETTE_SIZE@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	cmp	w2, w8
	b.ne	LBB0_9
; %bb.6:
	mov	x1, x0
	ldr	w0, [x21, #24]
                                        ; kill: def $w2 killed $w2 killed $x2
	bl	_memcpy
	ldr	x8, [x21, #8]
	mov	w9, #1
	str	w9, [x8]
LBB0_7:
	ldr	x8, [x21, #16]
	cbz	x8, LBB0_10
LBB0_8:
	mov	x0, x21
	bl	_msvideo1_decode_8bit
	b	LBB0_11
LBB0_9:
Lloh14:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh15:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh16:
	ldr	w1, [x8]
	str	x2, [sp]
Lloh17:
	adrp	x2, l_.str.1@PAGE
Lloh18:
	add	x2, x2, l_.str.1@PAGEOFF
	mov	x0, x22
	bl	_av_log
	ldr	x8, [x21, #16]
	cbnz	x8, LBB0_8
LBB0_10:
	mov	x0, x21
	bl	_msvideo1_decode_16bit
LBB0_11:
	ldr	x1, [x21, #8]
	mov	x0, x20
	bl	_av_frame_ref
	tbnz	w0, #31, LBB0_13
; %bb.12:
	mov	w8, #1
	str	w8, [x19]
	mov	x0, x24
LBB0_13:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_AV_LOG_ERROR,4,2               ; @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Packet is too small\n"

	.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
l_.str.1:                               ; @.str.1
	.asciz	"Palette size %d is wrong\n"

	.no_dead_strip	_msvideo1_decode_frame
.subsections_via_symbols
