	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function __iova_rcache_insert
___iova_rcache_insert:                  ## @__iova_rcache_insert
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r15
	movq	%rsi, %r12
	movq	%rdi, %r14
	movl	24(%rsi), %edi
	callq	_raw_cpu_ptr
	movq	%rax, %rbx
	movq	%rax, %rdi
	callq	_spin_lock_irqsave
	movq	8(%rbx), %rdi
	callq	_iova_magazine_full
	testl	%eax, %eax
	je	LBB0_8
## %bb.1:
	movq	16(%rbx), %rdi
	callq	_iova_magazine_full
	testl	%eax, %eax
	je	LBB0_7
## %bb.2:
	movq	%r14, -56(%rbp)                 ## 8-byte Spill
	movq	_GFP_ATOMIC@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_iova_magazine_alloc
	testq	%rax, %rax
	je	LBB0_11
## %bb.3:
	movq	%rax, %r14
	leaq	8(%r12), %rdi
	movq	%rdi, -48(%rbp)                 ## 8-byte Spill
	callq	_spin_lock
	movq	(%r12), %rax
	movq	_MAX_GLOBAL_MAGS@GOTPCREL(%rip), %rcx
	movq	8(%rbx), %r13
	cmpq	(%rcx), %rax
	jge	LBB0_5
## %bb.4:
	movq	16(%r12), %rcx
	leaq	1(%rax), %rdx
	movq	%rdx, (%r12)
	movq	%r13, (%rcx,%rax,8)
	xorl	%r13d, %r13d
LBB0_5:
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_spin_unlock
	movq	%r14, 8(%rbx)
	movq	-56(%rbp), %r14                 ## 8-byte Reload
	jmp	LBB0_9
LBB0_7:
	movq	8(%rbx), %rsi
	movq	16(%rbx), %rdi
	callq	_swap
LBB0_8:
	xorl	%r13d, %r13d
LBB0_9:
	movq	8(%rbx), %rdi
	movq	%r15, %rsi
	callq	_iova_magazine_push
	movq	%rbx, %rdi
	callq	_spin_unlock_irqrestore
	movl	$1, %ebx
	testq	%r13, %r13
	je	LBB0_12
## %bb.10:
	movq	%r13, %rdi
	movq	%r14, %rsi
	callq	_iova_magazine_free_pfns
	movq	%r13, %rdi
	callq	_iova_magazine_free
	jmp	LBB0_12
LBB0_11:
	movq	%rbx, %rdi
	callq	_spin_unlock_irqrestore
	xorl	%ebx, %ebx
LBB0_12:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_GFP_ATOMIC,4,2                 ## @GFP_ATOMIC
	.comm	_MAX_GLOBAL_MAGS,8,3            ## @MAX_GLOBAL_MAGS
	.no_dead_strip	___iova_rcache_insert
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function __iova_rcache_insert
___iova_rcache_insert:                  ; @__iova_rcache_insert
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x20, x2
	mov	x22, x1
	mov	x19, x0
	ldr	w0, [x1, #24]
	bl	_raw_cpu_ptr
	mov	x21, x0
	bl	_spin_lock_irqsave
	ldr	x0, [x21, #8]
	bl	_iova_magazine_full
	cbz	w0, LBB0_7
; %bb.1:
	ldr	x0, [x21, #16]
	bl	_iova_magazine_full
	cbz	w0, LBB0_6
; %bb.2:
Lloh0:
	adrp	x8, _GFP_ATOMIC@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GFP_ATOMIC@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	bl	_iova_magazine_alloc
	cbz	x0, LBB0_12
; %bb.3:
	mov	x24, x0
	add	x25, x22, #8
	mov	x0, x25
	bl	_spin_lock
	ldr	x8, [x22]
Lloh3:
	adrp	x9, _MAX_GLOBAL_MAGS@GOTPAGE
Lloh4:
	ldr	x9, [x9, _MAX_GLOBAL_MAGS@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	ldr	x23, [x21, #8]
	cmp	x8, x9
	b.ge	LBB0_5
; %bb.4:
	ldr	x9, [x22, #16]
	add	x10, x8, #1
	str	x10, [x22]
	str	x23, [x9, x8, lsl #3]
	mov	x23, #0
LBB0_5:
	mov	x0, x25
	bl	_spin_unlock
	str	x24, [x21, #8]
	b	LBB0_8
LBB0_6:
	ldp	x1, x0, [x21, #8]
	bl	_swap
LBB0_7:
	mov	x23, #0
LBB0_8:
	ldr	x0, [x21, #8]
	mov	x1, x20
	bl	_iova_magazine_push
	mov	x0, x21
	bl	_spin_unlock_irqrestore
	cbz	x23, LBB0_10
; %bb.9:
	mov	x0, x23
	mov	x1, x19
	bl	_iova_magazine_free_pfns
	mov	x0, x23
	bl	_iova_magazine_free
LBB0_10:
	mov	w0, #1
LBB0_11:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
LBB0_12:
	mov	x0, x21
	bl	_spin_unlock_irqrestore
	mov	w0, #0
	b	LBB0_11
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_ATOMIC,4,2                 ; @GFP_ATOMIC
	.comm	_MAX_GLOBAL_MAGS,8,3            ; @MAX_GLOBAL_MAGS
	.no_dead_strip	___iova_rcache_insert
.subsections_via_symbols
