	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mpc_read_packet
_mpc_read_packet:                       ## @mpc_read_packet
	.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	%rsi, %r14
	movq	%rdi, %r12
	movq	16(%rdi), %r13
	movl	(%r13), %ecx
	movl	4(%r13), %eax
	cmpl	%eax, %ecx
	jl	LBB0_3
## %bb.1:
	testl	%eax, %eax
	je	LBB0_3
## %bb.2:
	movq	_AVERROR_EOF@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	jmp	LBB0_20
LBB0_3:
	movslq	%ecx, %rdx
	movl	8(%r13), %eax
	incl	%eax
	cmpl	%eax, %ecx
	movl	%ecx, -48(%rbp)                 ## 4-byte Spill
	movq	%rdx, -64(%rbp)                 ## 8-byte Spill
	jne	LBB0_5
## %bb.4:
	movl	12(%r13), %r15d
	movl	%ecx, %eax
	jmp	LBB0_6
LBB0_5:
	movl	(%r12), %edi
	movq	24(%r13), %rax
	leaq	(%rdx,%rdx,2), %rcx
	movl	(%rax,%rcx,4), %esi
	movq	_SEEK_SET@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_avio_seek
	movq	24(%r13), %rcx
	movslq	(%r13), %rax
	leaq	(%rax,%rax,2), %rdx
	movl	4(%rcx,%rdx,4), %r15d
	movl	%r15d, 12(%r13)
LBB0_6:
	movl	%eax, 8(%r13)
	incl	%eax
	movl	%eax, (%r13)
	movl	(%r12), %edi
	callq	_avio_tell
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movl	(%r12), %edi
	callq	_avio_rl32
	movl	%eax, %ebx
	cmpl	$12, %r15d
	movq	%r14, -72(%rbp)                 ## 8-byte Spill
	jg	LBB0_8
## %bb.7:
	movb	$12, %cl
	subb	%r15b, %cl
	shrl	%cl, %ebx
	jmp	LBB0_9
LBB0_8:
	leal	-12(%r15), %ecx
                                        ## kill: def $cl killed $cl killed $ecx
	shll	%cl, %ebx
	movl	(%r12), %edi
	callq	_avio_rl32
	movb	$44, %cl
	subb	%r15b, %cl
	sarl	%cl, %eax
	orl	%ebx, %eax
	movl	%eax, %ebx
LBB0_9:
	andl	$1048575, %ebx                  ## imm = 0xFFFFF
	movq	%r12, -56(%rbp)                 ## 8-byte Spill
	movl	(%r12), %edi
	movq	_SEEK_SET@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	callq	_avio_seek
	leal	(%rbx,%r15), %r12d
	addl	$20, %r12d
	leal	(%rbx,%r15), %r14d
	addl	$51, %r14d
	sarl	$3, %r14d
	andl	$-4, %r14d
	movl	-48(%rbp), %edx                 ## 4-byte Reload
	cmpl	16(%r13), %edx
	jne	LBB0_12
## %bb.10:
	cmpl	$0, 4(%r13)
	je	LBB0_12
## %bb.11:
	movq	24(%r13), %rax
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	leaq	(%rcx,%rcx,2), %rcx
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	movl	%esi, (%rax,%rcx,4)
	movl	%r14d, 8(%rax,%rcx,4)
	movl	%r15d, 4(%rax,%rcx,4)
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	8(%rax), %rax
	movl	(%rax), %edi
	movq	_AVINDEX_KEYFRAME@GOTPCREL(%rip), %rax
	movl	(%rax), %r9d
	movl	%edx, %esi
	movl	%r14d, %ecx
	xorl	%r8d, %r8d
	callq	_av_add_index_entry
	incl	16(%r13)
LBB0_12:
	andl	$31, %r12d
	movl	%r12d, 12(%r13)
	leal	4(%r14), %esi
	movq	-72(%rbp), %r12                 ## 8-byte Reload
	movq	%r12, %rdi
	callq	_av_new_packet
	testl	%eax, %eax
	js	LBB0_13
