	.file	"extr_iova.c___iova_rcache_insert.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	__iova_rcache_insert, @function
__iova_rcache_insert:
.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
	mov	r13, rdi
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	mov	r12, rdx
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	mov	rbx, rsi
	sub	rsp, 24
	.cfi_def_cfa_offset 80
	mov	edi, DWORD PTR 24[rsi]
	call	raw_cpu_ptr@PLT
	xor	esi, esi
	mov	rbp, rax
	mov	rdi, rax
	call	spin_lock_irqsave@PLT
	mov	rdi, QWORD PTR 8[rbp]
	call	iova_magazine_full@PLT
	test	eax, eax
	jne	.L15
.L2:
	mov	rdi, QWORD PTR 8[rbp]
	mov	rsi, r12
.L12:
	call	iova_magazine_push@PLT
	xor	esi, esi
	mov	rdi, rbp
	call	spin_unlock_irqrestore@PLT
.L13:
	add	rsp, 24
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	mov	eax, 1
	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
.L15:
	.cfi_restore_state
	mov	rdi, QWORD PTR 16[rbp]
	call	iova_magazine_full@PLT
	test	eax, eax
	jne	.L3
	mov	rsi, QWORD PTR 8[rbp]
	mov	rdi, QWORD PTR 16[rbp]
	call	swap@PLT
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L3:
	mov	edi, DWORD PTR GFP_ATOMIC[rip]
	call	iova_magazine_alloc@PLT
	mov	r14, rax
	test	rax, rax
	je	.L16
	lea	rdi, 8[rbx]
	mov	QWORD PTR 8[rsp], rdi
	call	spin_lock@PLT
	mov	rax, QWORD PTR [rbx]
	cmp	rax, QWORD PTR MAX_GLOBAL_MAGS[rip]
	mov	rdi, QWORD PTR 8[rsp]
	jge	.L6
	lea	rcx, 1[rax]
	mov	rdx, QWORD PTR 16[rbx]
	mov	QWORD PTR [rbx], rcx
	mov	rcx, QWORD PTR 8[rbp]
	mov	QWORD PTR [rdx+rax*8], rcx
	call	spin_unlock@PLT
	mov	QWORD PTR 8[rbp], r14
	mov	rsi, r12
	mov	rdi, r14
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L16:
	mov	rdi, rbp
	xor	esi, esi
	call	spin_unlock_irqrestore@PLT
	add	rsp, 24
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xor	eax, eax
	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
.L6:
	.cfi_restore_state
	mov	r15, QWORD PTR 8[rbp]
	call	spin_unlock@PLT
	mov	QWORD PTR 8[rbp], r14
	mov	rsi, r12
	mov	rdi, r14
	call	iova_magazine_push@PLT
	xor	esi, esi
	mov	rdi, rbp
	call	spin_unlock_irqrestore@PLT
	test	r15, r15
	je	.L13
	mov	rsi, r13
	mov	rdi, r15
	call	iova_magazine_free_pfns@PLT
	mov	rdi, r15
	call	iova_magazine_free@PLT
	add	rsp, 24
	.cfi_def_cfa_offset 56
	mov	eax, 1
	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
	.cfi_endproc
.LFE0:
	.size	__iova_rcache_insert, .-__iova_rcache_insert
	.comm	MAX_GLOBAL_MAGS,8,8
	.comm	GFP_ATOMIC,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_iova.c___iova_rcache_insert.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	__iova_rcache_insert, %function
__iova_rcache_insert:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, lr}
	mov	r7, r0
	ldr	r0, [r1, #12]
	mov	r8, r2
	mov	r6, r1
	bl	raw_cpu_ptr
	mov	r4, r0
	mov	r1, #0
	bl	spin_lock_irqsave
	ldr	r0, [r4, #4]
	bl	iova_magazine_full
	cmp	r0, #0
	bne	.L15
.L2:
	mov	r1, r8
	ldr	r0, [r4, #4]
.L12:
	bl	iova_magazine_push
	mov	r0, r4
	mov	r1, #0
	bl	spin_unlock_irqrestore
.L13:
	mov	r0, #1
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L15:
	ldr	r0, [r4, #8]
	bl	iova_magazine_full
	cmp	r0, #0
	bne	.L3
	ldr	r1, [r4, #4]
	ldr	r0, [r4, #8]
	bl	swap
	b	.L2
.L3:
	ldr	r3, .L17
	ldr	r0, [r3]
	bl	iova_magazine_alloc
	subs	r5, r0, #0
	beq	.L16
	add	r9, r6, #4
	mov	r0, r9
	bl	spin_lock
	ldr	r2, .L17+4
	ldr	r3, [r6]
	ldr	r2, [r2]
	cmp	r3, r2
	bge	.L6
	add	r1, r3, #1
	str	r1, [r6]
	ldr	r2, [r6, #8]
	ldr	r1, [r4, #4]
	mov	r0, r9
	str	r1, [r2, r3, lsl #2]
	bl	spin_unlock
	mov	r1, r8
	mov	r0, r5
	str	r5, [r4, #4]
	b	.L12
.L16:
	mov	r0, r4
	mov	r1, #0
	bl	spin_unlock_irqrestore
	mov	r0, r5
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L6:
	mov	r0, r9
	ldr	r6, [r4, #4]
	bl	spin_unlock
	mov	r1, r8
	mov	r0, r5
	str	r5, [r4, #4]
	bl	iova_magazine_push
	mov	r0, r4
	mov	r1, #0
	bl	spin_unlock_irqrestore
	cmp	r6, #0
	beq	.L13
	mov	r1, r7
	mov	r0, r6
	bl	iova_magazine_free_pfns
	mov	r0, r6
	bl	iova_magazine_free
	mov	r0, #1
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L18:
	.align	2
.L17:
	.word	GFP_ATOMIC
	.word	MAX_GLOBAL_MAGS
	.size	__iova_rcache_insert, .-__iova_rcache_insert
	.comm	MAX_GLOBAL_MAGS,4,4
	.comm	GFP_ATOMIC,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
