	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function opal_i2c_attach
_opal_i2c_attach:                       ## @opal_i2c_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
	movl	%edi, %ebx
	callq	_device_get_softc
	movq	%rax, %r14
	movl	%ebx, 12(%rax)
	movl	%ebx, %edi
	callq	_ofw_bus_get_node
	leaq	L_.str(%rip), %rsi
	movl	%eax, %edi
	callq	_OF_getproplen
	testl	%eax, %eax
	jle	LBB0_3
## %bb.1:
	movl	%eax, %r15d
	movl	%ebx, %edi
	callq	_ofw_bus_get_node
	movq	%r14, %rdx
	addq	$8, %rdx
	leaq	L_.str(%rip), %rsi
	movl	%eax, %edi
	movl	%r15d, %ecx
	callq	_OF_getencprop
	leaq	L_.str.1(%rip), %rsi
	movl	%ebx, %edi
	movl	$-1, %edx
	callq	_device_add_child
	movq	%rax, (%r14)
	testq	%rax, %rax
	je	LBB0_2
## %bb.4:
	movq	%r14, %rdi
	callq	_I2C_LOCK_INIT
	movl	%ebx, %edi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_bus_generic_attach             ## TAILCALL
LBB0_2:
	leaq	L_.str.2(%rip), %rsi
	movl	%ebx, %edi
	callq	_device_printf
LBB0_3:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	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	"ibm,opal-id"

	.comm	_EINVAL,4,2                     ## @EINVAL
L_.str.1:                               ## @.str.1
	.asciz	"iicbus"

L_.str.2:                               ## @.str.2
	.asciz	"could not allocate iicbus instance\n"

	.no_dead_strip	_opal_i2c_attach
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function opal_i2c_attach
_opal_i2c_attach:                       ; @opal_i2c_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	x19, x0
	bl	_device_get_softc
	mov	x20, x0
	str	w19, [x0, #12]
	mov	x0, x19
	bl	_ofw_bus_get_node
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	bl	_OF_getproplen
	cmp	w0, #0
	b.le	LBB0_4
; %bb.1:
	mov	x21, x0
	mov	x0, x19
	bl	_ofw_bus_get_node
	add	x2, x20, #8
Lloh2:
	adrp	x1, l_.str@PAGE
Lloh3:
	add	x1, x1, l_.str@PAGEOFF
	mov	x3, x21
	bl	_OF_getencprop
Lloh4:
	adrp	x1, l_.str.1@PAGE
Lloh5:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	mov	w2, #-1
	bl	_device_add_child
	str	x0, [x20]
	cbz	x0, LBB0_3
; %bb.2:
	mov	x0, x20
	bl	_I2C_LOCK_INIT
	mov	x0, 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
	b	_bus_generic_attach
LBB0_3:
Lloh6:
	adrp	x1, l_.str.2@PAGE
Lloh7:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x19
	bl	_device_printf
LBB0_4:
Lloh8:
	adrp	x8, _EINVAL@GOTPAGE
Lloh9:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh10:
	ldr	w0, [x8]
	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 AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"ibm,opal-id"

	.comm	_EINVAL,4,2                     ; @EINVAL
l_.str.1:                               ; @.str.1
	.asciz	"iicbus"

l_.str.2:                               ; @.str.2
	.asciz	"could not allocate iicbus instance\n"

	.no_dead_strip	_opal_i2c_attach
.subsections_via_symbols
