	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function si_populate_smc_t
_si_populate_smc_t:                     ## @si_populate_smc_t
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, -56(%rbp)                 ## 8-byte Spill
	movq	%rsi, %rbx
	callq	_rv770_get_pi
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	movq	%rbx, %rdi
	callq	_si_get_ps
	movq	%rax, %r15
	movl	(%rax), %eax
	cmpl	$9, %eax
	jl	LBB0_2
## %bb.1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r12d, %r12d
	subl	(%rax), %r12d
	jmp	LBB0_10
LBB0_2:
	cmpl	$1, %eax
	jg	LBB0_4
## %bb.3:
	movl	$65535, %edi                    ## imm = 0xFFFF
	callq	_CG_R
	movl	%eax, %ebx
	xorl	%r12d, %r12d
	xorl	%edi, %edi
	callq	_CG_L
	orl	%eax, %ebx
	movl	%ebx, %edi
	callq	_cpu_to_be32
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	movq	(%rcx), %rcx
	movq	%rax, (%rcx)
	jmp	LBB0_10
LBB0_4:
	xorl	%r12d, %r12d
	xorl	%edi, %edi
	callq	_cpu_to_be32
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	movq	(%rcx), %rcx
	movq	%rax, (%rcx)
	cmpl	$2, (%r15)
	jl	LBB0_10
## %bb.5:
	movq	$-1, %r13
	movl	$1000, %ebx                     ## imm = 0x3E8
	movl	$100, %ecx
	movq	%r15, -80(%rbp)                 ## 8-byte Spill
	jmp	LBB0_6
	.p2align	4, 0x90
LBB0_8:                                 ##   in Loop: Header=BB0_6 Depth=1
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	movq	(%rcx), %rax
	movq	%rcx, %r15
	movq	8(%rax,%r13,8), %rdi
	callq	_be32_to_cpu
	movq	_CG_R_MASK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r12d
	notl	%r12d
	andl	%eax, %r12d
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %eax
	imull	-48(%rbp), %eax
	cltq
	imulq	$1759218605, %rax, %rdi         ## imm = 0x68DB8BAD
	movq	%rdi, %rax
	shrq	$63, %rax
	sarq	$45, %rdi
	addl	%eax, %edi
                                        ## kill: def $edi killed $edi killed $rdi
	callq	_CG_R
	orl	%eax, %r12d
	movl	%r12d, %edi
	callq	_cpu_to_be32
	movq	(%r15), %rcx
	movq	%rax, 8(%rcx,%r13,8)
	movl	%ebx, -60(%rbp)                 ## 4-byte Spill
	movq	-80(%rbp), %r15                 ## 8-byte Reload
	movl	(%r15), %eax
	addl	$-2, %eax
	xorl	%ecx, %ecx
	cmpq	%rax, %r14
	sete	%cl
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax,%rcx,4), %ebx
	movl	$65535, %edi                    ## imm = 0xFFFF
	callq	_CG_R
	movl	%eax, %r12d
	imull	-44(%rbp), %ebx
	movslq	%ebx, %rax
	movl	-60(%rbp), %ebx                 ## 4-byte Reload
	imulq	$1759218605, %rax, %rdi         ## imm = 0x68DB8BAD
	movq	%rdi, %rax
	shrq	$63, %rax
	sarq	$45, %rdi
	addl	%eax, %edi
                                        ## kill: def $edi killed $edi killed $rdi
	callq	_CG_L
	orl	%eax, %r12d
	movl	%r12d, %edi
	callq	_cpu_to_be32
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	movq	(%rcx), %rcx
	movq	%rax, 16(%rcx,%r13,8)
	movslq	(%r15), %rax
	addq	$-2, %rax
	addl	$1000, %ebx                     ## imm = 0x3E8
	movl	-64(%rbp), %ecx                 ## 4-byte Reload
	addl	$100, %ecx
	movq	%r14, %r13
	cmpq	%rax, %r14
	jge	LBB0_9
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	leaq	1(%r13), %r14
	movl	$50, %eax
	xorl	%edx, %edx
	movq	_SISLANDS_MAX_HARDWARE_POWERLEVELS@GOTPCREL(%rip), %rsi
	idivl	(%rsi)
	movq	_R600_AH_DFLT@GOTPCREL(%rip), %rdx
	imull	$100, (%rdx), %esi
	movl	%ecx, -64(%rbp)                 ## 4-byte Spill
	imull	%ecx, %eax
	movq	8(%r15), %rdx
	movl	4(%rdx,%r13,4), %ecx
	movl	8(%rdx,%r13,4), %edx
	movl	%eax, %edi
	leaq	-48(%rbp), %r8
	leaq	-44(%rbp), %r9
	callq	_r600_calculate_at
	testl	%eax, %eax
	je	LBB0_8
## %bb.7:                               ##   in Loop: Header=BB0_6 Depth=1
	movq	_R600_AH_DFLT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	imull	$-50, %eax, %ecx
	addl	%ebx, %ecx
	movl	%ecx, -44(%rbp)
	imull	$50, %eax, %eax
	addl	%ebx, %eax
	movl	%eax, -48(%rbp)
	jmp	LBB0_8
LBB0_9:
	xorl	%r12d, %r12d
LBB0_10:
	movl	%r12d, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_SISLANDS_MAX_HARDWARE_POWERLEVELS,4,2 ## @SISLANDS_MAX_HARDWARE_POWERLEVELS
	.comm	_R600_AH_DFLT,4,2               ## @R600_AH_DFLT
	.comm	_CG_R_MASK,4,2                  ## @CG_R_MASK
	.no_dead_strip	_si_populate_smc_t
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function si_populate_smc_t
_si_populate_smc_t:                     ; @si_populate_smc_t
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	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
	str	x2, [sp, #16]                   ; 8-byte Folded Spill
	mov	x21, x1
	bl	_rv770_get_pi
	str	x0, [sp, #8]                    ; 8-byte Folded Spill
	mov	x0, x21
	bl	_si_get_ps
	ldr	w8, [x0]
	cmp	w8, #9
	b.lt	LBB0_2
; %bb.1:
Lloh0:
	adrp	x8, _EINVAL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_10
LBB0_2:
	cmp	w8, #1
	b.gt	LBB0_4
; %bb.3:
	mov	w0, #65535
	bl	_CG_R
	mov	x20, x0
	mov	w0, #0
	bl	_CG_L
	orr	w0, w0, w20
	bl	_cpu_to_be32
	mov	x8, x0
	mov	w0, #0
	ldr	x9, [sp, #16]                   ; 8-byte Folded Reload
	ldr	x9, [x9]
	str	x8, [x9]
	b	LBB0_10
LBB0_4:
	mov	x19, x0
	mov	w0, #0
	bl	_cpu_to_be32
	mov	x8, x0
	mov	w0, #0
	ldr	x9, [sp, #16]                   ; 8-byte Folded Reload
	ldr	x9, [x9]
	str	x8, [x9]
	ldr	w8, [x19]
	cmp	w8, #2
	b.lt	LBB0_10
; %bb.5:
	mov	x22, #0
	mov	w23, #1000
Lloh3:
	adrp	x24, _R600_AH_DFLT@GOTPAGE
Lloh4:
	ldr	x24, [x24, _R600_AH_DFLT@GOTPAGEOFF]
	mov	w26, #50
	mov	w25, #100
	str	x19, [sp]                       ; 8-byte Folded Spill
	ldr	x21, [sp, #16]                  ; 8-byte Folded Reload
	mov	w20, #35757
	movk	w20, #26843, lsl #16
	b	LBB0_7
LBB0_6:                                 ;   in Loop: Header=BB0_7 Depth=1
	add	x28, x22, #1
	ldr	x8, [x21]
	lsl	x26, x22, #3
	ldr	x0, [x8, x26]
	bl	_be32_to_cpu
Lloh5:
	adrp	x8, _CG_R_MASK@GOTPAGE
Lloh6:
	ldr	x8, [x8, _CG_R_MASK@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	bic	w27, w0, w8
	ldr	w8, [sp, #28]
	ldr	x19, [sp, #8]                   ; 8-byte Folded Reload
	ldr	w9, [x19]
	mul	w8, w9, w8
	smull	x8, w8, w20
	lsr	x9, x8, #63
	asr	x8, x8, #45
	add	w0, w8, w9
	bl	_CG_R
	orr	w0, w0, w27
	bl	_cpu_to_be32
	ldr	x10, [sp]                       ; 8-byte Folded Reload
	ldr	w8, [x10]
	sub	w8, w8, #2
	cmp	x22, x8
	cset	w8, eq
	ldr	x9, [x21]
	str	x0, [x9, x26]
	ldr	w27, [x19, w8, uxtw #2]
	mov	x19, x10
	mov	w0, #65535
	bl	_CG_R
	mov	x22, x0
	ldr	w8, [sp, #24]
	mul	w8, w8, w27
	smull	x8, w8, w20
	lsr	x9, x8, #63
	asr	x8, x8, #45
	add	w0, w8, w9
	bl	_CG_L
	orr	w0, w0, w22
	bl	_cpu_to_be32
	ldr	x8, [x21]
	add	x8, x8, x26
	mov	w26, #50
	ldrsw	x9, [x19]
	sub	x9, x9, #2
	sub	x10, x28, #1
	str	x0, [x8, #8]
	add	w23, w23, #1000
	add	w25, w25, #100
	mov	x22, x28
	cmp	x10, x9
	b.ge	LBB0_9
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
Lloh8:
	adrp	x8, _SISLANDS_MAX_HARDWARE_POWERLEVELS@GOTPAGE
Lloh9:
	ldr	x8, [x8, _SISLANDS_MAX_HARDWARE_POWERLEVELS@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	sdiv	w8, w26, w8
	mul	w0, w25, w8
	ldr	w8, [x24]
	mov	w9, #100
	mul	w1, w8, w9
	ldr	x8, [x19, #8]
	add	x8, x8, x22, lsl #2
	ldp	w3, w2, [x8]
	add	x4, sp, #28
	add	x5, sp, #24
	bl	_r600_calculate_at
	cbz	w0, LBB0_6
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=1
	ldr	w8, [x24]
	mov	w9, #-50
	madd	w9, w8, w9, w23
	madd	w8, w8, w26, w23
	stp	w9, w8, [sp, #24]
	b	LBB0_6
LBB0_9:
	mov	w0, #0
LBB0_10:
	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
	add	sp, sp, #128
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_SISLANDS_MAX_HARDWARE_POWERLEVELS,4,2 ; @SISLANDS_MAX_HARDWARE_POWERLEVELS
	.comm	_R600_AH_DFLT,4,2               ; @R600_AH_DFLT
	.comm	_CG_R_MASK,4,2                  ; @CG_R_MASK
	.no_dead_strip	_si_populate_smc_t
.subsections_via_symbols
