	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function read_packet
_read_packet:                           ## @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
	pushq	%rax
	.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), %r15
	movq	8(%rdi), %rbx
	movl	(%rbx), %edx
	testl	%edx, %edx
	je	LBB0_1
## %bb.4:
	movq	%r15, %rdi
	movq	%r14, %rsi
	callq	_av_get_packet
	testl	%eax, %eax
	js	LBB0_7
## %bb.5:
	movq	_MVI_VIDEO_STREAM_INDEX@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%r14)
	movl	$0, (%rbx)
	jmp	LBB0_6
LBB0_1:
	movq	%r15, %rdi
	callq	*8(%rbx)
	movl	%eax, (%rbx)
	movl	16(%rbx), %eax
	testl	%eax, %eax
	je	LBB0_8
## %bb.2:
	movl	20(%rbx), %ecx
	movl	24(%rbx), %edx
	leal	(%rcx,%rdx), %r12d
	addl	$512, %r12d                     ## imm = 0x200
	movq	_MVI_FRAC_BITS@GOTPCREL(%rip), %r13
	movb	(%r13), %cl
	sarl	%cl, %r12d
	cmpl	%eax, %r12d
	cmovgel	%eax, %r12d
	movq	%r15, %rdi
	movq	%r14, %rsi
	movl	%r12d, %edx
	callq	_av_get_packet
	testl	%eax, %eax
	js	LBB0_7
## %bb.3:
	movq	_MVI_AUDIO_STREAM_INDEX@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%r14)
	subl	%r12d, 16(%rbx)
	movl	24(%rbx), %eax
	movb	(%r13), %cl
	shll	%cl, %r12d
	subl	%r12d, %eax
	addl	%eax, 20(%rbx)
LBB0_6:
	xorl	%eax, %eax
LBB0_7:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	movq	_EIO@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_AVERROR                        ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_EIO,4,2                        ## @EIO
	.comm	_MVI_FRAC_BITS,4,2              ## @MVI_FRAC_BITS
	.comm	_MVI_AUDIO_STREAM_INDEX,4,2     ## @MVI_AUDIO_STREAM_INDEX
	.comm	_MVI_VIDEO_STREAM_INDEX,4,2     ## @MVI_VIDEO_STREAM_INDEX
	.no_dead_strip	_read_packet
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function read_packet
_read_packet:                           ; @read_packet
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x19, x1
	ldp	x20, x22, [x0]
	ldr	w2, [x22]
	cbz	w2, LBB0_3
; %bb.1:
	mov	x0, x20
	mov	x1, x19
	bl	_av_get_packet
	tbnz	w0, #31, LBB0_6
; %bb.2:
	mov	w0, #0
Lloh0:
	adrp	x8, _MVI_VIDEO_STREAM_INDEX@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MVI_VIDEO_STREAM_INDEX@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	str	w8, [x19]
	str	wzr, [x22]
	b	LBB0_6
LBB0_3:
	ldr	x8, [x22, #8]
	mov	x0, x20
	blr	x8
	str	w0, [x22]
	ldr	w8, [x22, #16]
	cbz	w8, LBB0_7
; %bb.4:
	ldp	w9, w10, [x22, #20]
	add	w9, w9, w10
	add	w9, w9, #512
Lloh3:
	adrp	x23, _MVI_FRAC_BITS@GOTPAGE
Lloh4:
	ldr	x23, [x23, _MVI_FRAC_BITS@GOTPAGEOFF]
	ldr	w10, [x23]
	asr	w9, w9, w10
	cmp	w9, w8
	csel	w21, w9, w8, lt
	mov	x0, x20
	mov	x1, x19
	mov	x2, x21
	bl	_av_get_packet
	tbnz	w0, #31, LBB0_6
; %bb.5:
	mov	w0, #0
Lloh5:
	adrp	x8, _MVI_AUDIO_STREAM_INDEX@GOTPAGE
Lloh6:
	ldr	x8, [x8, _MVI_AUDIO_STREAM_INDEX@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	str	w8, [x19]
	ldp	w8, w9, [x22, #16]
	sub	w8, w8, w21
	ldr	w10, [x22, #24]
	ldr	w11, [x23]
	lsl	w11, w21, w11
	sub	w10, w10, w11
	add	w9, w10, w9
	stp	w8, w9, [x22, #16]
LBB0_6:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_7:
Lloh8:
	adrp	x8, _EIO@GOTPAGE
Lloh9:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh10:
	ldr	w0, [x8]
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	b	_AVERROR
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_EIO,4,2                        ; @EIO
	.comm	_MVI_FRAC_BITS,4,2              ; @MVI_FRAC_BITS
	.comm	_MVI_AUDIO_STREAM_INDEX,4,2     ; @MVI_AUDIO_STREAM_INDEX
	.comm	_MVI_VIDEO_STREAM_INDEX,4,2     ; @MVI_VIDEO_STREAM_INDEX
	.no_dead_strip	_read_packet
.subsections_via_symbols
