	.file	"936547.c"
	.intel_syntax noprefix
	.text
	.globl	_memory_watchlist
	.bss
	.align 8
	.type	_memory_watchlist, @object
	.size	_memory_watchlist, 8
_memory_watchlist:
	.zero	8
	.text
	.globl	_watch_address
	.type	_watch_address, @function
_watch_address:
.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, 48
	mov	QWORD PTR -24[rbp], rdi
	mov	QWORD PTR -32[rbp], rsi
	mov	DWORD PTR -36[rbp], edx
	mov	edi, 32
	call	malloc@PLT
	mov	QWORD PTR -8[rbp], rax
	mov	rax, QWORD PTR -8[rbp]
	mov	rdx, QWORD PTR -24[rbp]
	mov	QWORD PTR [rax], rdx
	mov	rax, QWORD PTR -8[rbp]
	mov	rdx, QWORD PTR -32[rbp]
	mov	QWORD PTR 8[rax], rdx
	mov	rax, QWORD PTR _memory_watchlist[rip]
	test	rax, rax
	je	.L2
	mov	rax, QWORD PTR _memory_watchlist[rip]
	mov	rdx, QWORD PTR -8[rbp]
	mov	QWORD PTR 24[rax], rdx
.L2:
	mov	rdx, QWORD PTR _memory_watchlist[rip]
	mov	rax, QWORD PTR -8[rbp]
	mov	QWORD PTR 16[rax], rdx
	mov	rax, QWORD PTR -8[rbp]
	mov	QWORD PTR 24[rax], 0
	mov	rax, QWORD PTR -8[rbp]
	mov	QWORD PTR _memory_watchlist[rip], rax
	mov	edx, DWORD PTR -36[rbp]
	mov	rcx, QWORD PTR -32[rbp]
	mov	rax, QWORD PTR -24[rbp]
	mov	rsi, rcx
	mov	rdi, rax
	call	mprotect@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	_watch_address, .-_watch_address
	.section	.rodata
.LC0:
	.string	"---"
	.align 8
.LC1:
	.string	"%s: Process received segmentation fault, examening ...\n"
.LC2:
	.string	"%s: cause was address %p\n"
	.align 8
.LC3:
	.string	"%s: raised because of invalid r/w acces to address (was in watchlist) ...\n"
	.text
	.globl	_sigsegv_protector
	.type	_sigsegv_protector, @function
_sigsegv_protector:
.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	DWORD PTR -20[rbp], edi
	mov	QWORD PTR -32[rbp], rsi
	mov	QWORD PTR -40[rbp], rdx
	lea	rdi, .LC0[rip]
	call	puts@PLT
	lea	rsi, __func__.1[rip]
	lea	rdi, .LC1[rip]
	mov	eax, 0
	call	printf@PLT
	mov	rax, QWORD PTR -32[rbp]
	mov	rax, QWORD PTR 16[rax]
	mov	rdx, rax
	lea	rsi, __func__.1[rip]
	lea	rdi, .LC2[rip]
	mov	eax, 0
	call	printf@PLT
	mov	rax, QWORD PTR _memory_watchlist[rip]
	mov	QWORD PTR -8[rbp], rax
	jmp	.L4
.L7:
	mov	rax, QWORD PTR -8[rbp]
	mov	rdx, QWORD PTR [rax]
	mov	rax, QWORD PTR -32[rbp]
	mov	rax, QWORD PTR 16[rax]
	cmp	rdx, rax
	je	.L12
	mov	rax, QWORD PTR -8[rbp]
	mov	rax, QWORD PTR 16[rax]
	mov	QWORD PTR -8[rbp], rax
.L4:
	cmp	QWORD PTR -8[rbp], 0
	jne	.L7
	jmp	.L6
.L12:
	nop
.L6:
	cmp	QWORD PTR -8[rbp], 0
	je	.L8
	lea	rsi, __func__.1[rip]
	lea	rdi, .LC3[rip]
	mov	eax, 0
	call	printf@PLT
	mov	rax, QWORD PTR -8[rbp]
	mov	rax, QWORD PTR 24[rax]
	test	rax, rax
	je	.L9
	mov	rax, QWORD PTR -8[rbp]
	mov	rax, QWORD PTR 24[rax]
	mov	rdx, QWORD PTR -8[rbp]
	mov	rdx, QWORD PTR 16[rdx]
	mov	QWORD PTR 16[rax], rdx
.L9:
	mov	rax, QWORD PTR -8[rbp]
	mov	rax, QWORD PTR 16[rax]
	mov	QWORD PTR _memory_watchlist[rip], rax
	mov	rax, QWORD PTR -8[rbp]
	mov	rcx, QWORD PTR 8[rax]
	mov	rax, QWORD PTR -32[rbp]
	mov	rax, QWORD PTR 16[rax]
	mov	edx, 3
	mov	rsi, rcx
	mov	rdi, rax
	call	mprotect@PLT
	mov	rax, QWORD PTR -8[rbp]
	mov	rdi, rax
	call	free@PLT
	lea	rdi, .LC0[rip]
	call	puts@PLT
	jmp	.L11
.L8:
	lea	rdi, .LC0[rip]
	call	puts@PLT
	mov	edi, 1
	call	exit@PLT
.L11:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	_sigsegv_protector, .-_sigsegv_protector
	.section	.rodata
.LC4:
	.string	"/dev/zero"
.LC5:
	.string	"the_stack_data/936547.c"
.LC6:
	.string	"memory != NULL"
	.text
	.globl	test_segfault_protector
	.type	test_segfault_protector, @function
test_segfault_protector:
.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, 16
	call	getpagesize@PLT
	mov	DWORD PTR -16[rbp], eax
	mov	esi, 0
	lea	rdi, .LC4[rip]
	mov	eax, 0
	call	open@PLT
	mov	DWORD PTR -12[rbp], eax
	mov	eax, DWORD PTR -16[rbp]
	cdqe
	mov	edx, DWORD PTR -12[rbp]
	mov	r9d, 0
	mov	r8d, edx
	mov	ecx, 2
	mov	edx, 2
	mov	rsi, rax
	mov	edi, 0
	call	mmap@PLT
	mov	QWORD PTR -8[rbp], rax
	cmp	QWORD PTR -8[rbp], 0
	jne	.L14
	lea	rcx, __PRETTY_FUNCTION__.0[rip]
	mov	edx, 76
	lea	rsi, .LC5[rip]
	lea	rdi, .LC6[rip]
	call	__assert_fail@PLT
