	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_lima_l2_cache_init             ## -- Begin function lima_l2_cache_init
	.p2align	4, 0x90
_lima_l2_cache_init:                    ## @lima_l2_cache_init
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %r14
	movq	(%rdi), %rax
	movq	16(%rdi), %rbx
	movq	_lima_ip_l2_cache2@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_5
## %bb.1:
	movq	_lima_ip_pp4@GOTPCREL(%rip), %rax
	movslq	(%rax), %rdx
	movq	_lima_ip_pp7@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	cmpl	%eax, %edx
	jg	LBB0_8
## %bb.2:
	movq	%rdx, %rcx
	shlq	$3, %rcx
	addq	8(%rbx), %rcx
	subl	%edx, %eax
	incl	%eax
	xorl	%edx, %edx
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	cmpq	$0, (%rcx,%rdx,8)
	jne	LBB0_5
## %bb.3:                               ##   in Loop: Header=BB0_4 Depth=1
	incq	%rdx
	cmpl	%edx, %eax
	jne	LBB0_4
LBB0_8:
	movq	_ENODEV@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_7
LBB0_5:
	leaq	8(%r14), %rdi
	callq	_spin_lock_init
	movq	_LIMA_L2_CACHE_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_l2_cache_read
	movl	(%rbx), %edi
	movl	%eax, %ecx
	shrl	$16, %ecx
	addb	$-10, %cl
	movl	$1, %r9d
	movl	$1, %edx
                                        ## kill: def $cl killed $cl killed $ecx
	shll	%cl, %edx
	movl	%eax, %ecx
	shrl	$8, %ecx
	movl	$1, %ebx
                                        ## kill: def $cl killed $cl killed $ecx
	shll	%cl, %ebx
	movl	$1, %r8d
	movl	%eax, %ecx
	shll	%cl, %r8d
	shrl	$24, %eax
	movl	%eax, %ecx
	shll	%cl, %r9d
	leaq	L_.str(%rip), %rsi
	movl	%ebx, %ecx
	callq	_dev_info
	movq	%r14, %rdi
	callq	_lima_l2_cache_flush
	testl	%eax, %eax
	jne	LBB0_7
## %bb.6:
	movq	_LIMA_L2_CACHE_ENABLE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_LIMA_L2_CACHE_ENABLE_ACCESS@GOTPCREL(%rip), %rax
	movq	_LIMA_L2_CACHE_ENABLE_READ_ALLOCATE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	orl	(%rax), %esi
	callq	_l2_cache_write
	movq	_LIMA_L2_CACHE_MAX_READS@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	$28, %esi
	callq	_l2_cache_write
	xorl	%eax, %eax
LBB0_7:
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_lima_ip_l2_cache2,8,3          ## @lima_ip_l2_cache2
	.comm	_lima_ip_pp4,4,2                ## @lima_ip_pp4
	.comm	_lima_ip_pp7,4,2                ## @lima_ip_pp7
	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_LIMA_L2_CACHE_SIZE,4,2         ## @LIMA_L2_CACHE_SIZE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"l2 cache %uK, %u-way, %ubyte cache line, %ubit external bus\n"

	.comm	_LIMA_L2_CACHE_ENABLE,4,2       ## @LIMA_L2_CACHE_ENABLE
	.comm	_LIMA_L2_CACHE_ENABLE_ACCESS,4,2 ## @LIMA_L2_CACHE_ENABLE_ACCESS
	.comm	_LIMA_L2_CACHE_ENABLE_READ_ALLOCATE,4,2 ## @LIMA_L2_CACHE_ENABLE_READ_ALLOCATE
	.comm	_LIMA_L2_CACHE_MAX_READS,4,2    ## @LIMA_L2_CACHE_MAX_READS
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_lima_l2_cache_init             ; -- Begin function lima_l2_cache_init
	.p2align	2
_lima_l2_cache_init:                    ; @lima_l2_cache_init
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x0
	ldr	x20, [x0, #16]
	ldr	x8, [x0]
Lloh0:
	adrp	x9, _lima_ip_l2_cache2@GOTPAGE
Lloh1:
	ldr	x9, [x9, _lima_ip_l2_cache2@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_6
; %bb.1:
Lloh3:
	adrp	x8, _lima_ip_pp4@GOTPAGE
Lloh4:
	ldr	x8, [x8, _lima_ip_pp4@GOTPAGEOFF]
Lloh5:
	ldrsw	x9, [x8]
Lloh6:
	adrp	x8, _lima_ip_pp7@GOTPAGE
Lloh7:
	ldr	x8, [x8, _lima_ip_pp7@GOTPAGEOFF]
Lloh8:
	ldr	w10, [x8]
	cmp	w9, w10
	b.gt	LBB0_5
; %bb.2:
	ldr	x8, [x20, #8]
	add	x8, x8, x9, lsl #3
	sub	w9, w10, w9
	add	w9, w9, #1
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x10, [x8]
	cbnz	x10, LBB0_6
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	add	x8, x8, #8
	subs	w9, w9, #1
	b.ne	LBB0_3
LBB0_5:
Lloh9:
	adrp	x8, _ENODEV@GOTPAGE
Lloh10:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_8
LBB0_6:
	add	x0, x19, #8
	bl	_spin_lock_init
Lloh12:
	adrp	x8, _LIMA_L2_CACHE_SIZE@GOTPAGE
Lloh13:
	ldr	x8, [x8, _LIMA_L2_CACHE_SIZE@GOTPAGEOFF]
Lloh14:
	ldr	w0, [x8]
	bl	_l2_cache_read
	ubfx	w8, w0, #16, #8
	sub	w8, w8, #10
	mov	w9, #1
	lsl	w2, w9, w8
	lsr	w10, w0, #8
	ldr	w8, [x20]
	lsl	w3, w9, w10
	lsl	w4, w9, w0
	lsr	w10, w0, #24
	lsl	w5, w9, w10
Lloh15:
	adrp	x1, l_.str@PAGE
Lloh16:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x8
	bl	_dev_info
	mov	x0, x19
	bl	_lima_l2_cache_flush
	cbnz	w0, LBB0_8
; %bb.7:
Lloh17:
	adrp	x8, _LIMA_L2_CACHE_ENABLE@GOTPAGE
Lloh18:
	ldr	x8, [x8, _LIMA_L2_CACHE_ENABLE@GOTPAGEOFF]
Lloh19:
	adrp	x9, _LIMA_L2_CACHE_ENABLE_ACCESS@GOTPAGE
Lloh20:
	ldr	x9, [x9, _LIMA_L2_CACHE_ENABLE_ACCESS@GOTPAGEOFF]
Lloh21:
	ldr	w0, [x8]
Lloh22:
	ldr	w8, [x9]
Lloh23:
	adrp	x9, _LIMA_L2_CACHE_ENABLE_READ_ALLOCATE@GOTPAGE
Lloh24:
	ldr	x9, [x9, _LIMA_L2_CACHE_ENABLE_READ_ALLOCATE@GOTPAGEOFF]
Lloh25:
	ldr	w9, [x9]
	orr	w1, w9, w8
	bl	_l2_cache_write
Lloh26:
	adrp	x8, _LIMA_L2_CACHE_MAX_READS@GOTPAGE
Lloh27:
	ldr	x8, [x8, _LIMA_L2_CACHE_MAX_READS@GOTPAGEOFF]
Lloh28:
	ldr	w0, [x8]
	mov	w1, #28
	bl	_l2_cache_write
	mov	w0, #0
LBB0_8:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh21
	.cfi_endproc
                                        ; -- End function
	.comm	_lima_ip_l2_cache2,8,3          ; @lima_ip_l2_cache2
	.comm	_lima_ip_pp4,4,2                ; @lima_ip_pp4
	.comm	_lima_ip_pp7,4,2                ; @lima_ip_pp7
	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_LIMA_L2_CACHE_SIZE,4,2         ; @LIMA_L2_CACHE_SIZE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"l2 cache %uK, %u-way, %ubyte cache line, %ubit external bus\n"

	.comm	_LIMA_L2_CACHE_ENABLE,4,2       ; @LIMA_L2_CACHE_ENABLE
	.comm	_LIMA_L2_CACHE_ENABLE_ACCESS,4,2 ; @LIMA_L2_CACHE_ENABLE_ACCESS
	.comm	_LIMA_L2_CACHE_ENABLE_READ_ALLOCATE,4,2 ; @LIMA_L2_CACHE_ENABLE_READ_ALLOCATE
	.comm	_LIMA_L2_CACHE_MAX_READS,4,2    ; @LIMA_L2_CACHE_MAX_READS
.subsections_via_symbols
