	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ci_enable_uvd_dpm
_ci_enable_uvd_dpm:                     ## @ci_enable_uvd_dpm
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r14d
	movq	%rdi, %r12
	callq	_ci_get_pi
	movq	%rax, %r15
	xorl	%eax, %eax
	cmpq	$0, 32(%r12)
	setne	%cl
	testl	%r14d, %r14d
	je	LBB0_11
## %bb.1:
	movl	$0, 8(%r15)
	movl	(%r12), %esi
	testl	%esi, %esi
	jle	LBB0_2
## %bb.3:
	movb	%cl, %al
	leaq	(%r12,%rax,8), %rcx
	addq	$16, %rcx
	movq	8(%r12), %rax
	movq	(%rcx), %rcx
	xorl	%edx, %edx
LBB0_4:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_5 Depth 2
	movl	%esi, %edi
	.p2align	4, 0x90
LBB0_5:                                 ##   Parent Loop BB0_4 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	leal	-1(%rdi), %esi
	cmpq	%rcx, (%rax,%rsi,8)
	jle	LBB0_6
## %bb.8:                               ##   in Loop: Header=BB0_5 Depth=2
	leal	1(%rsi), %ebx
	movl	%esi, %edi
	cmpl	$1, %ebx
	ja	LBB0_5
	jmp	LBB0_9
	.p2align	4, 0x90
LBB0_6:                                 ##   in Loop: Header=BB0_4 Depth=1
	leal	-1(%rdi), %esi
	btsl	%esi, %edx
	movl	%edx, 8(%r15)
	cmpl	$0, 16(%r15)
	je	LBB0_9
## %bb.7:                               ##   in Loop: Header=BB0_4 Depth=1
	cmpl	$1, %edi
	ja	LBB0_4
	jmp	LBB0_9
LBB0_11:
	testb	$1, (%r15)
	je	LBB0_14
## %bb.12:
	movl	$0, 4(%r15)
	movl	12(%r15), %edx
	orl	$1, %edx
	jmp	LBB0_13
LBB0_2:
	xorl	%edx, %edx
LBB0_9:
	movq	_PPSMC_MSG_UVDDPM_SetEnabledMask@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	callq	_ci_send_msg_to_smc_with_parameter
	testb	$1, (%r15)
	jne	LBB0_10
LBB0_14:
	testl	%r14d, %r14d
	jne	LBB0_15
LBB0_16:
	movq	_PPSMC_MSG_UVDDPM_Disable@GOTPCREL(%rip), %rax
	jmp	LBB0_17
LBB0_10:
	movl	$1, 4(%r15)
	movl	12(%r15), %edx
	andl	$-2, %edx
LBB0_13:
	movl	%edx, 12(%r15)
	movq	_PPSMC_MSG_MCLKDPM_SetEnabledMask@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	callq	_ci_send_msg_to_smc_with_parameter
	testl	%r14d, %r14d
	je	LBB0_16
LBB0_15:
	movq	_PPSMC_MSG_UVDDPM_Enable@GOTPCREL(%rip), %rax
LBB0_17:
	movl	(%rax), %esi
	movq	%r12, %rdi
	callq	_ci_send_msg_to_smc
	movq	_PPSMC_Result_OK@GOTPCREL(%rip), %rdx
	movq	_EINVAL@GOTPCREL(%rip), %rsi
	xorl	%edi, %edi
	xorl	%ecx, %ecx
	subl	(%rsi), %ecx
	cmpq	(%rdx), %rax
	cmovel	%edi, %ecx
	movl	%ecx, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PPSMC_MSG_UVDDPM_SetEnabledMask,4,2 ## @PPSMC_MSG_UVDDPM_SetEnabledMask
	.comm	_PPSMC_MSG_MCLKDPM_SetEnabledMask,4,2 ## @PPSMC_MSG_MCLKDPM_SetEnabledMask
	.comm	_PPSMC_MSG_UVDDPM_Enable,4,2    ## @PPSMC_MSG_UVDDPM_Enable
	.comm	_PPSMC_MSG_UVDDPM_Disable,4,2   ## @PPSMC_MSG_UVDDPM_Disable
	.comm	_PPSMC_Result_OK,8,3            ## @PPSMC_Result_OK
	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_ci_enable_uvd_dpm
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ci_enable_uvd_dpm
_ci_enable_uvd_dpm:                     ; @ci_enable_uvd_dpm
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x20, x1
	mov	x19, x0
	bl	_ci_get_pi
	mov	x21, x0
	ldr	x8, [x19, #32]
	add	x9, x19, #24
	add	x10, x19, #16
	cmp	x8, #0
	csel	x10, x10, x9, eq
	cbz	w20, LBB0_6
; %bb.1:
	str	wzr, [x21, #8]
	ldr	w9, [x19]
	cmp	w9, #1
	b.lt	LBB0_8
; %bb.2:
	mov	w2, #0
	ldr	x8, [x19, #8]
	ldr	x10, [x10]
	mov	w11, #1
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	sub	w12, w9, #1
	ldr	x13, [x8, w12, uxtw #3]
	cmp	x13, x10
	b.le	LBB0_5
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	add	w13, w12, #1
	mov	x9, x12
	cmp	w13, #1
	b.hi	LBB0_3
	b	LBB0_9
LBB0_5:                                 ;   in Loop: Header=BB0_3 Depth=1
	lsl	w13, w11, w12
	orr	w2, w2, w13
	str	w2, [x21, #8]
	ldr	w13, [x21, #16]
	cmp	w13, #0
	ccmp	w9, #1, #0, ne
	mov	x9, x12
	b.hi	LBB0_3
	b	LBB0_9
LBB0_6:
	ldrb	w8, [x21]
	tbz	w8, #0, LBB0_12
; %bb.7:
	str	wzr, [x21, #4]
	ldr	w8, [x21, #12]
	orr	w2, w8, #0x1
	b	LBB0_11
LBB0_8:
	mov	w2, #0
LBB0_9:
Lloh0:
	adrp	x8, _PPSMC_MSG_UVDDPM_SetEnabledMask@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PPSMC_MSG_UVDDPM_SetEnabledMask@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_ci_send_msg_to_smc_with_parameter
	ldrb	w8, [x21]
	tbz	w8, #0, LBB0_12
; %bb.10:
	mov	w8, #1
	str	w8, [x21, #4]
	ldr	w8, [x21, #12]
	and	w2, w8, #0xfffffffe
LBB0_11:
	str	w2, [x21, #12]
Lloh3:
	adrp	x8, _PPSMC_MSG_MCLKDPM_SetEnabledMask@GOTPAGE
Lloh4:
	ldr	x8, [x8, _PPSMC_MSG_MCLKDPM_SetEnabledMask@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_ci_send_msg_to_smc_with_parameter
LBB0_12:
Lloh6:
	adrp	x8, _PPSMC_MSG_UVDDPM_Enable@GOTPAGE
Lloh7:
	ldr	x8, [x8, _PPSMC_MSG_UVDDPM_Enable@GOTPAGEOFF]
Lloh8:
	adrp	x9, _PPSMC_MSG_UVDDPM_Disable@GOTPAGE
Lloh9:
	ldr	x9, [x9, _PPSMC_MSG_UVDDPM_Disable@GOTPAGEOFF]
	cmp	w20, #0
	csel	x8, x9, x8, eq
	ldr	w1, [x8]
	mov	x0, x19
	bl	_ci_send_msg_to_smc
Lloh10:
	adrp	x8, _PPSMC_Result_OK@GOTPAGE
Lloh11:
	ldr	x8, [x8, _PPSMC_Result_OK@GOTPAGEOFF]
Lloh12:
	ldr	x8, [x8]
Lloh13:
	adrp	x9, _EINVAL@GOTPAGE
Lloh14:
	ldr	x9, [x9, _EINVAL@GOTPAGEOFF]
Lloh15:
	ldr	w9, [x9]
	cmp	x0, x8
	csneg	w0, wzr, w9, eq
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_PPSMC_MSG_UVDDPM_SetEnabledMask,4,2 ; @PPSMC_MSG_UVDDPM_SetEnabledMask
	.comm	_PPSMC_MSG_MCLKDPM_SetEnabledMask,4,2 ; @PPSMC_MSG_MCLKDPM_SetEnabledMask
	.comm	_PPSMC_MSG_UVDDPM_Enable,4,2    ; @PPSMC_MSG_UVDDPM_Enable
	.comm	_PPSMC_MSG_UVDDPM_Disable,4,2   ; @PPSMC_MSG_UVDDPM_Disable
	.comm	_PPSMC_Result_OK,8,3            ; @PPSMC_Result_OK
	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_ci_enable_uvd_dpm
.subsections_via_symbols
