	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function decode_frame
_decode_frame:                          ## @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	%rdx, %rbx
	movq	%rsi, -48(%rbp)                 ## 8-byte Spill
	movq	%rdi, %r13
	movq	8(%rdi), %r12
	movq	(%rcx), %rax
	movq	%rax, (%r12)
	movq	%r12, %rdi
	callq	_bytestream_get_byte
	movl	%eax, %r15d
	movq	_BMV_AUDIO@GOTPCREL(%rip), %rax
	testl	%r15d, (%rax)
	je	LBB0_5
## %bb.1:
	movq	%r12, %rdi
	callq	_bytestream_get_byte
                                        ## kill: def $eax killed $eax def $rax
	movl	%eax, %ecx
	shll	$6, %ecx
	leal	(%rax,%rcx), %edx
	addl	$2, %edx
	cmpl	%edx, 8(%r14)
	jge	LBB0_4
## %bb.2:
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rdx
	jmp	LBB0_3
LBB0_4:
	addl	%ecx, %eax
	cltq
	addq	%rax, (%r12)
LBB0_5:
	movq	_BMV_COMMAND@GOTPCREL(%rip), %rax
	testl	%r15d, (%rax)
	je	LBB0_9
## %bb.6:
	movq	_BMV_PRINT@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	testl	%r15d, (%rcx)
	sete	%al
	movq	(%r12), %rcx
	movq	%rcx, %rdx
	subq	(%r14), %rdx
	leaq	(%rdx,%rax,2), %rdx
	addq	$8, %rdx
	movslq	8(%r14), %rsi
	cmpq	%rsi, %rdx
	jle	LBB0_8
## %bb.7:
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.1(%rip), %rdx
	jmp	LBB0_3
LBB0_8:
	addq	%rax, %rax
	addq	$8, %rax
	addq	%rcx, %rax
	movq	%rax, (%r12)
LBB0_9:
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	movq	_BMV_PALETTE@GOTPCREL(%rip), %rax
	testl	%r15d, (%rax)
	je	LBB0_13
## %bb.10:
	movq	(%r12), %rax
	subq	(%r14), %rax
	movslq	8(%r14), %rcx
	addq	$-768, %rcx                     ## imm = 0xFD00
	cmpq	%rcx, %rax
	jle	LBB0_11
## %bb.26:
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.2(%rip), %rdx
	jmp	LBB0_3
LBB0_11:
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_12:                                ## =>This Inner Loop Header: Depth=1
	movq	%r12, %rdi
	callq	_bytestream_get_be24
	orl	$-16777216, %eax                ## imm = 0xFF000000
	movq	8(%r12), %rcx
	movl	%eax, (%rcx,%rbx,4)
	incq	%rbx
	cmpq	$256, %rbx                      ## imm = 0x100
	jne	LBB0_12
LBB0_13:
	movq	_BMV_SCROLL@GOTPCREL(%rip), %rax
	testl	%r15d, (%rax)
	je	LBB0_17
## %bb.14:
	movq	(%r12), %rax
	subq	(%r14), %rax
	movslq	8(%r14), %rcx
	addq	$-2, %rcx
	cmpq	%rcx, %rax
	jle	LBB0_16
## %bb.15:
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.3(%rip), %rdx
	jmp	LBB0_3
LBB0_17:
	movq	_BMV_INTRA@GOTPCREL(%rip), %rax
	movl	%r15d, %ecx
	notl	%ecx
	xorl	%edx, %edx
	testl	%ecx, (%rax)
	movl	$-640, %ebx                     ## imm = 0xFD80
	cmovnel	%edx, %ebx
	jmp	LBB0_18
LBB0_16:
	movq	%r12, %rdi
	callq	_bytestream_get_le16
	movq	%rax, %rbx
LBB0_18:
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	movq	%r13, %rdi
	xorl	%edx, %edx
	callq	_ff_get_buffer
	testl	%eax, %eax
	js	LBB0_25
