	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mpc8_parse_seektable
_mpc8_parse_seektable:                  ## @mpc8_parse_seektable
	.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	%rdi, %r14
	cmpq	$0, (%rdi)
	je	LBB0_20
## %bb.1:
	movq	24(%r14), %r12
	movl	16(%r14), %edi
	movq	_SEEK_SET@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_avio_seek
	movl	16(%r14), %edi
	leaq	-60(%rbp), %rsi
	leaq	-44(%rbp), %rdx
	callq	_mpc8_get_chunk_header
	movl	-60(%rbp), %eax
	movq	_TAG_SEEKTABLE@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jne	LBB0_2
## %bb.4:
	movl	-44(%rbp), %edi
	testl	%edi, %edi
	jle	LBB0_6
## %bb.5:
	movq	_INT_MAX@GOTPCREL(%rip), %rax
	movslq	(%rax), %rax
	imulq	$1717986919, %rax, %rax         ## imm = 0x66666667
	movq	%rax, %rcx
	shrq	$63, %rcx
	sarq	$34, %rax
	addl	%ecx, %eax
	cmpl	%eax, %edi
	jg	LBB0_6
## %bb.7:
	movq	_AV_INPUT_BUFFER_PADDING_SIZE@GOTPCREL(%rip), %r15
	addq	(%r15), %rdi
	callq	_av_malloc
	testq	%rax, %rax
	je	LBB0_19
## %bb.8:
	movq	%rax, %rbx
	movl	16(%r14), %edi
	movl	-44(%rbp), %edx
	movq	%rax, %rsi
	callq	_avio_read
	cmpl	-44(%rbp), %eax
	jne	LBB0_9
## %bb.11:
	cltq
	leaq	(%rbx,%rax,4), %rdi
	movq	(%r15), %rdx
	xorl	%esi, %esi
	callq	_memset
	movl	-44(%rbp), %edx
	shll	$3, %edx
	leaq	-48(%rbp), %r15
	movq	%r15, %rdi
	movq	%rbx, %rsi
	callq	_init_get_bits
	movq	%r15, %rdi
	callq	_gb_get_v
	movl	%eax, -44(%rbp)
	movq	_UINT_MAX@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	leal	3(%rcx), %edx
	testl	%ecx, %ecx
	cmovnsl	%ecx, %edx
	sarl	$2, %edx
	cmpl	%edx, %eax
	jg	LBB0_13
## %bb.12:
	movslq	(%r12), %rcx
	imulq	$954437177, %rcx, %rcx          ## imm = 0x38E38E39
	movq	%rcx, %rdx
	shrq	$63, %rdx
	sarq	$40, %rcx
	addl	%edx, %ecx
	cmpl	%ecx, %eax
	jle	LBB0_14
LBB0_13:
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.4(%rip), %rdx
	jmp	LBB0_10
LBB0_20:
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rdx
	movq	%r14, %rdi
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_av_log                         ## TAILCALL
LBB0_2:
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.1(%rip), %rdx
	jmp	LBB0_3
LBB0_6:
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.2(%rip), %rdx
LBB0_3:
	movq	%r14, %rdi
	callq	_av_log
LBB0_19:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_9:
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.3(%rip), %rdx
LBB0_10:
	movq	%r14, %rdi
	callq	_av_log
	movq	%rbx, %rdi
LBB0_18:
	callq	_av_free
	jmp	LBB0_19
