	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_db8500_prcmu_set_arm_opp       ## -- Begin function db8500_prcmu_set_arm_opp
	.p2align	4, 0x90
_db8500_prcmu_set_arm_opp:              ## @db8500_prcmu_set_arm_opp
	.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
	movq	_ARM_NO_CHANGE@GOTPCREL(%rip), %rax
	cmpq	%rdi, (%rax)
	jg	LBB0_2
## %bb.1:
	movq	%rdi, %r15
	movq	_ARM_EXTCLK@GOTPCREL(%rip), %rax
	cmpq	%rdi, (%rax)
	jl	LBB0_2
## %bb.3:
	movq	_mb1_transfer@GOTPCREL(%rip), %r14
	movq	%r14, %rdi
	callq	_mutex_lock
	movq	_PRCM_MBOX_CPU_VAL@GOTPCREL(%rip), %r12
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r12), %edi
	callq	_readl
	movl	%eax, %ebx
	movl	$1, %edi
	callq	_MBOX_BIT
	testl	%ebx, %eax
	je	LBB0_6
## %bb.4:                               ##   in Loop: Header=BB0_5 Depth=1
	xorl	%eax, %eax
	callq	_cpu_relax
	jmp	LBB0_5
LBB0_2:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_7
LBB0_6:
	movq	_MB1H_ARM_APE_OPP@GOTPCREL(%rip), %r12
	movq	(%r12), %rdi
	movq	_tcdm_base@GOTPCREL(%rip), %rbx
	movq	_PRCM_MBOX_HEADER_REQ_MB1@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	(%rbx), %rsi
	callq	_writeb
	movq	_PRCM_REQ_MB1_ARM_OPP@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	(%rbx), %rsi
	movq	%r15, %rdi
	callq	_writeb
	movq	_APE_NO_CHANGE@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	movq	_PRCM_REQ_MB1_APE_OPP@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	(%rbx), %rsi
	callq	_writeb
	movl	$1, %edi
	callq	_MBOX_BIT
	movq	_PRCM_MBOX_CPU_SET@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movl	%eax, %edi
	callq	_writel
	leaq	24(%r14), %rdi
	callq	_wait_for_completion
	movq	8(%r14), %rax
	xorq	(%r12), %rax
	xorq	16(%r14), %r15
	movq	_EIO@GOTPCREL(%rip), %rcx
	xorl	%ebx, %ebx
	subl	(%rcx), %ebx
	xorl	%ecx, %ecx
	orq	%rax, %r15
	cmovel	%ecx, %ebx
	movq	%r14, %rdi
	callq	_mutex_unlock
LBB0_7:
	movl	%ebx, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ARM_NO_CHANGE,8,3              ## @ARM_NO_CHANGE
	.comm	_ARM_EXTCLK,8,3                 ## @ARM_EXTCLK
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_mb1_transfer,32,3              ## @mb1_transfer
	.comm	_PRCM_MBOX_CPU_VAL,4,2          ## @PRCM_MBOX_CPU_VAL
	.comm	_MB1H_ARM_APE_OPP,8,3           ## @MB1H_ARM_APE_OPP
	.comm	_tcdm_base,8,3                  ## @tcdm_base
	.comm	_PRCM_MBOX_HEADER_REQ_MB1,8,3   ## @PRCM_MBOX_HEADER_REQ_MB1
	.comm	_PRCM_REQ_MB1_ARM_OPP,8,3       ## @PRCM_REQ_MB1_ARM_OPP
	.comm	_APE_NO_CHANGE,8,3              ## @APE_NO_CHANGE
	.comm	_PRCM_REQ_MB1_APE_OPP,8,3       ## @PRCM_REQ_MB1_APE_OPP
	.comm	_PRCM_MBOX_CPU_SET,4,2          ## @PRCM_MBOX_CPU_SET
	.comm	_EIO,4,2                        ## @EIO
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_db8500_prcmu_set_arm_opp       ; -- Begin function db8500_prcmu_set_arm_opp
	.p2align	2
_db8500_prcmu_set_arm_opp:              ; @db8500_prcmu_set_arm_opp
	.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
Lloh0:
	adrp	x8, _ARM_NO_CHANGE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ARM_NO_CHANGE@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
Lloh3:
	adrp	x9, _ARM_EXTCLK@GOTPAGE
