	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function i2c_detach
_i2c_detach:                            ## @i2c_detach
	.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, %r14d
	callq	_device_get_softc
	movq	%rax, %rbx
	movl	24(%rax), %edi
	callq	_bus_generic_detach
	movl	%eax, %r15d
	testl	%eax, %eax
	je	LBB0_2
## %bb.1:
	movl	24(%rbx), %edi
	leaq	L_.str(%rip), %rsi
	callq	_device_printf
	jmp	LBB0_6
LBB0_2:
	movq	16(%rbx), %rsi
	testq	%rsi, %rsi
	je	LBB0_4
## %bb.3:
	movl	%r14d, %edi
	callq	_device_delete_child
LBB0_4:
	movl	12(%rbx), %edi
	callq	_gpio_pin_release
	movl	8(%rbx), %edi
	callq	_gpio_pin_release
	movq	(%rbx), %rcx
	testq	%rcx, %rcx
	je	LBB0_6
## %bb.5:
	movq	_SYS_RES_MEMORY@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%r14d, %edi
	xorl	%edx, %edx
	callq	_bus_release_resource
LBB0_6:
	movl	%r15d, %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	"cannot detach child devices\n"

	.comm	_SYS_RES_MEMORY,4,2             ## @SYS_RES_MEMORY
	.no_dead_strip	_i2c_detach
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function i2c_detach
_i2c_detach:                            ; @i2c_detach
	.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, x0
	bl	_device_get_softc
	mov	x21, x0
	ldr	w0, [x0, #24]
	bl	_bus_generic_detach
	mov	x19, x0
	cbz	w0, LBB0_2
; %bb.1:
	ldr	w0, [x21, #24]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	bl	_device_printf
	b	LBB0_6
LBB0_2:
	ldr	x1, [x21, #16]
	cbz	x1, LBB0_4
; %bb.3:
	mov	x0, x20
	bl	_device_delete_child
LBB0_4:
	ldr	w0, [x21, #12]
	bl	_gpio_pin_release
	ldr	w0, [x21, #8]
	bl	_gpio_pin_release
	ldr	x3, [x21]
	cbz	x3, LBB0_6
; %bb.5:
Lloh2:
	adrp	x8, _SYS_RES_MEMORY@GOTPAGE
Lloh3:
	ldr	x8, [x8, _SYS_RES_MEMORY@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
	mov	x0, x20
	mov	w2, #0
	bl	_bus_release_resource
LBB0_6:
	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
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"cannot detach child devices\n"

	.comm	_SYS_RES_MEMORY,4,2             ; @SYS_RES_MEMORY
	.no_dead_strip	_i2c_detach
.subsections_via_symbols
