	.file	"extr_mpegts.c_mpegts_read_packet.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	mpegts_read_packet, @function
mpegts_read_packet:
.LFB0:
	.cfi_startproc
	endbr64
	push	r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	push	rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	push	rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	mov	rbp, QWORD PTR [rdi]
	mov	rbx, rsi
	mov	DWORD PTR [rsi], -1
	mov	QWORD PTR 8[rbp], rsi
	mov	rdi, rbp
	xor	esi, esi
	call	handle_packets@PLT
	mov	r12d, eax
	test	eax, eax
	js	.L14
	jne	.L1
.L5:
	mov	r12d, DWORD PTR [rbx]
	sar	r12d, 31
	and	r12d, DWORD PTR AVERROR_INVALIDDATA[rip]
.L1:
	mov	eax, r12d
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	pop	rbp
	.cfi_def_cfa_offset 16
	pop	r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L14:
	.cfi_restore_state
	mov	rdi, QWORD PTR 8[rbp]
	call	av_packet_unref@PLT
	mov	edx, DWORD PTR NB_PID_MAX[rip]
	test	edx, edx
	jle	.L1
	mov	rax, QWORD PTR 0[rbp]
	sub	edx, 1
	mov	rsi, QWORD PTR MPEGTS_PES[rip]
	mov	rdi, QWORD PTR MPEGTS_PAYLOAD[rip]
	lea	rcx, 8[rax+rdx*8]
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L4:
	add	rax, 8
	cmp	rcx, rax
	je	.L1
.L6:
	mov	rdx, QWORD PTR [rax]
	test	rdx, rdx
	je	.L4
	cmp	QWORD PTR [rdx], rsi
	jne	.L4
	mov	rbp, QWORD PTR 8[rdx]
	cmp	QWORD PTR 0[rbp], rdi
	jne	.L4
	cmp	QWORD PTR 8[rbp], 0
	jle	.L4
	mov	rsi, rbx
	mov	rdi, rbp
	call	new_pes_packet@PLT
	mov	r12d, eax
	test	eax, eax
	js	.L1
	mov	rax, QWORD PTR MPEGTS_SKIP[rip]
	mov	QWORD PTR 0[rbp], rax
	jmp	.L5
	.cfi_endproc
.LFE0:
	.size	mpegts_read_packet, .-mpegts_read_packet
	.comm	NB_PID_MAX,4,4
	.comm	MPEGTS_SKIP,8,8
	.comm	MPEGTS_PES,8,8
	.comm	MPEGTS_PAYLOAD,8,8
	.comm	AVERROR_INVALIDDATA,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	 1f - 0f
	.long	 4f - 1f
	.long	 5
0:
	.string	 "GNU"
1:
	.align 8
	.long	 0xc0000002
	.long	 3f - 2f
2:
	.long	 0x3
3:
	.align 8
4:

	.arch armv5t
	.eabi_attribute 20, 1
	.eabi_attribute 21, 1
	.eabi_attribute 23, 3
	.eabi_attribute 24, 1
	.eabi_attribute 25, 1
	.eabi_attribute 26, 2
	.eabi_attribute 30, 2
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"extr_mpegts.c_mpegts_read_packet.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	mpegts_read_packet, %function
mpegts_read_packet:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, lr}
	mvn	r3, #0
	mov	r6, r1
	ldr	r5, [r0]
	mov	r1, #0
	str	r3, [r6]
	mov	r0, r5
	str	r6, [r5, #4]
	bl	handle_packets
	subs	r7, r0, #0
	blt	.L14
	bne	.L1
.L5:
	ldr	r3, [r6]
	cmp	r3, #0
	movge	r7, #0
	ldrlt	r3, .L15
	ldrlt	r7, [r3]
.L1:
	mov	r0, r7
	pop	{r4, r5, r6, r7, r8, pc}
.L14:
	ldr	r0, [r5, #4]
	bl	av_packet_unref
	ldr	r3, .L15+4
	ldr	r4, [r3]
	cmp	r4, #0
	ble	.L1
	ldr	r1, .L15+8
	ldr	ip, [r5]
	ldr	r2, .L15+12
	ldr	r5, [r1]
	mov	r3, #0
	ldr	r1, [r2]
	sub	ip, ip, #4
	b	.L6
.L4:
	cmp	r4, r3
	beq	.L1
.L6:
	ldr	r2, [ip, #4]!
	add	r3, r3, #1
	cmp	r2, #0
	beq	.L4
	ldr	lr, [r2]
	cmp	lr, r5
	bne	.L4
	ldr	r8, [r2, #4]
	ldr	r2, [r8]
	cmp	r2, r1
	bne	.L4
	ldr	r2, [r8, #4]
	cmp	r2, #0
	ble	.L4
	mov	r1, r6
	mov	r0, r8
	bl	new_pes_packet
	subs	r7, r0, #0
	blt	.L1
	ldr	r3, .L15+16
	ldr	r3, [r3]
	str	r3, [r8]
	b	.L5
.L16:
	.align	2
.L15:
	.word	AVERROR_INVALIDDATA
	.word	NB_PID_MAX
	.word	MPEGTS_PES
	.word	MPEGTS_PAYLOAD
	.word	MPEGTS_SKIP
	.size	mpegts_read_packet, .-mpegts_read_packet
	.comm	NB_PID_MAX,4,4
	.comm	MPEGTS_SKIP,4,4
	.comm	MPEGTS_PES,4,4
	.comm	MPEGTS_PAYLOAD,4,4
	.comm	AVERROR_INVALIDDATA,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