LBB0_14:
	movq	%rbx, -72(%rbp)                 ## 8-byte Spill
	leaq	-48(%rbp), %r15
	movq	%r15, %rdi
	movl	$4, %esi
	callq	_get_bits
	movl	%eax, -56(%rbp)                 ## 4-byte Spill
	movq	%r15, %rdi
	callq	_gb_get_v
	movl	%eax, %esi
	addl	4(%r12), %esi
	movq	8(%r14), %rax
	movl	(%rax), %edi
	movq	_AVINDEX_KEYFRAME@GOTPCREL(%rip), %rbx
	movl	(%rbx), %r9d
	movl	%esi, -52(%rbp)                 ## 4-byte Spill
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	callq	_av_add_index_entry
	movq	%r15, %rdi
	movq	%rbx, %r15
	callq	_gb_get_v
	movl	%eax, %r13d
	addl	4(%r12), %r13d
	movq	8(%r14), %rax
	movl	(%rax), %edi
	movl	(%rbx), %r9d
	movl	%r13d, %esi
	movl	$1, %edx
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	callq	_av_add_index_entry
	cmpl	$3, -44(%rbp)
	jl	LBB0_17
## %bb.15:
	movl	$2, %r12d
LBB0_16:                                ## =>This Inner Loop Header: Depth=1
	leaq	-48(%rbp), %rdi
	movl	$1, %esi
	movl	$33, %edx
	callq	_get_unary
	movq	%r15, %rbx
	movl	%eax, %r15d
	shll	$12, %r15d
	leaq	-48(%rbp), %rdi
	movl	$12, %esi
	callq	_get_bits
	addl	%r15d, %eax
	movq	%rbx, %r15
	movl	%eax, %ecx
	andl	$-2, %ecx
	negl	%ecx
	testb	$1, %al
	cmovel	%eax, %ecx
	sarl	%ecx
	leal	(%r13,%r13), %ebx
	subl	-52(%rbp), %ebx                 ## 4-byte Folded Reload
	addl	%ecx, %ebx
	movq	8(%r14), %rax
	movl	(%rax), %edi
	movl	%r12d, %edx
	movl	-56(%rbp), %ecx                 ## 4-byte Reload
                                        ## kill: def $cl killed $cl killed $ecx
	shll	%cl, %edx
	movl	(%r15), %r9d
	movl	%ebx, %esi
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	callq	_av_add_index_entry
	incl	%r12d
	movl	%r13d, %eax
	movl	%r13d, -52(%rbp)                ## 4-byte Spill
	movl	%ebx, %r13d
	cmpl	-44(%rbp), %r12d
	jl	LBB0_16
LBB0_17:
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	jmp	LBB0_18
	.cfi_endproc
                                        ## -- End function
	.comm	_AV_LOG_ERROR,4,2               ## @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"No stream added before parsing seek table\n"

	.comm	_SEEK_SET,4,2                   ## @SEEK_SET
	.comm	_TAG_SEEKTABLE,4,2              ## @TAG_SEEKTABLE
L_.str.1:                               ## @.str.1
	.asciz	"No seek table at given position\n"

	.comm	_INT_MAX,4,2                    ## @INT_MAX
L_.str.2:                               ## @.str.2
	.asciz	"Bad seek table size\n"

	.comm	_AV_INPUT_BUFFER_PADDING_SIZE,8,3 ## @AV_INPUT_BUFFER_PADDING_SIZE
L_.str.3:                               ## @.str.3
	.asciz	"seek table truncated\n"

	.comm	_UINT_MAX,4,2                   ## @UINT_MAX
L_.str.4:                               ## @.str.4
	.asciz	"Seek table is too big\n"

	.comm	_AVINDEX_KEYFRAME,4,2           ## @AVINDEX_KEYFRAME
	.no_dead_strip	_mpc8_parse_seektable
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mpc8_parse_seektable
_mpc8_parse_seektable:                  ; @mpc8_parse_seektable
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.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
	mov	x19, x0
	ldr	x8, [x0]
	cbz	x8, LBB0_9
