	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function rv770_init_smc_table
_rv770_init_smc_table:                  ## @rv770_init_smc_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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r12
	movq	%rdi, %r13
	callq	_rv770_get_pi
	movq	%rax, %r14
	movq	%r12, %rdi
	callq	_rv770_get_ps
	movq	%rax, %rbx
	leaq	20(%r14), %r15
	movq	%r15, %rdi
	xorl	%esi, %esi
	movl	$20, %edx
	callq	_memset
	movl	(%rbx), %eax
	movl	%eax, 16(%r14)
	movq	%r13, %rdi
	movq	%r15, %rsi
	callq	_rv770_populate_smc_vddc_table
	movq	%r13, %rdi
	movq	%r15, %rsi
	callq	_rv770_populate_smc_mvdd_table
	movl	8(%r13), %eax
	addl	$-128, %eax
	cmpl	$3, %eax
	ja	LBB0_1
## %bb.2:
	cltq
	leaq	l_switch.table.rv770_init_smc_table(%rip), %rcx
	movq	(%rcx,%rax,8), %rax
	jmp	LBB0_3
LBB0_1:
	movq	_PPSMC_THERMAL_PROTECT_TYPE_EXTERNAL@GOTPCREL(%rip), %rax
LBB0_3:
	movl	(%rax), %eax
	movl	%eax, 36(%r14)
	movl	12(%r13), %eax
	movq	_ATOM_PP_PLATFORM_CAP_HARDWAREDC@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_8
## %bb.4:
	movq	_PPSMC_SYSTEMFLAG_GPIO_DC@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	%ecx, 28(%r14)
	movq	_ATOM_PP_PLATFORM_CAP_DONT_WAIT_FOR_VBLANK_ON_ALERT@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_6
## %bb.5:
	movq	_PPSMC_EXTRAFLAGS_AC2DC_DONT_WAIT_FOR_VBLANK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	%ecx, 32(%r14)
LBB0_6:
	movq	_ATOM_PP_PLATFORM_CAP_GOTO_BOOT_ON_ALERT@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_8
## %bb.7:
	movq	_PPSMC_EXTRAFLAGS_AC2DC_ACTION_GOTOINITIALSTATE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	%ecx, 32(%r14)
LBB0_8:
	movq	_ATOM_PP_PLATFORM_CAP_STEPVDDC@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_10
## %bb.9:
	movq	_PPSMC_SYSTEMFLAG_STEPVDDC@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, 28(%r14)
LBB0_10:
	cmpq	$0, 8(%r14)
	je	LBB0_12
## %bb.11:
	movq	_PPSMC_SYSTEMFLAG_GDDR5@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, 28(%r14)
LBB0_12:
	movq	(%r13), %rax
	movq	_CHIP_RV730@GOTPCREL(%rip), %rcx
	movq	_CHIP_RV710@GOTPCREL(%rip), %rbx
	cmpq	(%rcx), %rax
	je	LBB0_14
## %bb.13:
	cmpq	(%rbx), %rax
	je	LBB0_14
## %bb.15:
	movq	%r13, %rdi
	movq	%r12, %rsi
	movq	%r15, %rdx
	callq	_rv770_populate_smc_initial_state
	testl	%eax, %eax
	jne	LBB0_24
	jmp	LBB0_17
LBB0_14:
	movq	%r13, %rdi
	movq	%r12, %rsi
	movq	%r15, %rdx
	callq	_rv730_populate_smc_initial_state
	testl	%eax, %eax
	jne	LBB0_24
LBB0_17:
	movq	(%r13), %rax
	movq	_CHIP_RV740@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_19
## %bb.18:
	movq	%r13, %rdi
	movq	%r15, %rsi
	callq	_rv740_populate_smc_acpi_state
	testl	%eax, %eax
	jne	LBB0_24
	jmp	LBB0_25
LBB0_19:
	movq	_CHIP_RV730@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_21
## %bb.20:
	cmpq	(%rbx), %rax
	je	LBB0_21
## %bb.22:
	movq	%r13, %rdi
	movq	%r15, %rsi
	callq	_rv770_populate_smc_acpi_state
	testl	%eax, %eax
	je	LBB0_25
LBB0_24:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_21:
	movq	%r13, %rdi
	movq	%r15, %rsi
	callq	_rv730_populate_smc_acpi_state
	testl	%eax, %eax
	jne	LBB0_24
LBB0_25:
	movl	20(%r14), %eax
	movl	%eax, 24(%r14)
	movl	(%r14), %r8d
	movl	4(%r14), %esi
	movq	%r13, %rdi
	movq	%r15, %rdx
	movl	$20, %ecx
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_rv770_copy_bytes_to_smc        ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_PPSMC_THERMAL_PROTECT_TYPE_INTERNAL,4,2 ## @PPSMC_THERMAL_PROTECT_TYPE_INTERNAL
	.comm	_PPSMC_THERMAL_PROTECT_TYPE_NONE,4,2 ## @PPSMC_THERMAL_PROTECT_TYPE_NONE
	.comm	_PPSMC_THERMAL_PROTECT_TYPE_EXTERNAL,4,2 ## @PPSMC_THERMAL_PROTECT_TYPE_EXTERNAL
	.comm	_ATOM_PP_PLATFORM_CAP_HARDWAREDC,4,2 ## @ATOM_PP_PLATFORM_CAP_HARDWAREDC
	.comm	_PPSMC_SYSTEMFLAG_GPIO_DC,4,2   ## @PPSMC_SYSTEMFLAG_GPIO_DC
	.comm	_ATOM_PP_PLATFORM_CAP_DONT_WAIT_FOR_VBLANK_ON_ALERT,4,2 ## @ATOM_PP_PLATFORM_CAP_DONT_WAIT_FOR_VBLANK_ON_ALERT
	.comm	_PPSMC_EXTRAFLAGS_AC2DC_DONT_WAIT_FOR_VBLANK,4,2 ## @PPSMC_EXTRAFLAGS_AC2DC_DONT_WAIT_FOR_VBLANK
	.comm	_ATOM_PP_PLATFORM_CAP_GOTO_BOOT_ON_ALERT,4,2 ## @ATOM_PP_PLATFORM_CAP_GOTO_BOOT_ON_ALERT
	.comm	_PPSMC_EXTRAFLAGS_AC2DC_ACTION_GOTOINITIALSTATE,4,2 ## @PPSMC_EXTRAFLAGS_AC2DC_ACTION_GOTOINITIALSTATE
	.comm	_ATOM_PP_PLATFORM_CAP_STEPVDDC,4,2 ## @ATOM_PP_PLATFORM_CAP_STEPVDDC
	.comm	_PPSMC_SYSTEMFLAG_STEPVDDC,4,2  ## @PPSMC_SYSTEMFLAG_STEPVDDC
	.comm	_PPSMC_SYSTEMFLAG_GDDR5,4,2     ## @PPSMC_SYSTEMFLAG_GDDR5
	.comm	_CHIP_RV730,8,3                 ## @CHIP_RV730
	.comm	_CHIP_RV710,8,3                 ## @CHIP_RV710
	.comm	_CHIP_RV740,8,3                 ## @CHIP_RV740
	.no_dead_strip	_rv770_init_smc_table
	.section	__DATA,__const
	.p2align	3                               ## @switch.table.rv770_init_smc_table
