	.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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	16(%rdi), %rdx
	movq	(%rdx), %rax
	cmpq	8(%rdx), %rax
	jae	LBB0_5
## %bb.1:
	movq	%rsi, %r14
	movq	%rdi, %rbx
	movq	(%rdi), %rcx
	movq	8(%rdi), %rdi
	movq	(%rcx), %rcx
	movq	%rcx, -96(%rbp)                 ## 8-byte Spill
	movq	16(%rdx), %r15
	leaq	(%rax,%rax,2), %r13
	movl	8(%r15,%r13,4), %esi
	movq	_SEEK_SET@GOTPCREL(%rip), %rax
	movq	%rdx, -72(%rbp)                 ## 8-byte Spill
	movl	(%rax), %edx
	movq	%rdi, -64(%rbp)                 ## 8-byte Spill
	callq	_avio_seek
	testl	%eax, %eax
	js	LBB0_6
## %bb.2:
	movq	%r14, -56(%rbp)                 ## 8-byte Spill
	leaq	(%r15,%r13,4), %r14
	movq	(%rbx), %rax
	movq	-72(%rbp), %rcx                 ## 8-byte Reload
	movq	(%rcx), %rcx
	movq	(%rax,%rcx,8), %rax
	movq	(%rax), %rax
	movq	(%rax), %rax
	movq	_AV_CODEC_ID_PNG@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_7
## %bb.3:
	movl	(%r14), %edx
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rsi
	callq	_av_get_packet
	testl	%eax, %eax
	jns	LBB0_15
	jmp	LBB0_6
LBB0_5:
	movq	_AVERROR_EOF@GOTPCREL(%rip), %rax
LBB0_19:
	movl	(%rax), %r12d
	jmp	LBB0_20
LBB0_7:
	movq	%r13, -80(%rbp)                 ## 8-byte Spill
	movq	%r15, -88(%rbp)                 ## 8-byte Spill
	movl	(%r14), %esi
	addl	$14, %esi
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rdi
	callq	_av_new_packet
	testl	%eax, %eax
	js	LBB0_6
## %bb.8:
	movq	16(%rbx), %rax
	movq	%rax, -48(%rbp)
	leaq	-48(%rbp), %r12
	movq	%r12, %rdi
	movl	$66, %esi
	callq	_bytestream_put_byte
	movq	%r12, %rdi
	movl	$77, %esi
	callq	_bytestream_put_byte
	movl	8(%rbx), %esi
	movq	%r12, %rdi
	callq	_bytestream_put_le32
	movq	%r12, %rdi
	xorl	%esi, %esi
	callq	_bytestream_put_le16
	movq	%r12, %rdi
	xorl	%esi, %esi
	callq	_bytestream_put_le16
	movq	%r12, %rdi
	xorl	%esi, %esi
	callq	_bytestream_put_le32
	movq	-48(%rbp), %rsi
	movl	(%r14), %edx
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	callq	_avio_read
	cmpl	(%r14), %eax
	jne	LBB0_17
## %bb.9:
	movq	-48(%rbp), %rdi
	addq	$56, %rdi
	callq	_AV_RL16
	movq	-96(%rbp), %rbx                 ## 8-byte Reload
	movq	(%rbx), %rcx
	movl	%eax, 8(%rcx)
	movq	-48(%rbp), %rdi
	subq	$-128, %rdi
	callq	_AV_RL32
	testl	%eax, %eax
	movq	-88(%rbp), %r14                 ## 8-byte Reload
	movq	-80(%rbp), %r15                 ## 8-byte Reload
	je	LBB0_11
## %bb.10:
	movq	-48(%rbp), %rdi
	subq	$-128, %rdi
	callq	_AV_RL32
	movl	%eax, 4(%r14,%r15,4)
LBB0_11:
	movq	(%rbx), %rax
	movl	8(%rax), %ecx
	cmpl	$8, %ecx
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	jg	LBB0_14
## %bb.12:
	cmpl	$0, 4(%r14,%r15,4)
	jne	LBB0_14
