	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function avs_read_video_packet
_avs_read_video_packet:                 ## @avs_read_video_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
	movl	%ecx, %r13d
	movq	%r9, -48(%rbp)                  ## 8-byte Spill
	movl	%edx, -52(%rbp)                 ## 4-byte Spill
                                        ## kill: def $r8d killed $r8d def $r8
	movq	%rsi, %r14
	movq	%rdi, %r15
	movl	16(%rbp), %ebx
	movq	8(%rdi), %rax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	movq	%r8, %r12
	leal	(%rbx,%r8), %esi
	movq	%r14, %rdi
	callq	_av_new_packet
	testl	%eax, %eax
	js	LBB0_6
## %bb.1:
	testl	%ebx, %ebx
	je	LBB0_3
## %bb.2:
	movq	(%r14), %rdi
	movabsq	$12884901888, %rax              ## imm = 0x300000000
	movq	%rax, (%rdi)
	movzbl	%bl, %eax
	movl	%eax, 8(%rdi)
	movzbl	%bh, %eax
	movl	%eax, 12(%rdi)
	addq	$16, %rdi
	leal	-4(%rbx), %edx
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	callq	_memcpy
LBB0_3:
	movq	(%r14), %rax
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	movslq	%ebx, %rcx
	movl	%r13d, (%rax,%rcx,4)
	movl	-52(%rbp), %edx                 ## 4-byte Reload
	movl	%edx, 4(%rax,%rcx,4)
	movq	%r12, %rbx
	movzbl	%bl, %edx
	movl	%edx, 8(%rax,%rcx,4)
	movzbl	%bh, %edx
	movl	%edx, 12(%rax,%rcx,4)
	movl	(%r15), %edi
	leaq	(%rax,%rcx,4), %rsi
	addq	$16, %rsi
	leal	-4(%r12), %edx
	callq	_avio_read
	addl	$4, %eax
	cmpl	%ebx, %eax
	jge	LBB0_4
## %bb.7:
	movq	%r14, %rdi
	callq	_av_packet_unref
	movq	_EIO@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_AVERROR                        ## TAILCALL
LBB0_4:
	addl	-48(%rbp), %eax                 ## 4-byte Folded Reload
	movl	%eax, 8(%r14)
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rax
	movl	(%rax), %eax
	movl	%eax, 16(%r14)
	xorl	%eax, %eax
	testl	%r13d, %r13d
	jne	LBB0_6
## %bb.5:
	movq	_AV_PKT_FLAG_KEY@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	%ecx, 12(%r14)
LBB0_6:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EIO,4,2                        ## @EIO
	.comm	_AV_PKT_FLAG_KEY,4,2            ## @AV_PKT_FLAG_KEY
	.no_dead_strip	_avs_read_video_packet
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal8,8byte_literals
	.p2align	3                               ; -- Begin function avs_read_video_packet
lCPI0_0:
	.long	0                               ; 0x0
	.long	3                               ; 0x3
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	2
_avs_read_video_packet:                 ; @avs_read_video_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	x21, x6
	mov	x25, x5
	mov	x22, x4
	mov	x20, x3
	mov	x24, x2
	mov	x19, x1
	mov	x23, x0
	ldr	x26, [x0, #8]
	add	w1, w6, w4
	mov	x0, x19
	bl	_av_new_packet
	tbnz	w0, #31, LBB0_7
; %bb.1:
	cbz	w21, LBB0_3
; %bb.2:
	ldr	x8, [x19]
Lloh0:
	adrp	x9, lCPI0_0@PAGE
Lloh1:
	ldr	d0, [x9, lCPI0_0@PAGEOFF]
	str	d0, [x8]
	and	w9, w21, #0xff
	ubfx	w10, w21, #8, #8
	stp	w9, w10, [x8, #8]
	add	x0, x8, #16
	sub	w2, w21, #4
	mov	x1, x25
	bl	_memcpy
LBB0_3:
	ldr	x8, [x19]
	add	x8, x8, w21, sxtw #2
	stp	w20, w24, [x8]
	and	w9, w22, #0xff
	ubfx	w10, w22, #8, #8
	stp	w9, w10, [x8, #8]
	ldr	w0, [x23]
	add	x1, x8, #16
	sub	w2, w22, #4
	bl	_avio_read
	add	w8, w0, #4
	cmp	w8, w22
	b.ge	LBB0_5
; %bb.4:
	mov	x0, x19
	bl	_av_packet_unref
Lloh2:
	adrp	x8, _EIO@GOTPAGE
Lloh3:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh4:
	ldr	w0, [x8]
	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
	b	_AVERROR
LBB0_5:
	add	w8, w8, w21
	str	w8, [x19, #8]
	ldr	x8, [x26]
	ldr	w8, [x8]
	str	w8, [x19, #16]
	mov	w0, #0
	cbnz	w20, LBB0_7
; %bb.6:
Lloh5:
	adrp	x8, _AV_PKT_FLAG_KEY@GOTPAGE
Lloh6:
	ldr	x8, [x8, _AV_PKT_FLAG_KEY@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	ldr	w9, [x19, #12]
	orr	w8, w9, w8
	str	w8, [x19, #12]
LBB0_7:
	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
	.loh AdrpLdr	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_EIO,4,2                        ; @EIO
	.comm	_AV_PKT_FLAG_KEY,4,2            ; @AV_PKT_FLAG_KEY
	.no_dead_strip	_avs_read_video_packet
.subsections_via_symbols
