	.file	"40791.c"
	.intel_syntax noprefix
	.text
	.globl	Code
	.section	.rodata
	.type	Code, @object
	.size	Code, 7
Code:
	.string	"\303f\203\374"
	.ascii	"u\371"
	.globl	EntryOffset
	.align 8
	.type	EntryOffset, @object
	.size	EntryOffset, 8
EntryOffset:
	.quad	1
.LC0:
	.string	"Unable to map pages"
.LC1:
	.string	"Mapped two pages at %p\n"
.LC2:
	.string	"Unprotecting page at %p\n"
	.align 8
.LC3:
	.string	"Unable to unprotect second page"
.LC4:
	.string	"Got back OK"
	.text
	.globl	main
	.type	main, @function
main:
.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
	call	getpagesize@PLT
	cdqe
	mov	QWORD PTR -16[rbp], rax
	mov	rax, QWORD PTR -16[rbp]
	add	rax, rax
	mov	r9d, 0
	mov	r8d, -1
	mov	ecx, 34
	mov	edx, 7
	mov	rsi, rax
	mov	edi, 0
	call	mmap@PLT
	mov	QWORD PTR -8[rbp], rax
	cmp	QWORD PTR -8[rbp], -1
	jne	.L2
	lea	rdi, .LC0[rip]
	call	puts@PLT
	mov	eax, 1
	jmp	.L3
.L2:
	mov	rax, QWORD PTR -8[rbp]
	mov	rsi, rax
	lea	rdi, .LC1[rip]
	mov	eax, 0
	call	printf@PLT
	mov	rdx, QWORD PTR -8[rbp]
	mov	rax, QWORD PTR -16[rbp]
	add	rax, rdx
	mov	rsi, rax
	lea	rdi, .LC2[rip]
	mov	eax, 0
	call	printf@PLT
	mov	rdx, QWORD PTR -8[rbp]
	mov	rax, QWORD PTR -16[rbp]
	lea	rcx, [rdx+rax]
	mov	rax, QWORD PTR -16[rbp]
	mov	edx, 0
	mov	rsi, rax
	mov	rdi, rcx
	call	mprotect@PLT
	test	eax, eax
	je	.L4
	lea	rdi, .LC3[rip]
	call	puts@PLT
	mov	eax, 1
	jmp	.L3
.L4:
	mov	rax, QWORD PTR -16[rbp]
	lea	rdx, -7[rax]
	mov	rax, QWORD PTR -8[rbp]
	add	rax, rdx
	mov	edx, DWORD PTR Code[rip]
	mov	DWORD PTR [rax], edx
	movzx	edx, WORD PTR Code[rip+4]
	mov	WORD PTR 4[rax], dx
	movzx	edx, BYTE PTR Code[rip+6]
	mov	BYTE PTR 6[rax], dl
	mov	eax, 0
	call	BlockSegv
	mov	edx, 1
	mov	rax, QWORD PTR -16[rbp]
	add	rax, rdx
	lea	rdx, -7[rax]
	mov	rax, QWORD PTR -8[rbp]
	add	rax, rdx
	mov	rdx, rax
	mov	eax, 0
	call	rdx
	lea	rdi, .LC4[rip]
	call	puts@PLT
	mov	eax, 0
.L3:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	main, .-main
	.section	.rodata
.LC5:
	.string	"Unable to block SEGV"
	.text
	.type	BlockSegv, @function
BlockSegv:
.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, 144
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	lea	rax, -144[rbp]
	mov	rdi, rax
	call	sigemptyset@PLT
	lea	rax, -144[rbp]
	mov	esi, 11
	mov	rdi, rax
	call	sigaddset@PLT
	lea	rax, -144[rbp]
	mov	edx, 0
	mov	rsi, rax
	mov	edi, 0
	call	sigprocmask@PLT
	test	eax, eax
	je	.L8
	lea	rdi, .LC5[rip]
	call	puts@PLT
	mov	edi, 1
	call	exit@PLT
.L8:
	nop
	mov	rax, QWORD PTR -8[rbp]
	sub	rax, QWORD PTR fs:40
	je	.L7
	call	__stack_chk_fail@PLT
