// File: /workspace/github_cpp_makefile_star2_O3/neubig[P]egret/Egret/src/Rule.cpp
// Function: string2rule(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&, Rule&)
bool string2rule(string& str, Rule& rule)
{
	string temp;
	str.erase(0,str.find_first_not_of(" \t"));
	temp=str.substr(0,str.find_first_of(" \t"));
	//jout<<temp<<endl;
	rule.prob=atof(temp.c_str());
	if(rule.prob<=0)rule.prob=0.000001;
	str.erase(0,str.find_first_of(" \t"));
	str.erase(0,str.find_first_not_of(" \t"));
	temp=str.substr(0,str.find(" --> "));
	rule.left=temp;
	//jout<<rule.left<<endl;
	str.erase(0,str.find(" --> ")+5);
	rule.right="";
	stringstream ss(str);
	while(!ss.eof())
	{
		string wrd="";
		ss>>wrd;
		if(wrd=="")break;
		if(rule.right.length()>0)
			rule.right+=" ";
		rule.right+=wrd;
	}

	return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1d8, %rsp            # imm = 0x1D8
movq %rsi, 0x8(%rsp)
movq %rdi, %r14
leaq 0x20(%rsp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq 0x458e(%rip), %rsi      # 0x40eb4
movl $0x2, %ecx
xorl %edx, %edx
callq 0x34e0
movq %r14, %rdi
xorl %esi, %esi
movq %rax, %rdx
callq 0x3090
leaq 0x456e(%rip), %rsi      # 0x40eb4
movl $0x2, %ecx
movq %r14, %rdi
xorl %edx, %edx
callq 0x3420
leaq 0x50(%rsp), %rdi
movq %r14, %rsi
xorl %edx, %edx
movq %rax, %rcx
callq 0x3300
leaq 0x10(%rsp), %rdi
leaq 0x50(%rsp), %r15
movq %r15, %rsi
callq 0x3380
movq (%r15), %rdi
leaq 0x60(%rsp), %r12
cmpq %r12, %rdi
je 0x3c993
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x32e0
movq 0x10(%rsp), %rdi
callq 0x3390
xorpd %xmm1, %xmm1
movapd %xmm0, %xmm2
cmpnlesd %xmm1, %xmm2
andpd %xmm2, %xmm0
movsd 0x44f2(%rip), %xmm1     # 0x40ea8
andnpd %xmm1, %xmm2
orpd %xmm0, %xmm2
movq 0x8(%rsp), %rax
movlpd %xmm2, 0x40(%rax)
leaq 0x44e5(%rip), %rsi      # 0x40eb4
movl $0x2, %ecx
movq %r14, %rdi
xorl %edx, %edx
callq 0x3420
movq %r14, %rdi
xorl %esi, %esi
movq %rax, %rdx
callq 0x3090
leaq 0x44c2(%rip), %rsi      # 0x40eb4
movl $0x2, %ecx
movq %r14, %rdi
xorl %edx, %edx
callq 0x34e0
movq %r14, %rdi
xorl %esi, %esi
movq %rax, %rdx
callq 0x3090
leaq 0x3b75(%rip), %rsi      # 0x4058a
movl $0x5, %ecx
movq %r14, %rdi
xorl %edx, %edx
callq 0x3510
leaq 0x50(%rsp), %rdi
movq %r14, %rsi
xorl %edx, %edx
movq %rax, %rcx
callq 0x3300
leaq 0x10(%rsp), %rdi
leaq 0x50(%rsp), %r15
movq %r15, %rsi
callq 0x3380
movq (%r15), %rdi
cmpq %r12, %rdi
je 0x3ca5d
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x32e0
leaq 0x10(%rsp), %rsi
movq 0x8(%rsp), %rdi
callq 0x3150
leaq 0x3b17(%rip), %rsi      # 0x4058a
movl $0x5, %ecx
movq %r14, %rdi
xorl %edx, %edx
callq 0x3510
leaq 0x5(%rax), %rdx
movq %r14, %rdi
xorl %esi, %esi
callq 0x3090
movq 0x8(%rsp), %rax
leaq 0x20(%rax), %r15
movq 0x28(%rax), %rdx
leaq 0x4412(%rip), %rcx      # 0x40eb6
movq %r15, %rdi
xorl %esi, %esi
xorl %r8d, %r8d
callq 0x3440
leaq 0x50(%rsp), %rdi
movq %r14, %rsi
movl $0x18, %edx
callq 0x3480
leaq 0x40(%rsp), %rbx
leaq 0x43e7(%rip), %r14      # 0x40eb6
leaq 0x30(%rsp), %r12
leaq 0x50(%rsp), %r13
movq 0x50(%rsp), %rax
movq -0x18(%rax), %rax
testb $0x2, 0x70(%rsp,%rax)
jne 0x3cb64
movq %rbx, 0x30(%rsp)
movq %r12, %rdi
movq %r14, %rsi
movq %r14, %rdx
callq 0xb7d0
movq %r13, %rdi
movq %r12, %rsi
callq 0x33a0
movq %r12, %rdi
movq %r14, %rsi
callq 0x30c0
movl %eax, %ebp
testl %eax, %eax
je 0x3cb45
movq 0x8(%rsp), %rax
cmpq $0x0, 0x28(%rax)
je 0x3cb33
movq %r15, %rdi
leaq 0x4384(%rip), %rsi      # 0x40eb2
callq 0x3570
movq 0x30(%rsp), %rsi
movq 0x38(%rsp), %rdx
movq %r15, %rdi
callq 0x30d0
movq 0x30(%rsp), %rdi
cmpq %rbx, %rdi
je 0x3cb5c
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x32e0
testl %ebp, %ebp
jne 0x3cad9
movq 0x1843d(%rip), %rsi     # 0x54fa8
leaq 0x50(%rsp), %rdi
callq 0x3230
leaq 0xd0(%rsp), %rdi
callq 0x30e0
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x3cb9e
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x32e0
movb $0x1, %al
addq $0x1d8, %rsp            # imm = 0x1D8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x3cbb8
jmp 0x3cbb8
jmp 0x3cbb8
movq %rax, %r14
jmp 0x3cbfa
movq %rax, %r14
jmp 0x3cbdc
movq %rax, %r14
movq 0x30(%rsp), %rdi
cmpq %rbx, %rdi
je 0x3cbdc
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x32e0
movq 0x183c5(%rip), %rsi     # 0x54fa8
leaq 0x50(%rsp), %rdi
callq 0x3230
leaq 0xd0(%rsp), %rdi
callq 0x30e0
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x3cc16
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x32e0
movq %r14, %rdi
callq 0x3530
nop