	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function bcm_bsc_attach
_bcm_bsc_attach:                        ## @bcm_bsc_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	%r13
	pushq	%r12
	pushq	%rbx
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edi, %r14d
	callq	_device_get_softc
	movq	%rax, %rbx
	movl	%r14d, 44(%rax)
	movl	$0, -44(%rbp)
	movq	_SYS_RES_MEMORY@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	movq	_RF_ACTIVE@GOTPCREL(%rip), %r13
	movl	(%r13), %ecx
	leaq	-44(%rbp), %rdx
	movl	%r14d, %edi
	callq	_bus_alloc_resource_any
	movq	%rax, 16(%rbx)
	testq	%rax, %rax
	je	LBB0_1
## %bb.4:
	movq	%rax, %rdi
	callq	_rman_get_bustag
	movl	%eax, 40(%rbx)
	movq	16(%rbx), %rdi
	callq	_rman_get_bushandle
	movl	%eax, 36(%rbx)
	movl	$0, -44(%rbp)
	movq	_SYS_RES_IRQ@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	movq	_RF_SHAREABLE@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	orl	(%r13), %ecx
	leaq	-44(%rbp), %rdx
	movl	%r14d, %edi
	callq	_bus_alloc_resource_any
	movq	%rax, 24(%rbx)
	testq	%rax, %rax
	je	LBB0_5
## %bb.6:
	movq	_INTR_TYPE_MISC@GOTPCREL(%rip), %rcx
	movq	_INTR_MPSAFE@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	orl	(%rcx), %edx
	movq	_bcm_bsc_intr@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r8d
	leaq	32(%rbx), %rcx
	movq	%rcx, (%rsp)
	movl	%r14d, %edi
	movq	%rax, %rsi
	xorl	%ecx, %ecx
	movq	%rbx, %r9
	callq	_bus_setup_intr
	testq	%rax, %rax
	je	LBB0_8
## %bb.7:
	movl	(%r12), %esi
	movq	24(%rbx), %rcx
	movl	%r14d, %edi
	xorl	%edx, %edx
	callq	_bus_release_resource
	movl	(%r15), %esi
	movq	16(%rbx), %rcx
	movl	%r14d, %edi
	xorl	%edx, %edx
	callq	_bus_release_resource
	leaq	L_.str.2(%rip), %rsi
	jmp	LBB0_2
LBB0_1:
	leaq	L_.str(%rip), %rsi
	jmp	LBB0_2
LBB0_5:
	movl	(%r15), %esi
	movq	16(%rbx), %rcx
	movl	%r14d, %edi
	xorl	%edx, %edx
	callq	_bus_release_resource
	leaq	L_.str.1(%rip), %rsi
LBB0_2:
	movl	%r14d, %edi
	callq	_device_printf
LBB0_3:
	movq	_ENXIO@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
LBB0_11:
	movl	%r15d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	movq	%rbx, %rdi
	addq	$8, %rdi
	movq	_MTX_DEF@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	leaq	L_.str.3(%rip), %rsi
	xorl	%r15d, %r15d
	xorl	%edx, %edx
	callq	_mtx_init
	movq	%rbx, %rdi
	callq	_bcm_bsc_sysctl_init
	movq	%rbx, %rdi
	callq	_BCM_BSC_LOCK
	movq	%rbx, %rdi
	callq	_bcm_bsc_reset
	movq	%rbx, %rdi
	callq	_BCM_BSC_UNLOCK
	leaq	L_.str.4(%rip), %rsi
	movl	%r14d, %edi
	movl	$-1, %edx
	callq	_device_add_child
	movq	%rax, (%rbx)
	testq	%rax, %rax
	je	LBB0_9
## %bb.10:
	movq	_bus_generic_attach@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	%r14d, %esi
	callq	_config_intrhook_oneshot
	jmp	LBB0_11
LBB0_9:
	movl	%r14d, %edi
	callq	_bcm_bsc_detach
	jmp	LBB0_3
	.cfi_endproc
                                        ## -- End function
	.comm	_SYS_RES_MEMORY,4,2             ## @SYS_RES_MEMORY
	.comm	_RF_ACTIVE,4,2                  ## @RF_ACTIVE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"cannot allocate memory window\n"

	.comm	_ENXIO,4,2                      ## @ENXIO
	.comm	_SYS_RES_IRQ,4,2                ## @SYS_RES_IRQ
	.comm	_RF_SHAREABLE,4,2               ## @RF_SHAREABLE
L_.str.1:                               ## @.str.1
	.asciz	"cannot allocate interrupt\n"

	.comm	_INTR_TYPE_MISC,4,2             ## @INTR_TYPE_MISC
	.comm	_INTR_MPSAFE,4,2                ## @INTR_MPSAFE
	.comm	_bcm_bsc_intr,4,2               ## @bcm_bsc_intr
L_.str.2:                               ## @.str.2
	.asciz	"cannot setup the interrupt handler\n"

L_.str.3:                               ## @.str.3
	.asciz	"bcm_bsc"

	.comm	_MTX_DEF,4,2                    ## @MTX_DEF
L_.str.4:                               ## @.str.4
	.asciz	"iicbus"

	.comm	_bus_generic_attach,8,3         ## @bus_generic_attach
	.no_dead_strip	_bcm_bsc_attach
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function bcm_bsc_attach
_bcm_bsc_attach:                        ; @bcm_bsc_attach
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x19, x0
	bl	_device_get_softc
	mov	x20, x0
	str	w19, [x0, #44]
	str	wzr, [sp, #12]
Lloh0:
	adrp	x21, _SYS_RES_MEMORY@GOTPAGE
Lloh1:
	ldr	x21, [x21, _SYS_RES_MEMORY@GOTPAGEOFF]
	ldr	w1, [x21]
Lloh2:
	adrp	x23, _RF_ACTIVE@GOTPAGE
Lloh3:
	ldr	x23, [x23, _RF_ACTIVE@GOTPAGEOFF]
	ldr	w3, [x23]
	add	x2, sp, #12
	mov	x0, x19
	bl	_bus_alloc_resource_any
	str	x0, [x20, #16]
	cbz	x0, LBB0_4
; %bb.1:
	bl	_rman_get_bustag
	str	w0, [x20, #40]
	ldr	x0, [x20, #16]
	bl	_rman_get_bushandle
	str	w0, [x20, #36]
	str	wzr, [sp, #12]
Lloh4:
	adrp	x22, _SYS_RES_IRQ@GOTPAGE
Lloh5:
	ldr	x22, [x22, _SYS_RES_IRQ@GOTPAGEOFF]
	ldr	w1, [x22]
	ldr	w8, [x23]
Lloh6:
	adrp	x9, _RF_SHAREABLE@GOTPAGE
Lloh7:
	ldr	x9, [x9, _RF_SHAREABLE@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	orr	w3, w9, w8
	add	x2, sp, #12
	mov	x0, x19
	bl	_bus_alloc_resource_any
	str	x0, [x20, #24]
	cbz	x0, LBB0_5
; %bb.2:
	mov	x1, x0
Lloh9:
	adrp	x8, _INTR_TYPE_MISC@GOTPAGE
Lloh10:
	ldr	x8, [x8, _INTR_TYPE_MISC@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
Lloh12:
	adrp	x9, _INTR_MPSAFE@GOTPAGE
Lloh13:
	ldr	x9, [x9, _INTR_MPSAFE@GOTPAGEOFF]
Lloh14:
	ldr	w9, [x9]
	orr	w2, w9, w8
Lloh15:
	adrp	x8, _bcm_bsc_intr@GOTPAGE
Lloh16:
	ldr	x8, [x8, _bcm_bsc_intr@GOTPAGEOFF]
Lloh17:
	ldr	w4, [x8]
	add	x6, x20, #32
	mov	x0, x19
	mov	x3, #0
	mov	x5, x20
	bl	_bus_setup_intr
	cbz	x0, LBB0_9
; %bb.3:
	ldr	w1, [x22]
	ldr	x3, [x20, #24]
	mov	x0, x19
	mov	w2, #0
	bl	_bus_release_resource
	ldr	w1, [x21]
	ldr	x3, [x20, #16]
	mov	x0, x19
	mov	w2, #0
	bl	_bus_release_resource
Lloh18:
	adrp	x1, l_.str.2@PAGE
Lloh19:
	add	x1, x1, l_.str.2@PAGEOFF
	b	LBB0_6
LBB0_4:
Lloh20:
	adrp	x1, l_.str@PAGE
Lloh21:
	add	x1, x1, l_.str@PAGEOFF
	b	LBB0_6
LBB0_5:
	ldr	w1, [x21]
	ldr	x3, [x20, #16]
	mov	x0, x19
	mov	w2, #0
	bl	_bus_release_resource
Lloh22:
	adrp	x1, l_.str.1@PAGE
Lloh23:
	add	x1, x1, l_.str.1@PAGEOFF
LBB0_6:
	mov	x0, x19
	bl	_device_printf
LBB0_7:
Lloh24:
	adrp	x8, _ENXIO@GOTPAGE
Lloh25:
	ldr	x8, [x8, _ENXIO@GOTPAGEOFF]
Lloh26:
	ldr	w0, [x8]
LBB0_8:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
LBB0_9:
	add	x0, x20, #8
Lloh27:
	adrp	x8, _MTX_DEF@GOTPAGE
Lloh28:
	ldr	x8, [x8, _MTX_DEF@GOTPAGEOFF]
Lloh29:
	ldr	w3, [x8]
Lloh30:
	adrp	x1, l_.str.3@PAGE
Lloh31:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x2, #0
	bl	_mtx_init
	mov	x0, x20
	bl	_bcm_bsc_sysctl_init
	mov	x0, x20
	bl	_BCM_BSC_LOCK
	mov	x0, x20
	bl	_bcm_bsc_reset
	mov	x0, x20
	bl	_BCM_BSC_UNLOCK
Lloh32:
	adrp	x1, l_.str.4@PAGE
Lloh33:
	add	x1, x1, l_.str.4@PAGEOFF
	mov	x0, x19
	mov	w2, #-1
	bl	_device_add_child
	str	x0, [x20]
	cbz	x0, LBB0_11
; %bb.10:
Lloh34:
	adrp	x8, _bus_generic_attach@GOTPAGE
Lloh35:
	ldr	x8, [x8, _bus_generic_attach@GOTPAGEOFF]
Lloh36:
	ldr	w0, [x8]
	mov	x1, x19
	bl	_config_intrhook_oneshot
	mov	w0, #0
	b	LBB0_8
LBB0_11:
	mov	x0, x19
	bl	_bcm_bsc_detach
	b	LBB0_7
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpAdd	Lloh32, Lloh33
	.loh AdrpAdd	Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.cfi_endproc
                                        ; -- End function
	.comm	_SYS_RES_MEMORY,4,2             ; @SYS_RES_MEMORY
	.comm	_RF_ACTIVE,4,2                  ; @RF_ACTIVE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"cannot allocate memory window\n"

	.comm	_ENXIO,4,2                      ; @ENXIO
	.comm	_SYS_RES_IRQ,4,2                ; @SYS_RES_IRQ
	.comm	_RF_SHAREABLE,4,2               ; @RF_SHAREABLE
l_.str.1:                               ; @.str.1
	.asciz	"cannot allocate interrupt\n"

	.comm	_INTR_TYPE_MISC,4,2             ; @INTR_TYPE_MISC
	.comm	_INTR_MPSAFE,4,2                ; @INTR_MPSAFE
	.comm	_bcm_bsc_intr,4,2               ; @bcm_bsc_intr
l_.str.2:                               ; @.str.2
	.asciz	"cannot setup the interrupt handler\n"

l_.str.3:                               ; @.str.3
	.asciz	"bcm_bsc"

	.comm	_MTX_DEF,4,2                    ; @MTX_DEF
l_.str.4:                               ; @.str.4
	.asciz	"iicbus"

	.comm	_bus_generic_attach,8,3         ; @bus_generic_attach
	.no_dead_strip	_bcm_bsc_attach
.subsections_via_symbols
