	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mbox_send_cmd
_mbox_send_cmd:                         ## @mbox_send_cmd
	.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
	movl	%edx, %ebx
	movl	%esi, %r15d
	movq	%rdi, %r12
	movq	_T_XUSB_CFG_ARU_MAILBOX_OWNER@GOTPCREL(%rip), %r13
	movl	(%r13), %esi
	callq	_FPCI_RD4
	movq	_ARU_MAILBOX_OWNER_NONE@GOTPCREL(%rip), %r14
	cmpl	(%r14), %eax
	jne	LBB0_1
## %bb.3:
	movl	%ebx, -44(%rbp)                 ## 4-byte Spill
	movl	(%r13), %esi
	movq	_ARU_MAILBOX_OWNER_SW@GOTPCREL(%rip), %rbx
	movl	(%rbx), %edx
	movq	%r12, %rdi
	callq	_FPCI_WR4
	movl	(%r13), %esi
	movq	%r12, %rdi
	callq	_FPCI_RD4
	cmpl	(%rbx), %eax
	jne	LBB0_4
## %bb.5:
	movl	%r15d, %edi
	callq	_ARU_MAILBOX_DATA_IN_TYPE
	movl	%eax, %ebx
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	callq	_ARU_MAILBOX_DATA_IN_DATA
	orl	%eax, %ebx
	movq	_T_XUSB_CFG_ARU_MAILBOX_DATA_IN@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	movl	%ebx, %edx
	callq	_FPCI_WR4
	movq	_T_XUSB_CFG_ARU_MAILBOX_CMD@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	movq	%r12, %rdi
	callq	_FPCI_RD4
	movq	_ARU_MAILBOX_CMD_DEST_FALC@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movq	_ARU_MAILBOX_CMD_INT_EN@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movl	(%rbx), %esi
	movq	%r12, %rdi
	movl	%eax, %edx
	callq	_FPCI_WR4
	movl	$251, %ebx
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r13), %esi
	movq	%r12, %rdi
	callq	_FPCI_RD4
	cmpl	(%r14), %eax
	je	LBB0_7
## %bb.8:                               ##   in Loop: Header=BB0_6 Depth=1
	movl	%eax, %r15d
	movl	$100, %edi
	callq	_DELAY
	decl	%ebx
	cmpl	$1, %ebx
	ja	LBB0_6
## %bb.9:
	movl	(%r12), %edi
	leaq	L_.str.2(%rip), %rsi
	movl	%r15d, %edx
	callq	_device_printf
	movq	_ETIMEDOUT@GOTPCREL(%rip), %rax
	jmp	LBB0_10
LBB0_1:
	movl	(%r12), %edi
	leaq	L_.str(%rip), %rsi
	jmp	LBB0_2
LBB0_4:
	movl	(%r12), %edi
	leaq	L_.str.1(%rip), %rsi
LBB0_2:
	movl	%eax, %edx
	callq	_device_printf
	movq	_EBUSY@GOTPCREL(%rip), %rax
LBB0_10:
	movl	(%rax), %eax
LBB0_11:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	xorl	%eax, %eax
	jmp	LBB0_11
	.cfi_endproc
                                        ## -- End function
	.comm	_T_XUSB_CFG_ARU_MAILBOX_OWNER,4,2 ## @T_XUSB_CFG_ARU_MAILBOX_OWNER
	.comm	_ARU_MAILBOX_OWNER_NONE,4,2     ## @ARU_MAILBOX_OWNER_NONE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"CPU mailbox is busy: 0x%08X\n"

	.comm	_EBUSY,4,2                      ## @EBUSY
	.comm	_ARU_MAILBOX_OWNER_SW,4,2       ## @ARU_MAILBOX_OWNER_SW
L_.str.1:                               ## @.str.1
	.asciz	"Cannot acquire CPU mailbox: 0x%08X\n"

	.comm	_T_XUSB_CFG_ARU_MAILBOX_DATA_IN,4,2 ## @T_XUSB_CFG_ARU_MAILBOX_DATA_IN
	.comm	_T_XUSB_CFG_ARU_MAILBOX_CMD,4,2 ## @T_XUSB_CFG_ARU_MAILBOX_CMD
	.comm	_ARU_MAILBOX_CMD_DEST_FALC,4,2  ## @ARU_MAILBOX_CMD_DEST_FALC
	.comm	_ARU_MAILBOX_CMD_INT_EN,4,2     ## @ARU_MAILBOX_CMD_INT_EN
L_.str.2:                               ## @.str.2
	.asciz	"Command response timeout: 0x%08X\n"

	.comm	_ETIMEDOUT,4,2                  ## @ETIMEDOUT
	.no_dead_strip	_mbox_send_cmd
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mbox_send_cmd
_mbox_send_cmd:                         ; @mbox_send_cmd
	.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
	mov	x20, x2
	mov	x21, x1
	mov	x19, x0
Lloh0:
	adrp	x22, _T_XUSB_CFG_ARU_MAILBOX_OWNER@GOTPAGE
Lloh1:
	ldr	x22, [x22, _T_XUSB_CFG_ARU_MAILBOX_OWNER@GOTPAGEOFF]
	ldr	w1, [x22]
	bl	_FPCI_RD4
Lloh2:
	adrp	x23, _ARU_MAILBOX_OWNER_NONE@GOTPAGE
Lloh3:
	ldr	x23, [x23, _ARU_MAILBOX_OWNER_NONE@GOTPAGEOFF]
	ldr	w8, [x23]
	cmp	w0, w8
	b.ne	LBB0_6
; %bb.1:
	ldr	w1, [x22]
Lloh4:
	adrp	x24, _ARU_MAILBOX_OWNER_SW@GOTPAGE
Lloh5:
	ldr	x24, [x24, _ARU_MAILBOX_OWNER_SW@GOTPAGEOFF]
	ldr	w2, [x24]
	mov	x0, x19
	bl	_FPCI_WR4
	ldr	w1, [x22]
	mov	x0, x19
	bl	_FPCI_RD4
	ldr	w8, [x24]
	cmp	w0, w8
	b.ne	LBB0_7
; %bb.2:
	mov	x0, x21
	bl	_ARU_MAILBOX_DATA_IN_TYPE
	mov	x21, x0
	mov	x0, x20
	bl	_ARU_MAILBOX_DATA_IN_DATA
	orr	w2, w0, w21
Lloh6:
	adrp	x8, _T_XUSB_CFG_ARU_MAILBOX_DATA_IN@GOTPAGE
Lloh7:
	ldr	x8, [x8, _T_XUSB_CFG_ARU_MAILBOX_DATA_IN@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_FPCI_WR4
Lloh9:
	adrp	x20, _T_XUSB_CFG_ARU_MAILBOX_CMD@GOTPAGE
Lloh10:
	ldr	x20, [x20, _T_XUSB_CFG_ARU_MAILBOX_CMD@GOTPAGEOFF]
	ldr	w1, [x20]
	mov	x0, x19
	bl	_FPCI_RD4
Lloh11:
	adrp	x8, _ARU_MAILBOX_CMD_DEST_FALC@GOTPAGE
Lloh12:
	ldr	x8, [x8, _ARU_MAILBOX_CMD_DEST_FALC@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
Lloh14:
	adrp	x9, _ARU_MAILBOX_CMD_INT_EN@GOTPAGE
Lloh15:
	ldr	x9, [x9, _ARU_MAILBOX_CMD_INT_EN@GOTPAGEOFF]
Lloh16:
	ldr	w9, [x9]
	orr	w8, w8, w0
	orr	w2, w8, w9
	ldr	w1, [x20]
	mov	x0, x19
	bl	_FPCI_WR4
	mov	w21, #251
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w1, [x22]
	mov	x0, x19
	bl	_FPCI_RD4
	ldr	w8, [x23]
	cmp	w0, w8
	b.eq	LBB0_11
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	x20, x0
	mov	w0, #100
	bl	_DELAY
	sub	w21, w21, #1
	cmp	w21, #1
	b.hi	LBB0_3
; %bb.5:
	ldr	w0, [x19]
Lloh17:
	adrp	x1, l_.str.2@PAGE
Lloh18:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x2, x20
	bl	_device_printf
Lloh19:
	adrp	x8, _ETIMEDOUT@GOTPAGE
Lloh20:
	ldr	x8, [x8, _ETIMEDOUT@GOTPAGEOFF]
	b	LBB0_9
LBB0_6:
	mov	x2, x0
	ldr	w0, [x19]
Lloh21:
	adrp	x1, l_.str@PAGE
Lloh22:
	add	x1, x1, l_.str@PAGEOFF
	b	LBB0_8
LBB0_7:
	mov	x2, x0
	ldr	w0, [x19]
Lloh23:
	adrp	x1, l_.str.1@PAGE
Lloh24:
	add	x1, x1, l_.str.1@PAGEOFF
LBB0_8:
	bl	_device_printf
Lloh25:
	adrp	x8, _EBUSY@GOTPAGE
Lloh26:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
LBB0_9:
	ldr	w0, [x8]
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
LBB0_11:
	mov	w0, #0
	b	LBB0_10
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpLdrGot	Lloh25, Lloh26
	.cfi_endproc
                                        ; -- End function
	.comm	_T_XUSB_CFG_ARU_MAILBOX_OWNER,4,2 ; @T_XUSB_CFG_ARU_MAILBOX_OWNER
	.comm	_ARU_MAILBOX_OWNER_NONE,4,2     ; @ARU_MAILBOX_OWNER_NONE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"CPU mailbox is busy: 0x%08X\n"

	.comm	_EBUSY,4,2                      ; @EBUSY
	.comm	_ARU_MAILBOX_OWNER_SW,4,2       ; @ARU_MAILBOX_OWNER_SW
l_.str.1:                               ; @.str.1
	.asciz	"Cannot acquire CPU mailbox: 0x%08X\n"

	.comm	_T_XUSB_CFG_ARU_MAILBOX_DATA_IN,4,2 ; @T_XUSB_CFG_ARU_MAILBOX_DATA_IN
	.comm	_T_XUSB_CFG_ARU_MAILBOX_CMD,4,2 ; @T_XUSB_CFG_ARU_MAILBOX_CMD
	.comm	_ARU_MAILBOX_CMD_DEST_FALC,4,2  ; @ARU_MAILBOX_CMD_DEST_FALC
	.comm	_ARU_MAILBOX_CMD_INT_EN,4,2     ; @ARU_MAILBOX_CMD_INT_EN
l_.str.2:                               ; @.str.2
	.asciz	"Command response timeout: 0x%08X\n"

	.comm	_ETIMEDOUT,4,2                  ; @ETIMEDOUT
	.no_dead_strip	_mbox_send_cmd
.subsections_via_symbols
