	.file	"extr_open_to_operation.c_check_mmap_write.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"open"
.LC1:
	.string	"mmap failed"
.LC2:
	.string	"mmap succeeded"
	.text
	.p2align 4
	.type	check_mmap_write, @function
check_mmap_write:
.LFB0:
	.cfi_startproc
	endbr64
	test	ecx, ecx
	jle	.L15
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	lea	eax, -1[rcx]
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	lea	rax, 4[rdx+rax*4]
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	mov	r13, rdi
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	mov	r12, rsi
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	mov	rbx, rdx
	sub	rsp, 24
	.cfi_def_cfa_offset 80
	mov	QWORD PTR 8[rsp], rax
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L3:
	mov	ecx, DWORD PTR MAP_SHARED[rip]
	mov	r14d, DWORD PTR PROT_WRITE[rip]
	xor	eax, eax
	mov	DWORD PTR 4[rsp], ecx
	call	getpagesize@PLT
	mov	ecx, DWORD PTR 4[rsp]
	mov	edx, r14d
	xor	r9d, r9d
	xor	edi, edi
	mov	esi, eax
	mov	r8d, ebp
	call	mmap@PLT
	mov	edx, r15d
	mov	r14, rax
	mov	eax, DWORD PTR O_ACCMODE[rip]
	and	eax, r15d
	cmp	QWORD PTR MAP_FAILED[rip], r14
	je	.L19
	cmp	eax, DWORD PTR O_WRONLY[rip]
	lea	rsi, .LC2[rip]
	mov	rdi, r13
	je	.L9
	cmp	eax, DWORD PTR O_RDWR[rip]
	je	.L9
	call	notok_mode@PLT
.L11:
	xor	eax, eax
	call	getpagesize@PLT
	mov	rdi, r14
	mov	esi, eax
	call	munmap@PLT
.L8:
	mov	edi, ebp
	add	rbx, 4
	call	close@PLT
	cmp	rbx, QWORD PTR 8[rsp]
	je	.L20
.L12:
	mov	r15d, DWORD PTR [rbx]
	mov	rdi, r12
	mov	esi, r15d
	call	open@PLT
	mov	ebp, eax
	test	eax, eax
	jns	.L3
	mov	edx, r15d
	lea	rsi, .LC0[rip]
	mov	rdi, r13
	add	rbx, 4
	call	notok_mode@PLT
	cmp	rbx, QWORD PTR 8[rsp]
	jne	.L12
.L20:
	add	rsp, 24
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	pop	rbx
	.cfi_def_cfa_offset 48
	pop	rbp
	.cfi_def_cfa_offset 40
	pop	r12
	.cfi_def_cfa_offset 32
	pop	r13
	.cfi_def_cfa_offset 24
	pop	r14
	.cfi_def_cfa_offset 16
	pop	r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L9:
	.cfi_restore_state
	call	ok_mode@PLT
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L19:
	cmp	eax, DWORD PTR O_WRONLY[rip]
	lea	rsi, .LC1[rip]
	mov	rdi, r13
	je	.L6
	cmp	eax, DWORD PTR O_RDWR[rip]
	je	.L6
	call	ok_mode@PLT
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L6:
	call	notok_mode@PLT
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L15:
	.cfi_def_cfa_offset 8
	.cfi_restore 3
	.cfi_restore 6
	.cfi_restore 12
	.cfi_restore 13
	.cfi_restore 14
	.cfi_restore 15
	ret
	.cfi_endproc
.LFE0:
	.size	check_mmap_write, .-check_mmap_write
	.comm	PROT_WRITE,4,4
	.comm	O_WRONLY,4,4
	.comm	O_RDWR,4,4
	.comm	O_ACCMODE,4,4
	.comm	MAP_SHARED,4,4
	.comm	MAP_FAILED,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_open_to_operation.c_check_mmap_write.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"open\000"
	.align	2
.LC1:
	.ascii	"mmap failed\000"
	.align	2
.LC2:
	.ascii	"mmap succeeded\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	check_mmap_write, %function
check_mmap_write:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 0, uses_anonymous_args = 0
	cmp	r3, #0
	bxle	lr
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	sub	r6, r2, #4
	sub	sp, sp, #20
	add	r3, r6, r3, lsl #2
	mov	r8, r0
	mov	r7, r1
	ldr	r9, .L21
	ldr	fp, .L21+4
	str	r3, [sp, #12]
	b	.L12
.L3:
	bl	getpagesize
	mov	r1, r0
	mov	r0, #0
	ldr	r3, .L21+8
	ldr	r2, .L21+12
	str	r4, [sp]
	str	r0, [sp, #4]
	ldr	r2, [r2]
	ldr	r3, [r3]
	bl	mmap
	ldr	r2, [r9]
	mov	r10, r0
	cmp	r2, r0
	beq	.L19
	ldr	r3, .L21+16
	ldr	r2, [fp]
	ldr	r1, [r3]
	and	r2, r2, r5
	cmp	r2, r1
	beq	.L9
	ldr	r1, .L21+20
	ldr	r1, [r1]
	cmp	r2, r1
	beq	.L9
	mov	r2, r5
	mov	r0, r8
	ldr	r1, .L21+24
	bl	notok_mode
.L11:
	bl	getpagesize
	mov	r1, r0
	mov	r0, r10
	bl	munmap
.L8:
	mov	r0, r4
	bl	close
	ldr	r3, [sp, #12]
	cmp	r6, r3
	beq	.L20
.L12:
	ldr	r5, [r6, #4]!
	mov	r0, r7
	mov	r1, r5
	bl	open
	subs	r4, r0, #0
	bge	.L3
	mov	r2, r5
	mov	r0, r8
	ldr	r1, .L21+28
	bl	notok_mode
	ldr	r3, [sp, #12]
	cmp	r6, r3
	bne	.L12
.L20:
	add	sp, sp, #20
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L9:
	mov	r2, r5
	mov	r0, r8
	ldr	r1, .L21+24
	bl	ok_mode
	b	.L11
.L19:
	ldr	r2, .L21+16
	ldr	r3, [fp]
	ldr	r2, [r2]
	and	r3, r3, r5
	cmp	r3, r2
	beq	.L6
	ldr	r2, .L21+20
	ldr	r2, [r2]
	cmp	r3, r2
	beq	.L6
	mov	r2, r5
	mov	r0, r8
	ldr	r1, .L21+32
	bl	ok_mode
	b	.L8
.L6:
	mov	r2, r5
	mov	r0, r8
	ldr	r1, .L21+32
	bl	notok_mode
	b	.L8
.L22:
	.align	2
.L21:
	.word	MAP_FAILED
	.word	O_ACCMODE
	.word	MAP_SHARED
	.word	PROT_WRITE
	.word	O_WRONLY
	.word	O_RDWR
	.word	.LC2
	.word	.LC0
	.word	.LC1
	.size	check_mmap_write, .-check_mmap_write
	.comm	PROT_WRITE,4,4
	.comm	O_WRONLY,4,4
	.comm	O_RDWR,4,4
	.comm	O_ACCMODE,4,4
	.comm	MAP_SHARED,4,4
	.comm	MAP_FAILED,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
