	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function gart_unmap_page
_gart_unmap_page:                       ## @gart_unmap_page
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	_iommu_bus_base@GOTPCREL(%rip), %rax
	movq	(%rax), %rcx
	movq	_EMERGENCY_PAGES@GOTPCREL(%rip), %rax
	movslq	(%rax), %rdi
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rax
	movslq	(%rax), %rax
	imulq	%rax, %rdi
	addq	%rcx, %rdi
	cmpq	%rsi, %rdi
	jg	LBB0_5
## %bb.1:
	movq	_iommu_size@GOTPCREL(%rip), %rdi
	movq	(%rdi), %rdi
	addq	%rcx, %rdi
	cmpq	%rsi, %rdi
	jle	LBB0_5
## %bb.2:
	movq	%rsi, %r14
	subq	%rcx, %r14
	movq	_PAGE_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	sarq	%cl, %r14
	movq	%rsi, %rdi
	movq	%rdx, %rsi
	movl	%eax, %edx
	callq	_iommu_num_pages
	testl	%eax, %eax
	jle	LBB0_22
## %bb.3:
	movq	_iommu_gatt_base@GOTPCREL(%rip), %rcx
	movq	(%rcx), %r9
	movl	%eax, %r11d
	cmpl	$8, %eax
	jb	LBB0_4
## %bb.6:
	leaq	(%r9,%r14,4), %rdx
	movq	_gart_unmapped_entry@GOTPCREL(%rip), %r8
	leaq	4(%r8), %rsi
	cmpq	%rsi, %rdx
	jae	LBB0_9
## %bb.7:
	leaq	(%r14,%r11), %rdx
	leaq	(%r9,%rdx,4), %rdx
	cmpq	_gart_unmapped_entry@GOTPCREL(%rip), %rdx
	jbe	LBB0_9
LBB0_4:
	xorl	%esi, %esi
LBB0_16:
	movq	%rsi, %r8
	notq	%r8
	addq	%r11, %r8
	movq	%r11, %rdi
	andq	$3, %rdi
	je	LBB0_19
## %bb.17:
	leaq	(%r9,%r14,4), %rbx
	movq	_gart_unmapped_entry@GOTPCREL(%rip), %rdx
	.p2align	4, 0x90
LBB0_18:                                ## =>This Inner Loop Header: Depth=1
	movl	(%rdx), %ecx
	movl	%ecx, (%rbx,%rsi,4)
	incq	%rsi
	decq	%rdi
	jne	LBB0_18
LBB0_19:
	cmpq	$3, %r8
	jb	LBB0_22
## %bb.20:
	leaq	(%r9,%r14,4), %rdx
	addq	$12, %rdx
	movq	_gart_unmapped_entry@GOTPCREL(%rip), %rdi
	.p2align	4, 0x90
LBB0_21:                                ## =>This Inner Loop Header: Depth=1
	movl	(%rdi), %ecx
	movl	%ecx, -12(%rdx,%rsi,4)
	movl	(%rdi), %ecx
	movl	%ecx, -8(%rdx,%rsi,4)
	movl	(%rdi), %ecx
	movl	%ecx, -4(%rdx,%rsi,4)
	movl	(%rdi), %ecx
	movl	%ecx, (%rdx,%rsi,4)
	addq	$4, %rsi
	cmpq	%rsi, %r11
	jne	LBB0_21
	jmp	LBB0_22
LBB0_5:
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
LBB0_9:
	movl	%r11d, %esi
	andl	$-8, %esi
	leaq	-8(%rsi), %rdx
	movq	%rdx, %r10
	shrq	$3, %r10
	incq	%r10
	testq	%rdx, %rdx
	je	LBB0_12
## %bb.10:
	movq	%r10, %rdi
	andq	$-2, %rdi
	movd	(%r8), %xmm0                    ## xmm0 = mem[0],zero,zero,zero
	pshufd	$0, %xmm0, %xmm0                ## xmm0 = xmm0[0,0,0,0]
	leaq	(%r9,%r14,4), %rbx
	addq	$48, %rbx
	xorl	%edx, %edx
	.p2align	4, 0x90
LBB0_11:                                ## =>This Inner Loop Header: Depth=1
	movdqu	%xmm0, -48(%rbx,%rdx,4)
	movdqu	%xmm0, -32(%rbx,%rdx,4)
	movdqu	%xmm0, -16(%rbx,%rdx,4)
	movdqu	%xmm0, (%rbx,%rdx,4)
	addq	$16, %rdx
	addq	$-2, %rdi
	jne	LBB0_11
	jmp	LBB0_13
LBB0_12:
	xorl	%edx, %edx
LBB0_13:
	testb	$1, %r10b
	je	LBB0_15
## %bb.14:
	movd	(%r8), %xmm0                    ## xmm0 = mem[0],zero,zero,zero
	pshufd	$0, %xmm0, %xmm0                ## xmm0 = xmm0[0,0,0,0]
	addq	%r14, %rdx
	movdqu	%xmm0, (%r9,%rdx,4)
	movdqu	%xmm0, 16(%r9,%rdx,4)
