	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function parse_palette_segment
_parse_palette_segment:                 ## @parse_palette_segment
	.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
	movl	%edx, %ebx
	movq	%rsi, %r14
	movq	%rdi, %r15
	movq	%rsi, -48(%rbp)
	movq	8(%rdi), %r13
	leaq	-48(%rbp), %rdi
	callq	_bytestream_get_byte
	movl	%eax, %r12d
	movl	%eax, %edi
	movq	%r13, %rsi
	callq	_find_palette
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	testq	%rax, %rax
	jne	LBB0_4
## %bb.1:
	movq	(%r13), %rax
	movq	_MAX_EPOCH_PALETTES@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jge	LBB0_2
## %bb.3:
	movq	8(%r13), %rcx
	leaq	1(%rax), %rdx
	movq	%rdx, (%r13)
	shlq	$4, %rax
	leaq	(%rcx,%rax), %rdx
	movq	%rdx, -64(%rbp)                 ## 8-byte Spill
	movl	%r12d, (%rcx,%rax)
LBB0_4:
	movslq	%ebx, %rax
	leaq	(%r14,%rax,4), %rdx
	movq	-48(%rbp), %rcx
	addq	$4, %rcx
	movq	%rcx, -48(%rbp)
	xorl	%eax, %eax
	movq	%rdx, -72(%rbp)                 ## 8-byte Spill
	cmpq	%rdx, %rcx
	jb	LBB0_5
	jmp	LBB0_10
	.p2align	4, 0x90
LBB0_7:                                 ##   in Loop: Header=BB0_5 Depth=1
	callq	_YUV_TO_RGB1_CCIR
LBB0_8:                                 ##   in Loop: Header=BB0_5 Depth=1
	movl	-52(%rbp), %ecx                 ## 4-byte Reload
	callq	_YUV_TO_RGB2_CCIR
	movl	%r14d, (%rsp)
	movq	%rbx, %r15
	movq	%rbx, %rdi
	leaq	L_.str.1(%rip), %rsi
	movl	-56(%rbp), %ebx                 ## 4-byte Reload
	movl	%ebx, %edx
	callq	_ff_dlog
	movl	%r14d, %ecx
	callq	_RGBA
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	movq	8(%rcx), %rcx
	movslq	%ebx, %rdx
	movl	%eax, (%rcx,%rdx,4)
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	cmpq	%rax, -48(%rbp)
	jae	LBB0_9
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	leaq	-48(%rbp), %rbx
	movq	%rbx, %rdi
	callq	_bytestream_get_byte
	movl	%eax, -56(%rbp)                 ## 4-byte Spill
	movq	%rbx, %rdi
	callq	_bytestream_get_byte
	movq	%r15, %r13
	movl	%eax, -52(%rbp)                 ## 4-byte Spill
	movq	%rbx, %rdi
	callq	_bytestream_get_byte
	movl	%eax, %r15d
	movq	%rbx, %rdi
	callq	_bytestream_get_byte
	movl	%eax, %r12d
	movq	%rbx, %rdi
	callq	_bytestream_get_byte
	movl	%eax, %r14d
	movq	%r13, %rbx
	movl	(%r13), %eax
	movl	$-577, %ecx                     ## imm = 0xFDBF
	addl	%ecx, %eax
	movl	%r12d, %edi
	movl	%r15d, %esi
	cmpl	$-577, %eax                     ## imm = 0xFDBF
	ja	LBB0_7
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=1
	callq	_YUV_TO_RGB1_CCIR_BT709
	jmp	LBB0_8
LBB0_9:
	xorl	%eax, %eax
	jmp	LBB0_10
LBB0_2:
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rdx
	movq	%r15, %rdi
	callq	_av_log
	movq	_AVERROR_INVALIDDATA@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
LBB0_10:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ff_crop_tab,8,3                ## @ff_crop_tab
	.comm	_MAX_NEG_CROP,4,2               ## @MAX_NEG_CROP
	.comm	_MAX_EPOCH_PALETTES,8,3         ## @MAX_EPOCH_PALETTES
	.comm	_AV_LOG_ERROR,4,2               ## @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Too many palettes in epoch\n"

	.comm	_AVERROR_INVALIDDATA,4,2        ## @AVERROR_INVALIDDATA
L_.str.1:                               ## @.str.1
	.asciz	"Color %d := (%d,%d,%d,%d)\n"

	.no_dead_strip	_parse_palette_segment
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function parse_palette_segment
_parse_palette_segment:                 ; @parse_palette_segment
	.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	x21, x2
	mov	x22, x1
	mov	x19, x0
	str	x1, [sp, #8]
	ldr	x23, [x0, #8]
	add	x0, sp, #8
	bl	_bytestream_get_byte
	mov	x24, x0
	mov	x1, x23
	bl	_find_palette
	mov	x20, x0
	cbnz	x0, LBB0_3
; %bb.1:
	ldr	x8, [x23]
Lloh0:
	adrp	x9, _MAX_EPOCH_PALETTES@GOTPAGE
Lloh1:
	ldr	x9, [x9, _MAX_EPOCH_PALETTES@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ge	LBB0_10
; %bb.2:
	ldr	x9, [x23, #8]
	add	x10, x8, #1
	str	x10, [x23]
	add	x20, x9, x8, lsl #4
	str	w24, [x20]
LBB0_3:
	add	x27, x22, w21, sxtw #2
	ldr	x8, [sp, #8]
	add	x8, x8, #4
	str	x8, [sp, #8]
	cmp	x8, x27
	b.hs	LBB0_9
; %bb.4:
Lloh3:
	adrp	x21, l_.str.1@PAGE
Lloh4:
	add	x21, x21, l_.str.1@PAGEOFF
	b	LBB0_7
LBB0_5:                                 ;   in Loop: Header=BB0_7 Depth=1
	bl	_YUV_TO_RGB1_CCIR
LBB0_6:                                 ;   in Loop: Header=BB0_7 Depth=1
	mov	x3, x23
	bl	_YUV_TO_RGB2_CCIR
	mov	x0, x19
	mov	x1, x21
	mov	x2, x22
	mov	x6, x24
	bl	_ff_dlog
	mov	x3, x24
	bl	_RGBA
	ldr	x8, [x20, #8]
	str	w0, [x8, w22, sxtw #2]
	ldr	x8, [sp, #8]
	cmp	x8, x27
	b.hs	LBB0_9
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	add	x0, sp, #8
	bl	_bytestream_get_byte
	mov	x22, x0
	add	x0, sp, #8
	bl	_bytestream_get_byte
	mov	x23, x0
	add	x0, sp, #8
	bl	_bytestream_get_byte
	mov	x25, x0
	add	x0, sp, #8
	bl	_bytestream_get_byte
	mov	x26, x0
	add	x0, sp, #8
	bl	_bytestream_get_byte
	mov	x24, x0
	ldr	w8, [x19]
	sub	w8, w8, #577
	mov	x0, x26
	mov	x1, x25
	cmn	w8, #577
	b.hi	LBB0_5
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=1
	bl	_YUV_TO_RGB1_CCIR_BT709
	b	LBB0_6
LBB0_9:
	mov	w0, #0
	b	LBB0_11
LBB0_10:
Lloh5:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh6:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
Lloh8:
	adrp	x2, l_.str@PAGE
Lloh9:
	add	x2, x2, l_.str@PAGEOFF
	mov	x0, x19
	bl	_av_log
Lloh10:
	adrp	x8, _AVERROR_INVALIDDATA@GOTPAGE
Lloh11:
	ldr	x8, [x8, _AVERROR_INVALIDDATA@GOTPAGEOFF]
Lloh12:
	ldr	w0, [x8]
LBB0_11:
	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
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_ff_crop_tab,8,3                ; @ff_crop_tab
	.comm	_MAX_NEG_CROP,4,2               ; @MAX_NEG_CROP
	.comm	_MAX_EPOCH_PALETTES,8,3         ; @MAX_EPOCH_PALETTES
	.comm	_AV_LOG_ERROR,4,2               ; @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Too many palettes in epoch\n"

	.comm	_AVERROR_INVALIDDATA,4,2        ; @AVERROR_INVALIDDATA
l_.str.1:                               ; @.str.1
	.asciz	"Color %d := (%d,%d,%d,%d)\n"

	.no_dead_strip	_parse_palette_segment
.subsections_via_symbols
