// File: /workspace/github_cpp_makefile_star2_O2/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 $0x248, %rsp            # imm = 0x248
movq %rsi, %rbx
movq %rdi, 0x40(%rsp)
xorps %xmm0, %xmm0
leaq 0x20(%rsp), %r14
movaps %xmm0, (%r14)
andq $0x0, 0x10(%r14)
leaq 0x68(%rsp), %rax
andl $0x0, (%rax)
andq $0x0, 0x8(%rax)
movq %rax, 0x10(%rax)
movq %rax, 0x18(%rax)
andq $0x0, 0x20(%rax)
movq %r14, %rdi
callq 0x515e
leaq 0x60(%rsp), %r15
movq %r15, %rdi
callq 0x1101c
movq 0x18(%rbx), %r12
movq %rbx, 0x8(%rsp)
leaq 0x8(%rbx), %rax
movq %rax, 0x10(%rsp)
cmpq 0x10(%rsp), %r12
je 0x1f9e4
leaq 0x20(%r12), %rbx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x129cc
movq %r15, %rdi
movq %rbx, %rsi
callq 0xa262
andl $0x0, (%rax)
movq %r12, %rdi
callq 0x3210
movq %rax, %r12
jmp 0x1f9b2
xorl %ecx, %ecx
leaq 0xb0(%rsp), %rbx
leaq 0xf0(%rsp), %r15
leaq 0x90(%rsp), %r13
leaq 0x130(%rsp), %rbp
xorl %r14d, %r14d
movq 0x20(%rsp), %rsi
movq 0x28(%rsp), %rax
subq %rsi, %rax
sarq $0x5, %rax
cmpq %rcx, %rax
jbe 0x1fc19
movq %rcx, 0x48(%rsp)
movq %rcx, %rax
shlq $0x5, %rax
addq %rax, %rsi
movq %rbx, %rdi
callq 0x33c0
movq 0x8(%rsp), %rdi
movq %rbx, %rsi
callq 0x19b24
movq %rax, 0x18(%rsp)
movq %r15, %rdi
movq %rbx, %rsi
callq 0x33c0
movq 0x40(%rsp), %rdi
movq %r15, %rsi
callq 0x2f88a
movq %rdx, 0x50(%rsp)
movq %rax, %r12
movq %r15, %rdi
callq 0x3578
cmpq 0x50(%rsp), %r12
je 0x1fbf4
leaq 0x40(%r12), %rsi
movq %r13, %rdi
callq 0x33c0
leaq 0x60(%rsp), %rdi
movq %r13, %rsi
callq 0x22d1e
leaq 0x68(%rsp), %rcx
cmpq %rcx, %rax
je 0x1fabb
leaq 0x60(%rsp), %rdi
movq %r13, %rsi
callq 0xa262
cmpl $0x0, (%rax)
jne 0x1fbdc
jmp 0x1fad8
leaq 0x20(%rsp), %rdi
movq %r13, %rsi
callq 0x129cc
leaq 0x60(%rsp), %rdi
movq %r13, %rsi
callq 0xa262
andl $0x0, (%rax)
movsd 0x80(%r12), %xmm0
callq 0x3280
movsd %xmm0, 0x58(%rsp)
movq 0x8(%rsp), %rdi
movq %r13, %rsi
callq 0x1b8b0
cmpq 0x10(%rsp), %rax
jne 0x1fba1
movq %rbp, %rdi
callq 0x19b8a
leaq 0xd0(%rsp), %rdi
movq %r13, %rsi
callq 0x33c0
movq %rbp, %r14
movq 0x18(%rsp), %rax
movl 0x48(%rax), %ebx
movl 0x4c(%rax), %ebp
leaq 0x110(%rsp), %r13
movq %r13, %rdi
leaq 0x13379(%rip), %rsi     # 0x32eb6
leaq 0x7(%rsp), %rdx
callq 0x9f86
movq %r14, %rdi
leaq 0xd0(%rsp), %r15
movq %r15, %rsi
movl %ebx, %edx
movl %ebp, %ecx
movq %r13, %r8
callq 0x21310
movq %r13, %rdi
callq 0x3578
movq %r15, %rdi
callq 0x3578
movq 0x8(%rsp), %rdi
leaq 0x90(%rsp), %rsi
callq 0x19b24
movq %r14, %rbp
movq %rax, %rdi
movq %r14, %rsi
callq 0x19d82
movq %rbp, %rdi
callq 0x17b24
leaq 0x90(%rsp), %r13
movq 0x8(%rsp), %rdi
movq %r13, %rsi
callq 0x19b24
movq %rax, %rdi
movq 0x18(%rsp), %rsi
movsd 0x58(%rsp), %xmm0
callq 0x23c76
leaq 0x60(%rsp), %rdi
leaq 0xb0(%rsp), %rsi
callq 0xa262
movl $0x1, (%rax)
movb $0x1, %r14b
movq %r13, %rdi
callq 0x3578
movq %r12, %rdi
callq 0x3210
movq %rax, %r12
jmp 0x1fa74
leaq 0xb0(%rsp), %rbx
movq %rbx, %rdi
callq 0x3578
movq 0x48(%rsp), %rcx
incq %rcx
leaq 0xf0(%rsp), %r15
jmp 0x1fa09
leaq 0x60(%rsp), %rdi
callq 0xd1fa
leaq 0x20(%rsp), %rdi
callq 0x5166
andb $0x1, %r14b
movl %r14d, %eax
addq $0x248, %rsp            # imm = 0x248
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x1fc59
movq %rax, %rbx
leaq 0xf0(%rsp), %rdi
jmp 0x1fcac
jmp 0x1fc9a
jmp 0x1fc9a
movq %rax, %rbx
jmp 0x1fcbe
movq %rax, %rbx
leaq 0x110(%rsp), %rdi
callq 0x3578
jmp 0x1fc73
movq %rax, %rbx
leaq 0xd0(%rsp), %rdi
callq 0x3578
jmp 0x1fc89
jmp 0x1fca1
jmp 0x1fca1
movq %rax, %rbx
leaq 0x130(%rsp), %rdi
callq 0x17b24
jmp 0x1fca4
jmp 0x1fca1
movq %rax, %rbx
jmp 0x1fcb1
jmp 0x1fca1
movq %rax, %rbx
leaq 0x90(%rsp), %rdi
callq 0x3578
leaq 0xb0(%rsp), %rdi
callq 0x3578
leaq 0x60(%rsp), %rdi
callq 0xd1fa
leaq 0x20(%rsp), %rdi
callq 0x5166
movq %rbx, %rdi
callq 0x34f0