	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function a6xx_hfi_send_msg
_a6xx_hfi_send_msg:                     ## @a6xx_hfi_send_msg
	.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
	movl	%r9d, -48(%rbp)                 ## 4-byte Spill
	movq	%r8, -56(%rbp)                  ## 8-byte Spill
	movl	%ecx, %r14d
	movq	%rdx, -64(%rbp)                 ## 8-byte Spill
	movl	%esi, %r15d
	movq	%rdi, %r13
	movq	_HFI_COMMAND_QUEUE@GOTPCREL(%rip), %rax
	movq	(%rax), %r12
	shlq	$2, %r12
	addq	8(%rdi), %r12
	sarl	$2, %r14d
	movq	%r12, %rdi
	callq	_atomic_inc_return
	cltq
	imulq	$-2146959231, %rax, %rbx        ## imm = 0x80080081
	shrq	$32, %rbx
	addl	%eax, %ebx
	movl	%ebx, %ecx
	shrl	$31, %ecx
	sarl	$11, %ebx
	addl	%ecx, %ebx
	movl	%ebx, %ecx
	shll	$12, %ecx
	subl	%ecx, %ebx
	addl	%eax, %ebx
	movl	%ebx, %eax
	shll	$20, %eax
	movq	_HFI_MSG_CMD@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	shll	$16, %ecx
	movl	%r14d, %esi
	shll	$8, %esi
	movl	%r15d, -44(%rbp)                ## 4-byte Spill
	orl	%r15d, %esi
	orl	%ecx, %esi
	orl	%eax, %esi
	movq	-64(%rbp), %rdx                 ## 8-byte Reload
	movl	%esi, (%rdx)
	movq	%r13, %rdi
	movq	%r12, %rsi
	movl	%r14d, %ecx
	callq	_a6xx_hfi_queue_write
	testl	%eax, %eax
	je	LBB0_2
## %bb.1:
	movl	%eax, %r14d
	movl	(%r13), %edi
	movq	_a6xx_hfi_msg_id@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movslq	-44(%rbp), %rcx                 ## 4-byte Folded Reload
	movl	(%rax,%rcx,4), %edx
	leaq	L_.str(%rip), %rsi
	movl	%ebx, %ecx
	callq	_DRM_DEV_ERROR
	movl	%r14d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_2:
	movq	%r13, %rdi
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	movl	%ebx, %edx
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	movl	-48(%rbp), %r8d                 ## 4-byte Reload
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_a6xx_hfi_wait_for_ack          ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_HFI_COMMAND_QUEUE,8,3          ## @HFI_COMMAND_QUEUE
	.comm	_HFI_MSG_CMD,4,2                ## @HFI_MSG_CMD
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Unable to send message %s id %d\n"

	.comm	_a6xx_hfi_msg_id,8,3            ## @a6xx_hfi_msg_id
	.no_dead_strip	_a6xx_hfi_send_msg
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function a6xx_hfi_send_msg
_a6xx_hfi_send_msg:                     ; @a6xx_hfi_send_msg
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x19, x5
	mov	x21, x4
	mov	x24, x2
	mov	x20, x1
	mov	x22, x0
	ldr	x8, [x0, #8]
Lloh0:
	adrp	x9, _HFI_COMMAND_QUEUE@GOTPAGE
Lloh1:
	ldr	x9, [x9, _HFI_COMMAND_QUEUE@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	add	x25, x8, x9, lsl #2
	asr	w26, w3, #2
	mov	x0, x25
	bl	_atomic_inc_return
	mov	w8, #129
	movk	w8, #32776, lsl #16
	smull	x8, w0, w8
	lsr	x8, x8, #32
	add	w8, w8, w0
	asr	w9, w8, #11
	add	w8, w9, w8, lsr #31
	sub	w8, w8, w8, lsl #12
Lloh3:
	adrp	x9, _HFI_MSG_CMD@GOTPAGE
Lloh4:
	ldr	x9, [x9, _HFI_MSG_CMD@GOTPAGEOFF]
	add	w23, w0, w8
Lloh5:
	ldr	w8, [x9]
	orr	w9, w20, w26, lsl #8
	orr	w8, w9, w8, lsl #16
	orr	w8, w8, w23, lsl #20
	str	w8, [x24]
	mov	x0, x22
	mov	x1, x25
	mov	x2, x24
	mov	x3, x26
	bl	_a6xx_hfi_queue_write
	cbz	w0, LBB0_2
; %bb.1:
	mov	x24, x0
	ldr	w0, [x22]
Lloh6:
	adrp	x8, _a6xx_hfi_msg_id@GOTPAGE
Lloh7:
	ldr	x8, [x8, _a6xx_hfi_msg_id@GOTPAGEOFF]
Lloh8:
	ldr	x8, [x8]
	ldr	w2, [x8, w20, sxtw #2]
Lloh9:
	adrp	x1, l_.str@PAGE
Lloh10:
	add	x1, x1, l_.str@PAGEOFF
	mov	x3, x23
	bl	_DRM_DEV_ERROR
	mov	x0, x24
	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
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
LBB0_2:
	mov	x0, x22
	mov	x1, x20
	mov	x2, x23
	mov	x3, x21
	mov	x4, x19
	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
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	b	_a6xx_hfi_wait_for_ack
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_HFI_COMMAND_QUEUE,8,3          ; @HFI_COMMAND_QUEUE
	.comm	_HFI_MSG_CMD,4,2                ; @HFI_MSG_CMD
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Unable to send message %s id %d\n"

	.comm	_a6xx_hfi_msg_id,8,3            ; @a6xx_hfi_msg_id
	.no_dead_strip	_a6xx_hfi_send_msg
.subsections_via_symbols
