// File: /workspace/github_c_makefile_star2_O1/MartinNovotny25[P]VUT-FIT-IFJ2020/parser.c
// Function: rule_for_def
void rule_for_def() {
    switch (token.type) {
        case t_IDENTIFIER:
            token = get_next_token(stdin);
            TDLLInsertLast(&tokens, token);
            //kontrola, ci pride inicializacia alebo definicia -- Neviem ci je IBA priradenie hodnoty možné, ak áno, iteračná premenná musí byť definovaná dopredu
            if (token.type != t_DEFINITION_2) {error_call(ERR_SYN, &tokens);}
            else {token = get_next_token(stdin);  TDLLInsertLast(&tokens, token);}

            TDLLInitList(&psa_list);

            while (token.type != T_SEMICOLON) {
                if ((token.type == t_PLUS)
                    || (token.type == t_MINUS)
                    || (token.type == t_DIVIDE)
                    || (token.type == t_MULTIPLY)
                    || (token.type == t_RIGHT_BRACKET)
                    || (token.type == t_LEFT_BRACKET)
                    || (token.type == t_LESS)
                    || (token.type == t_LESSOREQUAL)
                    || (token.type == t_GREATER)
                    || (token.type == t_GREATEROREQUAL)
                    || (token.type == t_EQUAL)
                    || (token.type == t_NOT_EQUAL)
                    || (token.type == t_IDENTIFIER)
                    || (token.type == t_FLOAT)
                    || (token.type == t_INT_NON_ZERO)
                    || (token.type == t_INT_ZERO)
                    || (token.type == t_STRING)) {

                    TDLLInsertLast(&psa_list, token);
                    token = get_next_token(stdin); TDLLInsertLast(&tokens, token);
                    

                } else { error_call(ERR_SYN, &tokens); }
            }

            evaluation(&psa_list, &tokens);
            TDLLDisposeList(&psa_list);
            token = get_next_token(stdin);
            TDLLInsertLast(&tokens, token);
            break;
            // Definicia je vynechaná
        case T_SEMICOLON:
            token = get_next_token(stdin);
            TDLLInsertLast(&tokens, token);
            break;
        default:
            //hocico ine -- ERROR
            error_call(ERR_SYN, &tokens);
    }

}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movl 0x9a22(%rip), %eax      # 0xc3d0
cmpl $0x38, %eax
je 0x2a16
cmpl $0x13, %eax
jne 0x2a3e
movq 0x9615(%rip), %r15      # 0xbfd8
movq (%r15), %rdi
callq 0x31f0
movq %rax, 0x99f6(%rip)      # 0xc3c8
movl %edx, 0x99f8(%rip)      # 0xc3d0
leaq 0x99d1(%rip), %rdi      # 0xc3b0
movq %rax, %rsi
callq 0x1726
cmpl $0x32, 0x99e2(%rip)     # 0xc3d0
jne 0x2a5a
movq (%r15), %rdi
callq 0x31f0
movq %rax, 0x99c9(%rip)      # 0xc3c8
movl %edx, 0x99cb(%rip)      # 0xc3d0
leaq 0x99a4(%rip), %rdi      # 0xc3b0
movq %rax, %rsi
callq 0x1726
jmp 0x2a6b
movq 0x95bb(%rip), %rax      # 0xbfd8
movq (%rax), %rdi
callq 0x31f0
movq %rax, 0x999c(%rip)      # 0xc3c8
movl %edx, 0x999e(%rip)      # 0xc3d0
leaq 0x9977(%rip), %rdi      # 0xc3b0
jmp 0x2b1c
leaq 0x996b(%rip), %rsi      # 0xc3b0
movl $0x2, %edi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x42c8
leaq 0x994f(%rip), %rsi      # 0xc3b0
movl $0x2, %edi
callq 0x42c8
leaq 0x9966(%rip), %rbx      # 0xc3d8
movq %rbx, %rdi
callq 0x16a7
leaq 0x992f(%rip), %r14      # 0xc3b0
movabsq $0xa03c00b0fc6, %r12    # imm = 0xA03C00B0FC6
movl 0x993f(%rip), %edx      # 0xc3d0
cmpq $0x38, %rdx
ja 0x2ad4
btq %rdx, %r12
jae 0x2ace
movq 0x9924(%rip), %rsi      # 0xc3c8
movq %rbx, %rdi
callq 0x1726
movq (%r15), %rdi
callq 0x31f0
movq %rax, 0x990d(%rip)      # 0xc3c8
movl %edx, 0x990f(%rip)      # 0xc3d0
movq %r14, %rdi
movq %rax, %rsi
callq 0x1726
jmp 0x2a8b
cmpq $0x38, %rdx
je 0x2ae3
movl $0x2, %edi
movq %r14, %rsi
callq 0x42c8
jmp 0x2a8b
leaq 0x98ee(%rip), %rbx      # 0xc3d8
leaq 0x98bf(%rip), %r14      # 0xc3b0
movq %rbx, %rdi
movq %r14, %rsi
callq 0x7d13
movq %rbx, %rdi
callq 0x16b6
movq (%r15), %rdi
callq 0x31f0
movq %rax, 0x98b5(%rip)      # 0xc3c8
movl %edx, 0x98b7(%rip)      # 0xc3d0
movq %r14, %rdi
movq %rax, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x1726