// File: neubig[P]egret/Egret/src/Forest-Berkeley.cpp
// Function: genNewNode_byLabel_berkeley(BerkeleyRuleSet const&, Node&, Node&, Node&, DecodeType)
Node& genNewNode_byLabel_berkeley(const BerkeleyRuleSet& ruleSet,Node& n1, Node& n2, Node& n3 , DecodeType decodetype)
{
	double score=1.0;
	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;
			genNewNode_byLabel_berkeley(ruleSet,label1,label2,n3,decodetype);
		}
	}
	if(!n3.useAllowState())
	{
		/*
		vector<vector<double> > prob;
		prob.clear();
		prob.reserve(100);
		for(int i=0;i<100;i++)
		{
			vector<double> temp;
			temp.clear();
			temp.reserve(100);
			prob.push_back(temp);
			for(int j=0;j<100;j++)
				prob[i].push_back(0);
		}
		*/
		double ** prob = (double**)malloc(sizeof(double*)*100);
		double *pool=(double*)malloc(sizeof(double)*100*100);
		for(int i=0;i<100;i++)
			//prob[i]=(double*)malloc(sizeof(double)*100);
			prob[i]=pool+i*100;
		for(int i=0;i<100;i++)
		{	
			for(int j=0;j<100;j++)
			{
				for(int k=0;k<100;k++)
				{
					prob[j][k]=0.9*0.9*.09;
					score=1.0*900*100;
				}
			}
		}
	}
	if(!n3.useAllowState())
		inbitime+=clock()-sec;
	return n3;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movl %r8d, -0x24(%rbp)
movsd 0x461b1(%rip), %xmm0    # 0x90168
movsd %xmm0, -0x30(%rbp)
callq 0x4250
movq %rax, -0x38(%rbp)
movq -0x10(%rbp), %rdi
callq 0x4ba50
movq %rax, -0x40(%rbp)
movq -0x10(%rbp), %rdi
callq 0x4b7f0
movq %rax, -0x48(%rbp)
leaq -0x40(%rbp), %rdi
leaq -0x48(%rbp), %rsi
callq 0x4ba80
testb $0x1, %al
jne 0x49ff5
jmp 0x4a084
movq -0x18(%rbp), %rdi
callq 0x4ba50
movq %rax, -0x50(%rbp)
movq -0x18(%rbp), %rdi
callq 0x4b7f0
movq %rax, -0x58(%rbp)
leaq -0x50(%rbp), %rdi
leaq -0x58(%rbp), %rsi
callq 0x4ba80
testb $0x1, %al
jne 0x4a022
jmp 0x4a06e
leaq -0x40(%rbp), %rdi
callq 0x4bab0
addq $0x20, %rax
movq %rax, -0x60(%rbp)
leaq -0x50(%rbp), %rdi
callq 0x4bab0
addq $0x20, %rax
movq %rax, -0x68(%rbp)
movq -0x8(%rbp), %rdi
movq -0x60(%rbp), %rsi
movq -0x68(%rbp), %rdx
movq -0x20(%rbp), %rcx
movl -0x24(%rbp), %r8d
callq 0x49f10
leaq -0x50(%rbp), %rdi
xorl %esi, %esi
callq 0x4bad0
movq %rax, -0x70(%rbp)
jmp 0x4a002
jmp 0x4a070
leaq -0x40(%rbp), %rdi
xorl %esi, %esi
callq 0x4bad0
movq %rax, -0x78(%rbp)
jmp 0x49fd2
movq -0x20(%rbp), %rdi
callq 0x458f0
testb $0x1, %al
jne 0x4a1a7
movl $0x320, %edi            # imm = 0x320
callq 0x44e0
movq %rax, -0x80(%rbp)
movl $0x13880, %edi          # imm = 0x13880
callq 0x44e0
movq %rax, -0x88(%rbp)
movl $0x0, -0x8c(%rbp)
cmpl $0x64, -0x8c(%rbp)
jge 0x4a0fe
movq -0x88(%rbp), %rdx
imull $0x64, -0x8c(%rbp), %eax
cltq
shlq $0x3, %rax
addq %rax, %rdx
movq -0x80(%rbp), %rax
movslq -0x8c(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movl -0x8c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x8c(%rbp)
jmp 0x4a0be
movl $0x0, -0x90(%rbp)
cmpl $0x64, -0x90(%rbp)
jge 0x4a1a5
movl $0x0, -0x94(%rbp)
cmpl $0x64, -0x94(%rbp)
jge 0x4a18f
movl $0x0, -0x98(%rbp)
cmpl $0x64, -0x98(%rbp)
jge 0x4a17c
movq -0x80(%rbp), %rax
movslq -0x94(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x98(%rbp), %rcx
movsd 0x461ef(%rip), %xmm0    # 0x90348
movsd %xmm0, (%rax,%rcx,8)
movsd 0x461da(%rip), %xmm0    # 0x90340
movsd %xmm0, -0x30(%rbp)
movl -0x98(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x98(%rbp)
jmp 0x4a132
jmp 0x4a17e
movl -0x94(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x94(%rbp)
jmp 0x4a11f
jmp 0x4a191
movl -0x90(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x90(%rbp)
jmp 0x4a108
jmp 0x4a1a7
movq -0x20(%rbp), %rdi
callq 0x458f0
testb $0x1, %al
jne 0x4a1d4
callq 0x4250
movq %rax, %rcx
subq -0x38(%rbp), %rcx
leaq 0x85271(%rip), %rax     # 0xcf438
addq (%rax), %rcx
leaq 0x85267(%rip), %rax     # 0xcf438
movq %rcx, (%rax)
movq -0x20(%rbp), %rax
addq $0xa0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)