	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_imx_scu_call_rpc               ## -- Begin function imx_scu_call_rpc
	.p2align	4, 0x90
_imx_scu_call_rpc:                      ## @imx_scu_call_rpc
	.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, %r12d
	movq	%rsi, %r15
	movq	%rdi, %rbx
	testq	%rdi, %rdi
	sete	%al
	testq	%rsi, %rsi
	sete	%cl
	orb	%al, %cl
	movzbl	%cl, %edi
	callq	_WARN_ON
	testq	%rax, %rax
	je	LBB0_3
## %bb.1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
LBB0_2:
	subl	(%rax), %ebx
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_3:
	leaq	4(%rbx), %rdi
	movq	%rdi, -48(%rbp)                 ## 8-byte Spill
	callq	_mutex_lock
	leaq	8(%rbx), %r14
	movq	%r14, %rdi
	callq	_reinit_completion
	movq	%r15, 24(%rbx)
	movq	$0, 16(%rbx)
	movq	%rbx, %rdi
	movq	%r15, %rsi
	callq	_imx_scu_ipc_write
	movl	%eax, %r13d
	testl	%eax, %eax
	js	LBB0_4
## %bb.5:
	testl	%r12d, %r12d
	je	LBB0_9
## %bb.6:
	movq	_MAX_RX_TIMEOUT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_wait_for_completion_timeout
	testl	%eax, %eax
	je	LBB0_7
## %bb.8:
	movl	(%r15), %r13d
	jmp	LBB0_9
LBB0_4:
	movl	(%rbx), %edi
	leaq	L_.str(%rip), %rsi
	movl	%r13d, %edx
	xorl	%eax, %eax
	callq	_dev_err
LBB0_9:
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_mutex_unlock
	movl	(%rbx), %edi
	leaq	L_.str.2(%rip), %rsi
	callq	_dev_dbg
	movl	%r13d, %edi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_imx_sc_to_linux_errno          ## TAILCALL
LBB0_7:
	movl	(%rbx), %edi
	leaq	L_.str.1(%rip), %rsi
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_dev_err
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_mutex_unlock
	movq	_ETIMEDOUT@GOTPCREL(%rip), %rax
	jmp	LBB0_2
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"RPC send msg failed: %d\n"

	.comm	_MAX_RX_TIMEOUT,4,2             ## @MAX_RX_TIMEOUT
L_.str.1:                               ## @.str.1
	.asciz	"RPC send msg timeout\n"

	.comm	_ETIMEDOUT,4,2                  ## @ETIMEDOUT
L_.str.2:                               ## @.str.2
	.asciz	"RPC SVC done\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_imx_scu_call_rpc               ; -- Begin function imx_scu_call_rpc
	.p2align	2
_imx_scu_call_rpc:                      ; @imx_scu_call_rpc
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.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
	mov	x22, x2
	mov	x21, x1
	mov	x19, x0
	cmp	x0, #0
	ccmp	x1, #0, #4, ne
	cset	w0, eq
	bl	_WARN_ON
	cbz	x0, LBB0_3
; %bb.1:
Lloh0:
	adrp	x8, _EINVAL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_2:
	ldr	w8, [x8]
	neg	w0, w8
	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
	add	sp, sp, #80
	ret
LBB0_3:
	add	x20, x19, #4
	mov	x0, x20
	bl	_mutex_lock
	add	x24, x19, #8
	mov	x0, x24
	bl	_reinit_completion
	stp	xzr, x21, [x19, #16]
	mov	x0, x19
	mov	x1, x21
	bl	_imx_scu_ipc_write
	mov	x23, x0
	tbnz	w0, #31, LBB0_7
; %bb.4:
	cbz	w22, LBB0_8
; %bb.5:
Lloh2:
	adrp	x8, _MAX_RX_TIMEOUT@GOTPAGE
Lloh3:
	ldr	x8, [x8, _MAX_RX_TIMEOUT@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
	mov	x0, x24
	bl	_wait_for_completion_timeout
	cbz	w0, LBB0_9
; %bb.6:
	ldr	w23, [x21]
	b	LBB0_8
LBB0_7:
	ldr	w0, [x19]
	str	x23, [sp]
Lloh5:
	adrp	x1, l_.str@PAGE
Lloh6:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
LBB0_8:
	mov	x0, x20
	bl	_mutex_unlock
	ldr	w0, [x19]
Lloh7:
	adrp	x1, l_.str.2@PAGE
Lloh8:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_dev_dbg
	mov	x0, x23
	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
	add	sp, sp, #80
	b	_imx_sc_to_linux_errno
LBB0_9:
	ldr	w0, [x19]
Lloh9:
	adrp	x1, l_.str.1@PAGE
Lloh10:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_err
	mov	x0, x20
	bl	_mutex_unlock
Lloh11:
	adrp	x8, _ETIMEDOUT@GOTPAGE
Lloh12:
	ldr	x8, [x8, _ETIMEDOUT@GOTPAGEOFF]
	b	LBB0_2
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpAdd	Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"RPC send msg failed: %d\n"

	.comm	_MAX_RX_TIMEOUT,4,2             ; @MAX_RX_TIMEOUT
l_.str.1:                               ; @.str.1
	.asciz	"RPC send msg timeout\n"

	.comm	_ETIMEDOUT,4,2                  ; @ETIMEDOUT
l_.str.2:                               ; @.str.2
	.asciz	"RPC SVC done\n"

.subsections_via_symbols
