	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ci_thermal_setup_fan_table
_ci_thermal_setup_fan_table:            ## @ci_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, %r13
	callq	_ci_get_pi
	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)
	cmpl	$0, 4(%rax)
	je	LBB0_4
## %bb.1:
	movq	%rax, %rbx
	movq	_CG_FDO_CTRL1@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_RREG32_SMC
	movl	%eax, %r15d
	movq	_FMAX_DUTY100_MASK@GOTPCREL(%rip), %rax
	andl	(%rax), %r15d
	movq	_FMAX_DUTY100_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	sarl	%cl, %r15d
	testl	%r15d, %r15d
	je	LBB0_4
## %bb.2:
	movl	4(%r13), %r12d
	imull	%r15d, %r12d
	movl	%r12d, %edi
	movl	$10000, %esi                    ## imm = 0x2710
	callq	_do_div
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	movl	8(%r13), %ebx
	movl	12(%r13), %r8d
	movl	16(%r13), %edi
	subl	%ebx, %edi
	subl	%r8d, %ebx
	movl	20(%r13), %eax
	movl	24(%r13), %esi
	subl	%eax, %esi
	subl	4(%r13), %eax
	movl	%r15d, %ecx
	shll	$4, %ecx
	imull	%ecx, %eax
	cltd
	idivl	%ebx
	addl	$50, %eax
	cltq
	imulq	$1374389535, %rax, %rbx         ## imm = 0x51EB851F
	movq	%rbx, %rax
	shrq	$63, %rax
	shrq	$32, %rbx
	sarl	$5, %ebx
	addl	%eax, %ebx
	imull	%esi, %ecx
	movl	%ecx, %eax
	cltd
	idivl	%edi
	addl	$50, %eax
	cltq
	imulq	$1374389535, %rax, %r14         ## imm = 0x51EB851F
	movq	%r14, %rax
	shrq	$63, %rax
	shrq	$32, %r14
	sarl	$5, %r14d
	addl	%eax, %r14d
	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	8(%r13), %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	28(%r13), %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	%ebx, %edi
	callq	_cpu_to_be16
	movq	%rax, -88(%rbp)
	movl	%r14d, %edi
	callq	_cpu_to_be16
	movq	%rax, -96(%rbp)
	movl	%r12d, %edi
	callq	_cpu_to_be16
	movq	%rax, -104(%rbp)
	movl	32(%r13), %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	%r13, %rdi
	callq	_radeon_get_xclk
	imull	36(%r13), %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	%r15d, %edi
	callq	_cpu_to_be16
	movq	%rax, -152(%rbp)
	movq	_CG_MULT_THERMAL_CTRL@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_RREG32_SMC
	movq	_TEMP_SEL_MASK@GOTPCREL(%rip), %rcx
	andl	(%rcx), %eax
	movq	_TEMP_SEL_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	sarl	%cl, %eax
	cltq
	movq	%rax, -160(%rbp)
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %r8d
	movl	4(%rax), %esi
	leaq	-160(%rbp), %rdx
	movq	%r13, %rdi
	movl	$112, %ecx
	callq	_ci_copy_bytes_to_smc
	testl	%eax, %eax
	je	LBB0_5
## %bb.3:
	leaq	L_.str(%rip), %rdi
	callq	_DRM_ERROR
LBB0_4:
	movl	$0, (%r13)
