	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function gru_init_chiplet
_gru_init_chiplet:                      ## @gru_init_chiplet
	.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
	movl	%r8d, %r15d
	movl	%ecx, %r14d
	movq	%rdx, %r12
	movq	%rsi, %r13
	movq	%rdi, %rbx
	addq	$60, %rdi
	callq	_spin_lock_init
	leaq	56(%rbx), %rdi
	callq	_spin_lock_init
	movq	%r13, (%rbx)
	movq	%r12, 40(%rbx)
	movq	_GRU_CHIPLETS_PER_BLADE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	imull	%r14d, %eax
	addl	%r15d, %eax
	movl	%eax, 8(%rbx)
	movq	_gru_base@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movslq	%r14d, %rcx
	movl	(%rax,%rcx,4), %eax
	movl	%eax, 52(%rbx)
	movl	%ecx, 12(%rbx)
	movl	%r15d, 16(%rbx)
	movq	_GRU_CBR_AU@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	$-1, %rax
	movq	$-1, %rdx
	shlq	%cl, %rdx
	cmpl	$64, %ecx
	notq	%rdx
	cmoveq	%rax, %rdx
	movq	%rdx, 24(%rbx)
	movq	_GRU_DSR_AU@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	shlq	%cl, %rax
	notq	%rax
	movq	%rax, 32(%rbx)
	movq	_MAX_ASID@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 48(%rbx)
	movq	%rbx, %rdi
	callq	_gru_tgh_flush_init
	movl	8(%rbx), %ecx
	movq	_gru_max_gids@GOTPCREL(%rip), %rax
	cmpl	(%rax), %ecx
	jl	LBB0_2
## %bb.1:
	leal	1(%rcx), %edx
	movl	%edx, (%rax)
LBB0_2:
	movq	_grudev@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	(%rbx), %r9
	movq	40(%rbx), %r8
	leaq	L_.str(%rip), %rsi
	movl	%r14d, %edx
                                        ## kill: def $ecx killed $ecx killed $rcx
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_gru_dbg                        ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_GRU_CHIPLETS_PER_BLADE,4,2     ## @GRU_CHIPLETS_PER_BLADE
	.comm	_gru_base,8,3                   ## @gru_base
	.comm	_GRU_CBR_AU,4,2                 ## @GRU_CBR_AU
	.comm	_GRU_DSR_AU,8,3                 ## @GRU_DSR_AU
	.comm	_MAX_ASID,4,2                   ## @MAX_ASID
	.comm	_gru_max_gids,4,2               ## @gru_max_gids
	.comm	_grudev,4,2                     ## @grudev
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"bid %d, gid %d, vaddr %p (0x%lx)\n"

	.no_dead_strip	_gru_init_chiplet
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function gru_init_chiplet
_gru_init_chiplet:                      ; @gru_init_chiplet
	.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
	mov	x21, x4
	mov	x19, x3
	mov	x22, x2
	mov	x23, x1
	mov	x20, x0
	add	x0, x0, #60
	bl	_spin_lock_init
	add	x0, x20, #56
	bl	_spin_lock_init
	str	x23, [x20]
Lloh0:
	adrp	x8, _GRU_CHIPLETS_PER_BLADE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GRU_CHIPLETS_PER_BLADE@GOTPAGEOFF]
	str	x22, [x20, #40]
Lloh2:
	ldr	w8, [x8]
	madd	w8, w8, w19, w21
	str	w8, [x20, #8]
Lloh3:
	adrp	x8, _gru_base@GOTPAGE
Lloh4:
	ldr	x8, [x8, _gru_base@GOTPAGEOFF]
Lloh5:
	ldr	x8, [x8]
	ldr	w8, [x8, w19, sxtw #2]
Lloh6:
	adrp	x9, _GRU_CBR_AU@GOTPAGE
Lloh7:
	ldr	x9, [x9, _GRU_CBR_AU@GOTPAGEOFF]
	stp	w19, w21, [x20, #12]
Lloh8:
	ldr	w9, [x9]
	mov	x10, #-1
	lsl	x11, x10, x9
	cmp	w9, #64
	csinv	x9, x10, x11, eq
Lloh9:
	adrp	x11, _GRU_DSR_AU@GOTPAGE
Lloh10:
	ldr	x11, [x11, _GRU_DSR_AU@GOTPAGEOFF]
Lloh11:
	ldr	x11, [x11]
	lsl	x10, x10, x11
	mvn	x10, x10
	stp	x9, x10, [x20, #24]
Lloh12:
	adrp	x9, _MAX_ASID@GOTPAGE
Lloh13:
	ldr	x9, [x9, _MAX_ASID@GOTPAGEOFF]
Lloh14:
	ldr	w9, [x9]
	stp	w9, w8, [x20, #48]
	mov	x0, x20
	bl	_gru_tgh_flush_init
	ldr	w3, [x20, #8]
Lloh15:
	adrp	x8, _gru_max_gids@GOTPAGE
Lloh16:
	ldr	x8, [x8, _gru_max_gids@GOTPAGEOFF]
	ldr	w9, [x8]
	cmp	w3, w9
	b.lt	LBB0_2
; %bb.1:
	add	w9, w3, #1
	str	w9, [x8]
LBB0_2:
Lloh17:
	adrp	x8, _grudev@GOTPAGE
Lloh18:
	ldr	x8, [x8, _grudev@GOTPAGEOFF]
Lloh19:
	ldr	w0, [x8]
	ldr	x4, [x20, #40]
	ldr	x5, [x20]
Lloh20:
	adrp	x1, l_.str@PAGE
Lloh21:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x19
	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
	b	_gru_dbg
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.comm	_GRU_CHIPLETS_PER_BLADE,4,2     ; @GRU_CHIPLETS_PER_BLADE
	.comm	_gru_base,8,3                   ; @gru_base
	.comm	_GRU_CBR_AU,4,2                 ; @GRU_CBR_AU
	.comm	_GRU_DSR_AU,8,3                 ; @GRU_DSR_AU
	.comm	_MAX_ASID,4,2                   ; @MAX_ASID
	.comm	_gru_max_gids,4,2               ; @gru_max_gids
	.comm	_grudev,4,2                     ; @grudev
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"bid %d, gid %d, vaddr %p (0x%lx)\n"

	.no_dead_strip	_gru_init_chiplet
.subsections_via_symbols
