	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function arm_mali_lpae_alloc_pgtable
_arm_mali_lpae_alloc_pgtable:           ## @arm_mali_lpae_alloc_pgtable
	.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
	cmpq	$0, 24(%rdi)
	jne	LBB0_9
## %bb.1:
	movq	%rdi, %rbx
	cmpl	$48, (%rdi)
	jg	LBB0_9
## %bb.2:
	cmpl	$40, 4(%rbx)
	jg	LBB0_9
## %bb.3:
	movq	_SZ_4K@GOTPCREL(%rip), %rax
	movq	_SZ_2M@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	movq	_SZ_1G@GOTPCREL(%rip), %rax
	orl	(%rax), %ecx
	andl	%ecx, 8(%rbx)
	movq	%rbx, %rdi
	callq	_arm_lpae_alloc_pgtable
	testq	%rax, %rax
	je	LBB0_9
## %bb.4:
	movq	%rax, %r14
	movq	_ARM_LPAE_MAX_LEVELS@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	%rax, (%r14)
	jge	LBB0_6
## %bb.5:
	movq	%rax, (%r14)
	movl	$4, 8(%r14)
LBB0_6:
	movq	_ARM_MALI_LPAE_MEMATTR_IMP_DEF@GOTPCREL(%rip), %r15
	movl	(%r15), %r12d
	movq	_ARM_LPAE_MAIR_ATTR_IDX_NC@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_ARM_LPAE_MAIR_ATTR_SHIFT
	movl	%eax, %ecx
	shll	%cl, %r12d
	movq	_ARM_MALI_LPAE_MEMATTR_WRITE_ALLOC@GOTPCREL(%rip), %rax
	movl	(%rax), %r13d
	movq	_ARM_LPAE_MAIR_ATTR_IDX_CACHE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_ARM_LPAE_MAIR_ATTR_SHIFT
	movl	%eax, %ecx
	shll	%cl, %r13d
	orl	%r12d, %r13d
	movl	(%r15), %r15d
	movq	_ARM_LPAE_MAIR_ATTR_IDX_DEV@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_ARM_LPAE_MAIR_ATTR_SHIFT
	movl	%eax, %ecx
	shll	%cl, %r15d
	orl	%r13d, %r15d
	movl	%r15d, 12(%rbx)
	movl	8(%r14), %edi
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdx
	callq	___arm_lpae_alloc_pages
	movl	%eax, 16(%r14)
	testl	%eax, %eax
	je	LBB0_8
## %bb.7:
	xorl	%eax, %eax
	callq	_wmb
	movl	16(%r14), %edi
	callq	_virt_to_phys
	movq	_ARM_MALI_LPAE_TTBR_READ_INNER@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movq	_ARM_MALI_LPAE_TTBR_ADRMODE_TABLE@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movl	%eax, 16(%rbx)
	addq	$12, %r14
	jmp	LBB0_10
LBB0_8:
	movq	%r14, %rdi
	callq	_kfree
LBB0_9:
	xorl	%r14d, %r14d
