	.file	"extr_ar9003_phy.c_ar9003_hw_bb_watchdog_config.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"Disabled BB Watchdog\n"
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC1:
	.string	"Enabled BB Watchdog timeout (%u ms)\n"
	.text
	.p2align 4
	.globl	ar9003_hw_bb_watchdog_config
	.type	ar9003_hw_bb_watchdog_config, @function
ar9003_hw_bb_watchdog_config:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	mov	rbp, rdi
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	sub	rsp, 8
	.cfi_def_cfa_offset 64
	call	ath9k_hw_common@PLT
	mov	r14d, DWORD PTR 0[rbp]
	mov	esi, DWORD PTR AR_PHY_WATCHDOG_CTL_2[rip]
	mov	rdi, rbp
	mov	r12, rax
	test	r14d, r14d
	je	.L11
	call	REG_READ@PLT
	mov	edx, DWORD PTR AR_PHY_WATCHDOG_IRQ_ENABLE[rip]
	and	eax, DWORD PTR AR_PHY_WATCHDOG_CNTL2_MASK[rip]
	mov	rdi, rbp
	mov	esi, DWORD PTR AR_PHY_WATCHDOG_CTL_2[rip]
	or	edx, eax
	mov	eax, DWORD PTR AR_PHY_WATCHDOG_RST_ENABLE[rip]
	not	eax
	and	edx, eax
	call	REG_WRITE@PLT
	cmp	r14d, 10000
	mov	ecx, 10000
	mov	rdi, QWORD PTR 8[rbp]
	cmovg	r14d, ecx
	imul	eax, r14d, 100
	movsx	rbx, eax
	imul	rbx, rbx, -580400985
	shr	rbx, 32
	add	ebx, eax
	sar	eax, 31
	mov	r13d, ebx
	mov	r15d, eax
	sar	r13d, 6
	sub	r13d, eax
	test	rdi, rdi
	jne	.L12
.L3:
	mov	edx, DWORD PTR AR_PHY_WATCHDOG_NON_IDLE_ENABLE[rip]
	mov	esi, DWORD PTR AR_PHY_WATCHDOG_CTL_1[rip]
	sal	r13d, 2
	mov	rdi, rbp
	and	r13d, DWORD PTR AR_PHY_WATCHDOG_NON_IDLE_MASK[rip]
	or	edx, DWORD PTR AR_PHY_WATCHDOG_IDLE_MASK[rip]
	or	edx, r13d
	call	REG_WRITE@PLT
	mov	esi, DWORD PTR RESET[rip]
	mov	ecx, r14d
	xor	eax, eax
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	mov	rdi, r12
	lea	rdx, .LC1[rip]
	pop	rbx
	.cfi_def_cfa_offset 48
	pop	rbp
	.cfi_def_cfa_offset 40
	pop	r12
	.cfi_def_cfa_offset 32
	pop	r13
	.cfi_def_cfa_offset 24
	pop	r14
	.cfi_def_cfa_offset 16
	pop	r15
	.cfi_def_cfa_offset 8
	jmp	ath_dbg@PLT
	.p2align 4,,10
	.p2align 3
.L12:
	.cfi_restore_state
	call	IS_CHAN_HT40@PLT
	sar	ebx, 5
	sub	ebx, r15d
	test	rax, rax
	cmovne	r13d, ebx
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L11:
	call	REG_READ@PLT
	mov	edx, DWORD PTR AR_PHY_WATCHDOG_RST_ENABLE[rip]
	or	edx, DWORD PTR AR_PHY_WATCHDOG_IRQ_ENABLE[rip]
	mov	rdi, rbp
	mov	esi, DWORD PTR AR_PHY_WATCHDOG_CTL_2[rip]
	not	edx
	and	edx, eax
	call	REG_WRITE@PLT
	mov	esi, DWORD PTR AR_PHY_WATCHDOG_CTL_1[rip]
	mov	rdi, rbp
	call	REG_READ@PLT
	mov	edx, DWORD PTR AR_PHY_WATCHDOG_NON_IDLE_ENABLE[rip]
	or	edx, DWORD PTR AR_PHY_WATCHDOG_IDLE_ENABLE[rip]
	mov	rdi, rbp
	mov	esi, DWORD PTR AR_PHY_WATCHDOG_CTL_1[rip]
	not	edx
	and	edx, eax
	call	REG_WRITE@PLT
	mov	esi, DWORD PTR RESET[rip]
	mov	rdi, r12
	xor	eax, eax
	add	rsp, 8
	.cfi_def_cfa_offset 56
	lea	rdx, .LC0[rip]
	pop	rbx
	.cfi_def_cfa_offset 48
	pop	rbp
	.cfi_def_cfa_offset 40
	pop	r12
	.cfi_def_cfa_offset 32
	pop	r13
	.cfi_def_cfa_offset 24
	pop	r14
	.cfi_def_cfa_offset 16
	pop	r15
	.cfi_def_cfa_offset 8
	jmp	ath_dbg@PLT
	.cfi_endproc
.LFE0:
	.size	ar9003_hw_bb_watchdog_config, .-ar9003_hw_bb_watchdog_config
	.comm	RESET,4,4
	.comm	AR_PHY_WATCHDOG_RST_ENABLE,4,4
	.comm	AR_PHY_WATCHDOG_NON_IDLE_MASK,4,4
	.comm	AR_PHY_WATCHDOG_NON_IDLE_ENABLE,4,4
	.comm	AR_PHY_WATCHDOG_IRQ_ENABLE,4,4
	.comm	AR_PHY_WATCHDOG_IDLE_MASK,4,4
	.comm	AR_PHY_WATCHDOG_IDLE_ENABLE,4,4
	.comm	AR_PHY_WATCHDOG_CTL_2,4,4
	.comm	AR_PHY_WATCHDOG_CTL_1,4,4
	.comm	AR_PHY_WATCHDOG_CNTL2_MASK,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	 1f - 0f
	.long	 4f - 1f
	.long	 5
0:
	.string	 "GNU"
1:
	.align 8
	.long	 0xc0000002
	.long	 3f - 2f
2:
	.long	 0x3
3:
	.align 8
4:

	.arch armv5t
	.eabi_attribute 20, 1
	.eabi_attribute 21, 1
	.eabi_attribute 23, 3
	.eabi_attribute 24, 1
	.eabi_attribute 25, 1
	.eabi_attribute 26, 2
	.eabi_attribute 30, 2
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"extr_ar9003_phy.c_ar9003_hw_bb_watchdog_config.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"Disabled BB Watchdog\012\000"
	.align	2
.LC1:
	.ascii	"Enabled BB Watchdog timeout (%u ms)\012\000"
	.text
	.align	2
	.global	ar9003_hw_bb_watchdog_config
	.syntax unified
	.arm
	.fpu softvfp
	.type	ar9003_hw_bb_watchdog_config, %function
ar9003_hw_bb_watchdog_config:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, lr}
	mov	r4, r0
	bl	ath9k_hw_common
	ldr	r6, [r4]
	mov	r8, r0
	cmp	r6, #0
	beq	.L12
	ldr	r5, .L14
	mov	r0, r4
	ldr	r1, [r5]
	bl	REG_READ
	ldr	r2, .L14+4
	ldr	r3, .L14+8
	ldr	r2, [r2]
	ldr	r1, .L14+12
	ldr	r3, [r3]
	and	r0, r0, r2
	ldr	r2, [r1]
	orr	r0, r0, r3
	bic	r2, r0, r2
	ldr	r1, [r5]
	mov	r0, r4
	bl	REG_WRITE
	ldr	r3, .L14+16
	ldr	r7, .L14+20
	cmp	r6, r3
	movge	r6, r3
	add	r2, r6, r6, lsl #2
	add	r2, r2, r2, lsl #2
	lsl	r2, r2, #2
	smull	r3, r7, r2, r7
	ldr	r0, [r4, #4]
	add	r7, r7, r2
	asr	r5, r2, #31
	cmp	r0, #0
	rsb	r9, r5, r7, asr #6
	bne	.L13
.L3:
	ldr	r2, .L14+24
	ldr	r1, .L14+28
	ldr	r3, .L14+32
	ldr	r1, [r1]
	ldr	r2, [r2]
	ldr	r3, [r3]
	orr	r2, r2, r1
	ldr	r1, .L14+36
	and	r3, r3, r9, lsl #2
	orr	r2, r2, r3
	mov	r0, r4
	ldr	r1, [r1]
	bl	REG_WRITE
	ldr	r2, .L14+40
	mov	r3, r6
	mov	r0, r8
	pop	{r4, r5, r6, r7, r8, r9, r10, lr}
	ldr	r1, [r2]
	ldr	r2, .L14+44
	b	ath_dbg
.L13:
	bl	IS_CHAN_HT40
	cmp	r0, #0
	rsbne	r9, r5, r7, asr #5
	b	.L3
.L12:
	ldr	r3, .L14
	mov	r0, r4
	ldr	r5, [r3]
	mov	r1, r5
	bl	REG_READ
	ldr	r3, .L14+12
	ldr	r2, .L14+8
	ldr	r3, [r3]
	ldr	r2, [r2]
	mov	r1, r5
	orr	r2, r3, r2
	bic	r2, r0, r2
	mov	r0, r4
	bl	REG_WRITE
	ldr	r3, .L14+36
	mov	r0, r4
	ldr	r5, [r3]
	mov	r1, r5
	bl	REG_READ
	mov	r2, r0
	ldr	r1, .L14+48
	ldr	r3, .L14+24
	ldr	r0, [r1]
	ldr	r3, [r3]
	mov	r1, r5
	orr	r3, r3, r0
	bic	r2, r2, r3
	mov	r0, r4
	bl	REG_WRITE
	ldr	r3, .L14+40
	mov	r0, r8
	pop	{r4, r5, r6, r7, r8, r9, r10, lr}
	ldr	r1, [r3]
	ldr	r2, .L14+52
	b	ath_dbg
.L15:
	.align	2
.L14:
	.word	AR_PHY_WATCHDOG_CTL_2
	.word	AR_PHY_WATCHDOG_CNTL2_MASK
	.word	AR_PHY_WATCHDOG_IRQ_ENABLE
	.word	AR_PHY_WATCHDOG_RST_ENABLE
	.word	10000
	.word	-580400985
	.word	AR_PHY_WATCHDOG_NON_IDLE_ENABLE
	.word	AR_PHY_WATCHDOG_IDLE_MASK
	.word	AR_PHY_WATCHDOG_NON_IDLE_MASK
	.word	AR_PHY_WATCHDOG_CTL_1
	.word	RESET
	.word	.LC1
	.word	AR_PHY_WATCHDOG_IDLE_ENABLE
	.word	.LC0
	.size	ar9003_hw_bb_watchdog_config, .-ar9003_hw_bb_watchdog_config
	.comm	RESET,4,4
	.comm	AR_PHY_WATCHDOG_RST_ENABLE,4,4
	.comm	AR_PHY_WATCHDOG_NON_IDLE_MASK,4,4
	.comm	AR_PHY_WATCHDOG_NON_IDLE_ENABLE,4,4
	.comm	AR_PHY_WATCHDOG_IRQ_ENABLE,4,4
	.comm	AR_PHY_WATCHDOG_IDLE_MASK,4,4
	.comm	AR_PHY_WATCHDOG_IDLE_ENABLE,4,4
	.comm	AR_PHY_WATCHDOG_CTL_2,4,4
	.comm	AR_PHY_WATCHDOG_CTL_1,4,4
	.comm	AR_PHY_WATCHDOG_CNTL2_MASK,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
