	.file	"extr_aiutils.c_ai_clkctl_setdelay.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	ai_clkctl_setdelay, @function
ai_clkctl_setdelay:
.LFB0:
	.cfi_startproc
	endbr64
	push	r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	push	r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	mov	r12, rdi
	push	rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	mov	rbp, rsi
	push	rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	sub	rsp, 8
	.cfi_def_cfa_offset 48
	mov	rbx, QWORD PTR PLL_DELAY[rip]
	call	ai_slowclk_src@PLT
	cmp	QWORD PTR SCC_SS_XTAL[rip], rax
	je	.L2
	add	rbx, QWORD PTR XTAL_ON_DELAY[rip]
.L2:
	mov	rdx, rbp
	xor	esi, esi
	mov	rdi, r12
	movabs	r12, 4835703278458516699
	call	ai_slowclk_freq@PLT
	imul	rbx, rax
	mov	rcx, rax
	imul	rcx, QWORD PTR FREF_DELAY[rip]
	add	rbx, 999999
	mov	rax, rbx
	add	rcx, 999999
	sar	rbx, 63
	imul	r12
	mov	rax, rcx
	sar	rcx, 63
	sar	rdx, 18
	sub	rdx, rbx
	mov	r13, rdx
	imul	r12
	mov	rdi, r13
	mov	r12, rdx
	sar	r12, 18
	sub	r12, rcx
	call	CHIPCREGOFFS@PLT
	mov	rdx, r13
	mov	rdi, rbp
	mov	esi, eax
	call	bcma_write32@PLT
	mov	rdi, r12
	call	CHIPCREGOFFS@PLT
	add	rsp, 8
	.cfi_def_cfa_offset 40
	mov	rdx, r12
	mov	rdi, rbp
	pop	rbx
	.cfi_def_cfa_offset 32
	mov	esi, eax
	pop	rbp
	.cfi_def_cfa_offset 24
	pop	r12
	.cfi_def_cfa_offset 16
	pop	r13
	.cfi_def_cfa_offset 8
	jmp	bcma_write32@PLT
	.cfi_endproc
.LFE0:
	.size	ai_clkctl_setdelay, .-ai_clkctl_setdelay
	.comm	XTAL_ON_DELAY,8,8
	.comm	SCC_SS_XTAL,8,8
	.comm	PLL_DELAY,8,8
	.comm	FREF_DELAY,8,8
	.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_aiutils.c_ai_clkctl_setdelay.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	ai_clkctl_setdelay, %function
ai_clkctl_setdelay:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	ldr	r3, .L5
	push	{r4, r5, r6, lr}
	mov	r6, r1
	ldr	r5, [r3]
	mov	r4, r0
	bl	ai_slowclk_src
	ldr	r3, .L5+4
	mov	r1, #0
	ldr	r3, [r3]
	mov	r2, r6
	cmp	r3, r0
	ldrne	r3, .L5+8
	mov	r0, r4
	ldrne	r3, [r3]
	ldr	r4, .L5+12
	addne	r5, r5, r3
	bl	ai_slowclk_freq
	ldr	r3, .L5+16
	ldr	r2, .L5+20
	mla	r5, r0, r5, r3
	ldr	r2, [r2]
	mla	r0, r2, r0, r3
	smull	r3, r2, r4, r5
	smull	r1, r3, r4, r0
	asr	r5, r5, #31
	rsb	r5, r5, r2, asr #18
	asr	r4, r0, #31
	mov	r0, r5
	rsb	r4, r4, r3, asr #18
	bl	CHIPCREGOFFS
	mov	r2, r5
	mov	r1, r0
	mov	r0, r6
	bl	bcma_write32
	mov	r0, r4
	bl	CHIPCREGOFFS
	mov	r2, r4
	mov	r1, r0
	mov	r0, r6
	pop	{r4, r5, r6, lr}
	b	bcma_write32
.L6:
	.align	2
.L5:
	.word	PLL_DELAY
	.word	SCC_SS_XTAL
	.word	XTAL_ON_DELAY
	.word	1125899907
	.word	999999
	.word	FREF_DELAY
	.size	ai_clkctl_setdelay, .-ai_clkctl_setdelay
	.comm	XTAL_ON_DELAY,4,4
	.comm	SCC_SS_XTAL,4,4
	.comm	PLL_DELAY,4,4
	.comm	FREF_DELAY,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
