// File: /workspace/github_cpp_makefile_star2_O1/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), %rax
movslq %edx, %rdx
imulq $0x4b4, %rdx, %rsi      # imm = 0x4B4
leaq (%rax,%rsi), %rdi
movl 0x4b0(%rax,%rsi), %r8d
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
cmpq %rdx, %r8
je 0x1de2
testl %r8d, %r8d
movq %rsi, -0x8(%rsp)
js 0x1e00
leaq (%rax,%rsi), %r9
addq $0x4b0, %r9             # imm = 0x4B0
leaq (%rax,%rsi), %r10
xorl %r11d, %r11d
movq $-0x1, %r12
movq %rdi, %rbx
xorl %esi, %esi
xorl %ebp, %ebp
leaq 0x2(%r12), %r14
leaq (%r14,%r14,2), %r15
leaq (%rdi,%r15,4), %rdx
movl (%rdx), %r13d
cmpq $-0x1, %r12
jne 0x1d6c
cmpl %ebp, %r13d
jne 0x1d6c
incl %r13d
movl %r13d, (%rdx)
movl 0x4(%rdi), %edx
movl %edx, 0x4(%rdi,%r15,4)
movl %edx, 0x8(%rdi)
movl %ecx, -0x4ac(%r9)
jmp 0x1dc8
cmpq $-0x1, %r12
je 0x1e04
cmpl %ebp, %r13d
jne 0x1e04
incl %r13d
movl %r13d, (%rdx)
leaq (%r12,%r12,2), %rdx
movl 0x10(%rdi,%rdx,4), %ebp
movl %ebp, 0x4(%rdi,%r15,4)
movl %ebp, 0x14(%rdi,%rdx,4)
movslq %esi, %r13
cmpq %r13, %r12
jl 0x1dc3
movq %rbx, %r12
movq %r11, %rdx
decq %rdx
movl -0x4(%r12), %ebp
movl %ebp, 0x8(%r12)
movq -0xc(%r12), %rbp
movq %rbp, (%r12)
addq $-0xc, %r12
cmpq %r13, %rdx
jg 0x1da4
incl %esi
decl (%r9)
movl (%r10,%r15,4), %ebp
addq $0x2, %r11
addq $0x18, %rbx
movq %r14, %r12
cmpq %r8, %r14
jl 0x1d37
jmp 0x1e5c
movl $0x0, (%rdi)
movl %ecx, 0x8(%rax,%rsi)
movl %ecx, 0x4(%rax,%rsi)
movl $0x1, 0x4b0(%rax,%rsi)
jmp 0x1ef7
xorl %esi, %esi
jmp 0x1e5c
cmpq $-0x1, %r12
je 0x1e0f
cmpl %ebp, %r13d
jne 0x1e5c
testq %r8, %r8
movq -0x8(%rsp), %r10
je 0x1e43
leaq (%r8,%r8,2), %rdx
incq %r8
leaq (%r10,%rdx,4), %rdx
addq %rax, %rdx
movl -0x4(%rdx), %r9d
movl %r9d, 0x8(%rdx)
movq -0xc(%rdx), %r9
movq %r9, (%rdx)
addq $-0xc, %rdx
decq %r8
cmpq $0x1, %r8
jg 0x1e27
incl 0x4b0(%rax,%r10)
movl $0x0, (%rdi)
movl 0x10(%rdi), %edx
movl %edx, 0x8(%rdi)
movl %ecx, 0x4(%rax,%r10)
testl %esi, %esi
movq -0x8(%rsp), %r11
je 0x1ef7
movl 0x4b0(%rdi), %ecx
testl %ecx, %ecx
jle 0x1eb6
addl %esi, %ecx
movslq %esi, %rdi
movslq %ecx, %r8
leaq (%r11,%rax), %r9
addq $0x8, %r9
leaq (,%rdi,4), %rcx
leaq (%rcx,%rcx,2), %rdx
xorl %ecx, %ecx
movl (%r9,%rdx), %r10d
movl %r10d, (%r9)
movq -0x8(%r9,%rdx), %r10
movq %r10, -0x8(%r9)
addq $0xc, %r9
leaq (%rdi,%rcx), %r10
incq %r10
incq %rcx
cmpq %r8, %r10
jl 0x1e91
jmp 0x1eb8
xorl %ecx, %ecx
testl %esi, %esi
jle 0x1ef7
addl %ecx, %esi
movl %ecx, %edx
leaq (%rdx,%rdx,2), %rdx
addq %r11, %rax
leal 0x1(%rcx), %edi
cmpl %edi, %esi
cmovlel %edi, %esi
leaq (%rax,%rdx,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