	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ec_i2c_construct_message
_ec_i2c_construct_message:              ## @ec_i2c_construct_message
	.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
	movl	%ecx, 16(%rdi)
	movl	%edx, (%rdi)
	testl	%edx, %edx
	jle	LBB0_8
## %bb.1:
	movq	%rsi, %r13
	movl	%edx, %eax
	leaq	(,%rax,8), %r9
	shlq	$5, %rax
	leaq	(%rdi,%rax), %r14
	addq	$96, %r14
	xorl	%ebx, %ebx
	movq	_I2C_M_TEN@GOTPCREL(%rip), %r15
	movq	_I2C_M_RD@GOTPCREL(%rip), %rsi
	movq	%r9, -56(%rbp)                  ## 8-byte Spill
	movq	%rdi, -48(%rbp)                 ## 8-byte Spill
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_6:                                 ##   in Loop: Header=BB0_2 Depth=1
	movl	4(%r13,%rbx,2), %esi
	movq	%r14, %rdi
	callq	_memcpy
	movq	_I2C_M_RD@GOTPCREL(%rip), %rsi
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movq	-56(%rbp), %r9                  ## 8-byte Reload
	movslq	(%r12,%rbx), %rax
	leaq	(%r14,%rax,4), %r14
LBB0_7:                                 ##   in Loop: Header=BB0_2 Depth=1
	addq	$8, %rbx
	cmpq	%rbx, %r9
	je	LBB0_8
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	8(%rdi), %r12
	movl	12(%r13,%rbx,2), %edx
	movl	%edx, (%r12,%rbx)
	movl	8(%r13,%rbx,2), %eax
	movl	%eax, 4(%r12,%rbx)
	movl	(%r13,%rbx,2), %ecx
	testl	%ecx, (%r15)
	jne	LBB0_5
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	testl	%ecx, (%rsi)
	je	LBB0_6
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	_EC_I2C_FLAG_READ@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movl	%eax, 4(%r12,%rbx)
	jmp	LBB0_7
LBB0_8:
	xorl	%eax, %eax
	jmp	LBB0_9
LBB0_5:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_9:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_I2C_M_TEN,4,2                  ## @I2C_M_TEN
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_I2C_M_RD,4,2                   ## @I2C_M_RD
	.comm	_EC_I2C_FLAG_READ,4,2           ## @EC_I2C_FLAG_READ
	.no_dead_strip	_ec_i2c_construct_message
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ec_i2c_construct_message
_ec_i2c_construct_message:              ; @ec_i2c_construct_message
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	str	w3, [x0, #16]
	str	w2, [x0]
	cmp	w2, #1
	b.lt	LBB0_7
; %bb.1:
	mov	x19, x0
	mov	x21, #0
	mov	w8, w2
	add	x9, x0, x8, lsl #5
	lsl	x22, x8, #3
	add	x20, x9, #96
	add	x23, x1, #8
Lloh0:
	adrp	x24, _I2C_M_TEN@GOTPAGE
Lloh1:
	ldr	x24, [x24, _I2C_M_TEN@GOTPAGEOFF]
Lloh2:
	adrp	x25, _I2C_M_RD@GOTPAGE
Lloh3:
	ldr	x25, [x25, _I2C_M_RD@GOTPAGEOFF]
Lloh4:
	adrp	x26, _EC_I2C_FLAG_READ@GOTPAGE
Lloh5:
	ldr	x26, [x26, _EC_I2C_FLAG_READ@GOTPAGEOFF]
	b	LBB0_4
LBB0_2:                                 ;   in Loop: Header=BB0_4 Depth=1
	ldur	w1, [x23, #-4]
	mov	x0, x20
	bl	_memcpy
	ldrsw	x8, [x27, x21]
	add	x20, x20, x8, lsl #2
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	add	x23, x23, #16
	add	x21, x21, #8
	cmp	x22, x21
	b.eq	LBB0_7
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x27, [x19, #8]
	add	x8, x27, x21
	ldp	w9, w2, [x23]
	stp	w2, w9, [x8]
	ldur	w10, [x23, #-8]
	ldr	w11, [x24]
	tst	w11, w10
	b.ne	LBB0_8
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	w11, [x25]
	tst	w11, w10
	b.eq	LBB0_2
; %bb.6:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	w10, [x26]
	orr	w9, w10, w9
	str	w9, [x8, #4]
	b	LBB0_3
LBB0_7:
	mov	w0, #0
	b	LBB0_9
LBB0_8:
Lloh6:
	adrp	x8, _EINVAL@GOTPAGE
Lloh7:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_9:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_I2C_M_TEN,4,2                  ; @I2C_M_TEN
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_I2C_M_RD,4,2                   ; @I2C_M_RD
	.comm	_EC_I2C_FLAG_READ,4,2           ; @EC_I2C_FLAG_READ
	.no_dead_strip	_ec_i2c_construct_message
.subsections_via_symbols
