// File: /workspace/github_cpp_makefile_star2_O3/neubig[P]egret/Egret/src/Forest.cpp
// Function: genUnaryNode_viterbi_old(ListRuleSet&, Node&)
bool genUnaryNode_viterbi_old(RuleSet& ruleSet,Node& node)
{
	bool mark=false;
	clock_t sec=clock();
	node.setUnaryInOrder(ruleSet);
	setutime+=clock()-sec;
	vector<LabelAndFamily>& uio=node.unaryInOrder();
	for(int i=0;(size_t)i<uio.size();i++)
	{
		LabelAndFamily& laf=uio[i];
		Label& oldLb=node[laf.term()];
		string rightPart=oldLb.nt();
		if(ruleSet.count(rightPart)>0)
		{
			int count=0;
			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(laf.ancestor().count(leftPart)>0)
				{
					double ruleScore=log(iter->second.prob);
					if(node.find(leftPart)==node.end())
					{
						Label newLabel;
						newLabel.init(leftPart,oldLb.start(),oldLb.stop());
						node[leftPart]=newLabel;
					}
					//cout<<"\n"<<leftPart<<"--->add Child: "<<rightPart<<endl;
					node[leftPart].addChild_viterbi(&oldLb,ruleScore);
					mark=true;
				}
			}
		}
	}
	return mark;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x208, %rsp            # imm = 0x208
movq %rsi, %rbx
movq %rdi, %r15
callq 0x31c0
movq %rax, %r14
movq %rbx, %rdi
movq %r15, %rsi
callq 0x350c8
callq 0x31c0
subq %r14, %rax
leaq 0x2e2c3(%rip), %rcx     # 0x55358
addq %rax, (%rcx)
movq 0x30(%rbx), %rax
cmpq %rax, 0x38(%rbx)
je 0x2751d
leaq 0x8(%r15), %rcx
movq %rcx, 0xb8(%rsp)
leaq 0x8(%rbx), %rcx
movq %rcx, 0xc8(%rsp)
xorl %ebp, %ebp
leaq 0x10(%rsp), %r13
xorl %r14d, %r14d
movq %r15, 0xb0(%rsp)
movq %rbp, 0xc0(%rsp)
shlq $0x7, %rbp
addq %rax, %rbp
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x1fdec
movq %rax, %rcx
leaq 0x40(%rsp), %rax
movq %rax, 0x30(%rsp)
movq 0x8(%rcx), %rsi
movq %rcx, 0x8(%rsp)
movq 0x10(%rcx), %rdx
addq %rsi, %rdx
leaq 0x30(%rsp), %r12
movq %r12, %rdi
callq 0x6afc
movq %r15, %rdi
movq %r12, %rsi
callq 0x2bdf0
cmpq 0xb8(%rsp), %rax
leaq 0x90(%rsp), %r12
je 0x274d4
leaq 0xa0(%rsp), %rax
movq %rax, 0x90(%rsp)
movq 0x30(%rsp), %rsi
movq 0x38(%rsp), %rdx
addq %rsi, %rdx
movq %r12, %rdi
callq 0x6afc
movq %r15, %rdi
movq %r12, %rsi
callq 0x3d098
movq %rax, %r15
movq %rdx, %r12
movq 0x90(%rsp), %rdi
leaq 0xa0(%rsp), %rax
cmpq %rax, %rdi
je 0x27190
movq 0xa0(%rsp), %rsi
incq %rsi
callq 0x32e0
cmpq %r12, %r15
je 0x274d4
leaq 0x20(%rbp), %rax
movq %rax, 0xd0(%rsp)
addq $0x28, %rbp
leaq 0x20(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x40(%r15), %rsi
movq 0x48(%r15), %rdx
addq %rsi, %rdx
movq %r13, %rdi
callq 0x6afc
movq 0xd0(%rsp), %rdi
movq %r13, %rsi
callq 0x2be7a
cmpq %rbp, %rax
je 0x274a4
movsd 0x80(%r15), %xmm0
callq 0x3260
movsd %xmm0, 0xd8(%rsp)
movq %rbx, %rdi
movq %r13, %rsi
callq 0x21d54
cmpq 0xc8(%rsp), %rax
jne 0x27480
leaq 0xf0(%rsp), %rdi
callq 0x1fe68
leaq 0x80(%rsp), %rax
movq %rax, 0x70(%rsp)
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rdx
addq %rsi, %rdx
leaq 0x70(%rsp), %rdi
callq 0x6afc
movq 0x8(%rsp), %rax
movsd 0x48(%rax), %xmm0
movaps %xmm0, 0xe0(%rsp)
leaq 0x60(%rsp), %rax
movq %rax, 0x50(%rsp)
leaq 0x50(%rsp), %rdi
leaq 0x19c4e(%rip), %rdx     # 0x40eb6
movq %rdx, %rsi
callq 0xb7d0
leaq 0xf8(%rsp), %rdi
leaq 0x70(%rsp), %rsi
callq 0x3150
movaps 0xe0(%rsp), %xmm0
movlps %xmm0, 0x138(%rsp)
leaq 0x118(%rsp), %rdi
leaq 0x50(%rsp), %rsi
callq 0x3150
movq 0x50(%rsp), %rdi
leaq 0x60(%rsp), %rax
cmpq %rax, %rdi
je 0x272c0
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x32e0
movq 0x70(%rsp), %rdi
leaq 0x80(%rsp), %rax
cmpq %rax, %rdi
je 0x272e2
movq 0x80(%rsp), %rsi
incq %rsi
callq 0x32e0
movq %rbx, %rdi
movq %r13, %rsi
callq 0x1fdec
movq %rax, %r14
movb 0xf0(%rsp), %al
movb %al, (%r14)
leaq 0x8(%r14), %rdi
leaq 0xf8(%rsp), %rsi
callq 0x3150
leaq 0x28(%r14), %rdi
leaq 0x118(%rsp), %rsi
callq 0x3150
leaq 0xf8(%rsp), %rcx
movb 0x48(%rcx), %al
movb %al, 0x50(%r14)
movq 0x40(%rcx), %rax
movq %rax, 0x48(%r14)
leaq 0x58(%r14), %rdi
leaq 0x148(%rsp), %rsi
callq 0x20524
leaq 0x70(%r14), %rdi
leaq 0x160(%rsp), %rsi
callq 0x20524
leaq 0x88(%r14), %rdi
leaq 0x178(%rsp), %rsi
callq 0x213d0
leaq 0xf8(%rsp), %rax
movups 0xb0(%rax), %xmm0
movups %xmm0, 0xb8(%r14)
leaq 0xc8(%r14), %rdi
leaq 0x1b8(%rsp), %rsi
callq 0x208ac
leaq 0xf8(%rsp), %rax
movups 0xd8(%rax), %xmm0
movups %xmm0, 0xe0(%r14)
movq %r14, %rdi
addq $0xf0, %rdi
leaq 0x1e0(%rsp), %rsi
callq 0x2123a
leaq 0xf8(%rsp), %rcx
movl 0x108(%rcx), %eax
movl %eax, 0x110(%r14)
movq 0x100(%rcx), %rax
movq %rax, 0x108(%r14)
leaq 0x1e0(%rsp), %rdi
callq 0x1cee0
movq 0x1b8(%rsp), %rdi
testq %rdi, %rdi
je 0x2740f
movq 0x1c8(%rsp), %rsi
subq %rdi, %rsi
callq 0x32e0
leaq 0x178(%rsp), %rdi
callq 0x1cf88
leaq 0x160(%rsp), %rdi
callq 0x1cf34
leaq 0x148(%rsp), %rdi
callq 0x1cf34
movq 0x118(%rsp), %rdi
leaq 0x128(%rsp), %rax
cmpq %rax, %rdi
je 0x2745b
movq 0x128(%rsp), %rsi
incq %rsi
callq 0x32e0
movq 0xf8(%rsp), %rdi
leaq 0x108(%rsp), %rax
cmpq %rax, %rdi
je 0x27480
movq 0x108(%rsp), %rsi
incq %rsi
callq 0x32e0
movq %rbx, %rdi
movq %r13, %rsi
callq 0x1fdec
movb $0x1, %r14b
movq %rax, %rdi
movq 0x8(%rsp), %rsi
movsd 0xd8(%rsp), %xmm0
callq 0x2d28e
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x274c0
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x32e0
movq %r15, %rdi
callq 0x31f0
movq %rax, %r15
cmpq %r12, %rax
jne 0x271a9
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0x274f0
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x32e0
movq 0xc0(%rsp), %rbp
incq %rbp
movq 0x30(%rbx), %rax
movq 0x38(%rbx), %rcx
subq %rax, %rcx
sarq $0x7, %rcx
cmpq %rbp, %rcx
movq 0xb0(%rsp), %r15
ja 0x270d0
jmp 0x27520
xorl %r14d, %r14d
andb $0x1, %r14b
movl %r14d, %eax
addq $0x208, %rsp            # imm = 0x208
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x275af
movq %rax, %rbx
movq 0x90(%rsp), %rdi
leaq 0xa0(%rsp), %rax
cmpq %rax, %rdi
je 0x275e7
movq 0xa0(%rsp), %rsi
jmp 0x275df
jmp 0x275af
movq %rax, %rbx
jmp 0x27589
jmp 0x275b6
movq %rax, %rbx
movq 0x50(%rsp), %rdi
leaq 0x60(%rsp), %rax
cmpq %rax, %rdi
je 0x27589
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x32e0
movq 0x70(%rsp), %rdi
leaq 0x80(%rsp), %rax
cmpq %rax, %rdi
je 0x275be
movq 0x80(%rsp), %rsi
incq %rsi
callq 0x32e0
jmp 0x275be
jmp 0x275b6
movq %rax, %rbx
jmp 0x275e7
jmp 0x275b6
movq %rax, %rbx
jmp 0x275cb
movq %rax, %rbx
leaq 0xf0(%rsp), %rdi
callq 0x2025c
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x275e7
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x32e0
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0x27603
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x32e0
movq %rbx, %rdi
callq 0x3530