	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_scif_map_window                ## -- Begin function scif_map_window
	.p2align	4, 0x90
_scif_map_window:                       ## @scif_map_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	%r13
	pushq	%r12
	pushq	%rbx
	subq	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r15
	movq	%rdi, %r14
	xorl	%r12d, %r12d
	xorl	%eax, %eax
	callq	_might_sleep
	movq	32(%r15), %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movq	_intel_iommu_enabled@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_2
## %bb.1:
	movq	%r14, %rdi
	callq	_scifdev_self
	testl	%eax, %eax
	je	LBB0_15
LBB0_2:
	cmpl	$0, (%r15)
	jle	LBB0_14
## %bb.3:
	movq	%r14, -72(%rbp)                 ## 8-byte Spill
	xorl	%ebx, %ebx
	xorl	%r13d, %r13d
	jmp	LBB0_4
	.p2align	4, 0x90
LBB0_11:                                ##   in Loop: Header=BB0_4 Depth=1
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rax
	movq	-64(%rbp), %r13                 ## 8-byte Reload
	movl	(%rax,%r13,4), %edi
	callq	_page_to_phys
	movq	16(%r15), %rcx
	movq	%rax, (%rcx,%rbx,8)
LBB0_12:                                ##   in Loop: Header=BB0_4 Depth=1
	addl	%r13d, %r14d
	incq	%rbx
	movl	%r14d, %r13d
	cmpl	(%r15), %r14d
	jge	LBB0_13
LBB0_4:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_6 Depth 2
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rax
	movl	%r13d, %ecx
	movq	%rcx, -64(%rbp)                 ## 8-byte Spill
	movl	(%rax,%rcx,4), %edi
	callq	_page_to_phys
	incl	%r13d
	movl	$1, %r14d
	cmpl	(%r15), %r13d
	jge	LBB0_8
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	%rax, %r12
	movl	%r13d, %ebx
	movl	$1, %r14d
	.p2align	4, 0x90
LBB0_6:                                 ##   Parent Loop BB0_4 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rax
	movl	(%rax,%rbx,4), %edi
	callq	_page_to_phys
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rcx
	addq	(%rcx), %r12
	cmpq	%rax, %r12
	jne	LBB0_8
## %bb.7:                               ##   in Loop: Header=BB0_6 Depth=2
	incl	%r14d
	incq	%rbx
	movq	%rax, %r12
	cmpl	%ebx, (%r15)
	jg	LBB0_6
LBB0_8:                                 ##   in Loop: Header=BB0_4 Depth=1
	movq	8(%r15), %rax
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	movl	%r14d, (%rax,%rbx,4)
	incl	24(%r15)
	xorl	%eax, %eax
	callq	_scif_is_mgmt_node
	testq	%rax, %rax
	je	LBB0_11
## %bb.9:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	leaq	(,%rax,8), %r12
	addq	16(%r15), %r12
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rax
	movq	-64(%rbp), %r13                 ## 8-byte Reload
	movl	(%rax,%r13,4), %edi
	callq	_page_to_phys
	movq	%rax, %rdi
	callq	_phys_to_virt
	movq	_PAGE_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	movl	%r14d, %r8d
	shll	%cl, %r8d
	movq	%r12, %rdi
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	movl	%eax, %esi
	movq	-72(%rbp), %rdx                 ## 8-byte Reload
	movl	%r8d, %ecx
	callq	_scif_map_single
	testl	%eax, %eax
	je	LBB0_12
## %bb.10:
	movl	%eax, %r12d
	jmp	LBB0_14
LBB0_13:
	xorl	%r12d, %r12d
LBB0_14:
	movl	%r12d, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_15:
	movq	%r14, %rdi
	movq	%r15, %rsi
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_scif_iommu_map                 ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_intel_iommu_enabled,8,3        ## @intel_iommu_enabled
	.comm	_PAGE_SIZE,8,3                  ## @PAGE_SIZE
	.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_map_window                ; -- Begin function scif_map_window
	.p2align	2
_scif_map_window:                       ; @scif_map_window
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x19, x1
	mov	x20, x0
	bl	_might_sleep
	ldr	x22, [x19, #32]
Lloh0:
	adrp	x8, _intel_iommu_enabled@GOTPAGE
Lloh1:
	ldr	x8, [x8, _intel_iommu_enabled@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cbz	x8, LBB0_2
; %bb.1:
	mov	x0, x20
	bl	_scifdev_self
	cbz	w0, LBB0_15
LBB0_2:
	ldr	w8, [x19]
	cmp	w8, #1
	b.lt	LBB0_13
; %bb.3:
	mov	x23, #0
	mov	w27, #0
Lloh3:
	adrp	x24, _PAGE_SIZE@GOTPAGE
Lloh4:
	ldr	x24, [x24, _PAGE_SIZE@GOTPAGEOFF]
Lloh5:
	adrp	x25, _PAGE_SHIFT@GOTPAGE
Lloh6:
	ldr	x25, [x25, _PAGE_SHIFT@GOTPAGEOFF]
	b	LBB0_6
LBB0_4:                                 ;   in Loop: Header=BB0_6 Depth=1
	ldr	x8, [x22]
	ldr	w0, [x8, x27, lsl #2]
	bl	_page_to_phys
	ldr	x8, [x19, #16]
	str	x0, [x8, x23, lsl #3]
LBB0_5:                                 ;   in Loop: Header=BB0_6 Depth=1
	add	x23, x23, #1
	ldr	w8, [x19]
	add	w27, w26, w27
	cmp	w27, w8
	b.ge	LBB0_13
LBB0_6:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_8 Depth 2
	ldr	x8, [x22]
	ldr	w0, [x8, w27, uxtw #2]
	bl	_page_to_phys
	add	w28, w27, #1
	ldr	w8, [x19]
	cmp	w28, w8
	b.ge	LBB0_10
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	mov	x21, x0
	mov	w26, #1
LBB0_8:                                 ;   Parent Loop BB0_6 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	x8, [x22]
	ldr	w0, [x8, x28, lsl #2]
	bl	_page_to_phys
	ldr	x8, [x24]
	add	x8, x8, x21
	cmp	x8, x0
	b.ne	LBB0_11
; %bb.9:                                ;   in Loop: Header=BB0_8 Depth=2
	add	w26, w26, #1
	add	x28, x28, #1
	ldr	w8, [x19]
	mov	x21, x0
	cmp	w8, w28
	b.gt	LBB0_8
	b	LBB0_11
LBB0_10:                                ;   in Loop: Header=BB0_6 Depth=1
	mov	w26, #1
LBB0_11:                                ;   in Loop: Header=BB0_6 Depth=1
	mov	w27, w27
	ldr	x8, [x19, #8]
	str	w26, [x8, x23, lsl #2]
	ldr	w8, [x19, #24]
	add	w8, w8, #1
	str	w8, [x19, #24]
	bl	_scif_is_mgmt_node
	cbz	x0, LBB0_4
; %bb.12:                               ;   in Loop: Header=BB0_6 Depth=1
	ldr	x8, [x19, #16]
	add	x21, x8, x23, lsl #3
	ldr	x8, [x22]
	ldr	w0, [x8, x27, lsl #2]
	bl	_page_to_phys
	bl	_phys_to_virt
	mov	x1, x0
	ldr	w8, [x25]
	lsl	w3, w26, w8
	mov	x0, x21
	mov	x2, x20
	bl	_scif_map_single
	cbz	w0, LBB0_5
	b	LBB0_14
LBB0_13:
	mov	w0, #0
LBB0_14:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
LBB0_15:
	mov	x0, x20
	mov	x1, x19
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	b	_scif_iommu_map
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_intel_iommu_enabled,8,3        ; @intel_iommu_enabled
	.comm	_PAGE_SIZE,8,3                  ; @PAGE_SIZE
	.comm	_PAGE_SHIFT,4,2                 ; @PAGE_SHIFT
.subsections_via_symbols
