	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function altera_mbox_send_data
_altera_mbox_send_data:                 ## @altera_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	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rsi, %r14
	callq	_mbox_chan_to_altera_mbox
	testq	%r14, %r14
	je	LBB0_2
## %bb.1:
	movq	%rax, %rbx
	testq	%rax, %rax
	je	LBB0_2
## %bb.4:
	cmpl	$0, 20(%rbx)
	je	LBB0_5
## %bb.6:
	movq	%rbx, %rdi
	callq	_altera_mbox_full
	testq	%rax, %rax
	je	LBB0_8
## %bb.7:
	movq	_EBUSY@GOTPCREL(%rip), %rcx
	jmp	LBB0_3
LBB0_5:
	movl	16(%rbx), %edi
	leaq	L_.str(%rip), %rsi
	callq	_dev_warn
LBB0_2:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
LBB0_3:
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_11:
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
LBB0_8:
	cmpq	$0, 8(%rbx)
	je	LBB0_10
## %bb.9:
	movq	%rbx, %rdi
	movl	$1, %esi
	callq	_altera_mbox_tx_intmask
LBB0_10:
	movq	_MBOX_PTR@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movl	(%r14,%rax,4), %edi
	movq	_MAILBOX_PTR_REG@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	(%rbx), %rsi
	callq	_writel_relaxed
	movq	_MBOX_CMD@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movl	(%r14,%rax,4), %edi
	movq	_MAILBOX_CMD_REG@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	(%rbx), %rsi
	callq	_writel_relaxed
	xorl	%eax, %eax
	jmp	LBB0_11
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"failed to send. This is receiver mailbox.\n"

	.comm	_EBUSY,4,2                      ## @EBUSY
	.comm	_MBOX_PTR,8,3                   ## @MBOX_PTR
	.comm	_MAILBOX_PTR_REG,8,3            ## @MAILBOX_PTR_REG
	.comm	_MBOX_CMD,8,3                   ## @MBOX_CMD
	.comm	_MAILBOX_CMD_REG,8,3            ## @MAILBOX_CMD_REG
	.no_dead_strip	_altera_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 altera_mbox_send_data
_altera_mbox_send_data:                 ; @altera_mbox_send_data
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x1
	bl	_mbox_chan_to_altera_mbox
	cbz	x19, LBB0_6
; %bb.1:
	mov	x20, x0
	cbz	x0, LBB0_6
; %bb.2:
	ldr	w8, [x20, #20]
	cbz	w8, LBB0_5
; %bb.3:
	mov	x0, x20
	bl	_altera_mbox_full
	cbz	x0, LBB0_9
; %bb.4:
Lloh0:
	adrp	x8, _EBUSY@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
	b	LBB0_7
LBB0_5:
	ldr	w0, [x20, #16]
Lloh2:
	adrp	x1, l_.str@PAGE
Lloh3:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_warn
LBB0_6:
Lloh4:
	adrp	x8, _EINVAL@GOTPAGE
Lloh5:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_7:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_8:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
LBB0_9:
	ldr	x8, [x20, #8]
	cbz	x8, LBB0_11
; %bb.10:
	mov	x0, x20
	mov	w1, #1
	bl	_altera_mbox_tx_intmask
LBB0_11:
Lloh6:
	adrp	x8, _MBOX_PTR@GOTPAGE
Lloh7:
	ldr	x8, [x8, _MBOX_PTR@GOTPAGEOFF]
Lloh8:
	ldr	x8, [x8]
	ldr	w0, [x19, x8, lsl #2]
	ldr	x8, [x20]
Lloh9:
	adrp	x9, _MAILBOX_PTR_REG@GOTPAGE
Lloh10:
	ldr	x9, [x9, _MAILBOX_PTR_REG@GOTPAGEOFF]
Lloh11:
	ldr	x9, [x9]
	add	x1, x9, x8
	bl	_writel_relaxed
Lloh12:
	adrp	x8, _MBOX_CMD@GOTPAGE
Lloh13:
	ldr	x8, [x8, _MBOX_CMD@GOTPAGEOFF]
Lloh14:
	ldr	x8, [x8]
	ldr	w0, [x19, x8, lsl #2]
	ldr	x8, [x20]
Lloh15:
	adrp	x9, _MAILBOX_CMD_REG@GOTPAGE
Lloh16:
	ldr	x9, [x9, _MAILBOX_CMD_REG@GOTPAGEOFF]
Lloh17:
	ldr	x9, [x9]
	add	x1, x9, x8
	bl	_writel_relaxed
	mov	w0, #0
	b	LBB0_8
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"failed to send. This is receiver mailbox.\n"

	.comm	_EBUSY,4,2                      ; @EBUSY
	.comm	_MBOX_PTR,8,3                   ; @MBOX_PTR
	.comm	_MAILBOX_PTR_REG,8,3            ; @MAILBOX_PTR_REG
	.comm	_MBOX_CMD,8,3                   ; @MBOX_CMD
	.comm	_MAILBOX_CMD_REG,8,3            ; @MAILBOX_CMD_REG
	.no_dead_strip	_altera_mbox_send_data
.subsections_via_symbols