## %bb.13:
	movl	$1, %esi
                                        ## kill: def $cl killed $cl killed $ecx
	shll	%cl, %esi
	leaq	(%r14,%r15,4), %rax
	addq	$4, %rax
	movl	%esi, (%rax)
	movq	-48(%rbp), %rdi
	subq	$-128, %rdi
	callq	_AV_WL32
LBB0_14:
	movq	-48(%rbp), %rdi
	addq	$-16, %rdi
	movl	4(%r14,%r15,4), %eax
	leal	54(,%rax,4), %esi
	callq	_AV_WL32
	movq	-48(%rbp), %r14
	addq	$32, %r14
	movq	%r14, %rdi
	callq	_AV_RL32
	movl	%eax, %esi
	shrl	$31, %esi
	addl	%eax, %esi
	sarl	%esi
	movq	%r14, %rdi
	callq	_AV_WL32
LBB0_15:
	movq	-72(%rbp), %rdx                 ## 8-byte Reload
	movq	(%rdx), %rax
	leaq	1(%rax), %rcx
	movq	%rcx, (%rdx)
	movl	%eax, 4(%rbx)
	movq	_AV_PKT_FLAG_KEY@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, (%rbx)
	xorl	%r12d, %r12d
	jmp	LBB0_20
LBB0_6:
	movl	%eax, %r12d
LBB0_20:
	movl	%r12d, %eax
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_17:
	movl	%eax, %r12d
	movq	%rbx, %rdi
	callq	_av_packet_unref
	testl	%r12d, %r12d
	js	LBB0_20