LBB0_15:
	cmpq	%r11, %rsi
	jne	LBB0_16
LBB0_22:
	movq	%r14, %rdi
	movl	%eax, %esi
	popq	%rbx
	popq	%r14
	popq	%rbp
	jmp	_free_iommu                     ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_iommu_bus_base,8,3             ## @iommu_bus_base
	.comm	_EMERGENCY_PAGES,4,2            ## @EMERGENCY_PAGES
	.comm	_PAGE_SIZE,4,2                  ## @PAGE_SIZE
	.comm	_iommu_size,8,3                 ## @iommu_size
	.comm	_PAGE_SHIFT,8,3                 ## @PAGE_SHIFT
	.comm	_gart_unmapped_entry,4,2        ## @gart_unmapped_entry
	.comm	_iommu_gatt_base,8,3            ## @iommu_gatt_base
	.no_dead_strip	_gart_unmap_page
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function gart_unmap_page
_gart_unmap_page:                       ; @gart_unmap_page
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
Lloh0:
	adrp	x8, _iommu_bus_base@GOTPAGE
Lloh1:
	ldr	x8, [x8, _iommu_bus_base@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x8]
Lloh3:
	adrp	x8, _EMERGENCY_PAGES@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EMERGENCY_PAGES@GOTPAGEOFF]
Lloh5:
	ldrsw	x10, [x8]
Lloh6:
	adrp	x8, _PAGE_SIZE@GOTPAGE
Lloh7:
	ldr	x8, [x8, _PAGE_SIZE@GOTPAGEOFF]
Lloh8:
	ldrsw	x8, [x8]
	madd	x10, x8, x10, x9
	cmp	x10, x1
	b.gt	LBB0_8
; %bb.1:
Lloh9:
	adrp	x10, _iommu_size@GOTPAGE
Lloh10:
	ldr	x10, [x10, _iommu_size@GOTPAGEOFF]
Lloh11:
	ldr	x10, [x10]
	add	x10, x10, x9
	cmp	x10, x1
	b.le	LBB0_8
; %bb.2:
	sub	x9, x1, x9
Lloh12:
	adrp	x10, _PAGE_SHIFT@GOTPAGE
Lloh13:
	ldr	x10, [x10, _PAGE_SHIFT@GOTPAGEOFF]
Lloh14:
	ldr	x10, [x10]
	asr	x19, x9, x10
	mov	x0, x1
	mov	x1, x2
	mov	x2, x8
	bl	_iommu_num_pages
	mov	x1, x0
	cmp	w0, #1
	b.lt	LBB0_12
; %bb.3:
Lloh15:
	adrp	x8, _iommu_gatt_base@GOTPAGE
Lloh16:
	ldr	x8, [x8, _iommu_gatt_base@GOTPAGEOFF]
Lloh17:
	ldr	x10, [x8]
	mov	w9, w1
Lloh18:
	adrp	x8, _gart_unmapped_entry@GOTPAGE
Lloh19:
	ldr	x8, [x8, _gart_unmapped_entry@GOTPAGEOFF]
	cmp	w1, #16
	b.lo	LBB0_9
; %bb.4:
	add	x12, x10, x19, lsl #2
	add	x11, x19, x9
	add	x11, x10, x11, lsl #2
	add	x13, x8, #4
	cmp	x12, x13
	ccmp	x11, x8, #0, lo
	b.hi	LBB0_9
; %bb.5:
	and	x11, x9, #0xfffffff0
	ld1r.4s	{ v0 }, [x8]
	add	x12, x12, #32
	mov	x13, x11
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	stp	q0, q0, [x12, #-32]
	stp	q0, q0, [x12], #64
	subs	x13, x13, #16
	b.ne	LBB0_6
; %bb.7:
	cmp	x11, x9
	b.ne	LBB0_10
	b	LBB0_12
LBB0_8:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
LBB0_9:
	mov	x11, #0
LBB0_10:
	add	x12, x11, x19
	add	x10, x10, x12, lsl #2
	sub	x9, x9, x11
LBB0_11:                                ; =>This Inner Loop Header: Depth=1
	ldr	w11, [x8]
	str	w11, [x10], #4
	subs	x9, x9, #1
	b.ne	LBB0_11
LBB0_12:
	mov	x0, x19
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_free_iommu
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_iommu_bus_base,8,3             ; @iommu_bus_base
	.comm	_EMERGENCY_PAGES,4,2            ; @EMERGENCY_PAGES
	.comm	_PAGE_SIZE,4,2                  ; @PAGE_SIZE
	.comm	_iommu_size,8,3                 ; @iommu_size
	.comm	_PAGE_SHIFT,8,3                 ; @PAGE_SHIFT
	.comm	_gart_unmapped_entry,4,2        ; @gart_unmapped_entry
	.comm	_iommu_gatt_base,8,3            ; @iommu_gatt_base
	.no_dead_strip	_gart_unmap_page
.subsections_via_symbols
