// File: /workspace/github_c_makefile_star2_O0/MartinNovotny25[P]VUT-FIT-IFJ2020/precanalysis.c
// Function: psa_rule_application
bool psa_rule_application(int pocet, tsym_stack_symbol* sym1, tsym_stack_symbol* sym2, tsym_stack_symbol* sym3) {
    //Redukcia ID -> E -> id
    if (pocet == 1) {
        if (sym1->symbol == T_ID) {
            return true;
        } else {
            return false;
        }
    }
        // NON_TERM sa bude pushovat pocas reduce pravidla namiesto popnutych symbolov
    else if (pocet == 3) {
        // E -> (E) Odstranenie zatvoriek
        if (sym1->symbol == T_LEFT_PARENTHESIS && sym2->symbol == T_NON_TERM && sym3->symbol == T_RIGHT_PARENTHESIS) {
            return true;
        }
        // napr E+E -> 1. a 3. symbol je NON_TERM
        if (sym1->symbol == T_NON_TERM && sym3->symbol == T_NON_TERM) {

            if(sym2->symbol == T_PLUS)
                return true;

            else if (sym2->symbol == T_MINUS)
                return true;

            else if (sym2->symbol == T_MUL)
                return true ;

            else if (sym2->symbol == T_DIV)
                return true;

            else if (sym2->symbol == T_EQUAL )
                return true;

            else if (sym2->symbol == T_NEQUAL )
                return true;

            else if (sym2->symbol == T_MOE)
                return true;

            else if (sym2->symbol == T_LOE )
                return true;

            else if (sym2->symbol == T_MORE ) {
                return true;
            }
            else if (sym2->symbol == T_LESS )
                return true;

        } else {
            return false;
        }
        return false;
    }
    return false;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
cmpl $0x1, -0x8(%rbp)
jne 0xc534
movq -0x10(%rbp), %rax
cmpl $0xc, (%rax)
jne 0xc52b
movb $0x1, -0x1(%rbp)
jmp 0xc644
movb $0x0, -0x1(%rbp)
jmp 0xc644
cmpl $0x3, -0x8(%rbp)
jne 0xc63e
movq -0x10(%rbp), %rax
cmpl $0x4, (%rax)
jne 0xc562
movq -0x18(%rbp), %rax
cmpl $0xf, (%rax)
jne 0xc562
movq -0x20(%rbp), %rax
cmpl $0x5, (%rax)
jne 0xc562
movb $0x1, -0x1(%rbp)
jmp 0xc644
movq -0x10(%rbp), %rax
cmpl $0xf, (%rax)
jne 0xc632
movq -0x20(%rbp), %rax
cmpl $0xf, (%rax)
jne 0xc632
movq -0x18(%rbp), %rax
cmpl $0x0, (%rax)
jne 0xc58e
movb $0x1, -0x1(%rbp)
jmp 0xc644
movq -0x18(%rbp), %rax
cmpl $0x1, (%rax)
jne 0xc5a0
movb $0x1, -0x1(%rbp)
jmp 0xc644
movq -0x18(%rbp), %rax
cmpl $0x2, (%rax)
jne 0xc5b2
movb $0x1, -0x1(%rbp)
jmp 0xc644
movq -0x18(%rbp), %rax
cmpl $0x3, (%rax)
jne 0xc5c4
movb $0x1, -0x1(%rbp)
jmp 0xc644
movq -0x18(%rbp), %rax
cmpl $0x6, (%rax)
jne 0xc5d3
movb $0x1, -0x1(%rbp)
jmp 0xc644
movq -0x18(%rbp), %rax
cmpl $0x7, (%rax)
jne 0xc5e2
movb $0x1, -0x1(%rbp)
jmp 0xc644
movq -0x18(%rbp), %rax
cmpl $0x8, (%rax)
jne 0xc5f1
movb $0x1, -0x1(%rbp)
jmp 0xc644
movq -0x18(%rbp), %rax
cmpl $0x9, (%rax)
jne 0xc600
movb $0x1, -0x1(%rbp)
jmp 0xc644
movq -0x18(%rbp), %rax
cmpl $0xb, (%rax)
jne 0xc60f
movb $0x1, -0x1(%rbp)
jmp 0xc644
movq -0x18(%rbp), %rax
cmpl $0xa, (%rax)
jne 0xc61e
movb $0x1, -0x1(%rbp)
jmp 0xc644
jmp 0xc620
jmp 0xc622
jmp 0xc624
jmp 0xc626
jmp 0xc628
jmp 0xc62a
jmp 0xc62c
jmp 0xc62e
jmp 0xc630
jmp 0xc638
movb $0x0, -0x1(%rbp)
jmp 0xc644
movb $0x0, -0x1(%rbp)
jmp 0xc644
jmp 0xc640
movb $0x0, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
popq %rbp
retq
nopl (%rax,%rax)