	.file	"extr_flash.c_flash_mmap.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	flash_mmap, @function
flash_mmap:
.LFB0:
	.cfi_startproc
	endbr64
	push	r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	lea	rdi, flash_lock[rip]
	push	r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	push	rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	mov	rbp, rsi
	push	rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	sub	rsp, 8
	.cfi_def_cfa_offset 48
	call	spin_lock@PLT
	mov	rbx, QWORD PTR flash[rip]
	mov	rax, QWORD PTR flash[rip+8]
	mov	r12, QWORD PTR flash[rip+16]
	cmp	rbx, rax
	je	.L3
	mov	edx, DWORD PTR 0[rbp]
	mov	ecx, DWORD PTR VM_WRITE[rip]
	and	ecx, edx
	test	DWORD PTR VM_READ[rip], edx
	jne	.L14
	test	ecx, ecx
	je	.L7
	mov	r12, QWORD PTR flash[rip+24]
	mov	rbx, rax
.L3:
	lea	rdi, flash_lock[rip]
	call	spin_unlock@PLT
	mov	rdx, QWORD PTR 8[rbp]
	mov	rcx, QWORD PTR PAGE_SHIFT[rip]
	mov	rax, rdx
	sal	rax, cl
	cmp	rax, r12
	jbe	.L8
	mov	eax, DWORD PTR ENXIO[rip]
	neg	eax
.L1:
	add	rsp, 8
	.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
.L8:
	.cfi_restore_state
	shr	rbx, cl
	mov	rcx, QWORD PTR 16[rbp]
	sub	rcx, QWORD PTR 24[rbp]
	sub	rcx, rax
	mov	edi, DWORD PTR 32[rbp]
	lea	r13, [rdx+rbx]
	cmp	rcx, r12
	cmovnb	r12, rcx
	call	pgprot_noncached@PLT
	mov	rsi, QWORD PTR 24[rbp]
	mov	rdx, r13
	mov	rdi, rbp
	mov	DWORD PTR 32[rbp], eax
	mov	r8d, eax
	mov	rcx, r12
	call	io_remap_pfn_range@PLT
	mov	r8, rax
	xor	eax, eax
	test	r8, r8
	je	.L1
	mov	eax, DWORD PTR EAGAIN[rip]
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	pop	rbx
	.cfi_def_cfa_offset 32
	pop	rbp
	.cfi_def_cfa_offset 24
	neg	eax
	pop	r12
	.cfi_def_cfa_offset 16
	pop	r13
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L14:
	.cfi_restore_state
	mov	r12, QWORD PTR flash[rip+16]
	test	ecx, ecx
	je	.L3
	lea	rdi, flash_lock[rip]
	call	spin_unlock@PLT
	mov	eax, DWORD PTR EINVAL[rip]
	neg	eax
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L7:
	lea	rdi, flash_lock[rip]
	call	spin_unlock@PLT
	mov	eax, DWORD PTR ENXIO[rip]
	neg	eax
	jmp	.L1
	.cfi_endproc
.LFE0:
	.size	flash_mmap, .-flash_mmap
	.comm	flash_lock,4,4
	.comm	flash,32,32
	.comm	VM_WRITE,4,4
	.comm	VM_READ,4,4
	.comm	PAGE_SHIFT,8,8
	.comm	ENXIO,4,4
	.comm	EINVAL,4,4
	.comm	EAGAIN,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_flash.c_flash_mmap.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	flash_mmap, %function
flash_mmap:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, lr}
	ldr	r0, .L16
	sub	sp, sp, #12
	mov	r4, r1
	bl	spin_lock
	ldr	r3, .L16+4
	ldr	r7, [r3]
	ldr	r2, [r3, #4]
	cmp	r7, r2
	beq	.L5
	ldr	r1, .L16+8
	ldr	r0, .L16+12
	ldr	ip, [r1]
	ldr	r1, [r4]
	ldr	r0, [r0]
	tst	r1, ip
	and	r1, r1, r0
	bne	.L14
	cmp	r1, #0
	beq	.L7
	mov	r7, r2
	ldr	r5, [r3, #12]
	b	.L3
.L14:
	cmp	r1, #0
	bne	.L15
.L5:
	ldr	r5, [r3, #8]
.L3:
	ldr	r0, .L16
	bl	spin_unlock
	ldr	r3, .L16+16
	ldr	r1, [r4, #4]
	ldr	r6, [r3]
	cmp	r5, r1, lsl r6
	lsl	r2, r1, r6
	bcs	.L8
	ldr	r3, .L16+20
	ldr	r0, [r3]
	rsb	r0, r0, #0
.L1:
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, pc}
.L8:
	ldr	r0, [r4, #12]
	ldr	r3, [r4, #8]
	add	r6, r1, r7, lsr r6
	sub	r3, r3, r0
	sub	r3, r3, r2
	cmp	r3, r5
	ldr	r0, [r4, #16]
	movcs	r5, r3
	bl	pgprot_noncached
	str	r0, [r4, #16]
	str	r0, [sp]
	mov	r3, r5
	mov	r2, r6
	mov	r0, r4
	ldr	r1, [r4, #12]
	bl	io_remap_pfn_range
	cmp	r0, #0
	ldrne	r3, .L16+24
	ldrne	r0, [r3]
	rsbne	r0, r0, #0
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, pc}
.L15:
	ldr	r0, .L16
	bl	spin_unlock
	ldr	r3, .L16+28
	ldr	r0, [r3]
	rsb	r0, r0, #0
	b	.L1
.L7:
	ldr	r0, .L16
	bl	spin_unlock
	ldr	r3, .L16+20
	ldr	r0, [r3]
	rsb	r0, r0, #0
	b	.L1
.L17:
	.align	2
.L16:
	.word	flash_lock
	.word	flash
	.word	VM_READ
	.word	VM_WRITE
	.word	PAGE_SHIFT
	.word	ENXIO
	.word	EAGAIN
	.word	EINVAL
	.size	flash_mmap, .-flash_mmap
	.comm	flash_lock,4,4
	.comm	flash,16,4
	.comm	VM_WRITE,4,4
	.comm	VM_READ,4,4
	.comm	PAGE_SHIFT,4,4
	.comm	ENXIO,4,4
	.comm	EINVAL,4,4
	.comm	EAGAIN,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
