	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_db8500_prcmu_request_ape_opp_100_voltage ## -- Begin function db8500_prcmu_request_ape_opp_100_voltage
	.p2align	4, 0x90
_db8500_prcmu_request_ape_opp_100_voltage: ## @db8500_prcmu_request_ape_opp_100_voltage
	.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	%edi, %ebx
	movq	_mb1_transfer@GOTPCREL(%rip), %r14
	movq	%r14, %rdi
	callq	_mutex_lock
	movl	_db8500_prcmu_request_ape_opp_100_voltage.requests(%rip), %eax
	testl	%ebx, %ebx
	je	LBB0_3
## %bb.1:
	leal	1(%rax), %ecx
	movl	%ecx, _db8500_prcmu_request_ape_opp_100_voltage.requests(%rip)
	xorl	%ebx, %ebx
	testl	%eax, %eax
	jne	LBB0_12
## %bb.2:
	movq	_MB1H_REQUEST_APE_OPP_100_VOLT@GOTPCREL(%rip), %rax
	jmp	LBB0_6
LBB0_3:
	testl	%eax, %eax
	je	LBB0_11
## %bb.4:
	leal	-1(%rax), %ecx
	movl	%ecx, _db8500_prcmu_request_ape_opp_100_voltage.requests(%rip)
	xorl	%ebx, %ebx
	cmpl	$1, %eax
	jne	LBB0_12
## %bb.5:
	movq	_MB1H_RELEASE_APE_OPP_100_VOLT@GOTPCREL(%rip), %rax
LBB0_6:
	movq	(%rax), %r15
	movq	_PRCM_MBOX_CPU_VAL@GOTPCREL(%rip), %r12
	.p2align	4, 0x90
LBB0_8:                                 ## =>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_9
## %bb.7:                               ##   in Loop: Header=BB0_8 Depth=1
	xorl	%eax, %eax
	callq	_cpu_relax
	jmp	LBB0_8
LBB0_9:
	movq	_tcdm_base@GOTPCREL(%rip), %rax
	movq	_PRCM_MBOX_HEADER_REQ_MB1@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rsi
	addq	(%rax), %rsi
	movq	%r15, %rdi
	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
	cmpq	%r15, 8(%r14)
	jne	LBB0_11
## %bb.10:
	movl	16(%r14), %r14d
	xorl	%ebx, %ebx
	xorl	%edi, %edi
	callq	_BIT
	testl	%r14d, %eax
	je	LBB0_12
LBB0_11:
	movq	_EIO@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_12:
	movq	_mb1_transfer@GOTPCREL(%rip), %rdi
	callq	_mutex_unlock
	movl	%ebx, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
.zerofill __DATA,__bss,_db8500_prcmu_request_ape_opp_100_voltage.requests,4,2 ## @db8500_prcmu_request_ape_opp_100_voltage.requests
	.comm	_mb1_transfer,32,3              ## @mb1_transfer
	.comm	_MB1H_REQUEST_APE_OPP_100_VOLT,8,3 ## @MB1H_REQUEST_APE_OPP_100_VOLT
	.comm	_EIO,4,2                        ## @EIO
	.comm	_MB1H_RELEASE_APE_OPP_100_VOLT,8,3 ## @MB1H_RELEASE_APE_OPP_100_VOLT
	.comm	_PRCM_MBOX_CPU_VAL,4,2          ## @PRCM_MBOX_CPU_VAL
	.comm	_tcdm_base,8,3                  ## @tcdm_base
	.comm	_PRCM_MBOX_HEADER_REQ_MB1,8,3   ## @PRCM_MBOX_HEADER_REQ_MB1
	.comm	_PRCM_MBOX_CPU_SET,4,2          ## @PRCM_MBOX_CPU_SET
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_db8500_prcmu_request_ape_opp_100_voltage ; -- Begin function db8500_prcmu_request_ape_opp_100_voltage
	.p2align	2
_db8500_prcmu_request_ape_opp_100_voltage: ; @db8500_prcmu_request_ape_opp_100_voltage
	.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, x0
Lloh0:
	adrp	x19, _mb1_transfer@GOTPAGE
Lloh1:
	ldr	x19, [x19, _mb1_transfer@GOTPAGEOFF]
	mov	x0, x19
	bl	_mutex_lock
	adrp	x8, _db8500_prcmu_request_ape_opp_100_voltage.requests@PAGE
	ldr	w9, [x8, _db8500_prcmu_request_ape_opp_100_voltage.requests@PAGEOFF]
	cbz	w20, LBB0_3
