	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function vivo_read_packet
_vivo_read_packet:                      ## @vivo_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	$24, %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, %r15
	movq	(%rdi), %r12
	movq	8(%rdi), %r13
	movl	(%r13), %eax
	movl	%eax, -52(%rbp)                 ## 4-byte Spill
	movl	4(%r13), %eax
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	.p2align	4, 0x90
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r12, %rdi
	callq	_avio_feof
	testq	%rax, %rax
	jne	LBB0_21
## %bb.2:                               ##   in Loop: Header=BB0_1 Depth=1
	movl	4(%r13), %ecx
	testl	%ecx, %ecx
	jne	LBB0_5
## %bb.3:                               ##   in Loop: Header=BB0_1 Depth=1
	movl	8(%r13), %esi
	movq	%r12, %rdi
	callq	_avio_skip
	movq	%r15, %rdi
	callq	_vivo_get_packet_header
	testl	%eax, %eax
	jns	LBB0_1
## %bb.4:
	movl	%eax, %ebx
	jmp	LBB0_24
LBB0_5:
	leal	-1(%rcx), %eax
	cmpl	$2, %eax
	jb	LBB0_8
## %bb.6:
	leal	-3(%rcx), %eax
	cmpl	$2, %eax
	jae	LBB0_22
## %bb.7:
	movl	$1, -44(%rbp)                   ## 4-byte Folded Spill
	jmp	LBB0_9
LBB0_8:
	movl	$0, -44(%rbp)                   ## 4-byte Folded Spill
LBB0_9:
	movl	8(%r13), %edx
	movq	%r12, %rdi
	movq	%r14, %rsi
	callq	_av_get_packet
	testl	%eax, %eax
	js	LBB0_19
## %bb.10:
	movq	%r15, %rdi
	callq	_vivo_get_packet_header
	movl	%eax, %ebx
	testl	%eax, %eax
	js	LBB0_20
## %bb.11:
	movl	-52(%rbp), %eax                 ## 4-byte Reload
	cmpl	%eax, (%r13)
	jne	LBB0_18
## %bb.12:
	movl	-48(%rbp), %ecx                 ## 4-byte Reload
	decl	%ecx
	movl	4(%r13), %eax
	decl	%eax
	movl	%ecx, -48(%rbp)                 ## 4-byte Spill
	xorl	%ecx, %eax
	cmpl	$1, %eax
	ja	LBB0_18
LBB0_13:                                ## =>This Inner Loop Header: Depth=1
	movq	%r12, %rdi
	callq	_avio_feof
	testq	%rax, %rax
	jne	LBB0_25
## %bb.14:                              ##   in Loop: Header=BB0_13 Depth=1
	movl	8(%r13), %edx
	movq	%r12, %rdi
	movq	%r14, %rsi
	callq	_av_append_packet
	testl	%eax, %eax
	js	LBB0_26
## %bb.15:                              ##   in Loop: Header=BB0_13 Depth=1
	movq	%r15, %rdi
	callq	_vivo_get_packet_header
	movl	%eax, %ebx
	testl	%eax, %eax
	js	LBB0_27
## %bb.16:                              ##   in Loop: Header=BB0_13 Depth=1
	movl	-52(%rbp), %eax                 ## 4-byte Reload
	cmpl	%eax, (%r13)
	jne	LBB0_18
## %bb.17:                              ##   in Loop: Header=BB0_13 Depth=1
	movl	4(%r13), %eax
	decl	%eax
	xorl	-48(%rbp), %eax                 ## 4-byte Folded Reload
	cmpl	$1, %eax
	jbe	LBB0_13
LBB0_18:
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	movl	%eax, (%r14)
	jmp	LBB0_24
LBB0_19:
	movl	%eax, %ebx
LBB0_20:
	movq	%r14, %rdi
	callq	_av_packet_unref
	jmp	LBB0_24
LBB0_21:
	movq	_AVERROR_EOF@GOTPCREL(%rip), %rax
	jmp	LBB0_23
LBB0_22:
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rdx
	movq	%r15, %rdi
                                        ## kill: def $ecx killed $ecx killed $rcx
	callq	_av_log
	movq	_AVERROR_INVALIDDATA@GOTPCREL(%rip), %rax
LBB0_23:
	movl	(%rax), %ebx
LBB0_24:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_25:
	movq	_AVERROR_EOF@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	movl	%eax, (%r14)
	testl	%ebx, %ebx
	jns	LBB0_24
	jmp	LBB0_20
LBB0_26:
	movl	%eax, %ebx
LBB0_27:
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	movl	%eax, (%r14)
	jmp	LBB0_20
	.cfi_endproc
                                        ## -- End function
	.comm	_AVERROR_EOF,4,2                ## @AVERROR_EOF
	.comm	_AV_LOG_ERROR,4,2               ## @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"unknown packet type %d\n"

	.comm	_AVERROR_INVALIDDATA,4,2        ## @AVERROR_INVALIDDATA
	.no_dead_strip	_vivo_read_packet
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function vivo_read_packet
_vivo_read_packet:                      ; @vivo_read_packet
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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, x1
	mov	x20, x0
	ldp	x21, x23, [x0]
	ldp	w24, w26, [x23]
LBB0_1:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x21
	bl	_avio_feof
	cbnz	x0, LBB0_21
; %bb.2:                                ;   in Loop: Header=BB0_1 Depth=1
	ldr	w3, [x23, #4]
	cbnz	w3, LBB0_5
; %bb.3:                                ;   in Loop: Header=BB0_1 Depth=1
	ldr	w1, [x23, #8]
	mov	x0, x21
	bl	_avio_skip
	mov	x0, x20
	bl	_vivo_get_packet_header
	tbz	w0, #31, LBB0_1
; %bb.4:
	mov	x22, x0
	b	LBB0_24
LBB0_5:
	sub	w8, w3, #1
	cmp	w8, #2
	b.lo	LBB0_8
; %bb.6:
	sub	w8, w3, #3
	cmp	w8, #2
	b.hs	LBB0_22
; %bb.7:
	mov	w25, #1
	b	LBB0_9
LBB0_8:
	mov	w25, #0
LBB0_9:
	ldr	w2, [x23, #8]
	mov	x0, x21
	mov	x1, x19
	bl	_av_get_packet
	tbnz	w0, #31, LBB0_19
; %bb.10:
	mov	x0, x20
	bl	_vivo_get_packet_header
	mov	x22, x0
	tbnz	w0, #31, LBB0_20
; %bb.11:
	ldr	w8, [x23]
	cmp	w8, w24
	b.ne	LBB0_18
; %bb.12:
	sub	w26, w26, #1
LBB0_13:                                ; =>This Inner Loop Header: Depth=1
	ldr	w8, [x23, #4]
	sub	w8, w8, #1
	eor	w8, w8, w26
	cmp	w8, #1
	b.hi	LBB0_18
; %bb.14:                               ;   in Loop: Header=BB0_13 Depth=1
	mov	x0, x21
	bl	_avio_feof
	cbnz	x0, LBB0_25
; %bb.15:                               ;   in Loop: Header=BB0_13 Depth=1
	ldr	w2, [x23, #8]
	mov	x0, x21
	mov	x1, x19
	bl	_av_append_packet
	tbnz	w0, #31, LBB0_26
; %bb.16:                               ;   in Loop: Header=BB0_13 Depth=1
	mov	x0, x20
	bl	_vivo_get_packet_header
	mov	x22, x0
	tbnz	w0, #31, LBB0_27
; %bb.17:                               ;   in Loop: Header=BB0_13 Depth=1
	ldr	w8, [x23]
	cmp	w8, w24
	b.eq	LBB0_13
LBB0_18:
	str	w25, [x19]
	b	LBB0_24
LBB0_19:
	mov	x22, x0
LBB0_20:
	mov	x0, x19
	bl	_av_packet_unref
	b	LBB0_24
LBB0_21:
Lloh0:
	adrp	x8, _AVERROR_EOF@GOTPAGE
Lloh1:
	ldr	x8, [x8, _AVERROR_EOF@GOTPAGEOFF]
	b	LBB0_23
LBB0_22:
Lloh2:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh3:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
Lloh5:
	adrp	x2, l_.str@PAGE
Lloh6:
	add	x2, x2, l_.str@PAGEOFF
	mov	x0, x20
	bl	_av_log
Lloh7:
	adrp	x8, _AVERROR_INVALIDDATA@GOTPAGE
Lloh8:
	ldr	x8, [x8, _AVERROR_INVALIDDATA@GOTPAGEOFF]
LBB0_23:
	ldr	w22, [x8]
LBB0_24:
	mov	x0, x22
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
LBB0_25:
Lloh9:
	adrp	x8, _AVERROR_EOF@GOTPAGE
Lloh10:
	ldr	x8, [x8, _AVERROR_EOF@GOTPAGEOFF]
Lloh11:
	ldr	w22, [x8]
	str	w25, [x19]
	tbz	w22, #31, LBB0_24
	b	LBB0_20
LBB0_26:
	mov	x22, x0
LBB0_27:
	str	w25, [x19]
	b	LBB0_20
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_AVERROR_EOF,4,2                ; @AVERROR_EOF
	.comm	_AV_LOG_ERROR,4,2               ; @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"unknown packet type %d\n"

	.comm	_AVERROR_INVALIDDATA,4,2        ; @AVERROR_INVALIDDATA
	.no_dead_strip	_vivo_read_packet
.subsections_via_symbols
