	.file	"extr_timekeeping.c_tk_setup_internals.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	tk_setup_internals, @function
tk_setup_internals:
.LFB0:
	.cfi_startproc
	endbr64
	push	r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	push	r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	push	r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	mov	r12, rsi
	push	rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	push	rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	mov	eax, DWORD PTR 8[rsi]
	mov	rbx, rdi
	add	DWORD PTR 112[rdi], 1
	mov	r14, QWORD PTR 96[rdi]
	add	rdi, 72
	mov	QWORD PTR 24[rdi], rsi
	mov	DWORD PTR 16[rdi], eax
	call	tk_clock_read@PLT
	mov	esi, DWORD PTR 4[r12]
	mov	ecx, DWORD PTR [r12]
	mov	QWORD PTR 64[rbx], r12
	mov	edx, DWORD PTR 8[r12]
	mov	r13d, DWORD PTR NTP_INTERVAL_LENGTH[rip]
	mov	DWORD PTR 84[rbx], eax
	mov	ebp, esi
	mov	DWORD PTR 52[rbx], eax
	shr	ebp, 31
	sal	r13d, cl
	mov	DWORD PTR 56[rbx], edx
	add	ebp, esi
	sar	ebp
	add	ebp, r13d
	mov	edi, ebp
	call	do_div@PLT
	test	ebp, ebp
	mov	eax, 1
	mov	edx, DWORD PTR 4[r12]
	cmove	ebp, eax
	mov	eax, r13d
	mov	DWORD PTR [rbx], ebp
	imul	ebp, edx
	sub	eax, ebp
	mov	DWORD PTR 4[rbx], ebp
	mov	DWORD PTR 8[rbx], eax
	mov	eax, DWORD PTR [r12]
	mov	DWORD PTR 12[rbx], ebp
	test	r14, r14
	je	.L3
	mov	esi, DWORD PTR [r14]
	mov	ecx, eax
	mov	r8d, DWORD PTR 72[rbx]
	mov	edi, DWORD PTR 40[rbx]
	sub	ecx, esi
	js	.L10
	sal	r8d, cl
	sal	edi, cl
	mov	DWORD PTR 72[rbx], r8d
	mov	DWORD PTR 40[rbx], edi
.L3:
	mov	ecx, DWORD PTR NTP_SCALE_SHIFT[rip]
	mov	DWORD PTR 76[rbx], eax
	mov	DWORD PTR 44[rbx], eax
	sub	ecx, eax
	mov	QWORD PTR 104[rbx], 0
	sal	r13d, cl
	mov	DWORD PTR 16[rbx], ecx
	mov	DWORD PTR 20[rbx], r13d
	mov	DWORD PTR 80[rbx], edx
	mov	DWORD PTR 48[rbx], edx
	mov	QWORD PTR 32[rbx], 0
	mov	QWORD PTR 24[rbx], 0
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	pop	rbp
	.cfi_def_cfa_offset 32
	pop	r12
	.cfi_def_cfa_offset 24
	pop	r13
	.cfi_def_cfa_offset 16
	pop	r14
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L10:
	.cfi_restore_state
	sub	esi, eax
	mov	ecx, esi
	sar	r8d, cl
	sar	edi, cl
	mov	DWORD PTR 72[rbx], r8d
	mov	DWORD PTR 40[rbx], edi
	jmp	.L3
	.cfi_endproc
.LFE0:
	.size	tk_setup_internals, .-tk_setup_internals
	.comm	NTP_SCALE_SHIFT,4,4
	.comm	NTP_INTERVAL_LENGTH,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_timekeeping.c_tk_setup_internals.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	tk_setup_internals, %function
tk_setup_internals:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, lr}
	mov	r4, r0
	mov	r5, r1
	ldr	r3, [r0, #84]
	ldr	r2, [r1, #8]
	add	r3, r3, #1
	ldr	r8, [r0, #76]
	str	r3, [r0, #84]
	str	r2, [r0, #72]
	str	r1, [r4, #76]
	add	r0, r0, #56
	bl	tk_clock_read
	ldr	r3, .L10
	ldr	r2, [r5]
	ldr	r7, [r3]
	ldmib	r5, {r1, r3}
	lsl	r7, r7, r2
	add	r6, r1, r1, lsr #31
	add	r6, r7, r6, asr #1
	str	r0, [r4, #68]
	str	r3, [r4, #48]
	str	r0, [r4, #44]
	str	r5, [r4, #52]
	mov	r0, r6
	bl	do_div
	cmp	r6, #0
	moveq	r6, #1
	ldr	r0, [r5, #4]
	cmp	r8, #0
	mul	r3, r6, r0
	sub	r2, r7, r3
	str	r3, [r4, #4]
	str	r3, [r4, #12]
	str	r6, [r4]
	ldr	r3, [r5]
	str	r2, [r4, #8]
	beq	.L3
	ldr	r2, [r8]
	ldr	ip, [r4, #56]
	subs	lr, r3, r2
	ldr	r1, [r4, #32]
	submi	r2, r2, r3
	asrmi	ip, ip, r2
	lslpl	ip, ip, lr
	asrmi	r2, r1, r2
	lslpl	r1, r1, lr
	strmi	ip, [r4, #56]
	strmi	r2, [r4, #32]
	strpl	ip, [r4, #56]
	strpl	r1, [r4, #32]
.L3:
	mov	r1, #0
	ldr	r2, .L10+4
	str	r3, [r4, #60]
	ldr	r2, [r2]
	str	r3, [r4, #36]
	sub	r3, r2, r3
	lsl	r7, r7, r3
	str	r0, [r4, #64]
	str	r0, [r4, #40]
	str	r7, [r4, #20]
	str	r3, [r4, #16]
	str	r1, [r4, #80]
	str	r1, [r4, #28]
	str	r1, [r4, #24]
	pop	{r4, r5, r6, r7, r8, pc}
.L11:
	.align	2
.L10:
	.word	NTP_INTERVAL_LENGTH
	.word	NTP_SCALE_SHIFT
	.size	tk_setup_internals, .-tk_setup_internals
	.comm	NTP_SCALE_SHIFT,4,4
	.comm	NTP_INTERVAL_LENGTH,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
