	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_intel_punit_ipc_command        ## -- Begin function intel_punit_ipc_command
	.p2align	4, 0x90
_intel_punit_ipc_command:               ## @intel_punit_ipc_command
	.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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%r8, -56(%rbp)                  ## 8-byte Spill
	movq	%rcx, %r13
	movl	%edx, -44(%rbp)                 ## 4-byte Spill
	movl	%esi, %r12d
	movl	%edi, %r14d
	movq	_punit_ipcdev@GOTPCREL(%rip), %rax
	movq	(%rax), %r15
	movq	%r15, %rdi
	callq	_mutex_lock
	leaq	4(%r15), %rdi
	callq	_reinit_completion
	movq	_IPC_PUNIT_CMD_TYPE_MASK@GOTPCREL(%rip), %rdx
	movl	(%rdx), %ebx
	movl	%r14d, -48(%rbp)                ## 4-byte Spill
	andl	%r14d, %ebx
	movq	_IPC_TYPE_OFFSET@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	sarl	%cl, %ebx
	testq	%r13, %r13
	je	LBB0_4
## %bb.1:
	movq	%rdx, %r14
	movl	(%r13), %edx
	movq	%r15, %rdi
	movl	%ebx, %esi
	callq	_ipc_write_data_low
	movq	_GTDRIVER_IPC@GOTPCREL(%rip), %rax
	cmpl	(%rax), %ebx
	je	LBB0_3
## %bb.2:
	movq	%r14, %rdx
	movq	_ISPDRIVER_IPC@GOTPCREL(%rip), %rax
	cmpl	(%rax), %ebx
	jne	LBB0_4
LBB0_3:
	movl	4(%r13), %edx
	movq	%r15, %rdi
	movl	%ebx, %esi
	callq	_ipc_write_data_high
	movq	%r14, %rdx
LBB0_4:
	movl	(%rdx), %edx
	notl	%edx
	andl	-48(%rbp), %edx                 ## 4-byte Folded Reload
	movq	_CMD_RUN@GOTPCREL(%rip), %rax
	movq	_CMD_PARA2_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	shll	%cl, %esi
	movq	_CMD_PARA1_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	shll	%cl, %r12d
	orl	%esi, %r12d
	orl	(%rax), %edx
	orl	%r12d, %edx
	movq	%r15, %rdi
	movl	%ebx, %esi
	callq	_ipc_write_cmd
	movq	%r15, %rdi
	movl	%ebx, %esi
	callq	_intel_punit_ipc_check_status
	movl	%eax, %r14d
	movq	-56(%rbp), %r12                 ## 8-byte Reload
	testq	%r12, %r12
	je	LBB0_9
## %bb.5:
	testl	%r14d, %r14d
	jne	LBB0_9
## %bb.6:
	movq	%r15, %rdi
	movl	%ebx, %esi
	callq	_ipc_read_data_low
	movl	%eax, (%r12)
	movq	_GTDRIVER_IPC@GOTPCREL(%rip), %rax
	cmpl	(%rax), %ebx
	je	LBB0_8
## %bb.7:
	movq	_ISPDRIVER_IPC@GOTPCREL(%rip), %rax
	cmpl	(%rax), %ebx
	jne	LBB0_9
LBB0_8:
	movq	%r15, %rdi
	movl	%ebx, %esi
	callq	_ipc_read_data_high
	movl	%eax, 4(%r12)
LBB0_9:
	movq	%r15, %rdi
	callq	_mutex_unlock
	movl	%r14d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_punit_ipcdev,8,3               ## @punit_ipcdev
	.comm	_IPC_PUNIT_CMD_TYPE_MASK,4,2    ## @IPC_PUNIT_CMD_TYPE_MASK
	.comm	_IPC_TYPE_OFFSET,4,2            ## @IPC_TYPE_OFFSET
	.comm	_GTDRIVER_IPC,4,2               ## @GTDRIVER_IPC
	.comm	_ISPDRIVER_IPC,4,2              ## @ISPDRIVER_IPC
	.comm	_CMD_RUN,4,2                    ## @CMD_RUN
	.comm	_CMD_PARA2_SHIFT,4,2            ## @CMD_PARA2_SHIFT
	.comm	_CMD_PARA1_SHIFT,4,2            ## @CMD_PARA1_SHIFT
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_intel_punit_ipc_command        ; -- Begin function intel_punit_ipc_command
	.p2align	2
_intel_punit_ipc_command:               ; @intel_punit_ipc_command
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x19, x4
	mov	x25, x3
	mov	x23, x2
	mov	x22, x1
	mov	x24, x0
Lloh0:
	adrp	x8, _punit_ipcdev@GOTPAGE
Lloh1:
	ldr	x8, [x8, _punit_ipcdev@GOTPAGEOFF]
Lloh2:
	ldr	x20, [x8]
	mov	x0, x20
	bl	_mutex_lock
	add	x0, x20, #4
	bl	_reinit_completion
Lloh3:
	adrp	x28, _IPC_PUNIT_CMD_TYPE_MASK@GOTPAGE
Lloh4:
	ldr	x28, [x28, _IPC_PUNIT_CMD_TYPE_MASK@GOTPAGEOFF]
	ldr	w8, [x28]
	and	w8, w8, w24
Lloh5:
	adrp	x9, _IPC_TYPE_OFFSET@GOTPAGE
Lloh6:
	ldr	x9, [x9, _IPC_TYPE_OFFSET@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
	asr	w21, w8, w9
Lloh8:
	adrp	x26, _GTDRIVER_IPC@GOTPAGE
Lloh9:
	ldr	x26, [x26, _GTDRIVER_IPC@GOTPAGEOFF]
Lloh10:
	adrp	x27, _ISPDRIVER_IPC@GOTPAGE
Lloh11:
	ldr	x27, [x27, _ISPDRIVER_IPC@GOTPAGEOFF]
	cbz	x25, LBB0_3
; %bb.1:
	ldr	w2, [x25]
	mov	x0, x20
	mov	x1, x21
	bl	_ipc_write_data_low
	ldr	w8, [x26]
	ldr	w9, [x27]
	cmp	w21, w8
	ccmp	w21, w9, #4, ne
	b.ne	LBB0_3
; %bb.2:
	ldr	w2, [x25, #4]
	mov	x0, x20
	mov	x1, x21
	bl	_ipc_write_data_high
LBB0_3:
	ldr	w8, [x28]
	bic	w8, w24, w8
Lloh12:
	adrp	x9, _CMD_RUN@GOTPAGE
Lloh13:
	ldr	x9, [x9, _CMD_RUN@GOTPAGEOFF]
Lloh14:
	ldr	w9, [x9]
Lloh15:
	adrp	x10, _CMD_PARA2_SHIFT@GOTPAGE
Lloh16:
	ldr	x10, [x10, _CMD_PARA2_SHIFT@GOTPAGEOFF]
Lloh17:
	ldr	w10, [x10]
Lloh18:
	adrp	x11, _CMD_PARA1_SHIFT@GOTPAGE
Lloh19:
	ldr	x11, [x11, _CMD_PARA1_SHIFT@GOTPAGEOFF]
	lsl	w10, w23, w10
Lloh20:
	ldr	w11, [x11]
	lsl	w11, w22, w11
	orr	w8, w8, w9
	orr	w8, w8, w10
	orr	w2, w8, w11
	mov	x0, x20
	mov	x1, x21
	bl	_ipc_write_cmd
	mov	x0, x20
	mov	x1, x21
	bl	_intel_punit_ipc_check_status
	mov	x22, x0
	cbz	x19, LBB0_7
; %bb.4:
	cbnz	w22, LBB0_7
; %bb.5:
	mov	x0, x20
	mov	x1, x21
	bl	_ipc_read_data_low
	str	w0, [x19]
	ldr	w8, [x26]
	ldr	w9, [x27]
	cmp	w21, w8
	ccmp	w21, w9, #4, ne
	b.ne	LBB0_7
; %bb.6:
	mov	x0, x20
	mov	x1, x21
	bl	_ipc_read_data_high
	str	w0, [x19, #4]
LBB0_7:
	mov	x0, x20
	bl	_mutex_unlock
	mov	x0, x22
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_punit_ipcdev,8,3               ; @punit_ipcdev
	.comm	_IPC_PUNIT_CMD_TYPE_MASK,4,2    ; @IPC_PUNIT_CMD_TYPE_MASK
	.comm	_IPC_TYPE_OFFSET,4,2            ; @IPC_TYPE_OFFSET
	.comm	_GTDRIVER_IPC,4,2               ; @GTDRIVER_IPC
	.comm	_ISPDRIVER_IPC,4,2              ; @ISPDRIVER_IPC
	.comm	_CMD_RUN,4,2                    ; @CMD_RUN
	.comm	_CMD_PARA2_SHIFT,4,2            ; @CMD_PARA2_SHIFT
	.comm	_CMD_PARA1_SHIFT,4,2            ; @CMD_PARA1_SHIFT
.subsections_via_symbols
