	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function read_cols_on_row
_read_cols_on_row:                      ## @read_cols_on_row
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r15
	movq	%rdi, %r14
	movl	(%rdi,%rsi,4), %ebx
	movl	$0, (%rdi,%rsi,4)
	movq	%rsi, %rdi
	callq	_select_row
	movl	$30, %edi
	callq	_wait_us
	movq	_mcp23018_status@GOTPCREL(%rip), %r13
	xorl	%eax, %eax
	cmpq	$0, (%r13)
	jne	LBB0_11
## %bb.1:
	movq	_I2C_ADDR_WRITE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_i2c_start
	movq	%rax, (%r13)
	xorl	%r12d, %r12d
	testq	%rax, %rax
	movl	%ebx, -44(%rbp)                 ## 4-byte Spill
	jne	LBB0_5
## %bb.2:
	movq	_GPIOA@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_i2c_write
	movq	%rax, (%r13)
	testq	%rax, %rax
	jne	LBB0_5
## %bb.3:
	movq	_I2C_ADDR_READ@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_i2c_start
	movq	%rax, (%r13)
	testq	%rax, %rax
	jne	LBB0_5
## %bb.4:
	xorl	%eax, %eax
	callq	_i2c_readNak
	movl	%eax, %r12d
	notl	%r12d
	shll	$8, %r12d
LBB0_5:
	xorl	%eax, %eax
	callq	_i2c_stop
	orl	%r12d, (%r14,%r15,4)
	movq	_ATMEGA_COLS@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_10
## %bb.6:
	xorl	%r12d, %r12d
	jmp	LBB0_7
	.p2align	4, 0x90
LBB0_9:                                 ##   in Loop: Header=BB0_7 Depth=1
	orl	%edx, (%r14,%r15,4)
	incq	%r12
	movq	_ATMEGA_COLS@GOTPCREL(%rip), %rax
	cmpq	(%rax), %r12
	jae	LBB0_10
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movq	_col_pins@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	(%rax,%r12,8), %rbx
	movq	%rbx, %rdi
	shrq	$4, %rdi
	callq	__SFR_IO8
	movq	%rax, %r13
	andl	$15, %ebx
	movq	%rbx, %rdi
	callq	__BV
	movq	_ROW_SHIFTER@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rdx
	movl	%r12d, %ecx
	shlq	%cl, %rdx
	testq	%r13, %rax
	je	LBB0_9
## %bb.8:                               ##   in Loop: Header=BB0_7 Depth=1
	xorl	%edx, %edx
	jmp	LBB0_9
LBB0_10:
	xorl	%eax, %eax
	callq	_unselect_rows
	xorl	%eax, %eax
	movl	-44(%rbp), %ecx                 ## 4-byte Reload
	cmpl	(%r14,%r15,4), %ecx
	setne	%al
LBB0_11:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_mcp23018_status,8,3            ## @mcp23018_status
	.comm	_I2C_ADDR_WRITE,4,2             ## @I2C_ADDR_WRITE
	.comm	_GPIOA,4,2                      ## @GPIOA
	.comm	_I2C_ADDR_READ,4,2              ## @I2C_ADDR_READ
	.comm	_ATMEGA_COLS,8,3                ## @ATMEGA_COLS
	.comm	_col_pins,8,3                   ## @col_pins
	.comm	_ROW_SHIFTER,8,3                ## @ROW_SHIFTER
	.no_dead_strip	_read_cols_on_row
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function read_cols_on_row
_read_cols_on_row:                      ; @read_cols_on_row
	.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
	mov	x19, x1
	mov	x20, x0
	lsl	x23, x1, #2
	ldr	w22, [x0, x23]
	str	wzr, [x0, x23]
	mov	x0, x1
	bl	_select_row
	mov	w0, #30
	bl	_wait_us
	mov	w0, #0
Lloh0:
	adrp	x21, _mcp23018_status@GOTPAGE
Lloh1:
	ldr	x21, [x21, _mcp23018_status@GOTPAGEOFF]
	ldr	x8, [x21]
	cbnz	x8, LBB0_9
; %bb.1:
Lloh2:
	adrp	x8, _I2C_ADDR_WRITE@GOTPAGE
Lloh3:
	ldr	x8, [x8, _I2C_ADDR_WRITE@GOTPAGEOFF]
Lloh4:
	ldr	w0, [x8]
	bl	_i2c_start
	str	x0, [x21]
	cbnz	x0, LBB0_4
; %bb.2:
Lloh5:
	adrp	x8, _GPIOA@GOTPAGE
Lloh6:
	ldr	x8, [x8, _GPIOA@GOTPAGEOFF]
Lloh7:
	ldr	w0, [x8]
	bl	_i2c_write
	str	x0, [x21]
	cbnz	x0, LBB0_4
; %bb.3:
Lloh8:
	adrp	x8, _I2C_ADDR_READ@GOTPAGE
Lloh9:
	ldr	x8, [x8, _I2C_ADDR_READ@GOTPAGEOFF]
Lloh10:
	ldr	w0, [x8]
	bl	_i2c_start
	str	x0, [x21]
	cbz	x0, LBB0_10
LBB0_4:
	mov	w21, #0
LBB0_5:
	bl	_i2c_stop
	ldr	w8, [x20, x23]
	orr	w8, w8, w21
	str	w8, [x20, x23]
Lloh11:
	adrp	x24, _ATMEGA_COLS@GOTPAGE
Lloh12:
	ldr	x24, [x24, _ATMEGA_COLS@GOTPAGEOFF]
	ldr	x8, [x24]
	cbz	x8, LBB0_8
; %bb.6:
	mov	x25, #0
Lloh13:
	adrp	x26, _col_pins@GOTPAGE
Lloh14:
	ldr	x26, [x26, _col_pins@GOTPAGEOFF]
Lloh15:
	adrp	x27, _ROW_SHIFTER@GOTPAGE
Lloh16:
	ldr	x27, [x27, _ROW_SHIFTER@GOTPAGEOFF]
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x26]
	ldr	x28, [x8, x25, lsl #3]
	lsr	x0, x28, #4
	bl	__SFR_IO8
	mov	x21, x0
	and	x0, x28, #0xf
	bl	__BV
	ldr	x8, [x27]
	lsl	x8, x8, x25
	ldr	w9, [x20, x23]
	tst	x0, x21
	csel	w8, w8, wzr, eq
	orr	w8, w8, w9
	str	w8, [x20, x23]
	add	x25, x25, #1
	ldr	x8, [x24]
	cmp	x25, x8
	b.lo	LBB0_7
LBB0_8:
	bl	_unselect_rows
	ldr	w8, [x20, x19, lsl #2]
	cmp	w22, w8
	cset	w0, ne
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
LBB0_10:
	bl	_i2c_readNak
	mvn	w8, w0
	lsl	w21, w8, #8
	b	LBB0_5
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_mcp23018_status,8,3            ; @mcp23018_status
	.comm	_I2C_ADDR_WRITE,4,2             ; @I2C_ADDR_WRITE
	.comm	_GPIOA,4,2                      ; @GPIOA
	.comm	_I2C_ADDR_READ,4,2              ; @I2C_ADDR_READ
	.comm	_ATMEGA_COLS,8,3                ; @ATMEGA_COLS
	.comm	_col_pins,8,3                   ; @col_pins
	.comm	_ROW_SHIFTER,8,3                ; @ROW_SHIFTER
	.no_dead_strip	_read_cols_on_row
.subsections_via_symbols
