	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cros_ec_pkt_xfer_lpc
_cros_ec_pkt_xfer_lpc:                  ## @cros_ec_pkt_xfer_lpc
	.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	$24, %rsp
	.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, %r15
	callq	_cros_ec_prepare_tx
	movq	_cros_ec_lpc_ops@GOTPCREL(%rip), %r12
	movq	_EC_LPC_ADDR_HOST_PACKET@GOTPCREL(%rip), %r13
	movq	(%r13), %rdi
	movq	8(%r15), %rdx
	movl	%eax, %esi
	callq	*8(%r12)
	movq	_EC_COMMAND_PROTOCOL_3@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	_EC_LPC_ADDR_HOST_CMD@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	leaq	-48(%rbp), %rdx
	movl	$1, %esi
	callq	*8(%r12)
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_ec_response_timed_out
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movl	(%r15), %edi
	leaq	L_.str(%rip), %rsi
	callq	_dev_warn
	movq	_EIO@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
	jmp	LBB0_8
LBB0_2:
	movq	_EC_LPC_ADDR_HOST_DATA@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	leaq	-48(%rbp), %rdx
	movl	$1, %esi
	callq	*(%r12)
	movq	%rax, 16(%r14)
	movq	%r15, %rdi
	movq	%r14, %rsi
	callq	_cros_ec_check_result
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_8
## %bb.3:
	movq	(%r13), %rdi
	leaq	-64(%rbp), %rdx
	movl	$16, %esi
	callq	*(%r12)
	movq	%rax, -48(%rbp)
	movq	-56(%rbp), %rax
	movq	%rax, 16(%r14)
	movl	-64(%rbp), %edx
	movl	(%r14), %ecx
	cmpl	%ecx, %edx
	jle	LBB0_5
## %bb.4:
	movl	(%r15), %edi
	leaq	L_.str.1(%rip), %rsi
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_dev_err
	movq	_EMSGSIZE@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
	jmp	LBB0_8
LBB0_5:
	movq	(%r13), %rdi
	addq	$16, %rdi
	movq	8(%r14), %rax
	movl	%edx, %esi
	movq	%rax, %rdx
	callq	*(%r12)
	addq	%rax, -48(%rbp)
	je	LBB0_7
## %bb.6:
	movl	(%r15), %edi
	movl	-60(%rbp), %edx
	leaq	L_.str.2(%rip), %rsi
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_dev_err
	movq	_EBADMSG@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
	jmp	LBB0_8
LBB0_7:
	movl	-64(%rbp), %ebx
LBB0_8:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_cros_ec_lpc_ops,16,3           ## @cros_ec_lpc_ops
	.comm	_EC_LPC_ADDR_HOST_PACKET,8,3    ## @EC_LPC_ADDR_HOST_PACKET
	.comm	_EC_COMMAND_PROTOCOL_3,8,3      ## @EC_COMMAND_PROTOCOL_3
	.comm	_EC_LPC_ADDR_HOST_CMD,8,3       ## @EC_LPC_ADDR_HOST_CMD
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"EC responsed timed out\n"

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

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

	.comm	_EBADMSG,4,2                    ## @EBADMSG
	.no_dead_strip	_cros_ec_pkt_xfer_lpc
.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_lpc
_cros_ec_pkt_xfer_lpc:                  ; @cros_ec_pkt_xfer_lpc
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	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
	mov	x20, x1
	mov	x19, x0
	bl	_cros_ec_prepare_tx
	mov	x1, x0
Lloh0:
	adrp	x21, _cros_ec_lpc_ops@GOTPAGE
Lloh1:
	ldr	x21, [x21, _cros_ec_lpc_ops@GOTPAGEOFF]
	ldr	x8, [x21, #8]
Lloh2:
	adrp	x22, _EC_LPC_ADDR_HOST_PACKET@GOTPAGE
Lloh3:
	ldr	x22, [x22, _EC_LPC_ADDR_HOST_PACKET@GOTPAGEOFF]
	ldr	x0, [x22]
	ldr	x2, [x19, #8]
	blr	x8
Lloh4:
	adrp	x8, _EC_COMMAND_PROTOCOL_3@GOTPAGE
Lloh5:
	ldr	x8, [x8, _EC_COMMAND_PROTOCOL_3@GOTPAGEOFF]
Lloh6:
	ldr	x8, [x8]
	str	x8, [sp, #8]
	ldr	x8, [x21, #8]
Lloh7:
	adrp	x9, _EC_LPC_ADDR_HOST_CMD@GOTPAGE
Lloh8:
	ldr	x9, [x9, _EC_LPC_ADDR_HOST_CMD@GOTPAGEOFF]
Lloh9:
	ldr	x0, [x9]
	add	x2, sp, #8
	mov	w1, #1
	blr	x8
	bl	_ec_response_timed_out
	cbz	x0, LBB0_3
; %bb.1:
	ldr	w0, [x19]
Lloh10:
	adrp	x1, l_.str@PAGE
Lloh11:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_warn
Lloh12:
	adrp	x8, _EIO@GOTPAGE
Lloh13:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
LBB0_2:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_4
LBB0_3:
	ldr	x8, [x21]
Lloh14:
	adrp	x9, _EC_LPC_ADDR_HOST_DATA@GOTPAGE
Lloh15:
	ldr	x9, [x9, _EC_LPC_ADDR_HOST_DATA@GOTPAGEOFF]
Lloh16:
	ldr	x0, [x9]
	add	x2, sp, #8
	mov	w1, #1
	blr	x8
	str	x0, [x20, #16]
	mov	x0, x19
	mov	x1, x20
	bl	_cros_ec_check_result
	cbz	w0, LBB0_5
LBB0_4:
	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
	add	sp, sp, #80
	ret
LBB0_5:
	ldr	x8, [x21]
	ldr	x0, [x22]
	add	x2, sp, #16
	mov	w1, #16
	blr	x8
	str	x0, [sp, #8]
	ldr	x8, [sp, #24]
	str	x8, [x20, #16]
	ldr	w8, [sp, #16]
	ldr	w9, [x20]
	cmp	w8, w9
	b.le	LBB0_7
; %bb.6:
	ldr	w0, [x19]
	str	x9, [sp]
Lloh17:
	adrp	x1, l_.str.1@PAGE
Lloh18:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x2, x8
	bl	_dev_err
Lloh19:
	adrp	x8, _EMSGSIZE@GOTPAGE
Lloh20:
	ldr	x8, [x8, _EMSGSIZE@GOTPAGEOFF]
	b	LBB0_2
LBB0_7:
	ldr	x9, [x21]
	ldr	x10, [x22]
	add	x0, x10, #16
	ldr	x2, [x20, #8]
	mov	x1, x8
	blr	x9
	ldr	x8, [sp, #8]
	adds	x8, x8, x0
	str	x8, [sp, #8]
	b.eq	LBB0_9
; %bb.8:
	ldr	w0, [x19]
	ldr	w2, [sp, #20]
Lloh21:
	adrp	x1, l_.str.2@PAGE
Lloh22:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_dev_err
Lloh23:
	adrp	x8, _EBADMSG@GOTPAGE
Lloh24:
	ldr	x8, [x8, _EBADMSG@GOTPAGEOFF]
	b	LBB0_2
LBB0_9:
	ldr	w0, [sp, #16]
	b	LBB0_4
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh23, Lloh24
	.loh AdrpAdd	Lloh21, Lloh22
	.cfi_endproc
                                        ; -- End function
	.comm	_cros_ec_lpc_ops,16,3           ; @cros_ec_lpc_ops
	.comm	_EC_LPC_ADDR_HOST_PACKET,8,3    ; @EC_LPC_ADDR_HOST_PACKET
	.comm	_EC_COMMAND_PROTOCOL_3,8,3      ; @EC_COMMAND_PROTOCOL_3
	.comm	_EC_LPC_ADDR_HOST_CMD,8,3       ; @EC_LPC_ADDR_HOST_CMD
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"EC responsed timed out\n"

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

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

	.comm	_EBADMSG,4,2                    ; @EBADMSG
	.no_dead_strip	_cros_ec_pkt_xfer_lpc
.subsections_via_symbols
