	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_vpu_ipi_send                   ## -- Begin function vpu_ipi_send
	.p2align	4, 0x90
_vpu_ipi_send:                          ## @vpu_ipi_send
	.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
	subq	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%ecx, %ebx
	movq	%rdx, %r12
	movl	%esi, %r14d
	callq	_platform_get_drvdata
	movq	%rax, %r15
	movq	_IPI_VPU_INIT@GOTPCREL(%rip), %rax
	cmpl	%r14d, (%rax)
	jae	LBB0_4
## %bb.1:
	testq	%r12, %r12
	je	LBB0_4
## %bb.2:
	cmpl	$8, %ebx
	ja	LBB0_4
## %bb.3:
	movq	_IPI_MAX@GOTPCREL(%rip), %rax
	cmpl	%r14d, (%rax)
	jbe	LBB0_4
## %bb.5:
	movq	24(%r15), %rax
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	movq	%r15, %rdi
	callq	_vpu_clock_enable
	testl	%eax, %eax
	je	LBB0_7
## %bb.6:
	movl	%eax, %r13d
	movl	12(%r15), %edi
	leaq	L_.str.1(%rip), %rsi
	xorl	%eax, %eax
	callq	_dev_err
	jmp	LBB0_17
LBB0_4:
	movl	12(%r15), %edi
	leaq	L_.str(%rip), %rsi
	xorl	%r13d, %r13d
	xorl	%eax, %eax
	callq	_dev_err
	movq	_EINVAL@GOTPCREL(%rip), %rax
	subl	(%rax), %r13d
LBB0_17:
	movl	%r13d, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	movq	%r15, %rdi
	callq	_vpu_running
	testl	%eax, %eax
	je	LBB0_8
## %bb.9:
	movl	%ebx, -44(%rbp)                 ## 4-byte Spill
	movq	%r15, %rdi
	addq	$8, %rdi
	movq	%rdi, -56(%rbp)                 ## 8-byte Spill
	callq	_mutex_lock
	movq	_jiffies@GOTPCREL(%rip), %r13
	movq	(%r13), %rax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	movq	_IPI_TIMEOUT_MS@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_msecs_to_jiffies
	movq	%rax, %rbx
	addq	-64(%rbp), %rbx                 ## 8-byte Folded Reload
	.p2align	4, 0x90
LBB0_10:                                ## =>This Inner Loop Header: Depth=1
	movq	(%r13), %rdi
	movq	%rbx, %rsi
	callq	_time_after
	testq	%rax, %rax
	jne	LBB0_11
## %bb.12:                              ##   in Loop: Header=BB0_10 Depth=1
	movq	_HOST_TO_VPU@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_vpu_cfg_readl
	testq	%rax, %rax
	jne	LBB0_10
## %bb.13:
	movq	-72(%rbp), %rbx                 ## 8-byte Reload
	movq	8(%rbx), %rdi
	movq	%r12, %rsi
	movl	-44(%rbp), %r12d                ## 4-byte Reload
	movl	%r12d, %edx
	callq	_memcpy
	movl	%r12d, (%rbx)
	movl	%r14d, 4(%rbx)
	movq	(%r15), %rax
	movl	%r14d, %ebx
	movl	$0, (%rax,%rbx,4)
	movq	_HOST_TO_VPU@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r15, %rdi
	movl	$1, %esi
	callq	_vpu_cfg_writel
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_mutex_unlock
	movq	_IPI_TIMEOUT_MS@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_msecs_to_jiffies
	movl	16(%r15), %edi
	movq	(%r15), %rcx
	movl	(%rcx,%rbx,4), %esi
	movq	%rax, %rdx
	callq	_wait_event_timeout
	movq	(%r15), %rcx
	movl	$0, (%rcx,%rbx,4)
	testl	%eax, %eax
	je	LBB0_14
## %bb.18:
	movq	%r15, %rdi
	callq	_vpu_clock_disable
	xorl	%r13d, %r13d
	jmp	LBB0_17
LBB0_8:
	movl	12(%r15), %edi
	leaq	L_.str.2(%rip), %rsi
	xorl	%eax, %eax
	callq	_dev_err
	movq	_EINVAL@GOTPCREL(%rip), %rax
	jmp	LBB0_15
LBB0_11:
	movl	12(%r15), %edi
	leaq	L_.str.3(%rip), %rsi
	xorl	%eax, %eax
	callq	_dev_err
	movq	_EIO@GOTPCREL(%rip), %rax
	movl	(%rax), %r13d
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_mutex_unlock
	jmp	LBB0_16
LBB0_14:
	movl	12(%r15), %edi
	leaq	L_.str.4(%rip), %rsi
	movl	%r14d, %edx
	xorl	%eax, %eax
	callq	_dev_err
	movq	_EIO@GOTPCREL(%rip), %rax
LBB0_15:
	movl	(%rax), %r13d
LBB0_16:
	negl	%r13d
	movq	%r15, %rdi
	callq	_vpu_clock_disable
	jmp	LBB0_17
	.cfi_endproc
                                        ## -- End function
	.comm	_IPI_VPU_INIT,4,2               ## @IPI_VPU_INIT
	.comm	_IPI_MAX,4,2                    ## @IPI_MAX
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"failed to send ipi message\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
L_.str.1:                               ## @.str.1
	.asciz	"failed to enable vpu clock\n"

L_.str.2:                               ## @.str.2
	.asciz	"vpu_ipi_send: VPU is not running\n"

	.comm	_jiffies,8,3                    ## @jiffies
	.comm	_IPI_TIMEOUT_MS,4,2             ## @IPI_TIMEOUT_MS
L_.str.3:                               ## @.str.3
	.asciz	"vpu_ipi_send: IPI timeout!\n"

	.comm	_EIO,4,2                        ## @EIO
	.comm	_HOST_TO_VPU,4,2                ## @HOST_TO_VPU
L_.str.4:                               ## @.str.4
	.asciz	"vpu ipi %d ack time out !"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_vpu_ipi_send                   ; -- Begin function vpu_ipi_send
	.p2align	2
_vpu_ipi_send:                          ; @vpu_ipi_send
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x21, x3
	mov	x22, x2
	mov	x20, x1
	bl	_platform_get_drvdata
	mov	x19, x0
Lloh0:
	adrp	x8, _IPI_VPU_INIT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _IPI_VPU_INIT@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w8, w20
	b.hs	LBB0_6
; %bb.1:
	cbz	x22, LBB0_6
; %bb.2:
	cmp	w21, #8
	b.hi	LBB0_6
; %bb.3:
Lloh3:
	adrp	x8, _IPI_MAX@GOTPAGE
Lloh4:
	ldr	x8, [x8, _IPI_MAX@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	cmp	w8, w20
	b.ls	LBB0_6
; %bb.4:
	ldr	x25, [x19, #24]
	mov	x0, x19
	bl	_vpu_clock_enable
	cbz	w0, LBB0_8
; %bb.5:
	mov	x23, x0
	ldr	w0, [x19, #12]
Lloh6:
	adrp	x1, l_.str.1@PAGE
Lloh7:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_err
	b	LBB0_7
LBB0_6:
	ldr	w0, [x19, #12]
Lloh8:
	adrp	x1, l_.str@PAGE
Lloh9:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
Lloh10:
	adrp	x8, _EINVAL@GOTPAGE
Lloh11:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	neg	w23, w8
LBB0_7:
	mov	x0, x23
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_8:
	mov	x0, x19
	bl	_vpu_running
	cbz	w0, LBB0_14
; %bb.9:
	add	x23, x19, #8
	mov	x0, x23
	bl	_mutex_lock
Lloh13:
	adrp	x28, _jiffies@GOTPAGE
Lloh14:
	ldr	x28, [x28, _jiffies@GOTPAGEOFF]
	ldr	x24, [x28]
Lloh15:
	adrp	x26, _IPI_TIMEOUT_MS@GOTPAGE
Lloh16:
	ldr	x26, [x26, _IPI_TIMEOUT_MS@GOTPAGEOFF]
	ldr	w0, [x26]
	bl	_msecs_to_jiffies
	add	x24, x0, x24
Lloh17:
	adrp	x27, _HOST_TO_VPU@GOTPAGE
Lloh18:
	ldr	x27, [x27, _HOST_TO_VPU@GOTPAGEOFF]
LBB0_10:                                ; =>This Inner Loop Header: Depth=1
	ldr	x0, [x28]
	mov	x1, x24
	bl	_time_after
	cbnz	x0, LBB0_15
; %bb.11:                               ;   in Loop: Header=BB0_10 Depth=1
	ldr	w1, [x27]
	mov	x0, x19
	bl	_vpu_cfg_readl
	cbnz	x0, LBB0_10
; %bb.12:
	ldr	x0, [x25, #8]
	mov	x1, x22
	mov	x2, x21
	bl	_memcpy
	stp	w21, w20, [x25]
	ldr	x8, [x19]
	mov	w9, w20
	lsl	x21, x9, #2
	str	wzr, [x8, x21]
	ldr	w2, [x27]
	mov	x0, x19
	mov	w1, #1
	bl	_vpu_cfg_writel
	mov	x0, x23
	bl	_mutex_unlock
	ldr	w0, [x26]
	bl	_msecs_to_jiffies
	mov	x2, x0
	ldr	w0, [x19, #16]
	ldr	x8, [x19]
	ldr	w1, [x8, x21]
	bl	_wait_event_timeout
	ldr	x8, [x19]
	str	wzr, [x8, x21]
	cbz	w0, LBB0_16
; %bb.13:
	mov	x0, x19
	bl	_vpu_clock_disable
	mov	w23, #0
	b	LBB0_7
LBB0_14:
	ldr	w0, [x19, #12]
Lloh19:
	adrp	x1, l_.str.2@PAGE
Lloh20:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_dev_err
Lloh21:
	adrp	x8, _EINVAL@GOTPAGE
Lloh22:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_17
LBB0_15:
	ldr	w0, [x19, #12]
Lloh23:
	adrp	x1, l_.str.3@PAGE
Lloh24:
	add	x1, x1, l_.str.3@PAGEOFF
	bl	_dev_err
Lloh25:
	adrp	x8, _EIO@GOTPAGE
Lloh26:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh27:
	ldr	w20, [x8]
	mov	x0, x23
	bl	_mutex_unlock
	b	LBB0_18
LBB0_16:
	ldr	w0, [x19, #12]
	str	x20, [sp]
Lloh28:
	adrp	x1, l_.str.4@PAGE
Lloh29:
	add	x1, x1, l_.str.4@PAGEOFF
	bl	_dev_err
Lloh30:
	adrp	x8, _EIO@GOTPAGE
Lloh31:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
LBB0_17:
	ldr	w20, [x8]
LBB0_18:
	neg	w23, w20
	mov	x0, x19
	bl	_vpu_clock_disable
	b	LBB0_7
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpLdrGot	Lloh30, Lloh31
	.loh AdrpAdd	Lloh28, Lloh29
	.cfi_endproc
                                        ; -- End function
	.comm	_IPI_VPU_INIT,4,2               ; @IPI_VPU_INIT
	.comm	_IPI_MAX,4,2                    ; @IPI_MAX
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"failed to send ipi message\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
l_.str.1:                               ; @.str.1
	.asciz	"failed to enable vpu clock\n"

l_.str.2:                               ; @.str.2
	.asciz	"vpu_ipi_send: VPU is not running\n"

	.comm	_jiffies,8,3                    ; @jiffies
	.comm	_IPI_TIMEOUT_MS,4,2             ; @IPI_TIMEOUT_MS
l_.str.3:                               ; @.str.3
	.asciz	"vpu_ipi_send: IPI timeout!\n"

	.comm	_EIO,4,2                        ; @EIO
	.comm	_HOST_TO_VPU,4,2                ; @HOST_TO_VPU
l_.str.4:                               ; @.str.4
	.asciz	"vpu ipi %d ack time out !"

.subsections_via_symbols
