	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_iceland_thermal_setup_fan_table ## -- Begin function iceland_thermal_setup_fan_table
	.p2align	4, 0x90
_iceland_thermal_setup_fan_table:       ## @iceland_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	%r13
	pushq	%r12
	pushq	%rbx
	subq	$120, %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	72(%rdi), %r14
	xorps	%xmm0, %xmm0
	movups	%xmm0, -64(%rbp)
	movups	%xmm0, -80(%rbp)
	movups	%xmm0, -96(%rbp)
	movups	%xmm0, -112(%rbp)
	movups	%xmm0, -128(%rbp)
	movups	%xmm0, -144(%rbp)
	movl	64(%rdi), %edi
	movq	_PHM_PlatformCaps_MicrocodeFanControl@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	callq	_phm_cap_enabled
	testl	%eax, %eax
	je	LBB0_6
## %bb.1:
	cmpq	$0, 48(%rbx)
	je	LBB0_3
LBB0_2:
	movl	64(%rbx), %edi
	movl	(%r15), %esi
	callq	_phm_cap_unset
LBB0_6:
	xorl	%eax, %eax
	addq	$120, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_3:
	cmpq	$0, (%r14)
	je	LBB0_2
## %bb.4:
	movl	(%rbx), %edi
	movq	_CGS_IND_REG__SMC@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_CG_FDO_CTRL1@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_FMAX_DUTY100@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	callq	_PHM_READ_VFPF_INDIRECT_FIELD
	testl	%eax, %eax
	je	LBB0_2
## %bb.5:
	movl	8(%rbx), %r15d
	imull	%eax, %r15d
	movl	%r15d, %edi
	movl	$10000, %esi                    ## imm = 0x2710
	movl	%eax, %r13d
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	callq	_do_div
	movl	12(%rbx), %esi
	movl	16(%rbx), %r8d
	movl	20(%rbx), %r9d
	subl	%esi, %r9d
	subl	%r8d, %esi
	movl	24(%rbx), %eax
	movl	28(%rbx), %edi
	subl	%eax, %edi
	subl	8(%rbx), %eax
	movl	%r13d, %ecx
	shll	$4, %ecx
	imull	%ecx, %eax
	cltd
	idivl	%esi
	addl	$50, %eax
	cltq
	imulq	$1374389535, %rax, %r12         ## imm = 0x51EB851F
	movq	%r12, %rax
	shrq	$63, %rax
	shrq	$32, %r12
	sarl	$5, %r12d
	addl	%eax, %r12d
	imull	%edi, %ecx
	movl	%ecx, %eax
	cltd
	idivl	%r9d
	addl	$50, %eax
	cltq
	imulq	$1374389535, %rax, %r13         ## imm = 0x51EB851F
	movq	%r13, %rax
	shrq	$63, %rax
	shrq	$32, %r13
	sarl	$5, %r13d
	addl	%eax, %r13d
	addl	$50, %r8d
	movslq	%r8d, %rax
	imulq	$1374389535, %rax, %rdi         ## imm = 0x51EB851F
	movq	%rdi, %rax
	shrq	$63, %rax
	shrq	$32, %rdi
	sarl	$5, %edi
	addl	%eax, %edi
                                        ## kill: def $edi killed $edi killed $rdi
	callq	_cpu_to_be16
	movq	%rax, -64(%rbp)
	movl	12(%rbx), %eax
	addl	$50, %eax
	cltq
	imulq	$1374389535, %rax, %rdi         ## imm = 0x51EB851F
	movq	%rdi, %rax
	shrq	$63, %rax
	shrq	$32, %rdi
	sarl	$5, %edi
	addl	%eax, %edi
                                        ## kill: def $edi killed $edi killed $rdi
	callq	_cpu_to_be16
	movq	%rax, -72(%rbp)
	movl	32(%rbx), %eax
	addl	$50, %eax
	cltq
	imulq	$1374389535, %rax, %rdi         ## imm = 0x51EB851F
	movq	%rdi, %rax
	shrq	$63, %rax
	shrq	$32, %rdi
	sarl	$5, %edi
	addl	%eax, %edi
                                        ## kill: def $edi killed $edi killed $rdi
	callq	_cpu_to_be16
	movq	%rax, -80(%rbp)
	movl	%r12d, %edi
	callq	_cpu_to_be16
	movq	%rax, -88(%rbp)
	movl	%r13d, %edi
	callq	_cpu_to_be16
	movq	%rax, -96(%rbp)
	movl	%r15d, %edi
	callq	_cpu_to_be16
	movq	%rax, -104(%rbp)
	movl	36(%rbx), %edi
	callq	_cpu_to_be16
	movq	%rax, -112(%rbp)
	movl	$1, %edi
	callq	_cpu_to_be16
	movq	%rax, -120(%rbp)
	movl	$1, %edi
	callq	_cpu_to_be16
	movq	%rax, -128(%rbp)
	movl	$5, %edi
	callq	_cpu_to_be16
	movq	%rax, -136(%rbp)
	movq	56(%rbx), %rdi
	callq	_amdgpu_asic_get_xclk
	imull	40(%rbx), %eax
	cltq
	imulq	$1374389535, %rax, %rdi         ## imm = 0x51EB851F
	movq	%rdi, %rax
	shrq	$63, %rax
	shrq	$32, %rdi
	sarl	$9, %edi
	addl	%eax, %edi
                                        ## kill: def $edi killed $edi killed $rdi
	callq	_cpu_to_be32
	movl	%eax, -144(%rbp)
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	callq	_cpu_to_be16
	movq	%rax, -152(%rbp)
	movl	(%rbx), %edi
	movq	_CGS_IND_REG__SMC@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_CG_MULT_THERMAL_CTRL@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_TEMP_SEL@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	callq	_PHM_READ_VFPF_INDIRECT_FIELD
	cltq
	movq	%rax, -160(%rbp)
	movq	(%r14), %rsi
	movq	_SMC_RAM_END@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	leaq	-160(%rbp), %rdx
	movq	%rbx, %rdi
	movl	$112, %ecx
	callq	_smu7_copy_bytes_to_smc
	jmp	LBB0_6
	.cfi_endproc
                                        ## -- End function
	.comm	_FDO_MODE_HARDWARE,4,2          ## @FDO_MODE_HARDWARE
	.comm	_PHM_PlatformCaps_MicrocodeFanControl,4,2 ## @PHM_PlatformCaps_MicrocodeFanControl
	.comm	_CGS_IND_REG__SMC,4,2           ## @CGS_IND_REG__SMC
	.comm	_CG_FDO_CTRL1,4,2               ## @CG_FDO_CTRL1
	.comm	_FMAX_DUTY100,4,2               ## @FMAX_DUTY100
	.comm	_CG_MULT_THERMAL_CTRL,4,2       ## @CG_MULT_THERMAL_CTRL
	.comm	_TEMP_SEL,4,2                   ## @TEMP_SEL
	.comm	_SMC_RAM_END,4,2                ## @SMC_RAM_END
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_iceland_thermal_setup_fan_table ; -- Begin function iceland_thermal_setup_fan_table
	.p2align	2
