	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_vega10_thermal_setup_fan_table ## -- Begin function vega10_thermal_setup_fan_table
	.p2align	4, 0x90
_vega10_thermal_setup_fan_table:        ## @vega10_thermal_setup_fan_table
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	88(%rdi), %r14
	movq	88(%r14), %rax
	movq	_GNLD_FAN_CONTROL@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpl	$0, (%rax,%rcx,4)
	je	LBB0_1
## %bb.2:
	movq	%rdi, %rbx
	movq	80(%rdi), %rax
	movq	%rax, 80(%r14)
	movl	72(%rdi), %eax
	movl	%eax, 72(%r14)
	movq	64(%rdi), %rax
	movq	%rax, 64(%r14)
	movq	56(%rdi), %rdx
	movq	%rdx, 56(%r14)
	movq	_PPSMC_MSG_SetFanTemperatureTarget@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
                                        ## kill: def $edx killed $edx killed $rdx
	callq	_smum_send_msg_to_smc_with_parameter
	movl	(%rbx), %eax
	movl	%eax, %ecx
	shll	$8, %ecx
	subl	%eax, %ecx
	movslq	%ecx, %rax
	imulq	$1374389535, %rax, %rax         ## imm = 0x51EB851F
	movq	%rax, %rcx
	shrq	$63, %rcx
	sarq	$37, %rax
	addl	%ecx, %eax
	movl	%eax, (%r14)
	movq	48(%rbx), %rax
	movq	%rax, 48(%r14)
	movl	40(%rbx), %eax
	movl	%eax, 40(%r14)
	movl	36(%rbx), %eax
	movl	%eax, 36(%r14)
	movups	20(%rbx), %xmm0
	movups	%xmm0, 20(%r14)
	movups	4(%rbx), %xmm0
	movups	%xmm0, 4(%r14)
	movq	_PPTABLE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	xorl	%r15d, %r15d
	movq	%rbx, %rdi
	movq	%r14, %rsi
	xorl	%ecx, %ecx
	callq	_smum_smc_table_manager
	testl	%eax, %eax
	je	LBB0_4
## %bb.3:
	movl	%eax, %ebx
	leaq	L_.str(%rip), %rdi
	callq	_pr_info
	movl	%ebx, %r15d
	jmp	LBB0_4
LBB0_1:
	xorl	%r15d, %r15d
LBB0_4:
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_GNLD_FAN_CONTROL,8,3           ## @GNLD_FAN_CONTROL
	.comm	_PPSMC_MSG_SetFanTemperatureTarget,4,2 ## @PPSMC_MSG_SetFanTemperatureTarget
	.comm	_PPTABLE,4,2                    ## @PPTABLE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed to update Fan Control Table in PPTable!"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_vega10_thermal_setup_fan_table ; -- Begin function vega10_thermal_setup_fan_table
	.p2align	2
_vega10_thermal_setup_fan_table:        ; @vega10_thermal_setup_fan_table
	.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
	ldr	x20, [x0, #88]
	ldr	x8, [x20, #88]
Lloh0:
	adrp	x9, _GNLD_FAN_CONTROL@GOTPAGE
Lloh1:
	ldr	x9, [x9, _GNLD_FAN_CONTROL@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	ldr	w8, [x8, x9, lsl #2]
	cbz	w8, LBB0_3
; %bb.1:
	mov	x19, x0
	ldr	x8, [x0, #80]
	str	x8, [x20, #80]
	ldr	w8, [x0, #72]
	str	w8, [x20, #72]
	ldp	x2, x8, [x0, #56]
	stp	x2, x8, [x20, #56]
Lloh3:
	adrp	x8, _PPSMC_MSG_SetFanTemperatureTarget@GOTPAGE
Lloh4:
	ldr	x8, [x8, _PPSMC_MSG_SetFanTemperatureTarget@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
                                        ; kill: def $w2 killed $w2 killed $x2
	bl	_smum_send_msg_to_smc_with_parameter
	ldr	w8, [x19]
	lsl	w9, w8, #8
	sub	w8, w9, w8
	mov	w9, #34079
	movk	w9, #20971, lsl #16
	smull	x8, w8, w9
	lsr	x9, x8, #63
	asr	x8, x8, #37
	add	w8, w8, w9
	str	w8, [x20]
	ldr	x8, [x19, #48]
	str	x8, [x20, #48]
	ldur	d0, [x19, #36]
	stur	d0, [x20, #36]
	ldur	q0, [x19, #20]
	stur	q0, [x20, #20]
	ldur	q0, [x19, #4]
	stur	q0, [x20, #4]
Lloh6:
	adrp	x8, _PPTABLE@GOTPAGE
Lloh7:
	ldr	x8, [x8, _PPTABLE@GOTPAGEOFF]
Lloh8:
	ldr	w2, [x8]
	mov	x0, x19
	mov	x1, x20
	mov	w3, #0
	bl	_smum_smc_table_manager
	mov	x19, x0
	cbz	w0, LBB0_4
; %bb.2:
Lloh9:
	adrp	x0, l_.str@PAGE
Lloh10:
	add	x0, x0, l_.str@PAGEOFF
	bl	_pr_info
	b	LBB0_4
LBB0_3:
	mov	w19, #0
LBB0_4:
	mov	x0, x19
	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 AdrpAdd	Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_GNLD_FAN_CONTROL,8,3           ; @GNLD_FAN_CONTROL
	.comm	_PPSMC_MSG_SetFanTemperatureTarget,4,2 ; @PPSMC_MSG_SetFanTemperatureTarget
	.comm	_PPTABLE,4,2                    ; @PPTABLE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed to update Fan Control Table in PPTable!"

.subsections_via_symbols
