	.file	"extr_mpga_packetizer.c_mpga_packetizer_packetize.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"lost sync"
.LC1:
	.string	"invalid header"
.LC2:
	.string	"free format not supported"
.LC3:
	.string	"invalid next header"
.LC4:
	.string	"recovered sync after %i bytes"
	.text
	.p2align 4
	.type	mpga_packetizer_packetize, @function
mpga_packetizer_packetize:
.LFB0:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	push	r15
	push	r14
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	mov	r14, rsi
	push	r13
	push	r12
	push	rbx
	sub	rsp, 72
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	mov	DWORD PTR -84[rbp], edx
	mov	rcx, rsp
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -56[rbp], rax
	xor	eax, eax
	mov	rax, QWORD PTR [rdi]
	mov	QWORD PTR -96[rbp], rax
	mov	rbx, QWORD PTR 8[rax]
	lea	r13, 4[rax]
	movsx	rax, DWORD PTR MPGA_HEADER_SIZE[rip]
	lea	rax, 15[0+rax*4]
	mov	rdx, rax
	and	rax, -4096
	sub	rcx, rax
	and	rdx, -16
	mov	rax, rcx
	cmp	rsp, rax
	je	.L3
.L56:
	sub	rsp, 4096
	or	QWORD PTR 4088[rsp], 0
	cmp	rsp, rax
	jne	.L56
.L3:
	and	edx, 4095
	sub	rsp, rdx
	test	rdx, rdx
	jne	.L57
.L4:
	lea	rcx, -68[rbp]
	mov	eax, DWORD PTR [rbx]
	mov	r12, rsp
	lea	r15, .L8[rip]
	mov	QWORD PTR -104[rbp], rcx
	.p2align 4,,10
	.p2align 3
.L5:
	add	eax, -128
.L6:
	cmp	eax, 5
	ja	.L6
	mov	eax, eax
	movsx	rax, DWORD PTR [r15+rax*4]
	add	rax, r15
	notrack jmp	rax
	.section	.rodata
	.align 4
	.align 4
.L8:
	.long	.L13-.L8
	.long	.L12-.L8
	.long	.L11-.L8
	.long	.L16-.L8
	.long	.L9-.L8
	.long	.L7-.L8
	.text
	.p2align 4,,10
	.p2align 3
.L18:
	cmp	DWORD PTR [r12], 255
	jne	.L17
	mov	eax, DWORD PTR 4[r12]
	and	eax, 224
	cmp	eax, 224
	je	.L58
.L17:
	mov	rdi, r13
	call	bytestream_skip_byte@PLT
	add	DWORD PTR 56[rbx], 1
.L16:
	mov	edx, 2
	mov	rsi, r12
	mov	rdi, r13
	call	bytestream_peek@PLT
	cmp	eax, DWORD PTR VC_CONTAINER_SUCCESS[rip]
	je	.L18
	cmp	DWORD PTR [rbx], 132
	jne	.L54
.L9:
	mov	edx, DWORD PTR MPGA_HEADER_SIZE[rip]
	mov	rsi, r12
	mov	rdi, r13
	call	bytestream_peek@PLT
	cmp	eax, DWORD PTR VC_CONTAINER_SUCCESS[rip]
	jne	.L54
	sub	rsp, 8
	lea	rax, 48[rbx]
	lea	rcx, 4[rbx]
	mov	rdi, r12
	push	rax
	lea	rax, 20[rbx]
	lea	rdx, 64[rbx]
	push	rax
	lea	rax, 60[rbx]
	lea	rsi, 24[rbx]
	push	rax
	lea	r9, 40[rbx]
	lea	r8, 8[rbx]
	call	mpga_read_header@PLT
	add	rsp, 32
	cmp	DWORD PTR VC_CONTAINER_SUCCESS[rip], eax
	jne	.L30
	mov	eax, DWORD PTR 12[rbx]
	test	eax, eax
	je	.L23
	cmp	eax, DWORD PTR 4[rbx]
	je	.L23
.L30:
	lea	rsi, .LC1[rip]
	xor	edi, edi
	call	LOG_ERROR@PLT
	mov	DWORD PTR [rbx], 129
	mov	eax, 129
	jmp	.L5
.L29:
	mov	eax, DWORD PTR -72[rbp]
	cmp	DWORD PTR 4[rbx], eax
	jne	.L30
	mov	eax, DWORD PTR -68[rbp]
	cmp	DWORD PTR 8[rbx], eax
	jne	.L30
	mov	DWORD PTR [rbx], 130
	.p2align 4,,10
	.p2align 3
