// File: neubig[P]egret/Egret/src/Forest.cpp
// Function: genUnaryNode_io(ListRuleSet&, Node&)
bool genUnaryNode_io(RuleSet& ruleSet,Node& node)
{
	bool mark=false;
	vector<string> ntPool;
	ntPool.clear();
	node.setUnaryInOrder(ruleSet,ntPool);
	
	for(int i=0;(size_t)i<ntPool.size();i++)
	{
		string rightPart=ntPool[i];
		Label& oldLb=node[rightPart];
		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(node.find(leftPart)==node.end())
			{
				ntPool.push_back(leftPart);
				Label newLabel;
				newLabel.init(leftPart,oldLb.start(),oldLb.stop());
				node[leftPart]=newLabel;
			}
			double ruleScore=iter->second.prob;
			//cerr<<"\n"<<leftPart<<"--->add Child: "<<rightPart<<endl;
			node[leftPart].addChild_io(&oldLb,ruleScore);
			mark=true;
		}
	}
	return mark;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x2a0, %rsp            # imm = 0x2A0
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movb $0x0, -0x11(%rbp)
leaq -0x30(%rbp), %rdi
movq %rdi, -0x248(%rbp)
callq 0x8340
movq -0x248(%rbp), %rdi
callq 0x8360
movq -0x248(%rbp), %rdx
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rsi
callq 0x77990
jmp 0x5c619
movl $0x0, -0x40(%rbp)
movslq -0x40(%rbp), %rax
movq %rax, -0x250(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x87f0
movq %rax, %rcx
movq -0x250(%rbp), %rax
cmpq %rcx, %rax
jae 0x5c9f2
movslq -0x40(%rbp), %rsi
leaq -0x30(%rbp), %rdi
callq 0x8810
movq %rax, %rsi
leaq -0x60(%rbp), %rdi
callq 0x4160
jmp 0x5c662
movq -0x10(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0x4b350
movq %rax, -0x258(%rbp)
jmp 0x5c678
movq -0x258(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x260(%rbp)
leaq -0x98(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0x4160
jmp 0x5c6a0
movq -0x260(%rbp), %rdi
leaq -0x98(%rbp), %rsi
callq 0x89570
movq %rdx, -0x270(%rbp)
movq %rax, -0x268(%rbp)
jmp 0x5c6c3
movq -0x270(%rbp), %rax
movq -0x268(%rbp), %rcx
movq %rcx, -0x78(%rbp)
movq %rax, -0x70(%rbp)
leaq -0x98(%rbp), %rdi
callq 0x4728
movq -0x78(%rbp), %rax
movq %rax, -0xa0(%rbp)
leaq -0x78(%rbp), %rsi
addq $0x8, %rsi
leaq -0xa0(%rbp), %rdi
callq 0x5e510
testb $0x1, %al
jne 0x5c70d
jmp 0x5c9d0
leaq -0xa0(%rbp), %rdi
callq 0x5e540
movq %rax, %rsi
addq $0x20, %rsi
leaq -0xc0(%rbp), %rdi
callq 0x4160
jmp 0x5c72e
movq -0x10(%rbp), %rdi
leaq -0xc0(%rbp), %rsi
callq 0x4b7a0
movq %rax, -0x278(%rbp)
jmp 0x5c747
movq -0x278(%rbp), %rax
movq %rax, -0xc8(%rbp)
movq -0x10(%rbp), %rdi
callq 0x4b7f0
movq %rax, -0xd0(%rbp)
leaq -0xc8(%rbp), %rdi
leaq -0xd0(%rbp), %rsi
callq 0x4b770
testb $0x1, %al
jne 0x5c781
jmp 0x5c94a
leaq -0x30(%rbp), %rdi
leaq -0xc0(%rbp), %rsi
callq 0x37000
jmp 0x5c793
leaq -0x1e8(%rbp), %rdi
callq 0x4b470
jmp 0x5c7a1
leaq -0x208(%rbp), %rdi
leaq -0xc0(%rbp), %rsi
callq 0x4160
jmp 0x5c7b6
movq -0x68(%rbp), %rdi
callq 0x4b730
movl %eax, -0x27c(%rbp)
jmp 0x5c7c7
movq -0x68(%rbp), %rdi
callq 0x4b750
movl %eax, -0x280(%rbp)
jmp 0x5c7d8
leaq -0x229(%rbp), %rdi
movq %rdi, -0x288(%rbp)
callq 0x4660
movq -0x288(%rbp), %rdx
leaq 0x3465d(%rip), %rsi     # 0x90e56
leaq -0x228(%rbp), %rdi
callq 0x1c730
jmp 0x5c807
movl -0x280(%rbp), %ecx
movl -0x27c(%rbp), %edx
leaq -0x1e8(%rbp), %rdi
leaq -0x208(%rbp), %rsi
leaq -0x228(%rbp), %r8
callq 0x5e570
jmp 0x5c82f
leaq -0x228(%rbp), %rdi
callq 0x4728
leaq -0x229(%rbp), %rdi
callq 0x43f0
leaq -0x208(%rbp), %rdi
callq 0x4728
movq -0x10(%rbp), %rdi
leaq -0xc0(%rbp), %rsi
callq 0x4b350
movq %rax, -0x290(%rbp)
jmp 0x5c86c
movq -0x290(%rbp), %rdi
leaq -0x1e8(%rbp), %rsi
callq 0x4b820
jmp 0x5c881
leaq -0x1e8(%rbp), %rdi
callq 0x46ba0
jmp 0x5c94a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x5ca15
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x5c9e7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x98(%rbp), %rdi
callq 0x4728
jmp 0x5c9e7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x5c9c2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x5c93c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x5c930
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x5c924
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x228(%rbp), %rdi
callq 0x4728
leaq -0x229(%rbp), %rdi
callq 0x43f0
leaq -0x208(%rbp), %rdi
callq 0x4728
leaq -0x1e8(%rbp), %rdi
callq 0x46ba0
jmp 0x5c9c2
leaq -0xa0(%rbp), %rdi
callq 0x5e540
movsd 0x60(%rax), %xmm0
movsd %xmm0, -0x238(%rbp)
movq -0x10(%rbp), %rdi
leaq -0xc0(%rbp), %rsi
callq 0x4b350
movq %rax, -0x298(%rbp)
jmp 0x5c97c
movq -0x298(%rbp), %rdi
movq -0x68(%rbp), %rsi
movsd -0x238(%rbp), %xmm0
xorl %edx, %edx
callq 0x682d0
jmp 0x5c998
movb $0x1, -0x11(%rbp)
leaq -0xc0(%rbp), %rdi
callq 0x4728
leaq -0xa0(%rbp), %rdi
xorl %esi, %esi
callq 0x5e5d0
movq %rax, -0x240(%rbp)
jmp 0x5c6f0
leaq -0xc0(%rbp), %rdi
callq 0x4728
jmp 0x5c9e7
leaq -0x60(%rbp), %rdi
callq 0x4728
movl -0x40(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x40(%rbp)
jmp 0x5c620
leaq -0x60(%rbp), %rdi
callq 0x4728
jmp 0x5ca15
movb -0x11(%rbp), %al
movb %al, -0x299(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x8830
movb -0x299(%rbp), %al
andb $0x1, %al
addq $0x2a0, %rsp            # imm = 0x2A0
popq %rbp
retq
leaq -0x30(%rbp), %rdi
callq 0x8830
movq -0x38(%rbp), %rdi
callq 0x4650
nopw (%rax,%rax)