// File: /workspace/github_c_makefile_star2_O3/olcaytaner[P]Isell/poly.c
// Function: plus_minus_token_list
char** plus_minus_token_list(char* st, int* tokencount)
{
	/*!Last Changed 19.01.2005*/
 int i = 0, j, k, len = strlen(st), parcount = 0, pos = 0, add, minus = 0, linelength;
 char line[READLINELENGTH], **tokenlist = NULL;
	*tokencount = 0;
 while (i < len)
	 {
		 add = 0;
		 if (st[i] == '(')
			 {
				 parcount++;
					add = 1;
			 }
			else
				 if (st[i] == ')')
					 {
						 parcount--;
							add = 1;
					 }
					else
						 if (st[i] == '+' || st[i] == '-')
								 if (parcount == 0)
									 {
											tokenlist = alloc(tokenlist, ((*tokencount) + 1) * sizeof(char *), (*tokencount) + 1);
											linelength = strlen(line);
  									tokenlist[*tokencount] = safemalloc(sizeof(char) * (linelength + minus + 1), "plus_minus_token_list", 24);
           for (j = 0; j < minus; j++)
											  tokenlist[*tokencount][j] = '-';
											for (j = minus, k = 0; j < linelength + minus; j++, k++)
												 tokenlist[*tokencount][j] = line[k];
           tokenlist[*tokencount][j] = '\0';
										 (*tokencount)++;
											if (st[i] == '-')
												 minus = 1;
											else
												 minus = 0;
											pos = 0;
									 }
									else
									  add = 1;
							else
							  add = 1;
			if (add)
			 {
					line[pos] = st[i];
					pos++;
					line[pos] = '\0';
			 }
		 i++;
	 }
	if (pos != 0)
	 {
			tokenlist = alloc(tokenlist, ((*tokencount) + 1) * sizeof(char *), (*tokencount) + 1);
			linelength = strlen(line);
  	tokenlist[*tokencount] = safemalloc(sizeof(char) * (linelength + minus + 1), "plus_minus_token_list", 53);
   for (j = 0; j < minus; j++)
					tokenlist[*tokencount][j] = '-';
			for (j = minus, k = 0; j < linelength + minus; j++, k++)
					tokenlist[*tokencount][j] = line[k];
   tokenlist[*tokencount][j] = '\0';
			(*tokencount)++;
	 }
	return tokenlist;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x7a148, %rsp          # imm = 0x7A148
movq %rsi, %rbx
movq %rdi, %r13
callq 0x4190
movl $0x0, (%rbx)
xorl %edx, %edx
testl %eax, %eax
jle 0x5b071
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
leaq 0x4fea8(%rip), %r15     # 0xaad5c
xorl %r9d, %r9d
xorl %r14d, %r14d
xorl %r12d, %r12d
movq %r13, 0x18(%rsp)
addq %r9, %r13
movq %rax, %r8
subq %r9, %r8
xorl %ebp, %ebp
xorl %ecx, %ecx
movzbl (%r13,%rbp), %esi
leal -0x28(%rsi), %edi
cmpl $0x5, %edi
ja 0x5aef2
movslq (%r15,%rdi,4), %rdi
addq %r15, %rdi
jmpq *%rdi
testl %ecx, %ecx
jne 0x5aef2
jmp 0x5af09
decl %ecx
jmp 0x5aef2
incl %ecx
movb %sil, 0x20(%rsp,%rbp)
movb $0x0, 0x21(%rsp,%rbp)
incq %rbp
cmpq %rbp, %r8
jne 0x5aecf
jmp 0x5afe0
movq %r9, 0x8(%rsp)
movq %rax, 0x10(%rsp)
movslq %edx, %rax
incl %edx
leaq 0x8(,%rax,8), %rsi
movq %r14, %rdi
callq 0x3a0b4
movq %rax, %r14
leaq 0x20(%rsp), %rdi
callq 0x4190
movq %rax, (%rsp)
addl %r12d, %eax
incl %eax
movslq %eax, %rdi
leaq 0x4fe84(%rip), %rsi     # 0xaadcc
movl $0x18, %edx
callq 0x3a0e1
movslq (%rbx), %rcx
movq %rax, (%r14,%rcx,8)
testl %r12d, %r12d
je 0x5af68
movslq (%rbx), %rax
movq (%r14,%rax,8), %rax
movb $0x2d, (%rax)
movq (%rsp), %rcx
testl %ecx, %ecx
movq 0x10(%rsp), %rax
movq 0x8(%rsp), %r8
jle 0x5af9f
addl %r12d, %ecx
movl %r12d, %r12d
movl %ecx, %edi
leaq 0x20(%rsp), %rcx
movb (%rcx), %dl
movslq (%rbx), %rsi
movq (%r14,%rsi,8), %rsi
movb %dl, (%rsi,%r12)
incq %r12
incq %rcx
cmpq %rdi, %r12
jb 0x5af87
movslq (%rbx), %rcx
movq (%r14,%rcx,8), %rdx
movslq %r12d, %rcx
movb $0x0, (%rdx,%rcx)
movl (%rbx), %edx
incl %edx
movl %edx, (%rbx)
xorl %r12d, %r12d
cmpb $0x2d, (%r13,%rbp)
sete %r12b
leaq (%r8,%rbp), %r9
incq %r9
notq %r8
addq %rax, %r8
cmpq %rbp, %r8
movq 0x18(%rsp), %r13
jne 0x5aec2
jmp 0x5b074
movslq %edx, %rax
incl %edx
leaq 0x8(,%rax,8), %rsi
movq %r14, %rdi
callq 0x3a0b4
movq %rax, %r14
leaq 0x20(%rsp), %rdi
callq 0x4190
movq %rax, %r15
addl %r12d, %eax
incl %eax
movslq %eax, %rdi
leaq 0x4fdb8(%rip), %rsi     # 0xaadcc
movl $0x35, %edx
callq 0x3a0e1
movslq (%rbx), %rcx
movq %rax, (%r14,%rcx,8)
testl %r12d, %r12d
je 0x5b034
movslq (%rbx), %rax
movq (%r14,%rax,8), %rax
movb $0x2d, (%rax)
testl %r15d, %r15d
jle 0x5b05f
addl %r12d, %r15d
movl %r12d, %r12d
movl %r15d, %eax
leaq 0x20(%rsp), %rcx
movb (%rcx), %dl
movslq (%rbx), %rsi
movq (%r14,%rsi,8), %rsi
movb %dl, (%rsi,%r12)
incq %r12
incq %rcx
cmpq %rax, %r12
jb 0x5b047
movslq (%rbx), %rax
movq (%r14,%rax,8), %rax
movslq %r12d, %rcx
movb $0x0, (%rax,%rcx)
incl (%rbx)
jmp 0x5b074
xorl %r14d, %r14d
movq %r14, %rax
addq $0x7a148, %rsp          # imm = 0x7A148
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq