	.file	"extr_vfio_platform_common.c_vfio_platform_regions_init.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	vfio_platform_regions_init, @function
vfio_platform_regions_init:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	xor	ebp, ebp
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	mov	rbx, rdi
	sub	rsp, 24
	.cfi_def_cfa_offset 80
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L3:
	add	ebp, 1
.L2:
	mov	esi, ebp
	mov	rdi, rbx
	call	[QWORD PTR 16[rbx]]
	test	rax, rax
	jne	.L3
	mov	edx, DWORD PTR GFP_KERNEL[rip]
	mov	esi, 4
	mov	edi, ebp
	call	kcalloc@PLT
	mov	QWORD PTR 8[rbx], rax
	test	rax, rax
	je	.L4
	lea	eax, -1[rbp]
	xor	r14d, r14d
	mov	QWORD PTR 8[rsp], rax
	test	ebp, ebp
	je	.L6
.L13:
	mov	esi, r14d
	mov	rdi, rbx
	call	[QWORD PTR 16[rbx]]
	mov	r13, rax
	test	rax, rax
	je	.L8
	mov	r15, QWORD PTR 8[rbx]
	lea	r12, [r14+r14*2]
	mov	eax, DWORD PTR [rax]
	mov	rdi, r13
	sal	r12, 3
	add	r15, r12
	mov	DWORD PTR [r15], eax
	call	resource_size@PLT
	mov	rdi, r13
	mov	DWORD PTR 4[r15], eax
	mov	rax, QWORD PTR 8[rbx]
	mov	QWORD PTR 16[rax+r12], 0
	call	resource_type@PLT
	cmp	eax, 128
	je	.L9
	cmp	eax, 129
	jne	.L8
	mov	rax, QWORD PTR 8[rbx]
	mov	ecx, DWORD PTR VFIO_PLATFORM_REGION_TYPE_PIO[rip]
	mov	DWORD PTR 8[rax+r12], ecx
.L12:
	lea	rax, 1[r14]
	cmp	r14, QWORD PTR 8[rsp]
	je	.L6
	mov	r14, rax
	jmp	.L13
	.p2align 4,,10
	.p2align 3
.L8:
	mov	rdi, QWORD PTR 8[rbx]
	call	kfree@PLT
	mov	eax, DWORD PTR EINVAL[rip]
	neg	eax
.L1:
	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
	mov	eax, DWORD PTR VFIO_PLATFORM_REGION_TYPE_MMIO[rip]
	add	r12, QWORD PTR 8[rbx]
	mov	ecx, DWORD PTR 4[r13]
	mov	DWORD PTR 8[r12], eax
	mov	rax, QWORD PTR 16[r12]
	or	rax, QWORD PTR VFIO_REGION_INFO_FLAG_READ[rip]
	mov	QWORD PTR 16[r12], rax
	test	DWORD PTR IORESOURCE_READONLY[rip], ecx
	jne	.L11
	or	rax, QWORD PTR VFIO_REGION_INFO_FLAG_WRITE[rip]
	mov	QWORD PTR 16[r12], rax
.L11:
	mov	eax, DWORD PTR PAGE_MASK[rip]
	not	eax
	test	DWORD PTR [r12], eax
	jne	.L12
	test	DWORD PTR 4[r12], eax
	jne	.L12
	mov	rax, QWORD PTR VFIO_REGION_INFO_FLAG_MMAP[rip]
	or	QWORD PTR 16[r12], rax
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L4:
	mov	eax, DWORD PTR ENOMEM[rip]
	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
	neg	eax
	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
.L6:
	.cfi_restore_state
	mov	DWORD PTR [rbx], ebp
	xor	eax, eax
	jmp	.L1
	.cfi_endproc
.LFE0:
	.size	vfio_platform_regions_init, .-vfio_platform_regions_init
	.comm	VFIO_REGION_INFO_FLAG_WRITE,8,8
	.comm	VFIO_REGION_INFO_FLAG_READ,8,8
	.comm	VFIO_REGION_INFO_FLAG_MMAP,8,8
	.comm	VFIO_PLATFORM_REGION_TYPE_PIO,4,4
	.comm	VFIO_PLATFORM_REGION_TYPE_MMIO,4,4
	.comm	PAGE_MASK,4,4
	.comm	IORESOURCE_READONLY,4,4
	.comm	GFP_KERNEL,4,4
	.comm	ENOMEM,4,4
	.comm	EINVAL,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_vfio_platform_common.c_vfio_platform_regions_init.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	vfio_platform_regions_init, %function
vfio_platform_regions_init:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r3, r4, r5, r6, r7, r8, r9, r10, fp, lr}
	mov	fp, #0
	mov	r5, r0
	b	.L2
.L3:
	add	fp, fp, #1
.L2:
	mov	r1, fp
	mov	r0, r5
	ldr	r3, [r5, #8]
	blx	r3
	cmp	r0, #0
	bne	.L3
	ldr	r2, .L21
	mov	r4, r0
	mov	r1, #4
	mov	r0, fp
	ldr	r2, [r2]
	bl	kcalloc
	cmp	r0, #0
	str	r0, [r5, #4]
	beq	.L4
	cmp	fp, #0
	beq	.L6
	ldr	r10, .L21+4
	ldr	r9, .L21+8
.L5:
	mov	r1, r4
	mov	r0, r5
	ldr	r3, [r5, #8]
	blx	r3
	subs	r6, r0, #0
	lsl	r7, r4, #4
	beq	.L8
	ldr	r3, [r5, #4]
	ldr	r2, [r6]
	add	r8, r3, r4, lsl #4
	str	r2, [r3, r4, lsl #4]
	bl	resource_size
	mov	r2, #0
	ldr	r3, [r5, #4]
	str	r0, [r8, #4]
	add	r3, r3, r7
	mov	r0, r6
	str	r2, [r3, #12]
	bl	resource_type
	cmp	r0, #128
	beq	.L9
	cmp	r0, #129
	bne	.L8
	ldr	r3, [r5, #4]
	add	r7, r3, r7
	ldr	r3, .L21+12
	ldr	r3, [r3]
	str	r3, [r7, #8]
.L12:
	add	r4, r4, #1
	cmp	fp, r4
	bne	.L5
.L6:
	mov	r0, #0
	str	fp, [r5]
	pop	{r3, r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L8:
	ldr	r0, [r5, #4]
	bl	kfree
	ldr	r3, .L21+16
	ldr	r0, [r3]
	rsb	r0, r0, #0
	pop	{r3, r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L9:
	ldr	r2, .L21+20
	ldr	r0, [r5, #4]
	ldr	lr, [r6, #4]
	ldr	ip, [r2]
	add	r3, r0, r7
	tst	lr, ip
	ldr	r2, [r3, #12]
	ldr	ip, [r9]
	ldr	r1, .L21+24
	orr	r2, r2, ip
	ldreq	ip, .L21+28
	str	r2, [r3, #12]
	ldreq	ip, [ip]
	ldr	r1, [r1]
	orreq	r2, ip, r2
	streq	r2, [r3, #12]
	ldr	r2, [r0, r7]
	ldr	lr, [r10]
	bics	r2, r2, r1
	mvn	r0, r1
	str	lr, [r3, #8]
	bne	.L12
	ldr	r2, [r3, #4]
	tst	r0, r2
	bne	.L12
	ldr	r1, .L21+32
	ldr	r2, [r3, #12]
	ldr	r1, [r1]
	orr	r2, r2, r1
	str	r2, [r3, #12]
	b	.L12
.L4:
	ldr	r3, .L21+36
	ldr	r0, [r3]
	rsb	r0, r0, #0
	pop	{r3, r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L22:
	.align	2
.L21:
	.word	GFP_KERNEL
	.word	VFIO_PLATFORM_REGION_TYPE_MMIO
	.word	VFIO_REGION_INFO_FLAG_READ
	.word	VFIO_PLATFORM_REGION_TYPE_PIO
	.word	EINVAL
	.word	IORESOURCE_READONLY
	.word	PAGE_MASK
	.word	VFIO_REGION_INFO_FLAG_WRITE
	.word	VFIO_REGION_INFO_FLAG_MMAP
	.word	ENOMEM
	.size	vfio_platform_regions_init, .-vfio_platform_regions_init
	.comm	VFIO_REGION_INFO_FLAG_WRITE,4,4
	.comm	VFIO_REGION_INFO_FLAG_READ,4,4
	.comm	VFIO_REGION_INFO_FLAG_MMAP,4,4
	.comm	VFIO_PLATFORM_REGION_TYPE_PIO,4,4
	.comm	VFIO_PLATFORM_REGION_TYPE_MMIO,4,4
	.comm	PAGE_MASK,4,4
	.comm	IORESOURCE_READONLY,4,4
	.comm	GFP_KERNEL,4,4
	.comm	ENOMEM,4,4
	.comm	EINVAL,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
