// File: /workspace/github_cpp_makefile_star2_O3/neubig[P]egret/Egret/src/Forest.cpp
// Function: genNewNode_viterbi(ListRuleSet&, Node&, Node&, Node&)
Node& genNewNode_viterbi(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=log(iter->second.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_viterbi(&label1,&label2,ruleScore);
				}
			}
		}
	}
	inbitime+=clock()-sec;
	return n3;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1f8, %rsp            # imm = 0x1F8
movq %rcx, %r13
movq %rdx, 0x38(%rsp)
movq %rsi, %rbx
movq %rdi, 0x10(%rsp)
callq 0x31c0
movq %rax, 0xa8(%rsp)
movq 0x18(%rbx), %rax
addq $0x8, %rbx
movq %rbx, 0xb0(%rsp)
movq %rax, (%rsp)
cmpq %rbx, %rax
je 0x26816
movq 0x38(%rsp), %rax
addq $0x8, %rax
movq %rax, 0x40(%rsp)
movq 0x10(%rsp), %rax
addq $0x8, %rax
movq %rax, 0xb8(%rsp)
leaq 0xe8(%rsp), %rbx
leaq 0x8(%r13), %rax
movq %rax, 0xc0(%rsp)
leaq 0xe0(%rsp), %r14
movq 0x38(%rsp), %rax
movq 0x18(%rax), %rax
movq %rax, 0x8(%rsp)
cmpq 0x40(%rsp), %rax
je 0x267fb
movq (%rsp), %rax
addq $0x40, %rax
movq %rax, 0xc8(%rsp)
leaq 0xf0(%rsp), %rax
movq %rax, 0xe0(%rsp)
movq (%rsp), %rax
movq 0x48(%rax), %rsi
movq 0x50(%rax), %rdx
addq %rsi, %rdx
movq %r14, %rdi
callq 0x6afc
movq %r14, %rdi
leaq 0x1aae1(%rip), %rsi     # 0x40eb2
callq 0x3570
movq 0x8(%rsp), %rax
movq 0x48(%rax), %rsi
movq 0x50(%rax), %rdx
movq %r14, %rdi
callq 0x30d0
leaq 0x28(%rsp), %rsi
movq %rsi, 0x18(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x26413
movq %rdx, 0x18(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x28(%rsp)
jmp 0x26419
movups (%rcx), %xmm0
movups %xmm0, (%rsi)
movq 0x8(%rax), %rdx
movq %rdx, 0x20(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0xe0(%rsp), %rdi
leaq 0xf0(%rsp), %rax
cmpq %rax, %rdi
je 0x26456
movq 0xf0(%rsp), %rsi
incq %rsi
callq 0x32e0
movq 0x10(%rsp), %rdi
leaq 0x18(%rsp), %rsi
callq 0x2bdf0
cmpq 0xb8(%rsp), %rax
je 0x267bd
leaq 0x98(%rsp), %rax
movq %rax, 0x88(%rsp)
movq 0x18(%rsp), %rsi
movq 0x20(%rsp), %rdx
addq %rsi, %rdx
leaq 0x88(%rsp), %r14
movq %r14, %rdi
callq 0x6afc
movq 0x10(%rsp), %rdi
movq %r14, %rsi
callq 0x3d098
movq %rax, %r15
movq %rdx, %r14
movq 0x88(%rsp), %rdi
leaq 0x98(%rsp), %rax
cmpq %rax, %rdi
je 0x264d8
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x32e0
cmpq %r14, %r15
je 0x267bd
movq 0x8(%rsp), %rax
addq $0x40, %rax
movq %rax, 0xd0(%rsp)
movsd 0x80(%r15), %xmm0
callq 0x3260
movsd %xmm0, 0xd8(%rsp)
leaq 0xe0(%rsp), %rdi
callq 0x1fe68
leaq 0x78(%rsp), %rax
movq %rax, 0x68(%rsp)
movq 0x40(%r15), %rsi
movq 0x48(%r15), %rdx
addq %rsi, %rdx
leaq 0x68(%rsp), %rdi
callq 0x6afc
movq (%rsp), %rax
movl 0x88(%rax), %ebp
movq 0x8(%rsp), %rax
movl 0x8c(%rax), %r12d
leaq 0x58(%rsp), %rax
movq %rax, 0x48(%rsp)
leaq 0x48(%rsp), %rdi
leaq 0x1a955(%rip), %rdx     # 0x40eb6
movq %rdx, %rsi
callq 0xb7d0
movq %rbx, %rdi
leaq 0x68(%rsp), %rsi
callq 0x3150
movl %ebp, 0x128(%rsp)
movl %r12d, 0x12c(%rsp)
leaq 0x108(%rsp), %rdi
leaq 0x48(%rsp), %rsi
callq 0x3150
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0x265b3
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x32e0
movq 0x68(%rsp), %rdi
leaq 0x78(%rsp), %rax
cmpq %rax, %rdi
je 0x265cf
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x32e0
movq %r13, %rdi
movq %rbx, %rsi
callq 0x21d54
cmpq 0xc0(%rsp), %rax
jne 0x266e2
movq %r13, %rdi
movq %rbx, %rsi
callq 0x1fdec
movq %rax, %rbp
movb 0xe0(%rsp), %al
movb %al, (%rbp)
leaq 0x8(%rbp), %rdi
movq %rbx, %rsi
callq 0x3150
leaq 0x28(%rbp), %rdi
leaq 0x108(%rsp), %rsi
callq 0x3150
leaq 0xf0(%rsp), %rcx
movb 0x40(%rcx), %al
movb %al, 0x50(%rbp)
movq 0x38(%rcx), %rax
movq %rax, 0x48(%rbp)
leaq 0x58(%rbp), %rdi
leaq 0x138(%rsp), %rsi
callq 0x20524
leaq 0x70(%rbp), %rdi
leaq 0x150(%rsp), %rsi
callq 0x20524
leaq 0x88(%rbp), %rdi
leaq 0x168(%rsp), %rsi
callq 0x213d0
leaq 0xf0(%rsp), %rax
movups 0xa8(%rax), %xmm0
movups %xmm0, 0xb8(%rbp)
leaq 0xc8(%rbp), %rdi
leaq 0x1a8(%rsp), %rsi
callq 0x208ac
leaq 0xf0(%rsp), %rax
movups 0xd0(%rax), %xmm0
movups %xmm0, 0xe0(%rbp)
movq %rbp, %rdi
addq $0xf0, %rdi
leaq 0x1d0(%rsp), %rsi
callq 0x2123a
leaq 0xf0(%rsp), %rcx
movl 0x100(%rcx), %eax
movl %eax, 0x110(%rbp)
movq 0xf8(%rcx), %rax
movq %rax, 0x108(%rbp)
movq %r13, %rdi
movq %rbx, %rsi
callq 0x1fdec
movq %rax, %rdi
movq 0xc8(%rsp), %rsi
movq 0xd0(%rsp), %rdx
movsd 0xd8(%rsp), %xmm0
callq 0x2d056
leaq 0x1d0(%rsp), %rdi
callq 0x1cee0
movq 0x1a8(%rsp), %rdi
testq %rdi, %rdi
je 0x26738
movq 0x1b8(%rsp), %rsi
subq %rdi, %rsi
callq 0x32e0
leaq 0x168(%rsp), %rdi
callq 0x1cf88
leaq 0x150(%rsp), %rdi
callq 0x1cf34
leaq 0x138(%rsp), %rdi
callq 0x1cf34
movq 0x108(%rsp), %rdi
leaq 0x118(%rsp), %rax
cmpq %rax, %rdi
je 0x26784
movq 0x118(%rsp), %rsi
incq %rsi
callq 0x32e0
movq 0xe8(%rsp), %rdi
leaq 0xf8(%rsp), %rax
cmpq %rax, %rdi
je 0x267a9
movq 0xf8(%rsp), %rsi
incq %rsi
callq 0x32e0
movq %r15, %rdi
callq 0x31f0
movq %rax, %r15
cmpq %r14, %rax
jne 0x264f2
movq 0x18(%rsp), %rdi
leaq 0x28(%rsp), %rax
cmpq %rax, %rdi
je 0x267d9
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x32e0
movq 0x8(%rsp), %rdi
callq 0x31f0
movq %rax, 0x8(%rsp)
cmpq 0x40(%rsp), %rax
leaq 0xe0(%rsp), %r14
jne 0x263a0
movq (%rsp), %rdi
callq 0x31f0
movq %rax, (%rsp)
cmpq 0xb0(%rsp), %rax
jne 0x26377
callq 0x31c0
subq 0xa8(%rsp), %rax
leaq 0x2eb3e(%rip), %rcx     # 0x55368
addq %rax, (%rcx)
movq %r13, %rax
addq $0x1f8, %rsp            # imm = 0x1F8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x2689c
movq %rax, %rbx
movq 0x88(%rsp), %rdi
leaq 0x98(%rsp), %rax
cmpq %rax, %rdi
je 0x26984
movq 0x98(%rsp), %rsi
jmp 0x2697c
jmp 0x26871
jmp 0x2689c
movq %rax, %rbx
movq 0xe0(%rsp), %rdi
leaq 0xf0(%rsp), %rax
cmpq %rax, %rdi
je 0x269a0
movq 0xf0(%rsp), %rsi
jmp 0x26998
jmp 0x268e6
movq %rax, %rbx
jmp 0x26984
movq %rax, %rbx
jmp 0x268c8
movq %rax, %rbx
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0x268c8
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x32e0
movq 0x68(%rsp), %rdi
leaq 0x78(%rsp), %rax
cmpq %rax, %rdi
je 0x268e9
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x32e0
jmp 0x268e9
movq %rax, %rbx
leaq 0x1d0(%rsp), %rdi
callq 0x1cee0
movq 0x1a8(%rsp), %rdi
testq %rdi, %rdi
je 0x26913
movq 0x1b8(%rsp), %rsi
subq %rdi, %rsi
callq 0x32e0
leaq 0x168(%rsp), %rdi
callq 0x1cf88
leaq 0x150(%rsp), %rdi
callq 0x1cf34
leaq 0x138(%rsp), %rdi
callq 0x1cf34
movq 0x108(%rsp), %rdi
leaq 0x118(%rsp), %rax
cmpq %rax, %rdi
je 0x2695f
movq 0x118(%rsp), %rsi
incq %rsi
callq 0x32e0
movq 0xe8(%rsp), %rdi
leaq 0xf8(%rsp), %rax
cmpq %rax, %rdi
je 0x26984
movq 0xf8(%rsp), %rsi
incq %rsi
callq 0x32e0
movq 0x18(%rsp), %rdi
leaq 0x28(%rsp), %rax
cmpq %rax, %rdi
je 0x269a0
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x32e0
movq %rbx, %rdi
callq 0x3530