	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ec_i2c_xfer
_ec_i2c_xfer:                           ## @ec_i2c_xfer
	.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	%edx, %r15d
	movq	%rsi, %rbx
	movl	%edx, -44(%rbp)
	movq	(%rdi), %r12
	movq	8(%r12), %r14
	movl	4(%r12), %eax
	movl	%eax, -60(%rbp)                 ## 4-byte Spill
	movq	%rsi, %rdi
	movl	%edx, %esi
	callq	_ec_i2c_count_message
	movl	%eax, %r13d
	testl	%eax, %eax
	js	LBB0_1
## %bb.2:
	movq	%r14, -56(%rbp)                 ## 8-byte Spill
	movq	%rbx, -72(%rbp)                 ## 8-byte Spill
	movq	%rbx, %rdi
	movl	%r15d, %esi
	callq	_ec_i2c_count_response
	movl	%eax, %r14d
	testl	%eax, %eax
	js	LBB0_3
## %bb.4:
	movl	%r13d, %edi
	movl	%r14d, %esi
	callq	_max
                                        ## kill: def $eax killed $eax def $rax
	leal	24(%rax), %edi
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_kmalloc
	testq	%rax, %rax
	je	LBB0_5
## %bb.6:
	movq	%rax, %rbx
	movl	8(%rax), %edi
	movq	-72(%rbp), %rsi                 ## 8-byte Reload
	movl	%r15d, %edx
	movl	-60(%rbp), %ecx                 ## 4-byte Reload
	callq	_ec_i2c_construct_message
	movq	%rbx, %r15
	testl	%eax, %eax
	je	LBB0_8
## %bb.7:
	movl	%eax, %ebx
	leaq	L_.str.2(%rip), %rsi
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movl	%eax, %edx
	callq	_dev_err
	movl	%ebx, %r13d
LBB0_12:
	movq	%r15, %rdi
	callq	_kfree
	jmp	LBB0_13
LBB0_1:
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
	movl	%r13d, %edx
	callq	_dev_warn
	jmp	LBB0_13
LBB0_3:
	leaq	L_.str.1(%rip), %rsi
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movl	%r14d, %edx
	callq	_dev_warn
	movl	%r14d, %r13d
	jmp	LBB0_13
LBB0_5:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r13d, %r13d
	subl	(%rax), %r13d
LBB0_13:
	movl	%r13d, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	movq	$0, 16(%r15)
	movq	_EC_CMD_I2C_PASSTHRU@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 12(%r15)
	movl	%r13d, (%r15)
	movl	%r14d, 4(%r15)
	movl	(%r12), %edi
	movq	%r15, %rsi
	callq	_cros_ec_cmd_xfer_status
	testl	%eax, %eax
	js	LBB0_9
## %bb.10:
	movl	8(%r15), %edi
	leaq	-44(%rbp), %rdx
	movq	-72(%rbp), %rsi                 ## 8-byte Reload
	callq	_ec_i2c_parse_response
	movl	%eax, %r13d
	testl	%eax, %eax
	js	LBB0_12
## %bb.11:
	movl	-44(%rbp), %r13d
	jmp	LBB0_12
LBB0_9:
	movl	%eax, %r13d
	leaq	L_.str.3(%rip), %rsi
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movl	%eax, %edx
	callq	_dev_err
	jmp	LBB0_12
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Error constructing message %d\n"

L_.str.1:                               ## @.str.1
	.asciz	"Error preparing response %d\n"

	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
L_.str.2:                               ## @.str.2
	.asciz	"Error constructing EC i2c message %d\n"

	.comm	_EC_CMD_I2C_PASSTHRU,4,2        ## @EC_CMD_I2C_PASSTHRU
L_.str.3:                               ## @.str.3
	.asciz	"Error transferring EC i2c message %d\n"

	.no_dead_strip	_ec_i2c_xfer
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ec_i2c_xfer
_ec_i2c_xfer:                           ; @ec_i2c_xfer
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.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
	mov	x24, x2
	mov	x21, x1
	str	w2, [sp, #12]
	ldr	x26, [x0]
	ldr	x20, [x26, #8]
	ldr	w25, [x26, #4]
	mov	x0, x1
	mov	x1, x2
	bl	_ec_i2c_count_message
	mov	x19, x0
	tbnz	w0, #31, LBB0_5
; %bb.1:
	mov	x0, x21
	mov	x1, x24
	bl	_ec_i2c_count_response
	mov	x23, x0
	tbnz	w0, #31, LBB0_6
; %bb.2:
	mov	x0, x19
	mov	x1, x23
	bl	_max
	add	w0, w0, #24
Lloh0:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	bl	_kmalloc
	cbz	x0, LBB0_7
; %bb.3:
	mov	x22, x0
	ldr	w0, [x0, #8]
	mov	x1, x21
	mov	x2, x24
	mov	x3, x25
	bl	_ec_i2c_construct_message
	cbz	w0, LBB0_8
; %bb.4:
	mov	x24, x0
Lloh3:
	adrp	x1, l_.str.2@PAGE
Lloh4:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x20
	mov	x2, x24
	bl	_dev_err
	mov	x19, x24
	b	LBB0_11
LBB0_5:
Lloh5:
	adrp	x1, l_.str@PAGE
Lloh6:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x20
	mov	x2, x19
	bl	_dev_warn
	b	LBB0_12
LBB0_6:
Lloh7:
	adrp	x1, l_.str.1@PAGE
Lloh8:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x20
	mov	x2, x23
	bl	_dev_warn
	mov	x19, x23
	b	LBB0_12
LBB0_7:
Lloh9:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh10:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	neg	w19, w8
	b	LBB0_12
LBB0_8:
Lloh12:
	adrp	x8, _EC_CMD_I2C_PASSTHRU@GOTPAGE
Lloh13:
	ldr	x8, [x8, _EC_CMD_I2C_PASSTHRU@GOTPAGEOFF]
	str	xzr, [x22, #16]
Lloh14:
	ldr	w8, [x8]
	str	w8, [x22, #12]
	stp	w19, w23, [x22]
	ldr	w0, [x26]
	mov	x1, x22
	bl	_cros_ec_cmd_xfer_status
	tbnz	w0, #31, LBB0_10
; %bb.9:
	ldr	w0, [x22, #8]
	add	x2, sp, #12
	mov	x1, x21
	bl	_ec_i2c_parse_response
	ldr	w8, [sp, #12]
	cmp	w0, #0
	csel	w19, w0, w8, lt
	b	LBB0_11
LBB0_10:
	mov	x19, x0
Lloh15:
	adrp	x1, l_.str.3@PAGE
Lloh16:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x0, x20
	mov	x2, x19
	bl	_dev_err
LBB0_11:
	mov	x0, x22
	bl	_kfree
LBB0_12:
	mov	x0, x19
	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
	add	sp, sp, #96
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpAdd	Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Error constructing message %d\n"

l_.str.1:                               ; @.str.1
	.asciz	"Error preparing response %d\n"

	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
l_.str.2:                               ; @.str.2
	.asciz	"Error constructing EC i2c message %d\n"

	.comm	_EC_CMD_I2C_PASSTHRU,4,2        ; @EC_CMD_I2C_PASSTHRU
l_.str.3:                               ; @.str.3
	.asciz	"Error transferring EC i2c message %d\n"

	.no_dead_strip	_ec_i2c_xfer
.subsections_via_symbols
