	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mpegts_raw_read_packet
_mpegts_raw_read_packet:                ## @mpegts_raw_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	%r13
	pushq	%r12
	pushq	%rbx
	subq	$88, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movq	%rdi, %r13
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	8(%rdi), %r15
	movq	_TS_PACKET_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_av_new_packet
	testq	%rax, %rax
	js	LBB0_1
## %bb.3:
	movq	16(%r14), %rsi
	movl	(%r15), %edx
	leaq	-128(%rbp), %rcx
	movq	%r13, %rdi
	callq	_read_packet
	movl	%eax, %ebx
	movl	(%r13), %edi
	callq	_avio_tell
	movq	%rax, 24(%r14)
	testl	%ebx, %ebx
	js	LBB0_4
## %bb.5:
	movq	-128(%rbp), %rsi
	movq	16(%r14), %rdi
	cmpq	%rdi, %rsi
	je	LBB0_7
## %bb.6:
	movl	(%r15), %edx
	callq	_memcpy
LBB0_7:
	movl	(%r15), %esi
	movq	%r13, %rdi
	callq	_finished_reading_packet
	cmpq	$0, 16(%r15)
	je	LBB0_17
## %bb.8:
	movq	16(%r14), %rdx
	leaq	-104(%rbp), %rdi
	leaq	-100(%rbp), %rsi
	callq	_parse_pcr
	testq	%rax, %rax
	je	LBB0_10
## %bb.9:
	movl	8(%r15), %eax
	jmp	LBB0_16
LBB0_1:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_20
## %bb.2:
	addq	$88, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_AVERROR                        ## TAILCALL
LBB0_4:
	movq	%r14, %rdi
	callq	_av_packet_unref
	jmp	LBB0_18
LBB0_10:
	movl	(%r13), %edi
	callq	_avio_tell
	movq	%rax, -120(%rbp)                ## 8-byte Spill
	movq	_MAX_PACKET_READAHEAD@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	jle	LBB0_15
## %bb.11:
	movl	$1, %ebx
	leaq	-96(%rbp), %r12
	.p2align	4, 0x90
LBB0_12:                                ## =>This Inner Loop Header: Depth=1
	leal	-1(%rbx), %esi
	movl	(%r13), %edi
	imull	(%r15), %esi
	addl	-120(%rbp), %esi                ## 4-byte Folded Reload
	movq	_SEEK_SET@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_avio_seek
	movl	(%r13), %edi
	movq	%r12, %rsi
	movl	$12, %edx
	callq	_avio_read
	leaq	-112(%rbp), %rdi
	leaq	-108(%rbp), %rsi
	movq	%r12, %rdx
	callq	_parse_pcr
	testq	%rax, %rax
	je	LBB0_13
## %bb.14:                              ##   in Loop: Header=BB0_12 Depth=1
	leal	1(%rbx), %eax
	movq	_MAX_PACKET_READAHEAD@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %ebx
	movl	%eax, %ebx
	jl	LBB0_12
	jmp	LBB0_15
LBB0_13:
	movl	-112(%rbp), %eax
	subl	-104(%rbp), %eax
	imull	$300, %eax, %ecx                ## imm = 0x12C
	movl	-108(%rbp), %eax
	subl	-100(%rbp), %eax
	addl	%ecx, %eax
	cltd
	idivl	%ebx
	movl	%eax, 4(%r15)
LBB0_15:
	movl	(%r13), %edi
	movq	_SEEK_SET@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	-120(%rbp), %rsi                ## 8-byte Reload
                                        ## kill: def $esi killed $esi killed $rsi
	callq	_avio_seek
	imull	$300, -104(%rbp), %eax          ## imm = 0x12C
	addl	-100(%rbp), %eax
LBB0_16:
	movl	%eax, (%r14)
	movl	4(%r15), %ecx
	movl	%ecx, 4(%r14)
	addl	%eax, %ecx
	movl	%ecx, 8(%r15)
LBB0_17:
	movq	$0, 8(%r14)
	xorl	%ebx, %ebx
