	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_init_expander                  ## -- Begin function init_expander
	.p2align	4, 0x90
_init_expander:                         ## @init_expander
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	_i2c_initialized@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	jne	LBB0_2
## %bb.1:
	xorl	%eax, %eax
	callq	_i2c_init
	movl	$1000000, %edi                  ## imm = 0xF4240
	callq	_wait_us
LBB0_2:
	movq	_expander_input_pin_mask@GOTPCREL(%rip), %r12
	cmpl	$0, (%r12)
	je	LBB0_3
LBB0_15:
	movq	_I2C_ADDR_WRITE@GOTPCREL(%rip), %r15
	movl	(%r15), %edi
	callq	_i2c_start
	movq	_expander_status@GOTPCREL(%rip), %r14
	movq	%rax, (%r14)
	testq	%rax, %rax
	jne	LBB0_23
## %bb.16:
	movq	_IODIRA@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_i2c_write
	movq	%rax, (%r14)
	testq	%rax, %rax
	jne	LBB0_23
## %bb.17:
	movl	(%r12), %edi
	callq	_i2c_write
	movq	%rax, (%r14)
	testq	%rax, %rax
	jne	LBB0_23
## %bb.18:
	xorl	%edi, %edi
	callq	_i2c_write
	movq	%rax, (%r14)
	testq	%rax, %rax
	jne	LBB0_23
## %bb.19:
	xorl	%eax, %eax
	callq	_i2c_stop
	movl	(%r15), %edi
	callq	_i2c_start
	movq	%rax, (%r14)
	testq	%rax, %rax
	jne	LBB0_23
## %bb.20:
	movq	_GPPUA@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_i2c_write
	movq	%rax, (%r14)
	testq	%rax, %rax
	jne	LBB0_23
## %bb.21:
	movl	(%r12), %edi
	callq	_i2c_write
	movq	%rax, (%r14)
	testq	%rax, %rax
	jne	LBB0_23
## %bb.22:
	xorl	%edi, %edi
	callq	_i2c_write
	movq	%rax, (%r14)
LBB0_23:
	xorl	%eax, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_i2c_stop                       ## TAILCALL
LBB0_3:
	movq	_MATRIX_COLS@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	testl	%r8d, %r8d
	jle	LBB0_15
## %bb.4:
	movq	_col_expanded@GOTPCREL(%rip), %rax
	movq	(%rax), %rdx
	movq	_expander_col_pins@GOTPCREL(%rip), %rax
	movq	(%rax), %rcx
	cmpl	$1, %r8d
	jne	LBB0_6
## %bb.5:
	xorl	%esi, %esi
	xorl	%edi, %edi
LBB0_12:
	testb	$1, %r8b
	je	LBB0_15
## %bb.13:
	cmpq	$0, (%rdx,%rdi,8)
	je	LBB0_15
## %bb.14:
	movb	(%rcx,%rdi,4), %al
	btsl	%eax, %esi
	movl	%esi, (%r12)
	jmp	LBB0_15
LBB0_6:
	movl	%r8d, %eax
	andl	$-2, %eax
	xorl	%esi, %esi
	xorl	%edi, %edi
	jmp	LBB0_7
	.p2align	4, 0x90
LBB0_11:                                ##   in Loop: Header=BB0_7 Depth=1
	addq	$2, %rdi
	cmpq	%rdi, %rax
	je	LBB0_12
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	cmpq	$0, (%rdx,%rdi,8)
	je	LBB0_9
## %bb.8:                               ##   in Loop: Header=BB0_7 Depth=1
	movzbl	(%rcx,%rdi,4), %ebx
	btsl	%ebx, %esi
	movl	%esi, (%r12)
LBB0_9:                                 ##   in Loop: Header=BB0_7 Depth=1
	cmpq	$0, 8(%rdx,%rdi,8)
	je	LBB0_11
## %bb.10:                              ##   in Loop: Header=BB0_7 Depth=1
	movzbl	4(%rcx,%rdi,4), %ebx
	btsl	%ebx, %esi
	movl	%esi, (%r12)
	jmp	LBB0_11
	.cfi_endproc
                                        ## -- End function
	.comm	_i2c_initialized,4,2            ## @i2c_initialized
	.comm	_expander_input_pin_mask,4,2    ## @expander_input_pin_mask
	.comm	_MATRIX_COLS,4,2                ## @MATRIX_COLS
	.comm	_col_expanded,8,3               ## @col_expanded
	.comm	_expander_col_pins,8,3          ## @expander_col_pins
	.comm	_I2C_ADDR_WRITE,4,2             ## @I2C_ADDR_WRITE
	.comm	_expander_status,8,3            ## @expander_status
	.comm	_IODIRA,4,2                     ## @IODIRA
	.comm	_GPPUA,4,2                      ## @GPPUA
	.comm	_MATRIX_ROWS,4,2                ## @MATRIX_ROWS
	.comm	_expander_row_pins,8,3          ## @expander_row_pins
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_init_expander                  ; -- Begin function init_expander
	.p2align	2
