	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pcc_mbox_request_channel       ## -- Begin function pcc_mbox_request_channel
	.p2align	4, 0x90
_pcc_mbox_request_channel:              ## @pcc_mbox_request_channel
	.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
	movl	%esi, %ebx
	movq	%rdi, %r12
	movq	_pcc_mbox_ctrl@GOTPCREL(%rip), %rax
	movq	(%rax), %r14
	movl	%esi, %edi
	callq	_get_pcc_channel
	movq	%rax, %r15
	movq	%rax, %rdi
	callq	_IS_ERR
	testq	%rax, %rax
	jne	LBB0_2
## %bb.1:
	cmpq	$0, 16(%r15)
	je	LBB0_3
LBB0_2:
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
	movl	%ebx, %edx
	callq	_dev_err
	movq	_EBUSY@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_9:
	movl	%ebx, %edi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_ERR_PTR                        ## TAILCALL
LBB0_3:
	leaq	8(%r15), %r13
	movq	%r13, %rdi
	callq	_spin_lock_irqsave
	xorps	%xmm0, %xmm0
	movups	%xmm0, 24(%r15)
	movq	$0, 40(%r15)
	movq	%r12, 16(%r15)
	movq	%r15, %rdi
	addq	$12, %rdi
	callq	_init_completion
	movq	(%r15), %rax
	movq	_TXDONE_BY_POLL@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_6
## %bb.4:
	cmpq	$0, (%r12)
	je	LBB0_6
## %bb.5:
	movq	_TXDONE_BY_ACK@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, (%r15)
LBB0_6:
	movq	%r13, %rdi
	callq	_spin_unlock_irqrestore
	movq	_pcc_doorbell_irq@GOTPCREL(%rip), %r12
	movq	(%r12), %rax
	movslq	%ebx, %r13
	movl	(%rax,%r13,4), %esi
	testl	%esi, %esi
	jle	LBB0_10
## %bb.7:
	movq	_pcc_mbox_irq@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_MBOX_IRQ_NAME@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	movq	%r14, %rdi
	xorl	%ecx, %ecx
	movq	%r15, %r9
	callq	_devm_request_irq
	movl	%eax, %ebx
	movl	%eax, %edi
	callq	_unlikely
	testq	%rax, %rax
	je	LBB0_10
## %bb.8:
	movq	(%r12), %rax
	movl	(%rax,%r13,4), %edx
	leaq	L_.str.1(%rip), %rsi
	movq	%r14, %rdi
	callq	_dev_err
	movq	%r15, %rdi
	callq	_pcc_mbox_free_channel
	jmp	LBB0_9
LBB0_10:
	movq	%r15, %rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_pcc_mbox_ctrl,8,3              ## @pcc_mbox_ctrl
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Channel not found for idx: %d\n"

	.comm	_EBUSY,4,2                      ## @EBUSY
	.comm	_TXDONE_BY_POLL,8,3             ## @TXDONE_BY_POLL
	.comm	_TXDONE_BY_ACK,8,3              ## @TXDONE_BY_ACK
	.comm	_pcc_doorbell_irq,8,3           ## @pcc_doorbell_irq
	.comm	_pcc_mbox_irq,4,2               ## @pcc_mbox_irq
	.comm	_MBOX_IRQ_NAME,4,2              ## @MBOX_IRQ_NAME
L_.str.1:                               ## @.str.1
	.asciz	"failed to register PCC interrupt %d\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pcc_mbox_request_channel       ; -- Begin function pcc_mbox_request_channel
	.p2align	2
_pcc_mbox_request_channel:              ; @pcc_mbox_request_channel
	.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
	mov	x20, x1
	mov	x22, x0
Lloh0:
	adrp	x8, _pcc_mbox_ctrl@GOTPAGE
Lloh1:
	ldr	x8, [x8, _pcc_mbox_ctrl@GOTPAGEOFF]
