	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function siff_read_packet
_siff_read_packet:                      ## @siff_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	8(%rdi), %rbx
	cmpq	$0, 48(%rbx)
	je	LBB0_7
## %bb.1:
	movq	(%rbx), %rax
	cmpq	8(%rbx), %rax
	jge	LBB0_11
## %bb.2:
	movl	16(%rbx), %ecx
	cmpl	$-1, %ecx
	je	LBB0_16
## %bb.3:
	testl	%ecx, %ecx
	je	LBB0_22
LBB0_4:
	movl	(%r12), %edi
	movl	36(%rbx), %edx
	addl	$-4, %edx
	movq	%r14, %rsi
	callq	_av_get_packet
	testl	%eax, %eax
	js	LBB0_14
## %bb.5:
	movl	$1, 4(%r14)
	movl	%eax, 8(%r14)
	movl	$0, 16(%rbx)
	cmpq	$0, (%rbx)
	jne	LBB0_10
## %bb.6:
	movq	_AV_PKT_FLAG_KEY@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, 16(%r14)
	jmp	LBB0_10
LBB0_7:
	movl	(%r12), %edi
	movl	40(%rbx), %edx
	movq	%r14, %rsi
	callq	_av_get_packet
	testl	%eax, %eax
	je	LBB0_11
## %bb.8:
	jle	LBB0_14
## %bb.9:
	movl	%eax, 8(%r14)
LBB0_10:
	movl	12(%r14), %eax
	jmp	LBB0_13
LBB0_11:
	movq	_AVERROR_EOF@GOTPCREL(%rip), %rax
LBB0_12:
	movl	(%rax), %eax
LBB0_13:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_14:
	movq	_EIO@GOTPCREL(%rip), %rax
LBB0_15:
	movl	(%rax), %edi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_AVERROR                        ## TAILCALL
LBB0_16:
	movl	(%r12), %edi
	callq	_avio_rl32
	addl	$-4, %eax
	movl	%eax, 20(%rbx)
	movl	(%r12), %edi
	callq	_avio_rl16
	movl	%eax, 24(%rbx)
	movq	_VB_HAS_GMC@GOTPCREL(%rip), %rcx
	xorl	%edx, %edx
	movl	(%rcx), %ecx
	andl	%eax, %ecx
	setne	%dl
	shll	$2, %edx
	movl	%edx, 28(%rbx)
	testl	%ecx, %ecx
	je	LBB0_18
## %bb.17:
	movl	(%r12), %edi
	movl	32(%rbx), %esi
	callq	_avio_read
	movl	24(%rbx), %eax
LBB0_18:
	movq	_VB_HAS_AUDIO@GOTPCREL(%rip), %r15
	testl	%eax, (%r15)
	je	LBB0_20
## %bb.19:
	movl	(%r12), %edi
	callq	_avio_rl32
	movl	(%r15), %edx
	xorl	%ecx, %ecx
	testl	%edx, 24(%rbx)
	setne	%cl
	jmp	LBB0_21
LBB0_20:
	xorl	%ecx, %ecx
	xorl	%eax, %eax
LBB0_21:
	movl	%eax, 36(%rbx)
	movl	%ecx, 16(%rbx)
	testl	%ecx, %ecx
	jne	LBB0_4
LBB0_22:
	movl	20(%rbx), %esi
	movslq	36(%rbx), %rcx
	movslq	28(%rbx), %rax
	leaq	(%rcx,%rax), %rdx
	addq	$2, %rdx
	cmpq	%rsi, %rdx
	jg	LBB0_31
## %bb.23:
	addl	%ecx, %eax
	subl	%eax, %esi
	addl	$-2, %esi
	movl	(%r12), %edi
                                        ## kill: def $esi killed $esi killed $rsi
	callq	_ffio_limit
	movl	%eax, %r15d
	movl	28(%rbx), %eax
	leal	(%r15,%rax), %esi
	addl	$2, %esi
	movq	%r14, %rdi
	callq	_av_new_packet
	testq	%rax, %rax
	js	LBB0_26
## %bb.24:
	movl	(%r14), %edi
	movl	24(%rbx), %esi
	callq	_AV_WL16
	movl	28(%rbx), %edx
	testl	%edx, %edx
	je	LBB0_27
## %bb.25:
	movl	(%r14), %edi
	addl	$2, %edi
	movl	32(%rbx), %esi
	callq	_memcpy
	movl	28(%rbx), %eax
	jmp	LBB0_28
LBB0_26:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	jmp	LBB0_15
LBB0_27:
	xorl	%eax, %eax
LBB0_28:
	movl	(%r12), %edi
	movl	(%r14), %ecx
	leal	(%rcx,%rax), %esi
	addl	$2, %esi
	movl	%r15d, %edx
	callq	_avio_read
	cmpl	%r15d, %eax
	jne	LBB0_30
## %bb.29:
	movl	$0, 4(%r14)
	movl	$-1, 16(%rbx)
	movq	(%rbx), %rax
	movq	_AV_PKT_FLAG_KEY@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	%ecx, 16(%r14)
	incq	%rax
	movq	%rax, (%rbx)
	jmp	LBB0_10
LBB0_30:
	movq	%r14, %rdi
	callq	_av_packet_unref
LBB0_31:
	movq	_AVERROR_INVALIDDATA@GOTPCREL(%rip), %rax
	jmp	LBB0_12
	.cfi_endproc
                                        ## -- End function
	.comm	_AVERROR_EOF,4,2                ## @AVERROR_EOF
	.comm	_VB_HAS_GMC,4,2                 ## @VB_HAS_GMC
	.comm	_VB_HAS_AUDIO,4,2               ## @VB_HAS_AUDIO
	.comm	_AVERROR_INVALIDDATA,4,2        ## @AVERROR_INVALIDDATA
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_EIO,4,2                        ## @EIO
	.comm	_AV_PKT_FLAG_KEY,4,2            ## @AV_PKT_FLAG_KEY
	.no_dead_strip	_siff_read_packet
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function siff_read_packet
_siff_read_packet:                      ; @siff_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
	ldr	x22, [x0, #8]
	ldr	x8, [x22, #48]
	cbz	x8, LBB0_7
; %bb.1:
	ldp	x8, x9, [x22]
	cmp	x8, x9
	b.ge	LBB0_11
; %bb.2:
	ldr	w8, [x22, #16]
	cmn	w8, #1
	b.eq	LBB0_16
; %bb.3:
	cbz	w8, LBB0_22
LBB0_4:
	ldr	w0, [x20]
	ldr	w8, [x22, #36]
	sub	w2, w8, #4
	mov	x1, x19
	bl	_av_get_packet
	tbnz	w0, #31, LBB0_14
; %bb.5:
	mov	w8, #1
	stp	w8, w0, [x19, #4]
	str	wzr, [x22, #16]
	ldr	x8, [x22]
	cbnz	x8, LBB0_10
; %bb.6:
Lloh0:
	adrp	x8, _AV_PKT_FLAG_KEY@GOTPAGE
Lloh1:
	ldr	x8, [x8, _AV_PKT_FLAG_KEY@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	ldr	w9, [x19, #16]
	orr	w8, w9, w8
	str	w8, [x19, #16]
	b	LBB0_10
LBB0_7:
	ldr	w0, [x20]
	ldr	w2, [x22, #40]
	mov	x1, x19
	bl	_av_get_packet
	cbz	w0, LBB0_11
; %bb.8:
	cmp	w0, #0
	b.le	LBB0_14
; %bb.9:
	str	w0, [x19, #8]
LBB0_10:
	ldr	w0, [x19, #12]
	b	LBB0_13
LBB0_11:
Lloh3:
	adrp	x8, _AVERROR_EOF@GOTPAGE
Lloh4:
	ldr	x8, [x8, _AVERROR_EOF@GOTPAGEOFF]
LBB0_12:
	ldr	w0, [x8]
LBB0_13:
	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_14:
Lloh5:
	adrp	x8, _EIO@GOTPAGE
Lloh6:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
LBB0_15:
	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
LBB0_16:
	ldr	w0, [x20]
	bl	_avio_rl32
	sub	w8, w0, #4
	str	w8, [x22, #20]
	ldr	w0, [x20]
	bl	_avio_rl16
Lloh7:
	adrp	x8, _VB_HAS_GMC@GOTPAGE
Lloh8:
	ldr	x8, [x8, _VB_HAS_GMC@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
	ands	w8, w8, w0
	cset	w9, ne
	lsl	w2, w9, #2
	stp	w0, w2, [x22, #24]
	cbz	w8, LBB0_18
; %bb.17:
	ldr	w0, [x20]
	ldr	w1, [x22, #32]
	bl	_avio_read
	ldr	w0, [x22, #24]
LBB0_18:
Lloh10:
	adrp	x21, _VB_HAS_AUDIO@GOTPAGE
Lloh11:
	ldr	x21, [x21, _VB_HAS_AUDIO@GOTPAGEOFF]
	ldr	w8, [x21]
	tst	w8, w0
	b.eq	LBB0_20
; %bb.19:
	ldr	w0, [x20]
	bl	_avio_rl32
	ldr	w8, [x22, #24]
	ldr	w9, [x21]
	tst	w9, w8
	cset	w8, ne
	b	LBB0_21
LBB0_20:
	mov	w8, #0
	mov	w0, #0
LBB0_21:
	str	w0, [x22, #36]
	str	w8, [x22, #16]
	cbnz	w8, LBB0_4
LBB0_22:
	ldr	w8, [x22, #20]
	ldrsw	x9, [x22, #36]
	ldrsw	x10, [x22, #28]
	add	x11, x9, x10
	add	x11, x11, #2
	cmp	x11, x8
	b.gt	LBB0_31
; %bb.23:
	add	w9, w9, w10
	sub	w8, w8, w9
	sub	w1, w8, #2
	ldr	w0, [x20]
	bl	_ffio_limit
	mov	x21, x0
	ldr	w8, [x22, #28]
	add	w8, w0, w8
	add	w1, w8, #2
	mov	x0, x19
	bl	_av_new_packet
	tbnz	x0, #63, LBB0_26
; %bb.24:
	ldr	w0, [x19]
	ldr	w1, [x22, #24]
	bl	_AV_WL16
	ldr	w2, [x22, #28]
	cbz	w2, LBB0_27
; %bb.25:
	ldr	w8, [x19]
	add	w0, w8, #2
	ldr	w1, [x22, #32]
	bl	_memcpy
	ldr	w8, [x22, #28]
	b	LBB0_28
LBB0_26:
Lloh12:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh13:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
	b	LBB0_15
LBB0_27:
	mov	w8, #0
LBB0_28:
	ldr	w0, [x20]
	ldr	w9, [x19]
	add	w8, w9, w8
	add	w1, w8, #2
	mov	x2, x21
	bl	_avio_read
	cmp	w0, w21
	b.ne	LBB0_30
; %bb.29:
	str	wzr, [x19, #4]
	mov	w8, #-1
	str	w8, [x22, #16]
	ldr	x8, [x22]
Lloh14:
	adrp	x9, _AV_PKT_FLAG_KEY@GOTPAGE
Lloh15:
	ldr	x9, [x9, _AV_PKT_FLAG_KEY@GOTPAGEOFF]
Lloh16:
	ldr	w9, [x9]
	ldr	w10, [x19, #16]
	orr	w9, w10, w9
	str	w9, [x19, #16]
	add	x8, x8, #1
	str	x8, [x22]
	b	LBB0_10
LBB0_30:
	mov	x0, x19
	bl	_av_packet_unref
LBB0_31:
Lloh17:
	adrp	x8, _AVERROR_INVALIDDATA@GOTPAGE
Lloh18:
	ldr	x8, [x8, _AVERROR_INVALIDDATA@GOTPAGEOFF]
	b	LBB0_12
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.comm	_AVERROR_EOF,4,2                ; @AVERROR_EOF
	.comm	_VB_HAS_GMC,4,2                 ; @VB_HAS_GMC
	.comm	_VB_HAS_AUDIO,4,2               ; @VB_HAS_AUDIO
	.comm	_AVERROR_INVALIDDATA,4,2        ; @AVERROR_INVALIDDATA
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_EIO,4,2                        ; @EIO
	.comm	_AV_PKT_FLAG_KEY,4,2            ; @AV_PKT_FLAG_KEY
	.no_dead_strip	_siff_read_packet
.subsections_via_symbols
