	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_hl_fw_send_cpu_message         ## -- Begin function hl_fw_send_cpu_message
	.p2align	4, 0x90
_hl_fw_send_cpu_message:                ## @hl_fw_send_cpu_message
	.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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%r9, %r14
	movl	%r8d, %ebx
	movl	%ecx, %r15d
	movq	%rdx, %r13
	movl	%esi, -72(%rbp)                 ## 4-byte Spill
	movq	%rdi, %r12
	movq	8(%rdi), %rax
	leaq	-76(%rbp), %rdx
	movl	%ecx, %esi
	callq	*8(%rax)
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movl	%ebx, -68(%rbp)                 ## 4-byte Spill
	movq	%r14, -88(%rbp)                 ## 8-byte Spill
	movq	%rax, %rdi
	movq	%r13, %rsi
	movl	%r15d, %edx
	movq	%rax, %rbx
	callq	_memcpy
	leaq	16(%r12), %r14
	movq	%r14, %rdi
	callq	_mutex_lock
	xorl	%r13d, %r13d
	cmpq	$0, 24(%r12)
	jne	LBB0_17
## %bb.3:
	movq	%r14, -56(%rbp)                 ## 8-byte Spill
	movq	%rbx, -64(%rbp)                 ## 8-byte Spill
	movl	%r15d, -44(%rbp)                ## 4-byte Spill
	cmpl	$0, (%r12)
	je	LBB0_6
## %bb.4:
	movq	_EIO@GOTPCREL(%rip), %rax
	xorl	%r13d, %r13d
	subl	(%rax), %r13d
	jmp	LBB0_13
LBB0_1:
	movl	20(%r12), %edi
	leaq	L_.str(%rip), %rsi
	xorl	%r13d, %r13d
	xorl	%eax, %eax
	callq	_dev_err
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	subl	(%rax), %r13d
	jmp	LBB0_18
LBB0_6:
	movl	-76(%rbp), %ecx
	movq	%r12, %rdi
	movl	-72(%rbp), %r14d                ## 4-byte Reload
	movl	%r14d, %esi
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	callq	_hl_hw_queue_send_cb_no_cmpl
	testl	%eax, %eax
	je	LBB0_8
## %bb.7:
	movl	%eax, %r13d
	movl	20(%r12), %edi
	leaq	L_.str.1(%rip), %rsi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_dev_err
LBB0_13:
	movl	-44(%rbp), %r15d                ## 4-byte Reload
	movq	-64(%rbp), %rbx                 ## 8-byte Reload
LBB0_16:
	movq	-56(%rbp), %r14                 ## 8-byte Reload
LBB0_17:
	movq	%r14, %rdi
	callq	_mutex_unlock
	movq	8(%r12), %rax
	movq	%r12, %rdi
	movl	%r15d, %esi
	movq	%rbx, %rdx
	callq	*(%rax)
