	.file	"372652.c"
	.intel_syntax noprefix
	.text
	.globl	needle
	.data
	.align 16
	.type	needle, @object
	.size	needle, 20
needle:
	.string	"\304 \004"
	.string	"\364\205\002"
	.string	"\300\204\304@\006"
	.ascii	"\bT\251\205G\370"
	.section	.rodata
.LC0:
	.string	"%02d  %04X"
.LC1:
	.string	" (PAGEUSED)"
.LC2:
	.string	" (CHECKSUM)"
.LC3:
	.string	" (CSUM-1)"
.LC4:
	.string	" (BACKUPPAGE)"
.LC5:
	.string	" (BIT2)"
.LC6:
	.string	" (BIT3)"
.LC7:
	.string	" (BIT4)"
.LC8:
	.string	" (BIT5)"
	.text
	.globl	printpageinfo
	.type	printpageinfo, @function
printpageinfo:
.LFB6:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 32
	mov	DWORD PTR -20[rbp], edi
	mov	eax, esi
	mov	WORD PTR -24[rbp], ax
	movzx	eax, WORD PTR -24[rbp]
	mov	BYTE PTR -2[rbp], al
	movzx	eax, WORD PTR -24[rbp]
	shr	ax, 8
	mov	BYTE PTR -1[rbp], al
	movzx	edx, WORD PTR -24[rbp]
	mov	eax, DWORD PTR -20[rbp]
	mov	esi, eax
	lea	rdi, .LC0[rip]
	mov	eax, 0
	call	printf@PLT
	movzx	eax, BYTE PTR -2[rbp]
	and	eax, 2
	test	eax, eax
	je	.L2
	lea	rdi, .LC1[rip]
	mov	eax, 0
	call	printf@PLT
.L2:
	movzx	eax, BYTE PTR -2[rbp]
	and	eax, 1
	test	eax, eax
	je	.L3
	lea	rdi, .LC2[rip]
	mov	eax, 0
	call	printf@PLT
.L3:
	movzx	eax, BYTE PTR -2[rbp]
	and	eax, 64
	test	eax, eax
	je	.L4
	lea	rdi, .LC3[rip]
	mov	eax, 0
	call	printf@PLT
.L4:
	movzx	eax, BYTE PTR -2[rbp]
	test	al, al
	jns	.L5
	lea	rdi, .LC4[rip]
	mov	eax, 0
	call	printf@PLT
.L5:
	movzx	eax, BYTE PTR -2[rbp]
	and	eax, 4
	test	eax, eax
	je	.L6
	lea	rdi, .LC5[rip]
	mov	eax, 0
	call	printf@PLT
.L6:
	movzx	eax, BYTE PTR -2[rbp]
	and	eax, 8
	test	eax, eax
	je	.L7
	lea	rdi, .LC6[rip]
	mov	eax, 0
	call	printf@PLT
.L7:
	movzx	eax, BYTE PTR -2[rbp]
	and	eax, 16
	test	eax, eax
	je	.L8
	lea	rdi, .LC7[rip]
	mov	eax, 0
	call	printf@PLT
.L8:
	movzx	eax, BYTE PTR -2[rbp]
	and	eax, 32
	test	eax, eax
	je	.L9
	lea	rdi, .LC8[rip]
	mov	eax, 0
	call	printf@PLT
.L9:
	mov	edi, 10
	call	putchar@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	printpageinfo, .-printpageinfo
	.section	.rodata
	.align 8
.LC9:
	.string	"trying to find the table len=%d\n"
.LC10:
	.string	"found at addr 0x%06X\n"
	.align 8
.LC11:
	.string	"could not find the code using the table, sorry..."
	.align 8
.LC12:
	.string	"we found the table address 0x%x but we do not know the segment yet...\n"
.LC13:
	.string	"dumping table at %x\n"
	.align 8
.LC14:
	.string	"your table has %d pages, so your eeprom is %d bytes big\n"
	.text
	.globl	findtable
	.type	findtable, @function
findtable:
.LFB7:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 48
	mov	QWORD PTR -40[rbp], rdi
	mov	DWORD PTR -44[rbp], esi
	mov	DWORD PTR -12[rbp], 0
	mov	DWORD PTR -8[rbp], 0
	mov	eax, DWORD PTR -44[rbp]
	mov	esi, eax
	lea	rdi, .LC9[rip]
	mov	eax, 0
	call	printf@PLT
	jmp	.L11
.L14:
	mov	edx, DWORD PTR -12[rbp]
	mov	rax, QWORD PTR -40[rbp]
	add	rax, rdx
	mov	edx, 20
	lea	rsi, needle[rip]
	mov	rdi, rax
	call	memcmp@PLT
	test	eax, eax
	jne	.L12
	mov	eax, DWORD PTR -12[rbp]
	mov	esi, eax
	lea	rdi, .LC10[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, DWORD PTR -12[rbp]
	mov	DWORD PTR -8[rbp], eax
	jmp	.L13
.L12:
	add	DWORD PTR -12[rbp], 1
.L11:
	mov	eax, DWORD PTR -12[rbp]
	mov	edx, DWORD PTR -44[rbp]
	sub	rdx, 20
	cmp	rax, rdx
	jb	.L14
.L13:
	cmp	DWORD PTR -8[rbp], 0
	jne	.L15
	lea	rdi, .LC11[rip]
	call	puts@PLT
	mov	edi, 0
	call	exit@PLT
.L15:
	sub	DWORD PTR -8[rbp], 2
	mov	edx, DWORD PTR -8[rbp]
	mov	rax, QWORD PTR -40[rbp]
	add	rax, rdx
	movzx	eax, WORD PTR [rax]
	mov	WORD PTR -20[rbp], ax
	movzx	eax, WORD PTR -20[rbp]
	mov	esi, eax
	lea	rdi, .LC12[rip]
	mov	eax, 0
	call	printf@PLT
	movzx	eax, WORD PTR -20[rbp]
	mov	DWORD PTR -4[rbp], eax
	add	DWORD PTR -4[rbp], 65536
	mov	eax, DWORD PTR -4[rbp]
	mov	esi, eax
	lea	rdi, .LC13[rip]
	mov	eax, 0
	call	printf@PLT
	mov	DWORD PTR -16[rbp], 0
	jmp	.L16
.L19:
	mov	edx, DWORD PTR -4[rbp]
	mov	eax, DWORD PTR -16[rbp]
	add	eax, eax
	cdqe
	add	rdx, rax
	mov	rax, QWORD PTR -40[rbp]
	add	rax, rdx
	movzx	eax, WORD PTR [rax]
	mov	WORD PTR -18[rbp], ax
	cmp	WORD PTR -18[rbp], 30583
	je	.L20
	movzx	edx, WORD PTR -18[rbp]
	mov	eax, DWORD PTR -16[rbp]
	mov	esi, edx
	mov	edi, eax
	call	printpageinfo
	add	DWORD PTR -16[rbp], 1
.L16:
	cmp	DWORD PTR -16[rbp], 128
	jle	.L19
	jmp	.L18
.L20:
	nop
.L18:
	mov	eax, DWORD PTR -16[rbp]
	sal	eax, 4
	mov	edx, eax
	mov	eax, DWORD PTR -16[rbp]
	mov	esi, eax
	lea	rdi, .LC14[rip]
	mov	eax, 0
	call	printf@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	findtable, .-findtable
	.section	.rodata
.LC15:
	.string	"please specify filename"
.LC16:
	.string	"rb"
.LC17:
	.string	"could not open file"
.LC18:
	.string	"image is %ldkb big...\n"
.LC19:
	.string	"loaded file \"%s\" ...\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB8:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 48
	mov	DWORD PTR -36[rbp], edi
	mov	QWORD PTR -48[rbp], rsi
	mov	QWORD PTR -24[rbp], 0
	mov	QWORD PTR -16[rbp], 0
	mov	QWORD PTR -8[rbp], 0
	cmp	DWORD PTR -36[rbp], 1
	jg	.L22
	lea	rdi, .LC15[rip]
	call	puts@PLT
	mov	edi, 0
	call	exit@PLT
.L22:
	mov	rax, QWORD PTR -48[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	lea	rsi, .LC16[rip]
	mov	rdi, rax
	call	fopen@PLT
	mov	QWORD PTR -8[rbp], rax
	cmp	QWORD PTR -8[rbp], 0
	jne	.L23
	lea	rdi, .LC17[rip]
	call	puts@PLT
	mov	edi, 0
	call	exit@PLT
.L23:
	mov	rax, QWORD PTR -8[rbp]
	mov	edx, 2
	mov	esi, 0
	mov	rdi, rax
	call	fseek@PLT
	mov	rax, QWORD PTR -8[rbp]
	mov	rdi, rax
	call	ftell@PLT
	mov	QWORD PTR -16[rbp], rax
	mov	rax, QWORD PTR -8[rbp]
	mov	edx, 0
	mov	esi, 0
	mov	rdi, rax
	call	fseek@PLT
	mov	rax, QWORD PTR -16[rbp]
	shr	rax, 10
	mov	rsi, rax
	lea	rdi, .LC18[rip]
	mov	eax, 0
	call	printf@PLT
	mov	rax, QWORD PTR -16[rbp]
	mov	rdi, rax
	call	malloc@PLT
	mov	QWORD PTR -24[rbp], rax
	mov	rcx, QWORD PTR -8[rbp]
	mov	rdx, QWORD PTR -16[rbp]
	mov	rax, QWORD PTR -24[rbp]
	mov	esi, 1
	mov	rdi, rax
	call	fread@PLT
	mov	rax, QWORD PTR -8[rbp]
	mov	rdi, rax
	call	fclose@PLT
	mov	rax, QWORD PTR -48[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	mov	rsi, rax
	lea	rdi, .LC19[rip]
	mov	eax, 0
	call	printf@PLT
	mov	rax, QWORD PTR -16[rbp]
	mov	edx, eax
	mov	rax, QWORD PTR -24[rbp]
	mov	esi, edx
	mov	rdi, rax
	call	findtable
	mov	eax, 0
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 10.5.0-1ubuntu1~20.04) 10.5.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, 6
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"372652.c"
	.text
	.global	needle
	.data
	.align	2
	.type	needle, %object
	.size	needle, 20
needle:
	.ascii	"\304 \004\000\364\205\002\000\300\204\304@\006\000\010"
	.ascii	"T\251\205G\370"
	.section	.rodata
	.align	2
.LC0:
	.ascii	"%02d  %04X\000"
	.align	2
.LC1:
	.ascii	" (PAGEUSED)\000"
	.align	2
.LC2:
	.ascii	" (CHECKSUM)\000"
	.align	2
.LC3:
	.ascii	" (CSUM-1)\000"
	.align	2
.LC4:
	.ascii	" (BACKUPPAGE)\000"
	.align	2
.LC5:
	.ascii	" (BIT2)\000"
	.align	2
.LC6:
	.ascii	" (BIT3)\000"
	.align	2
.LC7:
	.ascii	" (BIT4)\000"
	.align	2
.LC8:
	.ascii	" (BIT5)\000"
	.text
	.align	2
	.global	printpageinfo
	.syntax unified
	.arm
	.fpu softvfp
	.type	printpageinfo, %function
printpageinfo:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #16
	str	r0, [fp, #-16]
	mov	r3, r1
	strh	r3, [fp, #-18]	@ movhi
	ldrh	r3, [fp, #-18]	@ movhi
	strb	r3, [fp, #-6]
	ldrh	r3, [fp, #-18]
	lsr	r3, r3, #8
	lsl	r3, r3, #16
	lsr	r3, r3, #16
	strb	r3, [fp, #-5]
	ldrh	r3, [fp, #-18]
	mov	r2, r3
	ldr	r1, [fp, #-16]
	ldr	r0, .L10
	bl	printf
	ldrb	r3, [fp, #-6]	@ zero_extendqisi2
	and	r3, r3, #2
	cmp	r3, #0
	beq	.L2
	ldr	r0, .L10+4
	bl	printf
.L2:
	ldrb	r3, [fp, #-6]	@ zero_extendqisi2
	and	r3, r3, #1
	cmp	r3, #0
	beq	.L3
	ldr	r0, .L10+8
	bl	printf
.L3:
	ldrb	r3, [fp, #-6]	@ zero_extendqisi2
	and	r3, r3, #64
	cmp	r3, #0
	beq	.L4
	ldr	r0, .L10+12
	bl	printf
.L4:
	ldrsb	r3, [fp, #-6]
	cmp	r3, #0
	bge	.L5
	ldr	r0, .L10+16
	bl	printf
.L5:
	ldrb	r3, [fp, #-6]	@ zero_extendqisi2
	and	r3, r3, #4
	cmp	r3, #0
	beq	.L6
	ldr	r0, .L10+20
	bl	printf
.L6:
	ldrb	r3, [fp, #-6]	@ zero_extendqisi2
	and	r3, r3, #8
	cmp	r3, #0
	beq	.L7
	ldr	r0, .L10+24
	bl	printf
.L7:
	ldrb	r3, [fp, #-6]	@ zero_extendqisi2
	and	r3, r3, #16
	cmp	r3, #0
	beq	.L8
	ldr	r0, .L10+28
	bl	printf
.L8:
	ldrb	r3, [fp, #-6]	@ zero_extendqisi2
	and	r3, r3, #32
	cmp	r3, #0
	beq	.L9
	ldr	r0, .L10+32
	bl	printf
.L9:
	mov	r0, #10
	bl	putchar
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L11:
	.align	2
.L10:
	.word	.LC0
	.word	.LC1
	.word	.LC2
	.word	.LC3
	.word	.LC4
	.word	.LC5
	.word	.LC6
	.word	.LC7
	.word	.LC8
	.size	printpageinfo, .-printpageinfo
	.section	.rodata
	.align	2
.LC9:
	.ascii	"trying to find the table len=%d\012\000"
	.align	2
.LC10:
	.ascii	"found at addr 0x%06X\012\000"
	.align	2
.LC11:
	.ascii	"could not find the code using the table, sorry...\000"
	.align	2
.LC12:
	.ascii	"we found the table address 0x%x but we do not know "
	.ascii	"the segment yet...\012\000"
	.align	2
.LC13:
	.ascii	"dumping table at %x\012\000"
	.align	2
.LC14:
	.ascii	"your table has %d pages, so your eeprom is %d bytes"
	.ascii	" big\012\000"
	.text
	.align	2
	.global	findtable
	.syntax unified
	.arm
	.fpu softvfp
	.type	findtable, %function
findtable:
	@ args = 0, pretend = 0, frame = 32
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #32
	str	r0, [fp, #-32]
	str	r1, [fp, #-36]
	mov	r3, #0
	str	r3, [fp, #-16]
	mov	r3, #0
	str	r3, [fp, #-12]
	ldr	r1, [fp, #-36]
	ldr	r0, .L23
	bl	printf
	b	.L13
.L16:
	ldr	r2, [fp, #-32]
	ldr	r3, [fp, #-16]
	add	r3, r2, r3
	mov	r2, #20
	ldr	r1, .L23+4
	mov	r0, r3
	bl	memcmp
	mov	r3, r0
	cmp	r3, #0
	bne	.L14
	ldr	r1, [fp, #-16]
	ldr	r0, .L23+8
	bl	printf
	ldr	r3, [fp, #-16]
	str	r3, [fp, #-12]
	b	.L15
.L14:
	ldr	r3, [fp, #-16]
	add	r3, r3, #1
	str	r3, [fp, #-16]
.L13:
	ldr	r3, [fp, #-36]
	sub	r3, r3, #20
	ldr	r2, [fp, #-16]
	cmp	r2, r3
	bcc	.L16
.L15:
	ldr	r3, [fp, #-12]
	cmp	r3, #0
	bne	.L17
	ldr	r0, .L23+12
	bl	puts
	mov	r0, #0
	bl	exit
.L17:
	ldr	r3, [fp, #-12]
	sub	r3, r3, #2
	str	r3, [fp, #-12]
	ldr	r2, [fp, #-32]
	ldr	r3, [fp, #-12]
	add	r3, r2, r3
	ldrh	r3, [r3]	@ movhi
	strh	r3, [fp, #-24]	@ movhi
	ldrh	r3, [fp, #-24]
	mov	r1, r3
	ldr	r0, .L23+16
	bl	printf
	ldrh	r3, [fp, #-24]
	str	r3, [fp, #-8]
	ldr	r3, [fp, #-8]
	add	r3, r3, #65536
	str	r3, [fp, #-8]
	ldr	r1, [fp, #-8]
	ldr	r0, .L23+20
	bl	printf
	mov	r3, #0
	str	r3, [fp, #-20]
	b	.L18
.L21:
	ldr	r3, [fp, #-20]
	lsl	r3, r3, #1
	mov	r2, r3
	ldr	r3, [fp, #-8]
	add	r3, r2, r3
	ldr	r2, [fp, #-32]
	add	r3, r2, r3
	ldrh	r3, [r3]	@ movhi
	strh	r3, [fp, #-22]	@ movhi
	ldrh	r3, [fp, #-22]
	ldr	r2, .L23+24
	cmp	r3, r2
	beq	.L22
	ldr	r3, [fp, #-20]
	ldrh	r2, [fp, #-22]
	mov	r1, r2
	mov	r0, r3
	bl	printpageinfo
	ldr	r3, [fp, #-20]
	add	r3, r3, #1
	str	r3, [fp, #-20]
.L18:
	ldr	r3, [fp, #-20]
	cmp	r3, #128
	ble	.L21
	b	.L20
.L22:
	nop
.L20:
	ldr	r3, [fp, #-20]
	lsl	r3, r3, #4
	mov	r2, r3
	ldr	r1, [fp, #-20]
	ldr	r0, .L23+28
	bl	printf
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L24:
	.align	2
.L23:
	.word	.LC9
	.word	needle
	.word	.LC10
	.word	.LC11
	.word	.LC12
	.word	.LC13
	.word	30583
	.word	.LC14
	.size	findtable, .-findtable
	.section	.rodata
	.align	2
.LC15:
	.ascii	"please specify filename\000"
	.align	2
.LC16:
	.ascii	"rb\000"
	.align	2
.LC17:
	.ascii	"could not open file\000"
	.align	2
.LC18:
	.ascii	"image is %ldkb big...\012\000"
	.align	2
.LC19:
	.ascii	"loaded file \"%s\" ...\012\000"
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 24
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #24
	str	r0, [fp, #-24]
	str	r1, [fp, #-28]
	mov	r3, #0
	str	r3, [fp, #-16]
	mov	r3, #0
	str	r3, [fp, #-12]
	mov	r3, #0
	str	r3, [fp, #-8]
	ldr	r3, [fp, #-24]
	cmp	r3, #1
	bgt	.L26
	ldr	r0, .L29
	bl	puts
	mov	r0, #0
	bl	exit
.L26:
	ldr	r3, [fp, #-28]
	add	r3, r3, #4
	ldr	r3, [r3]
	ldr	r1, .L29+4
	mov	r0, r3
	bl	fopen
	str	r0, [fp, #-8]
	ldr	r3, [fp, #-8]
	cmp	r3, #0
	bne	.L27
	ldr	r0, .L29+8
	bl	puts
	mov	r0, #0
	bl	exit
.L27:
	mov	r2, #2
	mov	r1, #0
	ldr	r0, [fp, #-8]
	bl	fseek
	ldr	r0, [fp, #-8]
	bl	ftell
	mov	r3, r0
	str	r3, [fp, #-12]
	mov	r2, #0
	mov	r1, #0
	ldr	r0, [fp, #-8]
	bl	fseek
	ldr	r3, [fp, #-12]
	lsr	r3, r3, #10
	mov	r1, r3
	ldr	r0, .L29+12
	bl	printf
	ldr	r0, [fp, #-12]
	bl	malloc
	mov	r3, r0
	str	r3, [fp, #-16]
	ldr	r3, [fp, #-8]
	ldr	r2, [fp, #-12]
	mov	r1, #1
	ldr	r0, [fp, #-16]
	bl	fread
	ldr	r0, [fp, #-8]
	bl	fclose
	ldr	r3, [fp, #-28]
	add	r3, r3, #4
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, .L29+16
	bl	printf
	ldr	r1, [fp, #-12]
	ldr	r0, [fp, #-16]
	bl	findtable
	mov	r3, #0
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L30:
	.align	2
.L29:
	.word	.LC15
	.word	.LC16
	.word	.LC17
	.word	.LC18
	.word	.LC19
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
