	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_lg2160_attach                  ## -- Begin function lg2160_attach
	.p2align	4, 0x90
_lg2160_attach:                         ## @lg2160_attach
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movq	%rdi, %r15
	xorl	%ebx, %ebx
	movl	$0, %esi
	testq	%r14, %r14
	je	LBB0_2
## %bb.1:
	movq	%r14, %rdi
	callq	_i2c_adapter_id
	movl	%eax, %esi
LBB0_2:
	testq	%r15, %r15
	je	LBB0_4
## %bb.3:
	movl	4(%r15), %ebx
LBB0_4:
	leaq	L_.str(%rip), %rdi
	movl	%ebx, %edx
	callq	_lg_dbg
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$56, %edi
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_5
## %bb.6:
	movq	%rax, %rbx
	movq	%r15, 48(%rax)
	movq	%r14, 40(%rax)
	movabsq	$1095216660735, %rax            ## imm = 0xFF000000FF
	movq	%rax, (%rbx)
	movl	(%r15), %eax
	cmpl	$128, %eax
	je	LBB0_9
## %bb.7:
	movq	_lg2160_ops@GOTPCREL(%rip), %r14
	cmpl	$129, %eax
	je	LBB0_10
## %bb.8:
	leaq	L_.str.1(%rip), %rdi
	callq	_lg_warn
	jmp	LBB0_10
LBB0_5:
	xorl	%r15d, %r15d
	jmp	LBB0_11
LBB0_9:
	movq	_lg2161_ops@GOTPCREL(%rip), %r14
LBB0_10:
	leaq	16(%rbx), %r15
	movq	%rbx, %rdi
	addq	$32, %rdi
	movq	%r14, %rsi
	movl	$4, %edx
	callq	_memcpy
	movq	%rbx, 24(%rbx)
	movl	$-1, 8(%rbx)
	movl	$1, 16(%rbx)
LBB0_11:
	movq	%r15, %rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"(%d-%04x)\n"

	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
L_.str.1:                               ## @.str.1
	.asciz	"invalid chip requested, defaulting to LG2160"

	.comm	_lg2160_ops,4,2                 ## @lg2160_ops
	.comm	_lg2161_ops,4,2                 ## @lg2161_ops
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_lg2160_attach                  ; -- Begin function lg2160_attach
	.p2align	2
_lg2160_attach:                         ; @lg2160_attach
	.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
	mov	x20, x1
	mov	x19, x0
	cbz	x1, LBB0_2
; %bb.1:
	mov	x0, x20
	bl	_i2c_adapter_id
	mov	x1, x0
LBB0_2:
	cbz	x19, LBB0_4
; %bb.3:
	ldr	w2, [x19, #4]
	b	LBB0_5
LBB0_4:
	mov	w2, #0
LBB0_5:
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_lg_dbg
Lloh2:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh3:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
	mov	w0, #56
	bl	_kzalloc
	cbz	x0, LBB0_12
; %bb.6:
	mov	x21, x0
	stp	x20, x19, [x0, #40]
	movi	d0, #0x0000ff000000ff
	str	d0, [x0]
	ldr	w8, [x19]
	cmp	w8, #128
	b.eq	LBB0_10
; %bb.7:
	cmp	w8, #129
	b.eq	LBB0_9
; %bb.8:
Lloh5:
	adrp	x0, l_.str.1@PAGE
Lloh6:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_lg_warn
LBB0_9:
Lloh7:
	adrp	x1, _lg2160_ops@GOTPAGE
Lloh8:
	ldr	x1, [x1, _lg2160_ops@GOTPAGEOFF]
	b	LBB0_11
LBB0_10:
Lloh9:
	adrp	x1, _lg2161_ops@GOTPAGE
Lloh10:
	ldr	x1, [x1, _lg2161_ops@GOTPAGEOFF]
LBB0_11:
	add	x0, x21, #32
	mov	w2, #4
	bl	_memcpy
	mov	w8, #1
	mov	x0, x21
	str	w8, [x0, #16]!
	str	x21, [x21, #24]
	mov	w8, #-1
	str	w8, [x21, #8]
LBB0_12:
	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 AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"(%d-%04x)\n"

	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
l_.str.1:                               ; @.str.1
	.asciz	"invalid chip requested, defaulting to LG2160"

	.comm	_lg2160_ops,4,2                 ; @lg2160_ops
	.comm	_lg2161_ops,4,2                 ; @lg2161_ops
.subsections_via_symbols