LBB0_10:
	movq	%r14, %rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SZ_4K,4,2                      ## @SZ_4K
	.comm	_SZ_2M,4,2                      ## @SZ_2M
	.comm	_SZ_1G,4,2                      ## @SZ_1G
	.comm	_ARM_LPAE_MAX_LEVELS,8,3        ## @ARM_LPAE_MAX_LEVELS
	.comm	_ARM_MALI_LPAE_MEMATTR_IMP_DEF,4,2 ## @ARM_MALI_LPAE_MEMATTR_IMP_DEF
	.comm	_ARM_LPAE_MAIR_ATTR_IDX_NC,4,2  ## @ARM_LPAE_MAIR_ATTR_IDX_NC
	.comm	_ARM_MALI_LPAE_MEMATTR_WRITE_ALLOC,4,2 ## @ARM_MALI_LPAE_MEMATTR_WRITE_ALLOC
	.comm	_ARM_LPAE_MAIR_ATTR_IDX_CACHE,4,2 ## @ARM_LPAE_MAIR_ATTR_IDX_CACHE
	.comm	_ARM_LPAE_MAIR_ATTR_IDX_DEV,4,2 ## @ARM_LPAE_MAIR_ATTR_IDX_DEV
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ARM_MALI_LPAE_TTBR_READ_INNER,4,2 ## @ARM_MALI_LPAE_TTBR_READ_INNER
	.comm	_ARM_MALI_LPAE_TTBR_ADRMODE_TABLE,4,2 ## @ARM_MALI_LPAE_TTBR_ADRMODE_TABLE
	.no_dead_strip	_arm_mali_lpae_alloc_pgtable
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function arm_mali_lpae_alloc_pgtable
_arm_mali_lpae_alloc_pgtable:           ; @arm_mali_lpae_alloc_pgtable
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	ldr	x8, [x0, #24]
	cbnz	x8, LBB0_9
; %bb.1:
	mov	x19, x0
	ldr	w8, [x0]
	cmp	w8, #48
	b.gt	LBB0_9
; %bb.2:
	ldr	w8, [x19, #4]
	cmp	w8, #40
	b.gt	LBB0_9
; %bb.3:
Lloh0:
	adrp	x8, _SZ_4K@GOTPAGE
Lloh1:
	ldr	x8, [x8, _SZ_4K@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
Lloh3:
	adrp	x9, _SZ_2M@GOTPAGE
Lloh4:
	ldr	x9, [x9, _SZ_2M@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
Lloh6:
	adrp	x10, _SZ_1G@GOTPAGE
Lloh7:
	ldr	x10, [x10, _SZ_1G@GOTPAGEOFF]
	orr	w8, w9, w8
Lloh8:
	ldr	w9, [x10]
	orr	w8, w8, w9
	ldr	w9, [x19, #8]
	and	w8, w9, w8
	str	w8, [x19, #8]
	mov	x0, x19
	bl	_arm_lpae_alloc_pgtable
	cbz	x0, LBB0_10
; %bb.4:
	mov	x20, x0
	ldr	x9, [x0]
Lloh9:
	adrp	x8, _ARM_LPAE_MAX_LEVELS@GOTPAGE
Lloh10:
	ldr	x8, [x8, _ARM_LPAE_MAX_LEVELS@GOTPAGEOFF]
Lloh11:
	ldr	x8, [x8]
	cmp	x9, x8
	b.ge	LBB0_6
; %bb.5:
	str	x8, [x20]
	mov	w8, #4
	str	w8, [x20, #8]
LBB0_6:
Lloh12:
	adrp	x21, _ARM_MALI_LPAE_MEMATTR_IMP_DEF@GOTPAGE
Lloh13:
	ldr	x21, [x21, _ARM_MALI_LPAE_MEMATTR_IMP_DEF@GOTPAGEOFF]
	ldr	w22, [x21]
Lloh14:
	adrp	x8, _ARM_LPAE_MAIR_ATTR_IDX_NC@GOTPAGE
Lloh15:
	ldr	x8, [x8, _ARM_LPAE_MAIR_ATTR_IDX_NC@GOTPAGEOFF]
Lloh16:
	ldr	w0, [x8]
	bl	_ARM_LPAE_MAIR_ATTR_SHIFT
	lsl	w22, w22, w0
Lloh17:
	adrp	x8, _ARM_MALI_LPAE_MEMATTR_WRITE_ALLOC@GOTPAGE
Lloh18:
	ldr	x8, [x8, _ARM_MALI_LPAE_MEMATTR_WRITE_ALLOC@GOTPAGEOFF]
Lloh19:
	ldr	w23, [x8]
Lloh20:
	adrp	x8, _ARM_LPAE_MAIR_ATTR_IDX_CACHE@GOTPAGE
Lloh21:
	ldr	x8, [x8, _ARM_LPAE_MAIR_ATTR_IDX_CACHE@GOTPAGEOFF]
Lloh22:
	ldr	w0, [x8]
	bl	_ARM_LPAE_MAIR_ATTR_SHIFT
	lsl	w8, w23, w0
	orr	w22, w8, w22
	ldr	w21, [x21]
Lloh23:
	adrp	x8, _ARM_LPAE_MAIR_ATTR_IDX_DEV@GOTPAGE
Lloh24:
	ldr	x8, [x8, _ARM_LPAE_MAIR_ATTR_IDX_DEV@GOTPAGEOFF]
Lloh25:
	ldr	w0, [x8]
	bl	_ARM_LPAE_MAIR_ATTR_SHIFT
	lsl	w8, w21, w0
	orr	w8, w22, w8
	str	w8, [x19, #12]
	ldr	w0, [x20, #8]
Lloh26:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh27:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh28:
	ldr	w1, [x8]
	mov	x2, x19
	bl	___arm_lpae_alloc_pages
	str	w0, [x20, #16]
	cbz	w0, LBB0_8
; %bb.7:
	bl	_wmb
	ldr	w0, [x20, #16]
	bl	_virt_to_phys
Lloh29:
	adrp	x8, _ARM_MALI_LPAE_TTBR_READ_INNER@GOTPAGE
Lloh30:
	ldr	x8, [x8, _ARM_MALI_LPAE_TTBR_READ_INNER@GOTPAGEOFF]
Lloh31:
	ldr	w8, [x8]
	orr	w8, w8, w0
Lloh32:
	adrp	x9, _ARM_MALI_LPAE_TTBR_ADRMODE_TABLE@GOTPAGE
Lloh33:
	ldr	x9, [x9, _ARM_MALI_LPAE_TTBR_ADRMODE_TABLE@GOTPAGEOFF]
Lloh34:
	ldr	w9, [x9]
	orr	w8, w8, w9
	str	w8, [x19, #16]
	add	x0, x20, #12
	b	LBB0_10
LBB0_8:
	mov	x0, x20
	bl	_kfree
LBB0_9:
	mov	x0, #0
LBB0_10:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.cfi_endproc
                                        ; -- End function
	.comm	_SZ_4K,4,2                      ; @SZ_4K
	.comm	_SZ_2M,4,2                      ; @SZ_2M
	.comm	_SZ_1G,4,2                      ; @SZ_1G
	.comm	_ARM_LPAE_MAX_LEVELS,8,3        ; @ARM_LPAE_MAX_LEVELS
	.comm	_ARM_MALI_LPAE_MEMATTR_IMP_DEF,4,2 ; @ARM_MALI_LPAE_MEMATTR_IMP_DEF
	.comm	_ARM_LPAE_MAIR_ATTR_IDX_NC,4,2  ; @ARM_LPAE_MAIR_ATTR_IDX_NC
	.comm	_ARM_MALI_LPAE_MEMATTR_WRITE_ALLOC,4,2 ; @ARM_MALI_LPAE_MEMATTR_WRITE_ALLOC
	.comm	_ARM_LPAE_MAIR_ATTR_IDX_CACHE,4,2 ; @ARM_LPAE_MAIR_ATTR_IDX_CACHE
	.comm	_ARM_LPAE_MAIR_ATTR_IDX_DEV,4,2 ; @ARM_LPAE_MAIR_ATTR_IDX_DEV
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ARM_MALI_LPAE_TTBR_READ_INNER,4,2 ; @ARM_MALI_LPAE_TTBR_READ_INNER
	.comm	_ARM_MALI_LPAE_TTBR_ADRMODE_TABLE,4,2 ; @ARM_MALI_LPAE_TTBR_ADRMODE_TABLE
	.no_dead_strip	_arm_mali_lpae_alloc_pgtable
.subsections_via_symbols