.L11:
	mov	edx, DWORD PTR 56[rbx]
	test	edx, edx
	jne	.L59
.L32:
	mov	DWORD PTR 56[rbx], 0
	mov	rsi, QWORD PTR 48[rbx]
	mov	rdi, r13
	call	bytestream_skip@PLT
	mov	rax, QWORD PTR 4[rbx]
	mov	r15, QWORD PTR -96[rbp]
	mov	edx, 1
	mov	esi, DWORD PTR 40[rbx]
	mov	QWORD PTR 12[rbx], rax
	mov	rdi, r15
	call	vc_container_time_set_samplerate@PLT
	lea	rdx, -60[rbp]
	lea	rsi, -64[rbp]
	mov	rdi, r13
	mov	ecx, 1
	call	bytestream_get_timestamps@PLT
	mov	esi, DWORD PTR -64[rbp]
	mov	rdi, r15
	call	vc_container_time_set@PLT
	mov	QWORD PTR 32[rbx], 0
	mov	DWORD PTR [rbx], 133
.L7:
	mov	rdi, r13
	call	bytestream_size@PLT
	mov	r8, rax
	mov	rax, QWORD PTR 24[rbx]
	cmp	r8, rax
	jl	.L54
	mov	rdx, QWORD PTR 32[rbx]
	sub	rax, rdx
	mov	QWORD PTR [r14], rax
	mov	eax, DWORD PTR VC_CONTAINER_TIME_UNKNOWN[rip]
	mov	DWORD PTR 20[r14], eax
	mov	DWORD PTR 24[r14], eax
	mov	eax, DWORD PTR VC_CONTAINER_PACKET_FLAG_FRAME_END[rip]
	mov	DWORD PTR 16[r14], eax
	test	rdx, rdx
	je	.L60
.L34:
	mov	eax, DWORD PTR -84[rbp]
	test	DWORD PTR VC_PACKETIZER_FLAG_INFO[rip], eax
	jne	.L38
	mov	rdi, QWORD PTR [r14]
	mov	eax, DWORD PTR -84[rbp]
	test	DWORD PTR VC_PACKETIZER_FLAG_SKIP[rip], eax
	je	.L36
	mov	rsi, rdi
	mov	rdi, r13
	call	bytestream_skip@PLT
.L37:
	mov	rax, QWORD PTR [r14]
	add	rax, QWORD PTR 32[rbx]
	mov	QWORD PTR 32[rbx], rax
	cmp	rax, QWORD PTR 24[rbx]
	je	.L61
.L38:
	mov	eax, DWORD PTR VC_CONTAINER_SUCCESS[rip]
.L1:
	mov	rcx, QWORD PTR -56[rbp]
	xor	rcx, QWORD PTR fs:40
	jne	.L62
	lea	rsp, -40[rbp]
	pop	rbx
	pop	r12
	pop	r13
	pop	r14
	pop	r15
	pop	rbp
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
	.p2align 4,,10
	.p2align 3
.L12:
	.cfi_restore_state
	mov	rdi, r13
	call	bytestream_skip_byte@PLT
	mov	eax, DWORD PTR 56[rbx]
	lea	edx, 1[rax]
	mov	DWORD PTR 56[rbx], edx
	test	eax, eax
	je	.L63
.L15:
	mov	DWORD PTR [rbx], 131
	jmp	.L16
	.p2align 4,,10
	.p2align 3
.L13:
	mov	rsi, QWORD PTR 24[rbx]
.L14:
	mov	ecx, DWORD PTR MPGA_HEADER_SIZE[rip]
	mov	rdx, r12
	mov	rdi, r13
	call	bytestream_peek_at@PLT
	cmp	eax, DWORD PTR VC_CONTAINER_SUCCESS[rip]
	je	.L27
	mov	eax, DWORD PTR -84[rbp]
	test	DWORD PTR VC_PACKETIZER_FLAG_FLUSH[rip], eax
	je	.L54
	mov	DWORD PTR [rbx], 130
	mov	eax, 130
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L23:
	mov	eax, DWORD PTR 16[rbx]
	test	eax, eax
	je	.L25
	cmp	eax, DWORD PTR 8[rbx]
	jne	.L30
.L25:
	mov	rsi, QWORD PTR 24[rbx]
	test	rsi, rsi
	je	.L64
	mov	DWORD PTR [rbx], 128
	jmp	.L14
	.p2align 4,,10
	.p2align 3