Lloh4:
	ldr	x9, [x9, _ARM_EXTCLK@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	cmp	x8, x0
	ccmp	x9, x0, #8, le
	b.ge	LBB0_2
; %bb.1:
Lloh6:
	adrp	x8, _EINVAL@GOTPAGE
Lloh7:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	neg	w19, w8
	b	LBB0_6
LBB0_2:
	mov	x19, x0
Lloh9:
	adrp	x20, _mb1_transfer@GOTPAGE
Lloh10:
	ldr	x20, [x20, _mb1_transfer@GOTPAGEOFF]
	mov	x0, x20
	bl	_mutex_lock
Lloh11:
	adrp	x22, _PRCM_MBOX_CPU_VAL@GOTPAGE
Lloh12:
	ldr	x22, [x22, _PRCM_MBOX_CPU_VAL@GOTPAGEOFF]
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x22]
	bl	_readl
	mov	x21, x0
	mov	w0, #1
	bl	_MBOX_BIT
	tst	w0, w21
	b.eq	LBB0_5
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	bl	_cpu_relax
	b	LBB0_3
LBB0_5:
Lloh13:
	adrp	x21, _MB1H_ARM_APE_OPP@GOTPAGE
Lloh14:
	ldr	x21, [x21, _MB1H_ARM_APE_OPP@GOTPAGEOFF]
Lloh15:
	adrp	x22, _tcdm_base@GOTPAGE
Lloh16:
	ldr	x22, [x22, _tcdm_base@GOTPAGEOFF]
	ldr	x0, [x21]
	ldr	x8, [x22]
Lloh17:
	adrp	x9, _PRCM_MBOX_HEADER_REQ_MB1@GOTPAGE
Lloh18:
	ldr	x9, [x9, _PRCM_MBOX_HEADER_REQ_MB1@GOTPAGEOFF]
Lloh19:
	ldr	x9, [x9]
	add	x1, x9, x8
	bl	_writeb
	ldr	x8, [x22]
Lloh20:
	adrp	x9, _PRCM_REQ_MB1_ARM_OPP@GOTPAGE
Lloh21:
	ldr	x9, [x9, _PRCM_REQ_MB1_ARM_OPP@GOTPAGEOFF]
Lloh22:
	ldr	x9, [x9]
	add	x1, x9, x8
	mov	x0, x19
	bl	_writeb
Lloh23:
	adrp	x8, _APE_NO_CHANGE@GOTPAGE
Lloh24:
	ldr	x8, [x8, _APE_NO_CHANGE@GOTPAGEOFF]
Lloh25:
	ldr	x0, [x8]
	ldr	x8, [x22]
Lloh26:
	adrp	x9, _PRCM_REQ_MB1_APE_OPP@GOTPAGE
Lloh27:
	ldr	x9, [x9, _PRCM_REQ_MB1_APE_OPP@GOTPAGEOFF]
Lloh28:
	ldr	x9, [x9]
	add	x1, x9, x8
	bl	_writeb
	mov	w0, #1
	bl	_MBOX_BIT
Lloh29:
	adrp	x8, _PRCM_MBOX_CPU_SET@GOTPAGE
Lloh30:
	ldr	x8, [x8, _PRCM_MBOX_CPU_SET@GOTPAGEOFF]
Lloh31:
	ldr	w1, [x8]
	bl	_writel
	add	x0, x20, #24
	bl	_wait_for_completion
	ldr	x8, [x21]
	ldp	x9, x10, [x20, #8]
	cmp	x10, x19
	ccmp	x9, x8, #0, eq
Lloh32:
	adrp	x8, _EIO@GOTPAGE
Lloh33:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh34:
	ldr	w8, [x8]
	csneg	w19, wzr, w8, eq
	mov	x0, x20
	bl	_mutex_unlock
LBB0_6:
	mov	x0, x19
	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	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_ARM_NO_CHANGE,8,3              ; @ARM_NO_CHANGE
	.comm	_ARM_EXTCLK,8,3                 ; @ARM_EXTCLK
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_mb1_transfer,32,3              ; @mb1_transfer
	.comm	_PRCM_MBOX_CPU_VAL,4,2          ; @PRCM_MBOX_CPU_VAL
	.comm	_MB1H_ARM_APE_OPP,8,3           ; @MB1H_ARM_APE_OPP
	.comm	_tcdm_base,8,3                  ; @tcdm_base
	.comm	_PRCM_MBOX_HEADER_REQ_MB1,8,3   ; @PRCM_MBOX_HEADER_REQ_MB1
	.comm	_PRCM_REQ_MB1_ARM_OPP,8,3       ; @PRCM_REQ_MB1_ARM_OPP
	.comm	_APE_NO_CHANGE,8,3              ; @APE_NO_CHANGE
	.comm	_PRCM_REQ_MB1_APE_OPP,8,3       ; @PRCM_REQ_MB1_APE_OPP
	.comm	_PRCM_MBOX_CPU_SET,4,2          ; @PRCM_MBOX_CPU_SET
	.comm	_EIO,4,2                        ; @EIO
.subsections_via_symbols
