	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function xgene_hwmon_pcc_rd
_xgene_hwmon_pcc_rd:                    ## @xgene_hwmon_pcc_rd
	.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	%rsi, %r15
	movq	%rdi, %r14
	movq	40(%rdi), %r13
	addq	$8, %rdi
	movq	%rdi, -48(%rbp)                 ## 8-byte Spill
	callq	_mutex_lock
	leaq	36(%r14), %r12
	movq	%r12, %rdi
	callq	_init_completion
	movl	$1, (%r14)
	movl	(%r13), %ebx
	movq	_PCC_SIGNATURE_MASK@GOTPCREL(%rip), %rax
	movl	4(%r14), %edi
	orl	(%rax), %edi
	callq	_cpu_to_le32
	movl	%ebx, %edi
	movl	%eax, %esi
	callq	_WRITE_ONCE
	movl	4(%r13), %ebx
	movl	(%r15), %edi
	callq	_MSG_TYPE
	movq	_PCCC_GENERATE_DB_INT@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movl	%eax, %edi
	callq	_cpu_to_le16
	movl	%ebx, %edi
	movl	%eax, %esi
	callq	_WRITE_ONCE
	movl	8(%r13), %edi
	callq	_READ_ONCE
	movl	%eax, %edi
	callq	_le16_to_cpu
	movq	_PCCS_CMD_COMPLETE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
	notl	%edi
	andl	%eax, %edi
	movl	8(%r13), %ebx
	callq	_cpu_to_le16
	movl	%ebx, %edi
	movl	%eax, %esi
	callq	_WRITE_ONCE
	movl	12(%r13), %ebx
	movl	(%r15), %edi
	callq	_cpu_to_le32
	movl	%ebx, %edi
	movl	%eax, %esi
	callq	_WRITE_ONCE
	movl	12(%r14), %edi
	movq	%r15, %rsi
	callq	_mbox_send_message
	movl	%eax, %r13d
	testl	%eax, %eax
	js	LBB0_1
## %bb.2:
	movl	32(%r14), %edi
	callq	_usecs_to_jiffies
	movq	%r12, %rdi
	movl	%eax, %esi
	callq	_wait_for_completion_timeout
	testl	%eax, %eax
	je	LBB0_3
## %bb.4:
	movl	16(%r14), %edi
	callq	_MSG_TYPE
	movq	_MSG_TYPE_ERR@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jne	LBB0_6
## %bb.5:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r13d, %r13d
	subl	(%rax), %r13d
	jmp	LBB0_7
LBB0_1:
	movl	28(%r14), %edi
	leaq	L_.str(%rip), %rsi
	movl	%r13d, %edx
	xorl	%eax, %eax
	callq	_dev_err
	jmp	LBB0_7
LBB0_3:
	movl	28(%r14), %edi
	leaq	L_.str.1(%rip), %rsi
	xorl	%r13d, %r13d
	xorl	%eax, %eax
	callq	_dev_err
	movq	_ETIMEDOUT@GOTPCREL(%rip), %rax
	subl	(%rax), %r13d
	jmp	LBB0_7
LBB0_6:
	movl	16(%r14), %eax
	movl	%eax, (%r15)
	movl	20(%r14), %eax
	movl	%eax, 4(%r15)
	movl	24(%r14), %eax
	movl	%eax, 8(%r15)
LBB0_7:
	movl	12(%r14), %edi
	xorl	%esi, %esi
	callq	_mbox_chan_txdone
	movl	$0, (%r14)
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_mutex_unlock
	movl	%r13d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PCC_SIGNATURE_MASK,4,2         ## @PCC_SIGNATURE_MASK
	.comm	_PCCC_GENERATE_DB_INT,4,2       ## @PCCC_GENERATE_DB_INT
	.comm	_PCCS_CMD_COMPLETE,4,2          ## @PCCS_CMD_COMPLETE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Mailbox send error %d\n"

L_.str.1:                               ## @.str.1
	.asciz	"Mailbox operation timed out\n"

	.comm	_ETIMEDOUT,4,2                  ## @ETIMEDOUT
	.comm	_MSG_TYPE_ERR,4,2               ## @MSG_TYPE_ERR
	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_xgene_hwmon_pcc_rd
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function xgene_hwmon_pcc_rd
_xgene_hwmon_pcc_rd:                    ; @xgene_hwmon_pcc_rd
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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	x21, x1
	mov	x20, x0
	ldr	x24, [x0, #40]
	add	x19, x0, #8
	mov	x0, x19
	bl	_mutex_lock
	add	x22, x20, #36
	mov	x0, x22
	bl	_init_completion
	mov	w8, #1
	str	w8, [x20]
	ldr	w23, [x24]
Lloh0:
	adrp	x8, _PCC_SIGNATURE_MASK@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PCC_SIGNATURE_MASK@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	ldr	w9, [x20, #4]
	orr	w0, w9, w8
	bl	_cpu_to_le32
	mov	x1, x0
	mov	x0, x23
	bl	_WRITE_ONCE
	ldr	w23, [x24, #4]
	ldr	w0, [x21]
	bl	_MSG_TYPE
Lloh3:
	adrp	x8, _PCCC_GENERATE_DB_INT@GOTPAGE
Lloh4:
	ldr	x8, [x8, _PCCC_GENERATE_DB_INT@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	orr	w0, w8, w0
	bl	_cpu_to_le16
	mov	x1, x0
	mov	x0, x23
	bl	_WRITE_ONCE
	ldr	w0, [x24, #8]
	bl	_READ_ONCE
	bl	_le16_to_cpu
Lloh6:
	adrp	x8, _PCCS_CMD_COMPLETE@GOTPAGE
Lloh7:
	ldr	x8, [x8, _PCCS_CMD_COMPLETE@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	bic	w0, w0, w8
	ldr	w23, [x24, #8]
	bl	_cpu_to_le16
	mov	x1, x0
	mov	x0, x23
	bl	_WRITE_ONCE
	ldr	w23, [x24, #12]
	ldr	w0, [x21]
	bl	_cpu_to_le32
	mov	x1, x0
	mov	x0, x23
	bl	_WRITE_ONCE
	ldr	w0, [x20, #12]
	mov	x1, x21
	bl	_mbox_send_message
	mov	x23, x0
	tbnz	w0, #31, LBB0_4
; %bb.1:
	ldr	w0, [x20, #32]
	bl	_usecs_to_jiffies
	mov	x1, x0
	mov	x0, x22
	bl	_wait_for_completion_timeout
	cbz	w0, LBB0_5
; %bb.2:
	ldr	w0, [x20, #16]
	bl	_MSG_TYPE
Lloh9:
	adrp	x8, _MSG_TYPE_ERR@GOTPAGE
Lloh10:
	ldr	x8, [x8, _MSG_TYPE_ERR@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	cmp	w0, w8
	b.ne	LBB0_7
; %bb.3:
Lloh12:
	adrp	x8, _EINVAL@GOTPAGE
Lloh13:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_6
LBB0_4:
	ldr	w0, [x20, #28]
	str	x23, [sp]
Lloh14:
	adrp	x1, l_.str@PAGE
Lloh15:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
	b	LBB0_8
LBB0_5:
	ldr	w0, [x20, #28]
Lloh16:
	adrp	x1, l_.str.1@PAGE
Lloh17:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_err
Lloh18:
	adrp	x8, _ETIMEDOUT@GOTPAGE
Lloh19:
	ldr	x8, [x8, _ETIMEDOUT@GOTPAGEOFF]
LBB0_6:
	ldr	w8, [x8]
	neg	w23, w8
	b	LBB0_8
LBB0_7:
	ldr	w8, [x20, #16]
	str	w8, [x21]
	ldr	w8, [x20, #20]
	str	w8, [x21, #4]
	ldr	w8, [x20, #24]
	str	w8, [x21, #8]
LBB0_8:
	ldr	w0, [x20, #12]
	mov	w1, #0
	bl	_mbox_chan_txdone
	str	wzr, [x20]
	mov	x0, x19
	bl	_mutex_unlock
	mov	x0, x23
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpAdd	Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_PCC_SIGNATURE_MASK,4,2         ; @PCC_SIGNATURE_MASK
	.comm	_PCCC_GENERATE_DB_INT,4,2       ; @PCCC_GENERATE_DB_INT
	.comm	_PCCS_CMD_COMPLETE,4,2          ; @PCCS_CMD_COMPLETE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Mailbox send error %d\n"

l_.str.1:                               ; @.str.1
	.asciz	"Mailbox operation timed out\n"

	.comm	_ETIMEDOUT,4,2                  ; @ETIMEDOUT
	.comm	_MSG_TYPE_ERR,4,2               ; @MSG_TYPE_ERR
	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_xgene_hwmon_pcc_rd
.subsections_via_symbols
