	.file	"extr_2330.c_find_rwxmem.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"rb"
.LC1:
	.string	"/proc/self/map"
.LC2:
	.string	"fopen"
	.text
	.p2align 4
	.globl	find_rwxmem
	.type	find_rwxmem, @function
find_rwxmem:
.LFB0:
	.cfi_startproc
	endbr64
	push	r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	lea	rsi, .LC0[rip]
	lea	rdi, .LC1[rip]
	push	rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	push	rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	sub	rsp, 32
	.cfi_def_cfa_offset 64
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 24[rsp], rax
	xor	eax, eax
	call	fopen@PLT
	mov	rbp, rax
	test	rax, rax
	je	.L9
.L2:
	mov	rbx, rsp
	.p2align 4,,10
	.p2align 3
.L3:
	mov	rcx, rbp
	mov	edx, 1
	mov	esi, 16
	mov	rdi, rbx
	call	fread@PLT
	test	rax, rax
	je	.L10
	mov	edx, DWORD PTR [rsp]
	mov	eax, DWORD PTR MA_READ[rip]
	or	eax, DWORD PTR MA_WRITE[rip]
	or	eax, DWORD PTR MA_EXEC[rip]
	mov	ecx, eax
	and	ecx, edx
	cmp	eax, ecx
	jne	.L3
	test	DWORD PTR MA_STACK[rip], edx
	cmove	r12, QWORD PTR 8[rsp]
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L10:
	mov	rdi, rbp
	call	fclose@PLT
	mov	rax, QWORD PTR 24[rsp]
	xor	rax, QWORD PTR fs:40
	jne	.L11
	add	rsp, 32
	.cfi_remember_state
	.cfi_def_cfa_offset 32
	mov	rax, r12
	pop	rbx
	.cfi_def_cfa_offset 24
	pop	rbp
	.cfi_def_cfa_offset 16
	pop	r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L9:
	.cfi_restore_state
	lea	rdi, .LC2[rip]
	call	perror@PLT
	mov	edi, DWORD PTR EXIT_FAILURE[rip]
	call	exit@PLT
	jmp	.L2
.L11:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	find_rwxmem, .-find_rwxmem
	.comm	MA_WRITE,4,4
	.comm	MA_STACK,4,4
	.comm	MA_READ,4,4
	.comm	MA_EXEC,4,4
	.comm	EXIT_FAILURE,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.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, 2
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"extr_2330.c_find_rwxmem.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"rb\000"
	.align	2
.LC1:
	.ascii	"/proc/self/map\000"
	.align	2
.LC2:
	.ascii	"fopen\000"
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC3:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	find_rwxmem
	.syntax unified
	.arm
	.fpu softvfp
	.type	find_rwxmem, %function
find_rwxmem:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, lr}
	ldr	r3, .L12
	sub	sp, sp, #20
	ldr	r1, .L12+4
	ldr	r0, .L12+8
	ldr	r3, [r3]
	str	r3, [sp, #12]
	mov	r3,#0
	bl	fopen
	subs	r9, r0, #0
	beq	.L9
.L2:
	ldr	r6, .L12+12
	ldr	r5, .L12+16
	ldr	r4, .L12+20
	ldr	r7, .L12+24
.L3:
	mov	r3, r9
	mov	r2, #1
	mov	r1, #8
	add	r0, sp, #4
	bl	fread
	cmp	r0, #0
	beq	.L10
	ldr	r3, [r5]
	ldr	r2, [r6]
	ldr	r1, [r4]
	orr	r2, r2, r3
	ldr	r3, [sp, #4]
	orr	r2, r2, r1
	bics	r2, r2, r3
	bne	.L3
	ldr	r2, [r7]
	tst	r3, r2
	ldreq	r8, [sp, #8]
	b	.L3
.L10:
	mov	r0, r9
	bl	fclose
	ldr	r3, .L12
	ldr	r2, [r3]
	ldr	r3, [sp, #12]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L11
	mov	r0, r8
	add	sp, sp, #20
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, pc}
.L9:
	ldr	r0, .L12+28
	bl	perror
	ldr	r3, .L12+32
	ldr	r0, [r3]
	bl	exit
	b	.L2
.L11:
	bl	__stack_chk_fail
.L13:
	.align	2
.L12:
	.word	.LC3
	.word	.LC0
	.word	.LC1
	.word	MA_READ
	.word	MA_WRITE
	.word	MA_EXEC
	.word	MA_STACK
	.word	.LC2
	.word	EXIT_FAILURE
	.size	find_rwxmem, .-find_rwxmem
	.comm	MA_WRITE,4,4
	.comm	MA_STACK,4,4
	.comm	MA_READ,4,4
	.comm	MA_EXEC,4,4
	.comm	EXIT_FAILURE,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
