	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cros_ec_pkt_xfer_rpmsg
_cros_ec_pkt_xfer_rpmsg:                ## @cros_ec_pkt_xfer_rpmsg
	.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
	movq	%rsi, %r14
	movq	%rdi, %r12
	movq	24(%rdi), %r13
	movl	$0, 20(%rsi)
	callq	_cros_ec_prepare_tx
	movl	%eax, %ebx
	movl	(%r12), %edi
	leaq	L_.str(%rip), %rsi
	movl	%eax, %edx
	callq	_dev_dbg
	movq	%r13, %rdi
	callq	_reinit_completion
	movl	4(%r13), %edi
	movl	16(%r12), %esi
	movl	%ebx, %edx
	callq	_rpmsg_send
	testl	%eax, %eax
	je	LBB0_2
## %bb.1:
	movl	%eax, %r15d
	movl	(%r12), %edi
	leaq	L_.str.1(%rip), %rsi
	xorl	%eax, %eax
	callq	_dev_err
LBB0_25:
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_2:
	movq	_EC_MSG_TIMEOUT_MS@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_msecs_to_jiffies
	movq	%r13, %rdi
	movq	%rax, %rsi
	callq	_wait_for_completion_timeout
	testl	%eax, %eax
	je	LBB0_3
## %bb.4:
	movq	8(%r12), %rbx
	movl	4(%rbx), %eax
	movl	%eax, 20(%r14)
	movq	%r12, %rdi
	movq	%r14, %rsi
	callq	_cros_ec_check_result
	movl	%eax, %r15d
	testl	%eax, %eax
	jne	LBB0_23
## %bb.5:
	movl	(%rbx), %edx
	movl	(%r14), %ecx
	cmpl	%ecx, %edx
	jle	LBB0_7
## %bb.6:
	movl	(%r12), %edi
	leaq	L_.str.3(%rip), %rsi
	xorl	%r15d, %r15d
	xorl	%eax, %eax
	callq	_dev_err
	movq	_EMSGSIZE@GOTPCREL(%rip), %rax
	jmp	LBB0_22
LBB0_3:
	movl	(%r12), %edi
	leaq	L_.str.2(%rip), %rsi
	xorl	%r15d, %r15d
	xorl	%eax, %eax
	callq	_dev_err
	movq	_EIO@GOTPCREL(%rip), %rax
	subl	(%rax), %r15d
	jmp	LBB0_25
LBB0_7:
	movl	16(%r14), %edi
	movq	8(%r12), %rsi
	addq	$64, %rsi
	callq	_memcpy
	movslq	(%rbx), %r15
	movq	%r15, %rax
	addq	$8, %rax
	je	LBB0_23
## %bb.8:
	movq	8(%r12), %rcx
	cmpq	$4, %rax
	jae	LBB0_11
## %bb.9:
	xorl	%esi, %esi
	xorl	%edx, %edx
	jmp	LBB0_10
LBB0_11:
	movq	%rax, %rsi
	andq	$-4, %rsi
	leaq	-4(%rsi), %rdi
	movq	%rdi, %rdx
	shrq	$2, %rdx
	incq	%rdx
	movl	%edx, %ebx
	andl	$3, %ebx
	cmpq	$12, %rdi
	jae	LBB0_13
## %bb.12:
	pxor	%xmm0, %xmm0
	xorl	%edi, %edi
	pxor	%xmm1, %xmm1
	jmp	LBB0_15
LBB0_13:
	andq	$-4, %rdx
	pxor	%xmm0, %xmm0
	xorl	%edi, %edi
	pxor	%xmm1, %xmm1
	.p2align	4, 0x90
LBB0_14:                                ## =>This Inner Loop Header: Depth=1
	movdqu	(%rcx,%rdi,8), %xmm2
	paddq	%xmm0, %xmm2
	movdqu	16(%rcx,%rdi,8), %xmm0
	paddq	%xmm1, %xmm0
	movdqu	32(%rcx,%rdi,8), %xmm1
	movdqu	48(%rcx,%rdi,8), %xmm3
	movdqu	64(%rcx,%rdi,8), %xmm4
	paddq	%xmm1, %xmm4
	paddq	%xmm2, %xmm4
	movdqu	80(%rcx,%rdi,8), %xmm2
	paddq	%xmm3, %xmm2
	paddq	%xmm0, %xmm2
	movdqu	96(%rcx,%rdi,8), %xmm0
	paddq	%xmm4, %xmm0
	movdqu	112(%rcx,%rdi,8), %xmm1
	paddq	%xmm2, %xmm1
	addq	$16, %rdi
	addq	$-4, %rdx
	jne	LBB0_14
LBB0_15:
	testq	%rbx, %rbx
	je	LBB0_18
## %bb.16:
	leaq	(%rcx,%rdi,8), %rdx
	addq	$16, %rdx
	shlq	$5, %rbx
	xorl	%edi, %edi
	.p2align	4, 0x90
LBB0_17:                                ## =>This Inner Loop Header: Depth=1
	movdqu	-16(%rdx,%rdi), %xmm2
	paddq	%xmm2, %xmm0
	movdqu	(%rdx,%rdi), %xmm2
	paddq	%xmm2, %xmm1
	addq	$32, %rdi
	cmpq	%rdi, %rbx
	jne	LBB0_17
LBB0_18:
	paddq	%xmm1, %xmm0
	pshufd	$238, %xmm0, %xmm1              ## xmm1 = xmm0[2,3,2,3]
	paddq	%xmm0, %xmm1
	movq	%xmm1, %rdx
	jmp	LBB0_19
LBB0_10:
	addq	(%rcx,%rsi,8), %rdx
	incq	%rsi
LBB0_19:
	cmpq	%rsi, %rax
	jne	LBB0_10
## %bb.20:
	testq	%rdx, %rdx
	je	LBB0_23
## %bb.21:
	movl	(%r12), %edi
	leaq	L_.str.4(%rip), %rsi
	xorl	%r15d, %r15d
	xorl	%eax, %eax
	callq	_dev_err
	movq	_EBADMSG@GOTPCREL(%rip), %rax
LBB0_22:
	subl	(%rax), %r15d
LBB0_23:
	movq	8(%r14), %rax
	movq	_EC_CMD_REBOOT_EC@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_25
## %bb.24:
	movq	_EC_REBOOT_DELAY_MS@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_msleep
	jmp	LBB0_25
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"prepared, len=%d\n"

L_.str.1:                               ## @.str.1
	.asciz	"rpmsg send failed\n"

	.comm	_EC_MSG_TIMEOUT_MS,4,2          ## @EC_MSG_TIMEOUT_MS
L_.str.2:                               ## @.str.2
	.asciz	"rpmsg send timeout\n"

	.comm	_EIO,4,2                        ## @EIO
L_.str.3:                               ## @.str.3
	.asciz	"packet too long (%d bytes, expected %d)"

	.comm	_EMSGSIZE,4,2                   ## @EMSGSIZE
L_.str.4:                               ## @.str.4
	.asciz	"bad packet checksum, calculated %x\n"

	.comm	_EBADMSG,4,2                    ## @EBADMSG
	.comm	_EC_CMD_REBOOT_EC,8,3           ## @EC_CMD_REBOOT_EC
	.comm	_EC_REBOOT_DELAY_MS,4,2         ## @EC_REBOOT_DELAY_MS
	.no_dead_strip	_cros_ec_pkt_xfer_rpmsg
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function cros_ec_pkt_xfer_rpmsg
_cros_ec_pkt_xfer_rpmsg:                ; @cros_ec_pkt_xfer_rpmsg
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
	mov	x19, x1
	mov	x20, x0
	ldr	x22, [x0, #24]
	str	wzr, [x1, #20]
	bl	_cros_ec_prepare_tx
	mov	x21, x0
	ldr	w0, [x20]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x21
	bl	_dev_dbg
	mov	x0, x22
	bl	_reinit_completion
	ldr	w0, [x22, #4]
	ldr	w1, [x20, #16]
	mov	x2, x21
	bl	_rpmsg_send
	cbz	w0, LBB0_3
; %bb.1:
	mov	x21, x0
	ldr	w0, [x20]
Lloh2:
	adrp	x1, l_.str.1@PAGE
Lloh3:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_err
LBB0_2:
	mov	x0, x21
	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
	add	sp, sp, #64
	ret
LBB0_3:
Lloh4:
	adrp	x8, _EC_MSG_TIMEOUT_MS@GOTPAGE
Lloh5:
	ldr	x8, [x8, _EC_MSG_TIMEOUT_MS@GOTPAGEOFF]
Lloh6:
	ldr	w0, [x8]
	bl	_msecs_to_jiffies
	mov	x1, x0
	mov	x0, x22
	bl	_wait_for_completion_timeout
	cbz	w0, LBB0_7
; %bb.4:
	ldr	x22, [x20, #8]
	ldr	w8, [x22, #4]
	str	w8, [x19, #20]
	mov	x0, x20
	mov	x1, x19
	bl	_cros_ec_check_result
	mov	x21, x0
	cbnz	w0, LBB0_19
; %bb.5:
	ldr	w2, [x22]
	ldr	w8, [x19]
	cmp	w2, w8
	b.le	LBB0_8
; %bb.6:
	ldr	w0, [x20]
	stp	x2, x8, [sp]
Lloh7:
	adrp	x1, l_.str.3@PAGE
Lloh8:
	add	x1, x1, l_.str.3@PAGEOFF
	bl	_dev_err
Lloh9:
	adrp	x8, _EMSGSIZE@GOTPAGE
Lloh10:
	ldr	x8, [x8, _EMSGSIZE@GOTPAGEOFF]
	b	LBB0_18
LBB0_7:
	ldr	w0, [x20]
Lloh11:
	adrp	x1, l_.str.2@PAGE
Lloh12:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_dev_err
Lloh13:
	adrp	x8, _EIO@GOTPAGE
Lloh14:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_2
LBB0_8:
	ldr	w0, [x19, #16]
	ldr	x8, [x20, #8]
	add	x1, x8, #64
                                        ; kill: def $w2 killed $w2 killed $x2
	bl	_memcpy
	ldr	w21, [x22]
	sxtw	x8, w21
	adds	x11, x8, #8
	b.eq	LBB0_19
; %bb.9:
	ldr	x9, [x20, #8]
	cmn	w21, #9
	b.ls	LBB0_11
; %bb.10:
	mov	x10, #0
	mov	x12, #0
	b	LBB0_14
LBB0_11:
	and	x10, x11, #0xfffffffffffffff8
	add	x12, x9, #32
	movi.2d	v0, #0000000000000000
	mov	x13, x10
	movi.2d	v1, #0000000000000000
	movi.2d	v2, #0000000000000000
	movi.2d	v3, #0000000000000000
LBB0_12:                                ; =>This Inner Loop Header: Depth=1
	ldp	q4, q5, [x12, #-32]
	ldp	q6, q7, [x12], #64
	add.2d	v0, v4, v0
	add.2d	v1, v5, v1
	add.2d	v2, v6, v2
	add.2d	v3, v7, v3
	subs	x13, x13, #8
	b.ne	LBB0_12
; %bb.13:
	add.2d	v0, v1, v0
	add.2d	v0, v2, v0
	add.2d	v0, v3, v0
	addp.2d	d0, v0
	fmov	x12, d0
	cmp	x11, x10
	b.eq	LBB0_16
LBB0_14:
	add	x9, x9, x10, lsl #3
	sub	x8, x8, x10
	add	x8, x8, #8
LBB0_15:                                ; =>This Inner Loop Header: Depth=1
	ldr	x10, [x9], #8
	add	x12, x10, x12
	subs	x8, x8, #1
	b.ne	LBB0_15
LBB0_16:
	cbz	x12, LBB0_19
; %bb.17:
	ldr	w0, [x20]
	str	x12, [sp]
Lloh16:
	adrp	x1, l_.str.4@PAGE
Lloh17:
	add	x1, x1, l_.str.4@PAGEOFF
	bl	_dev_err
Lloh18:
	adrp	x8, _EBADMSG@GOTPAGE
Lloh19:
	ldr	x8, [x8, _EBADMSG@GOTPAGEOFF]
LBB0_18:
	ldr	w8, [x8]
	neg	w21, w8
LBB0_19:
	ldr	x8, [x19, #8]
Lloh20:
	adrp	x9, _EC_CMD_REBOOT_EC@GOTPAGE
Lloh21:
	ldr	x9, [x9, _EC_CMD_REBOOT_EC@GOTPAGEOFF]
Lloh22:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_2
; %bb.20:
Lloh23:
	adrp	x8, _EC_REBOOT_DELAY_MS@GOTPAGE
Lloh24:
	ldr	x8, [x8, _EC_REBOOT_DELAY_MS@GOTPAGEOFF]
Lloh25:
	ldr	w0, [x8]
	bl	_msleep
	b	LBB0_2
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"prepared, len=%d\n"

l_.str.1:                               ; @.str.1
	.asciz	"rpmsg send failed\n"

	.comm	_EC_MSG_TIMEOUT_MS,4,2          ; @EC_MSG_TIMEOUT_MS
l_.str.2:                               ; @.str.2
	.asciz	"rpmsg send timeout\n"

	.comm	_EIO,4,2                        ; @EIO
l_.str.3:                               ; @.str.3
	.asciz	"packet too long (%d bytes, expected %d)"

	.comm	_EMSGSIZE,4,2                   ; @EMSGSIZE
l_.str.4:                               ; @.str.4
	.asciz	"bad packet checksum, calculated %x\n"

	.comm	_EBADMSG,4,2                    ; @EBADMSG
	.comm	_EC_CMD_REBOOT_EC,8,3           ; @EC_CMD_REBOOT_EC
	.comm	_EC_REBOOT_DELAY_MS,4,2         ; @EC_REBOOT_DELAY_MS
	.no_dead_strip	_cros_ec_pkt_xfer_rpmsg
.subsections_via_symbols
