// File: /workspace/github_c_makefile_star2_O2/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, %r14
callq 0x53230
movq %rax, %rbx
movq %r14, %rdi
callq 0x4190
movq %rax, %r15
xorl %ecx, %ecx
pushq $0x1
popq %rbp
xorl %eax, %eax
xorl %esi, %esi
xorl %edx, %edx
xorpd %xmm0, %xmm0
xorl %r12d, %r12d
cmpl %r15d, %r12d
jge 0x531f5
movslq %r12d, %r13
movzbl (%r14,%r13), %edi
cmpl $0x2b, %edi
je 0x5310c
cmpl $0x2d, %edi
jne 0x53150
testl %r12d, %r12d
jne 0x5311d
cmpb $0x2d, %dil
cmovel %ebp, %eax
movl %ebp, %r12d
jmp 0x530f1
xorl $0x1, %ecx
orl %esi, %ecx
cmovel %ebp, %esi
cmpl $0x1, %eax
jne 0x53132
xorpd 0x4309e(%rip), %xmm0    # 0x961d0
movq %rbx, %rdi
callq 0x52528
xorl %eax, %eax
cmpb $0x2b, (%r14,%r13)
setne %al
xorpd %xmm0, %xmm0
xorl %ecx, %ecx
xorl %esi, %esi
xorl %edx, %edx
jmp 0x531ce
cmpl $0x78, %edi
jne 0x5316f
xorl %edx, %edx
ucomisd 0x42bb9(%rip), %xmm0    # 0x95d18
jne 0x5318a
jp 0x5318a
movl %ebp, %ecx
movsd 0x423b3(%rip), %xmm0    # 0x95520
jmp 0x531ce
leal -0x30(%rdi), %r8d
cmpb $0x9, %r8b
ja 0x5318e
movsbl %dil, %edi
testl %ecx, %ecx
je 0x531a5
imull $0xa, %esi, %ecx
leal (%rcx,%rdi), %esi
addl $-0x30, %esi
movl %ebp, %ecx
jmp 0x531ce
cmpb $0x2e, %dil
jne 0x531ce
movl %ebp, %edx
movsd 0x479da(%rip), %xmm1    # 0x9ab78
movsd %xmm1, (%rsp)
jmp 0x531ce
testl %edx, %edx
je 0x531d6
addl $-0x30, %edi
cvtsi2sd %edi, %xmm1
movsd (%rsp), %xmm2
mulsd %xmm2, %xmm1
addsd %xmm1, %xmm0
divsd 0x44b73(%rip), %xmm2    # 0x97d38
movsd %xmm2, (%rsp)
xorl %ecx, %ecx
movl %ebp, %edx
incl %r12d
jmp 0x530f1
cvtsi2sd %edi, %xmm1
mulsd 0x44b56(%rip), %xmm0    # 0x97d38
addsd %xmm1, %xmm0
addsd 0x47aca(%rip), %xmm0    # 0x9acb8
xorl %ecx, %ecx
jmp 0x5314c
cmpl $0x1, %eax
jne 0x53202
xorpd 0x42fce(%rip), %xmm0    # 0x961d0
movl %ecx, %eax
xorl $0x1, %eax
orl %esi, %eax
pushq $0x1
popq %rax
cmovnel %esi, %eax
testl %eax, %eax
cmovel %ecx, %eax
movq %rbx, %rdi
movl %eax, %esi
callq 0x52528
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq