	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function imx_scu_ipc_write
_imx_scu_ipc_write:                     ## @imx_scu_ipc_write
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	(%rsi), %r8d
	movq	_IMX_SC_RPC_MAX_MSG@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r8d
	jle	LBB0_2
## %bb.1:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_8
LBB0_2:
	movq	%rsi, %r15
	movq	%rdi, %r14
	movl	8(%rdi), %edi
	movl	4(%rsi), %ecx
	movl	8(%rsi), %edx
	leaq	L_.str(%rip), %rsi
	callq	_dev_dbg
	cmpl	$0, (%r15)
	jle	LBB0_7
## %bb.3:
	xorl	%ebx, %ebx
	movq	%r15, %r12
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r14), %rax
	movl	%ebx, %ecx
	andl	$3, %ecx
	movl	(%rax,%rcx,4), %edi
	movq	%r12, %rsi
	callq	_mbox_send_message
	testl	%eax, %eax
	js	LBB0_8
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	incq	%rbx
	movslq	(%r15), %rax
	addq	$4, %r12
	cmpq	%rax, %rbx
	jl	LBB0_4
LBB0_7:
	xorl	%eax, %eax
LBB0_8:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_IMX_SC_RPC_MAX_MSG,4,2         ## @IMX_SC_RPC_MAX_MSG
	.comm	_EINVAL,4,2                     ## @EINVAL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"RPC SVC %u FUNC %u SIZE %u\n"

	.no_dead_strip	_imx_scu_ipc_write
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function imx_scu_ipc_write
_imx_scu_ipc_write:                     ; @imx_scu_ipc_write
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	ldr	w4, [x1]
Lloh0:
	adrp	x8, _IMX_SC_RPC_MAX_MSG@GOTPAGE
Lloh1:
	ldr	x8, [x8, _IMX_SC_RPC_MAX_MSG@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w4, w8
	b.le	LBB0_2
; %bb.1:
Lloh3:
	adrp	x8, _EINVAL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_7
LBB0_2:
	mov	x19, x1
	mov	x20, x0
	ldr	w0, [x0, #8]
	ldp	w3, w2, [x1, #4]
Lloh6:
	adrp	x1, l_.str@PAGE
Lloh7:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_dbg
	ldr	w8, [x19]
	cmp	w8, #1
	b.lt	LBB0_6
; %bb.3:
	mov	x22, #0
	mov	x21, x19
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x20]
	and	x9, x22, #0x3
	ldr	w0, [x8, x9, lsl #2]
	mov	x1, x21
	bl	_mbox_send_message
	tbnz	w0, #31, LBB0_7
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	add	x22, x22, #1
	ldrsw	x8, [x19]
	add	x21, x21, #4
	cmp	x22, x8
	b.lt	LBB0_4
LBB0_6:
	mov	w0, #0
LBB0_7:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_IMX_SC_RPC_MAX_MSG,4,2         ; @IMX_SC_RPC_MAX_MSG
	.comm	_EINVAL,4,2                     ; @EINVAL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"RPC SVC %u FUNC %u SIZE %u\n"

	.no_dead_strip	_imx_scu_ipc_write
.subsections_via_symbols
