	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_expander_scan                  ## -- Begin function expander_scan
	.p2align	4, 0x90
_expander_scan:                         ## @expander_scan
	.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
	pushq	%rax
	.cfi_offset %rbx, -24
	movq	_expander_status@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	leaq	L_.str(%rip), %rdi
	xorl	%eax, %eax
	callq	_dprintf
	movq	_EXPANDER_ADDR@GOTPCREL(%rip), %rax
	movq	_I2C_WRITE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
	orl	(%rax), %edi
	callq	_i2c_start
	testq	%rax, %rax
	je	LBB0_1
## %bb.3:
	cmpl	$1, (%rbx)
	jne	LBB0_6
## %bb.4:
	leaq	L_.str.2(%rip), %rdi
	xorl	%eax, %eax
	callq	_dprintf
	movl	$0, (%rbx)
	jmp	LBB0_5
LBB0_1:
	xorl	%eax, %eax
	callq	_i2c_stop
	cmpl	$0, (%rbx)
	jne	LBB0_6
## %bb.2:
	leaq	L_.str.1(%rip), %rdi
	xorl	%eax, %eax
	callq	_dprintf
	movl	$1, (%rbx)
	xorl	%eax, %eax
	callq	_expander_config
LBB0_5:
	xorl	%eax, %eax
	callq	_clear_keyboard
LBB0_6:
	movl	(%rbx), %esi
	leaq	L_.str.3(%rip), %rdi
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	jmp	_dprintf                        ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"expander status: %d ... "

	.comm	_expander_status,4,2            ## @expander_status
	.comm	_EXPANDER_ADDR,4,2              ## @EXPANDER_ADDR
	.comm	_I2C_WRITE,4,2                  ## @I2C_WRITE
L_.str.1:                               ## @.str.1
	.asciz	"attached\n"

L_.str.2:                               ## @.str.2
	.asciz	"detached\n"

L_.str.3:                               ## @.str.3
	.asciz	"%d\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_expander_scan                  ; -- Begin function expander_scan
	.p2align	2
_expander_scan:                         ; @expander_scan
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #48
	.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
Lloh0:
	adrp	x19, _expander_status@GOTPAGE
Lloh1:
	ldr	x19, [x19, _expander_status@GOTPAGEOFF]
	ldr	w8, [x19]
	str	x8, [sp]
Lloh2:
	adrp	x0, l_.str@PAGE
Lloh3:
	add	x0, x0, l_.str@PAGEOFF
	bl	_dprintf
Lloh4:
	adrp	x8, _EXPANDER_ADDR@GOTPAGE
Lloh5:
	ldr	x8, [x8, _EXPANDER_ADDR@GOTPAGEOFF]
Lloh6:
	ldr	w8, [x8]
Lloh7:
	adrp	x9, _I2C_WRITE@GOTPAGE
Lloh8:
	ldr	x9, [x9, _I2C_WRITE@GOTPAGEOFF]
Lloh9:
	ldr	w9, [x9]
	orr	w0, w9, w8
	bl	_i2c_start
	cbz	x0, LBB0_3
; %bb.1:
	ldr	w8, [x19]
	cmp	w8, #1
	b.ne	LBB0_6
; %bb.2:
Lloh10:
	adrp	x0, l_.str.2@PAGE
Lloh11:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_dprintf
	str	wzr, [x19]
	b	LBB0_5
LBB0_3:
	bl	_i2c_stop
	ldr	w8, [x19]
	cbnz	w8, LBB0_6
; %bb.4:
Lloh12:
	adrp	x0, l_.str.1@PAGE
Lloh13:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_dprintf
	mov	w8, #1
	str	w8, [x19]
	bl	_expander_config
LBB0_5:
	bl	_clear_keyboard
LBB0_6:
	ldr	w8, [x19]
	str	x8, [sp]
Lloh14:
	adrp	x0, l_.str.3@PAGE
Lloh15:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_dprintf
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpAdd	Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"expander status: %d ... "

	.comm	_expander_status,4,2            ; @expander_status
	.comm	_EXPANDER_ADDR,4,2              ; @EXPANDER_ADDR
	.comm	_I2C_WRITE,4,2                  ; @I2C_WRITE
l_.str.1:                               ; @.str.1
	.asciz	"attached\n"

l_.str.2:                               ; @.str.2
	.asciz	"detached\n"

l_.str.3:                               ; @.str.3
	.asciz	"%d\n"

.subsections_via_symbols
