	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function a37xx_mbox_send_data
_a37xx_mbox_send_data:                  ## @a37xx_mbox_send_data
	.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
	testq	%rsi, %rsi
	je	LBB0_1
## %bb.3:
	movq	%rsi, %r14
	movq	(%rdi), %r13
	movq	_RWTM_MBOX_FIFO_STATUS@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	(%r13), %rdi
	callq	_readl
	movl	%eax, %ebx
	movq	_FIFO_STS_RDY@GOTPCREL(%rip), %rax
	testl	%ebx, (%rax)
	jne	LBB0_5
## %bb.4:
	movl	8(%r13), %edi
	leaq	L_.str(%rip), %rsi
	callq	_dev_warn
LBB0_5:
	movq	_FIFO_STS_CNTR_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	andl	%ebx, %eax
	movq	_FIFO_STS_CNTR_MAX@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jge	LBB0_10
## %bb.6:
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movq	8(%r14), %rax
	movl	(%rax,%rbx,4), %r15d
	movq	(%r13), %r12
	movl	%ebx, %edi
	callq	_RWTM_MBOX_PARAM
	addq	%rax, %r12
	movl	%r15d, %edi
	movq	%r12, %rsi
	callq	_writel
	incq	%rbx
	cmpq	$16, %rbx
	jne	LBB0_7
## %bb.8:
	movl	(%r14), %edi
	movq	_RWTM_MBOX_COMMAND@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	(%r13), %rsi
	callq	_writel
	xorl	%eax, %eax
	jmp	LBB0_9
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	jmp	LBB0_2
LBB0_10:
	movl	8(%r13), %edi
	leaq	L_.str.1(%rip), %rsi
	callq	_dev_err
	movq	_EBUSY@GOTPCREL(%rip), %rcx
LBB0_2:
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_9:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_RWTM_MBOX_FIFO_STATUS,8,3      ## @RWTM_MBOX_FIFO_STATUS
	.comm	_FIFO_STS_RDY,4,2               ## @FIFO_STS_RDY
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Secure processor not ready\n"

	.comm	_FIFO_STS_CNTR_MASK,4,2         ## @FIFO_STS_CNTR_MASK
	.comm	_FIFO_STS_CNTR_MAX,4,2          ## @FIFO_STS_CNTR_MAX
L_.str.1:                               ## @.str.1
	.asciz	"Secure processor command queue full\n"

	.comm	_EBUSY,4,2                      ## @EBUSY
	.comm	_RWTM_MBOX_COMMAND,8,3          ## @RWTM_MBOX_COMMAND
	.no_dead_strip	_a37xx_mbox_send_data
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function a37xx_mbox_send_data
_a37xx_mbox_send_data:                  ; @a37xx_mbox_send_data
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	cbz	x1, LBB0_7
; %bb.1:
	mov	x19, x1
	ldr	x22, [x0]
	ldr	x8, [x22]
Lloh0:
	adrp	x9, _RWTM_MBOX_FIFO_STATUS@GOTPAGE
Lloh1:
	ldr	x9, [x9, _RWTM_MBOX_FIFO_STATUS@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	add	x0, x9, x8
	bl	_readl
	mov	x20, x0
Lloh3:
	adrp	x8, _FIFO_STS_RDY@GOTPAGE
Lloh4:
	ldr	x8, [x8, _FIFO_STS_RDY@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	tst	w8, w0
	b.ne	LBB0_3
; %bb.2:
	ldr	w0, [x22, #8]
Lloh6:
	adrp	x1, l_.str@PAGE
Lloh7:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_warn
LBB0_3:
Lloh8:
	adrp	x8, _FIFO_STS_CNTR_MASK@GOTPAGE
Lloh9:
	ldr	x8, [x8, _FIFO_STS_CNTR_MASK@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	and	w8, w8, w20
Lloh11:
	adrp	x9, _FIFO_STS_CNTR_MAX@GOTPAGE
Lloh12:
	ldr	x9, [x9, _FIFO_STS_CNTR_MAX@GOTPAGEOFF]
Lloh13:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ge	LBB0_8
; %bb.4:
	mov	x20, #0
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19, #8]
	ldr	w21, [x8, x20, lsl #2]
	ldr	x23, [x22]
	mov	x0, x20
	bl	_RWTM_MBOX_PARAM
	add	x1, x0, x23
	mov	x0, x21
	bl	_writel
	add	x20, x20, #1
	cmp	x20, #16
	b.ne	LBB0_5
; %bb.6:
	ldr	w0, [x19]
	ldr	x8, [x22]
Lloh14:
	adrp	x9, _RWTM_MBOX_COMMAND@GOTPAGE
Lloh15:
	ldr	x9, [x9, _RWTM_MBOX_COMMAND@GOTPAGEOFF]
Lloh16:
	ldr	x9, [x9]
	add	x1, x9, x8
	bl	_writel
	mov	w0, #0
	b	LBB0_10
LBB0_7:
Lloh17:
	adrp	x8, _EINVAL@GOTPAGE
Lloh18:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_9
LBB0_8:
	ldr	w0, [x22, #8]
Lloh19:
	adrp	x1, l_.str.1@PAGE
Lloh20:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_err
Lloh21:
	adrp	x8, _EBUSY@GOTPAGE
Lloh22:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
LBB0_9:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_10:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpAdd	Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_RWTM_MBOX_FIFO_STATUS,8,3      ; @RWTM_MBOX_FIFO_STATUS
	.comm	_FIFO_STS_RDY,4,2               ; @FIFO_STS_RDY
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Secure processor not ready\n"

	.comm	_FIFO_STS_CNTR_MASK,4,2         ; @FIFO_STS_CNTR_MASK
	.comm	_FIFO_STS_CNTR_MAX,4,2          ; @FIFO_STS_CNTR_MAX
l_.str.1:                               ; @.str.1
	.asciz	"Secure processor command queue full\n"

	.comm	_EBUSY,4,2                      ; @EBUSY
	.comm	_RWTM_MBOX_COMMAND,8,3          ; @RWTM_MBOX_COMMAND
	.no_dead_strip	_a37xx_mbox_send_data
.subsections_via_symbols