_init_expander:                         ; @init_expander
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
Lloh0:
	adrp	x8, _i2c_initialized@GOTPAGE
Lloh1:
	ldr	x8, [x8, _i2c_initialized@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cbnz	w8, LBB0_2
; %bb.1:
	bl	_i2c_init
	mov	w0, #16960
	movk	w0, #15, lsl #16
	bl	_wait_us
LBB0_2:
Lloh3:
	adrp	x19, _expander_input_pin_mask@GOTPAGE
Lloh4:
	ldr	x19, [x19, _expander_input_pin_mask@GOTPAGEOFF]
	ldr	w8, [x19]
	cbz	w8, LBB0_12
LBB0_3:
Lloh5:
	adrp	x21, _I2C_ADDR_WRITE@GOTPAGE
Lloh6:
	ldr	x21, [x21, _I2C_ADDR_WRITE@GOTPAGEOFF]
	ldr	w0, [x21]
	bl	_i2c_start
Lloh7:
	adrp	x20, _expander_status@GOTPAGE
Lloh8:
	ldr	x20, [x20, _expander_status@GOTPAGEOFF]
	str	x0, [x20]
	cbnz	x0, LBB0_11
; %bb.4:
Lloh9:
	adrp	x8, _IODIRA@GOTPAGE
Lloh10:
	ldr	x8, [x8, _IODIRA@GOTPAGEOFF]
Lloh11:
	ldr	w0, [x8]
	bl	_i2c_write
	str	x0, [x20]
	cbnz	x0, LBB0_11
; %bb.5:
	ldr	w0, [x19]
	bl	_i2c_write
	str	x0, [x20]
	cbnz	x0, LBB0_11
; %bb.6:
	bl	_i2c_write
	str	x0, [x20]
	cbnz	x0, LBB0_11
; %bb.7:
	bl	_i2c_stop
	ldr	w0, [x21]
	bl	_i2c_start
	str	x0, [x20]
	cbnz	x0, LBB0_11
; %bb.8:
Lloh12:
	adrp	x8, _GPPUA@GOTPAGE
Lloh13:
	ldr	x8, [x8, _GPPUA@GOTPAGEOFF]
Lloh14:
	ldr	w0, [x8]
	bl	_i2c_write
	str	x0, [x20]
	cbnz	x0, LBB0_11
; %bb.9:
	ldr	w0, [x19]
	bl	_i2c_write
	str	x0, [x20]
	cbnz	x0, LBB0_11
; %bb.10:
	bl	_i2c_write
	str	x0, [x20]
LBB0_11:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	b	_i2c_stop
LBB0_12:
Lloh15:
	adrp	x8, _MATRIX_COLS@GOTPAGE
Lloh16:
	ldr	x8, [x8, _MATRIX_COLS@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	cmp	w8, #1
	b.lt	LBB0_3
; %bb.13:
	mov	w9, #0
Lloh18:
	adrp	x10, _col_expanded@GOTPAGE
Lloh19:
	ldr	x10, [x10, _col_expanded@GOTPAGEOFF]
Lloh20:
	ldr	x10, [x10]
Lloh21:
	adrp	x11, _expander_col_pins@GOTPAGE
Lloh22:
	ldr	x11, [x11, _expander_col_pins@GOTPAGEOFF]
Lloh23:
	ldr	x11, [x11]
	mov	w12, #1
	b	LBB0_15
LBB0_14:                                ;   in Loop: Header=BB0_15 Depth=1
	add	x11, x11, #4
	add	x10, x10, #8
	subs	x8, x8, #1
	b.eq	LBB0_3
LBB0_15:                                ; =>This Inner Loop Header: Depth=1
	ldr	x13, [x10]
	cbz	x13, LBB0_14
; %bb.16:                               ;   in Loop: Header=BB0_15 Depth=1
	ldr	w13, [x11]
	lsl	w13, w12, w13
	orr	w9, w9, w13
	str	w9, [x19]
	b	LBB0_14
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
	.comm	_i2c_initialized,4,2            ; @i2c_initialized
	.comm	_expander_input_pin_mask,4,2    ; @expander_input_pin_mask
	.comm	_MATRIX_COLS,4,2                ; @MATRIX_COLS
	.comm	_col_expanded,8,3               ; @col_expanded
	.comm	_expander_col_pins,8,3          ; @expander_col_pins
	.comm	_I2C_ADDR_WRITE,4,2             ; @I2C_ADDR_WRITE
	.comm	_expander_status,8,3            ; @expander_status
	.comm	_IODIRA,4,2                     ; @IODIRA
	.comm	_GPPUA,4,2                      ; @GPPUA
	.comm	_MATRIX_ROWS,4,2                ; @MATRIX_ROWS
	.comm	_expander_row_pins,8,3          ; @expander_row_pins
.subsections_via_symbols
