	.file	"extr_memfd_test.c_mfd_assert_write.c"
	.intel_syntax noprefix
	.text
	.section	.rodata
.LC0:
	.string	""
	.string	""
	.string	""
	.string	""
	.string	""
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC1:
	.string	"write() failed: %m\n"
.LC2:
	.string	"mmap() failed: %m\n"
.LC3:
	.string	"mprotect() failed: %m\n"
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC4:
	.string	"fallocate(PUNCH_HOLE) failed: %m\n"
	.text
	.p2align 4
	.type	mfd_assert_write, @function
mfd_assert_write:
.LFB0:
	.cfi_startproc
	endbr64
	push	r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	push	rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	mov	ebp, edi
	sub	rsp, 8
	.cfi_def_cfa_offset 32
	mov	eax, DWORD PTR hugetlbfs_test[rip]
	test	eax, eax
	je	.L15
.L3:
	mov	ecx, DWORD PTR MAP_SHARED[rip]
	xor	r9d, r9d
	xor	edi, edi
	mov	r8d, ebp
	mov	esi, DWORD PTR mfd_def_size[rip]
	mov	edx, DWORD PTR PROT_READ[rip]
	or	edx, DWORD PTR PROT_WRITE[rip]
	call	mmap@PLT
	cmp	QWORD PTR MAP_FAILED[rip], rax
	mov	r12, rax
	je	.L16
.L5:
	mov	BYTE PTR [r12], 0
	mov	esi, DWORD PTR mfd_def_size[rip]
	mov	rdi, r12
	call	munmap@PLT
	mov	ecx, DWORD PTR MAP_SHARED[rip]
	xor	r9d, r9d
	xor	edi, edi
	mov	edx, DWORD PTR PROT_WRITE[rip]
	mov	esi, DWORD PTR mfd_def_size[rip]
	mov	r8d, ebp
	call	mmap@PLT
	cmp	QWORD PTR MAP_FAILED[rip], rax
	mov	r12, rax
	je	.L17
.L6:
	mov	BYTE PTR [r12], 0
	mov	esi, DWORD PTR mfd_def_size[rip]
	mov	rdi, r12
	call	munmap@PLT
	mov	ecx, DWORD PTR MAP_SHARED[rip]
	xor	r9d, r9d
	xor	edi, edi
	mov	edx, DWORD PTR PROT_READ[rip]
	mov	esi, DWORD PTR mfd_def_size[rip]
	mov	r8d, ebp
	call	mmap@PLT
	cmp	QWORD PTR MAP_FAILED[rip], rax
	mov	r12, rax
	je	.L18
.L7:
	mov	esi, DWORD PTR mfd_def_size[rip]
	mov	edx, DWORD PTR PROT_READ[rip]
	mov	rdi, r12
	or	edx, DWORD PTR PROT_WRITE[rip]
	call	mprotect@PLT
	test	eax, eax
	js	.L19
.L8:
	mov	BYTE PTR [r12], 0
	mov	esi, DWORD PTR mfd_def_size[rip]
	mov	rdi, r12
	call	munmap@PLT
	mov	ecx, DWORD PTR mfd_def_size[rip]
	xor	edx, edx
	mov	edi, ebp
	mov	esi, DWORD PTR FALLOC_FL_PUNCH_HOLE[rip]
	or	esi, DWORD PTR FALLOC_FL_KEEP_SIZE[rip]
	call	fallocate@PLT
	test	eax, eax
	js	.L20
	add	rsp, 8
	.cfi_remember_state
	.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
.L15:
	.cfi_restore_state
	mov	edx, 4
	lea	rsi, .LC0[rip]
	call	write@PLT
	cmp	eax, 4
	je	.L3
	lea	rdi, .LC1[rip]
	call	printf@PLT
	xor	eax, eax
	call	abort@PLT
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L20:
	lea	rdi, .LC4[rip]
	call	printf@PLT
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	xor	eax, eax
	pop	rbp
	.cfi_def_cfa_offset 16
	pop	r12
	.cfi_def_cfa_offset 8
	jmp	abort@PLT
	.p2align 4,,10
	.p2align 3
.L19:
	.cfi_restore_state
	lea	rdi, .LC3[rip]
	call	printf@PLT
	xor	eax, eax
	call	abort@PLT
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L16:
	lea	rdi, .LC2[rip]
	call	printf@PLT
	xor	eax, eax
	call	abort@PLT
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L17:
	lea	rdi, .LC2[rip]
	call	printf@PLT
	xor	eax, eax
	call	abort@PLT
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L18:
	lea	rdi, .LC2[rip]
	call	printf@PLT
	xor	eax, eax
	call	abort@PLT
	jmp	.L7
	.cfi_endproc
.LFE0:
	.size	mfd_assert_write, .-mfd_assert_write
	.comm	mfd_def_size,4,4
	.comm	hugetlbfs_test,4,4
	.comm	PROT_WRITE,4,4
	.comm	PROT_READ,4,4
	.comm	MAP_SHARED,4,4
	.comm	MAP_FAILED,8,8
	.comm	FALLOC_FL_PUNCH_HOLE,4,4
	.comm	FALLOC_FL_KEEP_SIZE,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_memfd_test.c_mfd_assert_write.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC1:
	.ascii	"write() failed: %m\012\000"
	.align	2
.LC2:
	.ascii	"mmap() failed: %m\012\000"
	.align	2
.LC3:
	.ascii	"mprotect() failed: %m\012\000"
	.align	2
.LC4:
	.ascii	"fallocate(PUNCH_HOLE) failed: %m\012\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	mfd_assert_write, %function
mfd_assert_write:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	ldr	r3, .L21
	mov	r5, r0
	ldr	r3, [r3]
	sub	sp, sp, #12
	cmp	r3, #0
	beq	.L15
.L3:
	mov	r0, #0
	ldr	r8, .L21+4
	ldr	r7, .L21+8
	ldr	r2, [r8]
	ldr	r3, [r7]
	ldr	r10, .L21+12
	ldr	r4, .L21+16
	orr	r2, r2, r3
	ldr	r1, [r4]
	ldr	r3, [r10]
	str	r5, [sp]
	str	r0, [sp, #4]
	bl	mmap
	ldr	r9, .L21+20
	mov	r6, r0
	ldr	r3, [r9]
	cmp	r3, r0
	beq	.L16
.L5:
	mov	fp, #0
	strb	fp, [r6]
	mov	r0, r6
	ldr	r1, [r4]
	bl	munmap
	str	fp, [sp, #4]
	str	r5, [sp]
	ldr	r3, [r10]
	mov	r0, fp
	ldr	r2, [r7]
	ldr	r1, [r4]
	bl	mmap
	ldr	r3, [r9]
	mov	r6, r0
	cmp	r3, r0
	beq	.L17
.L6:
	mov	fp, #0
	strb	fp, [r6]
	mov	r0, r6
	ldr	r1, [r4]
	bl	munmap
	ldr	r3, [r10]
	mov	r0, fp
	ldr	r2, [r8]
	ldr	r1, [r4]
	str	fp, [sp, #4]
	str	r5, [sp]
	bl	mmap
	ldr	r3, [r9]
	mov	r6, r0
	cmp	r3, r0
	beq	.L18
.L7:
	ldr	r2, [r8]
	ldr	r3, [r7]
	mov	r0, r6
	ldr	r1, [r4]
	orr	r2, r2, r3
	bl	mprotect
	cmp	r0, #0
	blt	.L19
.L8:
	mov	r7, #0
	strb	r7, [r6]
	ldr	r1, [r4]
	mov	r0, r6
	bl	munmap
	ldr	r2, .L21+24
	ldr	r3, .L21+28
	ldr	ip, [r2]
	ldr	r1, [r3]
	mov	r2, r7
	mov	r0, r5
	ldr	r3, [r4]
	orr	r1, ip, r1
	bl	fallocate
	cmp	r0, r7
	blt	.L20
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L15:
	mov	r2, #4
	ldr	r1, .L21+32
	bl	write
	cmp	r0, #4
	beq	.L3
	ldr	r0, .L21+36
	bl	printf
	bl	abort
	b	.L3
.L20:
	ldr	r0, .L21+40
	bl	printf
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	b	abort
.L19:
	ldr	r0, .L21+44
	bl	printf
	bl	abort
	b	.L8
.L16:
	ldr	r0, .L21+48
	bl	printf
	bl	abort
	b	.L5
.L17:
	ldr	r0, .L21+48
	bl	printf
	bl	abort
	b	.L6
.L18:
	ldr	r0, .L21+48
	bl	printf
	bl	abort
	b	.L7
.L22:
	.align	2
.L21:
	.word	hugetlbfs_test
	.word	PROT_READ
	.word	PROT_WRITE
	.word	MAP_SHARED
	.word	mfd_def_size
	.word	MAP_FAILED
	.word	FALLOC_FL_PUNCH_HOLE
	.word	FALLOC_FL_KEEP_SIZE
	.word	.LANCHOR0
	.word	.LC1
	.word	.LC4
	.word	.LC3
	.word	.LC2
	.size	mfd_assert_write, .-mfd_assert_write
	.comm	mfd_def_size,4,4
	.comm	hugetlbfs_test,4,4
	.comm	PROT_WRITE,4,4
	.comm	PROT_READ,4,4
	.comm	MAP_SHARED,4,4
	.comm	MAP_FAILED,4,4
	.comm	FALLOC_FL_PUNCH_HOLE,4,4
	.comm	FALLOC_FL_KEEP_SIZE,4,4
	.section	.rodata
	.align	2
	.set	.LANCHOR0,. + 0
.LC0:
	.ascii	"\000\000\000\000\000"
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
