	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_bcma_chipco_watchdog_timer_set ## -- Begin function bcma_chipco_watchdog_timer_set
	.p2align	4, 0x90
_bcma_chipco_watchdog_timer_set:        ## @bcma_chipco_watchdog_timer_set
	.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	%esi, %ebx
	movq	%rdi, %r14
	callq	_bcma_chipco_watchdog_get_max_timer
	movl	%eax, %r15d
	movq	_BCMA_CC_CAP_PMU@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%r14)
	je	LBB0_2
## %bb.1:
	cmpl	%ebx, %r15d
	cmovgel	%ebx, %r15d
	cmpl	$1, %ebx
	movl	$2, %ebx
	cmovnel	%r15d, %ebx
	movq	_BCMA_CC_PMU_WATCHDOG@GOTPCREL(%rip), %rax
	jmp	LBB0_6
LBB0_2:
	testl	%ebx, %ebx
	jne	LBB0_3
## %bb.4:
	movq	_BCMA_CLKMODE_DYNAMIC@GOTPCREL(%rip), %rax
	jmp	LBB0_5
LBB0_3:
	movq	_BCMA_CLKMODE_FAST@GOTPCREL(%rip), %rax
LBB0_5:
	movl	(%rax), %esi
	movl	4(%r14), %edi
	callq	_bcma_core_set_clockmode
	cmpl	%ebx, %r15d
	cmovll	%r15d, %ebx
	movq	_BCMA_CC_WATCHDOG@GOTPCREL(%rip), %rax
LBB0_6:
	movl	(%rax), %esi
	movq	%r14, %rdi
	movl	%ebx, %edx
	callq	_bcma_cc_write32
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_BCMA_CC_CAP_PMU,4,2            ## @BCMA_CC_CAP_PMU
	.comm	_BCMA_CC_PMU_WATCHDOG,4,2       ## @BCMA_CC_PMU_WATCHDOG
	.comm	_BCMA_CLKMODE_FAST,4,2          ## @BCMA_CLKMODE_FAST
	.comm	_BCMA_CLKMODE_DYNAMIC,4,2       ## @BCMA_CLKMODE_DYNAMIC
	.comm	_BCMA_CC_WATCHDOG,4,2           ## @BCMA_CC_WATCHDOG
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_bcma_chipco_watchdog_timer_set ; -- Begin function bcma_chipco_watchdog_timer_set
	.p2align	2
_bcma_chipco_watchdog_timer_set:        ; @bcma_chipco_watchdog_timer_set
	.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, x1
	mov	x19, x0
	bl	_bcma_chipco_watchdog_get_max_timer
	mov	x21, x0
	ldr	w8, [x19]
Lloh0:
	adrp	x9, _BCMA_CC_CAP_PMU@GOTPAGE
Lloh1:
	ldr	x9, [x9, _BCMA_CC_CAP_PMU@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_2
; %bb.1:
	cmp	w21, w20
	csel	w8, w21, w20, lt
	mov	w9, #2
	cmp	w20, #1
	csel	w20, w9, w8, eq
Lloh3:
	adrp	x8, _BCMA_CC_PMU_WATCHDOG@GOTPAGE
Lloh4:
	ldr	x8, [x8, _BCMA_CC_PMU_WATCHDOG@GOTPAGEOFF]
	b	LBB0_3
LBB0_2:
Lloh5:
	adrp	x8, _BCMA_CLKMODE_FAST@GOTPAGE
Lloh6:
	ldr	x8, [x8, _BCMA_CLKMODE_FAST@GOTPAGEOFF]
Lloh7:
	adrp	x9, _BCMA_CLKMODE_DYNAMIC@GOTPAGE
Lloh8:
	ldr	x9, [x9, _BCMA_CLKMODE_DYNAMIC@GOTPAGEOFF]
	cmp	w20, #0
	csel	x8, x9, x8, eq
	ldr	w1, [x8]
	ldr	w0, [x19, #4]
	bl	_bcma_core_set_clockmode
	cmp	w21, w20
	csel	w20, w21, w20, lt
Lloh9:
	adrp	x8, _BCMA_CC_WATCHDOG@GOTPAGE
Lloh10:
	ldr	x8, [x8, _BCMA_CC_WATCHDOG@GOTPAGEOFF]
LBB0_3:
	ldr	w1, [x8]
	mov	x0, x19
	mov	x2, x20
	bl	_bcma_cc_write32
	mov	x0, x20
	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 AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.comm	_BCMA_CC_CAP_PMU,4,2            ; @BCMA_CC_CAP_PMU
	.comm	_BCMA_CC_PMU_WATCHDOG,4,2       ; @BCMA_CC_PMU_WATCHDOG
	.comm	_BCMA_CLKMODE_FAST,4,2          ; @BCMA_CLKMODE_FAST
	.comm	_BCMA_CLKMODE_DYNAMIC,4,2       ; @BCMA_CLKMODE_DYNAMIC
	.comm	_BCMA_CC_WATCHDOG,4,2           ; @BCMA_CC_WATCHDOG
.subsections_via_symbols
