	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pamu_config_spaace             ## -- Begin function pamu_config_spaace
	.p2align	4, 0x90
_pamu_config_spaace:                    ## @pamu_config_spaace
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	testq	%rsi, %rsi
	je	LBB0_12
## %bb.1:
	movl	%ecx, %r13d
	movq	%rdx, %r14
	movq	%rsi, %r15
	movl	%edi, %ebx
	movq	%r9, -56(%rbp)                  ## 8-byte Spill
	movq	%r8, -48(%rbp)                  ## 8-byte Spill
	callq	_pamu_get_ppaace
	movq	%rax, %r12
	testq	%r14, %r14
	jle	LBB0_7
## %bb.2:
	cmpq	%r15, %r14
	jge	LBB0_7
## %bb.3:
	testq	%r12, %r12
	je	LBB0_7
## %bb.4:
	decq	%r14
	movq	%r12, %rdi
	movq	%r14, %rsi
	callq	_pamu_get_spaace
	testq	%rax, %rax
	je	LBB0_13
## %bb.5:
	movq	%rax, %r12
	movq	_PAACE_V_VALID@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	testq	%rax, (%r12)
	jne	LBB0_8
## %bb.6:
	movq	%r12, %rdi
	callq	_pamu_init_spaace
	movq	(%r12), %rdi
	movq	_SPAACE_AF_LIODN@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movslq	%ebx, %rdx
	callq	_set_bf
	jmp	LBB0_8
LBB0_7:
	testq	%r12, %r12
	je	LBB0_13
LBB0_8:
	leal	-1(%r13), %eax
	testl	%eax, %r13d
	jne	LBB0_14
## %bb.9:
	movq	_PAMU_PAGE_SIZE@GOTPCREL(%rip), %rax
	cmpl	%r13d, (%rax)
	jg	LBB0_14
## %bb.10:
	movq	_ULONG_MAX@GOTPCREL(%rip), %rax
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	cmpq	%rcx, (%rax)
	jne	LBB0_19
## %bb.11:
	leaq	L_.str.3(%rip), %rdi
	jmp	LBB0_15
LBB0_12:
	leaq	L_.str(%rip), %rdi
	jmp	LBB0_15
LBB0_13:
	leaq	L_.str.1(%rip), %rdi
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_pr_debug
	movq	_ENOENT@GOTPCREL(%rip), %rax
	jmp	LBB0_17
LBB0_14:
	leaq	L_.str.2(%rip), %rdi
LBB0_15:
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_pr_debug
LBB0_16:
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_17:
	subl	(%rax), %ebx
LBB0_18:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_19:
	movq	16(%rbp), %r15
	movq	8(%r12), %r14
	movq	_PAACE_WIN_SWSE@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movl	%r13d, %edi
	movq	%rcx, %r13
	callq	_map_addrspace_size_to_wse
	movq	%r14, %rdi
	movl	%ebx, %esi
	movq	%rax, %rdx
	callq	_set_bf
	movq	16(%r12), %rdi
	movq	_PAACE_IA_ATM@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_PAACE_ATM_WINDOW_XLATE@GOTPCREL(%rip), %rax
	movq	(%rax), %rdx
	callq	_set_bf
	movq	%r13, %rax
	shrq	$20, %rax
	movq	%rax, 24(%r12)
	movq	8(%r12), %rdi
	movq	_PAACE_WIN_TWBAL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r13, %rdx
	callq	_set_bf
	movq	(%r12), %rdi
	movq	_PAACE_AF_AP@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movslq	40(%rbp), %rdx
	callq	_set_bf
	cmpq	$-1, %r15
	je	LBB0_21
## %bb.20:
	movq	%r15, 40(%r12)
LBB0_21:
	movq	_OME_NUMBER_ENTRIES@GOTPCREL(%rip), %rax
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	cmpq	%rcx, (%rax)
	jle	LBB0_23
## %bb.22:
	movq	16(%r12), %rdi
	movq	_PAACE_IA_OTM@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_PAACE_OTM_INDEXED@GOTPCREL(%rip), %rax
	movq	(%rax), %rdx
	movq	%rcx, %rbx
	callq	_set_bf
	movq	%rbx, 32(%r12)
	jmp	LBB0_25
LBB0_23:
	cmpq	$-1, %rcx
	je	LBB0_25
