// File: /workspace/github_c_makefile_star2_O0/MartinNovotny25[P]VUT-FIT-IFJ2020/parser.c
// Function: rule_func_assign
void rule_func_assign() {
    //V tomto pripade sa pozriem na token dopredu, ak bude lava zatvorka tak funckia, ak nieco ine, vyraz
    //Nesmie byt odriadkovanie
    if (token.type == t_EOL) { error_call(ERR_SYN, &tokens); }

    // Ak príde identifikátor, neviem si to je výraz alebo volanie funckie, volam dalsi token
    if (token.type == t_IDENTIFIER) {
        //PARSER -- tu si ulozim token cisto pre vkladanie do psa_listu
        help = token;

        token = get_next_token(stdin);
        TDLLInsertLast(&tokens, token);

        // Lava zatvorka -- volanie funckie
        if (token.type == t_LEFT_BRACKET) {
            token = get_next_token(stdin);
            TDLLInsertLast(&tokens, token);

            // po vyjdeni budem mat nacitany dalsi token
            rule_func_params();

            rule_eol();

            rule_stat();
        }

            // ciarka - dalsi vyraz
        else if (token.type == t_COMMA) {
            // Ci za jednym vyrazom pokracuje dalsi -- exp_NEXT
            rule_exp_n();

            rule_eol();
            rule_stat();
        }


            // Sem pojde precedencna ak za identifikatorom pojde aritmeticke znamienko
        else if ((token.type == t_PLUS)
                 || (token.type == t_MINUS)
                 || (token.type == t_DIVIDE)
                 || (token.type == t_MULTIPLY)) {
            TDLLInitList(&psa_list);
            // v help mam ulozeny identifikator, kedze je sucastou vyrazu a v token uz je nacitane znamienko
            TDLLInsertLast(&psa_list, help);
            TDLLInsertLast(&psa_list, token);
            token = get_next_token(stdin);
            TDLLInsertLast(&tokens, token);

            //Nacitanie dalsich znakov, koncim ked mi pride ciarka alebo EOL

            while (token.type != t_COMMA && token.type != t_EOL) {
                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); }

            }


            //Ak precedencna analyza vrati 1 -- ERROR
            evaluation(&psa_list, &tokens);
            TDLLDisposeList(&psa_list);

            // Pride mi ciarka alebo eol, musim zavolat exp_n ci za tym nieco ide
            rule_exp_n();
            rule_eol();
            rule_stat();

        }
    }

        // ak mi nepride id -- nemusis riesit, ide vyraz
    else if (token.type == t_FLOAT || token.type == t_INT_NON_ZERO || token.type == t_INT_ZERO ||
             token.type == t_STRING || token.type == t_LEFT_BRACKET) {

        TDLLInitList(&psa_list);
        TDLLInsertLast(&psa_list, token);

        token = get_next_token(stdin);
        TDLLInsertLast(&tokens, token);

        //nacitavam, kym nepride ciarka alebo eol -- koneic vyrazu
        while (token.type != t_COMMA && token.type != t_EOL) {
            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);

            // Ci za jednym vyrazom pokracuje dalsi
            rule_exp_n();
            rule_eol();
            rule_stat();
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
cmpl $0x2f, 0xd5c1(%rip)     # 0x103d0
jne 0x2e22
movl $0x2, %edi
leaq 0xd593(%rip), %rsi      # 0x103b0
callq 0x64e0
cmpl $0x13, 0xd5a7(%rip)     # 0x103d0
jne 0x312f
movq 0xd592(%rip), %rax      # 0x103c8
movq %rax, 0xd5b3(%rip)      # 0x103f0
movq 0xd58c(%rip), %rax      # 0x103d0
movq %rax, 0xd5ad(%rip)      # 0x103f8
movq 0xd186(%rip), %rax      # 0xffd8
movq (%rax), %rdi
callq 0x4840
movq %rax, -0x10(%rbp)
movl %edx, -0x8(%rbp)
movq -0x10(%rbp), %rax
movq %rax, 0xd55c(%rip)      # 0x103c8
movq -0x8(%rbp), %rax
movq %rax, 0xd559(%rip)      # 0x103d0
movq 0xd54a(%rip), %rsi      # 0x103c8
movl 0xd54c(%rip), %edx      # 0x103d0
leaq 0xd525(%rip), %rdi      # 0x103b0
callq 0x1450
cmpl $0x6, 0xd539(%rip)      # 0x103d0
jne 0x2ef2
movq 0xd138(%rip), %rax      # 0xffd8
movq (%rax), %rdi
callq 0x4840
movq %rax, -0x20(%rbp)
movl %edx, -0x18(%rbp)
movq -0x20(%rbp), %rax
movq %rax, 0xd50e(%rip)      # 0x103c8
movq -0x18(%rbp), %rax
movq %rax, 0xd50b(%rip)      # 0x103d0
movq 0xd4fc(%rip), %rsi      # 0x103c8
movl 0xd4fe(%rip), %edx      # 0x103d0
leaq 0xd4d7(%rip), %rdi      # 0x103b0
callq 0x1450
callq 0x3540
callq 0x43d0
callq 0x2280
jmp 0x312a
cmpl $0x5, 0xd4d7(%rip)      # 0x103d0
jne 0x2f0f
callq 0x4190
callq 0x43d0
callq 0x2280
jmp 0x3128
cmpl $0xa, 0xd4ba(%rip)      # 0x103d0
je 0x2f37
cmpl $0xb, 0xd4b1(%rip)      # 0x103d0
je 0x2f37
cmpl $0x8, 0xd4a8(%rip)      # 0x103d0
je 0x2f37
cmpl $0x9, 0xd49f(%rip)      # 0x103d0
jne 0x3126
leaq 0xd49a(%rip), %rdi      # 0x103d8
callq 0x1310
movq 0xd4a6(%rip), %rsi      # 0x103f0
movl 0xd4a8(%rip), %edx      # 0x103f8
leaq 0xd481(%rip), %rdi      # 0x103d8
callq 0x1450
movq 0xd465(%rip), %rsi      # 0x103c8
movl 0xd467(%rip), %edx      # 0x103d0
leaq 0xd468(%rip), %rdi      # 0x103d8
callq 0x1450
movq 0xd05c(%rip), %rax      # 0xffd8
movq (%rax), %rdi
callq 0x4840
movq %rax, -0x30(%rbp)
movl %edx, -0x28(%rbp)
movq -0x30(%rbp), %rax
movq %rax, 0xd432(%rip)      # 0x103c8
movq -0x28(%rbp), %rax
movq %rax, 0xd42f(%rip)      # 0x103d0
movq 0xd420(%rip), %rsi      # 0x103c8
movl 0xd422(%rip), %edx      # 0x103d0
leaq 0xd3fb(%rip), %rdi      # 0x103b0
callq 0x1450
xorl %eax, %eax
cmpl $0x5, 0xd40d(%rip)      # 0x103d0
movb %al, -0x61(%rbp)
je 0x2fd5
cmpl $0x2f, 0xd401(%rip)     # 0x103d0
setne %al
movb %al, -0x61(%rbp)
movb -0x61(%rbp), %al
testb $0x1, %al
jne 0x2fe1
jmp 0x30f8
cmpl $0xa, 0xd3e8(%rip)      # 0x103d0
je 0x3082
cmpl $0xb, 0xd3db(%rip)      # 0x103d0
je 0x3082
cmpl $0x8, 0xd3ce(%rip)      # 0x103d0
je 0x3082
cmpl $0x9, 0xd3c5(%rip)      # 0x103d0
je 0x3082
cmpl $0x7, 0xd3bc(%rip)      # 0x103d0
je 0x3082
cmpl $0x6, 0xd3b3(%rip)      # 0x103d0
je 0x3082
cmpl $0x1, 0xd3aa(%rip)      # 0x103d0
je 0x3082
cmpl $0x1e, 0xd3a1(%rip)     # 0x103d0
je 0x3082
cmpl $0x2, 0xd398(%rip)      # 0x103d0
je 0x3082
cmpl $0x1f, 0xd38f(%rip)     # 0x103d0
je 0x3082
cmpl $0x20, 0xd386(%rip)     # 0x103d0
je 0x3082
cmpl $0x21, 0xd37d(%rip)     # 0x103d0
je 0x3082
cmpl $0x13, 0xd374(%rip)     # 0x103d0
je 0x3082
cmpl $0x29, 0xd36b(%rip)     # 0x103d0
je 0x3082
cmpl $0x11, 0xd362(%rip)     # 0x103d0
je 0x3082
cmpl $0x10, 0xd359(%rip)     # 0x103d0
je 0x3082
cmpl $0x2b, 0xd350(%rip)     # 0x103d0
jne 0x30e2
movq 0xd33f(%rip), %rsi      # 0x103c8
movl 0xd341(%rip), %edx      # 0x103d0
leaq 0xd342(%rip), %rdi      # 0x103d8
callq 0x1450
movq 0xcf36(%rip), %rax      # 0xffd8
movq (%rax), %rdi
callq 0x4840
movq %rax, -0x40(%rbp)
movl %edx, -0x38(%rbp)
movq -0x40(%rbp), %rax
movq %rax, 0xd30c(%rip)      # 0x103c8
movq -0x38(%rbp), %rax
movq %rax, 0xd309(%rip)      # 0x103d0
movq 0xd2fa(%rip), %rsi      # 0x103c8
movl 0xd2fc(%rip), %edx      # 0x103d0
leaq 0xd2d5(%rip), %rdi      # 0x103b0
callq 0x1450
jmp 0x30f3
movl $0x2, %edi
leaq 0xd2c2(%rip), %rsi      # 0x103b0
callq 0x64e0
jmp 0x2fba
leaq 0xd2d9(%rip), %rdi      # 0x103d8
leaq 0xd2aa(%rip), %rsi      # 0x103b0
callq 0xc860
leaq 0xd2c6(%rip), %rdi      # 0x103d8
callq 0x1340
callq 0x4190
callq 0x43d0
callq 0x2280
jmp 0x3128
jmp 0x312a
jmp 0x3338
cmpl $0x29, 0xd29a(%rip)     # 0x103d0
je 0x3160
cmpl $0x11, 0xd291(%rip)     # 0x103d0
je 0x3160
cmpl $0x10, 0xd288(%rip)     # 0x103d0
je 0x3160
cmpl $0x2b, 0xd27f(%rip)     # 0x103d0
je 0x3160
cmpl $0x6, 0xd276(%rip)      # 0x103d0
jne 0x3336
leaq 0xd271(%rip), %rdi      # 0x103d8
callq 0x1310
movq 0xd255(%rip), %rsi      # 0x103c8
movl 0xd257(%rip), %edx      # 0x103d0
leaq 0xd258(%rip), %rdi      # 0x103d8
callq 0x1450
movq 0xce4c(%rip), %rax      # 0xffd8
movq (%rax), %rdi
callq 0x4840
movq %rax, -0x50(%rbp)
movl %edx, -0x48(%rbp)
movq -0x50(%rbp), %rax
movq %rax, 0xd222(%rip)      # 0x103c8
movq -0x48(%rbp), %rax
movq %rax, 0xd21f(%rip)      # 0x103d0
movq 0xd210(%rip), %rsi      # 0x103c8
movl 0xd212(%rip), %edx      # 0x103d0
leaq 0xd1eb(%rip), %rdi      # 0x103b0
callq 0x1450
xorl %eax, %eax
cmpl $0x5, 0xd1fd(%rip)      # 0x103d0
movb %al, -0x62(%rbp)
je 0x31e5
cmpl $0x2f, 0xd1f1(%rip)     # 0x103d0
setne %al
movb %al, -0x62(%rbp)
movb -0x62(%rbp), %al
testb $0x1, %al
jne 0x31f1
jmp 0x3308
cmpl $0xa, 0xd1d8(%rip)      # 0x103d0
je 0x3292
cmpl $0xb, 0xd1cb(%rip)      # 0x103d0
je 0x3292
cmpl $0x8, 0xd1be(%rip)      # 0x103d0
je 0x3292
cmpl $0x9, 0xd1b5(%rip)      # 0x103d0
je 0x3292
cmpl $0x7, 0xd1ac(%rip)      # 0x103d0
je 0x3292
cmpl $0x6, 0xd1a3(%rip)      # 0x103d0
je 0x3292
cmpl $0x1, 0xd19a(%rip)      # 0x103d0
je 0x3292
cmpl $0x1e, 0xd191(%rip)     # 0x103d0
je 0x3292
cmpl $0x2, 0xd188(%rip)      # 0x103d0
je 0x3292
cmpl $0x1f, 0xd17f(%rip)     # 0x103d0
je 0x3292
cmpl $0x20, 0xd176(%rip)     # 0x103d0
je 0x3292
cmpl $0x21, 0xd16d(%rip)     # 0x103d0
je 0x3292
cmpl $0x13, 0xd164(%rip)     # 0x103d0
je 0x3292
cmpl $0x29, 0xd15b(%rip)     # 0x103d0
je 0x3292
cmpl $0x11, 0xd152(%rip)     # 0x103d0
je 0x3292
cmpl $0x10, 0xd149(%rip)     # 0x103d0
je 0x3292
cmpl $0x2b, 0xd140(%rip)     # 0x103d0
jne 0x32f2
movq 0xd12f(%rip), %rsi      # 0x103c8
movl 0xd131(%rip), %edx      # 0x103d0
leaq 0xd132(%rip), %rdi      # 0x103d8
callq 0x1450
movq 0xcd26(%rip), %rax      # 0xffd8
movq (%rax), %rdi
callq 0x4840
movq %rax, -0x60(%rbp)
movl %edx, -0x58(%rbp)
movq -0x60(%rbp), %rax
movq %rax, 0xd0fc(%rip)      # 0x103c8
movq -0x58(%rbp), %rax
movq %rax, 0xd0f9(%rip)      # 0x103d0
movq 0xd0ea(%rip), %rsi      # 0x103c8
movl 0xd0ec(%rip), %edx      # 0x103d0
leaq 0xd0c5(%rip), %rdi      # 0x103b0
callq 0x1450
jmp 0x3303
movl $0x2, %edi
leaq 0xd0b2(%rip), %rsi      # 0x103b0
callq 0x64e0
jmp 0x31ca
leaq 0xd0c9(%rip), %rdi      # 0x103d8
leaq 0xd09a(%rip), %rsi      # 0x103b0
callq 0xc860
leaq 0xd0b6(%rip), %rdi      # 0x103d8
callq 0x1340
callq 0x4190
callq 0x43d0
callq 0x2280
jmp 0x3338
addq $0x70, %rsp
popq %rbp
retq
nop