	.file	"82818.c"
	.intel_syntax noprefix
	.text
	.type	write_bytes, @function
write_bytes:
.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 -24[rbp], rdi
	mov	QWORD PTR -32[rbp], rsi
	mov	QWORD PTR -8[rbp], 0
	jmp	.L2
.L3:
	mov	rdx, QWORD PTR -24[rbp]
	mov	rax, QWORD PTR -8[rbp]
	add	rax, rdx
	mov	rdx, QWORD PTR -8[rbp]
	mov	BYTE PTR [rax], dl
	add	QWORD PTR -8[rbp], 1
.L2:
	mov	rax, QWORD PTR -8[rbp]
	cmp	rax, QWORD PTR -32[rbp]
	jb	.L3
	nop
	nop
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	write_bytes, .-write_bytes
	.section	.rodata
.LC0:
	.string	"/proc/self/pagemap"
	.text
	.type	virt_to_pfn, @function
virt_to_pfn:
.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	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	esi, 0
	lea	rdi, .LC0[rip]
	mov	eax, 0
	call	open@PLT
	mov	DWORD PTR -20[rbp], eax
	cmp	DWORD PTR -20[rbp], 0
	jns	.L5
	mov	rax, -1
	jmp	.L7
.L5:
	mov	rax, QWORD PTR -40[rbp]
	shr	rax, 12
	sal	rax, 3
	mov	rcx, rax
	mov	eax, DWORD PTR -20[rbp]
	mov	edx, 0
	mov	rsi, rcx
	mov	edi, eax
	call	lseek@PLT
	lea	rcx, -16[rbp]
	mov	eax, DWORD PTR -20[rbp]
	mov	edx, 8
	mov	rsi, rcx
	mov	edi, eax
	call	read@PLT
	mov	eax, DWORD PTR -20[rbp]
	mov	edi, eax
	call	close@PLT
	mov	rax, QWORD PTR -16[rbp]
	movabs	rdx, 36028797018963967
	and	rax, rdx
.L7:
	mov	rsi, QWORD PTR -8[rbp]
	sub	rsi, QWORD PTR fs:40
	je	.L8
	call	__stack_chk_fail@PLT
.L8:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	virt_to_pfn, .-virt_to_pfn
	.section	.rodata
.LC1:
	.string	"/proc/kpageflags"
	.align 8
.LC2:
	.string	"Head page flags (%lx) is invalid\n"
	.align 8
.LC3:
	.string	"Tail page flags (%lx) is invalid\n"
	.text
	.type	check_page_flags, @function
check_page_flags:
.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	QWORD PTR -40[rbp], rdi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	esi, 0
	lea	rdi, .LC1[rip]
	mov	eax, 0
	call	open@PLT
	mov	DWORD PTR -20[rbp], eax
	cmp	DWORD PTR -20[rbp], 0
	jns	.L10
	mov	eax, -1
	jmp	.L17
