	.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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %rax
	movl	(%rcx), %edx
	cmpl	$9, %edx
	jle	LBB0_1
## %bb.2:
	movq	%rdi, %r12
	movq	%rsi, -64(%rbp)                 ## 8-byte Spill
	movq	%rax, -88(%rbp)                 ## 8-byte Spill
	movq	8(%rdi), %rsi
	movl	4(%rdi), %eax
	imull	(%rdi), %eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movq	%rsi, -72(%rbp)                 ## 8-byte Spill
	leaq	8(%rsi), %r13
	movl	4(%rcx), %esi
	movq	%r13, %rdi
	movq	%rcx, %rbx
	callq	_bytestream2_init
	movq	%r13, %rdi
	movl	$8, %esi
	callq	_bytestream2_skip
	movq	%r13, %rdi
	callq	_bytestream2_get_le16
	testl	%eax, %eax
	je	LBB0_3
## %bb.4:
	movl	%eax, %r14d
	movq	%rbx, -80(%rbp)                 ## 8-byte Spill
	leal	(,%r14,8), %ebx
	subl	%eax, %ebx
	movq	%r13, %rdi
	callq	_bytestream2_get_bytes_left
	cmpl	%eax, %ebx
	jle	LBB0_5
LBB0_1:
	movq	_AVERROR_INVALIDDATA@GOTPCREL(%rip), %rax
LBB0_28:
	movl	(%rax), %eax
	jmp	LBB0_29
LBB0_3:
	movl	(%rbx), %eax
	jmp	LBB0_29
