// File: /workspace/github_c_makefile_star2_O1/olcaytaner[P]Isell/binary.c
// Function: read_binary_function
Binaryfunctionptr read_binary_function(char* st)
{
 /*!Last Changed 19.04.2008*/
 int i, index = 0;
 Binaryfunctionptr result = NULL;
 Binaryterm term;
 term.count = 0;
 term.complement = NULL;
 term.variables = NULL;
 for (i = 0; i < strlen(st); i++)
  {
   switch (st[i])
    {
     case  '+':if (result == NULL)
                 result = empty_binary_function();
               add_binary_term(result, term);
               term.count = 0;
               term.complement = NULL;
               term.variables = NULL;
               break;
     case '\'':if (term.count > 0)
                 term.complement[term.count - 1] = BOOLEAN_TRUE;
               break;
     case  'x':term.count++;
               term.variables = (int *) alloc(term.variables, term.count * sizeof(int), term.count);
               term.complement = (BOOLEAN *) alloc(term.complement, term.count * sizeof(BOOLEAN), term.count);
               break;
     case  '0':
     case  '1':
     case  '2':
     case  '3':
     case  '4':
     case  '5':
     case  '6':
     case  '7':
     case  '8':
     case  '9':if (term.count > 0)
                {
                 index = st[i] - '0';
                 term.variables[term.count - 1] = index;
                 term.complement[term.count - 1] = BOOLEAN_FALSE;
                }
               break;
    }
  }
 if (result == NULL)
   result = empty_binary_function();
 add_binary_term(result, term);
 return result;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
cmpb $0x0, (%rdi)
je 0x69e4
movq %rdi, %r13
xorl %r15d, %r15d
xorl %r12d, %r12d
xorl %ebp, %ebp
xorl %r14d, %r14d
xorl %ebx, %ebx
movzbl (%r13,%r15), %eax
leal -0x30(%rax), %ecx
cmpl $0xa, %ecx
jae 0x6911
testl %ebx, %ebx
jle 0x68fc
movsbl %al, %eax
addl $-0x30, %eax
movl %ebx, %ecx
movl %eax, -0x4(%rbp,%rcx,4)
movl $0x0, -0x4(%r14,%rcx,4)
incq %r15
movq %r13, %rdi
callq 0x4190
cmpq %r15, %rax
ja 0x68d5
jmp 0x69ee
cmpl $0x27, %eax
je 0x69cc
cmpl $0x78, %eax
je 0x699a
cmpl $0x2b, %eax
jne 0x68fc
testq %r12, %r12
jne 0x6950
movl $0x10, %edi
leaq 0x9c376(%rip), %rsi     # 0xa2cab
movl $0x2, %edx
callq 0x390f5
movq %rax, %r12
movl $0x0, 0x8(%rax)
movq $0x0, (%rax)
movslq 0x8(%r12), %rax
leaq 0x1(%rax), %rdx
movl %edx, 0x8(%r12)
movq (%r12), %rdi
leaq 0x8(,%rax,8), %rax
leaq (%rax,%rax,2), %rsi
callq 0x390c8
movq %rax, (%r12)
movslq 0x8(%r12), %rcx
leaq (%rcx,%rcx,2), %rcx
movq %rbp, -0x18(%rax,%rcx,8)
movq %r14, -0x10(%rax,%rcx,8)
movl %ebx, -0x8(%rax,%rcx,8)
xorl %ebx, %ebx
xorl %r14d, %r14d
xorl %ebp, %ebp
jmp 0x68fc
movslq %ebx, %rax
incl %ebx
movq %rbp, %rdi
leaq 0x4(,%rax,4), %rbp
movq %rbp, %rsi
movl %ebx, %edx
callq 0x390c8
movq %r14, %rdi
movq %rbp, %rsi
movq %rax, %rbp
movl %ebx, %edx
callq 0x390c8
movq %rax, %r14
jmp 0x68fc
testl %ebx, %ebx
jle 0x68fc
movl %ebx, %eax
movl $0x1, -0x4(%r14,%rax,4)
jmp 0x68fc
xorl %ebx, %ebx
xorl %r14d, %r14d
xorl %ebp, %ebp
xorl %r12d, %r12d
testq %r12, %r12
jne 0x6a1a
leaq 0x9c2b1(%rip), %rsi     # 0xa2cab
movl $0x10, %edi
movl $0x2, %edx
callq 0x390f5
movq %rax, %r12
movl $0x0, 0x8(%rax)
movq $0x0, (%rax)
movslq 0x8(%r12), %rax
leaq 0x1(%rax), %rdx
movl %edx, 0x8(%r12)
movq (%r12), %rdi
leaq 0x8(,%rax,8), %rax
leaq (%rax,%rax,2), %rsi
callq 0x390c8
movq %rax, (%r12)
movslq 0x8(%r12), %rcx
leaq (%rcx,%rcx,2), %rcx
movq %rbp, -0x18(%rax,%rcx,8)
movq %r14, -0x10(%rax,%rcx,8)
movl %ebx, -0x8(%rax,%rcx,8)
movq %r12, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq