	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ni_initialize_smc_cac_tables
_ni_initialize_smc_cac_tables:          ## @ni_initialize_smc_cac_tables
	.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, %r15
	callq	_rv770_get_pi
	movq	%rax, %rbx
	movq	%r15, %rdi
	callq	_ni_get_pi
	xorl	%r12d, %r12d
	cmpl	$0, (%rax)
	je	LBB0_27
## %bb.1:
	movq	%rax, %r14
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$64, %edi
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_2
## %bb.3:
	movq	%rax, %r13
	movq	_CG_CAC_CTRL@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_RREG32
	movq	_TID_CNT_MASK@GOTPCREL(%rip), %rcx
	movq	_TID_UNIT_MASK@GOTPCREL(%rip), %rdx
	movl	(%rdx), %ebx
	orl	(%rcx), %ebx
	notl	%ebx
	andl	%eax, %ebx
	movq	96(%r14), %rax
	movl	28(%rax), %edi
	callq	_TID_CNT
	movl	%eax, %r12d
	movq	96(%r14), %rax
	movl	24(%rax), %edi
	callq	_TID_UNIT
	orl	%eax, %r12d
	orl	%ebx, %r12d
	movq	_CG_CAC_CTRL@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	%r12d, %esi
	callq	_WREG32
	movq	_NISLANDS_DCCAC_MAX_LEVELS@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	testl	%r8d, %r8d
	jle	LBB0_17
## %bb.4:
	movq	96(%r14), %rax
	movq	104(%r14), %rcx
	movq	16(%rax), %rdx
	xorl	%esi, %esi
	cmpl	$4, %r8d
	jb	LBB0_14
## %bb.5:
	movq	%rcx, %rax
	subq	%rdx, %rax
	cmpq	$32, %rax
	jb	LBB0_14
## %bb.6:
	movl	%r8d, %esi
	andl	$-4, %esi
	leaq	-4(%rsi), %rax
	movq	%rax, %rdi
	shrq	$2, %rdi
	incq	%rdi
	movl	%edi, %r9d
	andl	$3, %r9d
	cmpq	$12, %rax
	jae	LBB0_8
## %bb.7:
	xorl	%ebx, %ebx
	jmp	LBB0_10
LBB0_2:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r12d, %r12d
	subl	(%rax), %r12d
	jmp	LBB0_27
LBB0_8:
	andq	$-4, %rdi
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	movups	(%rdx,%rbx,8), %xmm0
	movups	16(%rdx,%rbx,8), %xmm1
	movups	%xmm0, (%rcx,%rbx,8)
	movups	%xmm1, 16(%rcx,%rbx,8)
	movups	32(%rdx,%rbx,8), %xmm0
	movups	48(%rdx,%rbx,8), %xmm1
	movups	%xmm0, 32(%rcx,%rbx,8)
	movups	%xmm1, 48(%rcx,%rbx,8)
	movups	64(%rdx,%rbx,8), %xmm0
	movups	80(%rdx,%rbx,8), %xmm1
	movups	%xmm0, 64(%rcx,%rbx,8)
	movups	%xmm1, 80(%rcx,%rbx,8)
	movups	96(%rdx,%rbx,8), %xmm0
	movups	112(%rdx,%rbx,8), %xmm1
	movups	%xmm0, 96(%rcx,%rbx,8)
	movups	%xmm1, 112(%rcx,%rbx,8)
	addq	$16, %rbx
	addq	$-4, %rdi
	jne	LBB0_9
LBB0_10:
	testq	%r9, %r9
	je	LBB0_13
## %bb.11:
	leaq	(%rcx,%rbx,8), %rdi
	addq	$16, %rdi
	leaq	(%rdx,%rbx,8), %rbx
	addq	$16, %rbx
	shlq	$5, %r9
	xorl	%eax, %eax
	.p2align	4, 0x90
LBB0_12:                                ## =>This Inner Loop Header: Depth=1
	movups	-16(%rbx,%rax), %xmm0
	movups	(%rbx,%rax), %xmm1
	movups	%xmm0, -16(%rdi,%rax)
	movups	%xmm1, (%rdi,%rax)
	addq	$32, %rax
	cmpq	%rax, %r9
	jne	LBB0_12
LBB0_13:
	cmpq	%r8, %rsi
	je	LBB0_17
LBB0_14:
	movq	%rsi, %rax
	notq	%rax
	addq	%r8, %rax
	movq	%r8, %rdi
	andq	$3, %rdi
	je	LBB0_16
	.p2align	4, 0x90
LBB0_15:                                ## =>This Inner Loop Header: Depth=1
	movq	(%rdx,%rsi,8), %rbx
	movq	%rbx, (%rcx,%rsi,8)
	incq	%rsi
	decq	%rdi
	jne	LBB0_15
LBB0_16:
	cmpq	$3, %rax
	jb	LBB0_17
	.p2align	4, 0x90
LBB0_28:                                ## =>This Inner Loop Header: Depth=1
	movq	(%rdx,%rsi,8), %rax
	movq	%rax, (%rcx,%rsi,8)
	movq	8(%rdx,%rsi,8), %rax
	movq	%rax, 8(%rcx,%rsi,8)
	movq	16(%rdx,%rsi,8), %rax
	movq	%rax, 16(%rcx,%rsi,8)
	movq	24(%rdx,%rsi,8), %rax
	movq	%rax, 24(%rcx,%rsi,8)
	addq	$4, %rsi
	cmpq	%rsi, %r8
	jne	LBB0_28
LBB0_17:
	movq	_SMC_NISLANDS_BIF_LUT_NUM_OF_ENTRIES@GOTPCREL(%rip), %rcx
	cmpl	$0, (%rcx)
	movq	96(%r14), %rax
	jle	LBB0_20
## %bb.18:
	movq	8(%rax), %rdx
	movq	56(%r13), %rsi
	xorl	%edi, %edi
	.p2align	4, 0x90
LBB0_19:                                ## =>This Inner Loop Header: Depth=1
	movl	(%rdx,%rdi,4), %ebx
	movl	%ebx, (%rsi,%rdi,4)
	incq	%rdi
	movslq	(%rcx), %rbx
	cmpq	%rbx, %rdi
	jl	LBB0_19
LBB0_20:
	movl	(%r15), %ecx
	movl	%ecx, 72(%r14)
	movq	$0, 64(%r14)
	movq	88(%r14), %rcx
	movq	104(%r14), %rdx
	movq	_NISLANDS_DCCAC_LEVEL_0@GOTPCREL(%rip), %rsi
	movq	(%rsi), %rsi
	movq	(%rdx,%rsi,8), %rdx
	movq	%rdx, 56(%r14)
	movl	4(%rax), %edx
	movl	%edx, 36(%r14)
	movl	(%rax), %eax
	movl	%eax, 32(%r14)
	xorps	%xmm0, %xmm0
	movups	%xmm0, 40(%r14)
	movq	$0, 24(%r14)
	movq	%rcx, 16(%r14)
	cmpq	$0, 80(%r14)
	je	LBB0_22
## %bb.21:
	movq	%r15, %rdi
	movq	%r13, %rsi
	callq	_ni_init_driver_calculated_leakage_table
	jmp	LBB0_23
LBB0_22:
	movq	%r15, %rdi
	movq	%r13, %rsi
	callq	_ni_init_simplified_leakage_table
LBB0_23:
	xorl	%r12d, %r12d
	testl	%eax, %eax
	jne	LBB0_25
## %bb.24:
	movq	64(%r14), %rdi
	callq	_cpu_to_be32
	movq	%rax, 48(%r13)
	movq	56(%r14), %rdi
	callq	_cpu_to_be32
	movq	%rax, 40(%r13)
	movq	48(%r14), %rdi
	callq	_cpu_to_be32
	movq	%rax, 32(%r13)
	movq	40(%r14), %rax
	movq	%rax, 24(%r13)
	movl	36(%r14), %eax
	movl	%eax, 20(%r13)
	movl	32(%r14), %eax
	movl	%eax, 16(%r13)
	movq	24(%r14), %rax
	movq	%rax, 8(%r13)
	movl	20(%r14), %eax
	movl	%eax, 4(%r13)
	movl	16(%r14), %eax
	movl	%eax, (%r13)
	movl	8(%r14), %esi
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %r8d
	movq	%r15, %rdi
	movq	%r13, %rdx
	movl	$64, %ecx
	callq	_rv770_copy_bytes_to_smc
	testl	%eax, %eax
	je	LBB0_26
LBB0_25:
	movq	$0, (%r14)
LBB0_26:
	movq	%r13, %rdi
	callq	_kfree
LBB0_27:
	movl	%r12d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_CG_CAC_CTRL,4,2                ## @CG_CAC_CTRL
	.comm	_TID_CNT_MASK,4,2               ## @TID_CNT_MASK
	.comm	_TID_UNIT_MASK,4,2              ## @TID_UNIT_MASK
	.comm	_NISLANDS_DCCAC_MAX_LEVELS,4,2  ## @NISLANDS_DCCAC_MAX_LEVELS
	.comm	_SMC_NISLANDS_BIF_LUT_NUM_OF_ENTRIES,4,2 ## @SMC_NISLANDS_BIF_LUT_NUM_OF_ENTRIES
	.comm	_NISLANDS_DCCAC_LEVEL_0,8,3     ## @NISLANDS_DCCAC_LEVEL_0
	.no_dead_strip	_ni_initialize_smc_cac_tables
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ni_initialize_smc_cac_tables
_ni_initialize_smc_cac_tables:          ; @ni_initialize_smc_cac_tables
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x20, x0
	bl	_rv770_get_pi
	mov	x22, x0
	mov	x0, x20
	bl	_ni_get_pi
	ldr	w8, [x0]
	cbz	w8, LBB0_20
; %bb.1:
	mov	x19, x0
Lloh0:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	w0, #64
	bl	_kzalloc
	cbz	x0, LBB0_15
; %bb.2:
	mov	x21, x0
Lloh3:
	adrp	x24, _CG_CAC_CTRL@GOTPAGE
Lloh4:
	ldr	x24, [x24, _CG_CAC_CTRL@GOTPAGEOFF]
	ldr	w0, [x24]
	bl	_RREG32
Lloh5:
	adrp	x8, _TID_CNT_MASK@GOTPAGE
Lloh6:
	ldr	x8, [x8, _TID_CNT_MASK@GOTPAGEOFF]
Lloh7:
	adrp	x9, _TID_UNIT_MASK@GOTPAGE
Lloh8:
	ldr	x9, [x9, _TID_UNIT_MASK@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
Lloh10:
	ldr	w9, [x9]
	orr	w8, w9, w8
	bic	w25, w0, w8
	ldr	x8, [x19, #96]
	ldr	w0, [x8, #28]
	bl	_TID_CNT
	mov	x23, x0
	ldr	x8, [x19, #96]
	ldr	w0, [x8, #24]
	bl	_TID_UNIT
	orr	w8, w23, w25
	orr	w1, w8, w0
	ldr	w0, [x24]
	bl	_WREG32
Lloh11:
	adrp	x8, _NISLANDS_DCCAC_MAX_LEVELS@GOTPAGE
Lloh12:
	ldr	x8, [x8, _NISLANDS_DCCAC_MAX_LEVELS@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	cmp	w8, #1
	b.lt	LBB0_10
; %bb.3:
	mov	x9, #0
	ldp	x10, x11, [x19, #96]
	ldr	x10, [x10, #16]
	cmp	w8, #8
	b.lo	LBB0_8
; %bb.4:
	sub	x12, x11, x10
	cmp	x12, #64
	b.lo	LBB0_8
; %bb.5:
	and	x9, x8, #0xfffffff8
	add	x12, x11, #32
	add	x13, x10, #32
	mov	x14, x9
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	ldp	q0, q1, [x13, #-32]
	ldp	q2, q3, [x13], #64
	stp	q0, q1, [x12, #-32]
	stp	q2, q3, [x12], #64
	subs	x14, x14, #8
	b.ne	LBB0_6
; %bb.7:
	cmp	x9, x8
	b.eq	LBB0_10
LBB0_8:
	lsl	x12, x9, #3
	add	x11, x11, x12
	add	x10, x10, x12
	sub	x8, x8, x9
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x9, [x10], #8
	str	x9, [x11], #8
	subs	x8, x8, #1
	b.ne	LBB0_9
LBB0_10:
Lloh14:
	adrp	x9, _SMC_NISLANDS_BIF_LUT_NUM_OF_ENTRIES@GOTPAGE
Lloh15:
	ldr	x9, [x9, _SMC_NISLANDS_BIF_LUT_NUM_OF_ENTRIES@GOTPAGEOFF]
	ldr	w10, [x9]
	ldr	x8, [x19, #96]
	cmp	w10, #1
	b.lt	LBB0_13
; %bb.11:
	mov	x10, #0
	ldr	x11, [x8, #8]
	ldr	x12, [x21, #56]
LBB0_12:                                ; =>This Inner Loop Header: Depth=1
	lsl	x13, x10, #2
	ldr	w14, [x11, x13]
	str	w14, [x12, x13]
	add	x10, x10, #1
	ldrsw	x13, [x9]
	cmp	x10, x13
	b.lt	LBB0_12
LBB0_13:
	ldr	w9, [x20]
	str	w9, [x19, #72]
	str	xzr, [x19, #64]
	ldr	x9, [x19, #104]
Lloh16:
	adrp	x10, _NISLANDS_DCCAC_LEVEL_0@GOTPAGE
Lloh17:
	ldr	x10, [x10, _NISLANDS_DCCAC_LEVEL_0@GOTPAGEOFF]
Lloh18:
	ldr	x10, [x10]
	ldr	x9, [x9, x10, lsl #3]
	str	x9, [x19, #56]
	ldr	d0, [x8]
	str	d0, [x19, #32]
	stp	xzr, xzr, [x19, #40]
	str	xzr, [x19, #24]
	ldr	d0, [x19, #88]
	str	d0, [x19, #16]
	ldr	x8, [x19, #80]
	cbz	x8, LBB0_16
; %bb.14:
	mov	x0, x20
	mov	x1, x21
	bl	_ni_init_driver_calculated_leakage_table
	cbnz	w0, LBB0_18
	b	LBB0_17
LBB0_15:
Lloh19:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh20:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh21:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_21
LBB0_16:
	mov	x0, x20
	mov	x1, x21
	bl	_ni_init_simplified_leakage_table
	cbnz	w0, LBB0_18
LBB0_17:
	ldr	x0, [x19, #64]
	bl	_cpu_to_be32
	str	x0, [x21, #48]
	ldr	x0, [x19, #56]
	bl	_cpu_to_be32
	str	x0, [x21, #40]
	ldr	x0, [x19, #48]
	bl	_cpu_to_be32
	ldr	x8, [x19, #40]
	stp	x8, x0, [x21, #24]
	ldr	d0, [x19, #32]
	str	d0, [x21, #16]
	ldr	x8, [x19, #24]
	str	x8, [x21, #8]
	ldr	d0, [x19, #16]
	str	d0, [x21]
	ldr	w1, [x19, #8]
	ldr	w4, [x22]
	mov	x0, x20
	mov	x2, x21
	mov	w3, #64
	bl	_rv770_copy_bytes_to_smc
	cbz	w0, LBB0_19
LBB0_18:
	str	xzr, [x19]
LBB0_19:
	mov	x0, x21
	bl	_kfree
LBB0_20:
	mov	w0, #0
LBB0_21:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh9
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_CG_CAC_CTRL,4,2                ; @CG_CAC_CTRL
	.comm	_TID_CNT_MASK,4,2               ; @TID_CNT_MASK
	.comm	_TID_UNIT_MASK,4,2              ; @TID_UNIT_MASK
	.comm	_NISLANDS_DCCAC_MAX_LEVELS,4,2  ; @NISLANDS_DCCAC_MAX_LEVELS
	.comm	_SMC_NISLANDS_BIF_LUT_NUM_OF_ENTRIES,4,2 ; @SMC_NISLANDS_BIF_LUT_NUM_OF_ENTRIES
	.comm	_NISLANDS_DCCAC_LEVEL_0,8,3     ; @NISLANDS_DCCAC_LEVEL_0
	.no_dead_strip	_ni_initialize_smc_cac_tables
.subsections_via_symbols
