	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_cxl_alloc_sst                  ## -- Begin function cxl_alloc_sst
	.p2align	4, 0x90
_cxl_alloc_sst:                         ## @cxl_alloc_sst
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r13
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, 16(%rdi)
	movq	$0, 24(%rdi)
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_get_zeroed_page
	movq	%rax, 8(%r13)
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	leaq	L_.str.1(%rip), %rdi
	xorl	%r14d, %r14d
	movl	%eax, %esi
	xorl	%eax, %eax
	callq	_pr_devel
	movl	8(%r13), %edi
	movq	_mmu_kernel_ssize@GOTPCREL(%rip), %r12
	movq	(%r12), %rsi
	callq	_get_kernel_vsid
	movl	%eax, %r15d
	movl	16(%r13), %eax
	sarl	$8, %eax
	decl	%eax
	movq	_CXL_SSTP0_An_SegTableSize_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	shll	%cl, %eax
	movq	_CXL_SSTP0_An_SegTableSize_MASK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
	notl	%edi
	andl	%eax, %edi
	callq	_unlikely
	testq	%rax, %rax
	je	LBB0_4
## %bb.3:
	leaq	L_.str.2(%rip), %rsi
	movl	$1, %edi
	callq	_WARN
	movq	_EINVAL@GOTPCREL(%rip), %rax
	subl	(%rax), %r14d
	jmp	LBB0_5
LBB0_1:
	leaq	L_.str(%rip), %rdi
	callq	_pr_err
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
	jmp	LBB0_5
LBB0_4:
	shll	$12, %r15d
	movq	(%r12), %rcx
	movq	_MMU_SEGSIZE_256M@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	cmpq	(%rax), %rcx
	sete	%bl
	shll	$28, %ebx
	addl	$-256, %ebx
	movl	8(%r13), %esi
	andl	%esi, %ebx
	movq	_CXL_SSTP1_An_V@GOTPCREL(%rip), %rax
	orl	(%rax), %ebx
	movslq	%r15d, %r8
	movq	_ESID_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	andl	%esi, %edx
	movl	%ebx, (%rsp)
	leaq	L_.str.3(%rip), %rdi
	xorl	%eax, %eax
	callq	_pr_devel
	movl	%ebx, 4(%r13)
LBB0_5:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PAGE_SIZE,8,3                  ## @PAGE_SIZE
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"cxl_alloc_sst: Unable to allocate segment table\n"

	.comm	_ENOMEM,4,2                     ## @ENOMEM
L_.str.1:                               ## @.str.1
	.asciz	"SSTP allocated at 0x%p\n"

	.comm	_mmu_kernel_ssize,8,3           ## @mmu_kernel_ssize
	.comm	_CXL_SSTP0_An_B_SHIFT,4,2       ## @CXL_SSTP0_An_B_SHIFT
	.comm	_SLB_VSID_KERNEL,4,2            ## @SLB_VSID_KERNEL
	.comm	_mmu_psize_defs,8,3             ## @mmu_psize_defs
	.comm	_mmu_linear_psize,8,3           ## @mmu_linear_psize
	.comm	_CXL_SSTP0_An_SegTableSize_SHIFT,4,2 ## @CXL_SSTP0_An_SegTableSize_SHIFT
	.comm	_CXL_SSTP0_An_SegTableSize_MASK,4,2 ## @CXL_SSTP0_An_SegTableSize_MASK
L_.str.2:                               ## @.str.2
	.asciz	"Impossible segment table size\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_MMU_SEGSIZE_256M,8,3           ## @MMU_SEGSIZE_256M
	.comm	_CXL_SSTP1_An_V,4,2             ## @CXL_SSTP1_An_V
L_.str.3:                               ## @.str.3
	.asciz	"Looked up %#llx: slbfee. %#llx (ssize: %x, vsid: %#lx), copied to SSTP0: %#llx, SSTP1: %#llx\n"

	.comm	_ESID_MASK,4,2                  ## @ESID_MASK
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_cxl_alloc_sst                  ; -- Begin function cxl_alloc_sst
	.p2align	2
_cxl_alloc_sst:                         ; @cxl_alloc_sst
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	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
	mov	x19, x0
Lloh0:
	adrp	x8, _PAGE_SIZE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PAGE_SIZE@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stp	x8, xzr, [x0, #16]
Lloh3:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh5:
	ldr	w0, [x8]
	bl	_get_zeroed_page
	str	x0, [x19, #8]
	cbz	x0, LBB0_3
; %bb.1:
	mov	x1, x0
Lloh6:
	adrp	x0, l_.str.1@PAGE
Lloh7:
	add	x0, x0, l_.str.1@PAGEOFF
                                        ; kill: def $w1 killed $w1 killed $x1
	bl	_pr_devel
	ldr	w0, [x19, #8]
Lloh8:
	adrp	x21, _mmu_kernel_ssize@GOTPAGE
Lloh9:
	ldr	x21, [x21, _mmu_kernel_ssize@GOTPAGEOFF]
	ldr	x1, [x21]
	bl	_get_kernel_vsid
	mov	x20, x0
	ldr	w8, [x19, #16]
	asr	w8, w8, #8
	sub	w8, w8, #1
Lloh10:
	adrp	x9, _CXL_SSTP0_An_SegTableSize_SHIFT@GOTPAGE
Lloh11:
	ldr	x9, [x9, _CXL_SSTP0_An_SegTableSize_SHIFT@GOTPAGEOFF]
Lloh12:
	ldr	w9, [x9]
	lsl	w8, w8, w9
Lloh13:
	adrp	x9, _CXL_SSTP0_An_SegTableSize_MASK@GOTPAGE
Lloh14:
	ldr	x9, [x9, _CXL_SSTP0_An_SegTableSize_MASK@GOTPAGEOFF]
Lloh15:
	ldr	w9, [x9]
	bic	w0, w8, w9
	bl	_unlikely
	cbz	x0, LBB0_5
; %bb.2:
Lloh16:
	adrp	x1, l_.str.2@PAGE
Lloh17:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	w0, #1
	bl	_WARN
Lloh18:
	adrp	x8, _EINVAL@GOTPAGE
Lloh19:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_4
LBB0_3:
Lloh20:
	adrp	x0, l_.str@PAGE
Lloh21:
	add	x0, x0, l_.str@PAGEOFF
	bl	_pr_err
Lloh22:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh23:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
LBB0_4:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_6
LBB0_5:
	lsl	w8, w20, #12
	sxtw	x8, w8
	ldr	x9, [x21]
Lloh24:
	adrp	x10, _MMU_SEGSIZE_256M@GOTPAGE
Lloh25:
	ldr	x10, [x10, _MMU_SEGSIZE_256M@GOTPAGEOFF]
Lloh26:
	ldr	x10, [x10]
	cmp	x9, x10
	mov	w10, #-256
	mov	w11, #268435200
	csel	w10, w11, w10, eq
	ldr	w1, [x19, #8]
	and	w10, w10, w1
Lloh27:
	adrp	x11, _CXL_SSTP1_An_V@GOTPAGE
Lloh28:
	ldr	x11, [x11, _CXL_SSTP1_An_V@GOTPAGEOFF]
Lloh29:
	ldr	w11, [x11]
	orr	w20, w10, w11
Lloh30:
	adrp	x10, _ESID_MASK@GOTPAGE
Lloh31:
	ldr	x10, [x10, _ESID_MASK@GOTPAGEOFF]
Lloh32:
	ldr	w10, [x10]
	and	w10, w10, w1
	stp	x9, x8, [sp, #8]
	str	x10, [sp]
	str	x20, [sp, #32]
Lloh33:
	adrp	x0, l_.str.3@PAGE
Lloh34:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_pr_devel
	mov	w0, #0
	str	w20, [x19, #4]
LBB0_6:
	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
	add	sp, sp, #96
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh22, Lloh23
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpAdd	Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.cfi_endproc
                                        ; -- End function
	.comm	_PAGE_SIZE,8,3                  ; @PAGE_SIZE
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"cxl_alloc_sst: Unable to allocate segment table\n"

	.comm	_ENOMEM,4,2                     ; @ENOMEM
l_.str.1:                               ; @.str.1
	.asciz	"SSTP allocated at 0x%p\n"

	.comm	_mmu_kernel_ssize,8,3           ; @mmu_kernel_ssize
	.comm	_CXL_SSTP0_An_B_SHIFT,4,2       ; @CXL_SSTP0_An_B_SHIFT
	.comm	_SLB_VSID_KERNEL,4,2            ; @SLB_VSID_KERNEL
	.comm	_mmu_psize_defs,8,3             ; @mmu_psize_defs
	.comm	_mmu_linear_psize,8,3           ; @mmu_linear_psize
	.comm	_CXL_SSTP0_An_SegTableSize_SHIFT,4,2 ; @CXL_SSTP0_An_SegTableSize_SHIFT
	.comm	_CXL_SSTP0_An_SegTableSize_MASK,4,2 ; @CXL_SSTP0_An_SegTableSize_MASK
l_.str.2:                               ; @.str.2
	.asciz	"Impossible segment table size\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_MMU_SEGSIZE_256M,8,3           ; @MMU_SEGSIZE_256M
	.comm	_CXL_SSTP1_An_V,4,2             ; @CXL_SSTP1_An_V
l_.str.3:                               ; @.str.3
	.asciz	"Looked up %#llx: slbfee. %#llx (ssize: %x, vsid: %#lx), copied to SSTP0: %#llx, SSTP1: %#llx\n"

	.comm	_ESID_MASK,4,2                  ; @ESID_MASK
.subsections_via_symbols