.L7:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	BlockSegv, .-BlockSegv
	.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	"40791.c"
	.text
	.global	Code
	.section	.rodata
	.align	2
	.type	Code, %object
	.size	Code, 7
Code:
	.ascii	"\303f\203\374\000u\371"
	.global	EntryOffset
	.align	2
	.type	EntryOffset, %object
	.size	EntryOffset, 4
EntryOffset:
	.word	1
	.align	2
.LC0:
	.ascii	"Unable to map pages\000"
	.align	2
.LC1:
	.ascii	"Mapped two pages at %p\012\000"
	.align	2
.LC2:
	.ascii	"Unprotecting page at %p\012\000"
	.align	2
.LC3:
	.ascii	"Unable to unprotect second page\000"
	.align	2
.LC4:
	.ascii	"Got back OK\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]
	bl	getpagesize
	mov	r3, r0
	str	r3, [fp, #-12]
	ldr	r3, [fp, #-12]
	lsl	r1, r3, #1
	mov	r3, #0
	str	r3, [sp, #4]
	mvn	r3, #0
	str	r3, [sp]
	mov	r3, #34
	mov	r2, #7
	mov	r0, #0
	bl	mmap
	str	r0, [fp, #-8]
	ldr	r3, [fp, #-8]
	cmn	r3, #1
	bne	.L2
	ldr	r0, .L5
	bl	puts
	mov	r3, #1
	b	.L3
.L2:
	ldr	r1, [fp, #-8]
	ldr	r0, .L5+4
	bl	printf
	ldr	r2, [fp, #-8]
	ldr	r3, [fp, #-12]
	add	r3, r2, r3
	mov	r1, r3
	ldr	r0, .L5+8
	bl	printf
	ldr	r2, [fp, #-8]
	ldr	r3, [fp, #-12]
	add	r3, r2, r3
	mov	r2, #0
	ldr	r1, [fp, #-12]
	mov	r0, r3
	bl	mprotect
	mov	r3, r0
	cmp	r3, #0
	beq	.L4
	ldr	r0, .L5+12
	bl	puts
	mov	r3, #1
	b	.L3
.L4:
	ldr	r3, [fp, #-12]
	sub	r3, r3, #7
	ldr	r2, [fp, #-8]
	add	r3, r2, r3
	ldr	r2, .L5+16
	mov	r0, r3
	mov	r1, r2
	mov	r3, #7
	mov	r2, r3
	bl	memcpy
	bl	BlockSegv
	mov	r2, #1
	ldr	r3, [fp, #-12]
	add	r3, r2, r3
	sub	r3, r3, #7
	ldr	r2, [fp, #-8]
	add	r3, r2, r3
	blx	r3
	ldr	r0, .L5+20
	bl	puts
	mov	r3, #0
.L3:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L6:
	.align	2
.L5:
	.word	.LC0
	.word	.LC1
	.word	.LC2
	.word	.LC3
	.word	Code
	.word	.LC4
	.size	main, .-main
	.section	.rodata
	.align	2
.LC5:
	.ascii	"Unable to block SEGV\000"
	.align	2
.LC6:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	BlockSegv, %function
BlockSegv:
	@ args = 0, pretend = 0, frame = 136
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #136
	ldr	r3, .L11
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	sub	r3, fp, #136
	mov	r0, r3
	bl	sigemptyset
	sub	r3, fp, #136
	mov	r1, #11
	mov	r0, r3
	bl	sigaddset
	sub	r3, fp, #136
	mov	r2, #0
	mov	r1, r3
	mov	r0, #0
	bl	sigprocmask
	mov	r3, r0
	cmp	r3, #0
	beq	.L10
	ldr	r0, .L11+4
	bl	puts
	mov	r0, #1
	bl	exit
.L10:
	nop
	ldr	r3, .L11
	ldr	r2, [r3]
	ldr	r3, [fp, #-8]
	eors	r2, r3, r2
	mov	r3, #0
	beq	.L9
	bl	__stack_chk_fail
.L9:
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L12:
	.align	2
.L11:
	.word	.LC6
	.word	.LC5
	.size	BlockSegv, .-BlockSegv
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