.L54:
	mov	eax, DWORD PTR VC_CONTAINER_ERROR_INCOMPLETE_DATA[rip]
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L58:
	mov	DWORD PTR [rbx], 132
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L60:
	mov	rdi, QWORD PTR -96[rbp]
	call	vc_container_time_get@PLT
	mov	DWORD PTR 20[r14], eax
	mov	DWORD PTR 24[r14], eax
	mov	eax, DWORD PTR VC_CONTAINER_PACKET_FLAG_FRAME_START[rip]
	or	DWORD PTR 16[r14], eax
	jmp	.L34
	.p2align 4,,10
	.p2align 3
.L36:
	mov	esi, DWORD PTR 12[r14]
	call	MIN@PLT
	mov	esi, DWORD PTR 8[r14]
	mov	rdi, r13
	mov	QWORD PTR [r14], rax
	mov	rdx, rax
	call	bytestream_get@PLT
	jmp	.L37
	.p2align 4,,10
	.p2align 3
.L57:
	or	QWORD PTR -8[rsp+rdx], 0
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L63:
	lea	rsi, .LC0[rip]
	xor	edi, edi
	call	LOG_DEBUG@PLT
	jmp	.L15
	.p2align 4,,10
	.p2align 3
.L59:
	lea	rsi, .LC4[rip]
	xor	edi, edi
	xor	eax, eax
	call	LOG_DEBUG@PLT
	jmp	.L32
	.p2align 4,,10
	.p2align 3
.L27:
	sub	rsp, 8
	mov	r8, QWORD PTR -104[rbp]
	xor	r9d, r9d
	xor	edx, edx
	push	0
	xor	esi, esi
	lea	rcx, -72[rbp]
	mov	rdi, r12
	push	0
	push	0
	call	mpga_read_header@PLT
	add	rsp, 32
	cmp	DWORD PTR VC_CONTAINER_SUCCESS[rip], eax
	je	.L29
	lea	rsi, .LC3[rip]
	xor	edi, edi
	call	LOG_ERROR@PLT
	mov	DWORD PTR [rbx], 129
	mov	eax, 129
	jmp	.L5
.L64:
	lea	rsi, .LC2[rip]
	xor	edi, edi
	call	LOG_ERROR@PLT
	mov	DWORD PTR [rbx], 129
	mov	eax, 129
	jmp	.L5
.L61:
	mov	esi, DWORD PTR 20[rbx]
	mov	rdi, QWORD PTR -96[rbp]
	call	vc_container_time_add@PLT
	mov	DWORD PTR [rbx], 132
	jmp	.L38
.L62:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	mpga_packetizer_packetize, .-mpga_packetizer_packetize
	.comm	VC_PACKETIZER_FLAG_SKIP,4,4
	.comm	VC_PACKETIZER_FLAG_INFO,4,4
	.comm	VC_PACKETIZER_FLAG_FLUSH,4,4
	.comm	VC_CONTAINER_TIME_UNKNOWN,4,4
	.comm	VC_CONTAINER_SUCCESS,4,4
	.comm	VC_CONTAINER_PACKET_FLAG_FRAME_START,4,4
	.comm	VC_CONTAINER_PACKET_FLAG_FRAME_END,4,4
	.comm	VC_CONTAINER_ERROR_INCOMPLETE_DATA,4,4
	.comm	MPGA_HEADER_SIZE,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_mpga_packetizer.c_mpga_packetizer_packetize.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"lost sync\000"
	.align	2
.LC1:
	.ascii	"invalid header\000"
	.align	2
.LC2:
	.ascii	"free format not supported\000"
	.align	2
.LC3:
	.ascii	"invalid next header\000"
	.align	2