## %bb.24:
	leaq	L_.str.4(%rip), %rdi
	xorl	%ebx, %ebx
	movq	%rcx, %rsi
	xorl	%eax, %eax
	callq	_pr_debug
	jmp	LBB0_16
LBB0_25:
	movl	32(%rbp), %r14d
	movq	24(%rbp), %rdx
	cmpq	$-1, %rdx
	je	LBB0_27
## %bb.26:
	movq	16(%r12), %rdi
	movq	_PAACE_IA_CID@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_set_bf
LBB0_27:
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_smp_wmb
	testl	%r14d, %r14d
	je	LBB0_29
## %bb.28:
	movq	(%r12), %rdi
	movq	_PAACE_AF_V@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_PAACE_V_VALID@GOTPCREL(%rip), %rax
	movq	(%rax), %rdx
	callq	_set_bf
LBB0_29:
	xorl	%eax, %eax
	callq	_mb
	jmp	LBB0_18
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Invalid subwindow count\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_PAACE_V_VALID,8,3              ## @PAACE_V_VALID
	.comm	_SPAACE_AF_LIODN,4,2            ## @SPAACE_AF_LIODN
L_.str.1:                               ## @.str.1
	.asciz	"Invalid liodn entry\n"

	.comm	_ENOENT,4,2                     ## @ENOENT
	.comm	_PAMU_PAGE_SIZE,4,2             ## @PAMU_PAGE_SIZE
L_.str.2:                               ## @.str.2
	.asciz	"subwindow size out of range, or not a power of 2\n"

	.comm	_ULONG_MAX,8,3                  ## @ULONG_MAX
L_.str.3:                               ## @.str.3
	.asciz	"real page number out of range\n"

	.comm	_PAACE_WIN_SWSE,4,2             ## @PAACE_WIN_SWSE
	.comm	_PAACE_IA_ATM,4,2               ## @PAACE_IA_ATM
	.comm	_PAACE_ATM_WINDOW_XLATE,8,3     ## @PAACE_ATM_WINDOW_XLATE
	.comm	_PAACE_WIN_TWBAL,4,2            ## @PAACE_WIN_TWBAL
	.comm	_PAACE_AF_AP,4,2                ## @PAACE_AF_AP
	.comm	_OME_NUMBER_ENTRIES,8,3         ## @OME_NUMBER_ENTRIES
	.comm	_PAACE_IA_OTM,4,2               ## @PAACE_IA_OTM
	.comm	_PAACE_OTM_INDEXED,8,3          ## @PAACE_OTM_INDEXED
L_.str.4:                               ## @.str.4
	.asciz	"bad operation mapping index: %d\n"

	.comm	_PAACE_IA_CID,4,2               ## @PAACE_IA_CID
	.comm	_PAACE_AF_V,4,2                 ## @PAACE_AF_V
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pamu_config_spaace             ; -- Begin function pamu_config_spaace
	.p2align	2
_pamu_config_spaace:                    ; @pamu_config_spaace
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	cbz	x1, LBB0_12
; %bb.1:
	mov	x19, x7
	mov	x22, x6
	mov	x23, x5
	mov	x21, x4
	mov	x24, x3
	mov	x26, x2
	mov	x27, x1
	mov	x25, x0
	bl	_pamu_get_ppaace
	mov	x20, x0
	subs	x1, x26, #1
	b.lt	LBB0_7
; %bb.2:
	cmp	x26, x27
	b.ge	LBB0_7
; %bb.3:
	cbz	x20, LBB0_7
; %bb.4:
	mov	x0, x20
	bl	_pamu_get_spaace
	cbz	x0, LBB0_13
; %bb.5:
	mov	x20, x0
	ldr	x8, [x0]
Lloh0:
	adrp	x9, _PAACE_V_VALID@GOTPAGE
Lloh1:
	ldr	x9, [x9, _PAACE_V_VALID@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	tst	x9, x8
	b.ne	LBB0_8
; %bb.6:
	mov	x0, x20
	bl	_pamu_init_spaace
	ldr	x0, [x20]
Lloh3:
	adrp	x8, _SPAACE_AF_LIODN@GOTPAGE
Lloh4:
	ldr	x8, [x8, _SPAACE_AF_LIODN@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	sxtw	x2, w25
	bl	_set_bf
	b	LBB0_8
LBB0_7:
	cbz	x20, LBB0_13
LBB0_8:
	sub	w8, w24, #1
	tst	w24, w8
	b.ne	LBB0_14
; %bb.9:
Lloh6:
	adrp	x8, _PAMU_PAGE_SIZE@GOTPAGE
Lloh7:
	ldr	x8, [x8, _PAMU_PAGE_SIZE@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	cmp	w8, w24
	b.gt	LBB0_14
; %bb.10:
Lloh9:
	adrp	x8, _ULONG_MAX@GOTPAGE
Lloh10:
	ldr	x8, [x8, _ULONG_MAX@GOTPAGEOFF]
Lloh11:
	ldr	x8, [x8]
	cmp	x8, x23
	b.ne	LBB0_18
; %bb.11:
Lloh12:
	adrp	x0, l_.str.3@PAGE
Lloh13:
	add	x0, x0, l_.str.3@PAGEOFF
	b	LBB0_15
LBB0_12:
Lloh14:
	adrp	x0, l_.str@PAGE
Lloh15:
	add	x0, x0, l_.str@PAGEOFF
	b	LBB0_15
LBB0_13:
Lloh16:
	adrp	x0, l_.str.1@PAGE
Lloh17:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_pr_debug
Lloh18:
	adrp	x8, _ENOENT@GOTPAGE
Lloh19:
	ldr	x8, [x8, _ENOENT@GOTPAGEOFF]
	b	LBB0_16
LBB0_14:
Lloh20:
	adrp	x0, l_.str.2@PAGE
Lloh21:
	add	x0, x0, l_.str.2@PAGEOFF
LBB0_15:
	bl	_pr_debug
Lloh22:
	adrp	x8, _EINVAL@GOTPAGE
Lloh23:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_16:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_17:
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_18:
	ldr	w27, [x29, #20]
	ldr	x25, [x20, #8]
Lloh24:
	adrp	x8, _PAACE_WIN_SWSE@GOTPAGE
Lloh25:
	ldr	x8, [x8, _PAACE_WIN_SWSE@GOTPAGEOFF]
Lloh26:
	ldr	w26, [x8]
	mov	x0, x24
	bl	_map_addrspace_size_to_wse
	mov	x2, x0
	mov	x0, x25
	mov	x1, x26
	bl	_set_bf
	ldr	x0, [x20, #16]
Lloh27:
	adrp	x8, _PAACE_IA_ATM@GOTPAGE
Lloh28:
	ldr	x8, [x8, _PAACE_IA_ATM@GOTPAGEOFF]
Lloh29:
	ldr	w1, [x8]
Lloh30:
	adrp	x8, _PAACE_ATM_WINDOW_XLATE@GOTPAGE
Lloh31:
	ldr	x8, [x8, _PAACE_ATM_WINDOW_XLATE@GOTPAGEOFF]
Lloh32:
	ldr	x2, [x8]
	bl	_set_bf
	lsr	x8, x23, #20
	str	x8, [x20, #24]
	ldr	x0, [x20, #8]
Lloh33:
	adrp	x8, _PAACE_WIN_TWBAL@GOTPAGE
Lloh34:
	ldr	x8, [x8, _PAACE_WIN_TWBAL@GOTPAGEOFF]
Lloh35:
	ldr	w1, [x8]
	mov	x2, x23
	bl	_set_bf
	ldr	x0, [x20]
Lloh36:
	adrp	x8, _PAACE_AF_AP@GOTPAGE
Lloh37:
	ldr	x8, [x8, _PAACE_AF_AP@GOTPAGEOFF]
Lloh38:
	ldr	w1, [x8]
	sxtw	x2, w27
	bl	_set_bf
	cmn	x22, #1
	b.eq	LBB0_20
; %bb.19:
	str	x22, [x20, #40]
LBB0_20:
Lloh39:
	adrp	x8, _OME_NUMBER_ENTRIES@GOTPAGE
Lloh40:
	ldr	x8, [x8, _OME_NUMBER_ENTRIES@GOTPAGEOFF]
Lloh41:
	ldr	x8, [x8]
	cmp	x8, x21
	b.le	LBB0_22
; %bb.21:
	ldr	x0, [x20, #16]
Lloh42:
	adrp	x8, _PAACE_IA_OTM@GOTPAGE
Lloh43:
	ldr	x8, [x8, _PAACE_IA_OTM@GOTPAGEOFF]
Lloh44:
	ldr	w1, [x8]
Lloh45:
	adrp	x8, _PAACE_OTM_INDEXED@GOTPAGE
Lloh46:
	ldr	x8, [x8, _PAACE_OTM_INDEXED@GOTPAGEOFF]
Lloh47:
	ldr	x2, [x8]
	bl	_set_bf
	str	x21, [x20, #32]
	b	LBB0_24
LBB0_22:
	cmn	x21, #1
	b.eq	LBB0_24
; %bb.23:
	str	x21, [sp]
Lloh48:
	adrp	x0, l_.str.4@PAGE
Lloh49:
	add	x0, x0, l_.str.4@PAGEOFF
	b	LBB0_15
LBB0_24:
	ldr	w21, [x29, #16]
	cmn	x19, #1
	b.eq	LBB0_26
; %bb.25:
	ldr	x0, [x20, #16]
Lloh50:
	adrp	x8, _PAACE_IA_CID@GOTPAGE
Lloh51:
	ldr	x8, [x8, _PAACE_IA_CID@GOTPAGEOFF]
Lloh52:
	ldr	w1, [x8]
	mov	x2, x19
	bl	_set_bf
LBB0_26:
	bl	_smp_wmb
	cbz	w21, LBB0_28
; %bb.27:
	ldr	x0, [x20]
Lloh53:
	adrp	x8, _PAACE_AF_V@GOTPAGE
Lloh54:
	ldr	x8, [x8, _PAACE_AF_V@GOTPAGEOFF]
Lloh55:
	ldr	w1, [x8]
Lloh56:
	adrp	x8, _PAACE_V_VALID@GOTPAGE
Lloh57:
	ldr	x8, [x8, _PAACE_V_VALID@GOTPAGEOFF]
Lloh58:
	ldr	x2, [x8]
	bl	_set_bf
LBB0_28:
	bl	_mb
	mov	w0, #0
	b	LBB0_17
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh38
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh39, Lloh40, Lloh41
	.loh AdrpLdrGotLdr	Lloh45, Lloh46, Lloh47
	.loh AdrpLdrGotLdr	Lloh42, Lloh43, Lloh44
	.loh AdrpAdd	Lloh48, Lloh49
	.loh AdrpLdrGotLdr	Lloh50, Lloh51, Lloh52
	.loh AdrpLdrGotLdr	Lloh56, Lloh57, Lloh58
	.loh AdrpLdrGotLdr	Lloh53, Lloh54, Lloh55
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Invalid subwindow count\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_PAACE_V_VALID,8,3              ; @PAACE_V_VALID
	.comm	_SPAACE_AF_LIODN,4,2            ; @SPAACE_AF_LIODN
l_.str.1:                               ; @.str.1
	.asciz	"Invalid liodn entry\n"

	.comm	_ENOENT,4,2                     ; @ENOENT
	.comm	_PAMU_PAGE_SIZE,4,2             ; @PAMU_PAGE_SIZE
l_.str.2:                               ; @.str.2
	.asciz	"subwindow size out of range, or not a power of 2\n"

	.comm	_ULONG_MAX,8,3                  ; @ULONG_MAX
l_.str.3:                               ; @.str.3
	.asciz	"real page number out of range\n"

	.comm	_PAACE_WIN_SWSE,4,2             ; @PAACE_WIN_SWSE
	.comm	_PAACE_IA_ATM,4,2               ; @PAACE_IA_ATM
	.comm	_PAACE_ATM_WINDOW_XLATE,8,3     ; @PAACE_ATM_WINDOW_XLATE
	.comm	_PAACE_WIN_TWBAL,4,2            ; @PAACE_WIN_TWBAL
	.comm	_PAACE_AF_AP,4,2                ; @PAACE_AF_AP
	.comm	_OME_NUMBER_ENTRIES,8,3         ; @OME_NUMBER_ENTRIES
	.comm	_PAACE_IA_OTM,4,2               ; @PAACE_IA_OTM
	.comm	_PAACE_OTM_INDEXED,8,3          ; @PAACE_OTM_INDEXED
l_.str.4:                               ; @.str.4
	.asciz	"bad operation mapping index: %d\n"

	.comm	_PAACE_IA_CID,4,2               ; @PAACE_IA_CID
	.comm	_PAACE_AF_V,4,2                 ; @PAACE_AF_V
.subsections_via_symbols
