	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_db8500_prcmu_set_ape_opp       ## -- Begin function db8500_prcmu_set_ape_opp
	.p2align	4, 0x90
_db8500_prcmu_set_ape_opp:              ## @db8500_prcmu_set_ape_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	%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	_mb1_transfer@GOTPCREL(%rip), %rbx
	xorl	%r15d, %r15d
	cmpq	%rdi, (%rbx)
	je	LBB0_20
## %bb.1:
	movq	%rdi, %r13
	leaq	8(%rbx), %r14
	movq	%r14, %rdi
	callq	_mutex_lock
	movq	(%rbx), %rax
	movq	_APE_50_PARTLY_25_OPP@GOTPCREL(%rip), %r12
	cmpq	(%r12), %rax
	jne	LBB0_3
## %bb.2:
	xorl	%edi, %edi
	callq	_request_even_slower_clocks
	movq	(%rbx), %rax
LBB0_3:
	movq	_APE_100_OPP@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	xorl	%r15d, %r15d
	cmpq	%r13, %rcx
	je	LBB0_5
## %bb.4:
	cmpq	%rcx, %rax
	jne	LBB0_12
LBB0_5:
	movq	%r14, -48(%rbp)                 ## 8-byte Spill
	movq	_PRCM_MBOX_CPU_VAL@GOTPCREL(%rip), %r14
	movl	(%r14), %edi
	callq	_readl
	movl	%eax, %r12d
	movl	$1, %edi
	callq	_MBOX_BIT
	testl	%r12d, %eax
	je	LBB0_7
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	xorl	%eax, %eax
	callq	_cpu_relax
	movl	(%r14), %edi
	callq	_readl
	movl	%eax, %ebx
	movl	$1, %edi
	callq	_MBOX_BIT
	testl	%ebx, %eax
	jne	LBB0_6
LBB0_7:
	movq	_MB1H_ARM_APE_OPP@GOTPCREL(%rip), %r14
	movq	(%r14), %rdi
	movq	_tcdm_base@GOTPCREL(%rip), %r12
	movq	_PRCM_MBOX_HEADER_REQ_MB1@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	(%r12), %rsi
	callq	_writeb
	movq	_ARM_NO_CHANGE@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	movq	_PRCM_REQ_MB1_ARM_OPP@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	(%r12), %rsi
	callq	_writeb
	movq	%r13, %rdi
	movq	_APE_50_PARTLY_25_OPP@GOTPCREL(%rip), %rax
	cmpq	%r13, (%rax)
	movq	_mb1_transfer@GOTPCREL(%rip), %rbx
	jne	LBB0_9
## %bb.8:
	movq	_APE_50_OPP@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
LBB0_9:
	movq	_PRCM_REQ_MB1_APE_OPP@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	(%r12), %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	32(%rbx), %rdi
	callq	_wait_for_completion
	movq	16(%rbx), %rax
	cmpq	(%r14), %rax
	movq	-48(%rbp), %r14                 ## 8-byte Reload
	movq	_APE_50_PARTLY_25_OPP@GOTPCREL(%rip), %r12
	jne	LBB0_11
## %bb.10:
	cmpq	%r13, 24(%rbx)
	je	LBB0_12
LBB0_11:
	movq	_EIO@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
LBB0_12:
	movq	(%r12), %rax
	testl	%r15d, %r15d
	jne	LBB0_14
## %bb.13:
	cmpq	%r13, %rax
	jne	LBB0_14
## %bb.17:
	movl	$1, %edi
	callq	_request_even_slower_clocks
	jmp	LBB0_18
LBB0_14:
	testl	%r15d, %r15d
	je	LBB0_18
## %bb.15:
	cmpq	%rax, (%rbx)
	jne	LBB0_19
## %bb.16:
	movl	$1, %edi
	callq	_request_even_slower_clocks
	jmp	LBB0_19
LBB0_18:
	movq	%r13, (%rbx)
LBB0_19:
	movq	%r14, %rdi
	callq	_mutex_unlock
LBB0_20:
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_mb1_transfer,40,3              ## @mb1_transfer
	.comm	_APE_50_PARTLY_25_OPP,8,3       ## @APE_50_PARTLY_25_OPP
	.comm	_APE_100_OPP,8,3                ## @APE_100_OPP
	.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	_ARM_NO_CHANGE,8,3              ## @ARM_NO_CHANGE
	.comm	_PRCM_REQ_MB1_ARM_OPP,8,3       ## @PRCM_REQ_MB1_ARM_OPP
	.comm	_APE_50_OPP,8,3                 ## @APE_50_OPP
	.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_ape_opp       ; -- Begin function db8500_prcmu_set_ape_opp
	.p2align	2
_db8500_prcmu_set_ape_opp:              ; @db8500_prcmu_set_ape_opp
	.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
Lloh0:
	adrp	x21, _mb1_transfer@GOTPAGE
Lloh1:
	ldr	x21, [x21, _mb1_transfer@GOTPAGEOFF]
	ldr	x8, [x21]
	cmp	x8, x0
	b.ne	LBB0_2
; %bb.1:
	mov	w20, #0
	b	LBB0_19
LBB0_2:
	mov	x19, x0
	add	x0, x21, #8
	bl	_mutex_lock
	ldr	x8, [x21]
Lloh2:
	adrp	x22, _APE_50_PARTLY_25_OPP@GOTPAGE
Lloh3:
	ldr	x22, [x22, _APE_50_PARTLY_25_OPP@GOTPAGEOFF]
	ldr	x9, [x22]
	cmp	x8, x9
	b.ne	LBB0_4
; %bb.3:
	mov	w0, #0
	bl	_request_even_slower_clocks
	ldr	x8, [x21]
LBB0_4:
Lloh4:
	adrp	x9, _APE_100_OPP@GOTPAGE
Lloh5:
	ldr	x9, [x9, _APE_100_OPP@GOTPAGEOFF]
Lloh6:
	ldr	x9, [x9]
	cmp	x9, x19
	ccmp	x8, x9, #4, ne
	b.ne	LBB0_10
; %bb.5:
Lloh7:
	adrp	x23, _PRCM_MBOX_CPU_VAL@GOTPAGE
Lloh8:
	ldr	x23, [x23, _PRCM_MBOX_CPU_VAL@GOTPAGEOFF]
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x23]
	bl	_readl
	mov	x20, x0
	mov	w0, #1
	bl	_MBOX_BIT
	tst	w0, w20
	b.eq	LBB0_8
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	bl	_cpu_relax
	b	LBB0_6
LBB0_8:
Lloh9:
	adrp	x20, _MB1H_ARM_APE_OPP@GOTPAGE
Lloh10:
	ldr	x20, [x20, _MB1H_ARM_APE_OPP@GOTPAGEOFF]
Lloh11:
	adrp	x23, _tcdm_base@GOTPAGE
Lloh12:
	ldr	x23, [x23, _tcdm_base@GOTPAGEOFF]
	ldr	x0, [x20]
	ldr	x8, [x23]
Lloh13:
	adrp	x9, _PRCM_MBOX_HEADER_REQ_MB1@GOTPAGE
Lloh14:
	ldr	x9, [x9, _PRCM_MBOX_HEADER_REQ_MB1@GOTPAGEOFF]
Lloh15:
	ldr	x9, [x9]
	add	x1, x9, x8
	bl	_writeb
Lloh16:
	adrp	x8, _ARM_NO_CHANGE@GOTPAGE
Lloh17:
	ldr	x8, [x8, _ARM_NO_CHANGE@GOTPAGEOFF]
Lloh18:
	ldr	x0, [x8]
	ldr	x8, [x23]
Lloh19:
	adrp	x9, _PRCM_REQ_MB1_ARM_OPP@GOTPAGE
Lloh20:
	ldr	x9, [x9, _PRCM_REQ_MB1_ARM_OPP@GOTPAGEOFF]
Lloh21:
	ldr	x9, [x9]
	add	x1, x9, x8
	bl	_writeb
	ldr	x8, [x22]
Lloh22:
	adrp	x9, _APE_50_OPP@GOTPAGE
Lloh23:
	ldr	x9, [x9, _APE_50_OPP@GOTPAGEOFF]
Lloh24:
	ldr	x9, [x9]
	cmp	x8, x19
	csel	x0, x9, x19, eq
	ldr	x8, [x23]
Lloh25:
	adrp	x9, _PRCM_REQ_MB1_APE_OPP@GOTPAGE
Lloh26:
	ldr	x9, [x9, _PRCM_REQ_MB1_APE_OPP@GOTPAGEOFF]
Lloh27:
	ldr	x9, [x9]
	add	x1, x9, x8
	bl	_writeb
	mov	w0, #1
	bl	_MBOX_BIT
Lloh28:
	adrp	x8, _PRCM_MBOX_CPU_SET@GOTPAGE
Lloh29:
	ldr	x8, [x8, _PRCM_MBOX_CPU_SET@GOTPAGEOFF]
Lloh30:
	ldr	w1, [x8]
	bl	_writel
	add	x0, x21, #32
	bl	_wait_for_completion
	ldr	x8, [x21, #16]
	ldr	x9, [x20]
	cmp	x8, x9
	b.ne	LBB0_11
; %bb.9:
	ldr	x8, [x21, #24]
	cmp	x8, x19
	b.ne	LBB0_11
LBB0_10:
	mov	w20, #0
	ldr	x8, [x22]
	cbz	w20, LBB0_12
	b	LBB0_14
LBB0_11:
Lloh31:
	adrp	x8, _EIO@GOTPAGE
Lloh32:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh33:
	ldr	w8, [x8]
	neg	w20, w8
	ldr	x8, [x22]
	cbnz	w20, LBB0_14
LBB0_12:
	cmp	x8, x19
	b.ne	LBB0_14
; %bb.13:
	mov	w0, #1
	bl	_request_even_slower_clocks
	b	LBB0_17
LBB0_14:
	cbz	w20, LBB0_17
; %bb.15:
	ldr	x9, [x21]
	cmp	x9, x8
	b.ne	LBB0_18
; %bb.16:
	mov	w0, #1
	bl	_request_even_slower_clocks
	b	LBB0_18
LBB0_17:
	str	x19, [x21]
LBB0_18:
	add	x0, x21, #8
	bl	_mutex_unlock
LBB0_19:
	mov	x0, x20
	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
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.cfi_endproc
                                        ; -- End function
	.comm	_mb1_transfer,40,3              ; @mb1_transfer
	.comm	_APE_50_PARTLY_25_OPP,8,3       ; @APE_50_PARTLY_25_OPP
	.comm	_APE_100_OPP,8,3                ; @APE_100_OPP
	.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	_ARM_NO_CHANGE,8,3              ; @ARM_NO_CHANGE
	.comm	_PRCM_REQ_MB1_ARM_OPP,8,3       ; @PRCM_REQ_MB1_ARM_OPP
	.comm	_APE_50_OPP,8,3                 ; @APE_50_OPP
	.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
