	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function intel_pmc_ipc_check_status
_intel_pmc_ipc_check_status:            ## @intel_pmc_ipc_check_status
	.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	_ipcdev@GOTPCREL(%rip), %r15
	cmpq	$0, 16(%r15)
	je	LBB0_2
## %bb.1:
	movq	_IPC_MAX_SEC@GOTPCREL(%rip), %rax
	movq	_HZ@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	imull	(%rax), %esi
	leaq	8(%r15), %rdi
	callq	_wait_for_completion_timeout
	xorl	%r13d, %r13d
	testq	%rax, %rax
	jne	LBB0_8
	jmp	LBB0_7
LBB0_2:
	movq	_IPC_LOOP_CNT@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	xorl	%r13d, %r13d
	xorl	%eax, %eax
	callq	_ipc_read_status
	movq	_IPC_STATUS_BUSY@GOTPCREL(%rip), %r14
	testl	%eax, (%r14)
	je	LBB0_6
## %bb.3:
	xorl	%r13d, %r13d
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	decl	%ebx
	je	LBB0_7
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	movl	$1, %edi
	callq	_udelay
	xorl	%eax, %eax
	callq	_ipc_read_status
	testl	%eax, (%r14)
	jne	LBB0_4
	jmp	LBB0_8
LBB0_6:
	testl	%ebx, %ebx
	jne	LBB0_8
LBB0_7:
	movq	_ETIMEDOUT@GOTPCREL(%rip), %rax
	xorl	%r13d, %r13d
	subl	(%rax), %r13d
LBB0_8:
	xorl	%eax, %eax
	callq	_ipc_read_status
	movl	%eax, %r14d
	movq	_ETIMEDOUT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	addl	%r13d, %eax
	jne	LBB0_10
## %bb.9:
	movl	(%r15), %ecx
	movl	4(%r15), %edi
	leaq	L_.str(%rip), %rsi
	movl	%r14d, %edx
	xorl	%eax, %eax
	callq	_dev_err
	jmp	LBB0_15
LBB0_10:
	movq	_IPC_STATUS_ERR@GOTPCREL(%rip), %rax
	testl	%r14d, (%rax)
	je	LBB0_15
## %bb.11:
	movq	_EIO@GOTPCREL(%rip), %rax
	movq	_IPC_CMD_SIZE@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	movl	%r14d, %edx
	sarl	%cl, %edx
	movl	(%rax), %r13d
	movzbl	%dl, %r12d
	movq	_ipc_err_sources@GOTPCREL(%rip), %rbx
	movq	(%rbx), %rdi
	callq	_ARRAY_SIZE
	movl	4(%r15), %edi
	cmpl	%eax, %r12d
	jge	LBB0_13
## %bb.12:
	movq	(%rbx), %rax
	movl	%r12d, %ecx
	movl	(%rax,%rcx,4), %edx
	movl	(%r15), %r8d
	leaq	L_.str.1(%rip), %rsi
	movl	%r14d, %ecx
	xorl	%eax, %eax
	callq	_dev_err
	jmp	LBB0_14
LBB0_13:
	movl	(%r15), %ecx
	leaq	L_.str.2(%rip), %rsi
	movl	%r14d, %edx
	xorl	%eax, %eax
	callq	_dev_err
LBB0_14:
	movq	_IPC_ERR_UNSIGNEDKERNEL@GOTPCREL(%rip), %rax
	movq	_IPC_ERR_EMSECURITY@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %r12d
	movq	_EACCES@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	cmovel	%ecx, %r13d
	cmpl	(%rax), %r12d
	cmovel	%ecx, %r13d
	negl	%r13d
LBB0_15:
	movl	%r13d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ipcdev,24,3                    ## @ipcdev
	.comm	_IPC_MAX_SEC,4,2                ## @IPC_MAX_SEC
	.comm	_HZ,4,2                         ## @HZ
	.comm	_ETIMEDOUT,4,2                  ## @ETIMEDOUT
	.comm	_IPC_LOOP_CNT,4,2               ## @IPC_LOOP_CNT
	.comm	_IPC_STATUS_BUSY,4,2            ## @IPC_STATUS_BUSY
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"IPC timed out, TS=0x%x, CMD=0x%x\n"

	.comm	_IPC_STATUS_ERR,4,2             ## @IPC_STATUS_ERR
	.comm	_EIO,4,2                        ## @EIO
	.comm	_IPC_CMD_SIZE,4,2               ## @IPC_CMD_SIZE
	.comm	_ipc_err_sources,8,3            ## @ipc_err_sources
L_.str.1:                               ## @.str.1
	.asciz	"IPC failed: %s, STS=0x%x, CMD=0x%x\n"

L_.str.2:                               ## @.str.2
	.asciz	"IPC failed: unknown, STS=0x%x, CMD=0x%x\n"

	.comm	_IPC_ERR_UNSIGNEDKERNEL,4,2     ## @IPC_ERR_UNSIGNEDKERNEL
	.comm	_IPC_ERR_EMSECURITY,4,2         ## @IPC_ERR_EMSECURITY
	.comm	_EACCES,4,2                     ## @EACCES
	.no_dead_strip	_intel_pmc_ipc_check_status
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function intel_pmc_ipc_check_status
_intel_pmc_ipc_check_status:            ; @intel_pmc_ipc_check_status
	.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
Lloh0:
	adrp	x21, _ipcdev@GOTPAGE
Lloh1:
	ldr	x21, [x21, _ipcdev@GOTPAGEOFF]
	ldr	x8, [x21, #16]
Lloh2:
	adrp	x22, _ETIMEDOUT@GOTPAGE
Lloh3:
	ldr	x22, [x22, _ETIMEDOUT@GOTPAGEOFF]
	cbz	x8, LBB0_3
; %bb.1:
Lloh4:
	adrp	x8, _IPC_MAX_SEC@GOTPAGE
Lloh5:
	ldr	x8, [x8, _IPC_MAX_SEC@GOTPAGEOFF]
Lloh6:
	ldr	w8, [x8]
Lloh7:
	adrp	x9, _HZ@GOTPAGE
Lloh8:
	ldr	x9, [x9, _HZ@GOTPAGEOFF]
Lloh9:
	ldr	w9, [x9]
	mul	w1, w9, w8
	add	x0, x21, #8
	bl	_wait_for_completion_timeout
	cbnz	x0, LBB0_7
LBB0_2:
	ldr	w8, [x22]
	neg	w20, w8
	b	LBB0_8
LBB0_3:
Lloh10:
	adrp	x8, _IPC_LOOP_CNT@GOTPAGE
Lloh11:
	ldr	x8, [x8, _IPC_LOOP_CNT@GOTPAGEOFF]
Lloh12:
	ldr	w19, [x8]
	bl	_ipc_read_status
Lloh13:
	adrp	x20, _IPC_STATUS_BUSY@GOTPAGE
Lloh14:
	ldr	x20, [x20, _IPC_STATUS_BUSY@GOTPAGEOFF]
	ldr	w8, [x20]
	tst	w8, w0
	b.eq	LBB0_6
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	subs	w19, w19, #1
	b.eq	LBB0_2
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	w0, #1
	bl	_udelay
	bl	_ipc_read_status
	ldr	w8, [x20]
	tst	w8, w0
	b.ne	LBB0_4
	b	LBB0_7
LBB0_6:
	cbz	w19, LBB0_2
LBB0_7:
	mov	w20, #0
LBB0_8:
	bl	_ipc_read_status
	mov	x19, x0
	ldr	w8, [x22]
	cmn	w20, w8
	b.ne	LBB0_10
; %bb.9:
	ldp	w3, w0, [x21]
Lloh15:
	adrp	x1, l_.str@PAGE
Lloh16:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x19
	bl	_dev_err
	b	LBB0_15
LBB0_10:
Lloh17:
	adrp	x8, _IPC_STATUS_ERR@GOTPAGE
Lloh18:
	ldr	x8, [x8, _IPC_STATUS_ERR@GOTPAGEOFF]
Lloh19:
	ldr	w8, [x8]
	tst	w8, w19
	b.eq	LBB0_15
; %bb.11:
Lloh20:
	adrp	x8, _EIO@GOTPAGE
Lloh21:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh22:
	ldr	w20, [x8]
Lloh23:
	adrp	x8, _IPC_CMD_SIZE@GOTPAGE
Lloh24:
	ldr	x8, [x8, _IPC_CMD_SIZE@GOTPAGEOFF]
Lloh25:
	ldr	w8, [x8]
	asr	w8, w19, w8
	and	w22, w8, #0xff
Lloh26:
	adrp	x23, _ipc_err_sources@GOTPAGE
Lloh27:
	ldr	x23, [x23, _ipc_err_sources@GOTPAGEOFF]
	ldr	x0, [x23]
	bl	_ARRAY_SIZE
	mov	x8, x0
	ldr	w0, [x21, #4]
	cmp	w22, w8
	b.ge	LBB0_13
; %bb.12:
	ldr	x8, [x23]
	ldr	w2, [x8, w22, uxtw #2]
	ldr	w8, [x21]
	str	x8, [sp]
Lloh28:
	adrp	x1, l_.str.1@PAGE
Lloh29:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x3, x19
	b	LBB0_14
LBB0_13:
	ldr	w3, [x21]
Lloh30:
	adrp	x1, l_.str.2@PAGE
Lloh31:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x2, x19
LBB0_14:
	bl	_dev_err
Lloh32:
	adrp	x8, _IPC_ERR_UNSIGNEDKERNEL@GOTPAGE
Lloh33:
	ldr	x8, [x8, _IPC_ERR_UNSIGNEDKERNEL@GOTPAGEOFF]
Lloh34:
	ldr	w8, [x8]
Lloh35:
	adrp	x9, _IPC_ERR_EMSECURITY@GOTPAGE
Lloh36:
	ldr	x9, [x9, _IPC_ERR_EMSECURITY@GOTPAGEOFF]
Lloh37:
	ldr	w9, [x9]
	cmp	w22, w9
	ccmp	w22, w8, #4, ne
Lloh38:
	adrp	x8, _EACCES@GOTPAGE
Lloh39:
	ldr	x8, [x8, _EACCES@GOTPAGEOFF]
Lloh40:
	ldr	w8, [x8]
	csel	w8, w8, w20, eq
	neg	w20, w8
LBB0_15:
	mov	x0, x20
	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 AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpAdd	Lloh28, Lloh29
	.loh AdrpAdd	Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh38, Lloh39, Lloh40
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.cfi_endproc
                                        ; -- End function
	.comm	_ipcdev,24,3                    ; @ipcdev
	.comm	_IPC_MAX_SEC,4,2                ; @IPC_MAX_SEC
	.comm	_HZ,4,2                         ; @HZ
	.comm	_ETIMEDOUT,4,2                  ; @ETIMEDOUT
	.comm	_IPC_LOOP_CNT,4,2               ; @IPC_LOOP_CNT
	.comm	_IPC_STATUS_BUSY,4,2            ; @IPC_STATUS_BUSY
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"IPC timed out, TS=0x%x, CMD=0x%x\n"

	.comm	_IPC_STATUS_ERR,4,2             ; @IPC_STATUS_ERR
	.comm	_EIO,4,2                        ; @EIO
	.comm	_IPC_CMD_SIZE,4,2               ; @IPC_CMD_SIZE
	.comm	_ipc_err_sources,8,3            ; @ipc_err_sources
l_.str.1:                               ; @.str.1
	.asciz	"IPC failed: %s, STS=0x%x, CMD=0x%x\n"

l_.str.2:                               ; @.str.2
	.asciz	"IPC failed: unknown, STS=0x%x, CMD=0x%x\n"

	.comm	_IPC_ERR_UNSIGNEDKERNEL,4,2     ; @IPC_ERR_UNSIGNEDKERNEL
	.comm	_IPC_ERR_EMSECURITY,4,2         ; @IPC_ERR_EMSECURITY
	.comm	_EACCES,4,2                     ; @EACCES
	.no_dead_strip	_intel_pmc_ipc_check_status
.subsections_via_symbols