; %bb.1:
	add	w10, w9, #1
	str	w10, [x8, _db8500_prcmu_request_ape_opp_100_voltage.requests@PAGEOFF]
	cbnz	w9, LBB0_12
; %bb.2:
Lloh2:
	adrp	x8, _MB1H_REQUEST_APE_OPP_100_VOLT@GOTPAGE
Lloh3:
	ldr	x8, [x8, _MB1H_REQUEST_APE_OPP_100_VOLT@GOTPAGEOFF]
	b	LBB0_6
LBB0_3:
	cbz	w9, LBB0_11
; %bb.4:
	subs	w9, w9, #1
	str	w9, [x8, _db8500_prcmu_request_ape_opp_100_voltage.requests@PAGEOFF]
	b.ne	LBB0_12
; %bb.5:
Lloh4:
	adrp	x8, _MB1H_RELEASE_APE_OPP_100_VOLT@GOTPAGE
Lloh5:
	ldr	x8, [x8, _MB1H_RELEASE_APE_OPP_100_VOLT@GOTPAGEOFF]
LBB0_6:
	ldr	x20, [x8]
Lloh6:
	adrp	x22, _PRCM_MBOX_CPU_VAL@GOTPAGE
Lloh7:
	ldr	x22, [x22, _PRCM_MBOX_CPU_VAL@GOTPAGEOFF]
LBB0_7:                                 ; =>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_9
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=1
	bl	_cpu_relax
	b	LBB0_7
LBB0_9:
Lloh8:
	adrp	x8, _tcdm_base@GOTPAGE
Lloh9:
	ldr	x8, [x8, _tcdm_base@GOTPAGEOFF]
Lloh10:
	ldr	x8, [x8]
Lloh11:
	adrp	x9, _PRCM_MBOX_HEADER_REQ_MB1@GOTPAGE
Lloh12:
	ldr	x9, [x9, _PRCM_MBOX_HEADER_REQ_MB1@GOTPAGEOFF]
Lloh13:
	ldr	x9, [x9]
	add	x1, x9, x8
	mov	x0, x20
	bl	_writeb
	mov	w0, #1
	bl	_MBOX_BIT
Lloh14:
	adrp	x8, _PRCM_MBOX_CPU_SET@GOTPAGE
Lloh15:
	ldr	x8, [x8, _PRCM_MBOX_CPU_SET@GOTPAGEOFF]
Lloh16:
	ldr	w1, [x8]
	bl	_writel
	add	x0, x19, #24
	bl	_wait_for_completion
	ldr	x8, [x19, #8]
	cmp	x8, x20
	b.ne	LBB0_11
; %bb.10:
	ldr	w19, [x19, #16]
	mov	w0, #0
	bl	_BIT
	tst	w0, w19
	b.eq	LBB0_12
LBB0_11:
Lloh17:
	adrp	x8, _EIO@GOTPAGE
Lloh18:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh19:
	ldr	w8, [x8]
	neg	w19, w8
	b	LBB0_13
LBB0_12:
	mov	w19, #0
LBB0_13:
Lloh20:
	adrp	x0, _mb1_transfer@GOTPAGE
Lloh21:
	ldr	x0, [x0, _mb1_transfer@GOTPAGEOFF]
	bl	_mutex_unlock
	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 AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh20, Lloh21
	.cfi_endproc
                                        ; -- End function
.zerofill __DATA,__bss,_db8500_prcmu_request_ape_opp_100_voltage.requests,4,2 ; @db8500_prcmu_request_ape_opp_100_voltage.requests
	.comm	_mb1_transfer,32,3              ; @mb1_transfer
	.comm	_MB1H_REQUEST_APE_OPP_100_VOLT,8,3 ; @MB1H_REQUEST_APE_OPP_100_VOLT
	.comm	_EIO,4,2                        ; @EIO
	.comm	_MB1H_RELEASE_APE_OPP_100_VOLT,8,3 ; @MB1H_RELEASE_APE_OPP_100_VOLT
	.comm	_PRCM_MBOX_CPU_VAL,4,2          ; @PRCM_MBOX_CPU_VAL
	.comm	_tcdm_base,8,3                  ; @tcdm_base
	.comm	_PRCM_MBOX_HEADER_REQ_MB1,8,3   ; @PRCM_MBOX_HEADER_REQ_MB1
	.comm	_PRCM_MBOX_CPU_SET,4,2          ; @PRCM_MBOX_CPU_SET
.subsections_via_symbols