; %bb.1:
	ldr	x23, [x19, #24]
	ldr	w0, [x19, #16]
Lloh0:
	adrp	x8, _SEEK_SET@GOTPAGE
Lloh1:
	ldr	x8, [x8, _SEEK_SET@GOTPAGEOFF]
Lloh2:
	ldr	w2, [x8]
	bl	_avio_seek
	ldr	w0, [x19, #16]
	add	x1, sp, #12
	add	x2, sp, #8
	bl	_mpc8_get_chunk_header
	ldr	w8, [sp, #12]
Lloh3:
	adrp	x9, _TAG_SEEKTABLE@GOTPAGE
Lloh4:
	ldr	x9, [x9, _TAG_SEEKTABLE@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ne	LBB0_10
; %bb.2:
	ldr	w8, [sp, #8]
	cmp	w8, #1
	b.lt	LBB0_11
; %bb.3:
Lloh6:
	adrp	x9, _INT_MAX@GOTPAGE
Lloh7:
	ldr	x9, [x9, _INT_MAX@GOTPAGEOFF]
Lloh8:
	ldrsw	x9, [x9]
	mov	w10, #26215
	movk	w10, #26214, lsl #16
	mul	x9, x9, x10
	lsr	x10, x9, #63
	asr	x9, x9, #34
	add	w9, w9, w10
	cmp	w8, w9
	b.gt	LBB0_11
; %bb.4:
Lloh9:
	adrp	x21, _AV_INPUT_BUFFER_PADDING_SIZE@GOTPAGE
Lloh10:
	ldr	x21, [x21, _AV_INPUT_BUFFER_PADDING_SIZE@GOTPAGEOFF]
	ldr	x9, [x21]
	add	x0, x9, x8
	bl	_av_malloc
	cbz	x0, LBB0_13
; %bb.5:
	mov	x20, x0
	ldr	w0, [x19, #16]
	ldr	w2, [sp, #8]
	mov	x1, x20
	bl	_avio_read
	ldr	w8, [sp, #8]
	cmp	w0, w8
	b.ne	LBB0_14
; %bb.6:
	add	x0, x20, w0, sxtw #2
	ldr	x2, [x21]
	mov	w1, #0
	bl	_memset
	ldr	w8, [sp, #8]
	lsl	w2, w8, #3
	add	x0, sp, #4
	mov	x1, x20
	bl	_init_get_bits
	add	x0, sp, #4
	bl	_gb_get_v
Lloh11:
	adrp	x8, _UINT_MAX@GOTPAGE
Lloh12:
	ldr	x8, [x8, _UINT_MAX@GOTPAGEOFF]
	str	w0, [sp, #8]
Lloh13:
	ldr	w8, [x8]
	add	w9, w8, #3
	cmp	w8, #0
	csel	w8, w9, w8, lt
	cmp	w0, w8, asr #2
	b.gt	LBB0_8
; %bb.7:
	ldrsw	x8, [x23]
	mov	w9, #36409
	movk	w9, #14563, lsl #16
	mul	x8, x8, x9
	lsr	x9, x8, #63
	asr	x8, x8, #40
	add	w8, w8, w9
	cmp	w0, w8
	b.le	LBB0_17
LBB0_8:
Lloh14:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh15:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh16:
	ldr	w1, [x8]
Lloh17:
	adrp	x2, l_.str.4@PAGE
Lloh18:
	add	x2, x2, l_.str.4@PAGEOFF
	b	LBB0_15
LBB0_9:
Lloh19:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh20:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh21:
	ldr	w1, [x8]
Lloh22:
	adrp	x2, l_.str@PAGE
Lloh23:
	add	x2, x2, l_.str@PAGEOFF
	mov	x0, x19
	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
	add	sp, sp, #96
	b	_av_log
LBB0_10:
Lloh24:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh25:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh26:
	ldr	w1, [x8]
Lloh27:
	adrp	x2, l_.str.1@PAGE
Lloh28:
	add	x2, x2, l_.str.1@PAGEOFF
	b	LBB0_12
LBB0_11:
Lloh29:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh30:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh31:
	ldr	w1, [x8]
Lloh32:
	adrp	x2, l_.str.2@PAGE
Lloh33:
	add	x2, x2, l_.str.2@PAGEOFF
LBB0_12:
	mov	x0, x19
	bl	_av_log
LBB0_13:
	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
	add	sp, sp, #96
	ret
LBB0_14:
Lloh34:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh35:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh36:
	ldr	w1, [x8]
Lloh37:
	adrp	x2, l_.str.3@PAGE
Lloh38:
	add	x2, x2, l_.str.3@PAGEOFF
LBB0_15:
	mov	x0, x19
	bl	_av_log
LBB0_16:
	mov	x0, x20
	bl	_av_free
	b	LBB0_13
LBB0_17:
	add	x0, sp, #4
	mov	w1, #4
	bl	_get_bits
	mov	x21, x0
	add	x0, sp, #4
	bl	_gb_get_v
	ldr	w8, [x23, #4]
	add	w22, w8, w0
	ldr	x8, [x19, #8]
	ldr	w0, [x8]
Lloh39:
	adrp	x25, _AVINDEX_KEYFRAME@GOTPAGE
Lloh40:
	ldr	x25, [x25, _AVINDEX_KEYFRAME@GOTPAGEOFF]
	ldr	w5, [x25]
	mov	x1, x22
	mov	w2, #0
	mov	w3, #0
	mov	w4, #0
	bl	_av_add_index_entry
	add	x0, sp, #4
	bl	_gb_get_v
	ldr	w8, [x23, #4]
	add	w23, w8, w0
	ldr	x8, [x19, #8]
	ldr	w0, [x8]
	ldr	w5, [x25]
	mov	x1, x23
	mov	w2, #1
	mov	w3, #0
	mov	w4, #0
	bl	_av_add_index_entry
	ldr	w8, [sp, #8]
	cmp	w8, #3
	b.lt	LBB0_16
; %bb.18:
	mov	w26, #2
LBB0_19:                                ; =>This Inner Loop Header: Depth=1
	add	x0, sp, #4
	mov	w1, #1
	mov	w2, #33
	bl	_get_unary
	mov	x24, x0
	add	x0, sp, #4
	mov	w1, #12
	bl	_get_bits
	add	w8, w0, w24, lsl #12
	and	w9, w8, #0xfffffffe
	tst	w8, #0x1
	csneg	w8, w8, w9, eq
	lsl	w9, w23, #1
	sub	w9, w9, w22
	add	w24, w9, w8, asr #1
	ldr	x8, [x19, #8]
	ldr	w0, [x8]
	lsl	w2, w26, w21
	ldr	w5, [x25]
	mov	x1, x24
	mov	w3, #0
	mov	w4, #0
	bl	_av_add_index_entry
	add	w26, w26, #1
	ldr	w8, [sp, #8]
	mov	x22, x23
	mov	x23, x24
	cmp	w26, w8
	b.lt	LBB0_19
	b	LBB0_16
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpAdd	Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpAdd	Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpAdd	Lloh37, Lloh38
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.loh AdrpLdrGot	Lloh39, Lloh40
	.cfi_endproc
                                        ; -- End function
	.comm	_AV_LOG_ERROR,4,2               ; @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"No stream added before parsing seek table\n"

	.comm	_SEEK_SET,4,2                   ; @SEEK_SET
	.comm	_TAG_SEEKTABLE,4,2              ; @TAG_SEEKTABLE
l_.str.1:                               ; @.str.1
	.asciz	"No seek table at given position\n"

	.comm	_INT_MAX,4,2                    ; @INT_MAX
l_.str.2:                               ; @.str.2
	.asciz	"Bad seek table size\n"

	.comm	_AV_INPUT_BUFFER_PADDING_SIZE,8,3 ; @AV_INPUT_BUFFER_PADDING_SIZE
l_.str.3:                               ; @.str.3
	.asciz	"seek table truncated\n"

	.comm	_UINT_MAX,4,2                   ; @UINT_MAX
l_.str.4:                               ; @.str.4
	.asciz	"Seek table is too big\n"

	.comm	_AVINDEX_KEYFRAME,4,2           ; @AVINDEX_KEYFRAME
	.no_dead_strip	_mpc8_parse_seektable
.subsections_via_symbols
