// File: /workspace/github_c_makefile_star2_O0/olcaytaner[P]Isell/lang.c
// Function: infix_to_postfix_conversion
Expnodeptr infix_to_postfix_conversion(Expnodeptr list)
{
 Expnodeptr s[STACKSIZE];
 int top = -1, currentop, stackop;
 Expnodeptr outputqueue = NULL, tmpoutput = NULL;
 Expnodeptr tmp = list, next;
 while (tmp)
  {
   next = tmp->next;
   if (tmp->type != NO_TYPE)
     tmpoutput = insert_into_exp_list(&outputqueue, tmpoutput, tmp);
   else 
     if (tmp->next && tmp->next->type == NO_TYPE && tmp->next->name[0] == '[') /*function token like myarray in myarray[*/
      {
       top++;
       s[top] = tmp;
      }
     else
       switch (tmp->name[0]) {
         case ',':while (top != -1 && s[top]->name[0] != '[') /*token is an array argument separator*/
                   {
                    tmpoutput = insert_into_exp_list(&outputqueue, tmpoutput, s[top]);
                    top--;
                   }
                  free_expnode(tmp);
                  if (top == -1)
                    return NULL;
                  break;
         case '[':
         case '(':top++;
                  s[top] = tmp;
                  break;
         case ']':while (top != -1 && s[top]->name[0] != '[')
                   {
                    tmpoutput = insert_into_exp_list(&outputqueue, tmpoutput, s[top]);
                    top--;
                   }
                  free_expnode(tmp);
                  if (top == -1)
                    return NULL;
                  free_expnode(s[top]);
                  top--;
                  tmpoutput = insert_into_exp_list(&outputqueue, tmpoutput, s[top]);
                  top--;         
                  break;
         case ')':while (top != -1 && s[top]->name[0] != '(')
                   {
                    tmpoutput = insert_into_exp_list(&outputqueue, tmpoutput, s[top]);
                    top--;
                   }
                  free_expnode(tmp);
                  if (top == -1)
                    return NULL;
                  free_expnode(s[top]);
                  top--;
                  break;
         default :currentop = listindexc(tmp->name[0], operators, 7);
                  if (currentop != -1)
                   {
                    if (top != -1)
                      stackop = listindexc(s[top]->name[0], operators, 7);
                    else 
                      stackop = -1;
                    while (stackop != -1 && has_higher_or_equal_precedence(stackop, currentop))
                     {
                      tmpoutput = insert_into_exp_list(&outputqueue, tmpoutput, s[top]);
                      top--;
                      if (top != -1)
                        stackop = listindexc(s[top]->name[0], operators, 7);
                      else 
                        stackop = -1;
                     }
                    top++;
                    s[top] = tmp;
                   }
                  break;
       }
   tmp = next;
  }
 while (top != -1)
  {
   tmpoutput = insert_into_exp_list(&outputqueue, tmpoutput, s[top]);
   top--;
  }
 if (tmpoutput)
   tmpoutput->next = NULL;
 return outputqueue;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1f90, %rsp           # imm = 0x1F90
movq %rdi, -0x10(%rbp)
movl $0xffffffff, -0x1f54(%rbp) # imm = 0xFFFFFFFF
movq $0x0, -0x1f68(%rbp)
movq $0x0, -0x1f70(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x1f78(%rbp)
cmpq $0x0, -0x1f78(%rbp)
je 0x4dc52
movq -0x1f78(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x1f80(%rbp)
movq -0x1f78(%rbp), %rax
cmpl $-0x1, 0x8(%rax)
je 0x4d79d
movq -0x1f70(%rbp), %rsi
movq -0x1f78(%rbp), %rdx
leaq -0x1f68(%rbp), %rdi
callq 0x4d6d0
movq %rax, -0x1f70(%rbp)
jmp 0x4dc3f
movq -0x1f78(%rbp), %rax
cmpq $0x0, 0x18(%rax)
je 0x4d7fc
movq -0x1f78(%rbp), %rax
movq 0x18(%rax), %rax
cmpl $-0x1, 0x8(%rax)
jne 0x4d7fc
movq -0x1f78(%rbp), %rax
movq 0x18(%rax), %rax
movq (%rax), %rax
movsbl (%rax), %eax
cmpl $0x5b, %eax
jne 0x4d7fc
movl -0x1f54(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1f54(%rbp)
movq -0x1f78(%rbp), %rcx
movslq -0x1f54(%rbp), %rax
movq %rcx, -0x1f50(%rbp,%rax,8)
jmp 0x4dc3d
movq -0x1f78(%rbp), %rax
movq (%rax), %rax
movsbl (%rax), %eax
movl %eax, -0x1f84(%rbp)
subl $0x28, %eax
je 0x4d8fe
jmp 0x4d81a
movl -0x1f84(%rbp), %eax
subl $0x29, %eax
je 0x4da24
jmp 0x4d82b
movl -0x1f84(%rbp), %eax
subl $0x2c, %eax
je 0x4d85d
jmp 0x4d838
movl -0x1f84(%rbp), %eax
subl $0x5b, %eax
je 0x4d8fe
jmp 0x4d849
movl -0x1f84(%rbp), %eax
subl $0x5d, %eax
je 0x4d928
jmp 0x4dae8
jmp 0x4d85f
xorl %eax, %eax
cmpl $-0x1, -0x1f54(%rbp)
movb %al, -0x1f85(%rbp)
je 0x4d891
movslq -0x1f54(%rbp), %rax
movq -0x1f50(%rbp,%rax,8), %rax
movq (%rax), %rax
movsbl (%rax), %eax
cmpl $0x5b, %eax
setne %al
movb %al, -0x1f85(%rbp)
movb -0x1f85(%rbp), %al
testb $0x1, %al
jne 0x4d89d
jmp 0x4d8d7
movq -0x1f70(%rbp), %rsi
movslq -0x1f54(%rbp), %rax
movq -0x1f50(%rbp,%rax,8), %rdx
leaq -0x1f68(%rbp), %rdi
callq 0x4d6d0
movq %rax, -0x1f70(%rbp)
movl -0x1f54(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x1f54(%rbp)
jmp 0x4d85f
movq -0x1f78(%rbp), %rdi
callq 0x4d180
cmpl $-0x1, -0x1f54(%rbp)
jne 0x4d8f9
movq $0x0, -0x8(%rbp)
jmp 0x4dcbb
jmp 0x4dc3b
movl -0x1f54(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1f54(%rbp)
movq -0x1f78(%rbp), %rcx
movslq -0x1f54(%rbp), %rax
movq %rcx, -0x1f50(%rbp,%rax,8)
jmp 0x4dc3b
jmp 0x4d92a
xorl %eax, %eax
cmpl $-0x1, -0x1f54(%rbp)
movb %al, -0x1f86(%rbp)
je 0x4d95c
movslq -0x1f54(%rbp), %rax
movq -0x1f50(%rbp,%rax,8), %rax
movq (%rax), %rax
movsbl (%rax), %eax
cmpl $0x5b, %eax
setne %al
movb %al, -0x1f86(%rbp)
movb -0x1f86(%rbp), %al
testb $0x1, %al
jne 0x4d968
jmp 0x4d9a2
movq -0x1f70(%rbp), %rsi
movslq -0x1f54(%rbp), %rax
movq -0x1f50(%rbp,%rax,8), %rdx
leaq -0x1f68(%rbp), %rdi
callq 0x4d6d0
movq %rax, -0x1f70(%rbp)
movl -0x1f54(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x1f54(%rbp)
jmp 0x4d92a
movq -0x1f78(%rbp), %rdi
callq 0x4d180
cmpl $-0x1, -0x1f54(%rbp)
jne 0x4d9c4
movq $0x0, -0x8(%rbp)
jmp 0x4dcbb
movslq -0x1f54(%rbp), %rax
movq -0x1f50(%rbp,%rax,8), %rdi
callq 0x4d180
movl -0x1f54(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x1f54(%rbp)
movq -0x1f70(%rbp), %rsi
movslq -0x1f54(%rbp), %rax
movq -0x1f50(%rbp,%rax,8), %rdx
leaq -0x1f68(%rbp), %rdi
callq 0x4d6d0
movq %rax, -0x1f70(%rbp)
movl -0x1f54(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x1f54(%rbp)
jmp 0x4dc3b
jmp 0x4da26
xorl %eax, %eax
cmpl $-0x1, -0x1f54(%rbp)
movb %al, -0x1f87(%rbp)
je 0x4da58
movslq -0x1f54(%rbp), %rax
movq -0x1f50(%rbp,%rax,8), %rax
movq (%rax), %rax
movsbl (%rax), %eax
cmpl $0x28, %eax
setne %al
movb %al, -0x1f87(%rbp)
movb -0x1f87(%rbp), %al
testb $0x1, %al
jne 0x4da64
jmp 0x4da9e
movq -0x1f70(%rbp), %rsi
movslq -0x1f54(%rbp), %rax
movq -0x1f50(%rbp,%rax,8), %rdx
leaq -0x1f68(%rbp), %rdi
callq 0x4d6d0
movq %rax, -0x1f70(%rbp)
movl -0x1f54(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x1f54(%rbp)
jmp 0x4da26
movq -0x1f78(%rbp), %rdi
callq 0x4d180
cmpl $-0x1, -0x1f54(%rbp)
jne 0x4dac0
movq $0x0, -0x8(%rbp)
jmp 0x4dcbb
movslq -0x1f54(%rbp), %rax
movq -0x1f50(%rbp,%rax,8), %rdi
callq 0x4d180
movl -0x1f54(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x1f54(%rbp)
jmp 0x4dc3b
movq -0x1f78(%rbp), %rax
movq (%rax), %rax
leaq 0xb72a4(%rip), %rsi     # 0x104d9d
movl $0x7, %edx
movsbl (%rax), %edi
callq 0x54aa0
movl %eax, -0x1f58(%rbp)
cmpl $-0x1, -0x1f58(%rbp)
je 0x4dc39
cmpl $-0x1, -0x1f54(%rbp)
je 0x4db50
movslq -0x1f54(%rbp), %rax
movq -0x1f50(%rbp,%rax,8), %rax
movq (%rax), %rax
leaq 0xb7262(%rip), %rsi     # 0x104d9d
movl $0x7, %edx
movsbl (%rax), %edi
callq 0x54aa0
movl %eax, -0x1f5c(%rbp)
jmp 0x4db5a
movl $0xffffffff, -0x1f5c(%rbp) # imm = 0xFFFFFFFF
jmp 0x4db5c
xorl %eax, %eax
cmpl $-0x1, -0x1f5c(%rbp)
movb %al, -0x1f88(%rbp)
je 0x4db8a
movl -0x1f5c(%rbp), %edi
movl -0x1f58(%rbp), %esi
callq 0x4d670
cmpl $0x0, %eax
setne %al
movb %al, -0x1f88(%rbp)
movb -0x1f88(%rbp), %al
testb $0x1, %al
jne 0x4db96
jmp 0x4dc14
movq -0x1f70(%rbp), %rsi
movslq -0x1f54(%rbp), %rax
movq -0x1f50(%rbp,%rax,8), %rdx
leaq -0x1f68(%rbp), %rdi
callq 0x4d6d0
movq %rax, -0x1f70(%rbp)
movl -0x1f54(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x1f54(%rbp)
cmpl $-0x1, -0x1f54(%rbp)
je 0x4dc05
movslq -0x1f54(%rbp), %rax
movq -0x1f50(%rbp,%rax,8), %rax
movq (%rax), %rax
leaq 0xb71ad(%rip), %rsi     # 0x104d9d
movl $0x7, %edx
movsbl (%rax), %edi
callq 0x54aa0
movl %eax, -0x1f5c(%rbp)
jmp 0x4dc0f
movl $0xffffffff, -0x1f5c(%rbp) # imm = 0xFFFFFFFF
jmp 0x4db5c
movl -0x1f54(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1f54(%rbp)
movq -0x1f78(%rbp), %rcx
movslq -0x1f54(%rbp), %rax
movq %rcx, -0x1f50(%rbp,%rax,8)
jmp 0x4dc3b
jmp 0x4dc3d
jmp 0x4dc3f
movq -0x1f80(%rbp), %rax
movq %rax, -0x1f78(%rbp)
jmp 0x4d74a
jmp 0x4dc54
cmpl $-0x1, -0x1f54(%rbp)
je 0x4dc97
movq -0x1f70(%rbp), %rsi
movslq -0x1f54(%rbp), %rax
movq -0x1f50(%rbp,%rax,8), %rdx
leaq -0x1f68(%rbp), %rdi
callq 0x4d6d0
movq %rax, -0x1f70(%rbp)
movl -0x1f54(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x1f54(%rbp)
jmp 0x4dc54
cmpq $0x0, -0x1f70(%rbp)
je 0x4dcb0
movq -0x1f70(%rbp), %rax
movq $0x0, 0x18(%rax)
movq -0x1f68(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x1f90, %rsp           # imm = 0x1F90
popq %rbp
retq
nopl (%rax,%rax)