.L10:
	mov	rax, QWORD PTR -40[rbp]
	sal	rax, 3
	mov	rcx, rax
	mov	eax, DWORD PTR -20[rbp]
	mov	edx, 0
	mov	rsi, rcx
	mov	edi, eax
	call	lseek@PLT
	lea	rcx, -16[rbp]
	mov	eax, DWORD PTR -20[rbp]
	mov	edx, 8
	mov	rsi, rcx
	mov	edi, eax
	call	read@PLT
	mov	rax, QWORD PTR -16[rbp]
	and	eax, 163840
	cmp	rax, 163840
	je	.L12
	mov	eax, DWORD PTR -20[rbp]
	mov	edi, eax
	call	close@PLT
	mov	rax, QWORD PTR -16[rbp]
	mov	rsi, rax
	lea	rdi, .LC2[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, -1
	jmp	.L17
.L12:
	mov	DWORD PTR -24[rbp], 1
	jmp	.L13
.L16:
	lea	rcx, -16[rbp]
	mov	eax, DWORD PTR -20[rbp]
	mov	edx, 8
	mov	rsi, rcx
	mov	edi, eax
	call	read@PLT
	mov	rax, QWORD PTR -16[rbp]
	and	eax, 196608
	cmp	rax, 196608
	jne	.L14
	mov	rax, QWORD PTR -16[rbp]
	and	eax, 163840
	cmp	rax, 163840
	jne	.L15
.L14:
	mov	eax, DWORD PTR -20[rbp]
	mov	edi, eax
	call	close@PLT
	mov	rax, QWORD PTR -16[rbp]
	mov	rsi, rax
	lea	rdi, .LC3[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, -1
	jmp	.L17
.L15:
	add	DWORD PTR -24[rbp], 1
.L13:
	mov	eax, DWORD PTR -24[rbp]
	cmp	eax, 511
	jbe	.L16
	mov	eax, DWORD PTR -20[rbp]
	mov	edi, eax
	call	close@PLT
	mov	eax, 0
.L17:
	mov	rdx, QWORD PTR -8[rbp]
	sub	rdx, QWORD PTR fs:40
	je	.L18
	call	__stack_chk_fail@PLT
.L18:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	check_page_flags, .-check_page_flags
	.section	.rodata
.LC4:
	.string	"mmap"
.LC5:
	.string	"virt_to_pfn"
	.align 8
.LC6:
	.string	"Returned address is %p whose pfn is %lx\n"
.LC7:
	.string	"check_page_flags"
.LC8:
	.string	"munmap"
	.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, 32
	mov	DWORD PTR -20[rbp], edi
	mov	QWORD PTR -32[rbp], rsi
	mov	r9d, 0
	mov	r8d, -1
	mov	ecx, 262178
	mov	edx, 3
	mov	esi, 2097152
	mov	edi, 0
	call	mmap@PLT
	mov	QWORD PTR -16[rbp], rax
	cmp	QWORD PTR -16[rbp], -1
	jne	.L20
	lea	rdi, .LC4[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L20:
	mov	rax, QWORD PTR -16[rbp]
	mov	esi, 2097152
	mov	rdi, rax
	call	write_bytes
	mov	rax, QWORD PTR -16[rbp]
	mov	rdi, rax
	call	virt_to_pfn
	mov	QWORD PTR -8[rbp], rax
	cmp	QWORD PTR -8[rbp], -1
	jne	.L21
	mov	rax, QWORD PTR -16[rbp]
	mov	esi, 2097152
	mov	rdi, rax
	call	munmap@PLT
	lea	rdi, .LC5[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L21:
	mov	rdx, QWORD PTR -8[rbp]
	mov	rax, QWORD PTR -16[rbp]
	mov	rsi, rax
	lea	rdi, .LC6[rip]
	mov	eax, 0
	call	printf@PLT
	mov	rax, QWORD PTR -8[rbp]
	mov	rdi, rax
	call	check_page_flags
	test	eax, eax
	jns	.L22
	mov	rax, QWORD PTR -16[rbp]
	mov	esi, 2097152
	mov	rdi, rax
	call	munmap@PLT
	lea	rdi, .LC7[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L22:
	mov	rax, QWORD PTR -16[rbp]
	mov	esi, 2097152
	mov	rdi, rax
	call	munmap@PLT
	test	eax, eax
	je	.L23
	lea	rdi, .LC8[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L23:
	mov	eax, 0
	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	"82818.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	write_bytes, %function
write_bytes:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 1, uses_anonymous_args = 0
	@ link register save eliminated.
	str	fp, [sp, #-4]!
	add	fp, sp, #0
	sub	sp, sp, #20
	str	r0, [fp, #-16]
	str	r1, [fp, #-20]
	mov	r3, #0
	str	r3, [fp, #-8]
	b	.L2
.L3:
	ldr	r2, [fp, #-16]
	ldr	r3, [fp, #-8]
	add	r3, r2, r3
	ldr	r2, [fp, #-8]
	and	r2, r2, #255
	strb	r2, [r3]
	ldr	r3, [fp, #-8]
	add	r3, r3, #1
	str	r3, [fp, #-8]
.L2:
	ldr	r2, [fp, #-8]
	ldr	r3, [fp, #-20]
	cmp	r2, r3
	bcc	.L3
	nop
	nop
	add	sp, fp, #0
	@ sp needed
	ldr	fp, [sp], #4
	bx	lr
	.size	write_bytes, .-write_bytes
	.section	.rodata
	.align	2
.LC0:
	.ascii	"/proc/self/pagemap\000"
	.align	2
.LC1:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	virt_to_pfn, %function
virt_to_pfn:
	@ 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]
	ldr	r3, .L9
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	mov	r1, #0
	ldr	r0, .L9+4
	bl	open
	str	r0, [fp, #-12]
	ldr	r3, [fp, #-12]
	cmp	r3, #0
	bge	.L5
	mvn	r3, #0
	b	.L7
.L5:
	ldr	r3, [fp, #-24]
	lsr	r3, r3, #12
	lsl	r3, r3, #2
	mov	r2, #0
	mov	r1, r3
	ldr	r0, [fp, #-12]
	bl	lseek
	sub	r3, fp, #16
	mov	r2, #4
	mov	r1, r3
	ldr	r0, [fp, #-12]
	bl	read
	ldr	r0, [fp, #-12]
	bl	close
	ldr	r3, [fp, #-16]
.L7:
	ldr	r2, .L9
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L8
	bl	__stack_chk_fail
.L8:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L10:
	.align	2
.L9:
	.word	.LC1
	.word	.LC0
	.size	virt_to_pfn, .-virt_to_pfn
	.section	.rodata
	.align	2
.LC2:
	.ascii	"/proc/kpageflags\000"
	.align	2
.LC3:
	.ascii	"Head page flags (%lx) is invalid\012\000"
	.align	2
.LC4:
	.ascii	"Tail page flags (%lx) is invalid\012\000"
	.align	2
.LC5:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	check_page_flags, %function
check_page_flags:
	@ 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]
	ldr	r3, .L21
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	mov	r1, #0
	ldr	r0, .L21+4
	bl	open
	str	r0, [fp, #-12]
	ldr	r3, [fp, #-12]
	cmp	r3, #0
	bge	.L12
	mvn	r3, #0
	b	.L19
.L12:
	ldr	r3, [fp, #-24]
	lsl	r3, r3, #2
	mov	r2, #0
	mov	r1, r3
	ldr	r0, [fp, #-12]
	bl	lseek
	sub	r3, fp, #20
	mov	r2, #4
	mov	r1, r3
	ldr	r0, [fp, #-12]
	bl	read
	ldr	r3, [fp, #-20]
	and	r3, r3, #163840
	cmp	r3, #163840
	beq	.L14
	ldr	r0, [fp, #-12]
	bl	close
	ldr	r3, [fp, #-20]
	mov	r1, r3
	ldr	r0, .L21+8
	bl	printf
	mvn	r3, #0
	b	.L19
.L14:
	mov	r3, #1
	str	r3, [fp, #-16]
	b	.L15
.L18:
	sub	r3, fp, #20
	mov	r2, #4
	mov	r1, r3
	ldr	r0, [fp, #-12]
	bl	read
	ldr	r3, [fp, #-20]
	and	r3, r3, #196608
	cmp	r3, #196608
	bne	.L16
	ldr	r3, [fp, #-20]
	and	r3, r3, #163840
	cmp	r3, #163840
	bne	.L17
.L16:
	ldr	r0, [fp, #-12]
	bl	close
	ldr	r3, [fp, #-20]
	mov	r1, r3
	ldr	r0, .L21+12
	bl	printf
	mvn	r3, #0
	b	.L19
.L17:
	ldr	r3, [fp, #-16]
	add	r3, r3, #1
	str	r3, [fp, #-16]
.L15:
	ldr	r3, [fp, #-16]
	cmp	r3, #512
	bcc	.L18
	ldr	r0, [fp, #-12]
	bl	close
	mov	r3, #0
.L19:
	ldr	r2, .L21
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L20
	bl	__stack_chk_fail
.L20:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L22:
	.align	2
.L21:
	.word	.LC5
	.word	.LC2
	.word	.LC3
	.word	.LC4
	.size	check_page_flags, .-check_page_flags
	.section	.rodata
	.align	2
.LC6:
	.ascii	"mmap\000"
	.align	2
.LC7:
	.ascii	"virt_to_pfn\000"
	.align	2
.LC8:
	.ascii	"Returned address is %p whose pfn is %lx\012\000"
	.align	2
.LC9:
	.ascii	"check_page_flags\000"
	.align	2
.LC10:
	.ascii	"munmap\000"
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #24
	str	r0, [fp, #-16]
	str	r1, [fp, #-20]
	mov	r3, #0
	str	r3, [sp, #4]
	mvn	r3, #0
	str	r3, [sp]
	ldr	r3, .L29
	mov	r2, #3
	mov	r1, #2097152
	mov	r0, #0
	bl	mmap
	str	r0, [fp, #-12]
	ldr	r3, [fp, #-12]
	cmn	r3, #1
	bne	.L24
	ldr	r0, .L29+4
	bl	perror
	mov	r0, #1
	bl	exit
.L24:
	mov	r1, #2097152
	ldr	r0, [fp, #-12]
	bl	write_bytes
	ldr	r0, [fp, #-12]
	bl	virt_to_pfn
	str	r0, [fp, #-8]
	ldr	r3, [fp, #-8]
	cmn	r3, #1
	bne	.L25
	mov	r1, #2097152
	ldr	r0, [fp, #-12]
	bl	munmap
	ldr	r0, .L29+8
	bl	perror
	mov	r0, #1
	bl	exit
.L25:
	ldr	r2, [fp, #-8]
	ldr	r1, [fp, #-12]
	ldr	r0, .L29+12
	bl	printf
	ldr	r0, [fp, #-8]
	bl	check_page_flags
	mov	r3, r0
	cmp	r3, #0
	bge	.L26
	mov	r1, #2097152
	ldr	r0, [fp, #-12]
	bl	munmap
	ldr	r0, .L29+16
	bl	perror
	mov	r0, #1
	bl	exit
.L26:
	mov	r1, #2097152
	ldr	r0, [fp, #-12]
	bl	munmap
	mov	r3, r0
	cmp	r3, #0
	beq	.L27
	ldr	r0, .L29+20
	bl	perror
	mov	r0, #1
	bl	exit
.L27:
	mov	r3, #0
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L30:
	.align	2
.L29:
	.word	262178
	.word	.LC6
	.word	.LC7
	.word	.LC8
	.word	.LC9
	.word	.LC10
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
