// File: /workspace/github_cpp_makefile_star2_O3/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 0x1d5a
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 0x14cd(%rip), %xmm1     # 0x3058
movsd %xmm0, 0x8(%rsp)
addsd %xmm0, %xmm1
movsd %xmm1, 0x10(%rsp)
xorl %r12d, %r12d
movq (%r15,%r12,8), %r13
movq %r14, %rdi
callq 0x1090
movq %r13, %rdi
movq %r14, %rsi
movl %eax, %edx
callq 0x13dc
xorl %edx, %edx
divl 0x190(%r15)
movl %edx, 0xa0(%r15,%r12,4)
movq 0xf0(%r15,%r12,8), %rax
movslq %edx, %rbp
movsd (%rax,%rbp,8), %xmm0
cvttsd2si %xmm0, %eax
cmpl %eax, 0x198(%r15)
je 0x1d32
movl %edx, %r8d
movl 0x190(%r15), %eax
imull %r12d, %eax
addl %edx, %eax
ucomisd 0x1477(%rip), %xmm0     # 0x3078
movslq %eax, %r13
jne 0x1c24
jp 0x1c24
movl $0x28, %edi
callq 0x1170
movq %rax, 0x1a8(%r15,%r13,8)
movq %rax, 0x20(%rax)
movq %rax, 0x18(%rax)
jmp 0x1c51
movq 0x1a8(%r15,%r13,8), %rsi
movq 0x18(%rsi), %rax
movsd 0x10(%rsp), %xmm0
ucomisd (%rax), %xmm0
jb 0x1c51
movq %r15, %rdi
movl %ebx, %edx
movl %r12d, %ecx
callq 0x1ec6
movslq 0xa0(%r15,%r12,4), %rbp
movq 0xf0(%r15,%r12,8), %rax
xorpd %xmm0, %xmm0
maxsd (%rax,%rbp,8), %xmm0
movsd 0x13f6(%rip), %xmm3     # 0x3060
addsd %xmm3, %xmm0
movsd %xmm0, (%rax,%rbp,8)
movq 0x1a8(%r15,%r13,8), %rax
movq 0x20(%rax), %rdx
movsd 0x10(%rdx), %xmm0
xorps %xmm1, %xmm1
cvtsi2sdl 0x190(%r15), %xmm1
movsd 0x13d0(%rip), %xmm2     # 0x3068
divsd %xmm1, %xmm2
ucomisd %xmm0, %xmm2
jbe 0x1cb7
addsd %xmm3, %xmm0
movsd %xmm0, 0x10(%rdx)
addq $0x8, %rdx
movsd 0x8(%rsp), %xmm0
jmp 0x1d2e
movq 0x20(%rdx), %rsi
movq %r15, %rdi
callq 0x1fe8
movsd 0x13a5(%rip), %xmm1     # 0x3070
ucomisd %xmm0, %xmm1
ja 0x1ce9
movq 0x1a8(%r15,%r13,8), %rax
movq 0x20(%rax), %rdx
movq 0x20(%rdx), %rsi
movq %r15, %rdi
callq 0x1fe8
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)
leaq 0x8(%rax), %rdx
movsd 0x8(%rax), %xmm0
movsd %xmm0, 0x8(%rcx)
movabsq $0x3ff0000000000000, %rcx # imm = 0x3FF0000000000000
movq %rcx, 0x10(%rax)
movsd 0x8(%rsp), %xmm0
movsd %xmm0, (%rax)
movsd %xmm0, (%rdx)
incl 0x7a13a8(%r15)
incq %r12
movslq 0x194(%r15), %rax
cmpq %rax, %r12
jl 0x1b9e
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop