	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_cros_ec_prepare_tx             ## -- Begin function cros_ec_prepare_tx
	.p2align	4, 0x90
_cros_ec_prepare_tx:                    ## @cros_ec_prepare_tx
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r15
	movq	%rdi, %r14
	cmpl	$3, (%rdi)
	jl	LBB0_1
## %bb.5:
	movq	%r14, %rdi
	movq	%r15, %rsi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_prepare_packet                 ## TAILCALL
LBB0_1:
	movl	(%r15), %eax
	movq	_EC_PROTO2_MAX_PARAM_SIZE@GOTPCREL(%rip), %rcx
	xorl	%edi, %edi
	cmpl	(%rcx), %eax
	setg	%dil
	callq	_BUG_ON
	movq	8(%r14), %rax
	movq	_EC_CMD_VERSION0@GOTPCREL(%rip), %rdx
	movl	4(%r15), %ecx
	addl	(%rdx), %ecx
	movl	%ecx, (%rax)
	movl	8(%r15), %edx
	movl	%edx, 4(%rax)
	movl	(%r15), %esi
	movl	%esi, 8(%rax)
	addl	%edx, %ecx
	addl	%esi, %ecx
	movl	(%r15), %edi
	testl	%edi, %edi
	jle	LBB0_4
## %bb.2:
	movq	16(%r15), %rdx
	xorl	%esi, %esi
	movq	_EC_MSG_TX_HEADER_BYTES@GOTPCREL(%rip), %r8
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%rdx,%rsi,4), %edi
	movslq	(%r8), %rbx
	addq	%rsi, %rbx
	movl	%edi, (%rax,%rbx,4)
	addl	%edi, %ecx
	incq	%rsi
	movslq	(%r15), %rdi
	cmpq	%rdi, %rsi
	jl	LBB0_3
LBB0_4:
	movq	_EC_MSG_TX_HEADER_BYTES@GOTPCREL(%rip), %rdx
	movslq	(%rdx), %rdx
	movslq	%edi, %rsi
	addq	%rdx, %rsi
	movl	%ecx, (%rax,%rsi,4)
	movq	_EC_MSG_TX_PROTO_BYTES@GOTPCREL(%rip), %rcx
	movl	(%r15), %eax
	addl	(%rcx), %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EC_PROTO2_MAX_PARAM_SIZE,4,2   ## @EC_PROTO2_MAX_PARAM_SIZE
	.comm	_EC_CMD_VERSION0,4,2            ## @EC_CMD_VERSION0
	.comm	_EC_MSG_TX_HEADER_BYTES,4,2     ## @EC_MSG_TX_HEADER_BYTES
	.comm	_EC_MSG_TX_PROTO_BYTES,4,2      ## @EC_MSG_TX_PROTO_BYTES
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_cros_ec_prepare_tx             ; -- Begin function cros_ec_prepare_tx
	.p2align	2
_cros_ec_prepare_tx:                    ; @cros_ec_prepare_tx
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x1
	mov	x20, x0
	ldr	w8, [x0]
	cmp	w8, #3
	b.lt	LBB0_2
; %bb.1:
	mov	x0, x20
	mov	x1, x19
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_prepare_packet
LBB0_2:
	ldr	w8, [x19]
Lloh0:
	adrp	x9, _EC_PROTO2_MAX_PARAM_SIZE@GOTPAGE
Lloh1:
	ldr	x9, [x9, _EC_PROTO2_MAX_PARAM_SIZE@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	cmp	w8, w9
	cset	w0, gt
	bl	_BUG_ON
	ldr	x8, [x20, #8]
Lloh3:
	adrp	x9, _EC_CMD_VERSION0@GOTPAGE
Lloh4:
	ldr	x9, [x9, _EC_CMD_VERSION0@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	ldr	w10, [x19, #4]
	add	w9, w10, w9
	str	w9, [x8]
	ldr	w10, [x19, #8]
	str	w10, [x8, #4]
	ldr	w11, [x19]
	str	w11, [x8, #8]
	add	w9, w10, w9
	add	w9, w9, w11
	ldr	w13, [x19]
Lloh6:
	adrp	x10, _EC_MSG_TX_HEADER_BYTES@GOTPAGE
Lloh7:
	ldr	x10, [x10, _EC_MSG_TX_HEADER_BYTES@GOTPAGEOFF]
	cmp	w13, #1
	b.lt	LBB0_5
; %bb.3:
	mov	x11, #0
	ldr	x12, [x19, #16]
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w13, [x12, x11, lsl #2]
	ldrsw	x14, [x10]
	add	x14, x11, x14
	str	w13, [x8, x14, lsl #2]
	add	w9, w13, w9
	add	x11, x11, #1
	ldrsw	x13, [x19]
	cmp	x11, x13
	b.lt	LBB0_4
LBB0_5:
	ldr	w10, [x10]
	add	w10, w10, w13
	str	w9, [x8, w10, sxtw #2]
Lloh8:
	adrp	x8, _EC_MSG_TX_PROTO_BYTES@GOTPAGE
Lloh9:
	ldr	x8, [x8, _EC_MSG_TX_PROTO_BYTES@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	ldr	w9, [x19]
	add	w0, w9, w8
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_EC_PROTO2_MAX_PARAM_SIZE,4,2   ; @EC_PROTO2_MAX_PARAM_SIZE
	.comm	_EC_CMD_VERSION0,4,2            ; @EC_CMD_VERSION0
	.comm	_EC_MSG_TX_HEADER_BYTES,4,2     ; @EC_MSG_TX_HEADER_BYTES
	.comm	_EC_MSG_TX_PROTO_BYTES,4,2      ; @EC_MSG_TX_PROTO_BYTES
.subsections_via_symbols
