	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function avisynth_read_packet
_avisynth_read_packet:                  ## @avisynth_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	%r12
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	(%rdi), %r12
	movl	$0, -36(%rbp)
	cmpq	$0, 8(%r12)
	je	LBB0_2
## %bb.1:
	movq	_AVERROR_UNKNOWN@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
LBB0_10:
	movl	%ebx, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_2:
	movq	%rsi, %r14
	movq	%rdi, %r15
	leaq	-48(%rbp), %rsi
	leaq	-36(%rbp), %rcx
	movq	%r14, %rdx
	callq	_avisynth_next_stream
	movq	-48(%rbp), %rax
	movq	(%rax), %rax
	movq	(%rax), %rax
	movq	_AVMEDIA_TYPE_VIDEO@GOTPCREL(%rip), %rcx
	movl	-36(%rbp), %edx
	cmpq	(%rcx), %rax
	jne	LBB0_6
## %bb.3:
	movq	%r15, %rdi
	movq	%r14, %rsi
	callq	_avisynth_read_packet_video
	movl	%eax, %ebx
	movq	_AVERROR_EOF@GOTPCREL(%rip), %rax
	cmpl	(%rax), %ebx
	jne	LBB0_10
## %bb.4:
	movl	(%r12), %edi
	callq	_avs_has_audio
	testq	%rax, %rax
	je	LBB0_10
## %bb.5:
	leaq	-48(%rbp), %rsi
	leaq	-36(%rbp), %rcx
	movq	%r15, %rdi
	movq	%r14, %rdx
	callq	_avisynth_next_stream
	movl	-36(%rbp), %edx
	movq	%r15, %rdi
	movq	%r14, %rsi
	callq	_avisynth_read_packet_audio
	jmp	LBB0_9
LBB0_6:
	movq	%r15, %rdi
	movq	%r14, %rsi
	callq	_avisynth_read_packet_audio
	movl	%eax, %ebx
	movq	_AVERROR_EOF@GOTPCREL(%rip), %rax
	cmpl	(%rax), %ebx
	jne	LBB0_10
## %bb.7:
	movl	(%r12), %edi
	callq	_avs_has_video
	testq	%rax, %rax
	je	LBB0_10
## %bb.8:
	leaq	-48(%rbp), %rsi
	leaq	-36(%rbp), %rcx
	movq	%r15, %rdi
	movq	%r14, %rdx
	callq	_avisynth_next_stream
	movl	-36(%rbp), %edx
	movq	%r15, %rdi
	movq	%r14, %rsi
	callq	_avisynth_read_packet_video
LBB0_9:
	movl	%eax, %ebx
	jmp	LBB0_10
	.cfi_endproc
                                        ## -- End function
	.comm	_AVERROR_UNKNOWN,4,2            ## @AVERROR_UNKNOWN
	.comm	_AVMEDIA_TYPE_VIDEO,8,3         ## @AVMEDIA_TYPE_VIDEO
	.comm	_AVERROR_EOF,4,2                ## @AVERROR_EOF
	.no_dead_strip	_avisynth_read_packet
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function avisynth_read_packet
_avisynth_read_packet:                  ; @avisynth_read_packet
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
	ldr	x22, [x0]
	str	wzr, [sp, #4]
	ldr	x8, [x22, #8]
	cbz	x8, LBB0_3
; %bb.1:
Lloh0:
	adrp	x8, _AVERROR_UNKNOWN@GOTPAGE
Lloh1:
	ldr	x8, [x8, _AVERROR_UNKNOWN@GOTPAGEOFF]
Lloh2:
	ldr	w21, [x8]
LBB0_2:
	mov	x0, x21
	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
	add	sp, sp, #64
	ret
LBB0_3:
	mov	x19, x1
	mov	x20, x0
	add	x1, sp, #8
	add	x3, sp, #4
	mov	x2, x19
	bl	_avisynth_next_stream
	ldr	x8, [sp, #8]
	ldr	x8, [x8]
	ldr	x8, [x8]
Lloh3:
	adrp	x9, _AVMEDIA_TYPE_VIDEO@GOTPAGE
Lloh4:
	ldr	x9, [x9, _AVMEDIA_TYPE_VIDEO@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	ldr	w2, [sp, #4]
	mov	x0, x20
	mov	x1, x19
	cmp	x8, x9
	b.ne	LBB0_7
; %bb.4:
	bl	_avisynth_read_packet_video
	mov	x21, x0
Lloh6:
	adrp	x8, _AVERROR_EOF@GOTPAGE
Lloh7:
	ldr	x8, [x8, _AVERROR_EOF@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	cmp	w0, w8
	b.ne	LBB0_2
; %bb.5:
	ldr	w0, [x22]
	bl	_avs_has_audio
	cbz	x0, LBB0_2
; %bb.6:
	add	x1, sp, #8
	add	x3, sp, #4
	mov	x0, x20
	mov	x2, x19
	bl	_avisynth_next_stream
	ldr	w2, [sp, #4]
	mov	x0, x20
	mov	x1, x19
	bl	_avisynth_read_packet_audio
	b	LBB0_10
LBB0_7:
	bl	_avisynth_read_packet_audio
	mov	x21, x0
Lloh9:
	adrp	x8, _AVERROR_EOF@GOTPAGE
Lloh10:
	ldr	x8, [x8, _AVERROR_EOF@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	cmp	w0, w8
	b.ne	LBB0_2
; %bb.8:
	ldr	w0, [x22]
	bl	_avs_has_video
	cbz	x0, LBB0_2
; %bb.9:
	add	x1, sp, #8
	add	x3, sp, #4
	mov	x0, x20
	mov	x2, x19
	bl	_avisynth_next_stream
	ldr	w2, [sp, #4]
	mov	x0, x20
	mov	x1, x19
	bl	_avisynth_read_packet_video
LBB0_10:
	mov	x21, x0
	b	LBB0_2
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_AVERROR_UNKNOWN,4,2            ; @AVERROR_UNKNOWN
	.comm	_AVMEDIA_TYPE_VIDEO,8,3         ; @AVMEDIA_TYPE_VIDEO
	.comm	_AVERROR_EOF,4,2                ; @AVERROR_EOF
	.no_dead_strip	_avisynth_read_packet
.subsections_via_symbols
