// File: /workspace/github_cpp_makefile_star2_O1/shuhaosun[P]Splitter-Windowed-CountMin/./Splitter.h
// Function: Splitter::Insert(char const*, int)
void Insert(const char * str, int t)
	{
		for(int i = 0; i < d; i++)
		{
			index[i] = (bobhash32[i]->run(str, strlen(str))) % w;
			if((int)counter[i][index[i]] != MAX_CNT)
			{
				int ij = w*i + index[i];
				if(counter[i][index[i]] == 0)
				{
					ListInitiate(&head[ij]);
				}
				else if ( (head[ij]->next->init < t - WINDOW_SIZE) || (head[ij]->next->init == t - WINDOW_SIZE))
				{
					Expire(head[ij], t, i, index[i]);
				}

				if (counter[i][index[i]] < 0)
				{
					counter[i][index[i]] = 0;
				}
				counter[i][index[i]]++;
				if (counter[i][index[i]] == 1)
				{
					ListInsert(head[ij], t, t, 1);
				}
				else if (head[ij]->prior->count < tau*WINDOW_SIZE/(double)w) 
				{
					head[ij]->prior->count++;
					head[ij]->prior->last = t;
				}
				else if (head[ij]->prior->prior != head[ij] && (Error(head[ij]->prior->prior, head[ij]->prior) < mu || Error(head[ij]->prior->prior, head[ij]->prior) == mu))
				{
					Merge(head[ij], t);
				}
				else
				{
					ListInsert(head[ij], t, t, 1);
				}
			}
			mem_acc ++;
		}
	}

// Assembly:
cmpl $0x0, 0x194(%rdi)
jle 0x1d6b
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %edx, %ebx
movq %rsi, %r14
movq %rdi, %r15
cvtsi2sd %edx, %xmm0
movsd 0x14d9(%rip), %xmm1     # 0x3058
movsd %xmm0, 0x8(%rsp)
addsd %xmm0, %xmm1
movsd %xmm1, 0x10(%rsp)
xorl %r12d, %r12d
movabsq $0x3ff0000000000000, %rbp # imm = 0x3FF0000000000000
movq (%r15,%r12,8), %r13
movq %r14, %rdi
callq 0x1090
movq %r13, %rdi
movq %r14, %rsi
movl %eax, %edx
callq 0x13dc
movsd 0x14a3(%rip), %xmm3     # 0x3060
xorl %edx, %edx
divl 0x190(%r15)
movl %edx, 0xa0(%r15,%r12,4)
movq 0xf0(%r15,%r12,8), %rax
movslq %edx, %rcx
movsd (%rax,%rcx,8), %xmm0
cvttsd2si %xmm0, %eax
cmpl %eax, 0x198(%r15)
je 0x1d43
movl %edx, %r8d
movl 0x190(%r15), %eax
imull %r12d, %eax
addl %edx, %eax
ucomisd 0x1471(%rip), %xmm0     # 0x3078
movslq %eax, %r13
jne 0x1c32
jp 0x1c32
movl $0x28, %edi
callq 0x1170
movsd 0x1440(%rip), %xmm3     # 0x3060
movq %rax, 0x1a8(%r15,%r13,8)
movq %rax, 0x20(%rax)
movq %rax, 0x18(%rax)
jmp 0x1c5f
movq 0x1a8(%r15,%r13,8), %rsi
movq 0x18(%rsi), %rax
movsd 0x10(%rsp), %xmm0
ucomisd (%rax), %xmm0
jb 0x1c5f
movq %r15, %rdi
movl %ebx, %edx
movl %r12d, %ecx
callq 0x1ed6
movsd 0x1401(%rip), %xmm3     # 0x3060
movq 0xf0(%r15,%r12,8), %rax
movslq 0xa0(%r15,%r12,4), %rcx
xorpd %xmm0, %xmm0
ucomisd (%rax,%rcx,8), %xmm0
jbe 0x1c82
movq $0x0, (%rax,%rcx,8)
movsd (%rax,%rcx,8), %xmm0
addsd %xmm3, %xmm0
movsd %xmm0, (%rax,%rcx,8)
movq 0x1a8(%r15,%r13,8), %rax
movq 0x20(%rax), %rdx
movsd 0x10(%rdx), %xmm0
xorps %xmm1, %xmm1
cvtsi2sdl 0x190(%r15), %xmm1
movsd 0x13b3(%rip), %xmm2     # 0x3068
divsd %xmm1, %xmm2
ucomisd %xmm0, %xmm2
jbe 0x1cd5
addsd %xmm3, %xmm0
movsd %xmm0, 0x10(%rdx)
movsd 0x8(%rsp), %xmm0
movsd %xmm0, 0x8(%rdx)
jmp 0x1d43
movq 0x20(%rdx), %rsi
movq %r15, %rdi
callq 0x1ffc
movsd 0x1387(%rip), %xmm1     # 0x3070
ucomisd %xmm0, %xmm1
ja 0x1d07
movq 0x1a8(%r15,%r13,8), %rax
movq 0x20(%rax), %rdx
movq 0x20(%rdx), %rsi
movq %r15, %rdi
callq 0x1ffc
movq 0x1a8(%r15,%r13,8), %rax
movq 0x20(%rax), %rax
movq 0x20(%rax), %rcx
movsd 0x10(%rcx), %xmm0
addsd 0x10(%rax), %xmm0
movsd %xmm0, 0x10(%rcx)
movsd 0x8(%rax), %xmm0
movsd %xmm0, 0x8(%rcx)
movq %rbp, 0x10(%rax)
movsd 0x8(%rsp), %xmm0
movsd %xmm0, (%rax)
movsd %xmm0, 0x8(%rax)
incl 0x7a13a8(%r15)
incq %r12
movslq 0x194(%r15), %rax
cmpq %rax, %r12
jl 0x1b9c
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq