	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function goodix_i2c_read
_goodix_i2c_read:                       ## @goodix_i2c_read
	.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	$88, %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_be16
	movl	%eax, -100(%rbp)
	movq	$0, -72(%rbp)
	movl	4(%rbx), %eax
	movl	%eax, -80(%rbp)
	movl	$2, -96(%rbp)
	leaq	-100(%rbp), %rcx
	movq	%rcx, -88(%rbp)
	movq	_I2C_M_RD@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	%rcx, -40(%rbp)
	movl	%eax, -48(%rbp)
	movl	%r15d, -64(%rbp)
	movq	%r14, -56(%rbp)
	movl	(%rbx), %edi
	leaq	-96(%rbp), %rsi
	movl	$2, %edx
	callq	_i2c_transfer
	movl	%eax, %ebx
	testl	%eax, %eax
	js	LBB0_2
## %bb.1:
	leaq	-96(%rbp), %rdi
	callq	_ARRAY_SIZE
	movq	_EIO@GOTPCREL(%rip), %rcx
	xorl	%edx, %edx
	subl	(%rcx), %edx
	xorl	%ecx, %ecx
	cmpl	%eax, %ebx
	cmovel	%ecx, %edx
	movl	%edx, %ebx
LBB0_2:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-32(%rbp), %rax
	jne	LBB0_4
## %bb.3:
	movl	%ebx, %eax
	addq	$88, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_4:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_I2C_M_RD,8,3                   ## @I2C_M_RD
	.comm	_EIO,4,2                        ## @EIO
	.no_dead_strip	_goodix_i2c_read
.subsections_via_symbols

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