	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function keywest_attach_adapter
_keywest_attach_adapter:                ## @keywest_attach_adapter
	.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
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	_keywest_ctx@GOTPCREL(%rip), %r12
	cmpq	$0, (%r12)
	je	LBB0_5
## %bb.1:
	movq	%rdi, %r14
	movl	(%rdi), %edi
	leaq	L_.str(%rip), %rsi
	movl	$6, %edx
	callq	_strncmp
	xorl	%ebx, %ebx
	testq	%rax, %rax
	jne	LBB0_8
## %bb.2:
	leaq	-40(%rbp), %r15
	xorl	%ebx, %ebx
	movq	%r15, %rdi
	xorl	%esi, %esi
	movl	$8, %edx
	callq	_memset
	movl	-36(%rbp), %edi
	movq	_I2C_NAME_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	L_.str.1(%rip), %rsi
	callq	_strlcpy
	movq	(%r12), %rax
	movl	8(%rax), %eax
	movl	%eax, -40(%rbp)
	movq	%r14, %rdi
	movq	%r15, %rsi
	callq	_i2c_new_device
	movq	(%r12), %rcx
	movq	%rax, (%rcx)
	movq	(%r12), %rax
	movq	(%rax), %rdi
	testq	%rdi, %rdi
	je	LBB0_9
## %bb.3:
	movq	(%rdi), %rsi
	testq	%rsi, %rsi
	je	LBB0_10
## %bb.4:
	addq	$8, %rdi
	callq	_list_add_tail
	xorl	%ebx, %ebx
	jmp	LBB0_8
LBB0_5:
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_6:
	xorl	%ebx, %ebx
LBB0_7:
	subl	(%rax), %ebx
LBB0_8:
	movl	%ebx, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_9:
	movq	_ENODEV@GOTPCREL(%rip), %rax
	jmp	LBB0_7
LBB0_10:
	callq	_i2c_unregister_device
	movq	(%r12), %rax
	movq	$0, (%rax)
	movq	_ENODEV@GOTPCREL(%rip), %rax
	jmp	LBB0_6
	.cfi_endproc
                                        ## -- End function
	.comm	_keywest_ctx,8,3                ## @keywest_ctx
	.comm	_EINVAL,4,2                     ## @EINVAL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"mac-io"

L_.str.1:                               ## @.str.1
	.asciz	"keywest"

	.comm	_I2C_NAME_SIZE,4,2              ## @I2C_NAME_SIZE
	.comm	_ENODEV,4,2                     ## @ENODEV
	.no_dead_strip	_keywest_attach_adapter
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function keywest_attach_adapter
_keywest_attach_adapter:                ; @keywest_attach_adapter
	.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	x20, _keywest_ctx@GOTPAGE
Lloh1:
	ldr	x20, [x20, _keywest_ctx@GOTPAGEOFF]
	ldr	x8, [x20]
	cbz	x8, LBB0_3
; %bb.1:
	mov	x19, x0
	ldr	w0, [x0]
Lloh2:
	adrp	x1, l_.str@PAGE
Lloh3:
	add	x1, x1, l_.str@PAGEOFF
	mov	w2, #6
	bl	_strncmp
	cbz	x0, LBB0_4
LBB0_2:
	mov	w0, #0
	b	LBB0_10
LBB0_3:
Lloh4:
	adrp	x8, _EINVAL@GOTPAGE
Lloh5:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_9
LBB0_4:
	add	x0, sp, #8
	mov	w1, #0
	mov	w2, #8
	bl	_memset
	ldr	w0, [sp, #12]
Lloh6:
	adrp	x8, _I2C_NAME_SIZE@GOTPAGE
Lloh7:
	ldr	x8, [x8, _I2C_NAME_SIZE@GOTPAGEOFF]
Lloh8:
	ldr	w2, [x8]
Lloh9:
	adrp	x1, l_.str.1@PAGE
Lloh10:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_strlcpy
	ldr	x8, [x20]
	ldr	w8, [x8, #8]
	str	w8, [sp, #8]
	add	x1, sp, #8
	mov	x0, x19
	bl	_i2c_new_device
	ldr	x8, [x20]
	str	x0, [x8]
	ldr	x8, [x20]
	ldr	x0, [x8]
	cbz	x0, LBB0_8
; %bb.5:
	ldr	x1, [x0]
	cbz	x1, LBB0_7
; %bb.6:
	add	x0, x0, #8
	bl	_list_add_tail
	b	LBB0_2
LBB0_7:
	bl	_i2c_unregister_device
	ldr	x8, [x20]
	str	xzr, [x8]
LBB0_8:
Lloh11:
	adrp	x8, _ENODEV@GOTPAGE
Lloh12:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
LBB0_9:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_10:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_keywest_ctx,8,3                ; @keywest_ctx
	.comm	_EINVAL,4,2                     ; @EINVAL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"mac-io"

l_.str.1:                               ; @.str.1
	.asciz	"keywest"

	.comm	_I2C_NAME_SIZE,4,2              ; @I2C_NAME_SIZE
	.comm	_ENODEV,4,2                     ; @ENODEV
	.no_dead_strip	_keywest_attach_adapter
.subsections_via_symbols
