	.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
	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, %r13
	movq	%rdi, %r15
	xorl	%r12d, %r12d
	movb	$1, %al
	movq	%rsi, -56(%rbp)                 ## 8-byte Spill
LBB0_1:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_3 Depth 2
	testl	%r12d, %r12d
	jne	LBB0_12
## %bb.2:                               ##   in Loop: Header=BB0_1 Depth=1
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	.p2align	4, 0x90
LBB0_3:                                 ##   Parent Loop BB0_1 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movl	(%r15), %edi
	callq	_avio_rb16
	movl	%eax, %r13d
	movl	(%r15), %edi
	callq	_avio_rb16
	movl	%eax, %ebx
	movl	(%r15), %edi
	callq	_avio_rb16
	movl	%eax, %r12d
	movl	(%r15), %edi
	callq	_avio_rb16
	movl	(%r15), %edi
	callq	_avio_rb32
	movl	%eax, %r14d
	movl	(%r15), %edi
	callq	_avio_rb32
	cmpl	$13, %ebx
	jl	LBB0_4
## %bb.5:                               ##   in Loop: Header=BB0_3 Depth=2
	addl	$-12, %ebx
	cmpl	$258, %r13d                     ## imm = 0x102
	jne	LBB0_7
## %bb.6:                               ##   in Loop: Header=BB0_3 Depth=2
	movl	(%r15), %edi
	movl	%ebx, %esi
	callq	_avio_skip
	jmp	LBB0_3
	.p2align	4, 0x90
LBB0_7:                                 ##   in Loop: Header=BB0_1 Depth=1
	movl	(%r15), %edi
	testb	$1, -44(%rbp)                   ## 1-byte Folded Reload
	je	LBB0_13
## %bb.8:                               ##   in Loop: Header=BB0_1 Depth=1
	movq	-56(%rbp), %r13                 ## 8-byte Reload
	movq	%r13, %rsi
	movl	%ebx, %edx
	callq	_av_get_packet
	movl	%eax, %ecx
	testl	%eax, %eax
	js	LBB0_15
## %bb.9:                               ##   in Loop: Header=BB0_1 Depth=1
	movl	%r14d, (%r13)
	addl	$-16, 4(%r13)
	jmp	LBB0_10
	.p2align	4, 0x90
LBB0_13:                                ##   in Loop: Header=BB0_1 Depth=1
	movq	-56(%rbp), %r13                 ## 8-byte Reload
	movq	%r13, %rsi
	movl	%ebx, %edx
	callq	_av_append_packet
	movl	%eax, %ecx
	testl	%eax, %eax
	js	LBB0_14
LBB0_10:                                ##   in Loop: Header=BB0_1 Depth=1
	andl	$128, %r12d
	xorl	%eax, %eax
	cmpl	%ebx, %ecx
	jae	LBB0_1
## %bb.11:
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.1(%rip), %rdx
	movq	%r15, %rdi
	movl	%ebx, %r8d
	xorl	%eax, %eax
	callq	_av_log
	movq	_AV_PKT_FLAG_CORRUPT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, 16(%r13)
LBB0_12:
	movq	$0, 8(%r13)
	xorl	%ecx, %ecx
	jmp	LBB0_15
LBB0_4:
	movl	$-1, %ecx
LBB0_15:
	movl	%ecx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_14:
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rdx
	movq	%r15, %rdi
	xorl	%eax, %eax
	movl	%ecx, %ebx
	callq	_av_log
	movq	%r13, %rdi
	callq	_av_packet_unref
	movl	%ebx, %ecx
	jmp	LBB0_15
	.cfi_endproc
                                        ## -- End function
	.comm	_AV_LOG_ERROR,4,2               ## @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"failed to grow packet\n"

L_.str.1:                               ## @.str.1
	.asciz	"Truncated packet! Read %d of %d bytes\n"

	.comm	_AV_PKT_FLAG_CORRUPT,4,2        ## @AV_PKT_FLAG_CORRUPT
	.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:
	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, x1
	mov	x20, x0
	mov	w8, #0
	mov	w25, #1
LBB0_1:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_2 Depth 2
	cbnz	w8, LBB0_11
LBB0_2:                                 ;   Parent Loop BB0_1 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	w0, [x20]
	bl	_avio_rb16
	mov	x21, x0
	ldr	w0, [x20]
	bl	_avio_rb16
	mov	x23, x0
	ldr	w0, [x20]
	bl	_avio_rb16
	mov	x22, x0
	ldr	w0, [x20]
	bl	_avio_rb16
	ldr	w0, [x20]
	bl	_avio_rb32
	mov	x24, x0
	ldr	w0, [x20]
	bl	_avio_rb32
	cmp	w23, #13
	b.lt	LBB0_12
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=2
	sub	w23, w23, #12
	cmp	w21, #258
	b.ne	LBB0_5
; %bb.4:                                ;   in Loop: Header=BB0_2 Depth=2
	ldr	w0, [x20]
	mov	x1, x23
	bl	_avio_skip
	b	LBB0_2
LBB0_5:                                 ;   in Loop: Header=BB0_1 Depth=1
	ldr	w0, [x20]
	mov	x1, x19
	mov	x2, x23
	tbz	w25, #0, LBB0_8
; %bb.6:                                ;   in Loop: Header=BB0_1 Depth=1
	bl	_av_get_packet
	mov	x21, x0
	tbnz	w0, #31, LBB0_13
; %bb.7:                                ;   in Loop: Header=BB0_1 Depth=1
	ldr	w8, [x19, #4]
	sub	w8, w8, #16
	stp	w24, w8, [x19]
	b	LBB0_9
LBB0_8:                                 ;   in Loop: Header=BB0_1 Depth=1
	bl	_av_append_packet
	mov	x21, x0
	tbnz	w0, #31, LBB0_14
LBB0_9:                                 ;   in Loop: Header=BB0_1 Depth=1
	mov	w25, #0
	and	w8, w22, #0x80
	cmp	w21, w23
	b.hs	LBB0_1
; %bb.10:
Lloh0:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh1:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	stp	x21, x23, [sp]
Lloh3:
	adrp	x2, l_.str.1@PAGE
Lloh4:
	add	x2, x2, l_.str.1@PAGEOFF
	mov	x0, x20
	bl	_av_log
Lloh5:
	adrp	x8, _AV_PKT_FLAG_CORRUPT@GOTPAGE
Lloh6:
	ldr	x8, [x8, _AV_PKT_FLAG_CORRUPT@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	ldr	w9, [x19, #16]
	orr	w8, w9, w8
	str	w8, [x19, #16]
LBB0_11:
	mov	w21, #0
	str	xzr, [x19, #8]
	b	LBB0_13
LBB0_12:
	mov	w21, #-1
LBB0_13:
	mov	x0, x21
	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:
Lloh8:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh9:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
Lloh11:
	adrp	x2, l_.str@PAGE
Lloh12:
	add	x2, x2, l_.str@PAGEOFF
	mov	x0, x20
	bl	_av_log
	mov	x0, x19
	bl	_av_packet_unref
	b	LBB0_13
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_AV_LOG_ERROR,4,2               ; @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"failed to grow packet\n"

l_.str.1:                               ; @.str.1
	.asciz	"Truncated packet! Read %d of %d bytes\n"

	.comm	_AV_PKT_FLAG_CORRUPT,4,2        ; @AV_PKT_FLAG_CORRUPT
	.no_dead_strip	_read_packet
.subsections_via_symbols