LBB0_5:
	xorl	%eax, %eax
	addq	$120, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_FDO_MODE_HARDWARE,4,2          ## @FDO_MODE_HARDWARE
	.comm	_CG_FDO_CTRL1,4,2               ## @CG_FDO_CTRL1
	.comm	_FMAX_DUTY100_MASK,4,2          ## @FMAX_DUTY100_MASK
	.comm	_FMAX_DUTY100_SHIFT,4,2         ## @FMAX_DUTY100_SHIFT
	.comm	_CG_MULT_THERMAL_CTRL,4,2       ## @CG_MULT_THERMAL_CTRL
	.comm	_TEMP_SEL_MASK,4,2              ## @TEMP_SEL_MASK
	.comm	_TEMP_SEL_SHIFT,4,2             ## @TEMP_SEL_SHIFT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed to load fan table to the SMC."

	.no_dead_strip	_ci_thermal_setup_fan_table
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ci_thermal_setup_fan_table
_ci_thermal_setup_fan_table:            ; @ci_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
	bl	_ci_get_pi
	movi.2d	v0, #0000000000000000
	stp	q0, q0, [sp, #80]
	stp	q0, q0, [sp, #48]
	stp	q0, q0, [sp, #16]
	ldr	w8, [x0, #4]
	cbz	w8, LBB0_4
; %bb.1:
	mov	x20, x0
Lloh0:
	adrp	x8, _CG_FDO_CTRL1@GOTPAGE
Lloh1:
	ldr	x8, [x8, _CG_FDO_CTRL1@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	bl	_RREG32_SMC
Lloh3:
	adrp	x8, _FMAX_DUTY100_MASK@GOTPAGE
Lloh4:
	ldr	x8, [x8, _FMAX_DUTY100_MASK@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	and	w8, w8, w0
Lloh6:
	adrp	x9, _FMAX_DUTY100_SHIFT@GOTPAGE
Lloh7:
	ldr	x9, [x9, _FMAX_DUTY100_SHIFT@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	asr	w21, w8, w9
	cbz	w21, LBB0_4
; %bb.2:
	ldr	w8, [x19, #4]
	mul	w22, w8, w21
	mov	x0, x22
	mov	w1, #10000
	bl	_do_div
	ldp	w8, w9, [x19, #12]
	ldp	w11, w10, [x19, #4]
	sub	w12, w10, w8
	sub	w9, w9, w10
	ldp	w10, w13, [x19, #20]
	sub	w11, w10, w11
	sub	w10, w13, w10
	lsl	w13, w21, #4
	mul	w11, w11, w13
	sdiv	w11, w11, w12
	add	w11, w11, #50
	mov	w25, #34079
	movk	w25, #20971, lsl #16
	smull	x11, w11, w25
	lsr	x12, x11, #32
	lsr	x11, x11, #63
	add	w23, w11, w12, asr #5
	mul	w10, w10, w13
	sdiv	w9, w10, w9
	add	w9, w9, #50
	smull	x9, w9, w25
	lsr	x10, x9, #32
	lsr	x9, x9, #63
	add	w24, w9, w10, asr #5
	add	w8, w8, #50
	smull	x8, w8, w25
	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, #8]
	add	w8, w8, #50
	smull	x8, w8, w25
	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, #28]
	add	w8, w8, #50
	smull	x8, w8, w25
	lsr	x9, x8, #32
	lsr	x8, x8, #63
	add	w0, w8, w9, asr #5
	bl	_cpu_to_be16
	str	x0, [sp, #80]
	mov	x0, x23
	bl	_cpu_to_be16
	str	x0, [sp, #72]
	mov	x0, x24
	bl	_cpu_to_be16
	str	x0, [sp, #64]
	mov	x0, x22
	bl	_cpu_to_be16
	str	x0, [sp, #56]
	ldr	w0, [x19, #32]
	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]
	mov	x0, x19
	bl	_radeon_get_xclk
	ldr	w8, [x19, #36]
	mul	w8, w8, w0
	smull	x8, w8, w25
	lsr	x9, x8, #32
	lsr	x8, x8, #63
	add	w0, w8, w9, asr #9
	bl	_cpu_to_be32
	str	w0, [sp, #16]
	mov	x0, x21
	bl	_cpu_to_be16
	str	x0, [sp, #8]
Lloh9:
	adrp	x8, _CG_MULT_THERMAL_CTRL@GOTPAGE
Lloh10:
	ldr	x8, [x8, _CG_MULT_THERMAL_CTRL@GOTPAGEOFF]
Lloh11:
	ldr	w0, [x8]
	bl	_RREG32_SMC
Lloh12:
	adrp	x8, _TEMP_SEL_MASK@GOTPAGE
Lloh13:
	ldr	x8, [x8, _TEMP_SEL_MASK@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	and	w8, w8, w0
Lloh15:
	adrp	x9, _TEMP_SEL_SHIFT@GOTPAGE
Lloh16:
	ldr	x9, [x9, _TEMP_SEL_SHIFT@GOTPAGEOFF]
Lloh17:
	ldr	w9, [x9]
	asr	w8, w8, w9
	sxtw	x8, w8
	str	x8, [sp]
	ldp	w4, w1, [x20]
	mov	x2, sp
	mov	x0, x19
	mov	w3, #112
	bl	_ci_copy_bytes_to_smc
	cbz	w0, LBB0_5
; %bb.3:
Lloh18:
	adrp	x0, l_.str@PAGE
Lloh19:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DRM_ERROR
LBB0_4:
	str	wzr, [x19]
LBB0_5:
	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
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.comm	_FDO_MODE_HARDWARE,4,2          ; @FDO_MODE_HARDWARE
	.comm	_CG_FDO_CTRL1,4,2               ; @CG_FDO_CTRL1
	.comm	_FMAX_DUTY100_MASK,4,2          ; @FMAX_DUTY100_MASK
	.comm	_FMAX_DUTY100_SHIFT,4,2         ; @FMAX_DUTY100_SHIFT
	.comm	_CG_MULT_THERMAL_CTRL,4,2       ; @CG_MULT_THERMAL_CTRL
	.comm	_TEMP_SEL_MASK,4,2              ; @TEMP_SEL_MASK
	.comm	_TEMP_SEL_SHIFT,4,2             ; @TEMP_SEL_SHIFT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed to load fan table to the SMC."

	.no_dead_strip	_ci_thermal_setup_fan_table
.subsections_via_symbols
