	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function redspark_read_packet
_redspark_read_packet:                  ## @redspark_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
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movq	%rdi, %rbx
	movq	8(%rdi), %rax
	movq	(%rax), %rax
	movq	8(%rax), %rax
	movq	16(%rdi), %r12
	movl	(%rax), %r15d
	movl	(%rdi), %edi
	callq	_avio_feof
	testq	%rax, %rax
	jne	LBB0_2
## %bb.1:
	movq	(%r12), %rax
	movq	8(%rbx), %rcx
	movq	(%rcx), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_3
LBB0_2:
	movq	_AVERROR_EOF@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
LBB0_5:
	movl	%r15d, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_3:
	shll	$3, %r15d
	movl	(%rbx), %edi
	movq	%r14, %rsi
	movl	%r15d, %edx
	callq	_av_get_packet
	cmpl	%r15d, %eax
	jne	LBB0_6
## %bb.4:
	movl	$14, (%r14)
	addq	$14, (%r12)
	movq	$0, 8(%r14)
	jmp	LBB0_5
LBB0_6:
	movq	%r14, %rdi
	callq	_av_packet_unref
	movq	_EIO@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_AVERROR                        ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_AVERROR_EOF,4,2                ## @AVERROR_EOF
	.comm	_EIO,4,2                        ## @EIO
	.no_dead_strip	_redspark_read_packet
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function redspark_read_packet
_redspark_read_packet:                  ; @redspark_read_packet
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x19, x1
	mov	x21, x0
	ldp	x8, x22, [x0, #8]
	ldr	x8, [x8]
	ldr	x8, [x8, #8]
	ldr	w20, [x8]
	ldr	w0, [x0]
	bl	_avio_feof
	cbnz	x0, LBB0_2
; %bb.1:
	ldr	x8, [x22]
	ldr	x9, [x21, #8]
	ldr	x9, [x9]
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_4
LBB0_2:
Lloh0:
	adrp	x8, _AVERROR_EOF@GOTPAGE
Lloh1:
	ldr	x8, [x8, _AVERROR_EOF@GOTPAGEOFF]
Lloh2:
	ldr	w20, [x8]
LBB0_3:
	mov	x0, x20
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
LBB0_4:
	lsl	w20, w20, #3
	ldr	w0, [x21]
	mov	x1, x19
	mov	x2, x20
	bl	_av_get_packet
	cmp	w0, w20
	b.ne	LBB0_6
; %bb.5:
	mov	w8, #14
	str	w8, [x19]
	ldr	x8, [x22]
	add	x8, x8, #14
	str	x8, [x22]
	str	xzr, [x19, #8]
	b	LBB0_3
LBB0_6:
	mov	x0, x19
	bl	_av_packet_unref
Lloh3:
	adrp	x8, _EIO@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh5:
	ldr	w0, [x8]
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	b	_AVERROR
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_AVERROR_EOF,4,2                ; @AVERROR_EOF
	.comm	_EIO,4,2                        ; @EIO
	.no_dead_strip	_redspark_read_packet
.subsections_via_symbols
