	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function parse_palette
_parse_palette:                         ## @parse_palette
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, -72(%rbp)                 ## 8-byte Spill
	movq	%rdi, -64(%rbp)                 ## 8-byte Spill
	testl	%ecx, %ecx
	js	LBB0_8
## %bb.1:
	movl	%r8d, %r13d
	movl	%ecx, %r14d
	movq	%rsi, %rbx
	incl	%r14d
	xorl	%r12d, %r12d
	movl	%r8d, -48(%rbp)                 ## 4-byte Spill
	movl	%r14d, -44(%rbp)                ## 4-byte Spill
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_4:                                 ##   in Loop: Header=BB0_2 Depth=1
	movq	_AV_LOG_WARNING@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	leaq	L_.str(%rip), %rdx
	movl	%r15d, %ecx
	callq	_av_log
	movq	%rbx, %rdi
	movl	$6, %esi
	callq	_bytestream2_skip
LBB0_7:                                 ##   in Loop: Header=BB0_2 Depth=1
	incl	%r12d
	cmpl	%r12d, %r14d
	je	LBB0_8
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	%rbx, %rdi
	callq	_bytestream2_get_be16
	movl	%eax, %r15d
	testl	%r13d, %r13d
	jne	LBB0_5
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	cmpl	$256, %r15d                     ## imm = 0x100
	jae	LBB0_4
LBB0_5:                                 ##   in Loop: Header=BB0_2 Depth=1
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rax
	movq	_AV_PIX_FMT_PAL8@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_10
## %bb.6:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	%rbx, %rdi
	callq	_bytestream2_get_byte
	movl	%eax, %r13d
	movq	%rbx, %rdi
	movl	$1, %esi
	callq	_bytestream2_skip
	movq	%rbx, %rdi
	callq	_bytestream2_get_byte
	movl	%eax, %r14d
	movq	%rbx, %rdi
	movl	$1, %esi
	callq	_bytestream2_skip
	movq	%rbx, %rdi
	callq	_bytestream2_get_byte
	movl	%eax, -52(%rbp)                 ## 4-byte Spill
	movq	%rbx, %rdi
	movl	$1, %esi
	callq	_bytestream2_skip
	shll	$16, %r13d
	shll	$8, %r14d
	orl	%r13d, %r14d
	movl	-48(%rbp), %r13d                ## 4-byte Reload
	orl	-52(%rbp), %r14d                ## 4-byte Folded Reload
	orl	$-16777216, %r14d               ## imm = 0xFF000000
	testl	%r13d, %r13d
	cmovnel	%r12d, %r15d
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	movl	%r14d, (%rax,%r15,4)
	movl	-44(%rbp), %r14d                ## 4-byte Reload
	jmp	LBB0_7
LBB0_8:
	xorl	%eax, %eax
	jmp	LBB0_9
LBB0_10:
	movq	_AVERROR_INVALIDDATA@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
LBB0_9:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_AV_LOG_WARNING,4,2             ## @AV_LOG_WARNING
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Palette index out of range: %u\n"

	.comm	_AV_PIX_FMT_PAL8,8,3            ## @AV_PIX_FMT_PAL8
	.comm	_AVERROR_INVALIDDATA,4,2        ## @AVERROR_INVALIDDATA
	.no_dead_strip	_parse_palette
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function parse_palette
_parse_palette:                         ; @parse_palette
	.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
	tbnz	w3, #31, LBB0_8
; %bb.1:
	mov	x19, x4
	mov	x20, x2
	mov	x21, x1
	mov	x22, x0
	mov	w28, #0
	add	w23, w3, #1
	b	LBB0_4
LBB0_2:                                 ;   in Loop: Header=BB0_4 Depth=1
Lloh0:
	adrp	x8, _AV_LOG_WARNING@GOTPAGE
Lloh1:
	ldr	x8, [x8, _AV_LOG_WARNING@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	x0, x22
Lloh3:
	adrp	x2, l_.str@PAGE
Lloh4:
	add	x2, x2, l_.str@PAGEOFF
	mov	x3, x24
	bl	_av_log
	mov	x0, x21
	mov	w1, #6
	bl	_bytestream2_skip
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	add	w28, w28, #1
	cmp	w23, w28
	b.eq	LBB0_8
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x21
	bl	_bytestream2_get_be16
	mov	x24, x0
	cbnz	w19, LBB0_6
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	cmp	w24, #256
	b.hs	LBB0_2
LBB0_6:                                 ;   in Loop: Header=BB0_4 Depth=1
	ldr	x8, [x22]
Lloh5:
	adrp	x9, _AV_PIX_FMT_PAL8@GOTPAGE
Lloh6:
	ldr	x9, [x9, _AV_PIX_FMT_PAL8@GOTPAGEOFF]
Lloh7:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_9
; %bb.7:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	x0, x21
	bl	_bytestream2_get_byte
	mov	x25, x0
	mov	x0, x21
	mov	w1, #1
	bl	_bytestream2_skip
	mov	x0, x21
	bl	_bytestream2_get_byte
	mov	x26, x0
	mov	x0, x21
	mov	w1, #1
	bl	_bytestream2_skip
	mov	x0, x21
	bl	_bytestream2_get_byte
	mov	x27, x0
	mov	x0, x21
	mov	w1, #1
	bl	_bytestream2_skip
	lsl	w8, w25, #16
	orr	w8, w8, w26, lsl #8
	orr	w8, w8, w27
	orr	w8, w8, #0xff000000
	cmp	w19, #0
	csel	w9, w28, w24, ne
	str	w8, [x20, w9, uxtw #2]
	b	LBB0_3
LBB0_8:
	mov	w0, #0
	b	LBB0_10
LBB0_9:
Lloh8:
	adrp	x8, _AVERROR_INVALIDDATA@GOTPAGE
Lloh9:
	ldr	x8, [x8, _AVERROR_INVALIDDATA@GOTPAGEOFF]
Lloh10:
	ldr	w0, [x8]
LBB0_10:
	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
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_AV_LOG_WARNING,4,2             ; @AV_LOG_WARNING
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Palette index out of range: %u\n"

	.comm	_AV_PIX_FMT_PAL8,8,3            ; @AV_PIX_FMT_PAL8
	.comm	_AVERROR_INVALIDDATA,4,2        ; @AVERROR_INVALIDDATA
	.no_dead_strip	_parse_palette
.subsections_via_symbols
