// File: 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
movq %rsp, %rbp
subq $0x2d0, %rsp            # imm = 0x2D0
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x4510
movq -0x8(%rbp), %rdi
movq %rdi, -0x240(%rbp)
leaq 0x82a6(%rip), %rsi      # 0x90e54
xorl %eax, %eax
movl %eax, %edx
movq %rdx, -0x238(%rbp)
callq 0x41f0
movq -0x240(%rbp), %rdi
movq -0x238(%rbp), %rsi
movq %rax, %rdx
callq 0x40c0
jmp 0x88bd6
movq -0x8(%rbp), %rdi
movq %rdi, -0x250(%rbp)
leaq 0x826c(%rip), %rsi      # 0x90e54
xorl %eax, %eax
movl %eax, %edx
movq %rdx, -0x248(%rbp)
callq 0x4190
movq -0x250(%rbp), %rsi
movq -0x248(%rbp), %rdx
movq %rax, %rcx
leaq -0x60(%rbp), %rdi
callq 0x43b0
jmp 0x88c14
leaq -0x30(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0x4470
leaq -0x60(%rbp), %rdi
callq 0x4728
leaq -0x30(%rbp), %rdi
callq 0x4150
movq %rax, %rdi
callq 0x4490
movq -0x10(%rbp), %rax
movsd %xmm0, 0x40(%rax)
movq -0x10(%rbp), %rax
xorps %xmm0, %xmm0
ucomisd 0x40(%rax), %xmm0
jb 0x88c76
movq -0x10(%rbp), %rax
movsd 0x81ea(%rip), %xmm0     # 0x90e48
movsd %xmm0, 0x40(%rax)
jmp 0x88c76
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x88f98
movq -0x8(%rbp), %rdi
movq %rdi, -0x260(%rbp)
leaq 0x81cc(%rip), %rsi      # 0x90e54
xorl %eax, %eax
movl %eax, %edx
movq %rdx, -0x258(%rbp)
callq 0x4190
movq -0x260(%rbp), %rdi
movq -0x258(%rbp), %rsi
movq %rax, %rdx
callq 0x40c0
jmp 0x88cb0
movq -0x8(%rbp), %rdi
movq %rdi, -0x270(%rbp)
leaq 0x8192(%rip), %rsi      # 0x90e54
xorl %eax, %eax
movl %eax, %edx
movq %rdx, -0x268(%rbp)
callq 0x41f0
movq -0x270(%rbp), %rdi
movq -0x268(%rbp), %rsi
movq %rax, %rdx
callq 0x40c0
jmp 0x88cea
movq -0x8(%rbp), %rdi
movq %rdi, -0x280(%rbp)
leaq 0x784e(%rip), %rsi      # 0x9054a
xorl %eax, %eax
movl %eax, %edx
movq %rdx, -0x278(%rbp)
callq 0x46f0
movq -0x280(%rbp), %rsi
movq -0x278(%rbp), %rdx
movq %rax, %rcx
leaq -0x80(%rbp), %rdi
callq 0x43b0
jmp 0x88d28
leaq -0x30(%rbp), %rdi
movq %rdi, -0x288(%rbp)
leaq -0x80(%rbp), %rsi
movq %rsi, -0x290(%rbp)
callq 0x4470
movq -0x290(%rbp), %rdi
callq 0x4728
movq -0x288(%rbp), %rsi
movq -0x10(%rbp), %rdi
callq 0x4050
jmp 0x88d61
movq -0x8(%rbp), %rdi
movq %rdi, -0x2a0(%rbp)
leaq 0x77d7(%rip), %rsi      # 0x9054a
xorl %eax, %eax
movl %eax, %edx
movq %rdx, -0x298(%rbp)
callq 0x46f0
movq -0x2a0(%rbp), %rdi
movq -0x298(%rbp), %rsi
movq %rax, %rdx
addq $0x5, %rdx
callq 0x40c0
jmp 0x88d9f
movq -0x10(%rbp), %rdi
addq $0x20, %rdi
leaq 0x80a8(%rip), %rsi      # 0x90e56
callq 0x4500
jmp 0x88db5
movq -0x8(%rbp), %rax
movq %rax, -0x2b0(%rbp)
movl $0x10, %edi
movl $0x8, %esi
callq 0x1c7e0
movl %eax, -0x2a4(%rbp)
jmp 0x88dd7
movl -0x2a4(%rbp), %edx
movq -0x2b0(%rbp), %rsi
leaq -0x208(%rbp), %rdi
callq 0x45b0
jmp 0x88df2
jmp 0x88df4
movq -0x208(%rbp), %rax
movq -0x18(%rax), %rax
leaq -0x208(%rbp,%rax), %rdi
callq 0x46a0
movb %al, -0x2b1(%rbp)
jmp 0x88e14
movb -0x2b1(%rbp), %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x88e25
jmp 0x88f60
leaq -0x229(%rbp), %rdi
movq %rdi, -0x2c0(%rbp)
callq 0x4660
movq -0x2c0(%rbp), %rdx
leaq 0x8010(%rip), %rsi      # 0x90e56
leaq -0x228(%rbp), %rdi
callq 0x1c730
jmp 0x88e54
leaq -0x229(%rbp), %rdi
callq 0x43f0
leaq -0x208(%rbp), %rdi
leaq -0x228(%rbp), %rsi
callq 0x44a0
jmp 0x88e75
leaq 0x7fda(%rip), %rsi      # 0x90e56
leaq -0x228(%rbp), %rdi
callq 0xa020
movb %al, -0x2c1(%rbp)
jmp 0x88e90
movb -0x2c1(%rbp), %al
testb $0x1, %al
jne 0x88e9c
jmp 0x88ef6
movl $0x3, -0x230(%rbp)
jmp 0x88f41
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x88f8c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x229(%rbp), %rdi
callq 0x43f0
jmp 0x88f8c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x228(%rbp), %rdi
callq 0x4728
jmp 0x88f8c
movq -0x10(%rbp), %rdi
addq $0x20, %rdi
callq 0x4570
cmpq $0x0, %rax
jbe 0x88f21
movq -0x10(%rbp), %rdi
addq $0x20, %rdi
leaq 0x7f3a(%rip), %rsi      # 0x90e52
callq 0x4360
jmp 0x88f1f
jmp 0x88f21
movq -0x10(%rbp), %rdi
addq $0x20, %rdi
leaq -0x228(%rbp), %rsi
callq 0x44b0
jmp 0x88f37
movl $0x0, -0x230(%rbp)
leaq -0x228(%rbp), %rdi
callq 0x4728
movl -0x230(%rbp), %eax
testl %eax, %eax
je 0x88f5b
jmp 0x88f59
jmp 0x88f60
jmp 0x88df4
movl $0x1, -0x230(%rbp)
leaq -0x208(%rbp), %rdi
callq 0x42d0
leaq -0x30(%rbp), %rdi
callq 0x4728
movb $0x1, %al
andb $0x1, %al
addq $0x2d0, %rsp            # imm = 0x2D0
popq %rbp
retq
leaq -0x208(%rbp), %rdi
callq 0x42d0
leaq -0x30(%rbp), %rdi
callq 0x4728
movq -0x38(%rbp), %rdi
callq 0x4650
nopw (%rax,%rax)