	.file	"extr_text_mmap.c_validate_mmap.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	validate_mmap, @function
validate_mmap:
.LFB0:
	.cfi_startproc
	endbr64
	push	r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	mov	r13, rdi
	mov	rdi, rcx
	push	r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	mov	r12d, esi
	xor	esi, esi
	push	rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	mov	ebp, edx
	mov	edx, 40
	push	rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	mov	rbx, rcx
	sub	rsp, 40
	.cfi_def_cfa_offset 80
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 24[rsp], rax
	xor	eax, eax
	call	memset@PLT
	mov	DWORD PTR 8[rbx], r12d
	mov	esi, ebp
	mov	edi, r12d
	mov	rax, QWORD PTR AO_INVALID_FD[rip]
	mov	DWORD PTR 12[rbx], ebp
	mov	QWORD PTR [rbx], rax
	call	FILE_WRITABLE@PLT
	mov	esi, DWORD PTR O_RDWR[rip]
	test	rax, rax
	cmove	esi, DWORD PTR O_RDONLY[rip]
	test	DWORD PTR MAP_SHARED[rip], ebp
	jne	.L4
	test	DWORD PTR PROT_WRITE[rip], r12d
	jne	.L17
.L4:
	mov	rdi, r13
	call	open@PLT
	mov	QWORD PTR [rbx], rax
	mov	rdi, rax
	test	rax, rax
	js	.L18
	mov	rsi, rsp
	call	fstat@PLT
	test	rax, rax
	jne	.L19
	mov	edi, DWORD PTR 8[rsp]
	call	S_ISREG@PLT
	test	eax, eax
	je	.L20
	mov	rax, QWORD PTR [rsp]
	mov	QWORD PTR 16[rbx], rax
	mov	rax, QWORD PTR AO_INVALID_FD[rip]
	cmp	QWORD PTR [rbx], rax
	jne	.L1
	mov	rax, QWORD PTR errno[rip]
	mov	QWORD PTR 24[rbx], rax
	.p2align 4,,10
	.p2align 3
.L1:
	mov	rax, QWORD PTR 24[rsp]
	xor	rax, QWORD PTR fs:40
	jne	.L21
	add	rsp, 40
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	pop	rbx
	.cfi_def_cfa_offset 32
	pop	rbp
	.cfi_def_cfa_offset 24
	pop	r12
	.cfi_def_cfa_offset 16
	pop	r13
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L17:
	.cfi_restore_state
	or	esi, DWORD PTR O_EXCL[rip]
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L18:
	mov	rax, QWORD PTR errno[rip]
	mov	QWORD PTR 24[rbx], rax
	mov	rax, QWORD PTR AO_INVALID_FD[rip]
	mov	QWORD PTR [rbx], rax
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L19:
	mov	rax, QWORD PTR errno[rip]
	mov	rdi, QWORD PTR [rbx]
	mov	QWORD PTR 24[rbx], rax
	call	close@PLT
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L20:
	mov	rax, QWORD PTR EINVAL[rip]
	mov	rdi, QWORD PTR [rbx]
	mov	QWORD PTR 24[rbx], rax
	mov	QWORD PTR errno[rip], rax
	call	close@PLT
	jmp	.L1
.L21:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	validate_mmap, .-validate_mmap
	.comm	errno,8,8
	.comm	PROT_WRITE,4,4
	.comm	O_RDWR,4,4
	.comm	O_RDONLY,4,4
	.comm	O_EXCL,4,4
	.comm	MAP_SHARED,4,4
	.comm	EINVAL,8,8
	.comm	AO_INVALID_FD,8,8
	.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_text_mmap.c_validate_mmap.c"
	.text
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	validate_mmap, %function
validate_mmap:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, lr}
	mov	r4, r3
	mov	r5, r2
	mov	r6, r1
	mov	r7, r0
	ldr	r8, .L21
	mov	r0, r3
	ldr	r3, .L21+4
	sub	sp, sp, #16
	mov	r2, #24
	mov	r1, #0
	ldr	r3, [r3]
	str	r3, [sp, #12]
	mov	r3,#0
	bl	memset
	ldr	r3, [r8]
	mov	r1, r5
	str	r3, [r4]
	mov	r0, r6
	str	r6, [r4, #4]
	str	r5, [r4, #8]
	bl	FILE_WRITABLE
	cmp	r0, #0
	ldrne	r3, .L21+8
	ldreq	r3, .L21+12
	ldr	r1, [r3]
	ldr	r3, .L21+16
	ldr	r3, [r3]
	tst	r5, r3
	bne	.L4
	ldr	r3, .L21+20
	ldr	r3, [r3]
	tst	r6, r3
	ldrne	r3, .L21+24
	ldrne	r3, [r3]
	orrne	r1, r1, r3
.L4:
	mov	r0, r7
	bl	open
	cmp	r0, #0
	str	r0, [r4]
	blt	.L17
	add	r1, sp, #4
	bl	fstat
	cmp	r0, #0
	bne	.L18
	ldr	r0, [sp, #8]
	bl	S_ISREG
	cmp	r0, #0
	beq	.L19
	ldr	r2, [r8]
	ldr	r1, [r4]
	ldr	r3, [sp, #4]
	cmp	r1, r2
	str	r3, [r4, #12]
	ldreq	r3, .L21+28
	ldreq	r3, [r3]
	streq	r3, [r4, #16]
.L1:
	ldr	r3, .L21+4
	ldr	r2, [r3]
	ldr	r3, [sp, #12]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L20
	add	sp, sp, #16
	@ sp needed
	pop	{r4, r5, r6, r7, r8, pc}
.L17:
	ldr	r3, .L21+28
	ldr	r2, [r8]
	ldr	r3, [r3]
	str	r2, [r4]
	str	r3, [r4, #16]
	b	.L1
.L18:
	ldr	r3, .L21+28
	ldr	r0, [r4]
	ldr	r3, [r3]
	str	r3, [r4, #16]
	bl	close
	b	.L1
.L19:
	ldr	r3, .L21+32
	ldr	r2, .L21+28
	ldr	r3, [r3]
	ldr	r0, [r4]
	str	r3, [r4, #16]
	str	r3, [r2]
	bl	close
	b	.L1
.L20:
	bl	__stack_chk_fail
.L22:
	.align	2
.L21:
	.word	AO_INVALID_FD
	.word	.LC0
	.word	O_RDWR
	.word	O_RDONLY
	.word	MAP_SHARED
	.word	PROT_WRITE
	.word	O_EXCL
	.word	errno
	.word	EINVAL
	.size	validate_mmap, .-validate_mmap
	.comm	errno,4,4
	.comm	PROT_WRITE,4,4
	.comm	O_RDWR,4,4
	.comm	O_RDONLY,4,4
	.comm	O_EXCL,4,4
	.comm	MAP_SHARED,4,4
	.comm	EINVAL,4,4
	.comm	AO_INVALID_FD,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
