	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function thp_read_packet
_thp_read_packet:                       ## @thp_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
	movl	(%rbx), %edx
	testl	%edx, %edx
	je	LBB0_1
## %bb.9:
	movq	%r12, %rdi
	movq	%r14, %rsi
	callq	_av_get_packet
	testl	%eax, %eax
	js	LBB0_15
## %bb.10:
	cmpl	(%rbx), %eax
	jne	LBB0_16
## %bb.11:
	movl	24(%rbx), %ecx
	movl	%ecx, 12(%r14)
	cmpl	$8, %eax
	jb	LBB0_13
## %bb.12:
	movq	(%r14), %rdi
	addq	$16, %rdi
	callq	_AV_RB32
	movl	%eax, 8(%r14)
LBB0_13:
	movl	$0, (%rbx)
	incq	8(%rbx)
	jmp	LBB0_14
LBB0_1:
	movq	8(%rbx), %rax
	cmpq	16(%rbx), %rax
	jge	LBB0_2
## %bb.3:
	movl	48(%rbx), %esi
	movq	_SEEK_SET@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r12, %rdi
	callq	_avio_seek
	movq	40(%rbx), %rdi
	movl	$1, %esi
	callq	_FFMAX
	addl	%eax, 48(%rbx)
	movq	%r12, %rdi
	callq	_avio_rb32
	movq	%rax, 40(%rbx)
	movq	%r12, %rdi
	callq	_avio_rb32
	movq	%r12, %rdi
	callq	_avio_rb32
	movq	%rax, %r15
	cmpq	$0, 32(%rbx)
	je	LBB0_5
## %bb.4:
	movq	%r12, %rdi
	callq	_avio_rb32
	movl	%eax, (%rbx)
	jmp	LBB0_6
LBB0_2:
	movq	_AVERROR_EOF@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	jmp	LBB0_15
LBB0_5:
	incq	8(%rbx)
LBB0_6:
	movq	%r12, %rdi
	movq	%r14, %rsi
	movl	%r15d, %edx
	callq	_av_get_packet
	testl	%eax, %eax
	js	LBB0_15
## %bb.7:
	cmpl	%r15d, %eax
	jne	LBB0_16
## %bb.8:
	movl	28(%rbx), %eax
	movl	%eax, 12(%r14)
LBB0_14:
	xorl	%eax, %eax
LBB0_15:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_16:
	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	_SEEK_SET,4,2                   ## @SEEK_SET
	.comm	_EIO,4,2                        ## @EIO
	.no_dead_strip	_thp_read_packet
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function thp_read_packet
_thp_read_packet:                       ; @thp_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
	ldp	x20, x22, [x0]
	ldr	w2, [x22]
	cbz	w2, LBB0_6
; %bb.1:
	mov	x0, x20
	mov	x1, x19
	bl	_av_get_packet
	tbnz	w0, #31, LBB0_14
; %bb.2:
	ldr	w8, [x22]
	cmp	w0, w8
	b.ne	LBB0_15
; %bb.3:
	ldr	w8, [x22, #24]
	str	w8, [x19, #12]
	cmp	w0, #8
	b.lo	LBB0_5
; %bb.4:
	ldr	x8, [x19]
	add	x0, x8, #16
	bl	_AV_RB32
	str	w0, [x19, #8]
LBB0_5:
	mov	w0, #0
	str	wzr, [x22]
	ldr	x8, [x22, #8]
	add	x8, x8, #1
	str	x8, [x22, #8]
	b	LBB0_14
LBB0_6:
	ldp	x8, x9, [x22, #8]
	cmp	x8, x9
	b.ge	LBB0_9
; %bb.7:
	ldr	w1, [x22, #48]
Lloh0:
	adrp	x8, _SEEK_SET@GOTPAGE
Lloh1:
	ldr	x8, [x8, _SEEK_SET@GOTPAGEOFF]
Lloh2:
	ldr	w2, [x8]
	mov	x0, x20
	bl	_avio_seek
	ldr	x0, [x22, #40]
	mov	w1, #1
	bl	_FFMAX
	ldr	w8, [x22, #48]
	add	w8, w8, w0
	str	w8, [x22, #48]
	mov	x0, x20
	bl	_avio_rb32
	str	x0, [x22, #40]
	mov	x0, x20
	bl	_avio_rb32
	mov	x0, x20
	bl	_avio_rb32
	mov	x21, x0
	ldr	x8, [x22, #32]
	cbz	x8, LBB0_10
; %bb.8:
	mov	x0, x20
	bl	_avio_rb32
	str	w0, [x22]
	b	LBB0_11
LBB0_9:
Lloh3:
	adrp	x8, _AVERROR_EOF@GOTPAGE
Lloh4:
	ldr	x8, [x8, _AVERROR_EOF@GOTPAGEOFF]
Lloh5:
	ldr	w0, [x8]
	b	LBB0_14
LBB0_10:
	ldr	x8, [x22, #8]
	add	x8, x8, #1
	str	x8, [x22, #8]
LBB0_11:
	mov	x0, x20
	mov	x1, x19
	mov	x2, x21
	bl	_av_get_packet
	tbnz	w0, #31, LBB0_14
; %bb.12:
	cmp	w0, w21
	b.ne	LBB0_15
; %bb.13:
	mov	w0, #0
	ldr	w8, [x22, #28]
	str	w8, [x19, #12]
LBB0_14:
	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_15:
	mov	x0, x19
	bl	_av_packet_unref
Lloh6:
	adrp	x8, _EIO@GOTPAGE
Lloh7:
	ldr	x8, [x8, _EIO@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	_AVERROR_EOF,4,2                ; @AVERROR_EOF
	.comm	_SEEK_SET,4,2                   ; @SEEK_SET
	.comm	_EIO,4,2                        ; @EIO
	.no_dead_strip	_thp_read_packet
.subsections_via_symbols
