	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sbg_read_packet
_sbg_read_packet:                       ## @sbg_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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movq	(%rdi), %rax
	movq	(%rax), %rax
	movq	(%rax), %r15
	movq	8(%rax), %rdi
	movq	24(%rax), %rcx
	movq	(%rcx), %rbx
	addq	%r15, %rbx
	movq	_AV_NOPTS_VALUE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rdi
	jne	LBB0_1
## %bb.2:
	subq	%r15, %rbx
	jle	LBB0_3
LBB0_4:
	movq	%r14, %rdi
	movl	$12, %esi
	callq	_av_new_packet
	testq	%rax, %rax
	js	LBB0_7
## %bb.5:
	movq	%r15, 24(%r14)
	movq	%r15, 32(%r14)
	movq	%rbx, 8(%r14)
	movq	16(%r14), %rdi
	movq	%r15, %rsi
	callq	_AV_WL64
	movq	8(%r14), %rsi
	movq	16(%r14), %rdi
	addq	$8, %rdi
	callq	_AV_WL32
	movl	(%r14), %eax
	jmp	LBB0_6
LBB0_1:
	addq	16(%rax), %rdi
	movq	%rbx, %rsi
	callq	_FFMIN
	movq	%rax, %rbx
	subq	%r15, %rbx
	jg	LBB0_4
LBB0_3:
	movq	_AVERROR_EOF@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
LBB0_6:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_AVERROR                        ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_AV_NOPTS_VALUE,8,3             ## @AV_NOPTS_VALUE
	.comm	_AVERROR_EOF,4,2                ## @AVERROR_EOF
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.no_dead_strip	_sbg_read_packet
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sbg_read_packet
_sbg_read_packet:                       ; @sbg_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
	ldr	x8, [x0]
	ldr	x8, [x8]
	ldr	x9, [x8, #24]
	ldr	x10, [x9]
	ldp	x20, x9, [x8]
	add	x1, x10, x20
Lloh0:
	adrp	x10, _AV_NOPTS_VALUE@GOTPAGE
Lloh1:
	ldr	x10, [x10, _AV_NOPTS_VALUE@GOTPAGEOFF]
Lloh2:
	ldr	x10, [x10]
	cmp	x9, x10
	b.ne	LBB0_4
; %bb.1:
	subs	x21, x1, x20
	b.le	LBB0_5
LBB0_2:
	mov	x0, x19
	mov	w1, #12
	bl	_av_new_packet
	tbnz	x0, #63, LBB0_7
; %bb.3:
	stp	x20, x20, [x19, #24]
	str	x21, [x19, #8]
	ldr	x0, [x19, #16]
	mov	x1, x20
	bl	_AV_WL64
	ldp	x1, x8, [x19, #8]
	add	x0, x8, #8
	bl	_AV_WL32
	ldr	w0, [x19]
	b	LBB0_6
LBB0_4:
	ldr	x8, [x8, #16]
	add	x0, x8, x9
	bl	_FFMIN
	mov	x1, x0
	subs	x21, x1, x20
	b.gt	LBB0_2
LBB0_5:
Lloh3:
	adrp	x8, _AVERROR_EOF@GOTPAGE
Lloh4:
	ldr	x8, [x8, _AVERROR_EOF@GOTPAGEOFF]
Lloh5:
	ldr	w0, [x8]
LBB0_6:
	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:
Lloh6:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh7:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh8:
	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
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_AV_NOPTS_VALUE,8,3             ; @AV_NOPTS_VALUE
	.comm	_AVERROR_EOF,4,2                ; @AVERROR_EOF
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.no_dead_strip	_sbg_read_packet
.subsections_via_symbols
