	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function aml8726_wdt_watchdog
_aml8726_wdt_watchdog:                  ## @aml8726_wdt_watchdog
	.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	%rdx, %r14
	movl	%esi, %ebx
	movq	%rdi, %r15
	callq	_AML_WDT_LOCK
	movq	_WD_INTERVAL@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	andl	%ebx, %ecx
	movl	$1, %eax
                                        ## kill: def $cl killed $cl killed $ecx
	shll	%cl, %eax
	testl	%ebx, %ebx
	je	LBB0_3
## %bb.1:
	addl	$9999, %eax                     ## imm = 0x270F
	cltq
	imulq	$1759218605, %rax, %rbx         ## imm = 0x68DB8BAD
	movq	%rbx, %rax
	shrq	$63, %rax
	sarq	$44, %rbx
	addl	%eax, %ebx
	movq	_AML_WDT_CTRL_TERMINAL_CNT_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_AML_WDT_CTRL_TERMINAL_CNT_SHIFT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	sarl	%cl, %eax
	cmpl	%eax, %ebx
	jle	LBB0_2
LBB0_3:
	movq	_AML_WDT_CTRL_REG@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movq	%r15, %rdi
	movl	%ebx, %esi
	callq	_CSR_READ_4
	movq	_AML_WDT_CTRL_IRQ_EN@GOTPCREL(%rip), %rcx
	movq	_AML_WDT_CTRL_EN@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	orl	(%rcx), %edx
	notl	%edx
	andl	%eax, %edx
	movq	%r15, %rdi
	movl	%ebx, %esi
	callq	_CSR_WRITE_4
	jmp	LBB0_4
LBB0_2:
                                        ## kill: def $cl killed $cl killed $ecx
	shll	%cl, %ebx
	movq	_AML_WDT_CTRL_CPU_WDRESET_MASK@GOTPCREL(%rip), %rax
	movq	_AML_WDT_CTRL_EN@GOTPCREL(%rip), %rcx
	orl	(%rax), %ebx
	orl	(%rcx), %ebx
	movq	_AML_WDT_RESET_REG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	xorl	%edx, %edx
	callq	_CSR_WRITE_4
	movq	_AML_WDT_CTRL_REG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	movl	%ebx, %edx
	callq	_CSR_WRITE_4
	movl	$0, (%r14)
LBB0_4:
	movq	%r15, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_AML_WDT_UNLOCK                 ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_WD_INTERVAL,4,2                ## @WD_INTERVAL
	.comm	_AML_WDT_CTRL_TERMINAL_CNT_MASK,4,2 ## @AML_WDT_CTRL_TERMINAL_CNT_MASK
	.comm	_AML_WDT_CTRL_TERMINAL_CNT_SHIFT,4,2 ## @AML_WDT_CTRL_TERMINAL_CNT_SHIFT
	.comm	_AML_WDT_CTRL_CPU_WDRESET_MASK,4,2 ## @AML_WDT_CTRL_CPU_WDRESET_MASK
	.comm	_AML_WDT_CTRL_EN,4,2            ## @AML_WDT_CTRL_EN
	.comm	_AML_WDT_RESET_REG,4,2          ## @AML_WDT_RESET_REG
	.comm	_AML_WDT_CTRL_REG,4,2           ## @AML_WDT_CTRL_REG
	.comm	_AML_WDT_CTRL_IRQ_EN,4,2        ## @AML_WDT_CTRL_IRQ_EN
	.no_dead_strip	_aml8726_wdt_watchdog
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function aml8726_wdt_watchdog
_aml8726_wdt_watchdog:                  ; @aml8726_wdt_watchdog
	.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, x2
	mov	x21, x1
	mov	x19, x0
	bl	_AML_WDT_LOCK
	cbz	w21, LBB0_2
; %bb.1:
Lloh0:
	adrp	x8, _WD_INTERVAL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _WD_INTERVAL@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	and	w8, w8, w21
	mov	w9, #1
	lsl	w8, w9, w8
	mov	w9, #9999
	add	w8, w8, w9
	mov	w9, #35757
	movk	w9, #26843, lsl #16
	smull	x8, w8, w9
	lsr	x9, x8, #63
	asr	x10, x8, #44
Lloh3:
	adrp	x8, _AML_WDT_CTRL_TERMINAL_CNT_MASK@GOTPAGE
Lloh4:
	ldr	x8, [x8, _AML_WDT_CTRL_TERMINAL_CNT_MASK@GOTPAGEOFF]
Lloh5:
	ldr	w11, [x8]
Lloh6:
	adrp	x8, _AML_WDT_CTRL_TERMINAL_CNT_SHIFT@GOTPAGE
Lloh7:
	ldr	x8, [x8, _AML_WDT_CTRL_TERMINAL_CNT_SHIFT@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	asr	w11, w11, w8
	add	w9, w10, w9
	cmp	w9, w11
	b.le	LBB0_3
LBB0_2:
Lloh9:
	adrp	x8, _AML_WDT_CTRL_REG@GOTPAGE
Lloh10:
	ldr	x8, [x8, _AML_WDT_CTRL_REG@GOTPAGEOFF]
Lloh11:
	ldr	w20, [x8]
	mov	x0, x19
	mov	x1, x20
	bl	_CSR_READ_4
Lloh12:
	adrp	x8, _AML_WDT_CTRL_IRQ_EN@GOTPAGE
Lloh13:
	ldr	x8, [x8, _AML_WDT_CTRL_IRQ_EN@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
Lloh15:
	adrp	x9, _AML_WDT_CTRL_EN@GOTPAGE
Lloh16:
	ldr	x9, [x9, _AML_WDT_CTRL_EN@GOTPAGEOFF]
Lloh17:
	ldr	w9, [x9]
	orr	w8, w9, w8
	bic	w2, w0, w8
	mov	x0, x19
	mov	x1, x20
	bl	_CSR_WRITE_4
	b	LBB0_4
LBB0_3:
Lloh18:
	adrp	x10, _AML_WDT_CTRL_CPU_WDRESET_MASK@GOTPAGE
Lloh19:
	ldr	x10, [x10, _AML_WDT_CTRL_CPU_WDRESET_MASK@GOTPAGEOFF]
Lloh20:
	ldr	w10, [x10]
Lloh21:
	adrp	x11, _AML_WDT_CTRL_EN@GOTPAGE
Lloh22:
	ldr	x11, [x11, _AML_WDT_CTRL_EN@GOTPAGEOFF]
Lloh23:
	ldr	w11, [x11]
	lsl	w8, w9, w8
	orr	w8, w10, w8
	orr	w21, w8, w11
Lloh24:
	adrp	x8, _AML_WDT_RESET_REG@GOTPAGE
Lloh25:
	ldr	x8, [x8, _AML_WDT_RESET_REG@GOTPAGEOFF]
Lloh26:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #0
	bl	_CSR_WRITE_4
Lloh27:
	adrp	x8, _AML_WDT_CTRL_REG@GOTPAGE
Lloh28:
	ldr	x8, [x8, _AML_WDT_CTRL_REG@GOTPAGEOFF]
Lloh29:
	ldr	w1, [x8]
	mov	x0, x19
	mov	x2, x21
	bl	_CSR_WRITE_4
	str	wzr, [x20]
LBB0_4:
	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	_AML_WDT_UNLOCK
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
	.comm	_WD_INTERVAL,4,2                ; @WD_INTERVAL
	.comm	_AML_WDT_CTRL_TERMINAL_CNT_MASK,4,2 ; @AML_WDT_CTRL_TERMINAL_CNT_MASK
	.comm	_AML_WDT_CTRL_TERMINAL_CNT_SHIFT,4,2 ; @AML_WDT_CTRL_TERMINAL_CNT_SHIFT
	.comm	_AML_WDT_CTRL_CPU_WDRESET_MASK,4,2 ; @AML_WDT_CTRL_CPU_WDRESET_MASK
	.comm	_AML_WDT_CTRL_EN,4,2            ; @AML_WDT_CTRL_EN
	.comm	_AML_WDT_RESET_REG,4,2          ; @AML_WDT_RESET_REG
	.comm	_AML_WDT_CTRL_REG,4,2           ; @AML_WDT_CTRL_REG
	.comm	_AML_WDT_CTRL_IRQ_EN,4,2        ; @AML_WDT_CTRL_IRQ_EN
	.no_dead_strip	_aml8726_wdt_watchdog
.subsections_via_symbols