_iceland_thermal_setup_fan_table:       ; @iceland_thermal_setup_fan_table
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #192
	.cfi_def_cfa_offset 192
	stp	x26, x25, [sp, #112]            ; 16-byte Folded Spill
	stp	x24, x23, [sp, #128]            ; 16-byte Folded Spill
	stp	x22, x21, [sp, #144]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #160]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #176]            ; 16-byte Folded Spill
	add	x29, sp, #176
	.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
	mov	x19, x0
	ldr	x24, [x0, #72]
	movi.2d	v0, #0000000000000000
	stp	q0, q0, [sp, #80]
	stp	q0, q0, [sp, #48]
	stp	q0, q0, [sp, #16]
	ldr	w0, [x0, #64]
Lloh0:
	adrp	x21, _PHM_PlatformCaps_MicrocodeFanControl@GOTPAGE
Lloh1:
	ldr	x21, [x21, _PHM_PlatformCaps_MicrocodeFanControl@GOTPAGEOFF]
	ldr	w1, [x21]
	bl	_phm_cap_enabled
	cbz	w0, LBB0_3
; %bb.1:
	ldr	x8, [x19, #48]
	cbz	x8, LBB0_4
LBB0_2:
	ldr	w0, [x19, #64]
	ldr	w1, [x21]
	bl	_phm_cap_unset
LBB0_3:
	mov	w0, #0
	ldp	x29, x30, [sp, #176]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #160]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #144]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #128]            ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #112]            ; 16-byte Folded Reload
	add	sp, sp, #192
	ret
LBB0_4:
	ldr	x8, [x24]
	cbz	x8, LBB0_2
; %bb.5:
	ldr	w0, [x19]
Lloh2:
	adrp	x25, _CGS_IND_REG__SMC@GOTPAGE
Lloh3:
	ldr	x25, [x25, _CGS_IND_REG__SMC@GOTPAGEOFF]
	ldr	w1, [x25]
Lloh4:
	adrp	x8, _CG_FDO_CTRL1@GOTPAGE
Lloh5:
	ldr	x8, [x8, _CG_FDO_CTRL1@GOTPAGEOFF]
Lloh6:
	ldr	w2, [x8]
Lloh7:
	adrp	x8, _FMAX_DUTY100@GOTPAGE
Lloh8:
	ldr	x8, [x8, _FMAX_DUTY100@GOTPAGEOFF]
Lloh9:
	ldr	w3, [x8]
	bl	_PHM_READ_VFPF_INDIRECT_FIELD
	cbz	w0, LBB0_2
; %bb.6:
	mov	x20, x0
	ldr	w8, [x19, #8]
	mul	w21, w8, w0
	mov	x0, x21
	mov	w1, #10000
	bl	_do_div
	ldp	w8, w9, [x19, #16]
	ldp	w11, w10, [x19, #8]
	sub	w12, w10, w8
	sub	w9, w9, w10
	ldp	w10, w13, [x19, #24]
	sub	w11, w10, w11
	sub	w10, w13, w10
	lsl	w13, w20, #4
	mul	w11, w11, w13
	sdiv	w11, w11, w12
	add	w11, w11, #50
	mov	w26, #34079
	movk	w26, #20971, lsl #16
	smull	x11, w11, w26
	lsr	x12, x11, #32
	lsr	x11, x11, #63
	add	w22, w11, w12, asr #5
	mul	w10, w10, w13
	sdiv	w9, w10, w9
	add	w9, w9, #50
	smull	x9, w9, w26
	lsr	x10, x9, #32
	lsr	x9, x9, #63
	add	w23, w9, w10, asr #5
	add	w8, w8, #50
	smull	x8, w8, w26
	lsr	x9, x8, #32
	lsr	x8, x8, #63
	add	w0, w8, w9, asr #5
	bl	_cpu_to_be16
	str	x0, [sp, #96]
	ldr	w8, [x19, #12]
	add	w8, w8, #50
	smull	x8, w8, w26
	lsr	x9, x8, #32
	lsr	x8, x8, #63
	add	w0, w8, w9, asr #5
	bl	_cpu_to_be16
	str	x0, [sp, #88]
	ldr	w8, [x19, #32]
	add	w8, w8, #50
	smull	x8, w8, w26
	lsr	x9, x8, #32
	lsr	x8, x8, #63
	add	w0, w8, w9, asr #5
	bl	_cpu_to_be16
	str	x0, [sp, #80]
	mov	x0, x22
	bl	_cpu_to_be16
	str	x0, [sp, #72]
	mov	x0, x23
	bl	_cpu_to_be16
	str	x0, [sp, #64]
	mov	x0, x21
	bl	_cpu_to_be16
	str	x0, [sp, #56]
	ldr	w0, [x19, #36]
	bl	_cpu_to_be16
	str	x0, [sp, #48]
	mov	w0, #1
	bl	_cpu_to_be16
	str	x0, [sp, #40]
	mov	w0, #1
	bl	_cpu_to_be16
	str	x0, [sp, #32]
	mov	w0, #5
	bl	_cpu_to_be16
	str	x0, [sp, #24]
	ldr	x0, [x19, #56]
	bl	_amdgpu_asic_get_xclk
	ldr	w8, [x19, #40]
	mul	w8, w8, w0
	smull	x8, w8, w26
	lsr	x9, x8, #32
	lsr	x8, x8, #63
	add	w0, w8, w9, asr #9
	bl	_cpu_to_be32
	str	w0, [sp, #16]
	mov	x0, x20
	bl	_cpu_to_be16
	str	x0, [sp, #8]
	ldr	w0, [x19]
	ldr	w1, [x25]
Lloh10:
	adrp	x8, _CG_MULT_THERMAL_CTRL@GOTPAGE
Lloh11:
	ldr	x8, [x8, _CG_MULT_THERMAL_CTRL@GOTPAGEOFF]
Lloh12:
	ldr	w2, [x8]
Lloh13:
	adrp	x8, _TEMP_SEL@GOTPAGE
Lloh14:
	ldr	x8, [x8, _TEMP_SEL@GOTPAGEOFF]
Lloh15:
	ldr	w3, [x8]
	bl	_PHM_READ_VFPF_INDIRECT_FIELD
                                        ; kill: def $w0 killed $w0 def $x0
	sxtw	x8, w0
	str	x8, [sp]
	ldr	x1, [x24]
Lloh16:
	adrp	x8, _SMC_RAM_END@GOTPAGE
Lloh17:
	ldr	x8, [x8, _SMC_RAM_END@GOTPAGEOFF]
Lloh18:
	ldr	w4, [x8]
	mov	x2, sp
	mov	x0, x19
	mov	w3, #112
	bl	_smu7_copy_bytes_to_smc
	b	LBB0_3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_FDO_MODE_HARDWARE,4,2          ; @FDO_MODE_HARDWARE
	.comm	_PHM_PlatformCaps_MicrocodeFanControl,4,2 ; @PHM_PlatformCaps_MicrocodeFanControl
	.comm	_CGS_IND_REG__SMC,4,2           ; @CGS_IND_REG__SMC
	.comm	_CG_FDO_CTRL1,4,2               ; @CG_FDO_CTRL1
	.comm	_FMAX_DUTY100,4,2               ; @FMAX_DUTY100
	.comm	_CG_MULT_THERMAL_CTRL,4,2       ; @CG_MULT_THERMAL_CTRL
	.comm	_TEMP_SEL,4,2                   ; @TEMP_SEL
	.comm	_SMC_RAM_END,4,2                ; @SMC_RAM_END
.subsections_via_symbols