Lloh2:
	ldr	x19, [x8]
	mov	x0, x1
	bl	_get_pcc_channel
	mov	x21, x0
	bl	_IS_ERR
	cbnz	x0, LBB0_2
; %bb.1:
	ldr	x8, [x21, #16]
	cbz	x8, LBB0_4
LBB0_2:
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	mov	x2, x20
	bl	_dev_err
Lloh5:
	adrp	x8, _EBUSY@GOTPAGE
Lloh6:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	neg	w22, w8
LBB0_3:
	mov	x0, x22
	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
	b	_ERR_PTR
LBB0_4:
	add	x23, x21, #8
	mov	x0, x23
	bl	_spin_lock_irqsave
	stp	xzr, xzr, [x21, #32]
	add	x0, x21, #12
	stp	x22, xzr, [x21, #16]
	bl	_init_completion
	ldr	x8, [x21]
Lloh8:
	adrp	x9, _TXDONE_BY_POLL@GOTPAGE
Lloh9:
	ldr	x9, [x9, _TXDONE_BY_POLL@GOTPAGEOFF]
Lloh10:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_7
; %bb.5:
	ldr	x8, [x22]
	cbz	x8, LBB0_7
; %bb.6:
Lloh11:
	adrp	x8, _TXDONE_BY_ACK@GOTPAGE
Lloh12:
	ldr	x8, [x8, _TXDONE_BY_ACK@GOTPAGEOFF]
Lloh13:
	ldr	x8, [x8]
	str	x8, [x21]
LBB0_7:
	mov	x0, x23
	bl	_spin_unlock_irqrestore
Lloh14:
	adrp	x23, _pcc_doorbell_irq@GOTPAGE
Lloh15:
	ldr	x23, [x23, _pcc_doorbell_irq@GOTPAGEOFF]
	ldr	x8, [x23]
	ldr	w1, [x8, w20, sxtw #2]
	cmp	w1, #1
	b.lt	LBB0_10
; %bb.8:
Lloh16:
	adrp	x8, _pcc_mbox_irq@GOTPAGE
Lloh17:
	ldr	x8, [x8, _pcc_mbox_irq@GOTPAGEOFF]
Lloh18:
	ldr	w2, [x8]
Lloh19:
	adrp	x8, _MBOX_IRQ_NAME@GOTPAGE
Lloh20:
	ldr	x8, [x8, _MBOX_IRQ_NAME@GOTPAGEOFF]
Lloh21:
	ldr	w4, [x8]
	mov	x0, x19
	mov	w3, #0
	mov	x5, x21
	bl	_devm_request_irq
	mov	x22, x0
	bl	_unlikely
	cbz	x0, LBB0_10
; %bb.9:
	sxtw	x8, w20
	ldr	x9, [x23]
	ldr	w2, [x9, x8, lsl #2]
Lloh22:
	adrp	x1, l_.str.1@PAGE
Lloh23:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_dev_err
	mov	x0, x21
	bl	_pcc_mbox_free_channel
	b	LBB0_3
LBB0_10:
	mov	x0, x21
	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 AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpAdd	Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.comm	_pcc_mbox_ctrl,8,3              ; @pcc_mbox_ctrl
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Channel not found for idx: %d\n"

	.comm	_EBUSY,4,2                      ; @EBUSY
	.comm	_TXDONE_BY_POLL,8,3             ; @TXDONE_BY_POLL
	.comm	_TXDONE_BY_ACK,8,3              ; @TXDONE_BY_ACK
	.comm	_pcc_doorbell_irq,8,3           ; @pcc_doorbell_irq
	.comm	_pcc_mbox_irq,4,2               ; @pcc_mbox_irq
	.comm	_MBOX_IRQ_NAME,4,2              ; @MBOX_IRQ_NAME
l_.str.1:                               ; @.str.1
	.asciz	"failed to register PCC interrupt %d\n"

.subsections_via_symbols
