	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_init_mcp23018                  ## -- Begin function init_mcp23018
	.p2align	4, 0x90
_init_mcp23018:                         ## @init_mcp23018
	.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
	leaq	L_.str(%rip), %rdi
	callq	_print
	movq	_mcp23018_status@GOTPCREL(%rip), %r12
	movl	$32, (%r12)
	movq	_i2c_initialized@GOTPCREL(%rip), %rbx
	cmpl	$0, (%rbx)
	jne	LBB0_2
## %bb.1:
	xorl	%eax, %eax
	callq	_i2c_init
	movl	$1, (%rbx)
	movl	$1000, %edi                     ## imm = 0x3E8
	callq	__delay_ms
LBB0_2:
	movq	_I2C_ADDR_WRITE@GOTPCREL(%rip), %r15
	movl	(%r15), %edi
	movq	_ERGODOX_EZ_I2C_TIMEOUT@GOTPCREL(%rip), %r14
	movl	(%r14), %esi
	callq	_i2c_start
	movl	%eax, (%r12)
	testl	%eax, %eax
	jne	LBB0_10
## %bb.3:
	movq	_IODIRA@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	(%r14), %esi
	callq	_i2c_write
	movl	%eax, (%r12)
	testl	%eax, %eax
	jne	LBB0_10
## %bb.4:
	movl	(%r14), %esi
	movl	$128, %edi
	callq	_i2c_write
	movl	%eax, (%r12)
	testl	%eax, %eax
	jne	LBB0_10
## %bb.5:
	movl	(%r14), %esi
	movl	$255, %edi
	callq	_i2c_write
	movl	%eax, (%r12)
	testl	%eax, %eax
	jne	LBB0_10
## %bb.6:
	xorl	%eax, %eax
	callq	_i2c_stop
	movl	(%r15), %edi
	movl	(%r14), %esi
	callq	_i2c_start
	movl	%eax, (%r12)
	testl	%eax, %eax
	jne	LBB0_10
## %bb.7:
	movq	_GPPUA@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	(%r14), %esi
	callq	_i2c_write
	movl	%eax, (%r12)
	testl	%eax, %eax
	jne	LBB0_10
## %bb.8:
	movl	(%r14), %esi
	movl	$128, %edi
	callq	_i2c_write
	movl	%eax, (%r12)
	testl	%eax, %eax
	jne	LBB0_10
## %bb.9:
	movl	(%r14), %esi
	movl	$255, %edi
	callq	_i2c_write
	movl	%eax, (%r12)
LBB0_10:
	xorl	%eax, %eax
	callq	_i2c_stop
	movl	(%r12), %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"starting init"

	.comm	_mcp23018_status,4,2            ## @mcp23018_status
	.comm	_i2c_initialized,4,2            ## @i2c_initialized
	.comm	_I2C_ADDR_WRITE,4,2             ## @I2C_ADDR_WRITE
	.comm	_ERGODOX_EZ_I2C_TIMEOUT,4,2     ## @ERGODOX_EZ_I2C_TIMEOUT
	.comm	_IODIRA,4,2                     ## @IODIRA
	.comm	_GPPUA,4,2                      ## @GPPUA
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_init_mcp23018                  ; -- Begin function init_mcp23018
	.p2align	2
_init_mcp23018:                         ; @init_mcp23018
	.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	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_print
Lloh2:
	adrp	x19, _mcp23018_status@GOTPAGE
Lloh3:
	ldr	x19, [x19, _mcp23018_status@GOTPAGEOFF]
	mov	w8, #32
	str	w8, [x19]
Lloh4:
	adrp	x20, _i2c_initialized@GOTPAGE
Lloh5:
	ldr	x20, [x20, _i2c_initialized@GOTPAGEOFF]
	ldr	w8, [x20]
	cbnz	w8, LBB0_2
; %bb.1:
	bl	_i2c_init
	mov	w8, #1
	str	w8, [x20]
	mov	w0, #1000
	bl	__delay_ms
LBB0_2:
Lloh6:
	adrp	x21, _I2C_ADDR_WRITE@GOTPAGE
Lloh7:
	ldr	x21, [x21, _I2C_ADDR_WRITE@GOTPAGEOFF]
	ldr	w0, [x21]
Lloh8:
	adrp	x20, _ERGODOX_EZ_I2C_TIMEOUT@GOTPAGE
Lloh9:
	ldr	x20, [x20, _ERGODOX_EZ_I2C_TIMEOUT@GOTPAGEOFF]
	ldr	w1, [x20]
	bl	_i2c_start
	str	w0, [x19]
	cbnz	w0, LBB0_10
; %bb.3:
Lloh10:
	adrp	x8, _IODIRA@GOTPAGE
Lloh11:
	ldr	x8, [x8, _IODIRA@GOTPAGEOFF]
Lloh12:
	ldr	w0, [x8]
	ldr	w1, [x20]
	bl	_i2c_write
	str	w0, [x19]
	cbnz	w0, LBB0_10
; %bb.4:
	ldr	w1, [x20]
	mov	w0, #128
	bl	_i2c_write
	str	w0, [x19]
	cbnz	w0, LBB0_10
; %bb.5:
	ldr	w1, [x20]
	mov	w0, #255
	bl	_i2c_write
	str	w0, [x19]
	cbnz	w0, LBB0_10
; %bb.6:
	bl	_i2c_stop
	ldr	w0, [x21]
	ldr	w1, [x20]
	bl	_i2c_start
	str	w0, [x19]
	cbnz	w0, LBB0_10
; %bb.7:
Lloh13:
	adrp	x8, _GPPUA@GOTPAGE
Lloh14:
	ldr	x8, [x8, _GPPUA@GOTPAGEOFF]
Lloh15:
	ldr	w0, [x8]
	ldr	w1, [x20]
	bl	_i2c_write
	str	w0, [x19]
	cbnz	w0, LBB0_10
; %bb.8:
	ldr	w1, [x20]
	mov	w0, #128
	bl	_i2c_write
	str	w0, [x19]
	cbnz	w0, LBB0_10
; %bb.9:
	ldr	w1, [x20]
	mov	w0, #255
	bl	_i2c_write
	str	w0, [x19]
LBB0_10:
	bl	_i2c_stop
	ldr	w0, [x19]
	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
	ret
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"starting init"

	.comm	_mcp23018_status,4,2            ; @mcp23018_status
	.comm	_i2c_initialized,4,2            ; @i2c_initialized
	.comm	_I2C_ADDR_WRITE,4,2             ; @I2C_ADDR_WRITE
	.comm	_ERGODOX_EZ_I2C_TIMEOUT,4,2     ; @ERGODOX_EZ_I2C_TIMEOUT
	.comm	_IODIRA,4,2                     ; @IODIRA
	.comm	_GPPUA,4,2                      ; @GPPUA
.subsections_via_symbols
