// File: neubig[P]egret/Egret/src/Forest.cpp
// Function: genUnaryNode_io_old(ListRuleSet&, Node&)
bool genUnaryNode_io_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=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_io(&oldLb,ruleScore);
					mark=true;
				}
			}
		}
	}
	return mark;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x2c0, %rsp            # imm = 0x2C0
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movb $0x0, -0x11(%rbp)
callq 0x4250
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rsi
callq 0x76d40
callq 0x4250
movq %rax, %rcx
subq -0x20(%rbp), %rcx
leaq 0x732d8(%rip), %rax     # 0xcf428
addq (%rax), %rcx
leaq 0x732ce(%rip), %rax     # 0xcf428
movq %rcx, (%rax)
movq -0x10(%rbp), %rdi
callq 0x5e610
movq %rax, -0x28(%rbp)
movl $0x0, -0x2c(%rbp)
movslq -0x2c(%rbp), %rax
movq %rax, -0x250(%rbp)
movq -0x28(%rbp), %rdi
callq 0x5e630
movq %rax, %rcx
movq -0x250(%rbp), %rax
cmpq %rcx, %rax
jae 0x5c5aa
movq -0x28(%rbp), %rdi
movslq -0x2c(%rbp), %rsi
callq 0x5e650
movq %rax, -0x38(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x268(%rbp)
movq -0x38(%rbp), %rdi
callq 0x5e670
movq -0x268(%rbp), %rdi
movq %rax, %rsi
callq 0x4b350
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rdi
callq 0x4b7d0
movq %rax, %rsi
leaq -0x60(%rbp), %rdi
movq %rdi, -0x260(%rbp)
callq 0x4160
movq -0x260(%rbp), %rsi
movq -0x8(%rbp), %rdi
callq 0x5e4b0
movq %rax, -0x258(%rbp)
jmp 0x5c205
movq -0x258(%rbp), %rax
cmpq $0x0, %rax
jbe 0x5c588
movl $0x0, -0x70(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x270(%rbp)
leaq -0xa0(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0x4160
jmp 0x5c23a
movq -0x270(%rbp), %rdi
leaq -0xa0(%rbp), %rsi
callq 0x89570
movq %rdx, -0x280(%rbp)
movq %rax, -0x278(%rbp)
jmp 0x5c25d
movq -0x280(%rbp), %rax
movq -0x278(%rbp), %rcx
movq %rcx, -0x80(%rbp)
movq %rax, -0x78(%rbp)
leaq -0xa0(%rbp), %rdi
callq 0x4728
movq -0x80(%rbp), %rax
movq %rax, -0xa8(%rbp)
leaq -0x80(%rbp), %rsi
addq $0x8, %rsi
leaq -0xa8(%rbp), %rdi
callq 0x5e510
testb $0x1, %al
jne 0x5c2a7
jmp 0x5c586
leaq -0xa8(%rbp), %rdi
callq 0x5e540
movq %rax, %rsi
addq $0x20, %rsi
leaq -0xc8(%rbp), %rdi
callq 0x4160
jmp 0x5c2c8
movq -0x38(%rbp), %rdi
callq 0x5e680
movq %rax, -0x288(%rbp)
jmp 0x5c2da
movq -0x288(%rbp), %rdi
leaq -0xc8(%rbp), %rsi
callq 0x5e6a0
movq %rax, -0x290(%rbp)
jmp 0x5c2f6
movq -0x290(%rbp), %rax
cmpq $0x0, %rax
jbe 0x5c552
leaq -0xa8(%rbp), %rdi
callq 0x5e540
movsd 0x60(%rax), %xmm0
movsd %xmm0, -0xd0(%rbp)
movq -0x10(%rbp), %rdi
leaq -0xc8(%rbp), %rsi
callq 0x4b7a0
movq %rax, -0x298(%rbp)
jmp 0x5c339
movq -0x298(%rbp), %rax
movq %rax, -0xd8(%rbp)
movq -0x10(%rbp), %rdi
callq 0x4b7f0
movq %rax, -0xe0(%rbp)
leaq -0xd8(%rbp), %rdi
leaq -0xe0(%rbp), %rsi
callq 0x4b770
testb $0x1, %al
jne 0x5c373
jmp 0x5c519
leaq -0x1f8(%rbp), %rdi
callq 0x4b470
jmp 0x5c381
leaq -0x218(%rbp), %rdi
leaq -0xc8(%rbp), %rsi
callq 0x4160
jmp 0x5c396
movq -0x40(%rbp), %rdi
callq 0x4b730
movl %eax, -0x29c(%rbp)
jmp 0x5c3a7
movq -0x40(%rbp), %rdi
callq 0x4b750
movl %eax, -0x2a0(%rbp)
jmp 0x5c3b8
leaq -0x239(%rbp), %rdi
movq %rdi, -0x2a8(%rbp)
callq 0x4660
movq -0x2a8(%rbp), %rdx
leaq 0x34a7d(%rip), %rsi     # 0x90e56
leaq -0x238(%rbp), %rdi
callq 0x1c730
jmp 0x5c3e7
movl -0x2a0(%rbp), %ecx
movl -0x29c(%rbp), %edx
leaq -0x1f8(%rbp), %rdi
leaq -0x218(%rbp), %rsi
leaq -0x238(%rbp), %r8
callq 0x5e570
jmp 0x5c40f
leaq -0x238(%rbp), %rdi
callq 0x4728
leaq -0x239(%rbp), %rdi
callq 0x43f0
leaq -0x218(%rbp), %rdi
callq 0x4728
movq -0x10(%rbp), %rdi
leaq -0xc8(%rbp), %rsi
callq 0x4b350
movq %rax, -0x2b0(%rbp)
jmp 0x5c44c
movq -0x2b0(%rbp), %rdi
leaq -0x1f8(%rbp), %rsi
callq 0x4b820
jmp 0x5c461
leaq -0x1f8(%rbp), %rdi
callq 0x46ba0
jmp 0x5c519
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0x5c59f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0xa0(%rbp), %rdi
callq 0x4728
jmp 0x5c59f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0x5c578
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0x5c50b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0x5c4ff
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0x5c4f3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0x238(%rbp), %rdi
callq 0x4728
leaq -0x239(%rbp), %rdi
callq 0x43f0
leaq -0x218(%rbp), %rdi
callq 0x4728
leaq -0x1f8(%rbp), %rdi
callq 0x46ba0
jmp 0x5c578
movq -0x10(%rbp), %rdi
leaq -0xc8(%rbp), %rsi
callq 0x4b350
movq %rax, -0x2b8(%rbp)
jmp 0x5c532
movq -0x2b8(%rbp), %rdi
movq -0x40(%rbp), %rsi
movsd -0xd0(%rbp), %xmm0
xorl %edx, %edx
callq 0x682d0
jmp 0x5c54e
movb $0x1, -0x11(%rbp)
leaq -0xc8(%rbp), %rdi
callq 0x4728
leaq -0xa8(%rbp), %rdi
xorl %esi, %esi
callq 0x5e5d0
movq %rax, -0x248(%rbp)
jmp 0x5c28a
leaq -0xc8(%rbp), %rdi
callq 0x4728
jmp 0x5c59f
jmp 0x5c588
leaq -0x60(%rbp), %rdi
callq 0x4728
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x5c171
leaq -0x60(%rbp), %rdi
callq 0x4728
jmp 0x5c5b8
movb -0x11(%rbp), %al
andb $0x1, %al
addq $0x2c0, %rsp            # imm = 0x2C0
popq %rbp
retq
movq -0x68(%rbp), %rdi
callq 0x4650
nopw %cs:(%rax,%rax)