	.file	"extr_ar91xx_chip.c_ar91xx_chip_detect_sys_frequency.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	ar91xx_chip_detect_sys_frequency, @function
ar91xx_chip_detect_sys_frequency:
.LFB0:
	.cfi_startproc
	endbr64
	sub	rsp, 8
	.cfi_def_cfa_offset 16
	mov	eax, DWORD PTR AR91XX_BASE_FREQ[rip]
	mov	edi, DWORD PTR AR91XX_PLL_REG_CPU_CONFIG[rip]
	mov	DWORD PTR u_ar71xx_refclk[rip], eax
	mov	DWORD PTR u_ar71xx_mdio_freq[rip], eax
	call	ATH_READ_REG@PLT
	mov	ecx, DWORD PTR AR91XX_PLL_DIV_SHIFT[rip]
	mov	esi, eax
	mov	edi, eax
	sar	esi, cl
	mov	ecx, DWORD PTR AR91XX_DDR_DIV_SHIFT[rip]
	and	esi, DWORD PTR AR91XX_PLL_DIV_MASK[rip]
	imul	esi, DWORD PTR AR91XX_BASE_FREQ[rip]
	sar	eax, cl
	mov	ecx, DWORD PTR AR91XX_DDR_DIV_MASK[rip]
	and	ecx, eax
	mov	eax, esi
	mov	DWORD PTR u_ar71xx_cpu_freq[rip], esi
	add	ecx, 1
	cdq
	idiv	ecx
	mov	ecx, DWORD PTR AR91XX_AHB_DIV_SHIFT[rip]
	sar	edi, cl
	and	edi, DWORD PTR AR91XX_AHB_DIV_MASK[rip]
	lea	ecx, 2[rdi+rdi]
	mov	DWORD PTR u_ar71xx_ddr_freq[rip], eax
	mov	eax, esi
	cdq
	idiv	ecx
	mov	DWORD PTR u_ar71xx_ahb_freq[rip], eax
	mov	DWORD PTR u_ar71xx_uart_freq[rip], eax
	mov	DWORD PTR u_ar71xx_wdt_freq[rip], eax
	add	rsp, 8
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE0:
	.size	ar91xx_chip_detect_sys_frequency, .-ar91xx_chip_detect_sys_frequency
	.comm	u_ar71xx_wdt_freq,4,4
	.comm	u_ar71xx_uart_freq,4,4
	.comm	u_ar71xx_refclk,4,4
	.comm	u_ar71xx_mdio_freq,4,4
	.comm	u_ar71xx_ddr_freq,4,4
	.comm	u_ar71xx_cpu_freq,4,4
	.comm	u_ar71xx_ahb_freq,4,4
	.comm	AR91XX_PLL_REG_CPU_CONFIG,4,4
	.comm	AR91XX_PLL_DIV_SHIFT,4,4
	.comm	AR91XX_PLL_DIV_MASK,4,4
	.comm	AR91XX_DDR_DIV_SHIFT,4,4
	.comm	AR91XX_DDR_DIV_MASK,4,4
	.comm	AR91XX_BASE_FREQ,4,4
	.comm	AR91XX_AHB_DIV_SHIFT,4,4
	.comm	AR91XX_AHB_DIV_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_ar91xx_chip.c_ar91xx_chip_detect_sys_frequency.c"
	.text
	.global	__aeabi_idiv
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	ar91xx_chip_detect_sys_frequency, %function
ar91xx_chip_detect_sys_frequency:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, lr}
	ldr	r6, .L4
	ldr	r0, .L4+4
	ldr	r3, [r6]
	ldr	r1, .L4+8
	ldr	r2, .L4+12
	ldr	r0, [r0]
	str	r3, [r1]
	str	r3, [r2]
	bl	ATH_READ_REG
	ldr	r2, .L4+16
	ldr	r3, .L4+20
	ldr	r4, [r2]
	ldr	r3, [r3]
	ldr	r1, [r6]
	and	r4, r4, r0, asr r3
	ldr	r2, .L4+24
	ldr	r3, .L4+28
	mul	r4, r1, r4
	ldr	r2, [r2]
	ldr	r1, [r3]
	ldr	r3, .L4+32
	and	r1, r1, r0, asr r2
	mov	r5, r0
	str	r4, [r3]
	add	r1, r1, #1
	mov	r0, r4
	bl	__aeabi_idiv
	mov	r2, r0
	ldr	r1, .L4+36
	ldr	r3, .L4+40
	ldr	r0, [r1]
	ldr	r1, [r3]
	ldr	r3, .L4+44
	and	r1, r1, r5, asr r0
	add	r1, r1, #1
	str	r2, [r3]
	lsl	r1, r1, #1
	mov	r0, r4
	bl	__aeabi_idiv
	ldr	r1, .L4+48
	ldr	r2, .L4+52
	ldr	r3, .L4+56
	str	r0, [r1]
	str	r0, [r2]
	str	r0, [r3]
	pop	{r4, r5, r6, pc}
.L5:
	.align	2
.L4:
	.word	AR91XX_BASE_FREQ
	.word	AR91XX_PLL_REG_CPU_CONFIG
	.word	u_ar71xx_refclk
	.word	u_ar71xx_mdio_freq
	.word	AR91XX_PLL_DIV_MASK
	.word	AR91XX_PLL_DIV_SHIFT
	.word	AR91XX_DDR_DIV_SHIFT
	.word	AR91XX_DDR_DIV_MASK
	.word	u_ar71xx_cpu_freq
	.word	AR91XX_AHB_DIV_SHIFT
	.word	AR91XX_AHB_DIV_MASK
	.word	u_ar71xx_ddr_freq
	.word	u_ar71xx_ahb_freq
	.word	u_ar71xx_uart_freq
	.word	u_ar71xx_wdt_freq
	.size	ar91xx_chip_detect_sys_frequency, .-ar91xx_chip_detect_sys_frequency
	.comm	u_ar71xx_wdt_freq,4,4
	.comm	u_ar71xx_uart_freq,4,4
	.comm	u_ar71xx_refclk,4,4
	.comm	u_ar71xx_mdio_freq,4,4
	.comm	u_ar71xx_ddr_freq,4,4
	.comm	u_ar71xx_cpu_freq,4,4
	.comm	u_ar71xx_ahb_freq,4,4
	.comm	AR91XX_PLL_REG_CPU_CONFIG,4,4
	.comm	AR91XX_PLL_DIV_SHIFT,4,4
	.comm	AR91XX_PLL_DIV_MASK,4,4
	.comm	AR91XX_DDR_DIV_SHIFT,4,4
	.comm	AR91XX_DDR_DIV_MASK,4,4
	.comm	AR91XX_BASE_FREQ,4,4
	.comm	AR91XX_AHB_DIV_SHIFT,4,4
	.comm	AR91XX_AHB_DIV_MASK,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