.LC4:
	.ascii	"recovered sync after %i bytes\000"
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC5:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	mpga_packetizer_packetize, %function
mpga_packetizer_packetize:
	@ args = 0, pretend = 0, frame = 32
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	add	fp, sp, #32
	sub	sp, sp, #60
	mov	r8, r1
	ldr	r3, .L65
	ldr	r10, .L65+4
	str	r2, [fp, #-64]
	ldr	r3, [r3]
	str	r3, [fp, #-40]
	mov	r3,#0
	ldr	r3, [r10]
	ldr	r9, [r0]
	lsl	r3, r3, #2
	ldr	r4, [r9, #8]
	add	r3, r3, #7
	bic	r3, r3, #7
	sub	sp, sp, r3
	ldr	r7, .L65+8
	ldr	r3, [r4]
	add	r5, sp, #24
	add	r6, r9, #4
.L2:
	sub	r3, r3, #128
.L3:
	cmp	r3, #5
	ldrls	pc, [pc, r3, asl #2]
	b	.L3
.L5:
	.word	.L10
	.word	.L9
	.word	.L8
	.word	.L13
	.word	.L6
	.word	.L4
.L15:
	ldr	r3, [r5]
	cmp	r3, #255
	bne	.L14
	ldr	r3, [r5, #4]
	and	r3, r3, #224
	cmp	r3, #224
	beq	.L58
.L14:
	mov	r0, r6
	bl	bytestream_skip_byte
	ldr	r3, [r4, #40]
	add	r3, r3, #1
	str	r3, [r4, #40]
.L13:
	mov	r2, #2
	mov	r1, r5
	mov	r0, r6
	bl	bytestream_peek
	ldr	r3, [r7]
	cmp	r0, r3
	beq	.L15
	ldr	r3, [r4]
	cmp	r3, #132
	bne	.L56
.L6:
	mov	r1, r5
	mov	r0, r6
	ldr	r2, [r10]
	bl	bytestream_peek
	ldr	r3, [r7]
	cmp	r0, r3
	bne	.L56
	add	ip, r4, #36
	add	r0, r4, #20
	add	r1, r4, #44
	add	r2, r4, #32
	add	r3, r4, #8
	str	r0, [sp, #12]
	str	r1, [sp, #8]
	str	r2, [sp, #4]
	str	r3, [sp]
	mov	r0, r5
	add	r3, r4, #4
	str	ip, [sp, #16]
	add	r2, r4, #48
	add	r1, r4, #24
	bl	mpga_read_header
	ldr	r3, [r7]
	cmp	r3, r0
	bne	.L27
	ldr	r3, [r4, #12]
	cmp	r3, #0
	bne	.L59
.L20:
	ldr	r3, [r4, #16]
	cmp	r3, #0
	beq	.L22
	ldr	r2, [r4, #8]
	cmp	r3, r2
	beq	.L22
.L27:
	mov	r0, #0
	ldr	r1, .L65+12
	bl	LOG_ERROR
	mov	r3, #129
	str	r3, [r4]
	b	.L2
.L26:
	ldr	r2, [r4, #4]
	ldr	r3, [fp, #-56]
	cmp	r2, r3
	bne	.L27
	ldr	r2, [r4, #8]
	ldr	r3, [fp, #-52]
	cmp	r2, r3
	bne	.L27
	mov	r3, #130
	str	r3, [r4]
.L8:
	ldr	r2, [r4, #40]
	cmp	r2, #0
	bne	.L60
.L29:
	mov	r5, #0
	ldr	r1, [r4, #36]
	mov	r0, r6
	str	r5, [r4, #40]
	bl	bytestream_skip
	ldmib	r4, {r2, r3}
	ldr	r1, [r4, #32]
	str	r2, [r4, #12]
	str	r3, [r4, #16]
	mov	r2, #1
	mov	r0, r9
	bl	vc_container_time_set_samplerate
	mov	r3, #1
	sub	r2, fp, #44
	sub	r1, fp, #48
	mov	r0, r6
	bl	bytestream_get_timestamps
	mov	r0, r9
	ldr	r1, [fp, #-48]
	bl	vc_container_time_set
	mov	r3, #133
	str	r5, [r4, #28]
	str	r3, [r4]
.L4:
	mov	r0, r6
	bl	bytestream_size
	ldr	r3, [r4, #24]
	cmp	r0, r3
	blt	.L56
	ldr	r2, .L65+16
	ldr	r0, .L65+20
	ldr	r1, [r4, #28]
	ldr	r2, [r2]
	ldr	r0, [r0]
	sub	r3, r3, r1
	cmp	r1, #0
	str	r2, [r8, #16]
	str	r2, [r8, #20]
	str	r3, [r8]
	str	r0, [r8, #12]
	beq	.L61
.L31:
	ldr	r3, .L65+24
	ldr	r2, [fp, #-64]
	ldr	r3, [r3]
	tst	r2, r3
	bne	.L35
	ldr	r3, .L65+28
	ldr	r2, [fp, #-64]
	ldr	r3, [r3]
	ldr	r1, [r8]
	tst	r2, r3
	beq	.L33
	mov	r0, r6
	bl	bytestream_skip
.L34:
	ldr	r1, [r8]
	ldr	r3, [r4, #28]
	ldr	r2, [r4, #24]
	add	r3, r3, r1
	cmp	r3, r2
	str	r3, [r4, #28]
	beq	.L62
.L35:
	ldr	r3, .L65+8
	ldr	r0, [r3]
.L1:
	ldr	r3, .L65
	ldr	r2, [r3]
	ldr	r3, [fp, #-40]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L63
	sub	sp, fp, #32
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L9:
	mov	r0, r6
	bl	bytestream_skip_byte
	ldr	r0, [r4, #40]
	add	r3, r0, #1
	cmp	r0, #0
	str	r3, [r4, #40]
	beq	.L64
.L12:
	mov	r3, #131
	str	r3, [r4]
	b	.L13
.L10:
	ldr	r1, [r4, #24]
.L11:
	ldr	r3, [r10]
	mov	r2, r5
	mov	r0, r6
	bl	bytestream_peek_at
	ldr	r3, [r7]
	cmp	r0, r3
	beq	.L24
	ldr	r3, .L65+32
	ldr	r2, [fp, #-64]
	ldr	r3, [r3]
	tst	r2, r3
	beq	.L56
	mov	r3, #130
	str	r3, [r4]
	b	.L2
.L59:
	ldr	r2, [r4, #4]
	cmp	r3, r2
	bne	.L27
	b	.L20
.L61:
	mov	r0, r9
	bl	vc_container_time_get
	ldr	r2, .L65+36
	ldr	r3, [r8, #12]
	ldr	r2, [r2]
	str	r0, [r8, #16]
	orr	r3, r3, r2
	str	r0, [r8, #20]
	str	r3, [r8, #12]
	b	.L31
.L22:
	ldr	r1, [r4, #24]
	cmp	r1, #0
	movne	r3, #128
	strne	r3, [r4]
	bne	.L11
	mov	r0, r1
	ldr	r1, .L65+40
	bl	LOG_ERROR
	mov	r3, #129
	str	r3, [r4]
	b	.L2
.L56:
	ldr	r3, .L65+44
	ldr	r0, [r3]
	b	.L1
.L58:
	mov	r3, #132
	str	r3, [r4]
	b	.L6
.L33:
	mov	r0, r1
	ldr	r1, [r8, #8]
	bl	MIN
	mov	r2, r0
	ldr	r1, [r8, #4]
	mov	r0, r6
	str	r2, [r8]
	bl	bytestream_get
	b	.L34
.L62:
	mov	r0, r9
	ldr	r1, [r4, #20]
	bl	vc_container_time_add
	mov	r3, #132
	str	r3, [r4]
	b	.L35
.L64:
	ldr	r1, .L65+48
	bl	LOG_DEBUG
	b	.L12
.L60:
	ldr	r1, .L65+52
	mov	r0, #0
	bl	LOG_DEBUG
	b	.L29
.L24:
	mov	r2, #0
	sub	r3, fp, #52
	str	r3, [sp]
	mov	r1, r2
	sub	r3, fp, #56
	mov	r0, r5
	str	r2, [sp, #16]
	str	r2, [sp, #12]
	str	r2, [sp, #8]
	str	r2, [sp, #4]
	bl	mpga_read_header
	ldr	r3, [r7]
	cmp	r3, r0
	beq	.L26
	mov	r2, #0
	ldr	r1, .L65+56
	mov	r0, r2
	bl	LOG_ERROR
	mov	r3, #129
	str	r3, [r4]
	b	.L2
.L63:
	bl	__stack_chk_fail
.L66:
	.align	2
.L65:
	.word	.LC5
	.word	MPGA_HEADER_SIZE
	.word	VC_CONTAINER_SUCCESS
	.word	.LC1
	.word	VC_CONTAINER_TIME_UNKNOWN
	.word	VC_CONTAINER_PACKET_FLAG_FRAME_END
	.word	VC_PACKETIZER_FLAG_INFO
	.word	VC_PACKETIZER_FLAG_SKIP
	.word	VC_PACKETIZER_FLAG_FLUSH
	.word	VC_CONTAINER_PACKET_FLAG_FRAME_START
	.word	.LC2
	.word	VC_CONTAINER_ERROR_INCOMPLETE_DATA
	.word	.LC0
	.word	.LC4
	.word	.LC3
	.size	mpga_packetizer_packetize, .-mpga_packetizer_packetize
	.comm	VC_PACKETIZER_FLAG_SKIP,4,4
	.comm	VC_PACKETIZER_FLAG_INFO,4,4
	.comm	VC_PACKETIZER_FLAG_FLUSH,4,4
	.comm	VC_CONTAINER_TIME_UNKNOWN,4,4
	.comm	VC_CONTAINER_SUCCESS,4,4
	.comm	VC_CONTAINER_PACKET_FLAG_FRAME_START,4,4
	.comm	VC_CONTAINER_PACKET_FLAG_FRAME_END,4,4
	.comm	VC_CONTAINER_ERROR_INCOMPLETE_DATA,4,4
	.comm	MPGA_HEADER_SIZE,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
