	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function vega12_smu_init
_vega12_smu_init:                       ## @vega12_smu_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	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movq	$0, -48(%rbp)
	movl	16(%rdi), %edi
	movq	_CGS_UCODE_ID_SMU@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-48(%rbp), %rdx
	callq	_cgs_get_firmware_info
	testl	%eax, %eax
	jne	LBB0_18
## %bb.1:
	cmpl	$0, -48(%rbp)
	je	LBB0_18
## %bb.2:
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$8, %edi
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_3
## %bb.4:
	movq	%rax, %r14
	movq	%rax, (%rbx)
	movq	8(%rbx), %rdi
	movq	_PAGE_SIZE@GOTPCREL(%rip), %r13
	movl	(%r13), %edx
	movq	_AMDGPU_GEM_DOMAIN_VRAM@GOTPCREL(%rip), %r12
	movl	(%r12), %ecx
	movq	(%rax), %rax
	movq	_TABLE_PPTABLE@GOTPCREL(%rip), %r15
	movq	(%r15), %rsi
	leaq	(%rsi,%rsi,2), %rsi
	leaq	20(%rax,%rsi,8), %r8
	leaq	16(%rax,%rsi,8), %r9
	leaq	(%rax,%rsi,8), %rax
	addq	$8, %rax
	movq	%rax, (%rsp)
	movl	$4, %esi
	callq	_amdgpu_bo_create_kernel
	testl	%eax, %eax
	jne	LBB0_17
## %bb.5:
	movq	(%r14), %rax
	movq	(%r15), %rcx
	leaq	(%rcx,%rcx,2), %rcx
	movabsq	$17179869185, %rdx              ## imm = 0x400000001
	movq	%rdx, (%rax,%rcx,8)
	movq	8(%rbx), %rdi
	movl	(%r13), %edx
	movq	_TABLE_WATERMARKS@GOTPCREL(%rip), %r13
	movq	(%r13), %rcx
	leaq	(%rcx,%rcx,2), %rcx
	leaq	20(%rax,%rcx,8), %r8
	leaq	16(%rax,%rcx,8), %r9
	leaq	8(%rax,%rcx,8), %rax
	movl	(%r12), %ecx
	movq	%rax, (%rsp)
	movl	$4, %esi
	callq	_amdgpu_bo_create_kernel
	testl	%eax, %eax
	jne	LBB0_16
## %bb.6:
	movq	(%r14), %rax
	movq	(%r13), %rcx
	leaq	(%rcx,%rcx,2), %rcx
	movabsq	$17179869185, %rdx              ## imm = 0x400000001
	movq	%rdx, (%rax,%rcx,8)
	movq	8(%rbx), %rdi
	movq	_PAGE_SIZE@GOTPCREL(%rip), %r15
	movl	(%r15), %edx
	movq	_TABLE_PMSTATUSLOG@GOTPCREL(%rip), %r13
	movq	(%r13), %rcx
	leaq	(%rcx,%rcx,2), %rcx
	leaq	20(%rax,%rcx,8), %r8
	leaq	16(%rax,%rcx,8), %r9
	leaq	8(%rax,%rcx,8), %rax
	movl	(%r12), %ecx
	movq	%rax, (%rsp)
	movl	$102400, %esi                   ## imm = 0x19000
	callq	_amdgpu_bo_create_kernel
	testl	%eax, %eax
	jne	LBB0_15
## %bb.7:
	movq	(%r14), %rax
	movq	(%r13), %rcx
	leaq	(%rcx,%rcx,2), %rcx
	movabsq	$439804651110401, %rdx          ## imm = 0x1900000000001
	movq	%rdx, (%rax,%rcx,8)
	movq	8(%rbx), %rdi
	movl	(%r15), %edx
	movl	(%r12), %ecx
	movq	_TABLE_AVFS_FUSE_OVERRIDE@GOTPCREL(%rip), %r15
	movq	(%r15), %rsi
	leaq	(%rsi,%rsi,2), %rsi
	leaq	20(%rax,%rsi,8), %r8
	leaq	16(%rax,%rsi,8), %r9
	leaq	(%rax,%rsi,8), %rax
	addq	$8, %rax
	movq	%rax, (%rsp)
	movl	$4, %esi
	callq	_amdgpu_bo_create_kernel
	testl	%eax, %eax
	jne	LBB0_13
## %bb.8:
	movq	(%r14), %rax
	movq	(%r15), %rcx
	leaq	(%rcx,%rcx,2), %rcx
	movabsq	$17179869185, %r13              ## imm = 0x400000001
	movq	%r13, (%rax,%rcx,8)
	movq	8(%rbx), %rdi
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movq	_TABLE_OVERDRIVE@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	leaq	(%rcx,%rcx,2), %rcx
	leaq	20(%rax,%rcx,8), %r8
	leaq	16(%rax,%rcx,8), %r9
	leaq	8(%rax,%rcx,8), %rax
	movl	(%r12), %ecx
	movq	%rax, (%rsp)
	movl	$4, %esi
	callq	_amdgpu_bo_create_kernel
	testl	%eax, %eax
	jne	LBB0_12
## %bb.9:
	movq	(%r14), %rax
	movq	_TABLE_OVERDRIVE@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	leaq	(%rcx,%rcx,2), %rcx
	movq	%r13, (%rax,%rcx,8)
	movq	8(%rbx), %rdi
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movl	(%r12), %ecx
	movq	_TABLE_SMU_METRICS@GOTPCREL(%rip), %r12
	movq	(%r12), %rsi
	leaq	(%rsi,%rsi,2), %rsi
	leaq	20(%rax,%rsi,8), %r8
	leaq	16(%rax,%rsi,8), %r9
	leaq	(%rax,%rsi,8), %rax
	addq	$8, %rax
	movq	%rax, (%rsp)
	movl	$4, %esi
	callq	_amdgpu_bo_create_kernel
	movq	(%r14), %rcx
	testl	%eax, %eax
	je	LBB0_10
## %bb.11:
	movq	_TABLE_OVERDRIVE@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	leaq	(%rax,%rax,2), %rax
	leaq	(%rcx,%rax,8), %rdi
	addq	$20, %rdi
	leaq	(%rcx,%rax,8), %rsi
	addq	$16, %rsi
	leaq	(%rcx,%rax,8), %rdx
	addq	$8, %rdx
	callq	_amdgpu_bo_free_kernel
LBB0_12:
	movq	(%r14), %rax
	movq	(%r15), %rcx
	leaq	(%rcx,%rcx,2), %rcx
	leaq	(%rax,%rcx,8), %rdi
	addq	$20, %rdi
	leaq	(%rax,%rcx,8), %rsi
	addq	$16, %rsi
	leaq	(%rax,%rcx,8), %rdx
	addq	$8, %rdx
	callq	_amdgpu_bo_free_kernel
	movq	_TABLE_PMSTATUSLOG@GOTPCREL(%rip), %r13
LBB0_13:
	movq	(%r14), %rax
	movq	(%r13), %rcx
	leaq	(%rcx,%rcx,2), %rcx
	cmpq	$0, 8(%rax,%rcx,8)
	je	LBB0_15
## %bb.14:
	leaq	(%rax,%rcx,8), %rdx
	addq	$8, %rdx
	leaq	(%rax,%rcx,8), %rdi
	addq	$20, %rdi
	leaq	(%rax,%rcx,8), %rsi
	addq	$16, %rsi
	callq	_amdgpu_bo_free_kernel
LBB0_15:
	movq	(%r14), %rax
	movq	_TABLE_WATERMARKS@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	leaq	(%rcx,%rcx,2), %rcx
	leaq	(%rax,%rcx,8), %rdi
	addq	$20, %rdi
	leaq	(%rax,%rcx,8), %rsi
	addq	$16, %rsi
	leaq	(%rax,%rcx,8), %rdx
	addq	$8, %rdx
	callq	_amdgpu_bo_free_kernel
	movq	_TABLE_PPTABLE@GOTPCREL(%rip), %r15
LBB0_16:
	movq	(%r14), %rax
	movq	(%r15), %rcx
	leaq	(%rcx,%rcx,2), %rcx
	leaq	(%rax,%rcx,8), %rdi
	addq	$20, %rdi
	leaq	(%rax,%rcx,8), %rsi
	addq	$16, %rsi
	leaq	(%rax,%rcx,8), %rdx
	addq	$8, %rdx
	callq	_amdgpu_bo_free_kernel
LBB0_17:
	movq	(%rbx), %rdi
	callq	_kfree
LBB0_18:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
LBB0_19:
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_20:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_3:
	movq	_ENOMEM@GOTPCREL(%rip), %rcx
	jmp	LBB0_19
LBB0_10:
	movq	(%r12), %rax
	leaq	(%rax,%rax,2), %rax
	movq	%r13, (%rcx,%rax,8)
	xorl	%eax, %eax
	jmp	LBB0_20
	.cfi_endproc
                                        ## -- End function
	.comm	_CGS_UCODE_ID_SMU,4,2           ## @CGS_UCODE_ID_SMU
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_PAGE_SIZE,4,2                  ## @PAGE_SIZE
	.comm	_AMDGPU_GEM_DOMAIN_VRAM,4,2     ## @AMDGPU_GEM_DOMAIN_VRAM
	.comm	_TABLE_PPTABLE,8,3              ## @TABLE_PPTABLE
	.comm	_TABLE_WATERMARKS,8,3           ## @TABLE_WATERMARKS
	.comm	_TABLE_PMSTATUSLOG,8,3          ## @TABLE_PMSTATUSLOG
	.comm	_TABLE_AVFS_FUSE_OVERRIDE,8,3   ## @TABLE_AVFS_FUSE_OVERRIDE
	.comm	_TABLE_OVERDRIVE,8,3            ## @TABLE_OVERDRIVE
	.comm	_TABLE_SMU_METRICS,8,3          ## @TABLE_SMU_METRICS
	.no_dead_strip	_vega12_smu_init
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal8,8byte_literals
	.p2align	3                               ; -- Begin function vega12_smu_init
lCPI0_0:
	.long	1                               ; 0x1
	.long	4                               ; 0x4
lCPI0_1:
	.long	1                               ; 0x1
	.long	102400                          ; 0x19000
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	2
_vega12_smu_init:                       ; @vega12_smu_init
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	d9, d8, [sp, #16]               ; 16-byte Folded Spill
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	.cfi_offset b8, -104
	.cfi_offset b9, -112
	mov	x19, x0
	str	xzr, [sp, #8]
	ldr	w0, [x0, #16]
Lloh0:
	adrp	x8, _CGS_UCODE_ID_SMU@GOTPAGE
Lloh1:
	ldr	x8, [x8, _CGS_UCODE_ID_SMU@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	add	x2, sp, #8
	bl	_cgs_get_firmware_info
	ldr	w8, [sp, #8]
	cmp	w0, #0
	ccmp	w8, #0, #4, eq
	b.eq	LBB0_15
; %bb.1:
Lloh3:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	mov	w0, #8
	bl	_kzalloc
	cbz	x0, LBB0_18
; %bb.2:
	mov	x20, x0
	str	x0, [x19]
	ldr	x0, [x19, #8]
Lloh6:
	adrp	x24, _PAGE_SIZE@GOTPAGE
Lloh7:
	ldr	x24, [x24, _PAGE_SIZE@GOTPAGEOFF]
	ldr	w2, [x24]
Lloh8:
	adrp	x23, _AMDGPU_GEM_DOMAIN_VRAM@GOTPAGE
Lloh9:
	ldr	x23, [x23, _AMDGPU_GEM_DOMAIN_VRAM@GOTPAGEOFF]
	ldr	w3, [x23]
	ldr	x8, [x20]
Lloh10:
	adrp	x21, _TABLE_PPTABLE@GOTPAGE
Lloh11:
	ldr	x21, [x21, _TABLE_PPTABLE@GOTPAGEOFF]
	ldr	x9, [x21]
	mov	w10, #24
	madd	x8, x9, x10, x8
	add	x4, x8, #20
	add	x5, x8, #16
	add	x6, x8, #8
	mov	w1, #4
	bl	_amdgpu_bo_create_kernel
	cbnz	w0, LBB0_14
; %bb.3:
	ldr	x8, [x20]
	ldr	x9, [x21]
	mov	w10, #24
	mul	x9, x9, x10
Lloh12:
	adrp	x11, lCPI0_0@PAGE
Lloh13:
	ldr	d8, [x11, lCPI0_0@PAGEOFF]
	str	d8, [x8, x9]
	ldr	x0, [x19, #8]
	ldr	w2, [x24]
Lloh14:
	adrp	x22, _TABLE_WATERMARKS@GOTPAGE
Lloh15:
	ldr	x22, [x22, _TABLE_WATERMARKS@GOTPAGEOFF]
	ldr	w3, [x23]
	ldr	x9, [x22]
	madd	x8, x9, x10, x8
	add	x4, x8, #20
	add	x5, x8, #16
	add	x6, x8, #8
	mov	w1, #4
	bl	_amdgpu_bo_create_kernel
	cbnz	w0, LBB0_13
; %bb.4:
	ldr	x8, [x20]
	ldr	x9, [x22]
	mov	w10, #24
	mul	x9, x9, x10
	str	d8, [x8, x9]
	ldr	x0, [x19, #8]
	ldr	w2, [x24]
Lloh16:
	adrp	x25, _TABLE_PMSTATUSLOG@GOTPAGE
Lloh17:
	ldr	x25, [x25, _TABLE_PMSTATUSLOG@GOTPAGEOFF]
	ldr	w3, [x23]
	ldr	x9, [x25]
	madd	x8, x9, x10, x8
	add	x4, x8, #20
	add	x5, x8, #16
	add	x6, x8, #8
	mov	w1, #36864
	movk	w1, #1, lsl #16
	bl	_amdgpu_bo_create_kernel
	cbnz	w0, LBB0_12
; %bb.5:
	ldr	x8, [x20]
	ldr	x9, [x25]
	mov	w10, #24
	mul	x9, x9, x10
Lloh18:
	adrp	x11, lCPI0_1@PAGE
Lloh19:
	ldr	d0, [x11, lCPI0_1@PAGEOFF]
	str	d0, [x8, x9]
	ldr	x0, [x19, #8]
	ldr	w2, [x24]
Lloh20:
	adrp	x26, _TABLE_AVFS_FUSE_OVERRIDE@GOTPAGE
Lloh21:
	ldr	x26, [x26, _TABLE_AVFS_FUSE_OVERRIDE@GOTPAGEOFF]
	ldr	w3, [x23]
	ldr	x9, [x26]
	madd	x8, x9, x10, x8
	add	x4, x8, #20
	add	x5, x8, #16
	add	x6, x8, #8
	mov	w1, #4
	bl	_amdgpu_bo_create_kernel
	cbnz	w0, LBB0_10
; %bb.6:
	ldr	x8, [x20]
	ldr	x9, [x26]
	mov	w10, #24
	mul	x9, x9, x10
	str	d8, [x8, x9]
	ldr	x0, [x19, #8]
	ldr	w2, [x24]
Lloh22:
	adrp	x27, _TABLE_OVERDRIVE@GOTPAGE
Lloh23:
	ldr	x27, [x27, _TABLE_OVERDRIVE@GOTPAGEOFF]
	ldr	w3, [x23]
	ldr	x9, [x27]
	madd	x8, x9, x10, x8
	add	x4, x8, #20
	add	x5, x8, #16
	add	x6, x8, #8
	mov	w1, #4
	bl	_amdgpu_bo_create_kernel
	cbnz	w0, LBB0_9
; %bb.7:
	ldr	x8, [x20]
	ldr	x9, [x27]
	mov	w10, #24
	mul	x9, x9, x10
	str	d8, [x8, x9]
	ldr	x0, [x19, #8]
	ldr	w2, [x24]
Lloh24:
	adrp	x24, _TABLE_SMU_METRICS@GOTPAGE
Lloh25:
	ldr	x24, [x24, _TABLE_SMU_METRICS@GOTPAGEOFF]
	ldr	w3, [x23]
	ldr	x9, [x24]
	madd	x8, x9, x10, x8
	add	x4, x8, #20
	add	x5, x8, #16
	add	x6, x8, #8
	mov	w1, #4
	bl	_amdgpu_bo_create_kernel
	ldr	x8, [x20]
	cbz	w0, LBB0_19
; %bb.8:
	ldr	x9, [x27]
	mov	w10, #24
	madd	x8, x9, x10, x8
	add	x0, x8, #20
	add	x1, x8, #16
	add	x2, x8, #8
	bl	_amdgpu_bo_free_kernel
LBB0_9:
	ldr	x8, [x20]
	ldr	x9, [x26]
	mov	w10, #24
	madd	x8, x9, x10, x8
	add	x0, x8, #20
	add	x1, x8, #16
	add	x2, x8, #8
	bl	_amdgpu_bo_free_kernel
LBB0_10:
	ldr	x8, [x20]
	ldr	x9, [x25]
	mov	w10, #24
	madd	x2, x9, x10, x8
	ldr	x10, [x2, #8]!
	cbz	x10, LBB0_12
; %bb.11:
	mov	w10, #24
	madd	x8, x9, x10, x8
	add	x0, x8, #20
	add	x1, x8, #16
	bl	_amdgpu_bo_free_kernel
LBB0_12:
	ldr	x8, [x20]
	ldr	x9, [x22]
	mov	w10, #24
	madd	x8, x9, x10, x8
	add	x0, x8, #20
	add	x1, x8, #16
	add	x2, x8, #8
	bl	_amdgpu_bo_free_kernel
LBB0_13:
	ldr	x8, [x20]
	ldr	x9, [x21]
	mov	w10, #24
	madd	x8, x9, x10, x8
	add	x0, x8, #20
	add	x1, x8, #16
	add	x2, x8, #8
	bl	_amdgpu_bo_free_kernel
LBB0_14:
	ldr	x0, [x19]
	bl	_kfree
LBB0_15:
Lloh26:
	adrp	x8, _EINVAL@GOTPAGE
Lloh27:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_16:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_17:
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	ldp	d9, d8, [sp, #16]               ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
LBB0_18:
Lloh28:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh29:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
	b	LBB0_16
LBB0_19:
	ldr	x9, [x24]
	mov	w10, #24
	mul	x9, x9, x10
	str	d8, [x8, x9]
	b	LBB0_17
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdr	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdr	Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh24, Lloh25
	.loh AdrpLdrGot	Lloh26, Lloh27
	.loh AdrpLdrGot	Lloh28, Lloh29
	.cfi_endproc
                                        ; -- End function
	.comm	_CGS_UCODE_ID_SMU,4,2           ; @CGS_UCODE_ID_SMU
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_PAGE_SIZE,4,2                  ; @PAGE_SIZE
	.comm	_AMDGPU_GEM_DOMAIN_VRAM,4,2     ; @AMDGPU_GEM_DOMAIN_VRAM
	.comm	_TABLE_PPTABLE,8,3              ; @TABLE_PPTABLE
	.comm	_TABLE_WATERMARKS,8,3           ; @TABLE_WATERMARKS
	.comm	_TABLE_PMSTATUSLOG,8,3          ; @TABLE_PMSTATUSLOG
	.comm	_TABLE_AVFS_FUSE_OVERRIDE,8,3   ; @TABLE_AVFS_FUSE_OVERRIDE
	.comm	_TABLE_OVERDRIVE,8,3            ; @TABLE_OVERDRIVE
	.comm	_TABLE_SMU_METRICS,8,3          ; @TABLE_SMU_METRICS
	.no_dead_strip	_vega12_smu_init
.subsections_via_symbols
