	.file	"87277.c"
	.intel_syntax noprefix
	.text
	.globl	g_size
	.data
	.align 4
	.type	g_size, @object
	.size	g_size, 4
g_size:
	.long	4
	.globl	g_paddr
	.bss
	.align 8
	.type	g_paddr, @object
	.size	g_paddr, 8
g_paddr:
	.zero	8
	.globl	g_is_write
	.align 4
	.type	g_is_write, @object
	.size	g_is_write, 4
g_is_write:
	.zero	4
	.globl	g_value
	.align 4
	.type	g_value, @object
	.size	g_value, 4
g_value:
	.zero	4
	.globl	g_count
	.data
	.align 4
	.type	g_count, @object
	.size	g_count, 4
g_count:
	.long	1
	.section	.rodata
.LC0:
	.string	"-8"
.LC1:
	.string	"-16"
.LC2:
	.string	"-32"
	.text
	.globl	parse_cmdline
	.type	parse_cmdline, @function
parse_cmdline:
.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	QWORD PTR -32[rbp], rsi
	mov	DWORD PTR -12[rbp], 0
	cmp	DWORD PTR -20[rbp], 1
	jg	.L2
	mov	eax, -1
	jmp	.L3
.L2:
	add	DWORD PTR -12[rbp], 1
	mov	eax, DWORD PTR -12[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -32[rbp]
	add	rax, rdx
	mov	rax, QWORD PTR [rax]
	lea	rsi, .LC0[rip]
	mov	rdi, rax
	call	strcmp@PLT
	test	eax, eax
	jne	.L4
	add	DWORD PTR -12[rbp], 1
	mov	DWORD PTR g_size[rip], 1
	jmp	.L5
.L4:
	mov	eax, DWORD PTR -12[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -32[rbp]
	add	rax, rdx
	mov	rax, QWORD PTR [rax]
	lea	rsi, .LC1[rip]
	mov	rdi, rax
	call	strcmp@PLT
	test	eax, eax
	jne	.L6
	add	DWORD PTR -12[rbp], 1
	mov	DWORD PTR g_size[rip], 2
	jmp	.L5
.L6:
	mov	eax, DWORD PTR -12[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -32[rbp]
	add	rax, rdx
	mov	rax, QWORD PTR [rax]
	lea	rsi, .LC2[rip]
	mov	rdi, rax
	call	strcmp@PLT
	test	eax, eax
	jne	.L5
	add	DWORD PTR -12[rbp], 1
	mov	DWORD PTR g_size[rip], 4
.L5:
	mov	eax, DWORD PTR -12[rbp]
	cmp	eax, DWORD PTR -20[rbp]
	jl	.L7
	mov	eax, -1
	jmp	.L3
.L7:
	mov	eax, DWORD PTR -12[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -32[rbp]
	add	rax, rdx
	mov	rax, QWORD PTR [rax]
	mov	edx, 16
	mov	esi, 0
	mov	rdi, rax
	call	strtoul@PLT
	mov	QWORD PTR g_paddr[rip], rax
	mov	rax, QWORD PTR g_paddr[rip]
	test	rax, rax
	jne	.L8
	mov	eax, -1
	jmp	.L3
.L8:
	mov	eax, DWORD PTR -12[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -32[rbp]
	add	rax, rdx
	mov	rax, QWORD PTR [rax]
	mov	esi, 61
	mov	rdi, rax
	call	strchr@PLT
	mov	QWORD PTR -8[rbp], rax
	cmp	QWORD PTR -8[rbp], 0
	je	.L9
	mov	DWORD PTR g_is_write[rip], 1
	mov	rax, QWORD PTR -8[rbp]
	mov	rdi, rax
	call	strlen@PLT
	cmp	rax, 1
	jbe	.L9
	add	QWORD PTR -8[rbp], 1
	mov	rax, QWORD PTR -8[rbp]
	mov	edx, 16
	mov	esi, 0
	mov	rdi, rax
	call	strtoul@PLT
	mov	DWORD PTR g_value[rip], eax
	mov	eax, 0
	jmp	.L3
.L9:
	add	DWORD PTR -12[rbp], 1
	mov	eax, DWORD PTR -12[rbp]
	cmp	eax, DWORD PTR -20[rbp]
	jl	.L10
	mov	eax, -1
	jmp	.L3
.L10:
	mov	eax, DWORD PTR -12[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -32[rbp]
	add	rax, rdx
	mov	rax, QWORD PTR [rax]
	movzx	eax, BYTE PTR [rax]
	cmp	al, 61
	jne	.L11
	mov	DWORD PTR g_is_write[rip], 1
	mov	eax, DWORD PTR -12[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -32[rbp]
	add	rax, rdx
	mov	rax, QWORD PTR [rax]
	mov	rdi, rax
	call	strlen@PLT
	cmp	rax, 1
	jbe	.L12
	mov	eax, DWORD PTR -12[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -32[rbp]
	add	rax, rdx
	mov	rdx, QWORD PTR [rax]
	add	rdx, 1
	mov	QWORD PTR [rax], rdx
	jmp	.L13
.L12:
	add	DWORD PTR -12[rbp], 1
	mov	eax, DWORD PTR -12[rbp]
	cmp	eax, DWORD PTR -20[rbp]
	jl	.L13
	mov	eax, -1
	jmp	.L3
.L13:
	mov	eax, DWORD PTR -12[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -32[rbp]
	add	rax, rdx
	mov	rax, QWORD PTR [rax]
	mov	edx, 16
	mov	esi, 0
	mov	rdi, rax
	call	strtoul@PLT
	mov	DWORD PTR g_value[rip], eax
	jmp	.L14
.L11:
	mov	eax, DWORD PTR g_is_write[rip]
	test	eax, eax
	je	.L15
	mov	eax, DWORD PTR -12[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -32[rbp]
	add	rax, rdx
	mov	rax, QWORD PTR [rax]
	mov	edx, 16
	mov	esi, 0
	mov	rdi, rax
	call	strtoul@PLT
	mov	DWORD PTR g_value[rip], eax
	jmp	.L14
.L15:
	mov	eax, DWORD PTR -12[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -32[rbp]
	add	rax, rdx
	mov	rax, QWORD PTR [rax]
	mov	edx, 16
	mov	esi, 0
	mov	rdi, rax
	call	strtoul@PLT
	mov	DWORD PTR g_count[rip], eax
.L14:
	mov	eax, 0
.L3:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	parse_cmdline, .-parse_cmdline
	.section	.rodata
.LC3:
	.string	"\n0x%08X: "
.LC4:
	.string	" %02X"
.LC5:
	.string	" %04X"
.LC6:
	.string	" %08X"
.LC7:
	.string	"\n"
	.text
	.globl	read_mem
	.type	read_mem, @function
read_mem:
.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 -48[rbp], edx
	mov	rax, QWORD PTR -40[rbp]
	mov	QWORD PTR -24[rbp], rax
	mov	rax, QWORD PTR -40[rbp]
	mov	QWORD PTR -16[rbp], rax
	mov	rax, QWORD PTR -40[rbp]
	mov	QWORD PTR -8[rbp], rax
	cmp	DWORD PTR -48[rbp], 4
	je	.L17
	cmp	DWORD PTR -48[rbp], 4
	ja	.L18
	cmp	DWORD PTR -48[rbp], 1
	je	.L19
	cmp	DWORD PTR -48[rbp], 2
	je	.L20
	jmp	.L18
.L19:
	mov	DWORD PTR -28[rbp], 0
	jmp	.L21
.L23:
	mov	eax, DWORD PTR -28[rbp]
	and	eax, 15
	test	eax, eax
	jne	.L22
	mov	rax, QWORD PTR g_paddr[rip]
	mov	esi, eax
	lea	rdi, .LC3[rip]
	mov	eax, 0
	call	printf@PLT
.L22:
	mov	eax, DWORD PTR -28[rbp]
	movsx	rdx, eax
	mov	rax, QWORD PTR -24[rbp]
	add	rax, rdx
	movzx	eax, BYTE PTR [rax]
	movzx	eax, al
	mov	esi, eax
	lea	rdi, .LC4[rip]
	mov	eax, 0
	call	printf@PLT
	mov	rax, QWORD PTR g_paddr[rip]
	add	rax, 1
	mov	QWORD PTR g_paddr[rip], rax
	add	DWORD PTR -28[rbp], 1
.L21:
	mov	eax, DWORD PTR -28[rbp]
	cmp	DWORD PTR -44[rbp], eax
	ja	.L23
	jmp	.L18
.L20:
	mov	DWORD PTR -28[rbp], 0
	jmp	.L24
.L26:
	mov	eax, DWORD PTR -28[rbp]
	and	eax, 7
	test	eax, eax
	jne	.L25
	mov	rax, QWORD PTR g_paddr[rip]
	mov	esi, eax
	lea	rdi, .LC3[rip]
	mov	eax, 0
	call	printf@PLT
.L25:
	mov	eax, DWORD PTR -28[rbp]
	cdqe
	lea	rdx, [rax+rax]
	mov	rax, QWORD PTR -16[rbp]
	add	rax, rdx
	movzx	eax, WORD PTR [rax]
	movzx	eax, ax
	mov	esi, eax
	lea	rdi, .LC5[rip]
	mov	eax, 0
	call	printf@PLT
	mov	rax, QWORD PTR g_paddr[rip]
	add	rax, 2
	mov	QWORD PTR g_paddr[rip], rax
	add	DWORD PTR -28[rbp], 1
.L24:
	mov	eax, DWORD PTR -28[rbp]
	cmp	DWORD PTR -44[rbp], eax
	ja	.L26
	jmp	.L18
.L17:
	mov	DWORD PTR -28[rbp], 0
	jmp	.L27
.L29:
	mov	eax, DWORD PTR -28[rbp]
	and	eax, 3
	test	eax, eax
	jne	.L28
	mov	rax, QWORD PTR g_paddr[rip]
	mov	esi, eax
	lea	rdi, .LC3[rip]
	mov	eax, 0
	call	printf@PLT
.L28:
	mov	eax, DWORD PTR -28[rbp]
	cdqe
	lea	rdx, 0[0+rax*4]
	mov	rax, QWORD PTR -8[rbp]
	add	rax, rdx
	mov	eax, DWORD PTR [rax]
	mov	esi, eax
	lea	rdi, .LC6[rip]
	mov	eax, 0
	call	printf@PLT
	mov	rax, QWORD PTR g_paddr[rip]
	add	rax, 4
	mov	QWORD PTR g_paddr[rip], rax
	add	DWORD PTR -28[rbp], 1
.L27:
	mov	eax, DWORD PTR -28[rbp]
	cmp	DWORD PTR -44[rbp], eax
	ja	.L29
	nop
.L18:
	lea	rdi, .LC7[rip]
	call	puts@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	read_mem, .-read_mem
	.globl	write_mem
	.type	write_mem, @function
write_mem:
.LFB8:
	.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 -40[rbp], rdi
	mov	DWORD PTR -44[rbp], esi
	mov	DWORD PTR -48[rbp], edx
	mov	rax, QWORD PTR -40[rbp]
	mov	QWORD PTR -24[rbp], rax
	mov	rax, QWORD PTR -40[rbp]
	mov	QWORD PTR -16[rbp], rax
	mov	rax, QWORD PTR -40[rbp]
	mov	QWORD PTR -8[rbp], rax
	cmp	DWORD PTR -48[rbp], 4
	je	.L31
	cmp	DWORD PTR -48[rbp], 4
	ja	.L35
	cmp	DWORD PTR -48[rbp], 1
	je	.L33
	cmp	DWORD PTR -48[rbp], 2
	je	.L34
	jmp	.L35
.L33:
	mov	eax, DWORD PTR -44[rbp]
	mov	edx, eax
	mov	rax, QWORD PTR -24[rbp]
	mov	BYTE PTR [rax], dl
	jmp	.L32
.L34:
	mov	eax, DWORD PTR -44[rbp]
	mov	edx, eax
	mov	rax, QWORD PTR -16[rbp]
	mov	WORD PTR [rax], dx
	jmp	.L32
.L31:
	mov	rax, QWORD PTR -8[rbp]
	mov	edx, DWORD PTR -44[rbp]
	mov	DWORD PTR [rax], edx
	nop
.L32:
.L35:
	nop
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	write_mem, .-write_mem
	.section	.rodata
	.align 8
.LC8:
	.string	"Usage:\n\nRead memory: memtool [-8 | -16 | -32] <phys addr> <count>\nWrite memory: memtool [-8 | -16 | -32] <phys addr>=<value>\n\nDefault access size is 32-bit.\n\nAddress, count and value are all in hex."
	.align 8
.LC9:
	.string	"Writing %d-bit value 0x%X to address 0x%08X\n"
	.align 8
.LC10:
	.string	"Reading 0x%X count starting at address 0x%08X\n"
.LC11:
	.string	"/dev/mem"
	.align 8
.LC12:
	.string	"Open /dev/mem error, maybe check permission."
.LC13:
	.string	"Error mapping address"
	.text
	.globl	main
	.type	main, @function
main:
.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, 48
	mov	DWORD PTR -36[rbp], edi
	mov	QWORD PTR -48[rbp], rsi
	mov	rdx, QWORD PTR -48[rbp]
	mov	eax, DWORD PTR -36[rbp]
	mov	rsi, rdx
	mov	edi, eax
	call	parse_cmdline
	test	eax, eax
	je	.L37
	lea	rdi, .LC8[rip]
	call	puts@PLT
	mov	eax, 1
	jmp	.L38
.L37:
	mov	eax, DWORD PTR g_size[rip]
	neg	eax
	movsx	rdx, eax
	mov	rax, QWORD PTR g_paddr[rip]
	and	rax, rdx
	mov	QWORD PTR g_paddr[rip], rax
	mov	rax, QWORD PTR g_paddr[rip]
	and	rax, -4096
	mov	QWORD PTR -24[rbp], rax
	mov	rax, QWORD PTR g_paddr[rip]
	mov	edx, eax
	mov	rax, QWORD PTR -24[rbp]
	mov	ecx, edx
	sub	ecx, eax
	mov	eax, DWORD PTR g_count[rip]
	mov	edx, DWORD PTR g_size[rip]
	imul	eax, edx
	add	eax, ecx
	mov	DWORD PTR -32[rbp], eax
	mov	eax, DWORD PTR -32[rbp]
	add	eax, 4095
	and	eax, -4096
	mov	DWORD PTR -32[rbp], eax
	mov	eax, DWORD PTR g_is_write[rip]
	test	eax, eax
	je	.L39
	mov	rax, QWORD PTR g_paddr[rip]
	mov	ecx, eax
	mov	eax, DWORD PTR g_value[rip]
	mov	edx, DWORD PTR g_size[rip]
	lea	esi, 0[0+rdx*8]
	mov	edx, eax
	lea	rdi, .LC9[rip]
	mov	eax, 0
	call	printf@PLT
	jmp	.L40
.L39:
	mov	rax, QWORD PTR g_paddr[rip]
	mov	edx, eax
	mov	eax, DWORD PTR g_count[rip]
	mov	esi, eax
	lea	rdi, .LC10[rip]
	mov	eax, 0
	call	printf@PLT
.L40:
	mov	edx, 0
	mov	esi, 2
	lea	rdi, .LC11[rip]
	mov	eax, 0
	call	open@PLT
	mov	DWORD PTR -28[rbp], eax
	cmp	DWORD PTR -28[rbp], 0
	jns	.L41
	lea	rdi, .LC12[rip]
	call	puts@PLT
	mov	eax, 1
	jmp	.L38
.L41:
	mov	rcx, QWORD PTR -24[rbp]
	mov	eax, DWORD PTR -32[rbp]
	mov	edx, DWORD PTR -28[rbp]
	mov	r9, rcx
	mov	r8d, edx
	mov	ecx, 1
	mov	edx, 3
	mov	rsi, rax
	mov	edi, 0
	call	mmap@PLT
	mov	QWORD PTR -16[rbp], rax
	cmp	QWORD PTR -16[rbp], 0
	jne	.L42
	lea	rdi, .LC13[rip]
	call	puts@PLT
	mov	eax, DWORD PTR -28[rbp]
	mov	edi, eax
	call	close@PLT
	mov	eax, 1
	jmp	.L38
.L42:
	mov	rax, QWORD PTR -16[rbp]
	mov	edx, eax
	mov	rax, QWORD PTR g_paddr[rip]
	sub	rax, QWORD PTR -24[rbp]
	add	rax, rdx
	mov	QWORD PTR -8[rbp], rax
	mov	eax, DWORD PTR g_is_write[rip]
	test	eax, eax
	je	.L43
	mov	eax, DWORD PTR g_size[rip]
	mov	edx, eax
	mov	ecx, DWORD PTR g_value[rip]
	mov	rax, QWORD PTR -8[rbp]
	mov	esi, ecx
	mov	rdi, rax
	call	write_mem
	jmp	.L44
.L43:
	mov	eax, DWORD PTR g_size[rip]
	mov	edx, eax
	mov	ecx, DWORD PTR g_count[rip]
	mov	rax, QWORD PTR -8[rbp]
	mov	esi, ecx
	mov	rdi, rax
	call	read_mem
.L44:
	mov	edx, DWORD PTR -32[rbp]
	mov	rax, QWORD PTR -16[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	munmap@PLT
	mov	eax, DWORD PTR -28[rbp]
	mov	edi, eax
	call	close@PLT
	mov	eax, 0
.L38:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.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	"87277.c"
	.text
	.global	g_size
	.data
	.align	2
	.type	g_size, %object
	.size	g_size, 4
g_size:
	.word	4
	.comm	g_paddr,4,4
	.comm	g_is_write,4,4
	.global	g_value
	.bss
	.align	2
	.type	g_value, %object
	.size	g_value, 4
g_value:
	.space	4
	.global	g_count
	.data
	.align	2
	.type	g_count, %object
	.size	g_count, 4
g_count:
	.word	1
	.section	.rodata
	.align	2
.LC0:
	.ascii	"-8\000"
	.align	2
.LC1:
	.ascii	"-16\000"
	.align	2
.LC2:
	.ascii	"-32\000"
	.text
	.align	2
	.global	parse_cmdline
	.syntax unified
	.arm
	.fpu softvfp
	.type	parse_cmdline, %function
parse_cmdline:
	@ 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]
	str	r1, [fp, #-20]
	mov	r3, #0
	str	r3, [fp, #-12]
	ldr	r3, [fp, #-16]
	cmp	r3, #1
	bgt	.L2
	mvn	r3, #0
	b	.L3
.L2:
	ldr	r3, [fp, #-12]
	add	r3, r3, #1
	str	r3, [fp, #-12]
	ldr	r3, [fp, #-12]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-20]
	add	r3, r2, r3
	ldr	r3, [r3]
	ldr	r1, .L16
	mov	r0, r3
	bl	strcmp
	mov	r3, r0
	cmp	r3, #0
	bne	.L4
	ldr	r3, [fp, #-12]
	add	r3, r3, #1
	str	r3, [fp, #-12]
	ldr	r3, .L16+4
	mov	r2, #1
	str	r2, [r3]
	b	.L5
.L4:
	ldr	r3, [fp, #-12]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-20]
	add	r3, r2, r3
	ldr	r3, [r3]
	ldr	r1, .L16+8
	mov	r0, r3
	bl	strcmp
	mov	r3, r0
	cmp	r3, #0
	bne	.L6
	ldr	r3, [fp, #-12]
	add	r3, r3, #1
	str	r3, [fp, #-12]
	ldr	r3, .L16+4
	mov	r2, #2
	str	r2, [r3]
	b	.L5
.L6:
	ldr	r3, [fp, #-12]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-20]
	add	r3, r2, r3
	ldr	r3, [r3]
	ldr	r1, .L16+12
	mov	r0, r3
	bl	strcmp
	mov	r3, r0
	cmp	r3, #0
	bne	.L5
	ldr	r3, [fp, #-12]
	add	r3, r3, #1
	str	r3, [fp, #-12]
	ldr	r3, .L16+4
	mov	r2, #4
	str	r2, [r3]
.L5:
	ldr	r2, [fp, #-12]
	ldr	r3, [fp, #-16]
	cmp	r2, r3
	blt	.L7
	mvn	r3, #0
	b	.L3
.L7:
	ldr	r3, [fp, #-12]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-20]
	add	r3, r2, r3
	ldr	r3, [r3]
	mov	r2, #16
	mov	r1, #0
	mov	r0, r3
	bl	strtoul
	mov	r3, r0
	ldr	r2, .L16+16
	str	r3, [r2]
	ldr	r3, .L16+16
	ldr	r3, [r3]
	cmp	r3, #0
	bne	.L8
	mvn	r3, #0
	b	.L3
.L8:
	ldr	r3, [fp, #-12]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-20]
	add	r3, r2, r3
	ldr	r3, [r3]
	mov	r1, #61
	mov	r0, r3
	bl	strchr
	str	r0, [fp, #-8]
	ldr	r3, [fp, #-8]
	cmp	r3, #0
	beq	.L9
	ldr	r3, .L16+20
	mov	r2, #1
	str	r2, [r3]
	ldr	r0, [fp, #-8]
	bl	strlen
	mov	r3, r0
	cmp	r3, #1
	bls	.L9
	ldr	r3, [fp, #-8]
	add	r3, r3, #1
	str	r3, [fp, #-8]
	mov	r2, #16
	mov	r1, #0
	ldr	r0, [fp, #-8]
	bl	strtoul
	mov	r3, r0
	ldr	r2, .L16+24
	str	r3, [r2]
	mov	r3, #0
	b	.L3
.L9:
	ldr	r3, [fp, #-12]
	add	r3, r3, #1
	str	r3, [fp, #-12]
	ldr	r2, [fp, #-12]
	ldr	r3, [fp, #-16]
	cmp	r2, r3
	blt	.L10
	mvn	r3, #0
	b	.L3
.L10:
	ldr	r3, [fp, #-12]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-20]
	add	r3, r2, r3
	ldr	r3, [r3]
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #61
	bne	.L11
	ldr	r3, .L16+20
	mov	r2, #1
	str	r2, [r3]
	ldr	r3, [fp, #-12]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-20]
	add	r3, r2, r3
	ldr	r3, [r3]
	mov	r0, r3
	bl	strlen
	mov	r3, r0
	cmp	r3, #1
	bls	.L12
	ldr	r3, [fp, #-12]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-20]
	add	r3, r2, r3
	ldr	r2, [r3]
	add	r2, r2, #1
	str	r2, [r3]
	b	.L13
.L12:
	ldr	r3, [fp, #-12]
	add	r3, r3, #1
	str	r3, [fp, #-12]
	ldr	r2, [fp, #-12]
	ldr	r3, [fp, #-16]
	cmp	r2, r3
	blt	.L13
	mvn	r3, #0
	b	.L3
.L13:
	ldr	r3, [fp, #-12]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-20]
	add	r3, r2, r3
	ldr	r3, [r3]
	mov	r2, #16
	mov	r1, #0
	mov	r0, r3
	bl	strtoul
	mov	r3, r0
	ldr	r2, .L16+24
	str	r3, [r2]
	b	.L14
.L11:
	ldr	r3, .L16+20
	ldr	r3, [r3]
	cmp	r3, #0
	beq	.L15
	ldr	r3, [fp, #-12]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-20]
	add	r3, r2, r3
	ldr	r3, [r3]
	mov	r2, #16
	mov	r1, #0
	mov	r0, r3
	bl	strtoul
	mov	r3, r0
	ldr	r2, .L16+24
	str	r3, [r2]
	b	.L14
.L15:
	ldr	r3, [fp, #-12]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-20]
	add	r3, r2, r3
	ldr	r3, [r3]
	mov	r2, #16
	mov	r1, #0
	mov	r0, r3
	bl	strtoul
	mov	r3, r0
	ldr	r2, .L16+28
	str	r3, [r2]
.L14:
	mov	r3, #0
.L3:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L17:
	.align	2
.L16:
	.word	.LC0
	.word	g_size
	.word	.LC1
	.word	.LC2
	.word	g_paddr
	.word	g_is_write
	.word	g_value
	.word	g_count
	.size	parse_cmdline, .-parse_cmdline
	.section	.rodata
	.align	2
.LC3:
	.ascii	"\0120x%08X: \000"
	.align	2
.LC4:
	.ascii	" %02X\000"
	.align	2
.LC5:
	.ascii	" %04X\000"
	.align	2
.LC6:
	.ascii	" %08X\000"
	.align	2
.LC7:
	.ascii	"\012\000"
	.text
	.align	2
	.global	read_mem
	.syntax unified
	.arm
	.fpu softvfp
	.type	read_mem, %function
read_mem:
	@ 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, #-24]
	str	r1, [fp, #-28]
	str	r2, [fp, #-32]
	ldr	r3, [fp, #-24]
	str	r3, [fp, #-16]
	ldr	r3, [fp, #-24]
	str	r3, [fp, #-12]
	ldr	r3, [fp, #-24]
	str	r3, [fp, #-8]
	ldr	r3, [fp, #-32]
	cmp	r3, #4
	beq	.L19
	ldr	r3, [fp, #-32]
	cmp	r3, #4
	bhi	.L20
	ldr	r3, [fp, #-32]
	cmp	r3, #1
	beq	.L21
	ldr	r3, [fp, #-32]
	cmp	r3, #2
	beq	.L22
	b	.L20
.L21:
	mov	r3, #0
	str	r3, [fp, #-20]
	b	.L23
.L25:
	ldr	r3, [fp, #-20]
	and	r3, r3, #15
	cmp	r3, #0
	bne	.L24
	ldr	r3, .L32
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, .L32+4
	bl	printf
.L24:
	ldr	r3, [fp, #-20]
	ldr	r2, [fp, #-16]
	add	r3, r2, r3
	ldrb	r3, [r3]	@ zero_extendqisi2
	mov	r1, r3
	ldr	r0, .L32+8
	bl	printf
	ldr	r3, .L32
	ldr	r3, [r3]
	add	r3, r3, #1
	ldr	r2, .L32
	str	r3, [r2]
	ldr	r3, [fp, #-20]
	add	r3, r3, #1
	str	r3, [fp, #-20]
.L23:
	ldr	r3, [fp, #-20]
	ldr	r2, [fp, #-28]
	cmp	r2, r3
	bhi	.L25
	b	.L20
.L22:
	mov	r3, #0
	str	r3, [fp, #-20]
	b	.L26
.L28:
	ldr	r3, [fp, #-20]
	and	r3, r3, #7
	cmp	r3, #0
	bne	.L27
	ldr	r3, .L32
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, .L32+4
	bl	printf
.L27:
	ldr	r3, [fp, #-20]
	lsl	r3, r3, #1
	ldr	r2, [fp, #-12]
	add	r3, r2, r3
	ldrh	r3, [r3]
	mov	r1, r3
	ldr	r0, .L32+12
	bl	printf
	ldr	r3, .L32
	ldr	r3, [r3]
	add	r3, r3, #2
	ldr	r2, .L32
	str	r3, [r2]
	ldr	r3, [fp, #-20]
	add	r3, r3, #1
	str	r3, [fp, #-20]
.L26:
	ldr	r3, [fp, #-20]
	ldr	r2, [fp, #-28]
	cmp	r2, r3
	bhi	.L28
	b	.L20
.L19:
	mov	r3, #0
	str	r3, [fp, #-20]
	b	.L29
.L31:
	ldr	r3, [fp, #-20]
	and	r3, r3, #3
	cmp	r3, #0
	bne	.L30
	ldr	r3, .L32
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, .L32+4
	bl	printf
.L30:
	ldr	r3, [fp, #-20]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-8]
	add	r3, r2, r3
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, .L32+16
	bl	printf
	ldr	r3, .L32
	ldr	r3, [r3]
	add	r3, r3, #4
	ldr	r2, .L32
	str	r3, [r2]
	ldr	r3, [fp, #-20]
	add	r3, r3, #1
	str	r3, [fp, #-20]
.L29:
	ldr	r3, [fp, #-20]
	ldr	r2, [fp, #-28]
	cmp	r2, r3
	bhi	.L31
	nop
.L20:
	ldr	r0, .L32+20
	bl	puts
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L33:
	.align	2
.L32:
	.word	g_paddr
	.word	.LC3
	.word	.LC4
	.word	.LC5
	.word	.LC6
	.word	.LC7
	.size	read_mem, .-read_mem
	.align	2
	.global	write_mem
	.syntax unified
	.arm
	.fpu softvfp
	.type	write_mem, %function
write_mem:
	@ args = 0, pretend = 0, frame = 32
	@ frame_needed = 1, uses_anonymous_args = 0
	@ link register save eliminated.
	str	fp, [sp, #-4]!
	add	fp, sp, #0
	sub	sp, sp, #36
	str	r0, [fp, #-24]
	str	r1, [fp, #-28]
	str	r2, [fp, #-32]
	ldr	r3, [fp, #-24]
	str	r3, [fp, #-16]
	ldr	r3, [fp, #-24]
	str	r3, [fp, #-12]
	ldr	r3, [fp, #-24]
	str	r3, [fp, #-8]
	ldr	r3, [fp, #-32]
	cmp	r3, #4
	beq	.L35
	ldr	r3, [fp, #-32]
	cmp	r3, #4
	bhi	.L39
	ldr	r3, [fp, #-32]
	cmp	r3, #1
	beq	.L37
	ldr	r3, [fp, #-32]
	cmp	r3, #2
	beq	.L38
	b	.L39
.L37:
	ldr	r3, [fp, #-28]
	and	r2, r3, #255
	ldr	r3, [fp, #-16]
	strb	r2, [r3]
	b	.L36
.L38:
	ldr	r3, [fp, #-28]
	lsl	r3, r3, #16
	lsr	r2, r3, #16
	ldr	r3, [fp, #-12]
	strh	r2, [r3]	@ movhi
	b	.L36
.L35:
	ldr	r3, [fp, #-8]
	ldr	r2, [fp, #-28]
	str	r2, [r3]
	nop
.L36:
.L39:
	nop
	add	sp, fp, #0
	@ sp needed
	ldr	fp, [sp], #4
	bx	lr
	.size	write_mem, .-write_mem
	.section	.rodata
	.align	2
.LC8:
	.ascii	"Usage:\012\012Read memory: memtool [-8 | -16 | -32]"
	.ascii	" <phys addr> <count>\012Write memory: memtool [-8 |"
	.ascii	" -16 | -32] <phys addr>=<value>\012\012Default acce"
	.ascii	"ss size is 32-bit.\012\012Address, count and value "
	.ascii	"are all in hex.\000"
	.align	2
.LC9:
	.ascii	"Writing %d-bit value 0x%X to address 0x%08X\012\000"
	.align	2
.LC10:
	.ascii	"Reading 0x%X count starting at address 0x%08X\012\000"
	.align	2
.LC11:
	.ascii	"/dev/mem\000"
	.align	2
.LC12:
	.ascii	"Open /dev/mem error, maybe check permission.\000"
	.align	2
.LC13:
	.ascii	"Error mapping address\000"
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 32
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #40
	str	r0, [fp, #-32]
	str	r1, [fp, #-36]
	ldr	r1, [fp, #-36]
	ldr	r0, [fp, #-32]
	bl	parse_cmdline
	mov	r3, r0
	cmp	r3, #0
	beq	.L41
	ldr	r0, .L49
	bl	puts
	mov	r3, #1
	b	.L42
.L41:
	ldr	r3, .L49+4
	ldr	r3, [r3]
	rsb	r3, r3, #0
	mov	r2, r3
	ldr	r3, .L49+8
	ldr	r3, [r3]
	and	r3, r3, r2
	ldr	r2, .L49+8
	str	r3, [r2]
	ldr	r3, .L49+8
	ldr	r3, [r3]
	bic	r3, r3, #4080
	bic	r3, r3, #15
	str	r3, [fp, #-24]
	ldr	r3, .L49+8
	ldr	r2, [r3]
	ldr	r3, [fp, #-24]
	sub	r2, r2, r3
	ldr	r3, .L49+12
	ldr	r3, [r3]
	ldr	r1, .L49+4
	ldr	r1, [r1]
	mul	r3, r1, r3
	add	r3, r2, r3
	str	r3, [fp, #-20]
	ldr	r3, [fp, #-20]
	add	r3, r3, #4080
	add	r3, r3, #15
	bic	r3, r3, #4080
	bic	r3, r3, #15
	str	r3, [fp, #-20]
	ldr	r3, .L49+16
	ldr	r3, [r3]
	cmp	r3, #0
	beq	.L43
	ldr	r3, .L49+4
	ldr	r3, [r3]
	lsl	r1, r3, #3
	ldr	r3, .L49+20
	ldr	r2, [r3]
	ldr	r3, .L49+8
	ldr	r3, [r3]
	ldr	r0, .L49+24
	bl	printf
	b	.L44
.L43:
	ldr	r3, .L49+12
	ldr	r3, [r3]
	ldr	r2, .L49+8
	ldr	r2, [r2]
	mov	r1, r3
	ldr	r0, .L49+28
	bl	printf
.L44:
	mov	r2, #0
	mov	r1, #2
	ldr	r0, .L49+32
	bl	open
	str	r0, [fp, #-16]
	ldr	r3, [fp, #-16]
	cmp	r3, #0
	bge	.L45
	ldr	r0, .L49+36
	bl	puts
	mov	r3, #1
	b	.L42
.L45:
	ldr	r3, [fp, #-24]
	str	r3, [sp, #4]
	ldr	r3, [fp, #-16]
	str	r3, [sp]
	mov	r3, #1
	mov	r2, #3
	ldr	r1, [fp, #-20]
	mov	r0, #0
	bl	mmap
	str	r0, [fp, #-12]
	ldr	r3, [fp, #-12]
	cmp	r3, #0
	bne	.L46
	ldr	r0, .L49+40
	bl	puts
	ldr	r0, [fp, #-16]
	bl	close
	mov	r3, #1
	b	.L42
.L46:
	ldr	r3, .L49+8
	ldr	r2, [r3]
	ldr	r3, [fp, #-24]
	sub	r2, r2, r3
	ldr	r3, [fp, #-12]
	add	r3, r2, r3
	str	r3, [fp, #-8]
	ldr	r3, .L49+16
	ldr	r3, [r3]
	cmp	r3, #0
	beq	.L47
	ldr	r3, .L49+20
	ldr	r3, [r3]
	ldr	r2, .L49+4
	ldr	r2, [r2]
	mov	r1, r3
	ldr	r0, [fp, #-8]
	bl	write_mem
	b	.L48
.L47:
	ldr	r3, .L49+12
	ldr	r3, [r3]
	ldr	r2, .L49+4
	ldr	r2, [r2]
	mov	r1, r3
	ldr	r0, [fp, #-8]
	bl	read_mem
.L48:
	ldr	r1, [fp, #-20]
	ldr	r0, [fp, #-12]
	bl	munmap
	ldr	r0, [fp, #-16]
	bl	close
	mov	r3, #0
.L42:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L50:
	.align	2
.L49:
	.word	.LC8
	.word	g_size
	.word	g_paddr
	.word	g_count
	.word	g_is_write
	.word	g_value
	.word	.LC9
	.word	.LC10
	.word	.LC11
	.word	.LC12
	.word	.LC13
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
