	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function bcmwd_watchdog_fn
_bcmwd_watchdog_fn:                     ## @bcmwd_watchdog_fn
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r14
	movl	%esi, %ebx
	movq	%rdi, %r15
	callq	_mtx_lock
	movq	_WD_INTERVAL@GOTPCREL(%rip), %rax
	andl	(%rax), %ebx
	jle	LBB0_3
## %bb.1:
	cmpl	$29, %ebx
	ja	LBB0_5
## %bb.2:
	movl	4(%r15), %edi
	leaq	L_.str(%rip), %rsi
	callq	_device_printf
LBB0_3:
	movq	_BCM2835_RSTC_REG@GOTPCREL(%rip), %rax
	movq	_BCM2835_PASSWORD@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movq	_BCM2835_PASSWORD_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	shll	%cl, %edx
	movl	(%rax), %esi
	movq	_BCM2835_RSTC_RESET@GOTPCREL(%rip), %rax
	orl	(%rax), %edx
	movq	%r15, %rdi
	callq	_WRITE
	jmp	LBB0_4
LBB0_5:
	movl	$1, %eax
	movl	%ebx, %ecx
	shll	%cl, %eax
	cltq
	imulq	$1152921505, %rax, %rax         ## imm = 0x44B82FA1
	movq	%rax, %rcx
	shrq	$63, %rcx
	sarq	$60, %rax
	addl	%ecx, %eax
	shll	$16, %eax
	movq	_BCM2835_WDOG_TIME_MASK@GOTPCREL(%rip), %rcx
	andl	(%rcx), %eax
	movq	_BCM2835_PASSWORD@GOTPCREL(%rip), %r12
	movl	(%r12), %edx
	movq	_BCM2835_PASSWORD_SHIFT@GOTPCREL(%rip), %r13
	movb	(%r13), %cl
	shll	%cl, %edx
	orl	%eax, %edx
	movq	_BCM2835_WDOG_REG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_WRITE
	movq	_BCM2835_RSTC_REG@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	movq	%r15, %rdi
	callq	_READ
	movq	_BCM2835_RSTC_WRCFG_CLR@GOTPCREL(%rip), %rcx
	andl	(%rcx), %eax
	movq	_BCM2835_RSTC_WRCFG_FULL_RESET@GOTPCREL(%rip), %rsi
	movl	(%r12), %edx
	movb	(%r13), %cl
	shll	%cl, %edx
	orl	(%rsi), %eax
	orl	%eax, %edx
	movl	(%rbx), %esi
	movq	%r15, %rdi
	callq	_WRITE
	movl	$0, (%r14)
LBB0_4:
	movq	%r15, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_mtx_unlock                     ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_WD_INTERVAL,4,2                ## @WD_INTERVAL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Can't arm, timeout must be between 1-15 seconds\n"

	.comm	_BCM2835_RSTC_REG,4,2           ## @BCM2835_RSTC_REG
	.comm	_BCM2835_PASSWORD,4,2           ## @BCM2835_PASSWORD
	.comm	_BCM2835_PASSWORD_SHIFT,4,2     ## @BCM2835_PASSWORD_SHIFT
	.comm	_BCM2835_RSTC_RESET,4,2         ## @BCM2835_RSTC_RESET
	.comm	_BCM2835_WDOG_TIME_MASK,4,2     ## @BCM2835_WDOG_TIME_MASK
	.comm	_BCM2835_WDOG_REG,4,2           ## @BCM2835_WDOG_REG
	.comm	_BCM2835_RSTC_WRCFG_CLR,4,2     ## @BCM2835_RSTC_WRCFG_CLR
	.comm	_BCM2835_RSTC_WRCFG_FULL_RESET,4,2 ## @BCM2835_RSTC_WRCFG_FULL_RESET
	.no_dead_strip	_bcmwd_watchdog_fn
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function bcmwd_watchdog_fn
_bcmwd_watchdog_fn:                     ; @bcmwd_watchdog_fn
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x20, x2
	mov	x21, x1
	mov	x19, x0
	bl	_mtx_lock
Lloh0:
	adrp	x8, _WD_INTERVAL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _WD_INTERVAL@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	and	w8, w8, w21
	cmp	w8, #1
	b.lt	LBB0_3
; %bb.1:
	cmp	w8, #29
	b.hi	LBB0_4
; %bb.2:
	ldr	w0, [x19, #4]
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	bl	_device_printf
LBB0_3:
Lloh5:
	adrp	x8, _BCM2835_RSTC_REG@GOTPAGE
Lloh6:
	ldr	x8, [x8, _BCM2835_RSTC_REG@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
Lloh8:
	adrp	x8, _BCM2835_PASSWORD@GOTPAGE
Lloh9:
	ldr	x8, [x8, _BCM2835_PASSWORD@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
Lloh11:
	adrp	x9, _BCM2835_PASSWORD_SHIFT@GOTPAGE
Lloh12:
	ldr	x9, [x9, _BCM2835_PASSWORD_SHIFT@GOTPAGEOFF]
Lloh13:
	ldr	w9, [x9]
	lsl	w8, w8, w9
Lloh14:
	adrp	x9, _BCM2835_RSTC_RESET@GOTPAGE
Lloh15:
	ldr	x9, [x9, _BCM2835_RSTC_RESET@GOTPAGEOFF]
Lloh16:
	ldr	w9, [x9]
	orr	w2, w8, w9
	mov	x0, x19
	bl	_WRITE
	b	LBB0_5
LBB0_4:
	mov	w9, #1
	lsl	w8, w9, w8
	mov	w9, #12193
	movk	w9, #17592, lsl #16
	smull	x8, w8, w9
	lsr	x9, x8, #63
	asr	x8, x8, #60
	add	w8, w8, w9
Lloh17:
	adrp	x9, _BCM2835_WDOG_TIME_MASK@GOTPAGE
Lloh18:
	ldr	x9, [x9, _BCM2835_WDOG_TIME_MASK@GOTPAGEOFF]
Lloh19:
	ldr	w9, [x9]
	and	w8, w9, w8, lsl #16
Lloh20:
	adrp	x21, _BCM2835_PASSWORD@GOTPAGE
Lloh21:
	ldr	x21, [x21, _BCM2835_PASSWORD@GOTPAGEOFF]
	ldr	w9, [x21]
Lloh22:
	adrp	x22, _BCM2835_PASSWORD_SHIFT@GOTPAGE
Lloh23:
	ldr	x22, [x22, _BCM2835_PASSWORD_SHIFT@GOTPAGEOFF]
	ldr	w10, [x22]
	lsl	w9, w9, w10
	orr	w2, w9, w8
Lloh24:
	adrp	x8, _BCM2835_WDOG_REG@GOTPAGE
Lloh25:
	ldr	x8, [x8, _BCM2835_WDOG_REG@GOTPAGEOFF]
Lloh26:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_WRITE
Lloh27:
	adrp	x23, _BCM2835_RSTC_REG@GOTPAGE
Lloh28:
	ldr	x23, [x23, _BCM2835_RSTC_REG@GOTPAGEOFF]
	ldr	w1, [x23]
	mov	x0, x19
	bl	_READ
Lloh29:
	adrp	x8, _BCM2835_RSTC_WRCFG_CLR@GOTPAGE
Lloh30:
	ldr	x8, [x8, _BCM2835_RSTC_WRCFG_CLR@GOTPAGEOFF]
Lloh31:
	ldr	w8, [x8]
	and	w8, w8, w0
Lloh32:
	adrp	x9, _BCM2835_RSTC_WRCFG_FULL_RESET@GOTPAGE
Lloh33:
	ldr	x9, [x9, _BCM2835_RSTC_WRCFG_FULL_RESET@GOTPAGEOFF]
Lloh34:
	ldr	w9, [x9]
	orr	w8, w8, w9
	ldr	w9, [x21]
	ldr	w10, [x22]
	lsl	w9, w9, w10
	orr	w2, w8, w9
	ldr	w1, [x23]
	mov	x0, x19
	bl	_WRITE
	str	wzr, [x20]
LBB0_5:
	mov	x0, x19
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	b	_mtx_unlock
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGot	Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGot	Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.comm	_WD_INTERVAL,4,2                ; @WD_INTERVAL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Can't arm, timeout must be between 1-15 seconds\n"

	.comm	_BCM2835_RSTC_REG,4,2           ; @BCM2835_RSTC_REG
	.comm	_BCM2835_PASSWORD,4,2           ; @BCM2835_PASSWORD
	.comm	_BCM2835_PASSWORD_SHIFT,4,2     ; @BCM2835_PASSWORD_SHIFT
	.comm	_BCM2835_RSTC_RESET,4,2         ; @BCM2835_RSTC_RESET
	.comm	_BCM2835_WDOG_TIME_MASK,4,2     ; @BCM2835_WDOG_TIME_MASK
	.comm	_BCM2835_WDOG_REG,4,2           ; @BCM2835_WDOG_REG
	.comm	_BCM2835_RSTC_WRCFG_CLR,4,2     ; @BCM2835_RSTC_WRCFG_CLR
	.comm	_BCM2835_RSTC_WRCFG_FULL_RESET,4,2 ; @BCM2835_RSTC_WRCFG_FULL_RESET
	.no_dead_strip	_bcmwd_watchdog_fn
.subsections_via_symbols
