	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_smu7_upload_smu_firmware_image ## -- Begin function smu7_upload_smu_firmware_image
	.p2align	4, 0x90
_smu7_upload_smu_firmware_image:        ## @smu7_upload_smu_firmware_image
	.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
	subq	$32, %rsp
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %rbx
	movq	16(%rdi), %rax
	xorps	%xmm0, %xmm0
	movaps	%xmm0, -48(%rbp)
	movq	$0, -32(%rbp)
	cmpl	$1, (%rax)
	movl	8(%rdi), %r14d
	jne	LBB0_1
## %bb.2:
	movq	_UCODE_ID_SMU@GOTPCREL(%rip), %rax
	jmp	LBB0_3
LBB0_1:
	movq	_UCODE_ID_SMU_SK@GOTPCREL(%rip), %rax
LBB0_3:
	movl	(%rax), %edi
	callq	_smu7_convert_fw_type_to_cgs
	leaq	-48(%rbp), %rdx
	movl	%r14d, %edi
	movl	%eax, %esi
	callq	_cgs_get_firmware_info
	movl	-32(%rbp), %eax
	movl	%eax, 4(%rbx)
	movl	-36(%rbp), %eax
	movl	%eax, (%rbx)
	movl	-40(%rbp), %esi
	movq	-48(%rbp), %rdx
	movq	_SMU7_SMC_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%rbx, %rdi
	callq	_smu7_upload_smc_firmware_data
	addq	$32, %rsp
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_UCODE_ID_SMU,4,2               ## @UCODE_ID_SMU
	.comm	_UCODE_ID_SMU_SK,4,2            ## @UCODE_ID_SMU_SK
	.comm	_SMU7_SMC_SIZE,4,2              ## @SMU7_SMC_SIZE
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_smu7_upload_smu_firmware_image ; -- Begin function smu7_upload_smu_firmware_image
	.p2align	2
_smu7_upload_smu_firmware_image:        ; @smu7_upload_smu_firmware_image
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	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
	mov	x19, x0
	ldr	x8, [x0, #16]
	stp	xzr, xzr, [sp, #8]
	str	xzr, [sp, #24]
	ldr	w8, [x8]
Lloh0:
	adrp	x9, _UCODE_ID_SMU@GOTPAGE
Lloh1:
	ldr	x9, [x9, _UCODE_ID_SMU@GOTPAGEOFF]
	ldr	w20, [x0, #8]
Lloh2:
	adrp	x10, _UCODE_ID_SMU_SK@GOTPAGE
Lloh3:
	ldr	x10, [x10, _UCODE_ID_SMU_SK@GOTPAGEOFF]
	cmp	w8, #1
	csel	x8, x9, x10, eq
	ldr	w0, [x8]
	bl	_smu7_convert_fw_type_to_cgs
	mov	x1, x0
	add	x2, sp, #8
	mov	x0, x20
	bl	_cgs_get_firmware_info
	ldur	d0, [sp, #20]
	str	d0, [x19]
	ldr	w1, [sp, #16]
	ldr	x2, [sp, #8]
Lloh4:
	adrp	x8, _SMU7_SMC_SIZE@GOTPAGE
Lloh5:
	ldr	x8, [x8, _SMU7_SMC_SIZE@GOTPAGEOFF]
Lloh6:
	ldr	w3, [x8]
	mov	x0, x19
	bl	_smu7_upload_smc_firmware_data
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.comm	_UCODE_ID_SMU,4,2               ; @UCODE_ID_SMU
	.comm	_UCODE_ID_SMU_SK,4,2            ; @UCODE_ID_SMU_SK
	.comm	_SMU7_SMC_SIZE,4,2              ; @SMU7_SMC_SIZE
.subsections_via_symbols
