// File: /workspace/github_cpp_makefile_star2_O1/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, %rbx
movq %rdx, 0x38(%rsp)
movq %rsi, %r14
movq %rdi, 0x10(%rsp)
callq 0x31c0
movq %rax, 0xa8(%rsp)
movq 0x18(%r14), %rax
addq $0x8, %r14
movq %r14, 0xb0(%rsp)
movq %rax, (%rsp)
cmpq %r14, %rax
je 0x26e84
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), %r14
leaq 0x8(%rbx), %rax
movq %rax, 0xc0(%rsp)
leaq 0xe0(%rsp), %r15
movq 0x38(%rsp), %rax
movq 0x18(%rax), %rax
movq %rax, 0x8(%rsp)
cmpq 0x40(%rsp), %rax
je 0x26e69
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 %r15, %rdi
callq 0x6a88
movq %r15, %rdi
leaq 0x1b453(%rip), %rsi     # 0x41e92
callq 0x3570
movq 0x8(%rsp), %rax
movq 0x48(%rax), %rsi
movq 0x50(%rax), %rdx
movq %r15, %rdi
callq 0x30d0
leaq 0x28(%rsp), %rsi
movq %rsi, 0x18(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x26a81
movq %rdx, 0x18(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x28(%rsp)
jmp 0x26a87
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 0x26ac4
movq 0xf0(%rsp), %rsi
incq %rsi
callq 0x32e0
movq 0x10(%rsp), %rdi
leaq 0x18(%rsp), %rsi
callq 0x2c5be
cmpq 0xb8(%rsp), %rax
je 0x26e2b
leaq 0x98(%rsp), %rax
movq %rax, 0x88(%rsp)
movq 0x18(%rsp), %rsi
movq 0x20(%rsp), %rdx
addq %rsi, %rdx
leaq 0x88(%rsp), %r15
movq %r15, %rdi
callq 0x6a88
movq 0x10(%rsp), %rdi
movq %r15, %rsi
callq 0x3dd56
movq %rax, %r15
movq %rdx, %r12
movq 0x88(%rsp), %rdi
leaq 0x98(%rsp), %rax
cmpq %rax, %rdi
je 0x26b46
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x32e0
cmpq %r12, %r15
je 0x26e2b
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 0x204bc
leaq 0x78(%rsp), %rax
movq %rax, 0x68(%rsp)
movq 0x40(%r15), %rsi
movq 0x48(%r15), %rdx
addq %rsi, %rdx
leaq 0x68(%rsp), %rdi
callq 0x6a88
movq (%rsp), %rax
movl 0x88(%rax), %ebp
movq 0x8(%rsp), %rax
movl 0x8c(%rax), %r13d
leaq 0x58(%rsp), %rax
movq %rax, 0x48(%rsp)
leaq 0x48(%rsp), %rdi
leaq 0x1b2c7(%rip), %rdx     # 0x41e96
movq %rdx, %rsi
callq 0xb8a2
movq %r14, %rdi
leaq 0x68(%rsp), %rsi
callq 0x3150
movl %ebp, 0x128(%rsp)
movl %r13d, 0x12c(%rsp)
leaq 0x108(%rsp), %rdi
leaq 0x48(%rsp), %rsi
callq 0x3150
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0x26c21
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x32e0
movq 0x68(%rsp), %rdi
leaq 0x78(%rsp), %rax
cmpq %rax, %rdi
je 0x26c3d
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x32e0
movq %rbx, %rdi
movq %r14, %rsi
callq 0x223b8
cmpq 0xc0(%rsp), %rax
jne 0x26d50
movq %rbx, %rdi
movq %r14, %rsi
callq 0x20440
movq %rax, %rbp
movb 0xe0(%rsp), %al
movb %al, (%rbp)
leaq 0x8(%rbp), %rdi
movq %r14, %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 0x20b88
leaq 0x70(%rbp), %rdi
leaq 0x150(%rsp), %rsi
callq 0x20b88
leaq 0x88(%rbp), %rdi
leaq 0x168(%rsp), %rsi
callq 0x21a40
leaq 0xf0(%rsp), %rax
movups 0xa8(%rax), %xmm0
movups %xmm0, 0xb8(%rbp)
leaq 0xc8(%rbp), %rdi
leaq 0x1a8(%rsp), %rsi
callq 0x20ef0
leaq 0xf0(%rsp), %rax
movups 0xd0(%rax), %xmm0
movups %xmm0, 0xe0(%rbp)
movq %rbp, %rdi
addq $0xf0, %rdi
leaq 0x1d0(%rsp), %rsi
callq 0x218ca
leaq 0xf0(%rsp), %rcx
movl 0x100(%rcx), %eax
movl %eax, 0x110(%rbp)
movq 0xf8(%rcx), %rax
movq %rax, 0x108(%rbp)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x20440
movq %rax, %rdi
movq 0xc8(%rsp), %rsi
movq 0xd0(%rsp), %rdx
movsd 0xd8(%rsp), %xmm0
callq 0x2d83e
leaq 0x1d0(%rsp), %rdi
callq 0x1d4e6
movq 0x1a8(%rsp), %rdi
testq %rdi, %rdi
je 0x26da6
movq 0x1b8(%rsp), %rsi
subq %rdi, %rsi
callq 0x32e0
leaq 0x168(%rsp), %rdi
callq 0x1d582
leaq 0x150(%rsp), %rdi
callq 0x1d534
leaq 0x138(%rsp), %rdi
callq 0x1d534
movq 0x108(%rsp), %rdi
leaq 0x118(%rsp), %rax
cmpq %rax, %rdi
je 0x26df2
movq 0x118(%rsp), %rsi
incq %rsi
callq 0x32e0
movq 0xe8(%rsp), %rdi
leaq 0xf8(%rsp), %rax
cmpq %rax, %rdi
je 0x26e17
movq 0xf8(%rsp), %rsi
incq %rsi
callq 0x32e0
movq %r15, %rdi
callq 0x31f0
movq %rax, %r15
cmpq %r12, %rax
jne 0x26b60
movq 0x18(%rsp), %rdi
leaq 0x28(%rsp), %rax
cmpq %rax, %rdi
je 0x26e47
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), %r15
jne 0x26a0e
movq (%rsp), %rdi
callq 0x31f0
movq %rax, (%rsp)
cmpq 0xb0(%rsp), %rax
jne 0x269e5
callq 0x31c0
subq 0xa8(%rsp), %rax
leaq 0x2f4d0(%rip), %rcx     # 0x56368
addq %rax, (%rcx)
movq %rbx, %rax
addq $0x1f8, %rsp            # imm = 0x1F8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x26f0a
movq %rax, %rbx
movq 0x88(%rsp), %rdi
leaq 0x98(%rsp), %rax
cmpq %rax, %rdi
je 0x26ff0
movq 0x98(%rsp), %rsi
jmp 0x26fe8
jmp 0x26edf
jmp 0x26f0a
movq %rax, %rbx
movq 0xe0(%rsp), %rdi
leaq 0xf0(%rsp), %rax
cmpq %rax, %rdi
je 0x2700c
movq 0xf0(%rsp), %rsi
jmp 0x27004
jmp 0x26f54
movq %rax, %rbx
jmp 0x26ff0
movq %rax, %rbx
jmp 0x26f36
movq %rax, %rbx
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0x26f36
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x32e0
movq 0x68(%rsp), %rdi
leaq 0x78(%rsp), %rax
cmpq %rax, %rdi
je 0x26f57
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x32e0
jmp 0x26f57
movq %rax, %rbx
leaq 0x1d0(%rsp), %rdi
callq 0x1d4e6
leaq 0x150(%rsp), %r14
movq 0x58(%r14), %rdi
testq %rdi, %rdi
je 0x26f85
movq 0x1b8(%rsp), %rsi
subq %rdi, %rsi
callq 0x32e0
leaq 0x168(%rsp), %rdi
callq 0x1d582
movq %r14, %rdi
callq 0x1d534
leaq 0x138(%rsp), %r14
movq %r14, %rdi
callq 0x1d534
movq -0x30(%r14), %rdi
leaq 0x118(%rsp), %rax
cmpq %rax, %rdi
je 0x26fcb
movq 0x118(%rsp), %rsi
incq %rsi
callq 0x32e0
movq 0xe8(%rsp), %rdi
leaq 0xf8(%rsp), %rax
cmpq %rax, %rdi
je 0x26ff0
movq 0xf8(%rsp), %rsi
incq %rsi
callq 0x32e0
movq 0x18(%rsp), %rdi
leaq 0x28(%rsp), %rax
cmpq %rax, %rdi
je 0x2700c
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x32e0
movq %rbx, %rdi
callq 0x3530