	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function smu7_set_power_profile_mode
_smu7_set_power_profile_mode:           ## @smu7_set_power_profile_mode
	.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	$72, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	testq	%rsi, %rsi
	je	LBB0_7
## %bb.1:
	movq	%rdi, %r15
	movq	8(%rdi), %r14
	movq	(%rsi,%rdx,8), %rbx
	leal	-128(%rbx), %eax
	cmpl	$4, %eax
	jb	LBB0_11
## %bb.2:
	cmpl	$133, %ebx
	je	LBB0_11
## %bb.3:
	cmpl	$132, %ebx
	jne	LBB0_7
## %bb.4:
	leaq	-1(%rdx), %rax
	cmpq	$6, %rax
	ja	LBB0_5
LBB0_7:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r12d, %r12d
	subl	(%rax), %r12d
	jmp	LBB0_18
LBB0_11:
	xorl	%r12d, %r12d
	cmpl	%ebx, (%r15)
	je	LBB0_18
## %bb.12:
	movl	%ebx, %esi
	movq	_smu7_profiling@GOTPCREL(%rip), %rax
	shlq	$6, %rsi
	addq	(%rax), %rsi
	leaq	-112(%rbp), %r13
	movq	%r13, %rdi
	movl	$64, %edx
	callq	_memcpy
	movq	%r15, %rdi
	movq	%r13, %rsi
	callq	_smum_update_dpm_settings
	testl	%eax, %eax
	jne	LBB0_18
## %bb.13:
	movq	-112(%rbp), %rax
	testq	%rax, %rax
	je	LBB0_15
## %bb.14:
	movq	%rax, (%r14)
	movups	-96(%rbp), %xmm0
	movups	%xmm0, 16(%r14)
	movq	-80(%rbp), %rax
	movq	%rax, 32(%r14)
LBB0_15:
	movq	-104(%rbp), %rax
	testq	%rax, %rax
	je	LBB0_17
## %bb.16:
	movq	%rax, 8(%r14)
	movups	-72(%rbp), %xmm0
	movups	%xmm0, 40(%r14)
	movq	-56(%rbp), %rax
	movq	%rax, 56(%r14)
LBB0_17:
	movq	%r15, %rdi
	movl	%ebx, %esi
	callq	_smu7_patch_compute_profile_mode
	movl	%ebx, (%r15)
	jmp	LBB0_18
LBB0_5:
	movq	_smu7_profiling@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movups	8448(%rax), %xmm0
	movups	8464(%rax), %xmm1
	movups	8480(%rax), %xmm2
	movups	8496(%rax), %xmm3
	movaps	%xmm0, -112(%rbp)
	movaps	%xmm1, -96(%rbp)
	movaps	%xmm2, -80(%rbp)
	movaps	%xmm3, -64(%rbp)
	testq	%rdx, %rdx
	je	LBB0_6
## %bb.8:
	addq	$8448, %rax                     ## imm = 0x2100
	movq	(%rsi), %rcx
	movq	%rcx, -112(%rbp)
	movups	8(%rsi), %xmm0
	movaps	%xmm0, -96(%rbp)
	movq	24(%rsi), %rcx
	movq	%rcx, -80(%rbp)
	movq	32(%rsi), %rcx
	movq	%rcx, -104(%rbp)
	movups	40(%rsi), %xmm0
	movups	%xmm0, -72(%rbp)
	movq	56(%rsi), %rcx
	movq	%rcx, -56(%rbp)
	movq	-80(%rbp), %rcx
	movq	%rcx, 32(%rax)
	movq	-72(%rbp), %rcx
	movq	%rcx, 40(%rax)
	movaps	-96(%rbp), %xmm0
	movups	%xmm0, 16(%rax)
	movq	-112(%rbp), %rcx
	movq	%rcx, (%rax)
	movq	-104(%rbp), %rcx
	movq	%rcx, 8(%rax)
	movq	-64(%rbp), %rcx
	movq	%rcx, 48(%rax)
	movq	-56(%rbp), %rcx
	movq	%rcx, 56(%rax)
	jmp	LBB0_9
LBB0_6:
	movq	-112(%rbp), %rax
	orq	-104(%rbp), %rax
	je	LBB0_7
LBB0_9:
	leaq	-112(%rbp), %rsi
	movq	%r15, %rdi
	callq	_smum_update_dpm_settings
	xorl	%r12d, %r12d
	testl	%eax, %eax
	jne	LBB0_18