## %bb.14:
	addl	$20, %r15d
	movq	(%r12), %rsi
	movl	%r15d, (%rsi)
	movl	4(%r13), %eax
	cmpl	%eax, (%r13)
	setg	%cl
	testl	%eax, %eax
	setne	%al
	andb	%cl, %al
	movzbl	%al, %eax
	movl	%eax, 4(%rsi)
	movq	$0, 8(%rsi)
	movq	$0, 16(%r12)
	movl	-48(%rbp), %eax                 ## 4-byte Reload
	movl	%eax, 8(%r12)
	movq	-56(%rbp), %r15                 ## 8-byte Reload
	movl	(%r15), %edi
	addq	$16, %rsi
	movl	%r14d, %edx
	callq	_avio_read
	movl	%eax, %ebx
	cmpl	$0, 12(%r13)
	je	LBB0_16
## %bb.15:
	movl	(%r15), %edi
	movq	_SEEK_CUR@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	$-4, %esi
	callq	_avio_seek
LBB0_16:
	cmpl	%r14d, %ebx
	jge	LBB0_19
## %bb.17:
	movq	%r12, %rdi
	callq	_av_packet_unref
	testl	%ebx, %ebx
	js	LBB0_20
## %bb.18:
	movq	_EIO@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_AVERROR                        ## TAILCALL
LBB0_13:
	movl	%eax, %ebx
	jmp	LBB0_20
LBB0_19:
	addl	$4, %ebx
	movl	%ebx, 12(%r12)
	xorl	%ebx, %ebx
LBB0_20:
	movl	%ebx, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_AVERROR_EOF,4,2                ## @AVERROR_EOF
	.comm	_SEEK_SET,4,2                   ## @SEEK_SET
	.comm	_AVINDEX_KEYFRAME,4,2           ## @AVINDEX_KEYFRAME
	.comm	_SEEK_CUR,4,2                   ## @SEEK_CUR
	.comm	_EIO,4,2                        ## @EIO
	.no_dead_strip	_mpc_read_packet
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mpc_read_packet
_mpc_read_packet:                       ; @mpc_read_packet
	.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
	ldr	x24, [x0, #16]
	ldp	w21, w8, [x24]
	cmp	w21, w8
	ccmp	w8, #0, #4, ge
	b.ne	LBB0_3
; %bb.1:
	mov	x19, x1
	mov	x20, x0
	sxtw	x25, w21
	ldr	w8, [x24, #8]
	add	w8, w8, #1
Lloh0:
	adrp	x22, _SEEK_SET@GOTPAGE
Lloh1:
	ldr	x22, [x22, _SEEK_SET@GOTPAGEOFF]
	cmp	w21, w8
	b.ne	LBB0_4
; %bb.2:
	ldr	w26, [x24, #12]
	mov	x8, x21
	b	LBB0_5
LBB0_3:
Lloh2:
	adrp	x8, _AVERROR_EOF@GOTPAGE
Lloh3:
	ldr	x8, [x8, _AVERROR_EOF@GOTPAGEOFF]
Lloh4:
	ldr	w23, [x8]
	b	LBB0_19
LBB0_4:
	ldr	w0, [x20]
	ldr	x8, [x24, #24]
	mov	w23, #12
	mul	x9, x25, x23
	ldr	w1, [x8, x9]
	ldr	w2, [x22]
	bl	_avio_seek
	ldr	x9, [x24, #24]
	ldrsw	x8, [x24]
	madd	x9, x8, x23, x9
	ldr	w26, [x9, #4]
	str	w26, [x24, #12]
LBB0_5:
	str	w8, [x24, #8]
	add	w8, w8, #1
	str	w8, [x24]
	ldr	w0, [x20]
	bl	_avio_tell
	mov	x23, x0
	ldr	w0, [x20]
	bl	_avio_rl32
	subs	w8, w26, #12
	b.gt	LBB0_7
; %bb.6:
	mov	w8, #12
	sub	w8, w8, w26
	lsr	w8, w0, w8
	b	LBB0_8
LBB0_7:
	lsl	w27, w0, w8
	ldr	w0, [x20]
	bl	_avio_rl32
	mov	w8, #44
	sub	w8, w8, w26
	asr	w8, w0, w8
	orr	w8, w8, w27
LBB0_8:
	and	w28, w8, #0xfffff
	add	w27, w26, #20
	ldr	w0, [x20]
	ldr	w2, [x22]
	mov	x1, x23
	bl	_avio_seek
	add	w28, w28, w27
	add	w8, w28, #31
	asr	w8, w8, #3
	and	w22, w8, #0xfffffffc
	ldr	w8, [x24, #16]
	cmp	w21, w8
	b.ne	LBB0_11
; %bb.9:
	ldr	w8, [x24, #4]
	cbz	w8, LBB0_11
; %bb.10:
	ldr	x8, [x24, #24]
	mov	w9, #12
	madd	x8, x25, x9, x8
	stp	w26, w22, [x8, #4]
	str	w23, [x8]
	ldr	x8, [x20, #8]
	ldr	w0, [x8]
Lloh5:
	adrp	x8, _AVINDEX_KEYFRAME@GOTPAGE
Lloh6:
	ldr	x8, [x8, _AVINDEX_KEYFRAME@GOTPAGEOFF]
Lloh7:
	ldr	w5, [x8]
	mov	x1, x21
	mov	x2, x21
	mov	x3, x22
	mov	w4, #0
	bl	_av_add_index_entry
	ldr	w8, [x24, #16]
	add	w8, w8, #1
	str	w8, [x24, #16]
LBB0_11:
	and	w8, w28, #0x1f
	str	w8, [x24, #12]
	add	w1, w22, #4
	mov	x0, x19
	bl	_av_new_packet
	tbnz	w0, #31, LBB0_17
; %bb.12:
	ldr	x8, [x19]
	str	w27, [x8]
	ldp	w9, w10, [x24]
	cmp	w9, w10
	ccmp	w10, #0, #4, gt
	cset	w9, ne
	str	xzr, [x8, #8]
	str	w9, [x8, #4]
	str	xzr, [x19, #16]
	str	w21, [x19, #8]
	ldr	w0, [x20]
	add	x1, x8, #16
	mov	x2, x22
	bl	_avio_read
	mov	x23, x0
	ldr	w8, [x24, #12]
	cbz	w8, LBB0_14
; %bb.13:
	ldr	w0, [x20]
Lloh8:
	adrp	x8, _SEEK_CUR@GOTPAGE
Lloh9:
	ldr	x8, [x8, _SEEK_CUR@GOTPAGEOFF]
Lloh10:
	ldr	w2, [x8]
	mov	w1, #-4
	bl	_avio_seek
LBB0_14:
	cmp	w23, w22
	b.ge	LBB0_18
; %bb.15:
	mov	x0, x19
	bl	_av_packet_unref
	tbnz	w23, #31, LBB0_19
; %bb.16:
Lloh11:
	adrp	x8, _EIO@GOTPAGE
Lloh12:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh13:
	ldr	w0, [x8]
	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
	b	_AVERROR
LBB0_17:
	mov	x23, x0
	b	LBB0_19
LBB0_18:
	add	w8, w23, #4
	mov	w23, #0
	str	w8, [x19, #12]
LBB0_19:
	mov	x0, x23
	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 AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_AVERROR_EOF,4,2                ; @AVERROR_EOF
	.comm	_SEEK_SET,4,2                   ; @SEEK_SET
	.comm	_AVINDEX_KEYFRAME,4,2           ; @AVINDEX_KEYFRAME
	.comm	_SEEK_CUR,4,2                   ; @SEEK_CUR
	.comm	_EIO,4,2                        ; @EIO
	.no_dead_strip	_mpc_read_packet
.subsections_via_symbols
