	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function nc_read_packet
_nc_read_packet:                        ## @nc_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, %r12
	movq	_NC_VIDEO_FLAG@GOTPCREL(%rip), %r15
	cmpl	$-1, (%r15)
	je	LBB0_6
## %bb.1:
	movl	$-1, %ebx
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r12), %edi
	callq	_avio_feof
	testq	%rax, %rax
	jne	LBB0_3
## %bb.5:                               ##   in Loop: Header=BB0_2 Depth=1
	shll	$8, %ebx
	movl	(%r12), %edi
	callq	_avio_r8
	addl	%eax, %ebx
	cmpl	(%r15), %ebx
	jne	LBB0_2
LBB0_6:
	movl	(%r12), %edi
	callq	_avio_r8
	movl	(%r12), %edi
	callq	_avio_rl16
	movl	%eax, %r15d
	movl	(%r12), %edi
	movl	$9, %esi
	callq	_avio_skip
	testl	%r15d, %r15d
	je	LBB0_7
## %bb.8:
	movl	(%r12), %edi
	movq	%r14, %rsi
	movl	%r15d, %edx
	callq	_av_get_packet
	cmpl	%r15d, %eax
	jne	LBB0_9
## %bb.11:
	movq	$0, (%r14)
	movl	%r15d, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	movq	_AV_LOG_DEBUG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rdx
	movq	%r12, %rdi
	callq	_av_log
	movq	_EAGAIN@GOTPCREL(%rip), %rax
	jmp	LBB0_4
LBB0_9:
	testl	%eax, %eax
	jle	LBB0_3
## %bb.10:
	movq	%r14, %rdi
	callq	_av_packet_unref
LBB0_3:
	movq	_EIO@GOTPCREL(%rip), %rax
LBB0_4:
	movl	(%rax), %edi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_AVERROR                        ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_NC_VIDEO_FLAG,4,2              ## @NC_VIDEO_FLAG
	.comm	_EIO,4,2                        ## @EIO
	.comm	_AV_LOG_DEBUG,4,2               ## @AV_LOG_DEBUG
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Next packet size is zero\n"

	.comm	_EAGAIN,4,2                     ## @EAGAIN
	.no_dead_strip	_nc_read_packet
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function nc_read_packet
_nc_read_packet:                        ; @nc_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	x20, x0
Lloh0:
	adrp	x21, _NC_VIDEO_FLAG@GOTPAGE
Lloh1:
	ldr	x21, [x21, _NC_VIDEO_FLAG@GOTPAGEOFF]
	ldr	w8, [x21]
	cmn	w8, #1
	b.eq	LBB0_4
; %bb.1:
	mov	w22, #-1
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x20]
	bl	_avio_feof
	cbnz	x0, LBB0_10
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	ldr	w0, [x20]
	bl	_avio_r8
	add	w22, w0, w22, lsl #8
	ldr	w8, [x21]
	cmp	w22, w8
	b.ne	LBB0_2
LBB0_4:
	ldr	w0, [x20]
	bl	_avio_r8
	ldr	w0, [x20]
	bl	_avio_rl16
	mov	x21, x0
	ldr	w0, [x20]
	mov	w1, #9
	bl	_avio_skip
	cbz	w21, LBB0_7
; %bb.5:
	ldr	w0, [x20]
	mov	x1, x19
	mov	x2, x21
	bl	_av_get_packet
	cmp	w0, w21
	b.ne	LBB0_8
; %bb.6:
	str	xzr, [x19]
	mov	x0, x21
	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_7:
Lloh2:
	adrp	x8, _AV_LOG_DEBUG@GOTPAGE
Lloh3:
	ldr	x8, [x8, _AV_LOG_DEBUG@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
Lloh5:
	adrp	x2, l_.str@PAGE
Lloh6:
	add	x2, x2, l_.str@PAGEOFF
	mov	x0, x20
	bl	_av_log
Lloh7:
	adrp	x8, _EAGAIN@GOTPAGE
Lloh8:
	ldr	x8, [x8, _EAGAIN@GOTPAGEOFF]
	b	LBB0_11
LBB0_8:
	cmp	w0, #1
	b.lt	LBB0_10
; %bb.9:
	mov	x0, x19
	bl	_av_packet_unref
LBB0_10:
Lloh9:
	adrp	x8, _EIO@GOTPAGE
Lloh10:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
LBB0_11:
	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 AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_NC_VIDEO_FLAG,4,2              ; @NC_VIDEO_FLAG
	.comm	_EIO,4,2                        ; @EIO
	.comm	_AV_LOG_DEBUG,4,2               ; @AV_LOG_DEBUG
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Next packet size is zero\n"

	.comm	_EAGAIN,4,2                     ; @EAGAIN
	.no_dead_strip	_nc_read_packet
.subsections_via_symbols