## %bb.10:
	leaq	-112(%rbp), %rsi
	movq	%r14, %rdi
	movl	$64, %edx
	callq	_memcpy
	movl	$132, (%r15)
LBB0_18:
	movl	%r12d, %eax
	addq	$72, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_smu7_profiling,8,3             ## @smu7_profiling
	.no_dead_strip	_smu7_set_power_profile_mode
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function smu7_set_power_profile_mode
_smu7_set_power_profile_mode:           ; @smu7_set_power_profile_mode
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	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
	cbz	x1, LBB0_5
; %bb.1:
	mov	x19, x0
	ldr	x20, [x0, #8]
	ldr	x21, [x1, x2, lsl #3]
	sub	w8, w21, #128
	cmp	w8, #4
	b.lo	LBB0_6
; %bb.2:
	cmp	w21, #133
	b.eq	LBB0_6
; %bb.3:
	cmp	w21, #132
	b.ne	LBB0_5
; %bb.4:
	sub	x8, x2, #1
	cmp	x8, #6
	b.hi	LBB0_15
LBB0_5:
Lloh0:
	adrp	x8, _EINVAL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_9
LBB0_6:
	ldr	w8, [x19]
	cmp	w8, w21
	b.eq	LBB0_8
; %bb.7:
	and	x8, x21, #0xffffffff
Lloh3:
	adrp	x9, _smu7_profiling@GOTPAGE
Lloh4:
	ldr	x9, [x9, _smu7_profiling@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	add	x1, x9, x8, lsl #6
	mov	x0, sp
	mov	w2, #64
	bl	_memcpy
	mov	x1, sp
	mov	x0, x19
	bl	_smum_update_dpm_settings
	cbz	w0, LBB0_10
LBB0_8:
	mov	w0, #0
LBB0_9:
	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
	add	sp, sp, #112
	ret
LBB0_10:
	ldr	x8, [sp]
	cbz	x8, LBB0_12
; %bb.11:
	str	x8, [x20]
	ldr	q0, [sp, #16]
	str	q0, [x20, #16]
	ldr	x8, [sp, #32]
	str	x8, [x20, #32]
LBB0_12:
	ldr	x8, [sp, #8]
	cbz	x8, LBB0_14
; %bb.13:
	str	x8, [x20, #8]
	ldur	q0, [sp, #40]
	stur	q0, [x20, #40]
	ldr	x8, [sp, #56]
	str	x8, [x20, #56]
LBB0_14:
	mov	x0, x19
	mov	x1, x21
	bl	_smu7_patch_compute_profile_mode
	mov	w0, #0
	str	w21, [x19]
	b	LBB0_9
LBB0_15:
Lloh6:
	adrp	x8, _smu7_profiling@GOTPAGE
Lloh7:
	ldr	x8, [x8, _smu7_profiling@GOTPAGEOFF]
Lloh8:
	ldr	x8, [x8]
	ldr	q0, [x8, #8448]
	ldr	q1, [x8, #8464]
	stp	q0, q1, [sp]
	ldr	q0, [x8, #8480]
	ldr	q1, [x8, #8496]
	stp	q0, q1, [sp, #32]
	cbz	x2, LBB0_17
; %bb.16:
	mov	w9, #8448
	add	x8, x8, x9
	ldp	x9, x10, [x1, #24]
	str	x9, [sp, #32]
	ldr	x9, [x1]
	ldur	q0, [x1, #8]
	str	q0, [sp, #16]
	stp	x9, x10, [sp]
	ldur	q0, [x1, #40]
	stur	q0, [sp, #40]
	ldr	x9, [x1, #56]
	str	x9, [sp, #56]
	ldp	q0, q1, [sp, #32]
	stp	q0, q1, [x8, #32]
	ldp	q0, q1, [sp]
	stp	q0, q1, [x8]
	b	LBB0_18
LBB0_17:
	ldp	x8, x9, [sp]
	orr	x8, x8, x9
	cbz	x8, LBB0_5
LBB0_18:
	mov	x1, sp
	mov	x0, x19
	bl	_smum_update_dpm_settings
	cbnz	w0, LBB0_8
; %bb.19:
	mov	x1, sp
	mov	x0, x20
	mov	w2, #64
	bl	_memcpy
	mov	w0, #0
	mov	w8, #132
	str	w8, [x19]
	b	LBB0_9
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_smu7_profiling,8,3             ; @smu7_profiling
	.no_dead_strip	_smu7_set_power_profile_mode
.subsections_via_symbols
