// File: neubig[P]egret/Egret/src/Forest.cpp
// Function: genNewNode_io(ListRuleSet&, Node&, Node&, Node&)
Node& genNewNode_io(RuleSet& ruleSet,Node& n1, Node& n2, Node& n3)
{
	clock_t sec=clock();
	for(Node::iterator n1iter=n1.begin();n1iter!=n1.end();n1iter++)
	{
		for(Node::iterator n2iter=n2.begin();n2iter!=n2.end();n2iter++)
		{
			Label& label1=n1iter->second;
			Label& label2=n2iter->second;
			string rightPart=label1.nt()+" "+label2.nt();
			if(ruleSet.count(rightPart)>0)
			{
				pair<RuleSet::RSIter,RuleSet::RSIter> iterPair=ruleSet.query(rightPart);
				for(RuleSet::RSIter iter=iterPair.first;iter!=iterPair.second;iter++)
				{
					//jout<<rightPart<<"==>"<<iter->second.left<<endl;
					double ruleScore=iter->second.prob;// when io, use the original prob
					Label label;
					label.init(iter->second.left,label1.start(),label2.stop());
					if(n3.find(label.nt())==n3.end())
						n3[label.nt()]=label;
					n3[label.nt()].addChildPair_io(&label1,&label2,ruleScore);
				}
			}
		}
	}
	inbitime+=clock()-sec;
	return n3;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x2f0, %rsp            # imm = 0x2F0
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
callq 0x4250
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rdi
callq 0x4ba50
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rdi
callq 0x4b7f0
movq %rax, -0x38(%rbp)
leaq -0x30(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x4ba80
testb $0x1, %al
jne 0x5abd4
jmp 0x5b097
movq -0x18(%rbp), %rdi
callq 0x4ba50
movq %rax, -0x40(%rbp)
movq -0x18(%rbp), %rdi
callq 0x4b7f0
movq %rax, -0x48(%rbp)
leaq -0x40(%rbp), %rdi
leaq -0x48(%rbp), %rsi
callq 0x4ba80
testb $0x1, %al
jne 0x5ac04
jmp 0x5b07e
leaq -0x30(%rbp), %rdi
callq 0x4bab0
addq $0x20, %rax
movq %rax, -0x50(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x4bab0
addq $0x20, %rax
movq %rax, -0x58(%rbp)
movq -0x50(%rbp), %rdi
callq 0x4b7d0
movq %rax, %rsi
leaq 0x36219(%rip), %rdx     # 0x90e52
leaq -0x98(%rbp), %rdi
callq 0x21540
movq -0x58(%rbp), %rdi
callq 0x4b7d0
movq %rax, -0x278(%rbp)
jmp 0x5ac57
movq -0x278(%rbp), %rdx
leaq -0x78(%rbp), %rdi
leaq -0x98(%rbp), %rsi
callq 0x214f0
jmp 0x5ac70
leaq -0x98(%rbp), %rdi
callq 0x4728
movq -0x8(%rbp), %rdi
leaq -0x78(%rbp), %rsi
callq 0x5e4b0
movq %rax, -0x280(%rbp)
jmp 0x5ac92
movq -0x280(%rbp), %rax
cmpq $0x0, %rax
jbe 0x5b053
movq -0x8(%rbp), %rax
movq %rax, -0x288(%rbp)
leaq -0xd8(%rbp), %rdi
leaq -0x78(%rbp), %rsi
callq 0x4160
jmp 0x5acc0
movq -0x288(%rbp), %rdi
leaq -0xd8(%rbp), %rsi
callq 0x89570
movq %rdx, -0x298(%rbp)
movq %rax, -0x290(%rbp)
jmp 0x5ace3
movq -0x298(%rbp), %rax
movq -0x290(%rbp), %rcx
movq %rcx, -0xb8(%rbp)
movq %rax, -0xb0(%rbp)
leaq -0xd8(%rbp), %rdi
callq 0x4728
movq -0xb8(%rbp), %rax
movq %rax, -0xe0(%rbp)
leaq -0xb8(%rbp), %rsi
addq $0x8, %rsi
leaq -0xe0(%rbp), %rdi
callq 0x5e510
testb $0x1, %al
jne 0x5ad39
jmp 0x5b051
leaq -0xe0(%rbp), %rdi
callq 0x5e540
movsd 0x60(%rax), %xmm0
movsd %xmm0, -0xe8(%rbp)
leaq -0x200(%rbp), %rdi
callq 0x4b470
jmp 0x5ad60
leaq -0xe0(%rbp), %rdi
callq 0x5e540
movq %rax, %rsi
addq $0x20, %rsi
leaq -0x220(%rbp), %rdi
callq 0x4160
jmp 0x5ad81
movq -0x50(%rbp), %rdi
callq 0x4b730
movl %eax, -0x29c(%rbp)
jmp 0x5ad92
movq -0x58(%rbp), %rdi
callq 0x4b750
movl %eax, -0x2a0(%rbp)
jmp 0x5ada3
leaq -0x241(%rbp), %rdi
movq %rdi, -0x2a8(%rbp)
callq 0x4660
movq -0x2a8(%rbp), %rdx
leaq 0x36092(%rip), %rsi     # 0x90e56
leaq -0x240(%rbp), %rdi
callq 0x1c730
jmp 0x5add2
movl -0x2a0(%rbp), %ecx
movl -0x29c(%rbp), %edx
leaq -0x200(%rbp), %rdi
leaq -0x220(%rbp), %rsi
leaq -0x240(%rbp), %r8
callq 0x5e570
jmp 0x5adfa
leaq -0x240(%rbp), %rdi
callq 0x4728
leaq -0x241(%rbp), %rdi
callq 0x43f0
leaq -0x220(%rbp), %rdi
callq 0x4728
movq -0x20(%rbp), %rax
movq %rax, -0x2b8(%rbp)
leaq -0x200(%rbp), %rdi
callq 0x4b7d0
movq %rax, -0x2b0(%rbp)
jmp 0x5ae3e
movq -0x2b0(%rbp), %rsi
movq -0x2b8(%rbp), %rdi
callq 0x4b7a0
movq %rax, -0x2c0(%rbp)
jmp 0x5ae5a
movq -0x2c0(%rbp), %rax
movq %rax, -0x250(%rbp)
movq -0x20(%rbp), %rdi
callq 0x4b7f0
movq %rax, -0x258(%rbp)
leaq -0x250(%rbp), %rdi
leaq -0x258(%rbp), %rsi
callq 0x4b770
testb $0x1, %al
jne 0x5ae94
jmp 0x5afc1
movq -0x20(%rbp), %rax
movq %rax, -0x2d0(%rbp)
leaq -0x200(%rbp), %rdi
callq 0x4b7d0
movq %rax, -0x2c8(%rbp)
jmp 0x5aeb4
movq -0x2c8(%rbp), %rsi
movq -0x2d0(%rbp), %rdi
callq 0x4b350
movq %rax, -0x2d8(%rbp)
jmp 0x5aed0
movq -0x2d8(%rbp), %rdi
leaq -0x200(%rbp), %rsi
callq 0x4b820
jmp 0x5aee5
jmp 0x5afc1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa0(%rbp)
movl %eax, -0xa4(%rbp)
leaq -0x98(%rbp), %rdi
callq 0x4728
jmp 0x5b0c4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa0(%rbp)
movl %eax, -0xa4(%rbp)
jmp 0x5b073
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa0(%rbp)
movl %eax, -0xa4(%rbp)
leaq -0xd8(%rbp), %rdi
callq 0x4728
jmp 0x5b073
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa0(%rbp)
movl %eax, -0xa4(%rbp)
jmp 0x5b043
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa0(%rbp)
movl %eax, -0xa4(%rbp)
jmp 0x5afb0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa0(%rbp)
movl %eax, -0xa4(%rbp)
jmp 0x5afa4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa0(%rbp)
movl %eax, -0xa4(%rbp)
leaq -0x240(%rbp), %rdi
callq 0x4728
leaq -0x241(%rbp), %rdi
callq 0x43f0
leaq -0x220(%rbp), %rdi
callq 0x4728
jmp 0x5b043
movq -0x20(%rbp), %rax
movq %rax, -0x2e8(%rbp)
leaq -0x200(%rbp), %rdi
callq 0x4b7d0
movq %rax, -0x2e0(%rbp)
jmp 0x5afe1
movq -0x2e0(%rbp), %rsi
movq -0x2e8(%rbp), %rdi
callq 0x4b350
movq %rax, -0x2f0(%rbp)
jmp 0x5affd
movq -0x2f0(%rbp), %rdi
movq -0x50(%rbp), %rsi
movq -0x58(%rbp), %rdx
movsd -0xe8(%rbp), %xmm0
xorl %ecx, %ecx
callq 0x684e0
jmp 0x5b01d
leaq -0x200(%rbp), %rdi
callq 0x46ba0
leaq -0xe0(%rbp), %rdi
xorl %esi, %esi
callq 0x5e5d0
movq %rax, -0x260(%rbp)
jmp 0x5ad19
leaq -0x200(%rbp), %rdi
callq 0x46ba0
jmp 0x5b073
jmp 0x5b053
leaq -0x78(%rbp), %rdi
callq 0x4728
leaq -0x40(%rbp), %rdi
xorl %esi, %esi
callq 0x4bad0
movq %rax, -0x268(%rbp)
jmp 0x5abe1
leaq -0x78(%rbp), %rdi
callq 0x4728
jmp 0x5b0c4
jmp 0x5b080
leaq -0x30(%rbp), %rdi
xorl %esi, %esi
callq 0x4bad0
movq %rax, -0x270(%rbp)
jmp 0x5abb1
callq 0x4250
movq %rax, %rcx
subq -0x28(%rbp), %rcx
leaq 0x7438e(%rip), %rax     # 0xcf438
addq (%rax), %rcx
leaq 0x74384(%rip), %rax     # 0xcf438
movq %rcx, (%rax)
movq -0x20(%rbp), %rax
addq $0x2f0, %rsp            # imm = 0x2F0
popq %rbp
retq
movq -0xa0(%rbp), %rdi
callq 0x4650