LBB0_18:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_20
## %bb.19:
	movl	%ebx, %eax
	addq	$88, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_20:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_TS_PACKET_SIZE,4,2             ## @TS_PACKET_SIZE
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_MAX_PACKET_READAHEAD,4,2       ## @MAX_PACKET_READAHEAD
	.comm	_SEEK_SET,4,2                   ## @SEEK_SET
	.no_dead_strip	_mpegts_raw_read_packet
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mpegts_raw_read_packet
_mpegts_raw_read_packet:                ; @mpegts_raw_read_packet
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #160
	.cfi_def_cfa_offset 160
	stp	x26, x25, [sp, #80]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #96]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #112]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #128]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #144]            ; 16-byte Folded Spill
	add	x29, sp, #144
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x19, x1
	mov	x20, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [sp, #72]
	ldr	x22, [x0, #8]
Lloh3:
	adrp	x8, _TS_PACKET_SIZE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _TS_PACKET_SIZE@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_av_new_packet
	tbnz	x0, #63, LBB0_7
; %bb.1:
	ldr	x1, [x19, #16]
	ldr	w2, [x22]
	mov	x3, sp
	mov	x0, x20
	bl	_read_packet
	mov	x21, x0
	ldr	w0, [x20]
	bl	_avio_tell
	str	x0, [x19, #24]
	tbnz	w21, #31, LBB0_9
; %bb.2:
	ldr	x1, [sp]
	ldr	x0, [x19, #16]
	cmp	x1, x0
	b.eq	LBB0_4
; %bb.3:
	ldr	w2, [x22]
	bl	_memcpy
LBB0_4:
	ldr	w1, [x22]
	mov	x0, x20
	bl	_finished_reading_packet
	ldr	x8, [x22, #16]
	cbz	x8, LBB0_17
; %bb.5:
	ldr	x2, [x19, #16]
	add	x0, sp, #20
	add	x1, sp, #12
	bl	_parse_pcr
	cbz	x0, LBB0_10
; %bb.6:
	ldr	w8, [x22, #8]
	b	LBB0_16
LBB0_7:
Lloh6:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh7:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh8:
	ldr	w0, [x8]
	ldr	x8, [sp, #72]
Lloh9:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh10:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh11:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_20
; %bb.8:
	ldp	x29, x30, [sp, #144]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #128]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #112]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #96]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #80]             ; 16-byte Folded Reload
	add	sp, sp, #160
	b	_AVERROR
LBB0_9:
	mov	x0, x19
	bl	_av_packet_unref
	b	LBB0_18
LBB0_10:
	ldr	w0, [x20]
	bl	_avio_tell
	mov	x21, x0
Lloh12:
	adrp	x25, _MAX_PACKET_READAHEAD@GOTPAGE
Lloh13:
	ldr	x25, [x25, _MAX_PACKET_READAHEAD@GOTPAGEOFF]
	ldr	w8, [x25]
Lloh14:
	adrp	x23, _SEEK_SET@GOTPAGE
Lloh15:
	ldr	x23, [x23, _SEEK_SET@GOTPAGEOFF]
	cmp	w8, #1
	b.lt	LBB0_15
; %bb.11:
	mov	w24, #1
LBB0_12:                                ; =>This Inner Loop Header: Depth=1
	sub	w8, w24, #1
	ldr	w0, [x20]
	ldr	w9, [x22]
	madd	w1, w9, w8, w21
	ldr	w2, [x23]
	bl	_avio_seek
	ldr	w0, [x20]
	add	x1, sp, #24
	mov	w2, #12
	bl	_avio_read
	add	x0, sp, #16
	add	x1, sp, #8
	add	x2, sp, #24
	bl	_parse_pcr
	cbz	x0, LBB0_14
; %bb.13:                               ;   in Loop: Header=BB0_12 Depth=1
	ldr	w8, [x25]
	add	w9, w24, #1
	cmp	w24, w8
	mov	x24, x9
	b.lt	LBB0_12
	b	LBB0_15
LBB0_14:
	ldp	w8, w9, [sp, #16]
	sub	w8, w8, w9
	mov	w9, #300
	ldp	w10, w11, [sp, #8]
	sub	w10, w10, w11
	madd	w8, w8, w9, w10
	sdiv	w8, w8, w24
	str	w8, [x22, #4]
LBB0_15:
	ldr	w0, [x20]
	ldr	w2, [x23]
	mov	x1, x21
	bl	_avio_seek
	ldr	w8, [sp, #20]
	mov	w9, #300
	ldr	w10, [sp, #12]
	madd	w8, w8, w9, w10
LBB0_16:
	str	w8, [x19]
	ldr	w9, [x22, #4]
	str	w9, [x19, #4]
	add	w8, w9, w8
	str	w8, [x22, #8]
LBB0_17:
	mov	w21, #0
	str	xzr, [x19, #8]
LBB0_18:
	ldr	x8, [sp, #72]
Lloh16:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh17:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh18:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_20
; %bb.19:
	mov	x0, x21
	ldp	x29, x30, [sp, #144]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #128]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #112]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #96]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #80]             ; 16-byte Folded Reload
	add	sp, sp, #160
	ret
LBB0_20:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.comm	_TS_PACKET_SIZE,4,2             ; @TS_PACKET_SIZE
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_MAX_PACKET_READAHEAD,4,2       ; @MAX_PACKET_READAHEAD
	.comm	_SEEK_SET,4,2                   ; @SEEK_SET
	.no_dead_strip	_mpegts_raw_read_packet
.subsections_via_symbols
