// File: /workspace/github_c_makefile_star2_O3/olcaytaner[P]Isell/poly.c
// Function: read_polynom
Polynomptr read_polynom(char* st)
{
	/*!Last Changed 19.01.2005*/
 int i = 0,power = 0,j = 0, type = 0, len, point = 0;
	double coefficient = 0, multiplier;
 Polynomptr result = create_polynom();
	len = strlen(st);
 while (i < len)
  {
   if (st[i]=='x')
    {
     j = 1;
					point = 0;
     if (coefficient==0)
       coefficient = 1;
    }
   else
     if (st[i]=='+' || st[i]=='-')
      {
       if (i == 0)
							 {
								 if (st[i]== '-')
           type = 1;
         i++;
								 continue;
							 }
       if (j==1 && power==0)
         power = 1;
       if (type == 1)
         coefficient*=-1;
       add_polynode_to_polynom(result,power,coefficient);
       if (st[i] == '+')
         type = 0;
       else
         type = 1;
       power = 0;
       coefficient = 0;
       j = 0;
							point = 0;
      }
     else
       if (st[i] >= '0' && st[i] <= '9')
         if (j == 0)
										 if (point == 0)
             coefficient = coefficient * 10 + st[i] - '0';
											else
											 {
												 coefficient = coefficient + (st[i] - '0') * multiplier;
												 multiplier /= 10;
											 }
         else
           power = power * 10 + st[i] - '0';
							else
								 if (st[i] == '.')
									 {
										 point = 1;
											multiplier = 0.1;
									 }
   i++;
  }
 if (type == 1)
   coefficient*=-1;
	if (j == 1 && power == 0)
		 power = 1;
 if (power!=0)
   add_polynode_to_polynom(result,power,coefficient);
 else
   add_polynode_to_polynom(result,j,coefficient);
 return result;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r15
leaq 0x4fb3f(%rip), %rsi     # 0xaadf2
movl $0x1, %ebx
movl $0x10, %edi
movl $0x1, %edx
callq 0x3a0e1
movq %rax, %r14
xorpd %xmm0, %xmm0
movupd %xmm0, (%rax)
movq %r15, %rdi
callq 0x4190
movq %rax, %r12
testl %r12d, %r12d
jle 0x5b422
xorl %ebp, %ebp
xorpd %xmm0, %xmm0
xorl %edx, %edx
xorl %esi, %esi
xorl %eax, %eax
xorl %ecx, %ecx
movslq %ebp, %r13
movzbl (%r15,%r13), %edi
cmpl $0x2b, %edi
je 0x5b306
cmpl $0x2d, %edi
jne 0x5b321
testl %ebp, %ebp
jne 0x5b343
cmpb $0x2d, %dil
movl $0x1, %ebp
cmovel %ebp, %eax
cmpl $0x1, %r12d
jne 0x5b2f4
jmp 0x5b413
cmpl $0x78, %edi
jne 0x5b384
xorl %edx, %edx
movl $0x1, %ecx
ucomisd 0x4a9d3(%rip), %xmm0    # 0xa5d08
jne 0x5b374
jp 0x5b374
movsd 0x4a1df(%rip), %xmm0    # 0xa5520
jmp 0x5b374
xorl $0x1, %ecx
orl %esi, %ecx
cmovel %ebx, %esi
cmpl $0x1, %eax
jne 0x5b358
xorpd 0x4ae78(%rip), %xmm0    # 0xa61d0
movq %r14, %rdi
callq 0x5a606
xorl %eax, %eax
cmpb $0x2b, (%r15,%r13)
setne %al
xorpd %xmm0, %xmm0
xorl %ecx, %ecx
xorl %esi, %esi
xorl %edx, %edx
incl %ebp
cmpl %r12d, %ebp
jl 0x5b2f4
jmp 0x5b413
leal -0x30(%rdi), %r8d
cmpb $0x9, %r8b
ja 0x5b3a6
movsbl %dil, %edi
testl %ecx, %ecx
je 0x5b3c0
leal (%rsi,%rsi,4), %ecx
leal (%rdi,%rcx,2), %esi
addl $-0x30, %esi
movl $0x1, %ecx
jmp 0x5b374
cmpb $0x2e, %dil
jne 0x5b374
movl $0x1, %edx
movsd 0x4f88f(%rip), %xmm1    # 0xaac48
movsd %xmm1, (%rsp)
jmp 0x5b374
testl %edx, %edx
je 0x5b3f1
addl $-0x30, %edi
xorps %xmm1, %xmm1
cvtsi2sd %edi, %xmm1
movsd (%rsp), %xmm2
mulsd %xmm2, %xmm1
addsd %xmm1, %xmm0
divsd 0x4c9d5(%rip), %xmm2    # 0xa7db8
movsd %xmm2, (%rsp)
movl $0x1, %edx
xorl %ecx, %ecx
jmp 0x5b374
xorps %xmm1, %xmm1
cvtsi2sd %edi, %xmm1
mulsd 0x4c9b8(%rip), %xmm0    # 0xa7db8
addsd %xmm1, %xmm0
addsd 0x4f97c(%rip), %xmm0    # 0xaad88
xorl %ecx, %ecx
jmp 0x5b372
cmpl $0x1, %eax
jne 0x5b42a
xorpd 0x4adb0(%rip), %xmm0    # 0xa61d0
jmp 0x5b42a
xorpd %xmm0, %xmm0
xorl %esi, %esi
xorl %ecx, %ecx
movl %ecx, %eax
xorl $0x1, %eax
orl %esi, %eax
cmovnel %esi, %ebx
testl %ebx, %ebx
cmovel %ecx, %ebx
movq %r14, %rdi
movl %ebx, %esi
callq 0x5a606
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq