// File: /workspace/github_cpp_makefile_star2_O3/neubig[P]egret/Egret/src/Forest.cpp
// Function: genUnaryNode_viterbi_coarse_old(ListRuleSet&, Node&)
bool genUnaryNode_viterbi_coarse_old(RuleSet& ruleSet,Node& node)
{
	bool mark=false;
	vector<string> ntPool;
	map<string,int> ntSet;
	ntPool.clear();
	ntSet.clear();
	for(Node::iterator iter=node.begin();iter!=node.end();iter++)
	{
		ntPool.push_back(iter->first);
		ntSet[iter->first]=0;
	}
	
	for(int i=0;(size_t)i<ntPool.size();i++)
	{
		string rightPart=ntPool[i];
		Label& oldLb=node[rightPart];
		//if(ruleSet.count(rightPart)==0)continue;
		pair<RuleSet::RSIter,RuleSet::RSIter> iterPair=ruleSet.query(rightPart);
		for(RuleSet::RSIter iter=iterPair.first;iter!=iterPair.second;iter++)
		{
			string leftPart=iter->second.left;
			if(ntSet.find(leftPart)==ntSet.end())
			{
				ntPool.push_back(leftPart);
				ntSet[leftPart]=0;
			}
			else if(ntSet[leftPart]!=0)continue;
			
			double ruleScore=log(iter->second.prob);
			if(node.find(leftPart)==node.end())
			{
				Label newLabel;
				newLabel.init(leftPart,oldLb.start(),oldLb.stop());
				node[leftPart]=newLabel;
			}
			//jout<<"\n"<<leftPart<<"--->add Child: "<<rightPart<<endl;
			node[leftPart].addChild_viterbi(&oldLb,ruleScore);
			ntSet[rightPart]=1;
			mark=true;
		}
	}
	return mark;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x238, %rsp            # imm = 0x238
movq %rsi, %rbx
movq %rdi, 0xc8(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, (%rsp)
xorl %eax, %eax
movq %rax, 0x10(%rsp)
leaq 0xe8(%rsp), %rcx
movl $0x0, (%rcx)
movq %rax, 0x8(%rcx)
movq %rcx, 0x10(%rcx)
movq %rcx, 0x18(%rcx)
movq %rax, 0x20(%rcx)
leaq 0xe0(%rsp), %rdi
callq 0x1517c
movq 0x18(%rbx), %r14
leaq 0x8(%rbx), %rax
movq %rax, 0x38(%rsp)
cmpq %rax, %r14
je 0x27cf5
movq %rsp, %r15
leaq 0xe0(%rsp), %r12
leaq 0x20(%r14), %r13
movq %r15, %rdi
movq %r13, %rsi
callq 0x17546
movq %r12, %rdi
movq %r13, %rsi
callq 0xb866
movl $0x0, (%rax)
movq %r14, %rdi
callq 0x31f0
movq %rax, %r14
cmpq 0x38(%rsp), %rax
jne 0x27cc3
movq (%rsp), %rax
cmpq %rax, 0x8(%rsp)
je 0x2819d
xorl %edx, %edx
leaq 0x18(%rsp), %r15
leaq 0xa8(%rsp), %r13
leaq 0x48(%rsp), %rbp
leaq 0xe0(%rsp), %r14
xorl %r12d, %r12d
movq %rdx, 0xd0(%rsp)
movq %rdx, %rcx
shlq $0x5, %rcx
leaq 0x28(%rsp), %rdx
movq %rdx, 0x18(%rsp)
movq (%rax,%rcx), %rsi
movq 0x8(%rax,%rcx), %rdx
addq %rsi, %rdx
movq %r15, %rdi
callq 0x6afc
movq %rbx, %rdi
movq %r15, %rsi
callq 0x1fdec
movq %rax, 0x40(%rsp)
leaq 0xb8(%rsp), %rax
movq %rax, 0xa8(%rsp)
movq 0x18(%rsp), %rsi
movq 0x20(%rsp), %rdx
addq %rsi, %rdx
movq %r13, %rdi
callq 0x6afc
movq 0xc8(%rsp), %rdi
movq %r13, %rsi
callq 0x3d098
movq %rax, %r15
movq %rdx, %r13
movq 0xa8(%rsp), %rdi
leaq 0xb8(%rsp), %rax
cmpq %rax, %rdi
je 0x27dc0
movq 0xb8(%rsp), %rsi
incq %rsi
callq 0x32e0
cmpq %r13, %r15
je 0x2814e
leaq 0x58(%rsp), %rax
movq %rax, 0x48(%rsp)
movq 0x40(%r15), %rsi
movq 0x48(%r15), %rdx
addq %rsi, %rdx
movq %rbp, %rdi
callq 0x6afc
movq %r14, %rdi
movq %rbp, %rsi
callq 0x2bf04
leaq 0xe8(%rsp), %rcx
cmpq %rcx, %rax
je 0x27e14
movq %r14, %rdi
movq %rbp, %rsi
callq 0xb866
cmpl $0x0, (%rax)
jne 0x2811e
jmp 0x27e30
movq %rsp, %rdi
movq %rbp, %rsi
callq 0x17546
movq %r14, %rdi
movq %rbp, %rsi
callq 0xb866
movl $0x0, (%rax)
movsd 0x80(%r15), %xmm0
callq 0x3260
movsd %xmm0, 0xd8(%rsp)
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x21d54
cmpq 0x38(%rsp), %rax
jne 0x280e7
leaq 0x120(%rsp), %rdi
callq 0x1fe68
leaq 0x98(%rsp), %rax
movq %rax, 0x88(%rsp)
movq 0x48(%rsp), %rsi
movq 0x50(%rsp), %rdx
addq %rsi, %rdx
leaq 0x88(%rsp), %rdi
callq 0x6afc
movq 0x40(%rsp), %rax
movsd 0x48(%rax), %xmm0
movaps %xmm0, 0x110(%rsp)
leaq 0x78(%rsp), %rax
movq %rax, 0x68(%rsp)
leaq 0x68(%rsp), %rdi
leaq 0x18ffa(%rip), %rdx     # 0x40eb6
movq %rdx, %rsi
callq 0xb7d0
leaq 0x128(%rsp), %rdi
leaq 0x88(%rsp), %rsi
callq 0x3150
movaps 0x110(%rsp), %xmm0
movlps %xmm0, 0x168(%rsp)
leaq 0x148(%rsp), %rdi
leaq 0x68(%rsp), %rsi
callq 0x3150
movq 0x68(%rsp), %rdi
leaq 0x78(%rsp), %rax
cmpq %rax, %rdi
je 0x27f17
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x32e0
movq 0x88(%rsp), %rdi
leaq 0x98(%rsp), %rax
cmpq %rax, %rdi
je 0x27f3c
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x32e0
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x1fdec
movq %rax, %r12
movb 0x120(%rsp), %al
movb %al, (%r12)
leaq 0x8(%r12), %rdi
leaq 0x128(%rsp), %rsi
callq 0x3150
leaq 0x28(%r12), %rdi
leaq 0x148(%rsp), %rsi
callq 0x3150
leaq 0x128(%rsp), %rcx
movb 0x48(%rcx), %al
movb %al, 0x50(%r12)
movq 0x40(%rcx), %rax
movq %rax, 0x48(%r12)
leaq 0x58(%r12), %rdi
leaq 0x178(%rsp), %rsi
callq 0x20524
leaq 0x70(%r12), %rdi
leaq 0x190(%rsp), %rsi
callq 0x20524
leaq 0x88(%r12), %rdi
leaq 0x1a8(%rsp), %rsi
callq 0x213d0
leaq 0x128(%rsp), %rax
movups 0xb0(%rax), %xmm0
movups %xmm0, 0xb8(%r12)
leaq 0xc8(%r12), %rdi
leaq 0x1e8(%rsp), %rsi
callq 0x208ac
leaq 0x128(%rsp), %rax
movups 0xd8(%rax), %xmm0
movups %xmm0, 0xe0(%r12)
movq %r12, %rdi
addq $0xf0, %rdi
leaq 0x210(%rsp), %rsi
callq 0x2123a
leaq 0x128(%rsp), %rcx
movl 0x108(%rcx), %eax
movl %eax, 0x110(%r12)
movq 0x100(%rcx), %rax
movq %rax, 0x108(%r12)
leaq 0x210(%rsp), %rdi
callq 0x1cee0
movq 0x1e8(%rsp), %rdi
testq %rdi, %rdi
je 0x28076
movq 0x1f8(%rsp), %rsi
subq %rdi, %rsi
callq 0x32e0
leaq 0x1a8(%rsp), %rdi
callq 0x1cf88
leaq 0x190(%rsp), %rdi
callq 0x1cf34
leaq 0x178(%rsp), %rdi
callq 0x1cf34
movq 0x148(%rsp), %rdi
leaq 0x158(%rsp), %rax
cmpq %rax, %rdi
je 0x280c2
movq 0x158(%rsp), %rsi
incq %rsi
callq 0x32e0
movq 0x128(%rsp), %rdi
leaq 0x138(%rsp), %rax
cmpq %rax, %rdi
je 0x280e7
movq 0x138(%rsp), %rsi
incq %rsi
callq 0x32e0
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x1fdec
movq %rax, %rdi
movq 0x40(%rsp), %rsi
movsd 0xd8(%rsp), %xmm0
callq 0x2d28e
movq %r14, %rdi
leaq 0x18(%rsp), %rsi
callq 0xb866
movl $0x1, (%rax)
movb $0x1, %r12b
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0x2813a
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x32e0
movq %r15, %rdi
callq 0x31f0
movq %rax, %r15
cmpq %r13, %rax
jne 0x27dc9
movq 0x18(%rsp), %rdi
leaq 0x28(%rsp), %rax
cmpq %rax, %rdi
je 0x2816a
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x32e0
movq 0xd0(%rsp), %rdx
incq %rdx
movq (%rsp), %rax
movq 0x8(%rsp), %rcx
subq %rax, %rcx
sarq $0x5, %rcx
cmpq %rdx, %rcx
leaq 0x18(%rsp), %r15
leaq 0xa8(%rsp), %r13
ja 0x27d23
jmp 0x281a0
xorl %r12d, %r12d
leaq 0xe0(%rsp), %rdi
callq 0x10d92
movq %rsp, %rdi
callq 0x6186
andb $0x1, %r12b
movl %r12d, %eax
addq $0x238, %rsp            # imm = 0x238
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x28203
jmp 0x2825a
jmp 0x2825a
movq %rax, %rbx
movq 0xa8(%rsp), %rdi
leaq 0xb8(%rsp), %rax
cmpq %rax, %rdi
je 0x28294
movq 0xb8(%rsp), %rsi
jmp 0x2828c
movq %rax, %rbx
jmp 0x282b0
movq %rax, %rbx
jmp 0x28231
jmp 0x28263
movq %rax, %rbx
movq 0x68(%rsp), %rdi
leaq 0x78(%rsp), %rax
cmpq %rax, %rdi
je 0x28231
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x32e0
movq 0x88(%rsp), %rdi
leaq 0x98(%rsp), %rax
cmpq %rax, %rdi
je 0x2826b
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x32e0
jmp 0x2826b
jmp 0x28263
movq %rax, %rbx
jmp 0x28294
jmp 0x28263
jmp 0x28263
movq %rax, %rbx
jmp 0x28278
movq %rax, %rbx
leaq 0x120(%rsp), %rdi
callq 0x2025c
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0x28294
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x32e0
movq 0x18(%rsp), %rdi
leaq 0x28(%rsp), %rax
cmpq %rax, %rdi
je 0x282b0
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x32e0
leaq 0xe0(%rsp), %rdi
callq 0x10d92
movq %rsp, %rdi
callq 0x6186
movq %rbx, %rdi
callq 0x3530