## %bb.19:
	movslq	8(%r14), %rax
	movq	(%r14), %rsi
	movq	(%r12), %rdi
	movq	16(%r12), %rdx
	subq	%rdi, %rsi
	addq	%rax, %rsi
	movl	%ebx, %ecx
	callq	_decode_bmv_frame
	testq	%rax, %rax
	je	LBB0_21
## %bb.20:
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.4(%rip), %rdx
LBB0_3:
	movq	%r13, %rdi
	callq	_av_log
	movq	_AVERROR_INVALIDDATA@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
LBB0_25:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_21:
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	movq	(%rbx), %rax
	movq	8(%rax), %rdi
	movq	8(%r12), %rsi
	movq	_AVPALETTE_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_memcpy
	movq	_BMV_PALETTE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	andl	%r15d, %eax
	movl	%eax, 8(%rbx)
	cmpl	$0, (%r13)
	jle	LBB0_24
## %bb.22:
	movq	%rbx, %rcx
	movq	16(%r12), %r15
	movq	(%rbx), %rax
	movq	(%rax), %r12
	movl	4(%r13), %edx
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_23:                                ## =>This Inner Loop Header: Depth=1
	movq	%r12, %rdi
	movq	%r15, %rsi
                                        ## kill: def $edx killed $edx killed $rdx
	callq	_memcpy
	movslq	4(%r13), %rdx
	leaq	(%r15,%rdx,4), %r15
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	16(%rax), %rax
	movslq	(%rax), %rax
	leaq	(%r12,%rax,4), %r12
	incl	%ebx
	cmpl	(%r13), %ebx
	jl	LBB0_23
LBB0_24:
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movl	$1, (%rax)
	movl	8(%r14), %eax
	jmp	LBB0_25
	.cfi_endproc
                                        ## -- End function
	.comm	_BMV_AUDIO,4,2                  ## @BMV_AUDIO
	.comm	_AV_LOG_ERROR,4,2               ## @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Audio data doesn't fit in frame\n"

	.comm	_AVERROR_INVALIDDATA,4,2        ## @AVERROR_INVALIDDATA
	.comm	_BMV_COMMAND,4,2                ## @BMV_COMMAND
	.comm	_BMV_PRINT,4,2                  ## @BMV_PRINT
L_.str.1:                               ## @.str.1
	.asciz	"Command data doesn't fit in frame\n"

	.comm	_BMV_PALETTE,4,2                ## @BMV_PALETTE
L_.str.2:                               ## @.str.2
	.asciz	"Palette data doesn't fit in frame\n"

	.comm	_BMV_SCROLL,4,2                 ## @BMV_SCROLL
L_.str.3:                               ## @.str.3
	.asciz	"Screen offset data doesn't fit in frame\n"

	.comm	_BMV_INTRA,4,2                  ## @BMV_INTRA
L_.str.4:                               ## @.str.4
	.asciz	"Error decoding frame data\n"

	.comm	_AVPALETTE_SIZE,4,2             ## @AVPALETTE_SIZE
	.no_dead_strip	_decode_frame
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function decode_frame
_decode_frame:                          ; @decode_frame
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x20, x3
	mov	x21, x2
	mov	x22, x1
	mov	x19, x0
	ldr	x23, [x0, #8]
	ldr	x8, [x3]
	str	x8, [x23]
	mov	x0, x23
	bl	_bytestream_get_byte
	mov	x24, x0
Lloh0:
	adrp	x8, _BMV_AUDIO@GOTPAGE
Lloh1:
	ldr	x8, [x8, _BMV_AUDIO@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	tst	w8, w0
	b.eq	LBB0_4
; %bb.1:
	mov	x0, x23
	bl	_bytestream_get_byte
	ldr	w9, [x20, #8]
	add	w8, w0, w0, lsl #6
	add	w10, w8, #2
	cmp	w9, w10
	b.ge	LBB0_3
; %bb.2:
Lloh3:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh4:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
Lloh6:
	adrp	x2, l_.str@PAGE
Lloh7:
	add	x2, x2, l_.str@PAGEOFF
	b	LBB0_21
LBB0_3:
	ldr	x9, [x23]
	add	x8, x9, w8, sxtw
	str	x8, [x23]
LBB0_4:
Lloh8:
	adrp	x8, _BMV_COMMAND@GOTPAGE
Lloh9:
	ldr	x8, [x8, _BMV_COMMAND@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	tst	w8, w24
	b.eq	LBB0_8
; %bb.5:
Lloh11:
	adrp	x8, _BMV_PRINT@GOTPAGE
Lloh12:
	ldr	x8, [x8, _BMV_PRINT@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	tst	w8, w24
	mov	w8, #8
	mov	w9, #10
	csel	x8, x9, x8, eq
	ldr	x9, [x23]
	ldr	x10, [x20]
	sub	x10, x9, x10
	add	x10, x10, x8
	ldrsw	x11, [x20, #8]
	cmp	x10, x11
	b.le	LBB0_7
; %bb.6:
Lloh14:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh15:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh16:
	ldr	w1, [x8]
Lloh17:
	adrp	x2, l_.str.1@PAGE
Lloh18:
	add	x2, x2, l_.str.1@PAGEOFF
	b	LBB0_21
LBB0_7:
	add	x8, x8, x9
	str	x8, [x23]
LBB0_8:
Lloh19:
	adrp	x26, _BMV_PALETTE@GOTPAGE
Lloh20:
	ldr	x26, [x26, _BMV_PALETTE@GOTPAGEOFF]
	ldr	w8, [x26]
	tst	w8, w24
	b.eq	LBB0_13
; %bb.9:
	ldr	x8, [x23]
	ldr	x9, [x20]
	ldrsw	x10, [x20, #8]
	sub	x10, x10, #768
	sub	x8, x8, x9
	cmp	x8, x10
	b.le	LBB0_11
; %bb.10:
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
	b	LBB0_21
LBB0_11:
	mov	x25, #0
LBB0_12:                                ; =>This Inner Loop Header: Depth=1
	mov	x0, x23
	bl	_bytestream_get_be24
	orr	w8, w0, #0xff000000
	ldr	x9, [x23, #8]
	str	w8, [x9, x25]
	add	x25, x25, #4
	cmp	x25, #1024
	b.ne	LBB0_12
LBB0_13:
Lloh26:
	adrp	x8, _BMV_SCROLL@GOTPAGE
Lloh27:
	ldr	x8, [x8, _BMV_SCROLL@GOTPAGEOFF]
Lloh28:
	ldr	w8, [x8]
	tst	w8, w24
	b.eq	LBB0_16
; %bb.14:
	ldr	x8, [x23]
	ldr	x9, [x20]
	ldrsw	x10, [x20, #8]
	sub	x10, x10, #2
	sub	x8, x8, x9
	cmp	x8, x10
	b.le	LBB0_17
; %bb.15:
Lloh29:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh30:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh31:
	ldr	w1, [x8]
Lloh32:
	adrp	x2, l_.str.3@PAGE
Lloh33:
	add	x2, x2, l_.str.3@PAGEOFF
	b	LBB0_21
LBB0_16:
Lloh34:
	adrp	x8, _BMV_INTRA@GOTPAGE
Lloh35:
	ldr	x8, [x8, _BMV_INTRA@GOTPAGEOFF]
Lloh36:
	ldr	w8, [x8]
	bics	wzr, w8, w24
	mov	w8, #-640
	csel	w25, w8, wzr, eq
	b	LBB0_18
LBB0_17:
	mov	x0, x23
	bl	_bytestream_get_le16
	mov	x25, x0
LBB0_18:
	mov	x0, x19
	mov	x1, x22
	mov	w2, #0
	bl	_ff_get_buffer
	tbnz	w0, #31, LBB0_22
; %bb.19:
	ldr	x0, [x23]
	ldrsw	x8, [x20, #8]
	ldr	x9, [x20]
	sub	x9, x9, x0
	add	x1, x9, x8
	ldr	x2, [x23, #16]
	mov	x3, x25
	bl	_decode_bmv_frame
	cbz	x0, LBB0_23
; %bb.20:
Lloh37:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh38:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh39:
	ldr	w1, [x8]
Lloh40:
	adrp	x2, l_.str.4@PAGE
Lloh41:
	add	x2, x2, l_.str.4@PAGEOFF
LBB0_21:
	mov	x0, x19
	bl	_av_log
Lloh42:
	adrp	x8, _AVERROR_INVALIDDATA@GOTPAGE
Lloh43:
	ldr	x8, [x8, _AVERROR_INVALIDDATA@GOTPAGEOFF]
Lloh44:
	ldr	w0, [x8]
LBB0_22:
	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
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
LBB0_23:
	ldr	x8, [x22]
	ldr	x0, [x8, #8]
	ldr	x1, [x23, #8]
Lloh45:
	adrp	x8, _AVPALETTE_SIZE@GOTPAGE
Lloh46:
	ldr	x8, [x8, _AVPALETTE_SIZE@GOTPAGEOFF]
Lloh47:
	ldr	w2, [x8]
	bl	_memcpy
	ldr	w8, [x26]
	and	w8, w8, w24
	str	w8, [x22, #8]
	ldr	w8, [x19]
	cmp	w8, #1
	b.lt	LBB0_26
; %bb.24:
	mov	w25, #0
	ldr	x23, [x23, #16]
	ldr	x8, [x22]
	ldr	x24, [x8]
	ldr	w2, [x19, #4]
LBB0_25:                                ; =>This Inner Loop Header: Depth=1
	mov	x0, x24
	mov	x1, x23
                                        ; kill: def $w2 killed $w2 killed $x2
	bl	_memcpy
	ldp	w8, w2, [x19]
                                        ; kill: def $w2 killed $w2 def $x2
	sxtw	x2, w2
	add	x23, x23, x2, lsl #2
	ldr	x9, [x22, #16]
	ldrsw	x9, [x9]
	add	x24, x24, x9, lsl #2
	add	w25, w25, #1
	cmp	w25, w8
	b.lt	LBB0_25
LBB0_26:
	mov	w8, #1
	str	w8, [x21]
	ldr	w0, [x20, #8]
	b	LBB0_22
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpAdd	Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.loh AdrpAdd	Lloh40, Lloh41
	.loh AdrpLdrGotLdr	Lloh37, Lloh38, Lloh39
	.loh AdrpLdrGotLdr	Lloh42, Lloh43, Lloh44
	.loh AdrpLdrGotLdr	Lloh45, Lloh46, Lloh47
	.cfi_endproc
                                        ; -- End function
	.comm	_BMV_AUDIO,4,2                  ; @BMV_AUDIO
	.comm	_AV_LOG_ERROR,4,2               ; @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Audio data doesn't fit in frame\n"

	.comm	_AVERROR_INVALIDDATA,4,2        ; @AVERROR_INVALIDDATA
	.comm	_BMV_COMMAND,4,2                ; @BMV_COMMAND
	.comm	_BMV_PRINT,4,2                  ; @BMV_PRINT
l_.str.1:                               ; @.str.1
	.asciz	"Command data doesn't fit in frame\n"

	.comm	_BMV_PALETTE,4,2                ; @BMV_PALETTE
l_.str.2:                               ; @.str.2
	.asciz	"Palette data doesn't fit in frame\n"

	.comm	_BMV_SCROLL,4,2                 ; @BMV_SCROLL
l_.str.3:                               ; @.str.3
	.asciz	"Screen offset data doesn't fit in frame\n"

	.comm	_BMV_INTRA,4,2                  ; @BMV_INTRA
l_.str.4:                               ; @.str.4
	.asciz	"Error decoding frame data\n"

	.comm	_AVPALETTE_SIZE,4,2             ; @AVPALETTE_SIZE
	.no_dead_strip	_decode_frame
.subsections_via_symbols
