	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function iommu_load_old_irte
_iommu_load_old_irte:                   ## @iommu_load_old_irte
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r15
	movq	_DMAR_IRTA_REG@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	8(%r15), %rdi
	callq	_dmar_readq
	movq	_INTR_REMAP_TABLE_REG_SIZE_MASK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	andl	%eax, %ecx
	movq	_INTR_REMAP_TABLE_REG_SIZE@GOTPCREL(%rip), %rdx
	cmpl	(%rdx), %ecx
	jne	LBB0_1
## %bb.3:
	movq	_VTD_PAGE_MASK@GOTPCREL(%rip), %rcx
	andl	(%rcx), %eax
	movq	_INTR_REMAP_TABLE_ENTRIES@GOTPCREL(%rip), %r12
	movslq	(%r12), %rbx
	shlq	$2, %rbx
	movq	_MEMREMAP_WB@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movl	%eax, %edi
	movq	%rbx, %rsi
	callq	_memremap
	testq	%rax, %rax
	je	LBB0_4
## %bb.5:
	movq	%rax, %r14
	movq	(%r15), %rax
	movq	8(%rax), %rdi
	movq	%r14, %rsi
	movq	%rbx, %rdx
	callq	_memcpy
	movq	(%r15), %rax
	movq	8(%rax), %rsi
	movq	%r15, %rdi
	movq	%rbx, %rdx
	callq	___iommu_flush_cache
	movl	(%r12), %eax
	testl	%eax, %eax
	je	LBB0_10
## %bb.6:
	xorl	%ebx, %ebx
	jmp	LBB0_7
	.p2align	4, 0x90
LBB0_9:                                 ##   in Loop: Header=BB0_7 Depth=1
	incq	%rbx
	movl	%eax, %ecx
	cmpq	%rcx, %rbx
	jae	LBB0_10
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r15), %rcx
	movq	8(%rcx), %rdx
	cmpq	$0, (%rdx,%rbx,8)
	je	LBB0_9
## %bb.8:                               ##   in Loop: Header=BB0_7 Depth=1
	movl	(%rcx), %edi
	movl	%ebx, %esi
	movl	$1, %edx
	callq	_bitmap_set
	movl	(%r12), %eax
	jmp	LBB0_9
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	jmp	LBB0_2
LBB0_10:
	movq	%r14, %rdi
	callq	_memunmap
	xorl	%eax, %eax
	jmp	LBB0_11
LBB0_4:
	movq	_ENOMEM@GOTPCREL(%rip), %rcx
LBB0_2:
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_11:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_DMAR_IRTA_REG,8,3              ## @DMAR_IRTA_REG
	.comm	_INTR_REMAP_TABLE_REG_SIZE_MASK,4,2 ## @INTR_REMAP_TABLE_REG_SIZE_MASK
	.comm	_INTR_REMAP_TABLE_REG_SIZE,4,2  ## @INTR_REMAP_TABLE_REG_SIZE
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_VTD_PAGE_MASK,4,2              ## @VTD_PAGE_MASK
	.comm	_INTR_REMAP_TABLE_ENTRIES,4,2   ## @INTR_REMAP_TABLE_ENTRIES
	.comm	_MEMREMAP_WB,4,2                ## @MEMREMAP_WB
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.no_dead_strip	_iommu_load_old_irte
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function iommu_load_old_irte
_iommu_load_old_irte:                   ; @iommu_load_old_irte
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x19, x0
	ldr	x8, [x0, #8]
Lloh0:
	adrp	x9, _DMAR_IRTA_REG@GOTPAGE
Lloh1:
	ldr	x9, [x9, _DMAR_IRTA_REG@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	add	x0, x9, x8
	bl	_dmar_readq
Lloh3:
	adrp	x8, _INTR_REMAP_TABLE_REG_SIZE_MASK@GOTPAGE
Lloh4:
	ldr	x8, [x8, _INTR_REMAP_TABLE_REG_SIZE_MASK@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	and	w8, w8, w0
Lloh6:
	adrp	x9, _INTR_REMAP_TABLE_REG_SIZE@GOTPAGE
Lloh7:
	ldr	x9, [x9, _INTR_REMAP_TABLE_REG_SIZE@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ne	LBB0_7
; %bb.1:
Lloh9:
	adrp	x8, _VTD_PAGE_MASK@GOTPAGE
Lloh10:
	ldr	x8, [x8, _VTD_PAGE_MASK@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
Lloh12:
	adrp	x22, _INTR_REMAP_TABLE_ENTRIES@GOTPAGE
Lloh13:
	ldr	x22, [x22, _INTR_REMAP_TABLE_ENTRIES@GOTPAGEOFF]
	and	w0, w8, w0
	ldrsw	x8, [x22]
	lsl	x21, x8, #2
Lloh14:
	adrp	x8, _MEMREMAP_WB@GOTPAGE
Lloh15:
	ldr	x8, [x8, _MEMREMAP_WB@GOTPAGEOFF]
Lloh16:
	ldr	w2, [x8]
	mov	x1, x21
	bl	_memremap
	cbz	x0, LBB0_9
; %bb.2:
	mov	x20, x0
	ldr	x8, [x19]
	ldr	x0, [x8, #8]
	mov	x1, x20
	mov	x2, x21
	bl	_memcpy
	ldr	x8, [x19]
	ldr	x1, [x8, #8]
	mov	x0, x19
	mov	x2, x21
	bl	___iommu_flush_cache
	ldr	w8, [x22]
	cbz	w8, LBB0_8
; %bb.3:
	mov	x21, #0
	b	LBB0_5
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=1
	add	x21, x21, #1
	cmp	x21, w8, uxtw
	b.hs	LBB0_8
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x9, [x19]
	ldr	x10, [x9, #8]
	ldr	x10, [x10, x21, lsl #3]
	cbz	x10, LBB0_4
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	w0, [x9]
	mov	x1, x21
	mov	w2, #1
	bl	_bitmap_set
	ldr	w8, [x22]
	b	LBB0_4
LBB0_7:
Lloh17:
	adrp	x8, _EINVAL@GOTPAGE
Lloh18:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_10
LBB0_8:
	mov	x0, x20
	bl	_memunmap
	mov	w0, #0
	b	LBB0_11
LBB0_9:
Lloh19:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh20:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
LBB0_10:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_11:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
	.comm	_DMAR_IRTA_REG,8,3              ; @DMAR_IRTA_REG
	.comm	_INTR_REMAP_TABLE_REG_SIZE_MASK,4,2 ; @INTR_REMAP_TABLE_REG_SIZE_MASK
	.comm	_INTR_REMAP_TABLE_REG_SIZE,4,2  ; @INTR_REMAP_TABLE_REG_SIZE
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_VTD_PAGE_MASK,4,2              ; @VTD_PAGE_MASK
	.comm	_INTR_REMAP_TABLE_ENTRIES,4,2   ; @INTR_REMAP_TABLE_ENTRIES
	.comm	_MEMREMAP_WB,4,2                ; @MEMREMAP_WB
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.no_dead_strip	_iommu_load_old_irte
.subsections_via_symbols
