// File: 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:
subq $0x38, %rsp
movq %rdi, 0x30(%rsp)
movq %rsi, 0x28(%rsp)
movl %edx, 0x24(%rsp)
movq 0x30(%rsp), %rax
movq %rax, 0x10(%rsp)
movl $0x0, 0x20(%rsp)
movq 0x10(%rsp), %rcx
movl 0x20(%rsp), %eax
cmpl 0x194(%rcx), %eax
jge 0x3a28
movq 0x10(%rsp), %rax
movslq 0x20(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, (%rsp)
movq 0x28(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x28(%rsp), %rdi
callq 0x20a0
movq (%rsp), %rdi
movq 0x8(%rsp), %rsi
movl %eax, %edx
callq 0x2450
movq 0x10(%rsp), %rcx
xorl %edx, %edx
divl 0x190(%rcx)
movslq 0x20(%rsp), %rax
movl %edx, 0xa0(%rcx,%rax,4)
movslq 0x20(%rsp), %rax
movq 0xf0(%rcx,%rax,8), %rax
movslq 0x20(%rsp), %rdx
movslq 0xa0(%rcx,%rdx,4), %rdx
cvttsd2si (%rax,%rdx,8), %eax
cmpl 0x198(%rcx), %eax
je 0x3a04
movq 0x10(%rsp), %rcx
movl 0x190(%rcx), %eax
imull 0x20(%rsp), %eax
movslq 0x20(%rsp), %rdx
addl 0xa0(%rcx,%rdx,4), %eax
movl %eax, 0x1c(%rsp)
movslq 0x20(%rsp), %rax
movq 0xf0(%rcx,%rax,8), %rax
movslq 0x20(%rsp), %rdx
movslq 0xa0(%rcx,%rdx,4), %rcx
movsd (%rax,%rcx,8), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x3722
jp 0x3722
movq 0x10(%rsp), %rdi
movq %rdi, %rsi
addq $0x1a8, %rsi            # imm = 0x1A8
movslq 0x1c(%rsp), %rax
shlq $0x3, %rax
addq %rax, %rsi
callq 0x4230
jmp 0x37b6
movq 0x10(%rsp), %rax
movslq 0x1c(%rsp), %rcx
movq 0x1a8(%rax,%rcx,8), %rax
movq 0x18(%rax), %rax
movsd (%rax), %xmm1
cvtsi2sdl 0x24(%rsp), %xmm0
movsd 0x2936(%rip), %xmm2     # 0x6080
subsd %xmm2, %xmm0
ucomisd %xmm1, %xmm0
ja 0x3788
movq 0x10(%rsp), %rax
movslq 0x1c(%rsp), %rcx
movq 0x1a8(%rax,%rcx,8), %rax
movq 0x18(%rax), %rax
movsd (%rax), %xmm0
cvtsi2sdl 0x24(%rsp), %xmm1
movsd 0x2904(%rip), %xmm2     # 0x6080
subsd %xmm2, %xmm1
ucomisd %xmm1, %xmm0
jne 0x37b4
jp 0x37b4
movq 0x10(%rsp), %rdi
movslq 0x1c(%rsp), %rax
movq 0x1a8(%rdi,%rax,8), %rsi
movl 0x24(%rsp), %edx
movl 0x20(%rsp), %ecx
movslq 0x20(%rsp), %rax
movl 0xa0(%rdi,%rax,4), %r8d
callq 0x4280
jmp 0x37b6
movq 0x10(%rsp), %rcx
movslq 0x20(%rsp), %rax
movq 0xf0(%rcx,%rax,8), %rax
movslq 0x20(%rsp), %rdx
movslq 0xa0(%rcx,%rdx,4), %rcx
xorps %xmm0, %xmm0
ucomisd (%rax,%rcx,8), %xmm0
jbe 0x3806
movq 0x10(%rsp), %rcx
movslq 0x20(%rsp), %rax
movq 0xf0(%rcx,%rax,8), %rax
movslq 0x20(%rsp), %rdx
movslq 0xa0(%rcx,%rdx,4), %rcx
xorps %xmm0, %xmm0
movsd %xmm0, (%rax,%rcx,8)
movq 0x10(%rsp), %rcx
movslq 0x20(%rsp), %rax
movq 0xf0(%rcx,%rax,8), %rax
movslq 0x20(%rsp), %rdx
movslq 0xa0(%rcx,%rdx,4), %rdx
movsd 0x283b(%rip), %xmm0     # 0x6068
addsd (%rax,%rdx,8), %xmm0
movsd %xmm0, (%rax,%rdx,8)
movslq 0x20(%rsp), %rax
movq 0xf0(%rcx,%rax,8), %rax
movslq 0x20(%rsp), %rdx
movslq 0xa0(%rcx,%rdx,4), %rcx
movsd (%rax,%rcx,8), %xmm0
movsd 0x280a(%rip), %xmm1     # 0x6068
ucomisd %xmm1, %xmm0
jne 0x3890
jp 0x3890
movq 0x10(%rsp), %rdi
movslq 0x1c(%rsp), %rax
movq 0x1a8(%rdi,%rax,8), %rsi
movl 0x24(%rsp), %edx
movl 0x24(%rsp), %ecx
movl $0x1, %r8d
callq 0x4560
jmp 0x3a02
movq 0x10(%rsp), %rax
movslq 0x1c(%rsp), %rcx
movq 0x1a8(%rax,%rcx,8), %rcx
movq 0x20(%rcx), %rcx
movsd 0x10(%rcx), %xmm1
cvtsi2sdl 0x190(%rax), %xmm2
movsd 0x277d(%rip), %xmm0     # 0x6038
divsd %xmm2, %xmm0
ucomisd %xmm1, %xmm0
jbe 0x390e
movq 0x10(%rsp), %rax
movslq 0x1c(%rsp), %rcx
movq 0x1a8(%rax,%rcx,8), %rcx
movq 0x20(%rcx), %rcx
movsd 0x2785(%rip), %xmm0     # 0x6068
addsd 0x10(%rcx), %xmm0
movsd %xmm0, 0x10(%rcx)
cvtsi2sdl 0x24(%rsp), %xmm0
movslq 0x1c(%rsp), %rcx
movq 0x1a8(%rax,%rcx,8), %rax
movq 0x20(%rax), %rax
movsd %xmm0, 0x8(%rax)
jmp 0x3a00
movq 0x10(%rsp), %rcx
movslq 0x1c(%rsp), %rax
movq 0x1a8(%rcx,%rax,8), %rax
movq 0x20(%rax), %rax
movq 0x20(%rax), %rax
movslq 0x1c(%rsp), %rdx
cmpq 0x1a8(%rcx,%rdx,8), %rax
je 0x39d9
movq 0x10(%rsp), %rdi
movslq 0x1c(%rsp), %rax
movq 0x1a8(%rdi,%rax,8), %rax
movq 0x20(%rax), %rax
movq 0x20(%rax), %rsi
movslq 0x1c(%rsp), %rax
movq 0x1a8(%rdi,%rax,8), %rax
movq 0x20(%rax), %rdx
callq 0x4630
movaps %xmm0, %xmm1
movsd 0x2712(%rip), %xmm0     # 0x6088
ucomisd %xmm1, %xmm0
ja 0x39bc
movq 0x10(%rsp), %rdi
movslq 0x1c(%rsp), %rax
movq 0x1a8(%rdi,%rax,8), %rax
movq 0x20(%rax), %rax
movq 0x20(%rax), %rsi
movslq 0x1c(%rsp), %rax
movq 0x1a8(%rdi,%rax,8), %rax
movq 0x20(%rax), %rdx
callq 0x4630
movsd 0x26d4(%rip), %xmm1     # 0x6088
ucomisd %xmm1, %xmm0
jne 0x39d9
jp 0x39d9
movq 0x10(%rsp), %rdi
movslq 0x1c(%rsp), %rax
movq 0x1a8(%rdi,%rax,8), %rsi
movl 0x24(%rsp), %edx
callq 0x4700
jmp 0x39fe
movq 0x10(%rsp), %rdi
movslq 0x1c(%rsp), %rax
movq 0x1a8(%rdi,%rax,8), %rsi
movl 0x24(%rsp), %edx
movl 0x24(%rsp), %ecx
movl $0x1, %r8d
callq 0x4560
jmp 0x3a00
jmp 0x3a02
jmp 0x3a04
movq 0x10(%rsp), %rax
movl 0x7a13a8(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x7a13a8(%rax)
movl 0x20(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x20(%rsp)
jmp 0x3624
addq $0x38, %rsp
retq
nopl (%rax)