	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_scif_unmap_window              ## -- Begin function scif_unmap_window
	.p2align	4, 0x90
_scif_unmap_window:                     ## @scif_unmap_window
	.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	%rsi, %r15
	movq	%rdi, %r14
	xorl	%eax, %eax
	callq	_scif_is_iommu_enabled
	testq	%rax, %rax
	je	LBB0_4
## %bb.1:
	movq	%r14, %rdi
	callq	_scifdev_self
	testl	%eax, %eax
	je	LBB0_2
LBB0_4:
	movl	(%r15), %eax
	testl	%eax, %eax
	jle	LBB0_9
## %bb.5:
	movq	8(%r15), %rcx
	xorl	%ebx, %ebx
	movq	_PAGE_SHIFT@GOTPCREL(%rip), %r12
	jmp	LBB0_6
	.p2align	4, 0x90
LBB0_8:                                 ##   in Loop: Header=BB0_6 Depth=1
	incq	%rbx
	movslq	%eax, %rdx
	cmpq	%rdx, %rbx
	jge	LBB0_9
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%rcx,%rbx,4), %edi
	testl	%edi, %edi
	je	LBB0_8
## %bb.7:                               ##   in Loop: Header=BB0_6 Depth=1
	movq	16(%r15), %rax
	movl	(%rax,%rbx,4), %edx
	movzbl	(%r12), %ecx
	shll	%cl, %edx
	movq	%r14, %rsi
	callq	_scif_unmap_single
	movq	8(%r15), %rcx
	movl	$0, (%rcx,%rbx,4)
	movl	(%r15), %eax
	jmp	LBB0_8
LBB0_2:
	movq	24(%r15), %rax
	testq	%rax, %rax
	je	LBB0_9
## %bb.3:
	movq	(%r14), %rdi
	movl	(%rax), %edx
	movl	4(%rax), %esi
	movq	_DMA_BIDIRECTIONAL@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	callq	_dma_unmap_sg
	movq	24(%r15), %rdi
	callq	_sg_free_table
	movq	24(%r15), %rdi
	callq	_kfree
	movq	$0, 24(%r15)
LBB0_9:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_DMA_BIDIRECTIONAL,4,2          ## @DMA_BIDIRECTIONAL
	.comm	_PAGE_SHIFT,4,2                 ## @PAGE_SHIFT
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_scif_unmap_window              ; -- Begin function scif_unmap_window
	.p2align	2
_scif_unmap_window:                     ; @scif_unmap_window
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x19, x1
	mov	x20, x0
	bl	_scif_is_iommu_enabled
	cbz	x0, LBB0_2
; %bb.1:
	mov	x0, x20
	bl	_scifdev_self
	cbz	w0, LBB0_7
LBB0_2:
	ldr	w8, [x19]
	cmp	w8, #1
	b.lt	LBB0_9
; %bb.3:
	mov	x21, #0
	ldr	x9, [x19, #8]
Lloh0:
	adrp	x22, _PAGE_SHIFT@GOTPAGE
Lloh1:
	ldr	x22, [x22, _PAGE_SHIFT@GOTPAGEOFF]
	b	LBB0_5
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=1
	add	x21, x21, #1
	cmp	x21, w8, sxtw
	b.ge	LBB0_9
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x9, x21, lsl #2]
	cbz	w0, LBB0_4
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	x8, [x19, #16]
	lsl	x23, x21, #2
	ldr	w8, [x8, x23]
	ldr	w9, [x22]
	lsl	w2, w8, w9
	mov	x1, x20
	bl	_scif_unmap_single
	ldr	x9, [x19, #8]
	str	wzr, [x9, x23]
	ldr	w8, [x19]
	b	LBB0_4
LBB0_7:
	ldr	x8, [x19, #24]
	cbz	x8, LBB0_9
; %bb.8:
	ldr	x0, [x20]
	ldp	w2, w1, [x8]
Lloh2:
	adrp	x8, _DMA_BIDIRECTIONAL@GOTPAGE
Lloh3:
	ldr	x8, [x8, _DMA_BIDIRECTIONAL@GOTPAGEOFF]
Lloh4:
	ldr	w3, [x8]
	bl	_dma_unmap_sg
	ldr	x0, [x19, #24]
	bl	_sg_free_table
	ldr	x0, [x19, #24]
	bl	_kfree
	str	xzr, [x19, #24]
LBB0_9:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_DMA_BIDIRECTIONAL,4,2          ; @DMA_BIDIRECTIONAL
	.comm	_PAGE_SHIFT,4,2                 ; @PAGE_SHIFT
.subsections_via_symbols