.L14:
	mov	eax, DWORD PTR -12[rbp]
	mov	edi, eax
	call	close@PLT
	mov	rax, QWORD PTR -8[rbp]
	mov	BYTE PTR [rax], 0
	mov	eax, DWORD PTR -16[rbp]
	movsx	rcx, eax
	mov	rax, QWORD PTR -8[rbp]
	mov	edx, 0
	mov	rsi, rcx
	mov	rdi, rax
	call	_watch_address
	mov	rax, QWORD PTR -8[rbp]
	mov	BYTE PTR [rax], 123
	mov	eax, DWORD PTR -16[rbp]
	movsx	rdx, eax
	mov	rax, QWORD PTR -8[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	munmap@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	test_segfault_protector, .-test_segfault_protector
	.section	.rodata
.LC7:
	.string	"Program exited"
	.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, 160
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	lea	rax, -160[rbp]
	mov	edx, 152
	mov	esi, 0
	mov	rdi, rax
	call	memset@PLT
	lea	rax, _sigsegv_protector[rip]
	mov	QWORD PTR -160[rbp], rax
	mov	DWORD PTR -24[rbp], 4
	lea	rax, -160[rbp]
	mov	edx, 0
	mov	rsi, rax
	mov	edi, 11
	call	sigaction@PLT
	mov	eax, 0
	call	test_segfault_protector
	lea	rdi, .LC7[rip]
	call	puts@PLT
	mov	eax, 0
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L17
	call	__stack_chk_fail@PLT
.L17:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	main, .-main
	.section	.rodata
	.align 16
	.type	__func__.1, @object
	.size	__func__.1, 19
__func__.1:
	.string	"_sigsegv_protector"
	.align 16
	.type	__PRETTY_FUNCTION__.0, @object
	.size	__PRETTY_FUNCTION__.0, 24
__PRETTY_FUNCTION__.0:
	.string	"test_segfault_protector"
	.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	"936547.c"
	.text
	.global	_memory_watchlist
	.bss
	.align	2
	.type	_memory_watchlist, %object
	.size	_memory_watchlist, 4
_memory_watchlist:
	.space	4
	.text
	.align	2
	.global	_watch_address
	.syntax unified
	.arm
	.fpu softvfp
	.type	_watch_address, %function
_watch_address:
	@ 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, #-16]
	str	r1, [fp, #-20]
	str	r2, [fp, #-24]
	mov	r0, #16
	bl	malloc
	mov	r3, r0
	str	r3, [fp, #-8]
	ldr	r3, [fp, #-8]
	ldr	r2, [fp, #-16]
	str	r2, [r3]
	ldr	r3, [fp, #-8]
	ldr	r2, [fp, #-20]
	str	r2, [r3, #4]
	ldr	r3, .L3
	ldr	r3, [r3]
	cmp	r3, #0
	beq	.L2
	ldr	r3, .L3
	ldr	r3, [r3]
	ldr	r2, [fp, #-8]
	str	r2, [r3, #12]
.L2:
	ldr	r3, .L3
	ldr	r2, [r3]
	ldr	r3, [fp, #-8]
	str	r2, [r3, #8]
	ldr	r3, [fp, #-8]
	mov	r2, #0
	str	r2, [r3, #12]
	ldr	r2, .L3
	ldr	r3, [fp, #-8]
	str	r3, [r2]
	ldr	r2, [fp, #-24]
	ldr	r1, [fp, #-20]
	ldr	r0, [fp, #-16]
	bl	mprotect
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L4:
	.align	2
.L3:
	.word	_memory_watchlist
	.size	_watch_address, .-_watch_address
	.section	.rodata
	.align	2
.LC0:
	.ascii	"---\000"
	.align	2
.LC1:
	.ascii	"%s: Process received segmentation fault, examening "
	.ascii	"...\012\000"
	.align	2
.LC2:
	.ascii	"%s: cause was address %p\012\000"
	.align	2
.LC3:
	.ascii	"%s: raised because of invalid r/w acces to address "
	.ascii	"(was in watchlist) ...\012\000"
	.text
	.align	2
	.global	_sigsegv_protector
	.syntax unified
	.arm
	.fpu softvfp
	.type	_sigsegv_protector, %function
_sigsegv_protector:
	@ 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, #-16]
	str	r1, [fp, #-20]
	str	r2, [fp, #-24]
	ldr	r0, .L15
	bl	puts
	ldr	r1, .L15+4
	ldr	r0, .L15+8
	bl	printf
	ldr	r3, [fp, #-20]
	ldr	r3, [r3, #12]
	mov	r2, r3
	ldr	r1, .L15+4
	ldr	r0, .L15+12
	bl	printf
	ldr	r3, .L15+16
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	b	.L6
.L9:
	ldr	r3, [fp, #-8]
	ldr	r2, [r3]
	ldr	r3, [fp, #-20]
	ldr	r3, [r3, #12]
	cmp	r2, r3
	beq	.L14
	ldr	r3, [fp, #-8]
	ldr	r3, [r3, #8]
	str	r3, [fp, #-8]
.L6:
	ldr	r3, [fp, #-8]
	cmp	r3, #0
	bne	.L9
	b	.L8
.L14:
	nop
.L8:
	ldr	r3, [fp, #-8]
	cmp	r3, #0
	beq	.L10
	ldr	r1, .L15+4
	ldr	r0, .L15+20
	bl	printf
	ldr	r3, [fp, #-8]
	ldr	r3, [r3, #12]
	cmp	r3, #0
	beq	.L11
	ldr	r3, [fp, #-8]
	ldr	r3, [r3, #12]
	ldr	r2, [fp, #-8]
	ldr	r2, [r2, #8]
	str	r2, [r3, #8]
.L11:
	ldr	r3, [fp, #-8]
	ldr	r3, [r3, #8]
	ldr	r2, .L15+16
	str	r3, [r2]
	ldr	r3, [fp, #-20]
	ldr	r0, [r3, #12]
	ldr	r3, [fp, #-8]
	ldr	r3, [r3, #4]
	mov	r2, #3
	mov	r1, r3
	bl	mprotect
	ldr	r0, [fp, #-8]
	bl	free
	ldr	r0, .L15
	bl	puts
	b	.L13
.L10:
	ldr	r0, .L15
	bl	puts
	mov	r0, #1
	bl	exit
.L13:
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L16:
	.align	2
.L15:
	.word	.LC0
	.word	__func__.6457
	.word	.LC1
	.word	.LC2
	.word	_memory_watchlist
	.word	.LC3
	.size	_sigsegv_protector, .-_sigsegv_protector
	.section	.rodata
	.align	2
.LC4:
	.ascii	"/dev/zero\000"
	.align	2
.LC5:
	.ascii	"the_stack_data/936547.c\000"
	.align	2
.LC6:
	.ascii	"memory != NULL\000"
	.text
	.align	2
	.global	test_segfault_protector
	.syntax unified
	.arm
	.fpu softvfp
	.type	test_segfault_protector, %function
test_segfault_protector:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #24
	bl	getpagesize
	str	r0, [fp, #-16]
	mov	r1, #0
	ldr	r0, .L19
	bl	open
	str	r0, [fp, #-12]
	ldr	r1, [fp, #-16]
	mov	r3, #0
	str	r3, [sp, #4]
	ldr	r3, [fp, #-12]
	str	r3, [sp]
	mov	r3, #2
	mov	r2, #2
	mov	r0, #0
	bl	mmap
	str	r0, [fp, #-8]
	ldr	r3, [fp, #-8]
	cmp	r3, #0
	bne	.L18
	ldr	r3, .L19+4
	mov	r2, #76
	ldr	r1, .L19+8
	ldr	r0, .L19+12
	bl	__assert_fail
.L18:
	ldr	r0, [fp, #-12]
	bl	close
	ldr	r3, [fp, #-8]
	mov	r2, #0
	strb	r2, [r3]
	ldr	r3, [fp, #-16]
	mov	r2, #0
	mov	r1, r3
	ldr	r0, [fp, #-8]
	bl	_watch_address
	ldr	r3, [fp, #-8]
	mov	r2, #123
	strb	r2, [r3]
	ldr	r3, [fp, #-16]
	mov	r1, r3
	ldr	r0, [fp, #-8]
	bl	munmap
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L20:
	.align	2
.L19:
	.word	.LC4
	.word	__PRETTY_FUNCTION__.6467
	.word	.LC5
	.word	.LC6
	.size	test_segfault_protector, .-test_segfault_protector
	.section	.rodata
	.align	2
.LC7:
	.ascii	"Program exited\000"
	.align	2
.LC8:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 144
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #144
	ldr	r3, .L24
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	sub	r3, fp, #148
	mov	r2, #140
	mov	r1, #0
	mov	r0, r3
	bl	memset
	ldr	r3, .L24+4
	str	r3, [fp, #-148]
	mov	r3, #4
	str	r3, [fp, #-16]
	sub	r3, fp, #148
	mov	r2, #0
	mov	r1, r3
	mov	r0, #11
	bl	sigaction
	bl	test_segfault_protector
	ldr	r0, .L24+8
	bl	puts
	mov	r3, #0
	ldr	r2, .L24
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L23
	bl	__stack_chk_fail
.L23:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L25:
	.align	2
.L24:
	.word	.LC8
	.word	_sigsegv_protector
	.word	.LC7
	.size	main, .-main
	.section	.rodata
	.align	2
	.type	__func__.6457, %object
	.size	__func__.6457, 19
__func__.6457:
	.ascii	"_sigsegv_protector\000"
	.align	2
	.type	__PRETTY_FUNCTION__.6467, %object
	.size	__PRETTY_FUNCTION__.6467, 24
__PRETTY_FUNCTION__.6467:
	.ascii	"test_segfault_protector\000"
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