l_switch.table.rv770_init_smc_table:
	.quad	_PPSMC_THERMAL_PROTECT_TYPE_INTERNAL
	.quad	_PPSMC_THERMAL_PROTECT_TYPE_NONE
	.quad	_PPSMC_THERMAL_PROTECT_TYPE_EXTERNAL
	.quad	_PPSMC_THERMAL_PROTECT_TYPE_INTERNAL

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function rv770_init_smc_table
_rv770_init_smc_table:                  ; @rv770_init_smc_table
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x22, x1
	mov	x19, x0
	bl	_rv770_get_pi
	mov	x20, x0
	mov	x0, x22
	bl	_rv770_get_ps
	mov	x23, x0
	add	x21, x20, #20
	mov	x0, x21
	mov	w1, #0
	mov	w2, #20
	bl	_memset
	ldr	w8, [x23]
	str	w8, [x20, #16]
	mov	x0, x19
	mov	x1, x21
	bl	_rv770_populate_smc_vddc_table
	mov	x0, x19
	mov	x1, x21
	bl	_rv770_populate_smc_mvdd_table
	ldr	w8, [x19, #8]
	sub	w8, w8, #128
	cmp	w8, #3
	b.hi	LBB0_2
; %bb.1:
Lloh0:
	adrp	x9, l_switch.table.rv770_init_smc_table@PAGE
Lloh1:
	add	x9, x9, l_switch.table.rv770_init_smc_table@PAGEOFF
	ldr	x8, [x9, w8, sxtw #3]
	b	LBB0_3
LBB0_2:
Lloh2:
	adrp	x8, _PPSMC_THERMAL_PROTECT_TYPE_EXTERNAL@GOTPAGE
Lloh3:
	ldr	x8, [x8, _PPSMC_THERMAL_PROTECT_TYPE_EXTERNAL@GOTPAGEOFF]
LBB0_3:
	ldr	w8, [x8]
	str	w8, [x20, #36]
	ldr	w8, [x19, #12]
Lloh4:
	adrp	x9, _ATOM_PP_PLATFORM_CAP_HARDWAREDC@GOTPAGE
Lloh5:
	ldr	x9, [x9, _ATOM_PP_PLATFORM_CAP_HARDWAREDC@GOTPAGEOFF]
Lloh6:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_8
; %bb.4:
Lloh7:
	adrp	x9, _PPSMC_SYSTEMFLAG_GPIO_DC@GOTPAGE
Lloh8:
	ldr	x9, [x9, _PPSMC_SYSTEMFLAG_GPIO_DC@GOTPAGEOFF]
Lloh9:
	ldr	w9, [x9]
	ldr	w10, [x20, #28]
	orr	w9, w10, w9
	str	w9, [x20, #28]
Lloh10:
	adrp	x9, _ATOM_PP_PLATFORM_CAP_DONT_WAIT_FOR_VBLANK_ON_ALERT@GOTPAGE
Lloh11:
	ldr	x9, [x9, _ATOM_PP_PLATFORM_CAP_DONT_WAIT_FOR_VBLANK_ON_ALERT@GOTPAGEOFF]
Lloh12:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_6
; %bb.5:
Lloh13:
	adrp	x9, _PPSMC_EXTRAFLAGS_AC2DC_DONT_WAIT_FOR_VBLANK@GOTPAGE
Lloh14:
	ldr	x9, [x9, _PPSMC_EXTRAFLAGS_AC2DC_DONT_WAIT_FOR_VBLANK@GOTPAGEOFF]
Lloh15:
	ldr	w9, [x9]
	ldr	w10, [x20, #32]
	orr	w9, w10, w9
	str	w9, [x20, #32]
LBB0_6:
Lloh16:
	adrp	x9, _ATOM_PP_PLATFORM_CAP_GOTO_BOOT_ON_ALERT@GOTPAGE
Lloh17:
	ldr	x9, [x9, _ATOM_PP_PLATFORM_CAP_GOTO_BOOT_ON_ALERT@GOTPAGEOFF]
Lloh18:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_8
; %bb.7:
Lloh19:
	adrp	x9, _PPSMC_EXTRAFLAGS_AC2DC_ACTION_GOTOINITIALSTATE@GOTPAGE
Lloh20:
	ldr	x9, [x9, _PPSMC_EXTRAFLAGS_AC2DC_ACTION_GOTOINITIALSTATE@GOTPAGEOFF]
Lloh21:
	ldr	w9, [x9]
	ldr	w10, [x20, #32]
	orr	w9, w10, w9
	str	w9, [x20, #32]
LBB0_8:
Lloh22:
	adrp	x9, _ATOM_PP_PLATFORM_CAP_STEPVDDC@GOTPAGE
Lloh23:
	ldr	x9, [x9, _ATOM_PP_PLATFORM_CAP_STEPVDDC@GOTPAGEOFF]
Lloh24:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_10
; %bb.9:
Lloh25:
	adrp	x8, _PPSMC_SYSTEMFLAG_STEPVDDC@GOTPAGE
Lloh26:
	ldr	x8, [x8, _PPSMC_SYSTEMFLAG_STEPVDDC@GOTPAGEOFF]
Lloh27:
	ldr	w8, [x8]
	ldr	w9, [x20, #28]
	orr	w8, w9, w8
	str	w8, [x20, #28]
LBB0_10:
	ldr	x8, [x20, #8]
	cbz	x8, LBB0_12
; %bb.11:
Lloh28:
	adrp	x8, _PPSMC_SYSTEMFLAG_GDDR5@GOTPAGE
Lloh29:
	ldr	x8, [x8, _PPSMC_SYSTEMFLAG_GDDR5@GOTPAGEOFF]
Lloh30:
	ldr	w8, [x8]
	ldr	w9, [x20, #28]
	orr	w8, w9, w8
	str	w8, [x20, #28]
LBB0_12:
	ldr	x8, [x19]
Lloh31:
	adrp	x24, _CHIP_RV730@GOTPAGE
Lloh32:
	ldr	x24, [x24, _CHIP_RV730@GOTPAGEOFF]
	ldr	x9, [x24]
Lloh33:
	adrp	x23, _CHIP_RV710@GOTPAGE
Lloh34:
	ldr	x23, [x23, _CHIP_RV710@GOTPAGEOFF]
	ldr	x10, [x23]
	cmp	x8, x9
	mov	x0, x19
	mov	x1, x22
	mov	x2, x21
	ccmp	x8, x10, #4, ne
	b.ne	LBB0_14
; %bb.13:
	bl	_rv730_populate_smc_initial_state
	cbnz	w0, LBB0_20
	b	LBB0_15
LBB0_14:
	bl	_rv770_populate_smc_initial_state
	cbnz	w0, LBB0_20
LBB0_15:
	ldr	x8, [x19]
Lloh35:
	adrp	x9, _CHIP_RV740@GOTPAGE
Lloh36:
	ldr	x9, [x9, _CHIP_RV740@GOTPAGEOFF]
Lloh37:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_17
; %bb.16:
	mov	x0, x19
	mov	x1, x21
	bl	_rv740_populate_smc_acpi_state
	cbnz	w0, LBB0_20
	b	LBB0_22
LBB0_17:
	ldr	x9, [x24]
	cmp	x8, x9
	b.eq	LBB0_21
; %bb.18:
	ldr	x9, [x23]
	cmp	x8, x9
	b.eq	LBB0_21
; %bb.19:
	mov	x0, x19
	mov	x1, x21
	bl	_rv770_populate_smc_acpi_state
	cbz	w0, LBB0_22
LBB0_20:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_21:
	mov	x0, x19
	mov	x1, x21
	bl	_rv730_populate_smc_acpi_state
	cbnz	w0, LBB0_20
LBB0_22:
	ldr	w8, [x20, #20]
	str	w8, [x20, #24]
	ldp	w4, w1, [x20]
	mov	x0, x19
	mov	x2, x21
	mov	w3, #20
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	b	_rv770_copy_bytes_to_smc
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGot	Lloh33, Lloh34
	.loh AdrpLdrGot	Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.cfi_endproc
                                        ; -- End function
	.comm	_PPSMC_THERMAL_PROTECT_TYPE_INTERNAL,4,2 ; @PPSMC_THERMAL_PROTECT_TYPE_INTERNAL
	.comm	_PPSMC_THERMAL_PROTECT_TYPE_NONE,4,2 ; @PPSMC_THERMAL_PROTECT_TYPE_NONE
	.comm	_PPSMC_THERMAL_PROTECT_TYPE_EXTERNAL,4,2 ; @PPSMC_THERMAL_PROTECT_TYPE_EXTERNAL
	.comm	_ATOM_PP_PLATFORM_CAP_HARDWAREDC,4,2 ; @ATOM_PP_PLATFORM_CAP_HARDWAREDC
	.comm	_PPSMC_SYSTEMFLAG_GPIO_DC,4,2   ; @PPSMC_SYSTEMFLAG_GPIO_DC
	.comm	_ATOM_PP_PLATFORM_CAP_DONT_WAIT_FOR_VBLANK_ON_ALERT,4,2 ; @ATOM_PP_PLATFORM_CAP_DONT_WAIT_FOR_VBLANK_ON_ALERT
	.comm	_PPSMC_EXTRAFLAGS_AC2DC_DONT_WAIT_FOR_VBLANK,4,2 ; @PPSMC_EXTRAFLAGS_AC2DC_DONT_WAIT_FOR_VBLANK
	.comm	_ATOM_PP_PLATFORM_CAP_GOTO_BOOT_ON_ALERT,4,2 ; @ATOM_PP_PLATFORM_CAP_GOTO_BOOT_ON_ALERT
	.comm	_PPSMC_EXTRAFLAGS_AC2DC_ACTION_GOTOINITIALSTATE,4,2 ; @PPSMC_EXTRAFLAGS_AC2DC_ACTION_GOTOINITIALSTATE
	.comm	_ATOM_PP_PLATFORM_CAP_STEPVDDC,4,2 ; @ATOM_PP_PLATFORM_CAP_STEPVDDC
	.comm	_PPSMC_SYSTEMFLAG_STEPVDDC,4,2  ; @PPSMC_SYSTEMFLAG_STEPVDDC
	.comm	_PPSMC_SYSTEMFLAG_GDDR5,4,2     ; @PPSMC_SYSTEMFLAG_GDDR5
	.comm	_CHIP_RV730,8,3                 ; @CHIP_RV730
	.comm	_CHIP_RV710,8,3                 ; @CHIP_RV710
	.comm	_CHIP_RV740,8,3                 ; @CHIP_RV740
	.no_dead_strip	_rv770_init_smc_table
	.section	__DATA,__const
	.p2align	3                               ; @switch.table.rv770_init_smc_table
l_switch.table.rv770_init_smc_table:
	.quad	_PPSMC_THERMAL_PROTECT_TYPE_INTERNAL
	.quad	_PPSMC_THERMAL_PROTECT_TYPE_NONE
	.quad	_PPSMC_THERMAL_PROTECT_TYPE_EXTERNAL
	.quad	_PPSMC_THERMAL_PROTECT_TYPE_INTERNAL

.subsections_via_symbols
