	.file	"500486.c"
	.intel_syntax noprefix
	.text
	.globl	readl
	.type	readl, @function
readl:
.LFB6:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	mov	QWORD PTR -8[rbp], rdi
	mov	rax, QWORD PTR -8[rbp]
	mov	eax, DWORD PTR [rax]
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	readl, .-readl
	.globl	writel
	.type	writel, @function
writel:
.LFB7:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	mov	DWORD PTR -4[rbp], edi
	mov	QWORD PTR -16[rbp], rsi
	mov	rax, QWORD PTR -16[rbp]
	mov	edx, DWORD PTR -4[rbp]
	mov	DWORD PTR [rax], edx
	nop
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	writel, .-writel
	.section	.rodata
	.align 8
.LC0:
	.string	"Unable to map image destination memory"
	.align 8
.LC1:
	.string	"Unable to open image source memory"
	.text
	.globl	copy_flash_img
	.type	copy_flash_img, @function
copy_flash_img:
.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, 32
	mov	DWORD PTR -20[rbp], edi
	mov	DWORD PTR -24[rbp], esi
	mov	DWORD PTR -28[rbp], edx
	call	getpagesize@PLT
	cdqe
	mov	QWORD PTR -8[rbp], rax
	mov	eax, DWORD PTR -28[rbp]
	mov	edx, 0
	div	QWORD PTR -8[rbp]
	add	rax, 1
	imul	rax, QWORD PTR -8[rbp]
	mov	edx, DWORD PTR -20[rbp]
	mov	r9d, 1543503872
	mov	r8d, edx
	mov	ecx, 1
	mov	edx, 3
	mov	rsi, rax
	mov	edi, 0
	call	mmap@PLT
	mov	QWORD PTR memimg.1[rip], rax
	mov	rax, QWORD PTR memimg.1[rip]
	cmp	rax, -1
	jne	.L5
	lea	rdi, .LC0[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L5:
	mov	eax, DWORD PTR -28[rbp]
	mov	edx, DWORD PTR -24[rbp]
	mov	r9d, 0
	mov	r8d, edx
	mov	ecx, 1
	mov	edx, 1
	mov	rsi, rax
	mov	edi, 0
	call	mmap@PLT
	mov	QWORD PTR fwimg.0[rip], rax
	mov	rax, QWORD PTR fwimg.0[rip]
	cmp	rax, -1
	jne	.L6
	lea	rdi, .LC1[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L6:
	mov	edx, DWORD PTR -28[rbp]
	mov	rcx, QWORD PTR fwimg.0[rip]
	mov	rax, QWORD PTR memimg.1[rip]
	mov	rsi, rcx
	mov	rdi, rax
	call	memcpy@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	copy_flash_img, .-copy_flash_img
	.section	.rodata
.LC2:
	.string	"Unable to open flash image\n"
	.align 8
.LC3:
	.string	"Unable to determine size of firmware image"
.LC4:
	.string	"Flash too large (> 32MB)"
	.text
	.globl	boot_firmware_image
	.type	boot_firmware_image, @function
boot_firmware_image:
.LFB9:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 192
	mov	DWORD PTR -180[rbp], edi
	mov	QWORD PTR -192[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	rax, QWORD PTR -192[rbp]
	mov	esi, 0
	mov	rdi, rax
	mov	eax, 0
	call	open@PLT
	mov	DWORD PTR -164[rbp], eax
	cmp	DWORD PTR -164[rbp], 0
	jns	.L8
	lea	rdi, .LC2[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L8:
	lea	rdx, -160[rbp]
	mov	rax, QWORD PTR -192[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	stat@PLT
	test	eax, eax
	je	.L9
	lea	rdi, .LC3[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L9:
	mov	rax, QWORD PTR -112[rbp]
	cmp	rax, 33554432
	jle	.L10
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 24
	mov	esi, 1
	lea	rdi, .LC4[rip]
	call	fwrite@PLT
	mov	edi, 1
	call	exit@PLT
.L10:
	mov	rax, QWORD PTR -112[rbp]
	mov	edx, eax
	mov	ecx, DWORD PTR -164[rbp]
	mov	eax, DWORD PTR -180[rbp]
	mov	esi, ecx
	mov	edi, eax
	call	copy_flash_img
	mov	eax, DWORD PTR -164[rbp]
	mov	edi, eax
	call	close@PLT
	nop
	mov	rax, QWORD PTR -8[rbp]
	sub	rax, QWORD PTR fs:40
	je	.L11
	call	__stack_chk_fail@PLT
.L11:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	boot_firmware_image, .-boot_firmware_image
	.section	.rodata
.LC5:
	.string	"Usage: %s <flash image>\n"
.LC6:
	.string	"/dev/mem"
.LC7:
	.string	"Unable to open /dev/mem"
	.align 8
.LC8:
	.string	"Unable to map LPC register memory"
	.align 8
.LC9:
	.string	"Booting from memory after power cycle"
.LC10:
	.string	"Resetting LPC_HICR7 to 0x%x\n"
.LC11:
	.string	"LPC_HICR7 = 0x%x\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB10:
	.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	QWORD PTR -32[rbp], rsi
	mov	DWORD PTR -16[rbp], 805309952
	cmp	DWORD PTR -20[rbp], 2
	jle	.L13
	mov	rax, QWORD PTR -32[rbp]
	mov	rax, QWORD PTR [rax]
	mov	rsi, rax
	lea	rdi, .LC5[rip]
	mov	eax, 0
	call	printf@PLT
	mov	edi, 1
	call	exit@PLT
.L13:
	mov	esi, 1052674
	lea	rdi, .LC6[rip]
	mov	eax, 0
	call	open@PLT
	mov	DWORD PTR -12[rbp], eax
	cmp	DWORD PTR -12[rbp], 0
	jns	.L14
	lea	rdi, .LC7[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L14:
	call	getpagesize@PLT
	cdqe
	mov	edx, DWORD PTR -12[rbp]
	mov	r9d, 511217664
	mov	r8d, edx
	mov	ecx, 1
	mov	edx, 3
	mov	rsi, rax
	mov	edi, 0
	call	mmap@PLT
	mov	QWORD PTR -8[rbp], rax
	cmp	QWORD PTR -8[rbp], -1
	jne	.L15
	lea	rdi, .LC8[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L15:
	cmp	DWORD PTR -20[rbp], 2
	jne	.L16
	mov	rax, QWORD PTR -32[rbp]
	add	rax, 8
	mov	rdx, QWORD PTR [rax]
	mov	eax, DWORD PTR -12[rbp]
	mov	rsi, rdx
	mov	edi, eax
	call	boot_firmware_image
	mov	DWORD PTR -16[rbp], 1543507456
	lea	rdi, .LC9[rip]
	call	puts@PLT
.L16:
	mov	rax, QWORD PTR -8[rbp]
	add	rax, 136
	mov	rdi, rax
	call	readl
	cmp	DWORD PTR -16[rbp], eax
	je	.L17
	mov	eax, DWORD PTR -16[rbp]
	mov	esi, eax
	lea	rdi, .LC10[rip]
	mov	eax, 0
	call	printf@PLT
	mov	rax, QWORD PTR -8[rbp]
	lea	rdx, 136[rax]
	mov	eax, DWORD PTR -16[rbp]
	mov	rsi, rdx
	mov	edi, eax
	call	writel
.L17:
	mov	eax, DWORD PTR -16[rbp]
	mov	esi, eax
	lea	rdi, .LC11[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, 0
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	main, .-main
	.local	memimg.1
	.comm	memimg.1,8,8
	.local	fwimg.0
	.comm	fwimg.0,8,8
	.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	"500486.c"
	.text
	.align	2
	.global	readl
	.syntax unified
	.arm
	.fpu softvfp
	.type	readl, %function
readl:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	@ link register save eliminated.
	str	fp, [sp, #-4]!
	add	fp, sp, #0
	sub	sp, sp, #12
	str	r0, [fp, #-8]
	ldr	r3, [fp, #-8]
	ldr	r3, [r3]
	mov	r0, r3
	add	sp, fp, #0
	@ sp needed
	ldr	fp, [sp], #4
	bx	lr
	.size	readl, .-readl
	.align	2
	.global	writel
	.syntax unified
	.arm
	.fpu softvfp
	.type	writel, %function
writel:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	@ link register save eliminated.
	str	fp, [sp, #-4]!
	add	fp, sp, #0
	sub	sp, sp, #12
	str	r0, [fp, #-8]
	str	r1, [fp, #-12]
	ldr	r3, [fp, #-12]
	ldr	r2, [fp, #-8]
	str	r2, [r3]
	nop
	add	sp, fp, #0
	@ sp needed
	ldr	fp, [sp], #4
	bx	lr
	.size	writel, .-writel
	.global	__aeabi_uidiv
	.section	.rodata
	.align	2
.LC0:
	.ascii	"Unable to map image destination memory\000"
	.align	2
.LC1:
	.ascii	"Unable to open image source memory\000"
	.text
	.align	2
	.global	copy_flash_img
	.syntax unified
	.arm
	.fpu softvfp
	.type	copy_flash_img, %function
copy_flash_img:
	@ args = 0, pretend = 0, frame = 24
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #32
	str	r0, [fp, #-16]
	str	r1, [fp, #-20]
	str	r2, [fp, #-24]
	bl	getpagesize
	mov	r3, r0
	str	r3, [fp, #-8]
	ldr	r1, [fp, #-8]
	ldr	r0, [fp, #-24]
	bl	__aeabi_uidiv
	mov	r3, r0
	add	r3, r3, #1
	ldr	r2, [fp, #-8]
	mul	r1, r2, r3
	mov	r3, #1543503872
	str	r3, [sp, #4]
	ldr	r3, [fp, #-16]
	str	r3, [sp]
	mov	r3, #1
	mov	r2, #3
	mov	r0, #0
	bl	mmap
	mov	r3, r0
	ldr	r2, .L7
	str	r3, [r2]
	ldr	r3, .L7
	ldr	r3, [r3]
	cmn	r3, #1
	bne	.L5
	ldr	r0, .L7+4
	bl	perror
	mov	r0, #1
	bl	exit
.L5:
	mov	r3, #0
	str	r3, [sp, #4]
	ldr	r3, [fp, #-20]
	str	r3, [sp]
	mov	r3, #1
	mov	r2, #1
	ldr	r1, [fp, #-24]
	mov	r0, #0
	bl	mmap
	mov	r3, r0
	ldr	r2, .L7+8
	str	r3, [r2]
	ldr	r3, .L7+8
	ldr	r3, [r3]
	cmn	r3, #1
	bne	.L6
	ldr	r0, .L7+12
	bl	perror
	mov	r0, #1
	bl	exit
.L6:
	ldr	r3, .L7
	ldr	r3, [r3]
	ldr	r2, .L7+8
	ldr	r1, [r2]
	ldr	r2, [fp, #-24]
	mov	r0, r3
	bl	memcpy
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L8:
	.align	2
.L7:
	.word	memimg.6118
	.word	.LC0
	.word	fwimg.6119
	.word	.LC1
	.size	copy_flash_img, .-copy_flash_img
	.section	.rodata
	.align	2
.LC2:
	.ascii	"Unable to open flash image\012\000"
	.align	2
.LC3:
	.ascii	"Unable to determine size of firmware image\000"
	.align	2
.LC4:
	.ascii	"Flash too large (> 32MB)\000"
	.align	2
.LC5:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	boot_firmware_image
	.syntax unified
	.arm
	.fpu softvfp
	.type	boot_firmware_image, %function
boot_firmware_image:
	@ args = 0, pretend = 0, frame = 112
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #112
	str	r0, [fp, #-112]
	str	r1, [fp, #-116]
	ldr	r3, .L14
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	mov	r1, #0
	ldr	r0, [fp, #-116]
	bl	open
	str	r0, [fp, #-104]
	ldr	r3, [fp, #-104]
	cmp	r3, #0
	bge	.L10
	ldr	r0, .L14+4
	bl	perror
	mov	r0, #1
	bl	exit
.L10:
	sub	r3, fp, #100
	mov	r1, r3
	ldr	r0, [fp, #-116]
	bl	stat
	mov	r3, r0
	cmp	r3, #0
	beq	.L11
	ldr	r0, .L14+8
	bl	perror
	mov	r0, #1
	bl	exit
.L11:
	ldr	r3, [fp, #-56]
	cmp	r3, #33554432
	ble	.L12
	ldr	r3, .L14+12
	ldr	r3, [r3]
	mov	r2, #24
	mov	r1, #1
	ldr	r0, .L14+16
	bl	fwrite
	mov	r0, #1
	bl	exit
.L12:
	ldr	r3, [fp, #-56]
	mov	r2, r3
	ldr	r1, [fp, #-104]
	ldr	r0, [fp, #-112]
	bl	copy_flash_img
	ldr	r0, [fp, #-104]
	bl	close
	nop
	ldr	r3, .L14
	ldr	r2, [r3]
	ldr	r3, [fp, #-8]
	eors	r2, r3, r2
	mov	r3, #0
	beq	.L13
	bl	__stack_chk_fail
.L13:
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L15:
	.align	2
.L14:
	.word	.LC5
	.word	.LC2
	.word	.LC3
	.word	stderr
	.word	.LC4
	.size	boot_firmware_image, .-boot_firmware_image
	.section	.rodata
	.align	2
.LC6:
	.ascii	"Usage: %s <flash image>\012\000"
	.align	2
.LC7:
	.ascii	"/dev/mem\000"
	.align	2
.LC8:
	.ascii	"Unable to open /dev/mem\000"
	.align	2
.LC9:
	.ascii	"Unable to map LPC register memory\000"
	.align	2
.LC10:
	.ascii	"Booting from memory after power cycle\000"
	.align	2
.LC11:
	.ascii	"Resetting LPC_HICR7 to 0x%x\012\000"
	.align	2
.LC12:
	.ascii	"LPC_HICR7 = 0x%x\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, #32
	str	r0, [fp, #-24]
	str	r1, [fp, #-28]
	ldr	r3, .L23
	str	r3, [fp, #-16]
	ldr	r3, [fp, #-24]
	cmp	r3, #2
	ble	.L17
	ldr	r3, [fp, #-28]
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, .L23+4
	bl	printf
	mov	r0, #1
	bl	exit
.L17:
	ldr	r1, .L23+8
	ldr	r0, .L23+12
	bl	open
	str	r0, [fp, #-12]
	ldr	r3, [fp, #-12]
	cmp	r3, #0
	bge	.L18
	ldr	r0, .L23+16
	bl	perror
	mov	r0, #1
	bl	exit
.L18:
	bl	getpagesize
	mov	r3, r0
	mov	r1, r3
	ldr	r3, .L23+20
	str	r3, [sp, #4]
	ldr	r3, [fp, #-12]
	str	r3, [sp]
	mov	r3, #1
	mov	r2, #3
	mov	r0, #0
	bl	mmap
	str	r0, [fp, #-8]
	ldr	r3, [fp, #-8]
	cmn	r3, #1
	bne	.L19
	ldr	r0, .L23+24
	bl	perror
	mov	r0, #1
	bl	exit
.L19:
	ldr	r3, [fp, #-24]
	cmp	r3, #2
	bne	.L20
	ldr	r3, [fp, #-28]
	add	r3, r3, #4
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, [fp, #-12]
	bl	boot_firmware_image
	ldr	r3, .L23+28
	str	r3, [fp, #-16]
	ldr	r0, .L23+32
	bl	puts
.L20:
	ldr	r3, [fp, #-8]
	add	r3, r3, #136
	mov	r0, r3
	bl	readl
	mov	r2, r0
	ldr	r3, [fp, #-16]
	cmp	r3, r2
	beq	.L21
	ldr	r1, [fp, #-16]
	ldr	r0, .L23+36
	bl	printf
	ldr	r3, [fp, #-8]
	add	r3, r3, #136
	mov	r1, r3
	ldr	r0, [fp, #-16]
	bl	writel
.L21:
	ldr	r1, [fp, #-16]
	ldr	r0, .L23+40
	bl	printf
	mov	r3, #0
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L24:
	.align	2
.L23:
	.word	805309952
	.word	.LC6
	.word	1052674
	.word	.LC7
	.word	.LC8
	.word	511217664
	.word	.LC9
	.word	1543507456
	.word	.LC10
	.word	.LC11
	.word	.LC12
	.size	main, .-main
	.local	memimg.6118
	.comm	memimg.6118,4,4
	.local	fwimg.6119
	.comm	fwimg.6119,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
