// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movl $0x0, -0xc(%rbp)
movl $0x0, -0x10(%rbp)
movl $0x0, -0x14(%rbp)
movl $0x0, -0x18(%rbp)
movl $0x0, -0x20(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x28(%rbp)
callq 0x82340
movq %rax, -0x38(%rbp)
movq -0x8(%rbp), %rdi
callq 0x4150
movl %eax, -0x1c(%rbp)
movl -0xc(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jge 0x822e1
movq -0x8(%rbp), %rax
movslq -0xc(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x78, %eax
jne 0x82109
movl $0x1, -0x14(%rbp)
movl $0x0, -0x20(%rbp)
movsd -0x28(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x82104
jp 0x82104
movsd 0x5ff19(%rip), %xmm0    # 0xe2018
movsd %xmm0, -0x28(%rbp)
jmp 0x822d3
movq -0x8(%rbp), %rax
movslq -0xc(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x2b, %eax
je 0x8212f
movq -0x8(%rbp), %rax
movslq -0xc(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x2d, %eax
jne 0x821da
cmpl $0x0, -0xc(%rbp)
jne 0x8215b
movq -0x8(%rbp), %rax
movslq -0xc(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x2d, %eax
jne 0x8214d
movl $0x1, -0x18(%rbp)
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x820bc
cmpl $0x1, -0x14(%rbp)
jne 0x8216e
cmpl $0x0, -0x10(%rbp)
jne 0x8216e
movl $0x1, -0x10(%rbp)
cmpl $0x1, -0x18(%rbp)
jne 0x82186
movsd 0x608cc(%rip), %xmm0    # 0xe2a48
mulsd -0x28(%rbp), %xmm0
movsd %xmm0, -0x28(%rbp)
movq -0x38(%rbp), %rdi
movl -0x10(%rbp), %esi
movsd -0x28(%rbp), %xmm0
callq 0x80e00
movq -0x8(%rbp), %rax
movslq -0xc(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x2b, %eax
jne 0x821b1
movl $0x0, -0x18(%rbp)
jmp 0x821b8
movl $0x1, -0x18(%rbp)
movl $0x0, -0x10(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x28(%rbp)
movl $0x0, -0x14(%rbp)
movl $0x0, -0x20(%rbp)
jmp 0x822d1
movq -0x8(%rbp), %rax
movslq -0xc(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x30, %eax
jl 0x822a8
movq -0x8(%rbp), %rax
movslq -0xc(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x39, %eax
jg 0x822a8
cmpl $0x0, -0x14(%rbp)
jne 0x8228e
cmpl $0x0, -0x20(%rbp)
jne 0x8224c
movsd -0x28(%rbp), %xmm0
movq -0x8(%rbp), %rax
movslq -0xc(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cvtsi2sd %eax, %xmm1
movsd 0x62717(%rip), %xmm2    # 0xe4948
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd 0x65587(%rip), %xmm1    # 0xe77c8
subsd %xmm1, %xmm0
movsd %xmm0, -0x28(%rbp)
jmp 0x8228c
movsd -0x28(%rbp), %xmm1
movq -0x8(%rbp), %rax
movslq -0xc(%rbp), %rcx
movsbl (%rax,%rcx), %eax
subl $0x30, %eax
cvtsi2sd %eax, %xmm0
movsd -0x30(%rbp), %xmm2
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x28(%rbp)
movsd -0x30(%rbp), %xmm0
movsd 0x626c5(%rip), %xmm1    # 0xe4948
divsd %xmm1, %xmm0
movsd %xmm0, -0x30(%rbp)
jmp 0x822a6
imull $0xa, -0x10(%rbp), %eax
movq -0x8(%rbp), %rcx
movslq -0xc(%rbp), %rdx
movsbl (%rcx,%rdx), %ecx
addl %ecx, %eax
subl $0x30, %eax
movl %eax, -0x10(%rbp)
jmp 0x822cf
movq -0x8(%rbp), %rax
movslq -0xc(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x2e, %eax
jne 0x822cd
movl $0x1, -0x20(%rbp)
movsd 0x653d8(%rip), %xmm0    # 0xe76a0
movsd %xmm0, -0x30(%rbp)
jmp 0x822cf
jmp 0x822d1
jmp 0x822d3
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x820bc
cmpl $0x1, -0x18(%rbp)
jne 0x822f9
movsd 0x60759(%rip), %xmm0    # 0xe2a48
mulsd -0x28(%rbp), %xmm0
movsd %xmm0, -0x28(%rbp)
cmpl $0x1, -0x14(%rbp)
jne 0x8230c
cmpl $0x0, -0x10(%rbp)
jne 0x8230c
movl $0x1, -0x10(%rbp)
cmpl $0x0, -0x10(%rbp)
je 0x82325
movq -0x38(%rbp), %rdi
movl -0x10(%rbp), %esi
movsd -0x28(%rbp), %xmm0
callq 0x80e00
jmp 0x82336
movq -0x38(%rbp), %rdi
movl -0x14(%rbp), %esi
movsd -0x28(%rbp), %xmm0
callq 0x80e00
movq -0x38(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq