	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function elan_i2c_read_block
_elan_i2c_read_block:                   ## @elan_i2c_read_block
	.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
	subq	$72, %rsp
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%ecx, %r15d
	movq	%rdx, %r14
	movq	%rdi, %rbx
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -32(%rbp)
	movl	%esi, %edi
	callq	_cpu_to_le16
	movl	%eax, -84(%rbp)
	movq	_I2C_M_TEN@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	andl	(%rbx), %eax
	movl	%eax, -80(%rbp)
	movl	$4, -76(%rbp)
	leaq	-84(%rbp), %rcx
	movq	%rcx, -72(%rbp)
	movl	8(%rbx), %ecx
	movl	%ecx, -64(%rbp)
	movq	_I2C_M_RD@GOTPCREL(%rip), %rdx
	orl	(%rdx), %eax
	movl	%eax, -56(%rbp)
	movl	%r15d, -52(%rbp)
	movq	%r14, -48(%rbp)
	movl	%ecx, -40(%rbp)
	movl	4(%rbx), %ebx
	leaq	-80(%rbp), %r14
	movq	%r14, %rdi
	callq	_ARRAY_SIZE
	movl	%ebx, %edi
	movq	%r14, %rsi
	movl	%eax, %edx
	callq	_i2c_transfer
	movl	%eax, %ebx
	movq	%r14, %rdi
	callq	_ARRAY_SIZE
	movq	_EIO@GOTPCREL(%rip), %rdx
	xorl	%ecx, %ecx
	subl	(%rdx), %ecx
	xorl	%edx, %edx
	testl	%ebx, %ebx
	cmovsl	%ebx, %ecx
	cmpl	%eax, %ebx
	cmovel	%edx, %ecx
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-32(%rbp), %rax
	jne	LBB0_2
## %bb.1:
	movl	%ecx, %eax
	addq	$72, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_2:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_I2C_M_TEN,4,2                  ## @I2C_M_TEN
	.comm	_I2C_M_RD,4,2                   ## @I2C_M_RD
	.comm	_EIO,4,2                        ## @EIO
	.no_dead_strip	_elan_i2c_read_block
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function elan_i2c_read_block
_elan_i2c_read_block:                   ; @elan_i2c_read_block
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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, x3
	mov	x20, x2
	mov	x21, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-40]
	mov	x0, x1
	bl	_cpu_to_le16
	str	w0, [sp, #4]
Lloh3:
	adrp	x8, _I2C_M_TEN@GOTPAGE
Lloh4:
	ldr	x8, [x8, _I2C_M_TEN@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	ldp	w9, w22, [x21]
	and	w8, w8, w9
	mov	w9, #4
	stp	w8, w9, [sp, #8]
	add	x9, sp, #4
	str	x9, [sp, #16]
	ldr	w9, [x21, #8]
Lloh6:
	adrp	x10, _I2C_M_RD@GOTPAGE
Lloh7:
	ldr	x10, [x10, _I2C_M_RD@GOTPAGEOFF]
Lloh8:
	ldr	w10, [x10]
	orr	w8, w10, w8
	str	w9, [sp, #24]
	stp	w8, w19, [sp, #32]
	str	x20, [sp, #40]
	str	w9, [sp, #48]
	add	x0, sp, #8
	bl	_ARRAY_SIZE
	mov	x2, x0
	add	x1, sp, #8
	mov	x0, x22
	bl	_i2c_transfer
	mov	x19, x0
	add	x0, sp, #8
	bl	_ARRAY_SIZE
Lloh9:
	adrp	x8, _EIO@GOTPAGE
Lloh10:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	cmp	w19, #0
	csneg	w8, w19, w8, lt
	cmp	w19, w0
	csel	w0, wzr, w8, eq
	ldur	x8, [x29, #-40]
Lloh12:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh13:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh14:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_2
; %bb.1:
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_2:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_I2C_M_TEN,4,2                  ; @I2C_M_TEN
	.comm	_I2C_M_RD,4,2                   ; @I2C_M_RD
	.comm	_EIO,4,2                        ; @EIO
	.no_dead_strip	_elan_i2c_read_block
.subsections_via_symbols