LBB0_18:
	movl	%r13d, %eax
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	movq	-64(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rsi
	addq	$8, %rsi
	movl	$1, (%rsp)
	movq	%r12, %rdi
	xorl	%ecx, %ecx
	movl	$1000, %r8d                     ## imm = 0x3E8
	movl	-68(%rbp), %r9d                 ## 4-byte Reload
	callq	_hl_poll_timeout_memory
	movl	%eax, %r13d
	movq	%r12, %rdi
	movl	%r14d, %esi
	callq	_hl_hw_queue_inc_ci_kernel
	movq	_ETIMEDOUT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	addl	%r13d, %eax
	jne	LBB0_10
## %bb.9:
	movl	20(%r12), %edi
	leaq	L_.str.2(%rip), %rsi
	xorl	%eax, %eax
	callq	_dev_err
	movl	$1, (%r12)
	jmp	LBB0_15
LBB0_10:
	movl	4(%rbx), %edi
	callq	_le32_to_cpu
	movq	_ARMCP_PKT_CTL_RC_MASK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	andl	%eax, %edx
	movq	_ARMCP_PKT_CTL_RC_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	sarl	%cl, %edx
	testl	%edx, %edx
	je	LBB0_12
## %bb.11:
	movl	20(%r12), %edi
	movq	_ARMCP_PKT_CTL_OPCODE_MASK@GOTPCREL(%rip), %rcx
	andl	(%rcx), %eax
	movq	_ARMCP_PKT_CTL_OPCODE_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	sarl	%cl, %eax
	leaq	L_.str.3(%rip), %rsi
	xorl	%r13d, %r13d
	movl	%eax, %ecx
	xorl	%eax, %eax
	callq	_dev_err
	movq	_EIO@GOTPCREL(%rip), %rax
	subl	(%rax), %r13d
	jmp	LBB0_13
LBB0_12:
	xorl	%r13d, %r13d
	movq	-88(%rbp), %r14                 ## 8-byte Reload
	testq	%r14, %r14
	je	LBB0_13
## %bb.14:
	movq	-64(%rbp), %rbx                 ## 8-byte Reload
	movl	(%rbx), %edi
	callq	_le64_to_cpu
	movq	%rax, (%r14)
LBB0_15:
	movl	-44(%rbp), %r15d                ## 4-byte Reload
	jmp	LBB0_16
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed to allocate DMA memory for packet to CPU\n"

	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_EIO,4,2                        ## @EIO
L_.str.1:                               ## @.str.1
	.asciz	"Failed to send CB on CPU PQ (%d)\n"

	.comm	_ARMCP_PACKET_FENCE_VAL,4,2     ## @ARMCP_PACKET_FENCE_VAL
	.comm	_ETIMEDOUT,4,2                  ## @ETIMEDOUT
L_.str.2:                               ## @.str.2
	.asciz	"Device CPU packet timeout (0x%x)\n"

	.comm	_ARMCP_PKT_CTL_RC_MASK,4,2      ## @ARMCP_PKT_CTL_RC_MASK
	.comm	_ARMCP_PKT_CTL_RC_SHIFT,4,2     ## @ARMCP_PKT_CTL_RC_SHIFT
L_.str.3:                               ## @.str.3
	.asciz	"F/W ERROR %d for CPU packet %d\n"

	.comm	_ARMCP_PKT_CTL_OPCODE_MASK,4,2  ## @ARMCP_PKT_CTL_OPCODE_MASK
	.comm	_ARMCP_PKT_CTL_OPCODE_SHIFT,4,2 ## @ARMCP_PKT_CTL_OPCODE_SHIFT
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_hl_fw_send_cpu_message         ; -- Begin function hl_fw_send_cpu_message
	.p2align	2
_hl_fw_send_cpu_message:                ; @hl_fw_send_cpu_message
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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	x23, x5
	mov	x26, x4
	mov	x19, x3
	mov	x22, x2
	mov	x25, x1
	mov	x20, x0
	ldr	x8, [x0, #8]
	ldr	x8, [x8, #8]
	add	x2, sp, #28
	mov	x1, x3
	blr	x8
	cbz	x0, LBB0_3
; %bb.1:
	mov	x21, x0
	mov	x1, x22
	mov	x2, x19
	bl	_memcpy
	add	x22, x20, #16
	mov	x0, x22
	bl	_mutex_lock
	ldr	x8, [x20, #24]
	cbz	x8, LBB0_4
LBB0_2:
	mov	w24, #0
	b	LBB0_10
LBB0_3:
	ldr	w0, [x20, #20]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
Lloh2:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh3:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	neg	w24, w8
	b	LBB0_11
LBB0_4:
	ldr	w8, [x20]
	cbz	w8, LBB0_6
LBB0_5:
Lloh5:
	adrp	x8, _EIO@GOTPAGE
Lloh6:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	neg	w24, w8
	b	LBB0_10
LBB0_6:
	ldr	w3, [sp, #28]
	mov	x0, x20
	mov	x1, x25
	mov	x2, x19
	bl	_hl_hw_queue_send_cb_no_cmpl
	cbz	w0, LBB0_8
; %bb.7:
	mov	x24, x0
	ldr	w0, [x20, #20]
	str	x24, [sp]
Lloh8:
	adrp	x1, l_.str.1@PAGE
Lloh9:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_err
	b	LBB0_10
LBB0_8:
	add	x1, x21, #8
	mov	w27, #1
	mov	x0, x20
	mov	w3, #0
	mov	w4, #1000
	mov	x5, x26
	mov	w6, #1
	bl	_hl_poll_timeout_memory
	mov	x24, x0
	mov	x0, x20
	mov	x1, x25
	bl	_hl_hw_queue_inc_ci_kernel
Lloh10:
	adrp	x8, _ETIMEDOUT@GOTPAGE
Lloh11:
	ldr	x8, [x8, _ETIMEDOUT@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	cmn	w24, w8
	b.ne	LBB0_12
; %bb.9:
	ldr	w0, [x20, #20]
Lloh13:
	adrp	x1, l_.str.2@PAGE
Lloh14:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_dev_err
	str	w27, [x20]
LBB0_10:
	mov	x0, x22
	bl	_mutex_unlock
	ldr	x8, [x20, #8]
	ldr	x8, [x8]
	mov	x0, x20
	mov	x1, x19
	mov	x2, x21
	blr	x8
LBB0_11:
	mov	x0, x24
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
LBB0_12:
	ldr	w0, [x21, #4]
	bl	_le32_to_cpu
Lloh15:
	adrp	x8, _ARMCP_PKT_CTL_RC_MASK@GOTPAGE
Lloh16:
	ldr	x8, [x8, _ARMCP_PKT_CTL_RC_MASK@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	and	w8, w8, w0
Lloh18:
	adrp	x9, _ARMCP_PKT_CTL_RC_SHIFT@GOTPAGE
Lloh19:
	ldr	x9, [x9, _ARMCP_PKT_CTL_RC_SHIFT@GOTPAGEOFF]
Lloh20:
	ldr	w9, [x9]
	asr	w9, w8, w9
	cbz	w9, LBB0_14
; %bb.13:
	ldr	w8, [x20, #20]
Lloh21:
	adrp	x10, _ARMCP_PKT_CTL_OPCODE_MASK@GOTPAGE
Lloh22:
	ldr	x10, [x10, _ARMCP_PKT_CTL_OPCODE_MASK@GOTPAGEOFF]
Lloh23:
	ldr	w10, [x10]
	and	w10, w10, w0
Lloh24:
	adrp	x11, _ARMCP_PKT_CTL_OPCODE_SHIFT@GOTPAGE
Lloh25:
	ldr	x11, [x11, _ARMCP_PKT_CTL_OPCODE_SHIFT@GOTPAGEOFF]
Lloh26:
	ldr	w11, [x11]
	asr	w10, w10, w11
	stp	x9, x10, [sp]
Lloh27:
	adrp	x1, l_.str.3@PAGE
Lloh28:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x0, x8
	bl	_dev_err
	b	LBB0_5
LBB0_14:
	cbz	x23, LBB0_2
; %bb.15:
	ldr	w0, [x21]
	bl	_le64_to_cpu
	mov	w24, #0
	str	x0, [x23]
	b	LBB0_10
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpAdd	Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed to allocate DMA memory for packet to CPU\n"

	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_EIO,4,2                        ; @EIO
l_.str.1:                               ; @.str.1
	.asciz	"Failed to send CB on CPU PQ (%d)\n"

	.comm	_ARMCP_PACKET_FENCE_VAL,4,2     ; @ARMCP_PACKET_FENCE_VAL
	.comm	_ETIMEDOUT,4,2                  ; @ETIMEDOUT
l_.str.2:                               ; @.str.2
	.asciz	"Device CPU packet timeout (0x%x)\n"

	.comm	_ARMCP_PKT_CTL_RC_MASK,4,2      ; @ARMCP_PKT_CTL_RC_MASK
	.comm	_ARMCP_PKT_CTL_RC_SHIFT,4,2     ; @ARMCP_PKT_CTL_RC_SHIFT
l_.str.3:                               ; @.str.3
	.asciz	"F/W ERROR %d for CPU packet %d\n"

	.comm	_ARMCP_PKT_CTL_OPCODE_MASK,4,2  ; @ARMCP_PKT_CTL_OPCODE_MASK
	.comm	_ARMCP_PKT_CTL_OPCODE_SHIFT,4,2 ; @ARMCP_PKT_CTL_OPCODE_SHIFT
.subsections_via_symbols