## %bb.18:
	movq	_AVERROR_INVALIDDATA@GOTPCREL(%rip), %rax
	jmp	LBB0_19
	.cfi_endproc
                                        ## -- End function
	.comm	_AVERROR_EOF,4,2                ## @AVERROR_EOF
	.comm	_SEEK_SET,4,2                   ## @SEEK_SET
	.comm	_AV_CODEC_ID_PNG,8,3            ## @AV_CODEC_ID_PNG
	.comm	_AVERROR_INVALIDDATA,4,2        ## @AVERROR_INVALIDDATA
	.comm	_AV_PKT_FLAG_KEY,4,2            ## @AV_PKT_FLAG_KEY
	.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
	ldr	x22, [x0, #16]
	ldp	x23, x8, [x22]
	cmp	x23, x8
	b.hs	LBB0_4
; %bb.1:
	mov	x19, x1
	mov	x21, x0
	ldp	x8, x20, [x0]
	ldr	x25, [x8]
	ldr	x24, [x22, #16]
	mov	w8, #12
	madd	x26, x23, x8, x24
	ldr	w1, [x26, #8]
Lloh0:
	adrp	x8, _SEEK_SET@GOTPAGE
Lloh1:
	ldr	x8, [x8, _SEEK_SET@GOTPAGEOFF]
Lloh2:
	ldr	w2, [x8]
	mov	x0, x20
	bl	_avio_seek
	tbnz	w0, #31, LBB0_15
; %bb.2:
	ldr	x8, [x21]
	ldr	x9, [x22]
	ldr	x8, [x8, x9, lsl #3]
	ldr	x8, [x8]
	ldr	x8, [x8]
Lloh3:
	adrp	x9, _AV_CODEC_ID_PNG@GOTPAGE
Lloh4:
	ldr	x9, [x9, _AV_CODEC_ID_PNG@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_5
; %bb.3:
	ldr	w2, [x26]
	mov	x0, x20
	mov	x1, x19
	bl	_av_get_packet
	tbz	w0, #31, LBB0_13
	b	LBB0_15
LBB0_4:
Lloh6:
	adrp	x8, _AVERROR_EOF@GOTPAGE
Lloh7:
	ldr	x8, [x8, _AVERROR_EOF@GOTPAGEOFF]
Lloh8:
	ldr	w0, [x8]
	b	LBB0_15
LBB0_5:
	ldr	w8, [x26]
	add	w1, w8, #14
	mov	x0, x19
	bl	_av_new_packet
	tbnz	w0, #31, LBB0_15
; %bb.6:
	ldr	x8, [x19, #16]
	str	x8, [sp, #8]
	add	x0, sp, #8
	mov	w1, #66
	bl	_bytestream_put_byte
	add	x0, sp, #8
	mov	w1, #77
	bl	_bytestream_put_byte
	ldr	w1, [x19, #8]
	add	x0, sp, #8
	bl	_bytestream_put_le32
	add	x0, sp, #8
	mov	w1, #0
	bl	_bytestream_put_le16
	add	x0, sp, #8
	mov	w1, #0
	bl	_bytestream_put_le16
	add	x0, sp, #8
	mov	w1, #0
	bl	_bytestream_put_le32
	ldr	x1, [sp, #8]
	ldr	w2, [x26]
	mov	x0, x20
	bl	_avio_read
	ldr	w8, [x26]
	cmp	w0, w8
	b.ne	LBB0_14
; %bb.7:
	ldr	x8, [sp, #8]
	add	x0, x8, #56
	bl	_AV_RL16
	ldr	x8, [x25]
	str	w0, [x8, #8]
	ldr	x8, [sp, #8]
	add	x0, x8, #128
	bl	_AV_RL32
	cbz	w0, LBB0_9
; %bb.8:
	ldr	x8, [sp, #8]
	add	x0, x8, #128
	bl	_AV_RL32
	mov	w8, #12
	madd	x8, x23, x8, x24
	str	w0, [x8, #4]
LBB0_9:
	ldr	x8, [x25]
	ldr	w8, [x8, #8]
	cmp	w8, #8
	b.gt	LBB0_12
; %bb.10:
	mov	w9, #12
	madd	x9, x23, x9, x24
	ldr	w10, [x9, #4]!
	cbnz	w10, LBB0_12
; %bb.11:
	mov	w10, #1
	lsl	w1, w10, w8
	str	w1, [x9]
	ldr	x8, [sp, #8]
	add	x0, x8, #128
	bl	_AV_WL32
LBB0_12:
	ldr	x8, [sp, #8]
	sub	x0, x8, #16
	mov	w8, #12
	madd	x8, x23, x8, x24
	ldr	w8, [x8, #4]
	lsl	w8, w8, #2
	add	w1, w8, #54
	bl	_AV_WL32
	ldr	x8, [sp, #8]
	add	x20, x8, #32
	mov	x0, x20
	bl	_AV_RL32
	cmp	w0, #0
	cinc	w8, w0, lt
	asr	w1, w8, #1
	mov	x0, x20
	bl	_AV_WL32
LBB0_13:
	mov	w0, #0
	ldr	x8, [x22]
	add	x9, x8, #1
Lloh9:
	adrp	x10, _AV_PKT_FLAG_KEY@GOTPAGE
Lloh10:
	ldr	x10, [x10, _AV_PKT_FLAG_KEY@GOTPAGEOFF]
	str	x9, [x22]
Lloh11:
	ldr	w9, [x10]
	ldr	w10, [x19]
	orr	w9, w10, w9
	stp	w9, w8, [x19]
	b	LBB0_15
LBB0_14:
	mov	x20, x0
	mov	x0, x19
	bl	_av_packet_unref
Lloh12:
	adrp	x8, _AVERROR_INVALIDDATA@GOTPAGE
Lloh13:
	ldr	x8, [x8, _AVERROR_INVALIDDATA@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	cmp	w20, #0
	csel	w0, w20, w8, lt
LBB0_15:
	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
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_AVERROR_EOF,4,2                ; @AVERROR_EOF
	.comm	_SEEK_SET,4,2                   ; @SEEK_SET
	.comm	_AV_CODEC_ID_PNG,8,3            ; @AV_CODEC_ID_PNG
	.comm	_AVERROR_INVALIDDATA,4,2        ; @AVERROR_INVALIDDATA
	.comm	_AV_PKT_FLAG_KEY,4,2            ; @AV_PKT_FLAG_KEY
	.no_dead_strip	_read_packet
.subsections_via_symbols
