	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pamu_config_ppaace             ## -- Begin function pamu_config_ppaace
	.p2align	4, 0x90
_pamu_config_ppaace:                    ## @pamu_config_ppaace
	.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
	movl	%edx, %r14d
	movl	%edx, -48(%rbp)
	leal	-1(%r14), %eax
	testl	%eax, %edx
	jne	LBB0_5
## %bb.1:
	movl	%ecx, %r13d
	movq	_PAMU_PAGE_SIZE@GOTPCREL(%rip), %rcx
	cmpl	%r14d, (%rcx)
	jg	LBB0_5
## %bb.2:
	movl	%esi, %ebx
	testl	%esi, %eax
	je	LBB0_9
## %bb.3:
	leaq	L_.str.1(%rip), %rdi
LBB0_4:
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_pr_debug
	jmp	LBB0_6
LBB0_5:
	leaq	L_.str(%rip), %rdi
	xorl	%ebx, %ebx
	leaq	-48(%rbp), %rsi
	xorl	%eax, %eax
	callq	_pr_debug
LBB0_6:
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_7:
	subl	(%rax), %ebx
LBB0_8:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_9:
	movl	%r9d, %r12d
	movq	%r8, %r15
	callq	_pamu_get_ppaace
	testq	%rax, %rax
	je	LBB0_12
## %bb.10:
	movq	%r15, -56(%rbp)                 ## 8-byte Spill
	movl	24(%rax), %ecx
	movl	%ecx, -44(%rbp)                 ## 4-byte Spill
	movq	_PPAACE_AF_WSE@GOTPCREL(%rip), %rcx
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	movl	(%rcx), %r15d
	movl	%r14d, %edi
	callq	_map_addrspace_size_to_wse
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	movl	%r15d, %esi
	movq	-64(%rbp), %r15                 ## 8-byte Reload
	movl	%eax, %edx
	callq	_set_bf
	movq	%r15, %rdi
	callq	_pamu_init_ppaace
	movq	_PAMU_PAGE_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	addb	$20, %cl
	movl	%ebx, %edx
	sarl	%cl, %edx
	movl	%edx, (%r15)
	movl	24(%r15), %edi
	movq	_PPAACE_AF_WBAL@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movb	(%rax), %cl
	sarl	%cl, %ebx
	movl	%ebx, %edx
	callq	_set_bf
	movq	_OME_NUMBER_ENTRIES@GOTPCREL(%rip), %rax
	cmpl	%r13d, (%rax)
	jle	LBB0_13
## %bb.11:
	movl	28(%r15), %edi
	movq	_PAACE_IA_OTM@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_PAACE_OTM_INDEXED@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_set_bf
	movl	%r13d, 40(%r15)
	jmp	LBB0_15
LBB0_12:
	movq	_ENOENT@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	jmp	LBB0_7
LBB0_13:
	cmpl	$-1, %r13d
	je	LBB0_15
## %bb.14:
	leaq	L_.str.2(%rip), %rdi
	xorl	%ebx, %ebx
	movl	%r13d, %esi
	xorl	%eax, %eax
	callq	_pr_debug
	jmp	LBB0_6
LBB0_15:
	movl	16(%rbp), %edx
	cmpl	$-1, %edx
	je	LBB0_17
## %bb.16:
	movl	28(%r15), %edi
	movq	_PAACE_IA_CID@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_set_bf
LBB0_17:
	movl	24(%rbp), %ebx
	cmpl	$-1, %r12d
	je	LBB0_19
## %bb.18:
	movl	%r12d, 36(%r15)
LBB0_19:
	testl	%ebx, %ebx
	je	LBB0_22
## %bb.20:
	leal	-1(%rbx), %edi
	callq	_pamu_get_fspi_and_allocate
	movq	%rax, %r14
	movq	_ULONG_MAX@GOTPCREL(%rip), %rax
	cmpq	(%rax), %r14
	jne	LBB0_23
## %bb.21:
	leaq	L_.str.3(%rip), %rdi
	jmp	LBB0_4
LBB0_22:
	movl	32(%rbp), %ebx
	movl	28(%r15), %edi
	movq	_PAACE_IA_ATM@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_PAACE_ATM_WINDOW_XLATE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_set_bf
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
	movq	%rdx, %rax
	shrq	$20, %rax
	movq	%rax, 16(%r15)
	movl	32(%r15), %edi
	movq	_PAACE_WIN_TWBAL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
                                        ## kill: def $edx killed $edx killed $rdx
	callq	_set_bf
	movl	24(%r15), %edi
	movq	_PAACE_AF_AP@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%ebx, %edx
	callq	_set_bf
	movl	28(%r15), %edi
	movq	_PAACE_IA_WCE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%edx, %edx
	callq	_set_bf
	movl	24(%r15), %edi
	movq	_PPAACE_AF_MW@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%edx, %edx
	callq	_set_bf
	jmp	LBB0_24
LBB0_23:
	movq	%r15, %r13
	movl	28(%r15), %r15d
	movq	_PAACE_IA_WCE@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	movl	%ebx, %edi
	callq	_map_subwindow_cnt_to_wce
	movl	%r15d, %edi
	movl	%r12d, %esi
	movl	%eax, %edx
	callq	_set_bf
	movl	24(%r13), %edi
	movq	_PPAACE_AF_MW@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$1, %edx
	callq	_set_bf
	movq	%r14, 8(%r13)
LBB0_24:
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_mb
	jmp	LBB0_8
	.cfi_endproc
                                        ## -- End function
	.comm	_PAMU_PAGE_SIZE,4,2             ## @PAMU_PAGE_SIZE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"window size too small or not a power of two %pa\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
L_.str.1:                               ## @.str.1
	.asciz	"window address is not aligned with window size\n"

	.comm	_ENOENT,4,2                     ## @ENOENT
	.comm	_PPAACE_AF_WSE,4,2              ## @PPAACE_AF_WSE
	.comm	_PAMU_PAGE_SHIFT,4,2            ## @PAMU_PAGE_SHIFT
	.comm	_PPAACE_AF_WBAL,4,2             ## @PPAACE_AF_WBAL
	.comm	_OME_NUMBER_ENTRIES,4,2         ## @OME_NUMBER_ENTRIES
	.comm	_PAACE_IA_OTM,4,2               ## @PAACE_IA_OTM
	.comm	_PAACE_OTM_INDEXED,4,2          ## @PAACE_OTM_INDEXED
L_.str.2:                               ## @.str.2
	.asciz	"bad operation mapping index: %d\n"

	.comm	_PAACE_IA_CID,4,2               ## @PAACE_IA_CID
	.comm	_ULONG_MAX,8,3                  ## @ULONG_MAX
L_.str.3:                               ## @.str.3
	.asciz	"spaace indexes exhausted\n"

	.comm	_PAACE_IA_WCE,4,2               ## @PAACE_IA_WCE
	.comm	_PPAACE_AF_MW,4,2               ## @PPAACE_AF_MW
	.comm	_PAACE_IA_ATM,4,2               ## @PAACE_IA_ATM
	.comm	_PAACE_ATM_WINDOW_XLATE,4,2     ## @PAACE_ATM_WINDOW_XLATE
	.comm	_PAACE_WIN_TWBAL,4,2            ## @PAACE_WIN_TWBAL
	.comm	_PAACE_AF_AP,4,2                ## @PAACE_AF_AP
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pamu_config_ppaace             ; -- Begin function pamu_config_ppaace
	.p2align	2
_pamu_config_ppaace:                    ; @pamu_config_ppaace
	.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
Lloh0:
	adrp	x8, _PAMU_PAGE_SIZE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PAMU_PAGE_SIZE@GOTPAGEOFF]
	str	w2, [sp, #12]
Lloh2:
	ldr	w9, [x8]
	sub	w8, w2, #1
	and	w10, w2, w8
	cmp	w10, #0
	ccmp	w9, w2, #0, eq
	b.le	LBB0_2
; %bb.1:
	add	x8, sp, #12
	str	x8, [sp]
Lloh3:
	adrp	x0, l_.str@PAGE
Lloh4:
	add	x0, x0, l_.str@PAGEOFF
	b	LBB0_4
LBB0_2:
	mov	x25, x1
	tst	w8, w1
	b.eq	LBB0_7
; %bb.3:
Lloh5:
	adrp	x0, l_.str.1@PAGE
Lloh6:
	add	x0, x0, l_.str.1@PAGEOFF
LBB0_4:
	bl	_pr_debug
Lloh7:
	adrp	x8, _EINVAL@GOTPAGE
Lloh8:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_5:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_6:
	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_7:
	mov	x21, x7
	mov	x23, x6
	mov	x22, x5
	mov	x20, x4
	mov	x24, x3
	mov	x26, x2
	bl	_pamu_get_ppaace
	cbz	x0, LBB0_10
; %bb.8:
	mov	x19, x0
	ldr	w27, [x0, #24]
Lloh9:
	adrp	x8, _PPAACE_AF_WSE@GOTPAGE
Lloh10:
	ldr	x8, [x8, _PPAACE_AF_WSE@GOTPAGEOFF]
Lloh11:
	ldr	w28, [x8]
	mov	x0, x26
	bl	_map_addrspace_size_to_wse
	mov	x2, x0
	mov	x0, x27
	mov	x1, x28
	bl	_set_bf
	mov	x0, x19
	bl	_pamu_init_ppaace
Lloh12:
	adrp	x8, _PAMU_PAGE_SHIFT@GOTPAGE
Lloh13:
	ldr	x8, [x8, _PAMU_PAGE_SHIFT@GOTPAGEOFF]
	ldr	w9, [x8]
	add	w9, w9, #20
	asr	w9, w25, w9
	str	w9, [x19]
	ldr	w0, [x19, #24]
Lloh14:
	adrp	x9, _PPAACE_AF_WBAL@GOTPAGE
Lloh15:
	ldr	x9, [x9, _PPAACE_AF_WBAL@GOTPAGEOFF]
Lloh16:
	ldr	w1, [x9]
	ldr	w8, [x8]
	asr	w2, w25, w8
	bl	_set_bf
Lloh17:
	adrp	x8, _OME_NUMBER_ENTRIES@GOTPAGE
Lloh18:
	ldr	x8, [x8, _OME_NUMBER_ENTRIES@GOTPAGEOFF]
Lloh19:
	ldr	w8, [x8]
	cmp	w8, w24
	b.le	LBB0_11
; %bb.9:
	ldr	w0, [x19, #28]
Lloh20:
	adrp	x8, _PAACE_IA_OTM@GOTPAGE
Lloh21:
	ldr	x8, [x8, _PAACE_IA_OTM@GOTPAGEOFF]
Lloh22:
	ldr	w1, [x8]
Lloh23:
	adrp	x8, _PAACE_OTM_INDEXED@GOTPAGE
Lloh24:
	ldr	x8, [x8, _PAACE_OTM_INDEXED@GOTPAGEOFF]
Lloh25:
	ldr	w2, [x8]
	bl	_set_bf
	str	w24, [x19, #40]
	b	LBB0_13
LBB0_10:
Lloh26:
	adrp	x8, _ENOENT@GOTPAGE
Lloh27:
	ldr	x8, [x8, _ENOENT@GOTPAGEOFF]
	b	LBB0_5
LBB0_11:
	cmn	w24, #1
	b.eq	LBB0_13
; %bb.12:
	str	x24, [sp]
Lloh28:
	adrp	x0, l_.str.2@PAGE
Lloh29:
	add	x0, x0, l_.str.2@PAGEOFF
	b	LBB0_4
LBB0_13:
	cmn	w23, #1
	b.eq	LBB0_15
; %bb.14:
	ldr	w0, [x19, #28]
Lloh30:
	adrp	x8, _PAACE_IA_CID@GOTPAGE
Lloh31:
	ldr	x8, [x8, _PAACE_IA_CID@GOTPAGEOFF]
Lloh32:
	ldr	w1, [x8]
	mov	x2, x23
	bl	_set_bf
LBB0_15:
	cmn	w22, #1
	b.eq	LBB0_17
; %bb.16:
	str	w22, [x19, #36]
LBB0_17:
	cbz	w21, LBB0_20
; %bb.18:
	sub	w0, w21, #1
	bl	_pamu_get_fspi_and_allocate
Lloh33:
	adrp	x8, _ULONG_MAX@GOTPAGE
Lloh34:
	ldr	x8, [x8, _ULONG_MAX@GOTPAGEOFF]
Lloh35:
	ldr	x8, [x8]
	cmp	x0, x8
	b.ne	LBB0_21
; %bb.19:
Lloh36:
	adrp	x0, l_.str.3@PAGE
Lloh37:
	add	x0, x0, l_.str.3@PAGEOFF
	b	LBB0_4
LBB0_20:
	ldr	w21, [x29, #16]
	ldr	w0, [x19, #28]
Lloh38:
	adrp	x8, _PAACE_IA_ATM@GOTPAGE
Lloh39:
	ldr	x8, [x8, _PAACE_IA_ATM@GOTPAGEOFF]
Lloh40:
	ldr	w1, [x8]
Lloh41:
	adrp	x8, _PAACE_ATM_WINDOW_XLATE@GOTPAGE
Lloh42:
	ldr	x8, [x8, _PAACE_ATM_WINDOW_XLATE@GOTPAGEOFF]
Lloh43:
	ldr	w2, [x8]
	bl	_set_bf
	lsr	x8, x20, #20
	str	x8, [x19, #16]
	ldr	w0, [x19, #32]
Lloh44:
	adrp	x8, _PAACE_WIN_TWBAL@GOTPAGE
Lloh45:
	ldr	x8, [x8, _PAACE_WIN_TWBAL@GOTPAGEOFF]
Lloh46:
	ldr	w1, [x8]
	mov	x2, x20
	bl	_set_bf
	ldr	w0, [x19, #24]
Lloh47:
	adrp	x8, _PAACE_AF_AP@GOTPAGE
Lloh48:
	ldr	x8, [x8, _PAACE_AF_AP@GOTPAGEOFF]
Lloh49:
	ldr	w1, [x8]
	mov	x2, x21
	bl	_set_bf
	ldr	w0, [x19, #28]
Lloh50:
	adrp	x8, _PAACE_IA_WCE@GOTPAGE
Lloh51:
	ldr	x8, [x8, _PAACE_IA_WCE@GOTPAGEOFF]
Lloh52:
	ldr	w1, [x8]
	mov	w2, #0
	bl	_set_bf
	ldr	w0, [x19, #24]
Lloh53:
	adrp	x8, _PPAACE_AF_MW@GOTPAGE
Lloh54:
	ldr	x8, [x8, _PPAACE_AF_MW@GOTPAGEOFF]
Lloh55:
	ldr	w1, [x8]
	mov	w2, #0
	bl	_set_bf
	b	LBB0_22
LBB0_21:
	mov	x20, x0
	ldr	w22, [x19, #28]
Lloh56:
	adrp	x8, _PAACE_IA_WCE@GOTPAGE
Lloh57:
	ldr	x8, [x8, _PAACE_IA_WCE@GOTPAGEOFF]
Lloh58:
	ldr	w23, [x8]
	mov	x0, x21
	bl	_map_subwindow_cnt_to_wce
	mov	x2, x0
	mov	x0, x22
	mov	x1, x23
	bl	_set_bf
	ldr	w0, [x19, #24]
Lloh59:
	adrp	x8, _PPAACE_AF_MW@GOTPAGE
Lloh60:
	ldr	x8, [x8, _PPAACE_AF_MW@GOTPAGEOFF]
Lloh61:
	ldr	w1, [x8]
	mov	w2, #1
	bl	_set_bf
	str	x20, [x19, #8]
LBB0_22:
	bl	_mb
	mov	w0, #0
	b	LBB0_6
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGot	Lloh26, Lloh27
	.loh AdrpAdd	Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpAdd	Lloh36, Lloh37
	.loh AdrpLdrGotLdr	Lloh53, Lloh54, Lloh55
	.loh AdrpLdrGotLdr	Lloh50, Lloh51, Lloh52
	.loh AdrpLdrGotLdr	Lloh47, Lloh48, Lloh49
	.loh AdrpLdrGotLdr	Lloh44, Lloh45, Lloh46
	.loh AdrpLdrGotLdr	Lloh41, Lloh42, Lloh43
	.loh AdrpLdrGotLdr	Lloh38, Lloh39, Lloh40
	.loh AdrpLdrGotLdr	Lloh59, Lloh60, Lloh61
	.loh AdrpLdrGotLdr	Lloh56, Lloh57, Lloh58
	.cfi_endproc
                                        ; -- End function
	.comm	_PAMU_PAGE_SIZE,4,2             ; @PAMU_PAGE_SIZE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"window size too small or not a power of two %pa\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
l_.str.1:                               ; @.str.1
	.asciz	"window address is not aligned with window size\n"

	.comm	_ENOENT,4,2                     ; @ENOENT
	.comm	_PPAACE_AF_WSE,4,2              ; @PPAACE_AF_WSE
	.comm	_PAMU_PAGE_SHIFT,4,2            ; @PAMU_PAGE_SHIFT
	.comm	_PPAACE_AF_WBAL,4,2             ; @PPAACE_AF_WBAL
	.comm	_OME_NUMBER_ENTRIES,4,2         ; @OME_NUMBER_ENTRIES
	.comm	_PAACE_IA_OTM,4,2               ; @PAACE_IA_OTM
	.comm	_PAACE_OTM_INDEXED,4,2          ; @PAACE_OTM_INDEXED
l_.str.2:                               ; @.str.2
	.asciz	"bad operation mapping index: %d\n"

	.comm	_PAACE_IA_CID,4,2               ; @PAACE_IA_CID
	.comm	_ULONG_MAX,8,3                  ; @ULONG_MAX
l_.str.3:                               ; @.str.3
	.asciz	"spaace indexes exhausted\n"

	.comm	_PAACE_IA_WCE,4,2               ; @PAACE_IA_WCE
	.comm	_PPAACE_AF_MW,4,2               ; @PPAACE_AF_MW
	.comm	_PAACE_IA_ATM,4,2               ; @PAACE_IA_ATM
	.comm	_PAACE_ATM_WINDOW_XLATE,4,2     ; @PAACE_ATM_WINDOW_XLATE
	.comm	_PAACE_WIN_TWBAL,4,2            ; @PAACE_WIN_TWBAL
	.comm	_PAACE_AF_AP,4,2                ; @PAACE_AF_AP
.subsections_via_symbols
