	.file	"extr_telx.c_DecodePageHeaderPacket.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"ERASE !"
	.text
	.p2align 4
	.type	DecodePageHeaderPacket, @function
DecodePageHeaderPacket:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	mov	r14, rsi
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	xor	r13d, r13d
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	mov	r12d, edx
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	xor	ebx, ebx
	sub	rsp, 280
	.cfi_def_cfa_offset 336
	mov	rbp, QWORD PTR [rdi]
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 264[rsp], rax
	xor	eax, eax
	.p2align 4,,10
	.p2align 3
.L2:
	mov	edi, DWORD PTR 32[r14+r13]
	call	hamming_8_4@PLT
	mov	edi, eax
	call	bytereverse@PLT
	mov	ecx, r13d
	add	r13, 4
	sar	eax, 4
	and	eax, 15
	sal	eax, cl
	or	ebx, eax
	cmp	r13, 24
	jne	.L2
	mov	edi, DWORD PTR 28[r14]
	movsx	r15, r12d
	call	hamming_8_4@PLT
	mov	edi, eax
	call	bytereverse@PLT
	mov	edi, DWORD PTR 24[r14]
	mov	r13d, eax
	call	hamming_8_4@PLT
	and	r13d, 240
	mov	edi, eax
	call	bytereverse@PLT
	mov	rdx, QWORD PTR 0[rbp]
	lea	r8, 56[r14]
	mov	ecx, r12d
	sar	eax, 4
	mov	r9d, 26
	mov	esi, 256
	and	eax, 15
	or	eax, r13d
	mov	r13, rsp
	mov	DWORD PTR [rdx+r15*4], eax
	mov	rdi, r13
	mov	rdx, rbp
	call	decode_string@PLT
	mov	rdi, r13
	call	dbg@PLT
	mov	eax, ebx
	mov	rdx, QWORD PTR ppi_national_subsets[rip]
	sar	eax, 21
	cdqe
	mov	edx, DWORD PTR [rdx+rax*4]
	mov	rax, QWORD PTR 56[rbp]
	mov	DWORD PTR [rax+r15*4], edx
	mov	edx, DWORD PTR 48[rbp]
	mov	eax, DWORD PTR FLAG_SUBTITLE[rip]
	test	edx, edx
	jne	.L3
	cmp	DWORD PTR 8[rbp], 7
	je	.L3
	or	eax, DWORD PTR FLAG_SUPPRESS_HEADER[rip]
.L3:
	mov	ecx, eax
	mov	rdx, QWORD PTR 16[rbp]
	and	ecx, ebx
	cmp	ecx, eax
	sete	al
	xor	edi, edi
	movzx	eax, al
	mov	DWORD PTR [rdx+r15*4], eax
	test	DWORD PTR FLAG_MAGAZINE_SERIAL[rip], ebx
	setne	dil
	call	dbg@PLT
	mov	eax, DWORD PTR 24[rbp]
	cmp	eax, -1
	je	.L4
	mov	rdx, QWORD PTR 0[rbp]
	xor	r12d, r12d
	cmp	eax, DWORD PTR [rdx+r15*4]
	je	.L4
.L1:
	mov	rax, QWORD PTR 264[rsp]
	xor	rax, QWORD PTR fs:40
	jne	.L24
	add	rsp, 280
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	mov	eax, r12d
	pop	rbx
	.cfi_def_cfa_offset 48
	pop	rbp
	.cfi_def_cfa_offset 40
	pop	r12
	.cfi_def_cfa_offset 32
	pop	r13
	.cfi_def_cfa_offset 24
	pop	r14
	.cfi_def_cfa_offset 16
	pop	r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L4:
	.cfi_restore_state
	mov	rax, QWORD PTR 16[rbp]
	mov	r12d, DWORD PTR [rax+r15*4]
	test	r12d, r12d
	je	.L1
	xor	edx, edx
	mov	rax, QWORD PTR 32[rbp]
	and	ebx, DWORD PTR FLAG_ERASE_PAGE[rip]
	setne	dl
	mov	DWORD PTR [rax+r15*4], edx
	jne	.L25
	mov	rsi, QWORD PTR 40[rbp]
.L9:
	mov	rsi, QWORD PTR [rsi]
	mov	rdi, r13
	mov	r12d, 1
	call	strcmp@PLT
	test	rax, rax
	je	.L1
	mov	rax, QWORD PTR 40[rbp]
	mov	edx, 7
	mov	rsi, r13
	mov	rdi, QWORD PTR [rax]
	call	strncpy@PLT
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L25:
	lea	rdi, .LC0[rip]
	call	dbg@PLT
	mov	rax, QWORD PTR 32[rbp]
	mov	rsi, QWORD PTR 40[rbp]
	mov	DWORD PTR [rax+r15*4], 0
	lea	rcx, 256[rsi]
	lea	rax, 8[rsi]
	.p2align 4,,10
	.p2align 3
.L8:
	mov	rdx, QWORD PTR [rax]
	cmp	QWORD PTR [rdx], 0
	je	.L7
	mov	QWORD PTR [rdx], 0
.L7:
	add	rax, 8
	cmp	rcx, rax
	jne	.L8
	jmp	.L9
.L24:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	DecodePageHeaderPacket, .-DecodePageHeaderPacket
	.comm	ppi_national_subsets,8,8
	.comm	FLAG_UPDATE,4,4
	.comm	FLAG_SUPPRESS_HEADER,4,4
	.comm	FLAG_SUBTITLE,4,4
	.comm	FLAG_NEWSFLASH,4,4
	.comm	FLAG_MAGAZINE_SERIAL,4,4
	.comm	FLAG_INTERRUPTED,4,4
	.comm	FLAG_INHIBIT_DISPLAY,4,4
	.comm	FLAG_ERASE_PAGE,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_telx.c_DecodePageHeaderPacket.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"ERASE !\000"
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC1:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	DecodePageHeaderPacket, %function
DecodePageHeaderPacket:
	@ args = 0, pretend = 0, frame = 264
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, lr}
	ldr	r3, .L31
	sub	sp, sp, #272
	mov	r6, r1
	mov	r8, r2
	ldr	r3, [r3]
	str	r3, [sp, #268]
	mov	r3,#0
	mov	r5, #0
	ldr	r7, [r0]
	add	r10, r1, #28
	add	r9, r1, #52
.L2:
	mov	r4, r10
	ldr	r0, [r10, #4]!
	bl	hamming_8_4
	bl	bytereverse
	sub	r4, r4, #28
	asr	r0, r0, #4
	sub	r4, r4, r6
	and	r0, r0, #15
	cmp	r10, r9
	orr	r5, r5, r0, lsl r4
	bne	.L2
	ldr	r0, [r6, #28]
	bl	hamming_8_4
	bl	bytereverse
	mov	r4, r0
	ldr	r0, [r6, #24]
	bl	hamming_8_4
	bl	bytereverse
	mov	r3, #26
	ldr	r2, [r7]
	lsl	r0, r0, #24
	and	r4, r4, #240
	orr	r4, r4, r0, lsr #28
	add	r6, r6, #56
	str	r4, [r2, r8, lsl #2]
	mov	r1, #256
	mov	r2, r7
	str	r3, [sp, #4]
	add	r0, sp, #12
	mov	r3, r8
	str	r6, [sp]
	bl	decode_string
	add	r0, sp, #12
	bl	dbg
	ldr	r2, .L31+4
	asr	r3, r5, #21
	ldr	r1, [r2]
	ldr	r2, [r7, #28]
	ldr	r1, [r1, r3, lsl #2]
	ldr	r3, .L31+8
	str	r1, [r2, r8, lsl #2]
	ldr	r2, [r7, #24]
	ldr	r3, [r3]
	cmp	r2, #0
	bne	.L3
	ldr	r2, [r7, #4]
	cmp	r2, #7
	ldrne	r2, .L31+12
	ldrne	r2, [r2]
	orrne	r3, r3, r2
.L3:
	bics	r3, r3, r5
	moveq	r1, #1
	movne	r1, #0
	ldr	r2, [r7, #8]
	ldr	r3, .L31+16
	str	r1, [r2, r8, lsl #2]
	ldr	r3, [r3]
	tst	r5, r3
	movne	r0, #1
	moveq	r0, #0
	bl	dbg
	ldr	r3, [r7, #12]
	cmn	r3, #1
	beq	.L4
	ldr	r2, [r7]
	ldr	r2, [r2, r8, lsl #2]
	cmp	r3, r2
	movne	r0, #0
	beq	.L4
.L1:
	ldr	r3, .L31
	ldr	r2, [r3]
	ldr	r3, [sp, #268]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L29
	add	sp, sp, #272
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L4:
	ldr	r3, [r7, #8]
	ldr	r0, [r3, r8, lsl #2]
	cmp	r0, #0
	beq	.L1
	ldr	r2, .L31+20
	ldr	r3, [r7, #16]
	ldr	r2, [r2]
	and	r5, r5, r2
	cmp	r5, #0
	movne	r2, #1
	moveq	r2, #0
	ldreq	lr, [r7, #20]
	str	r2, [r3, r8, lsl #2]
	bne	.L30
.L9:
	ldr	r4, [lr]
	add	r0, sp, #12
	mov	r1, r4
	bl	strcmp
	cmp	r0, #0
	moveq	r0, #1
	beq	.L1
	mov	r0, r4
	mov	r2, #3
	add	r1, sp, #12
	bl	strncpy
	mov	r0, #1
	b	.L1
.L30:
	ldr	r0, .L31+24
	bl	dbg
	mov	r2, #0
	ldr	lr, [r7, #20]
	mov	ip, r2
	mov	r3, lr
	ldr	r1, [r7, #16]
	add	r0, lr, #124
	str	r2, [r1, r8, lsl #2]
.L8:
	ldr	r2, [r3, #4]!
	ldr	r1, [r2]
	cmp	r1, #0
	strne	ip, [r2]
	cmp	r0, r3
	bne	.L8
	b	.L9
.L29:
	bl	__stack_chk_fail
.L32:
	.align	2
.L31:
	.word	.LC1
	.word	ppi_national_subsets
	.word	FLAG_SUBTITLE
	.word	FLAG_SUPPRESS_HEADER
	.word	FLAG_MAGAZINE_SERIAL
	.word	FLAG_ERASE_PAGE
	.word	.LC0
	.size	DecodePageHeaderPacket, .-DecodePageHeaderPacket
	.comm	ppi_national_subsets,4,4
	.comm	FLAG_UPDATE,4,4
	.comm	FLAG_SUPPRESS_HEADER,4,4
	.comm	FLAG_SUBTITLE,4,4
	.comm	FLAG_NEWSFLASH,4,4
	.comm	FLAG_MAGAZINE_SERIAL,4,4
	.comm	FLAG_INTERRUPTED,4,4
	.comm	FLAG_INHIBIT_DISPLAY,4,4
	.comm	FLAG_ERASE_PAGE,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
