	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_scif_get_window_offset         ## -- Begin function scif_get_window_offset
	.p2align	4, 0x90
_scif_get_window_offset:                ## @scif_get_window_offset
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%r8, %r14
	movl	%ecx, %r15d
	movq	%rdi, %rbx
	movq	_SCIF_MAP_FIXED@GOTPCREL(%rip), %rax
	testl	%esi, (%rax)
	je	LBB0_3
## %bb.1:
	movl	%edx, %edi
	callq	_SCIF_IOVA_PFN
                                        ## kill: def $eax killed $eax def $rax
	leal	(%r15,%rax), %edx
	decl	%edx
	movq	%rbx, %rdi
	movl	%eax, %esi
	callq	_reserve_iova
	testq	%rax, %rax
	jne	LBB0_6
## %bb.2:
	movq	_EADDRINUSE@GOTPCREL(%rip), %rcx
	jmp	LBB0_5
LBB0_3:
	movq	_SCIF_DMA_63BIT_PFN@GOTPCREL(%rip), %rax
	movq	(%rax), %rdx
	decq	%rdx
	movq	%rbx, %rdi
	movl	%r15d, %esi
	xorl	%ecx, %ecx
	callq	_alloc_iova
	testq	%rax, %rax
	je	LBB0_4
LBB0_6:
	movl	(%rax), %eax
	movq	_PAGE_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	shll	%cl, %eax
	movl	%eax, (%r14)
	xorl	%eax, %eax
	jmp	LBB0_7
LBB0_4:
	movq	_ENOMEM@GOTPCREL(%rip), %rcx
LBB0_5:
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_7:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SCIF_MAP_FIXED,4,2             ## @SCIF_MAP_FIXED
	.comm	_EADDRINUSE,4,2                 ## @EADDRINUSE
	.comm	_SCIF_DMA_63BIT_PFN,8,3         ## @SCIF_DMA_63BIT_PFN
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.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_get_window_offset         ; -- Begin function scif_get_window_offset
	.p2align	2
_scif_get_window_offset:                ; @scif_get_window_offset
	.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, x4
	mov	x20, x3
	mov	x21, x0
Lloh0:
	adrp	x8, _SCIF_MAP_FIXED@GOTPAGE
Lloh1:
	ldr	x8, [x8, _SCIF_MAP_FIXED@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	tst	w8, w1
	b.eq	LBB0_3
; %bb.1:
	mov	x0, x2
	bl	_SCIF_IOVA_PFN
	mov	x1, x0
	add	w8, w20, w0
	sub	w2, w8, #1
	mov	x0, x21
	bl	_reserve_iova
	mov	x8, x0
	cbnz	x0, LBB0_4
; %bb.2:
Lloh3:
	adrp	x8, _EADDRINUSE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EADDRINUSE@GOTPAGEOFF]
	b	LBB0_6
LBB0_3:
Lloh5:
	adrp	x8, _SCIF_DMA_63BIT_PFN@GOTPAGE
Lloh6:
	ldr	x8, [x8, _SCIF_DMA_63BIT_PFN@GOTPAGEOFF]
Lloh7:
	ldr	x8, [x8]
	sub	x2, x8, #1
	mov	x0, x21
	mov	x1, x20
	mov	w3, #0
	bl	_alloc_iova
	mov	x8, x0
	cbz	x0, LBB0_5
LBB0_4:
	mov	w0, #0
	ldr	w8, [x8]
Lloh8:
	adrp	x9, _PAGE_SHIFT@GOTPAGE
Lloh9:
	ldr	x9, [x9, _PAGE_SHIFT@GOTPAGEOFF]
Lloh10:
	ldr	w9, [x9]
	lsl	w8, w8, w9
	str	w8, [x19]
	b	LBB0_7
LBB0_5:
Lloh11:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh12:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
LBB0_6:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_7:
	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	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_SCIF_MAP_FIXED,4,2             ; @SCIF_MAP_FIXED
	.comm	_EADDRINUSE,4,2                 ; @EADDRINUSE
	.comm	_SCIF_DMA_63BIT_PFN,8,3         ; @SCIF_DMA_63BIT_PFN
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_PAGE_SHIFT,4,2                 ; @PAGE_SHIFT
.subsections_via_symbols
