// File: /workspace/github_c_makefile_star2_O1/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
leaq 0x4e003(%rip), %rsi     # 0xa7d42
movl $0x1, %ebp
movl $0x10, %edi
movl $0x1, %edx
callq 0x390f5
movq %rax, %rbx
xorpd %xmm0, %xmm0
movupd %xmm0, (%rax)
movq %r14, %rdi
callq 0x4190
movq %rax, %r15
testl %r15d, %r15d
jle 0x59ea4
xorl %r12d, %r12d
xorpd %xmm0, %xmm0
xorl %edx, %edx
xorl %esi, %esi
xorl %eax, %eax
xorl %ecx, %ecx
movslq %r12d, %r13
movzbl (%r14,%r13), %edi
cmpl $0x2b, %edi
je 0x59d93
cmpl $0x2d, %edi
jne 0x59db1
testl %r12d, %r12d
jne 0x59dd3
cmpb $0x2d, %dil
movl $0x1, %r12d
cmovel %r12d, %eax
cmpl $0x1, %r15d
jne 0x59d81
jmp 0x59eae
cmpl $0x78, %edi
jne 0x59e15
xorl %edx, %edx
movl $0x1, %ecx
ucomisd 0x48f43(%rip), %xmm0    # 0xa2d08
jne 0x59e04
jp 0x59e04
movsd 0x4874f(%rip), %xmm0    # 0xa2520
jmp 0x59e04
xorl $0x1, %ecx
orl %esi, %ecx
cmovel %ebp, %esi
cmpl $0x1, %eax
jne 0x59de8
xorpd 0x493e8(%rip), %xmm0    # 0xa31d0
movq %rbx, %rdi
callq 0x5908a
xorl %eax, %eax
cmpb $0x2b, (%r14,%r13)
setne %al
xorpd %xmm0, %xmm0
xorl %ecx, %ecx
xorl %esi, %esi
xorl %edx, %edx
incl %r12d
cmpl %r15d, %r12d
jl 0x59d81
jmp 0x59eae
leal -0x30(%rdi), %r8d
cmpb $0x9, %r8b
ja 0x59e37
movsbl %dil, %edi
testl %ecx, %ecx
je 0x59e51
leal (%rsi,%rsi,4), %ecx
leal (%rdi,%rcx,2), %esi
addl $-0x30, %esi
movl $0x1, %ecx
jmp 0x59e04
cmpb $0x2e, %dil
jne 0x59e04
movl $0x1, %edx
movsd 0x4dd4e(%rip), %xmm1    # 0xa7b98
movsd %xmm1, (%rsp)
jmp 0x59e04
testl %edx, %edx
je 0x59e82
addl $-0x30, %edi
xorps %xmm1, %xmm1
cvtsi2sd %edi, %xmm1
movsd (%rsp), %xmm2
mulsd %xmm2, %xmm1
addsd %xmm1, %xmm0
divsd 0x4aebc(%rip), %xmm2    # 0xa4d30
movsd %xmm2, (%rsp)
movl $0x1, %edx
xorl %ecx, %ecx
jmp 0x59e04
xorps %xmm1, %xmm1
cvtsi2sd %edi, %xmm1
mulsd 0x4ae9f(%rip), %xmm0    # 0xa4d30
addsd %xmm1, %xmm0
addsd 0x4de3b(%rip), %xmm0    # 0xa7cd8
xorl %ecx, %ecx
jmp 0x59e02
xorpd %xmm0, %xmm0
xorl %ecx, %ecx
xorl %esi, %esi
xorl %eax, %eax
cmpl $0x1, %eax
jne 0x59ebb
xorpd 0x49315(%rip), %xmm0    # 0xa31d0
movl %ecx, %eax
xorl $0x1, %eax
orl %esi, %eax
movl $0x1, %eax
cmovnel %esi, %eax
testl %eax, %eax
cmovel %ecx, %eax
movq %rbx, %rdi
movl %eax, %esi
callq 0x5908a
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq