// File: /workspace/github_c_makefile_star2_O0/olcaytaner[P]Isell/poly.c
// Function: create_function
Function create_function(char* st)
{
	/*!Last Changed 19.01.2005*/
	Function tmp;
	Functionnodeptr tmpnode;
	char* functionp, *minp, *maxp, **tokens;
 char* parts[6];
	int i, tokencount, j;
	tmp.min = 0;
	tmp.max = -1;
	functionp = strtok(st, " \n");
	if (!functionp)
		 return tmp;
 minp = strtok(NULL, " \n");
	if (!minp)
		 return tmp;
 maxp = strtok(NULL, " \n");
	if (!maxp)
		 return tmp;
	tmp.min = atof(minp);
	tmp.max = atof(maxp);
	if (tmp.min > tmp.max)
		 return tmp;
	tmp.start = NULL;
	tmp.end = NULL;
	tokens = plus_minus_token_list(functionp, &tokencount);
	for (j = 0; j < tokencount; j++)
	 {
		 tmpnode = safemalloc(sizeof(Functionnode), "create_function", 26);
			tmpnode->next = NULL;
   divide_function_into_parts(tokens[j], parts);
			if (parts[0])
				 tmpnode->coefficient = atof(parts[0]);
			else
			  tmpnode->coefficient = 1;
			if (parts[1]) 
				 tmpnode->xpower = atoi(parts[1]);
			else
				 tmpnode->xpower = 0;
			if (parts[2])
			 {
				 tmpnode->sinpower = atoi(parts[2]);
					if (parts[3])
						 tmpnode->sinus = read_polynom(parts[3]);
					else
					  tmpnode->sinus = NULL;
			 }
			else
				 tmpnode->sinpower = 0;
			if (parts[4])
			 {
				 tmpnode->cospower = atoi(parts[4]);
					if (parts[5])
						 tmpnode->cosinus = read_polynom(parts[5]);
					else
					  tmpnode->cosinus = NULL;
			 }
			else
				 tmpnode->cospower = 0;
			for (i = 0; i < 6; i++)
				 if (parts[i])
						 safe_free(parts[i]);
			if (tmp.end)
			 {
				 tmp.end->next = tmpnode;
					tmp.end = tmpnode;
			 }
			else
			 {
				 tmp.start = tmpnode;
					tmp.end = tmpnode;
			 }
	 }
	free_2d((void**)tokens, tokencount);
	return tmp;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x80(%rbp)
movq %rdi, %rax
movq %rax, -0x78(%rbp)
movq %rsi, -0x8(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, 0x10(%rdi)
movsd 0x60c6e(%rip), %xmm0    # 0xe2a48
movsd %xmm0, 0x18(%rdi)
movq -0x8(%rbp), %rdi
leaq 0x6baca(%rip), %rsi     # 0xed8b4
callq 0x4230
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x81dff
jmp 0x8205c
xorl %eax, %eax
movl %eax, %edi
leaq 0x6baaa(%rip), %rsi     # 0xed8b4
callq 0x4230
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0x81e1f
jmp 0x8205c
xorl %eax, %eax
movl %eax, %edi
leaq 0x6ba8a(%rip), %rsi     # 0xed8b4
callq 0x4230
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
jne 0x81e3f
jmp 0x8205c
movq -0x20(%rbp), %rdi
callq 0x4100
movq -0x80(%rbp), %rax
movsd %xmm0, 0x10(%rax)
movq -0x28(%rbp), %rdi
callq 0x4100
movq -0x80(%rbp), %rax
movsd %xmm0, 0x18(%rax)
movsd 0x10(%rax), %xmm0
ucomisd 0x18(%rax), %xmm0
jbe 0x81e74
jmp 0x8205c
movq -0x80(%rbp), %rax
movq $0x0, (%rax)
movq $0x0, 0x8(%rax)
movq -0x18(%rbp), %rdi
leaq -0x68(%rbp), %rsi
callq 0x81a00
movq %rax, -0x30(%rbp)
movl $0x0, -0x6c(%rbp)
movl -0x6c(%rbp), %eax
cmpl -0x68(%rbp), %eax
jge 0x82050
movl $0x30, %edi
leaq 0x6597b(%rip), %rsi     # 0xe7832
movl $0x1a, %edx
callq 0x52d70
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq $0x0, 0x28(%rax)
movq -0x30(%rbp), %rax
movslq -0x6c(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq -0x60(%rbp), %rsi
callq 0x81610
cmpq $0x0, -0x60(%rbp)
je 0x81f00
movq -0x60(%rbp), %rdi
callq 0x4100
movq -0x10(%rbp), %rax
movsd %xmm0, (%rax)
jmp 0x81f10
movq -0x10(%rbp), %rax
movsd 0x6010c(%rip), %xmm0    # 0xe2018
movsd %xmm0, (%rax)
cmpq $0x0, -0x58(%rbp)
je 0x81f2b
movq -0x58(%rbp), %rdi
callq 0x41c0
movl %eax, %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x8(%rax)
jmp 0x81f36
movq -0x10(%rbp), %rax
movl $0x0, 0x8(%rax)
cmpq $0x0, -0x50(%rbp)
je 0x81f7a
movq -0x50(%rbp), %rdi
callq 0x41c0
movl %eax, %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0xc(%rax)
cmpq $0x0, -0x48(%rbp)
je 0x81f6c
movq -0x48(%rbp), %rdi
callq 0x82070
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x10(%rax)
jmp 0x81f78
movq -0x10(%rbp), %rax
movq $0x0, 0x10(%rax)
jmp 0x81f85
movq -0x10(%rbp), %rax
movl $0x0, 0xc(%rax)
cmpq $0x0, -0x40(%rbp)
je 0x81fc9
movq -0x40(%rbp), %rdi
callq 0x41c0
movl %eax, %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x18(%rax)
cmpq $0x0, -0x38(%rbp)
je 0x81fbb
movq -0x38(%rbp), %rdi
callq 0x82070
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x20(%rax)
jmp 0x81fc7
movq -0x10(%rbp), %rax
movq $0x0, 0x20(%rax)
jmp 0x81fd4
movq -0x10(%rbp), %rax
movl $0x0, 0x18(%rax)
movl $0x0, -0x64(%rbp)
cmpl $0x6, -0x64(%rbp)
jge 0x82008
movslq -0x64(%rbp), %rax
cmpq $0x0, -0x60(%rbp,%rax,8)
je 0x81ffb
movslq -0x64(%rbp), %rax
movq -0x60(%rbp,%rax,8), %rdi
callq 0x52e80
jmp 0x81ffd
movl -0x64(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x64(%rbp)
jmp 0x81fdb
movq -0x80(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x8202d
movq -0x80(%rbp), %rax
movq -0x10(%rbp), %rdx
movq 0x8(%rax), %rcx
movq %rdx, 0x28(%rcx)
movq -0x10(%rbp), %rcx
movq %rcx, 0x8(%rax)
jmp 0x82040
movq -0x80(%rbp), %rax
movq -0x10(%rbp), %rcx
movq %rcx, (%rax)
movq -0x10(%rbp), %rcx
movq %rcx, 0x8(%rax)
jmp 0x82042
movl -0x6c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x6c(%rbp)
jmp 0x81e9f
movq -0x30(%rbp), %rdi
movl -0x68(%rbp), %esi
callq 0x52e20
movq -0x78(%rbp), %rax
addq $0x80, %rsp
popq %rbp
retq
nopl (%rax)