	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ni_populate_smc_t
_ni_populate_smc_t:                     ## @ni_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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, -64(%rbp)                 ## 8-byte Spill
	movq	%rsi, %r14
	movq	%rdi, %rbx
	callq	_rv770_get_pi
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	movq	%rbx, %rdi
	callq	_evergreen_get_pi
	movq	%rax, %r12
	movq	%r14, %rdi
	callq	_ni_get_ps
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movl	(%rax), %eax
	cmpl	$9, %eax
	jl	LBB0_2
## %bb.1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
	jmp	LBB0_13
LBB0_2:
	cmpl	$1, %eax
	jg	LBB0_4
## %bb.3:
	movl	$65535, %edi                    ## imm = 0xFFFF
	callq	_CG_R
	movl	%eax, %r14d
	xorl	%r15d, %r15d
	xorl	%edi, %edi
	callq	_CG_L
	orl	%eax, %r14d
	movl	%r14d, %edi
	callq	_cpu_to_be32
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	movq	(%rcx), %rcx
	movq	%rax, (%rcx)
	jmp	LBB0_13
LBB0_4:
	xorl	%r15d, %r15d
	xorl	%edi, %edi
	callq	_cpu_to_be32
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	movq	(%rcx), %rcx
	movq	%rax, (%rcx)
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	cmpl	$2, (%rax)
	jl	LBB0_13
## %bb.5:
	movq	$-1, %r14
	movl	$1000, %ebx                     ## imm = 0x3E8
	movq	%r12, -80(%rbp)                 ## 8-byte Spill
	movq	-64(%rbp), %r15                 ## 8-byte Reload
	jmp	LBB0_6
	.p2align	4, 0x90
LBB0_11:                                ##   in Loop: Header=BB0_6 Depth=1
	movq	(%r15), %rax
	movq	8(%rax,%r14,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,%r14,8)
	movq	%rbx, -88(%rbp)                 ## 8-byte Spill
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %eax
	addl	$-2, %eax
	xorl	%ecx, %ecx
	cmpq	%rax, %r13
	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
	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	(%r15), %rcx
	movq	%rax, 16(%rcx,%r14,8)
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movslq	(%rax), %rax
	movq	-88(%rbp), %rbx                 ## 8-byte Reload
	addq	$-2, %rax
	addl	$1000, %ebx                     ## imm = 0x3E8
	movq	%r13, %r14
	cmpq	%rax, %r13
	movq	-80(%rbp), %r12                 ## 8-byte Reload
	jge	LBB0_12
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	cmpq	$0, 8(%r12)
	je	LBB0_8
## %bb.7:                               ##   in Loop: Header=BB0_6 Depth=1
	cmpq	$0, (%r12)
	movl	$2, %eax
	movl	$8, %ecx
	cmovel	%ecx, %eax
	leal	-1000(%rbx), %edi
	imull	%eax, %edi
	movq	_R600_AH_DFLT@GOTPCREL(%rip), %rax
	imull	$100, (%rax), %esi
	addl	$2000, %edi                     ## imm = 0x7D0
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	8(%rax), %rax
	movl	4(%rax,%r14,4), %ecx
	movl	8(%rax,%r14,4), %edx
	jmp	LBB0_9
	.p2align	4, 0x90
LBB0_8:                                 ##   in Loop: Header=BB0_6 Depth=1
	movq	_R600_AH_DFLT@GOTPCREL(%rip), %rax
	imull	$100, (%rax), %esi
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	8(%rax), %rax
	movl	4(%rax,%r14,4), %ecx
	movl	8(%rax,%r14,4), %edx
	movl	%ebx, %edi
LBB0_9:                                 ##   in Loop: Header=BB0_6 Depth=1
	leaq	-48(%rbp), %r8
	leaq	-44(%rbp), %r9
	callq	_r600_calculate_at
	leaq	1(%r14), %r13
	testl	%eax, %eax
	je	LBB0_11
## %bb.10:                              ##   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_11
LBB0_12:
	xorl	%r15d, %r15d
LBB0_13:
	movl	%r15d, %eax
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_R600_AH_DFLT,4,2               ## @R600_AH_DFLT
	.comm	_CG_R_MASK,4,2                  ## @CG_R_MASK
	.no_dead_strip	_ni_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 ni_populate_smc_t
_ni_populate_smc_t:                     ; @ni_populate_smc_t
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	mov	x19, x2
	mov	x22, x1
	mov	x21, x0
	bl	_rv770_get_pi
	str	x0, [sp]                        ; 8-byte Folded Spill
	mov	x0, x21
	bl	_evergreen_get_pi
	mov	x20, x0
	mov	x0, x22
	bl	_ni_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_12
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, [x19]
	str	x8, [x9]
	b	LBB0_12
LBB0_4:
	mov	x22, x0
	mov	w0, #0
	bl	_cpu_to_be32
	mov	x8, x0
	mov	w0, #0
	ldr	x9, [x19]
	str	x8, [x9]
	ldr	w8, [x22]
	cmp	w8, #2
	b.lt	LBB0_12
; %bb.5:
	mov	x25, #0
	mov	w23, #1000
	mov	w26, #4
	mov	w21, #35757
	movk	w21, #26843, lsl #16
	b	LBB0_7
LBB0_6:                                 ;   in Loop: Header=BB0_7 Depth=1
	ldr	x8, [x19]
	lsl	x27, x25, #3
	ldr	x0, [x8, x27]
	bl	_be32_to_cpu
Lloh3:
	adrp	x8, _CG_R_MASK@GOTPAGE
Lloh4:
	ldr	x8, [x8, _CG_R_MASK@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	bic	w24, w0, w8
	ldr	w8, [sp, #12]
	ldr	x28, [sp]                       ; 8-byte Folded Reload
	ldr	w9, [x28]
	mul	w8, w9, w8
	smull	x8, w8, w21
	lsr	x9, x8, #63
	asr	x8, x8, #45
	add	w0, w8, w9
	bl	_CG_R
	orr	w0, w0, w24
	bl	_cpu_to_be32
	ldr	w8, [x22]
	sub	w8, w8, #2
	cmp	x25, x8
	cset	w8, eq
	ldr	x9, [x19]
	str	x0, [x9, x27]
	ldr	w28, [x28, w8, uxtw #2]
	mov	w0, #65535
	bl	_CG_R
	mov	x24, x0
	ldr	w8, [sp, #8]
	mul	w8, w8, w28
	smull	x8, w8, w21
	lsr	x9, x8, #63
	asr	x8, x8, #45
	add	w0, w8, w9
	bl	_CG_L
	orr	w0, w0, w24
	bl	_cpu_to_be32
	ldr	x8, [x19]
	add	x9, x25, #1
	add	x8, x8, x27
	str	x0, [x8, #8]
	ldrsw	x8, [x22]
	sub	x8, x8, #2
	add	w23, w23, #1000
	add	x26, x26, #4
	cmp	x25, x8
	mov	x25, x9
	b.ge	LBB0_11
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x20, #8]
	cbz	x8, LBB0_9
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=1
	ldr	x8, [x20]
	cmp	x8, #0
	mov	w8, #2
	mov	w9, #8
	csel	w8, w9, w8, eq
	sub	w9, w23, #1000
	mul	w8, w9, w8
	add	w0, w8, #2000
Lloh6:
	adrp	x8, _R600_AH_DFLT@GOTPAGE
Lloh7:
	ldr	x8, [x8, _R600_AH_DFLT@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	mov	w9, #100
	mul	w1, w8, w9
	ldr	x8, [x22, #8]
	add	x8, x8, x26
	ldp	w3, w2, [x8, #-4]
	add	x4, sp, #12
	add	x5, sp, #8
	bl	_r600_calculate_at
	cbnz	w0, LBB0_10
	b	LBB0_6
LBB0_9:                                 ;   in Loop: Header=BB0_7 Depth=1
Lloh9:
	adrp	x8, _R600_AH_DFLT@GOTPAGE
Lloh10:
	ldr	x8, [x8, _R600_AH_DFLT@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	mov	w9, #100
	mul	w1, w8, w9
	ldr	x8, [x22, #8]
	add	x8, x8, x26
	ldp	w3, w2, [x8, #-4]
	add	x4, sp, #12
	add	x5, sp, #8
	mov	x0, x23
	bl	_r600_calculate_at
	cbz	w0, LBB0_6
LBB0_10:                                ;   in Loop: Header=BB0_7 Depth=1
Lloh12:
	adrp	x8, _R600_AH_DFLT@GOTPAGE
Lloh13:
	ldr	x8, [x8, _R600_AH_DFLT@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	mov	w9, #-50
	madd	w10, w8, w9, w23
	mov	w9, #50
	madd	w8, w8, w9, w23
	stp	w10, w8, [sp, #8]
	b	LBB0_6
LBB0_11:
	mov	w0, #0
LBB0_12:
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_R600_AH_DFLT,4,2               ; @R600_AH_DFLT
	.comm	_CG_R_MASK,4,2                  ; @CG_R_MASK
	.no_dead_strip	_ni_populate_smc_t
.subsections_via_symbols
