	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function i2c_read_hand
_i2c_read_hand:                         ## @i2c_read_hand
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%rbx
	subq	$56, %rsp
	.cfi_offset %rbx, -24
	movl	%edi, %ebx
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -16(%rbp)
	callq	_I2C_ADDR
	movq	_I2C_TIMEOUT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	leaq	-64(%rbp), %rsi
	movl	%eax, %edi
	movl	$40, %edx
	callq	_i2c_receive
	movq	%rax, %rcx
	movq	_I2C_STATUS_SUCCESS@GOTPCREL(%rip), %rdx
	movl	$1, %eax
	cmpq	(%rdx), %rcx
	jne	LBB0_5
## %bb.1:
	movq	-64(%rbp), %rcx
	movq	_TWI_REPLY_KEYDATA@GOTPCREL(%rip), %rdx
	movl	$2, %eax
	cmpq	(%rdx), %rcx
	jne	LBB0_5
## %bb.2:
	testl	%ebx, %ebx
	je	LBB0_4
## %bb.3:
	movq	_ROWS_PER_HAND@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
LBB0_4:
	movq	_rows@GOTPCREL(%rip), %rax
	movslq	%ebx, %rdi
	shlq	$3, %rdi
	addq	(%rax), %rdi
	leaq	-56(%rbp), %rsi
	movl	$4, %edx
	callq	_memcpy
	xorl	%eax, %eax
LBB0_5:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	-16(%rbp), %rcx
	jne	LBB0_7
## %bb.6:
	addq	$56, %rsp
	popq	%rbx
	popq	%rbp
	retq
LBB0_7:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_I2C_TIMEOUT,4,2                ## @I2C_TIMEOUT
	.comm	_I2C_STATUS_SUCCESS,8,3         ## @I2C_STATUS_SUCCESS
	.comm	_TWI_REPLY_KEYDATA,8,3          ## @TWI_REPLY_KEYDATA
	.comm	_ROWS_PER_HAND,4,2              ## @ROWS_PER_HAND
	.comm	_rows,8,3                       ## @rows
	.no_dead_strip	_i2c_read_hand
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function i2c_read_hand
_i2c_read_hand:                         ; @i2c_read_hand
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-24]
	bl	_I2C_ADDR
Lloh3:
	adrp	x8, _I2C_TIMEOUT@GOTPAGE
Lloh4:
	ldr	x8, [x8, _I2C_TIMEOUT@GOTPAGEOFF]
Lloh5:
	ldr	w3, [x8]
	mov	x1, sp
	mov	w2, #40
	bl	_i2c_receive
Lloh6:
	adrp	x8, _I2C_STATUS_SUCCESS@GOTPAGE
Lloh7:
	ldr	x8, [x8, _I2C_STATUS_SUCCESS@GOTPAGEOFF]
Lloh8:
	ldr	x8, [x8]
	cmp	x0, x8
	b.ne	LBB0_3
; %bb.1:
	ldr	x8, [sp]
Lloh9:
	adrp	x9, _TWI_REPLY_KEYDATA@GOTPAGE
Lloh10:
	ldr	x9, [x9, _TWI_REPLY_KEYDATA@GOTPAGEOFF]
Lloh11:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_4
; %bb.2:
Lloh12:
	adrp	x8, _ROWS_PER_HAND@GOTPAGE
Lloh13:
	ldr	x8, [x8, _ROWS_PER_HAND@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	cmp	w19, #0
	csel	w8, wzr, w8, eq
Lloh15:
	adrp	x9, _rows@GOTPAGE
Lloh16:
	ldr	x9, [x9, _rows@GOTPAGEOFF]
Lloh17:
	ldr	x9, [x9]
	add	x0, x9, w8, sxtw #3
	mov	x8, sp
	add	x1, x8, #8
	mov	w2, #4
	bl	_memcpy
	mov	w0, #0
	b	LBB0_5
LBB0_3:
	mov	w0, #1
	b	LBB0_5
LBB0_4:
	mov	w0, #2
LBB0_5:
	ldur	x8, [x29, #-24]
Lloh18:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh19:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh20:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_7
; %bb.6:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
LBB0_7:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
	.comm	_I2C_TIMEOUT,4,2                ; @I2C_TIMEOUT
	.comm	_I2C_STATUS_SUCCESS,8,3         ; @I2C_STATUS_SUCCESS
	.comm	_TWI_REPLY_KEYDATA,8,3          ; @TWI_REPLY_KEYDATA
	.comm	_ROWS_PER_HAND,4,2              ; @ROWS_PER_HAND
	.comm	_rows,8,3                       ; @rows
	.no_dead_strip	_i2c_read_hand
.subsections_via_symbols
