// File: /workspace/github_cpp_makefile_star2_O3/shuhaosun[P]ECM-Sketch/./ECM_Sketch.h
// Function: ECM_Sketch::Insert_bucket(int, int, int)
void Insert_bucket(int i, int j, int t)
	{
		int z = counter[i][j].number;
		int p = -1;
		int value = 0;
		int first = 0;
		if (counter[i][j].number == -1)
		{
			counter[i][j].bucket[0].exponent = 0;
			counter[i][j].bucket[0].start = t;
			counter[i][j].bucket[0].end = t;
			counter[i][j].number = 1;
		}
		else
		{
			while (p < z)
			{
				if ((counter[i][j].bucket[p + 2].exponent == value) && (p == -1))    // p+2 = 1
				{
					counter[i][j].bucket[p + 2].exponent++;
					counter[i][j].bucket[p + 2].end = counter[i][j].bucket[p + 1].end;
					counter[i][j].bucket[p + 1].start = counter[i][j].bucket[p + 2].end;
					counter[i][j].bucket[p + 1].end = t;
					p = p + 2;
					value = counter[i][j].bucket[p].exponent;
				}
				else if ((counter[i][j].bucket[p + 2].exponent == value) && (p != -1))
				{
					counter[i][j].bucket[p + 2].exponent++;
					counter[i][j].bucket[p + 2].end = counter[i][j].bucket[p + 1].end;
					counter[i][j].bucket[p + 1].start = counter[i][j].bucket[p + 2].end;
					for (int q = p + 1; q > first; q--)
					{
						counter[i][j].bucket[q].exponent = counter[i][j].bucket[q - 1].exponent;
						counter[i][j].bucket[q].start = counter[i][j].bucket[q - 1].start;
						counter[i][j].bucket[q].end = counter[i][j].bucket[q - 1].end;
					}
					first++;
					counter[i][j].number--;
					p = p + 2;
					value = counter[i][j].bucket[p].exponent;
				}
				else if ((counter[i][j].bucket[p + 2].exponent != value) && (p != -1))
				{
					break;
				}
				else
				{
					for (int q = z; q > 0; q--)
					{
						counter[i][j].bucket[q].exponent = counter[i][j].bucket[q - 1].exponent;
						counter[i][j].bucket[q].start = counter[i][j].bucket[q - 1].start;
						counter[i][j].bucket[q].end = counter[i][j].bucket[q - 1].end;
					}
					counter[i][j].number++;
					counter[i][j].bucket[0].exponent = 0;
					counter[i][j].bucket[0].start = counter[i][j].bucket[1].end;
					counter[i][j].bucket[0].end = t;
					break;
				}
			}
			int qq = 0;
			if (first != 0)
			{
				for (int q = first; q < first + counter[i][j].number; ++q)
				{
					counter[i][j].bucket[qq].exponent = counter[i][j].bucket[q].exponent;
					counter[i][j].bucket[qq].start = counter[i][j].bucket[q].start;
					counter[i][j].bucket[qq].end = counter[i][j].bucket[q].end;
					qq++;
				}
				for (int q = qq; q < qq + first; ++q)
				{
					counter[i][j].bucket[q].exponent = -1;
					counter[i][j].bucket[q].start = -1;
					counter[i][j].bucket[q].end = -1;
				}
			}
		}
	}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movslq %esi, %rax
movq 0xf0(%rdi,%rax,8), %rsi
movslq %edx, %rax
imulq $0x4b4, %rax, %rdi      # imm = 0x4B4
leaq (%rsi,%rdi), %rax
movl 0x4b0(%rsi,%rdi), %r9d
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
cmpq %rdx, %r9
je 0x1dde
testl %r9d, %r9d
js 0x1eee
movq %rsi, -0x8(%rsp)
movq %rdi, -0x10(%rsp)
leaq (%rsi,%rdi), %r10
addq $0x4b0, %r10            # imm = 0x4B0
xorl %r11d, %r11d
movq $-0x1, %r15
movq %rax, %r8
movl %r9d, %edi
xorl %esi, %esi
xorl %ebp, %ebp
leaq 0x2(%r15), %r14
leaq (%r14,%r14,2), %r13
leaq (%rax,%r13,4), %r12
movl (%r12), %edx
cmpq $-0x1, %r15
jne 0x1d71
cmpl %ebp, %edx
jne 0x1d71
incl %ebp
movl %ebp, (%r12)
movl 0x4(%rax), %edx
movl %edx, 0x4(%rax,%r13,4)
movl %edx, 0x8(%rax)
movl %ecx, -0x4ac(%r10)
jmp 0x1dc8
cmpq $-0x1, %r15
je 0x1dfc
cmpl %ebp, %edx
jne 0x1dfc
incl %ebp
movl %ebp, (%r12)
leaq (%r15,%r15,2), %rdx
movl 0x10(%rax,%rdx,4), %ebx
movl %ebx, 0x4(%rax,%r13,4)
movl %ebx, 0x14(%rax,%rdx,4)
movslq %esi, %r13
movq %r8, %rbx
movq %r11, %rdx
cmpq %r13, %r15
jl 0x1dc1
decq %rdx
movl -0x4(%rbx), %ebp
movl %ebp, 0x8(%rbx)
movq -0xc(%rbx), %r15
movq %r15, (%rbx)
addq $-0xc, %rbx
cmpq %r13, %rdx
jg 0x1da4
movl (%r12), %ebp
incl %esi
decl %edi
movl %edi, (%r10)
addq $0x2, %r11
addq $0x18, %r8
movq %r14, %r15
cmpq %r9, %r14
jl 0x1d3d
jmp 0x1e54
movl $0x0, (%rax)
movl %ecx, 0x8(%rsi,%rdi)
movl %ecx, 0x4(%rsi,%rdi)
movl $0x1, 0x4b0(%rsi,%rdi)
jmp 0x1eee
cmpq $-0x1, %r15
je 0x1e06
cmpl %ebp, %edx
jne 0x1e54
testl %r9d, %r9d
je 0x1e3c
leaq (%r9,%r9,2), %rdx
incq %r9
movq -0x10(%rsp), %r8
leaq (%r8,%rdx,4), %rdx
addq -0x8(%rsp), %rdx
movl -0x4(%rdx), %r8d
movl %r8d, 0x8(%rdx)
movq -0xc(%rdx), %r8
movq %r8, (%rdx)
addq $-0xc, %rdx
decq %r9
cmpq $0x1, %r9
ja 0x1e20
incl %edi
movl %edi, (%r10)
movl $0x0, (%rax)
movl 0x10(%rax), %edx
movl %edx, 0x8(%rax)
movl %ecx, -0x4ac(%r10)
testl %esi, %esi
movq -0x8(%rsp), %r11
movq -0x10(%rsp), %rdx
je 0x1eee
testl %edi, %edi
jle 0x1ead
addl %esi, %edi
movslq %esi, %r8
movslq %edi, %rdi
leaq (%rdx,%r11), %r9
addq $0x8, %r9
leaq (,%r8,4), %rax
leaq (%rax,%rax,2), %r10
xorl %ecx, %ecx
movl (%r9,%r10), %eax
movl %eax, (%r9)
movq -0x8(%r9,%r10), %rax
movq %rax, -0x8(%r9)
addq $0xc, %r9
leaq (%r8,%rcx), %rax
incq %rax
incq %rcx
cmpq %rdi, %rax
jl 0x1e88
jmp 0x1eaf
xorl %ecx, %ecx
testl %esi, %esi
jle 0x1eee
addl %ecx, %esi
movl %ecx, %eax
leaq (%rax,%rax,2), %rax
addq %rdx, %r11
leal 0x1(%rcx), %edx
cmpl %edx, %esi
cmovlel %edx, %esi
leaq (%r11,%rax,4), %rdi
notl %ecx
addl %esi, %ecx
leaq (%rcx,%rcx,2), %rax
leaq 0xc(,%rax,4), %rdx
movl $0xff, %esi
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x10a0
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop