// File: /workspace/github_c_makefile_star2_O2/olcaytaner[P]Isell/lang.c
// Function: evaluate_expression_list
variableptr evaluate_expression_list(Expnodeptr list)
{
 /*!Last Changed 12.08.2010*/
 /*!Last Changed 03.01.2006*/
 variableptr result, tmparray;
 char st[MAXLENGTH];
 Expnodeptr s[STACKSIZE];
 Stackptr indexstack;
 Expnodeptr tmp, operand1, operand2, tmpresult, next;
 int top = -1, optype, index;
 tmp = infix_to_postfix_conversion(list);
 while (tmp)
  {
   next = tmp->next;
   if (tmp->type != NO_TYPE)
    {
     top++;
     s[top] = tmp;
    }
   else
    {
     optype = listindexc(tmp->name[0], operators, 7);
     if (optype == -1)
      {
       sprintf(st, "%s[]", tmp->name);
       tmparray = get_variable(st);
       if (tmparray && tmparray->type == ARRAY_TYPE)
        {
         indexstack = stack();
         while (tmparray->type == ARRAY_TYPE)
          {
           operand1 = s[top];
           if (operand1->type == INTEGER_TYPE)
             index = operand1->value.intvalue;
           else 
             index = (int) operand1->value.floatvalue;
           push(indexstack, index);
           tmparray = &(tmparray->value.array[0]);
           top--;
           free_expnode(operand1);
          }
         tmparray = get_variable(st);
         while (tmparray->type == ARRAY_TYPE)
          {
           index = pop(indexstack);
           tmparray = &(tmparray->value.array[index - 1]);
          }
         free_stack(indexstack);
         tmpresult = safemalloc(sizeof(Expnode), "evaluate_expression_list", 33);
         tmpresult->type = tmparray->type;
         if (tmparray->type == INTEGER_TYPE)
           tmpresult->value.intvalue = tmparray->value.intvalue;
         else
           tmpresult->value.floatvalue = tmparray->value.floatvalue;
         top++;
         s[top] = tmpresult;
        }
       else
         return NULL;
      }
     else 
      {
       operand2 = s[top];
       top--;
       operand1 = s[top];
       top--;
       tmpresult = evaluate_operation(operand1, operand2, optype);
       free_expnode(operand1);
       free_expnode(operand2);
       top++;
       s[top] = tmpresult;
      }
     free_expnode(tmp);
    }
   tmp = next;
  }
 result = safemalloc(sizeof(struct variable), "evaluate_expression_list", 69);
 result->value = s[top]->value;
 result->type = s[top]->type;
 free_expnode(s[top]);
 return result;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x7c078, %rsp          # imm = 0x7C078
callq 0x31b27
movq %rax, %r15
pushq $-0x1
popq %r13
movslq %r13d, %rbp
testq %r15, %r15
je 0x313ec
movq 0x18(%r15), %r12
cmpl $-0x1, 0x8(%r15)
je 0x31285
leal 0x1(%rbp), %r13d
movq %r15, 0x18(%rsp,%rbp,8)
movq %r12, %r15
jmp 0x31260
movq (%r15), %rax
movsbl (%rax), %edi
leaq 0x9bb3b(%rip), %rsi     # 0xccdcd
pushq $0x7
popq %rdx
callq 0x35ff2
cmpl $-0x1, %eax
movq %r12, 0x8(%rsp)
je 0x312e1
movq 0x8(%rsp,%rbp,8), %rbx
movq 0x10(%rsp,%rbp,8), %r14
leal -0x1(%rbp), %r13d
movq %rbx, %rdi
movq %r14, %rsi
movl %eax, %edx
callq 0x319d3
movq %rax, %r12
movq %rbx, %rdi
callq 0x31823
movq %r14, %rdi
callq 0x31823
movq %r12, 0x8(%rsp,%rbp,8)
movq 0x8(%rsp), %rbx
jmp 0x313dc
movq (%r15), %rdx
leaq 0x1f50(%rsp), %rbx
movq %rbx, %rdi
leaq 0x68368(%rip), %rsi     # 0x9965e
xorl %eax, %eax
callq 0x41b0
movq %rbx, %rdi
callq 0x3092c
testq %rax, %rax
je 0x3141a
movq %rax, %rbx
cmpl $0x3, (%rax)
jne 0x3141a
xorl %eax, %eax
callq 0x19a2f
movq %rax, %r12
leal 0x1(%rbp), %r13d
leaq (%rsp,%rbp,8), %rbp
addq $0x10, %rbp
cmpl $0x3, (%rbx)
jne 0x31369
movq (%rbp), %r14
cmpl $0x0, 0x8(%r14)
je 0x31348
cvttsd2si 0x10(%r14), %esi
jmp 0x3134c
movl 0x10(%r14), %esi
movq %r12, %rdi
callq 0x19a4d
movq 0x28(%rbx), %rbx
movq %r14, %rdi
callq 0x31823
decl %r13d
addq $-0x8, %rbp
jmp 0x31330
leaq 0x1f50(%rsp), %rdi
callq 0x3092c
movq %rax, %rbx
cmpl $0x3, (%rbx)
jne 0x3139a
movq %r12, %rdi
callq 0x19a6b
movq 0x28(%rbx), %rcx
cltq
imulq $0x30, %rax, %rax
leaq (%rcx,%rax), %rbx
addq $-0x30, %rbx
jmp 0x31379
movq %r12, %rdi
callq 0x19a87
pushq $0x20
popq %rdi
leaq 0x682b7(%rip), %rsi     # 0x99663
pushq $0x21
popq %rdx
callq 0x34f59
movl (%rbx), %ecx
movl %ecx, 0x8(%rax)
testl %ecx, %ecx
je 0x313c9
movsd 0x28(%rbx), %xmm0
movsd %xmm0, 0x10(%rax)
jmp 0x313cf
movl 0x28(%rbx), %ecx
movl %ecx, 0x10(%rax)
movq 0x8(%rsp), %rbx
movslq %r13d, %rcx
movq %rax, 0x10(%rsp,%rcx,8)
movq %r15, %rdi
callq 0x31823
movq %rbx, %r15
jmp 0x31260
leaq 0x68270(%rip), %rsi     # 0x99663
pushq $0x30
popq %rdi
pushq $0x45
popq %rdx
callq 0x34f59
movq %rax, %rbx
movq 0x10(%rsp,%rbp,8), %rdi
movq 0x10(%rdi), %rax
movq %rax, 0x28(%rbx)
movl 0x8(%rdi), %eax
movl %eax, (%rbx)
callq 0x31823
jmp 0x3141c
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x7c078, %rsp          # imm = 0x7C078
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq