	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function bcmwd_attach
_bcmwd_attach:                          ## @bcmwd_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	_bcmwd_lsc@GOTPCREL(%rip), %rbx
	cmpq	$0, (%rbx)
	je	LBB0_2
LBB0_1:
	movq	_ENXIO@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	jmp	LBB0_7
LBB0_2:
	movl	%edi, %r14d
	callq	_device_get_softc
	movq	%rax, %r15
	movl	$7, (%rax)
	movq	_BCM2835_PASSWORD@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 48(%r15)
	movq	$0, 40(%r15)
	movl	%r14d, 32(%r15)
	movl	$0, -28(%rbp)
	movq	_SYS_RES_MEMORY@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_RF_ACTIVE@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	leaq	-28(%rbp), %rdx
	movl	%r14d, %edi
	callq	_bus_alloc_resource_any
	movq	%rax, 16(%r15)
	testq	%rax, %rax
	je	LBB0_3
## %bb.4:
	movq	%rax, %rdi
	callq	_rman_get_bustag
	movl	%eax, 28(%r15)
	movq	16(%r15), %rdi
	callq	_rman_get_bushandle
	movl	%eax, 24(%r15)
	movq	_compat_data@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%r14d, %edi
	callq	_ofw_bus_search_compatible
	movq	(%rax), %rax
	movq	_UPSTREAM_DTB@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_6
## %bb.5:
	movq	_UPSTREAM_DTB_REGS_OFFSET@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 8(%r15)
LBB0_6:
	movq	%r15, (%rbx)
	movq	%r15, %rdi
	addq	$4, %rdi
	movq	_MTX_DEF@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	leaq	L_.str.1(%rip), %rsi
	leaq	L_.str.2(%rip), %rdx
	callq	_mtx_init
	movq	_watchdog_list@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_bcmwd_watchdog_fn@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%ebx, %ebx
	movq	%r15, %rdx
	xorl	%ecx, %ecx
	callq	_EVENTHANDLER_REGISTER
LBB0_7:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_3:
	leaq	L_.str(%rip), %rsi
	movl	%r14d, %edi
	callq	_device_printf
	jmp	LBB0_1
	.cfi_endproc
                                        ## -- End function
	.comm	_bcmwd_lsc,8,3                  ## @bcmwd_lsc
	.comm	_ENXIO,4,2                      ## @ENXIO
	.comm	_BCM2835_PASSWORD,4,2           ## @BCM2835_PASSWORD
	.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	"could not allocate memory resource\n"

	.comm	_compat_data,4,2                ## @compat_data
	.comm	_UPSTREAM_DTB,8,3               ## @UPSTREAM_DTB
	.comm	_UPSTREAM_DTB_REGS_OFFSET,4,2   ## @UPSTREAM_DTB_REGS_OFFSET
L_.str.1:                               ## @.str.1
	.asciz	"BCM2835 Watchdog"

L_.str.2:                               ## @.str.2
	.asciz	"bcmwd"

	.comm	_MTX_DEF,4,2                    ## @MTX_DEF
	.comm	_watchdog_list,4,2              ## @watchdog_list
	.comm	_bcmwd_watchdog_fn,4,2          ## @bcmwd_watchdog_fn
	.no_dead_strip	_bcmwd_attach
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function bcmwd_attach
_bcmwd_attach:                          ; @bcmwd_attach
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
Lloh0:
	adrp	x21, _bcmwd_lsc@GOTPAGE
Lloh1:
	ldr	x21, [x21, _bcmwd_lsc@GOTPAGEOFF]
	ldr	x8, [x21]
	cbz	x8, LBB0_2
LBB0_1:
Lloh2:
	adrp	x8, _ENXIO@GOTPAGE
Lloh3:
	ldr	x8, [x8, _ENXIO@GOTPAGEOFF]
Lloh4:
	ldr	w0, [x8]
	b	LBB0_6
LBB0_2:
	mov	x20, x0
	bl	_device_get_softc
	mov	x19, x0
	mov	w8, #7
Lloh5:
	adrp	x9, _BCM2835_PASSWORD@GOTPAGE
Lloh6:
	ldr	x9, [x9, _BCM2835_PASSWORD@GOTPAGEOFF]
	str	w8, [x0]
Lloh7:
	ldr	w8, [x9]
	str	w8, [x0, #48]
	str	xzr, [x0, #40]
	str	w20, [x0, #32]
	str	wzr, [sp, #12]
Lloh8:
	adrp	x8, _SYS_RES_MEMORY@GOTPAGE
Lloh9:
	ldr	x8, [x8, _SYS_RES_MEMORY@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
Lloh11:
	adrp	x8, _RF_ACTIVE@GOTPAGE
Lloh12:
	ldr	x8, [x8, _RF_ACTIVE@GOTPAGEOFF]
Lloh13:
	ldr	w3, [x8]
	add	x2, sp, #12
	mov	x0, x20
	bl	_bus_alloc_resource_any
	str	x0, [x19, #16]
	cbz	x0, LBB0_7
; %bb.3:
	bl	_rman_get_bustag
	str	w0, [x19, #28]
	ldr	x0, [x19, #16]
	bl	_rman_get_bushandle
	str	w0, [x19, #24]
Lloh14:
	adrp	x8, _compat_data@GOTPAGE
Lloh15:
	ldr	x8, [x8, _compat_data@GOTPAGEOFF]
Lloh16:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_ofw_bus_search_compatible
	ldr	x8, [x0]
Lloh17:
	adrp	x9, _UPSTREAM_DTB@GOTPAGE
Lloh18:
	ldr	x9, [x9, _UPSTREAM_DTB@GOTPAGEOFF]
Lloh19:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_5
; %bb.4:
Lloh20:
	adrp	x8, _UPSTREAM_DTB_REGS_OFFSET@GOTPAGE
Lloh21:
	ldr	x8, [x8, _UPSTREAM_DTB_REGS_OFFSET@GOTPAGEOFF]
Lloh22:
	ldr	w8, [x8]
	str	w8, [x19, #8]
LBB0_5:
	str	x19, [x21]
	add	x0, x19, #4
Lloh23:
	adrp	x8, _MTX_DEF@GOTPAGE
Lloh24:
	ldr	x8, [x8, _MTX_DEF@GOTPAGEOFF]
Lloh25:
	ldr	w3, [x8]
Lloh26:
	adrp	x1, l_.str.1@PAGE
Lloh27:
	add	x1, x1, l_.str.1@PAGEOFF
Lloh28:
	adrp	x2, l_.str.2@PAGE
Lloh29:
	add	x2, x2, l_.str.2@PAGEOFF
	bl	_mtx_init
Lloh30:
	adrp	x8, _watchdog_list@GOTPAGE
Lloh31:
	ldr	x8, [x8, _watchdog_list@GOTPAGEOFF]
Lloh32:
	ldr	w0, [x8]
Lloh33:
	adrp	x8, _bcmwd_watchdog_fn@GOTPAGE
Lloh34:
	ldr	x8, [x8, _bcmwd_watchdog_fn@GOTPAGEOFF]
Lloh35:
	ldr	w1, [x8]
	mov	x2, x19
	mov	w3, #0
	bl	_EVENTHANDLER_REGISTER
	mov	w0, #0
LBB0_6:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
LBB0_7:
Lloh36:
	adrp	x1, l_.str@PAGE
Lloh37:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x20
	bl	_device_printf
	b	LBB0_1
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpAdd	Lloh28, Lloh29
	.loh AdrpAdd	Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpAdd	Lloh36, Lloh37
	.cfi_endproc
                                        ; -- End function
	.comm	_bcmwd_lsc,8,3                  ; @bcmwd_lsc
	.comm	_ENXIO,4,2                      ; @ENXIO
	.comm	_BCM2835_PASSWORD,4,2           ; @BCM2835_PASSWORD
	.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	"could not allocate memory resource\n"

	.comm	_compat_data,4,2                ; @compat_data
	.comm	_UPSTREAM_DTB,8,3               ; @UPSTREAM_DTB
	.comm	_UPSTREAM_DTB_REGS_OFFSET,4,2   ; @UPSTREAM_DTB_REGS_OFFSET
l_.str.1:                               ; @.str.1
	.asciz	"BCM2835 Watchdog"

l_.str.2:                               ; @.str.2
	.asciz	"bcmwd"

	.comm	_MTX_DEF,4,2                    ; @MTX_DEF
	.comm	_watchdog_list,4,2              ; @watchdog_list
	.comm	_bcmwd_watchdog_fn,4,2          ; @bcmwd_watchdog_fn
	.no_dead_strip	_bcmwd_attach
.subsections_via_symbols