LBB0_5:
	movq	_AV_GET_BUFFER_FLAG_REF@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r12, %rdi
	movq	-64(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rsi
	callq	_ff_get_buffer
	testl	%eax, %eax
	js	LBB0_29
## %bb.6:
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rsi
	movq	(%rsi), %rax
	cmpq	$0, (%rax)
	je	LBB0_8
## %bb.7:
	movq	%rbx, %rdi
	callq	_av_frame_copy
	testl	%eax, %eax
	js	LBB0_29
LBB0_8:
	testl	%r14d, %r14d
	jle	LBB0_23
## %bb.9:
	movq	%r12, -56(%rbp)                 ## 8-byte Spill
	jmp	LBB0_10
	.p2align	4, 0x90
LBB0_22:                                ##   in Loop: Header=BB0_10 Depth=1
	decl	%r14d
	je	LBB0_23
LBB0_10:                                ## =>This Inner Loop Header: Depth=1
	movq	%r13, %rdi
	callq	_bytestream2_get_bytes_left
	testl	%eax, %eax
	jle	LBB0_1
## %bb.11:                              ##   in Loop: Header=BB0_10 Depth=1
	movq	%r13, %rdi
	callq	_bytestream2_get_byte
	movl	%eax, %r15d
	shll	$16, %r15d
	movq	%r13, %rdi
	movl	$1, %esi
	callq	_bytestream2_skip
	movq	%r13, %rdi
	callq	_bytestream2_get_byte
	movl	%eax, %ebx
	shll	$8, %ebx
	orl	%r15d, %ebx
	movq	%r13, %rdi
	movl	$1, %esi
	callq	_bytestream2_skip
	movq	%r13, %rdi
	callq	_bytestream2_get_byte
	movl	%eax, %r15d
	orl	%ebx, %r15d
	movq	%r13, %rdi
	movl	$1, %esi
	callq	_bytestream2_skip
	movq	%r13, %rdi
	callq	_bytestream2_get_byte
	movl	%eax, %r12d
	testb	$16, %r12b
	jne	LBB0_13
## %bb.12:                              ##   in Loop: Header=BB0_10 Depth=1
	movq	-64(%rbp), %rbx                 ## 8-byte Reload
	testb	$8, %r12b
	jne	LBB0_15
	jmp	LBB0_16
	.p2align	4, 0x90
LBB0_13:                                ##   in Loop: Header=BB0_10 Depth=1
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movl	$1024, %esi                     ## imm = 0x400
	movl	$1024, %edx                     ## imm = 0x400
	movl	%r15d, %ecx
	movq	-64(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %r8
	callq	_fill_tileX
	subl	%eax, -44(%rbp)                 ## 4-byte Folded Spill
	testb	$8, %r12b
	je	LBB0_16
LBB0_15:                                ##   in Loop: Header=BB0_10 Depth=1
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movl	$256, %esi                      ## imm = 0x100
	movl	$256, %edx                      ## imm = 0x100
	movl	%r15d, %ecx
	movq	%rbx, %r8
	callq	_fill_tileX
	subl	%eax, -44(%rbp)                 ## 4-byte Folded Spill
LBB0_16:                                ##   in Loop: Header=BB0_10 Depth=1
	testb	$4, %r12b
	jne	LBB0_17
## %bb.18:                              ##   in Loop: Header=BB0_10 Depth=1
	testb	$2, %r12b
	jne	LBB0_19
LBB0_20:                                ##   in Loop: Header=BB0_10 Depth=1
	testb	$1, %r12b
	je	LBB0_22
	jmp	LBB0_21
	.p2align	4, 0x90
LBB0_17:                                ##   in Loop: Header=BB0_10 Depth=1
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movl	$64, %esi
	movl	$64, %edx
	movl	%r15d, %ecx
	movq	%rbx, %r8
	callq	_fill_tileX
	subl	%eax, -44(%rbp)                 ## 4-byte Folded Spill
	testb	$2, %r12b
	je	LBB0_20
LBB0_19:                                ##   in Loop: Header=BB0_10 Depth=1
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movl	$16, %esi
	movl	$16, %edx
	movl	%r15d, %ecx
	movq	%rbx, %r8
	callq	_fill_tileX
	subl	%eax, -44(%rbp)                 ## 4-byte Folded Spill
	testb	$1, %r12b
	je	LBB0_22
LBB0_21:                                ##   in Loop: Header=BB0_10 Depth=1
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movl	%r15d, %esi
	movq	%rbx, %rdx
	callq	_fill_tile4
	subl	%eax, -44(%rbp)                 ## 4-byte Folded Spill
	jmp	LBB0_22
LBB0_23:
	movq	-72(%rbp), %r14                 ## 8-byte Reload
	movq	(%r14), %rdi
	callq	_av_frame_unref
	movq	(%r14), %rdi
	movq	%rbx, %rsi
	callq	_av_frame_ref
	testl	%eax, %eax
	js	LBB0_29
## %bb.24:
	xorl	%eax, %eax
	cmpl	$0, -44(%rbp)                   ## 4-byte Folded Reload
	setle	%cl
	jg	LBB0_25
## %bb.26:
	movq	_AV_PICTURE_TYPE_I@GOTPCREL(%rip), %rdx
	jmp	LBB0_27
LBB0_29:
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_25:
	movq	_AV_PICTURE_TYPE_P@GOTPCREL(%rip), %rdx
LBB0_27:
	movl	(%rdx), %edx
	movl	%edx, 4(%rbx)
	movb	%cl, %al
	movl	%eax, (%rbx)
	movq	-88(%rbp), %rax                 ## 8-byte Reload
	movl	$1, (%rax)
	movq	-80(%rbp), %rax                 ## 8-byte Reload
	jmp	LBB0_28
	.cfi_endproc
                                        ## -- End function
	.comm	_AVERROR_INVALIDDATA,4,2        ## @AVERROR_INVALIDDATA
	.comm	_AV_GET_BUFFER_FLAG_REF,4,2     ## @AV_GET_BUFFER_FLAG_REF
	.comm	_AV_PICTURE_TYPE_I,4,2          ## @AV_PICTURE_TYPE_I
	.comm	_AV_PICTURE_TYPE_P,4,2          ## @AV_PICTURE_TYPE_P
	.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	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x20, x2
	ldr	w2, [x3]
	cmp	w2, #9
	b.le	LBB0_3
; %bb.1:
	mov	x19, x3
	mov	x21, x1
	mov	x22, x0
	ldr	x27, [x0, #8]
	ldp	w25, w26, [x0]
	add	x23, x27, #8
	ldr	w1, [x3, #4]
	mov	x0, x23
	bl	_bytestream2_init
	mov	x0, x23
	mov	w1, #8
	bl	_bytestream2_skip
	mov	x0, x23
	bl	_bytestream2_get_le16
	cbz	w0, LBB0_10
; %bb.2:
	mov	x24, x0
	lsl	w8, w0, #3
	sub	w28, w8, w0
	mov	x0, x23
	bl	_bytestream2_get_bytes_left
	cmp	w28, w0
	b.le	LBB0_4
LBB0_3:
Lloh0:
	adrp	x8, _AVERROR_INVALIDDATA@GOTPAGE
Lloh1:
	ldr	x8, [x8, _AVERROR_INVALIDDATA@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	b	LBB0_11
LBB0_4:
Lloh3:
	adrp	x8, _AV_GET_BUFFER_FLAG_REF@GOTPAGE
Lloh4:
	ldr	x8, [x8, _AV_GET_BUFFER_FLAG_REF@GOTPAGEOFF]
Lloh5:
	ldr	w2, [x8]
	mov	x0, x22
	mov	x1, x21
	bl	_ff_get_buffer
	tbnz	w0, #31, LBB0_11
; %bb.5:
	ldr	x1, [x27]
	ldr	x8, [x1]
	ldr	x8, [x8]
	cbz	x8, LBB0_7
; %bb.6:
	mov	x0, x21
	bl	_av_frame_copy
	tbnz	w0, #31, LBB0_11
LBB0_7:
	mul	w28, w26, w25
	cmp	w24, #1
	b.ge	LBB0_13
LBB0_8:
	ldr	x0, [x27]
	bl	_av_frame_unref
	ldr	x0, [x27]
	mov	x1, x21
	bl	_av_frame_ref
	tbnz	w0, #31, LBB0_11
; %bb.9:
	cmp	w28, #1
	cset	w8, lt
Lloh6:
	adrp	x9, _AV_PICTURE_TYPE_I@GOTPAGE
Lloh7:
	ldr	x9, [x9, _AV_PICTURE_TYPE_I@GOTPAGEOFF]
Lloh8:
	adrp	x10, _AV_PICTURE_TYPE_P@GOTPAGE
Lloh9:
	ldr	x10, [x10, _AV_PICTURE_TYPE_P@GOTPAGEOFF]
	csel	x9, x9, x10, lt
	ldr	w9, [x9]
	stp	w8, w9, [x21]
	mov	w8, #1
	str	w8, [x20]
LBB0_10:
	ldr	w0, [x19]
LBB0_11:
	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
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
LBB0_12:                                ;   in Loop: Header=BB0_13 Depth=1
	subs	w24, w24, #1
	b.eq	LBB0_8
LBB0_13:                                ; =>This Inner Loop Header: Depth=1
	mov	x0, x23
	bl	_bytestream2_get_bytes_left
	cmp	w0, #1
	b.lt	LBB0_3
; %bb.14:                               ;   in Loop: Header=BB0_13 Depth=1
	mov	x0, x23
	bl	_bytestream2_get_byte
	mov	x25, x0
	mov	x0, x23
	mov	w1, #1
	bl	_bytestream2_skip
	mov	x0, x23
	bl	_bytestream2_get_byte
	lsl	w8, w0, #8
	orr	w25, w8, w25, lsl #16
	mov	x0, x23
	mov	w1, #1
	bl	_bytestream2_skip
	mov	x0, x23
	bl	_bytestream2_get_byte
	orr	w25, w25, w0
	mov	x0, x23
	mov	w1, #1
	bl	_bytestream2_skip
	mov	x0, x23
	bl	_bytestream2_get_byte
	mov	x26, x0
	tbnz	w0, #4, LBB0_19
; %bb.15:                               ;   in Loop: Header=BB0_13 Depth=1
	tbnz	w26, #3, LBB0_20
LBB0_16:                                ;   in Loop: Header=BB0_13 Depth=1
	tbnz	w26, #2, LBB0_21
LBB0_17:                                ;   in Loop: Header=BB0_13 Depth=1
	tbnz	w26, #1, LBB0_22
LBB0_18:                                ;   in Loop: Header=BB0_13 Depth=1
	tbz	w26, #0, LBB0_12
	b	LBB0_23
LBB0_19:                                ;   in Loop: Header=BB0_13 Depth=1
	mov	x0, x22
	mov	w1, #1024
	mov	w2, #1024
	mov	x3, x25
	mov	x4, x21
	bl	_fill_tileX
	sub	w28, w28, w0
	tbz	w26, #3, LBB0_16
LBB0_20:                                ;   in Loop: Header=BB0_13 Depth=1
	mov	x0, x22
	mov	w1, #256
	mov	w2, #256
	mov	x3, x25
	mov	x4, x21
	bl	_fill_tileX
	sub	w28, w28, w0
	tbz	w26, #2, LBB0_17
LBB0_21:                                ;   in Loop: Header=BB0_13 Depth=1
	mov	x0, x22
	mov	w1, #64
	mov	w2, #64
	mov	x3, x25
	mov	x4, x21
	bl	_fill_tileX
	sub	w28, w28, w0
	tbz	w26, #1, LBB0_18
LBB0_22:                                ;   in Loop: Header=BB0_13 Depth=1
	mov	x0, x22
	mov	w1, #16
	mov	w2, #16
	mov	x3, x25
	mov	x4, x21
	bl	_fill_tileX
	sub	w28, w28, w0
	tbz	w26, #0, LBB0_12
LBB0_23:                                ;   in Loop: Header=BB0_13 Depth=1
	mov	x0, x22
	mov	x1, x25
	mov	x2, x21
	bl	_fill_tile4
	sub	w28, w28, w0
	b	LBB0_12
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_AVERROR_INVALIDDATA,4,2        ; @AVERROR_INVALIDDATA
	.comm	_AV_GET_BUFFER_FLAG_REF,4,2     ; @AV_GET_BUFFER_FLAG_REF
	.comm	_AV_PICTURE_TYPE_I,4,2          ; @AV_PICTURE_TYPE_I
	.comm	_AV_PICTURE_TYPE_P,4,2          ; @AV_PICTURE_TYPE_P
	.no_dead_strip	_decode_frame
.subsections_via_symbols
