// File: /workspace/github_c_makefile_star2_O1/MartinNovotny25[P]VUT-FIT-IFJ2020/semantics.c
// Function: enter_else_body
void enter_else_body(TDLList *L, tBSTNodePtrLocal *elsenode, functionData params, char *id){
    // preskoc else
    TDLLSucc(L);
    // prescko {
    TDLLSucc(L);

    while(L->Act->tdata.type != t_BRACES_R){
        if ((L->Act->tdata.type == t_IDENTIFIER) && (L->Act->lptr->tdata.type != t_FUNC) && (L->Act->rptr->tdata.type == t_LEFT_BRACKET)) {
            checkCallFunction(L, L->Act->tdata.lex, elsenode);
        }
        if(L->Act->tdata.type == t_IDENTIFIER && L->Act->rptr->tdata.type == t_ASSIGN){
			TDLLElemPtr temp_node = L->Act;
			while(temp_node->tdata.type != t_EOL){
				if(temp_node->lptr->tdata.type == t_EOL){
					assign_vals_control(L, elsenode, params);
					break;
				}
				TDLLPred(L);
				temp_node = temp_node->lptr;
			}
		}
        
        if (L->Act->tdata.type == t_DEFINITION_2) {
            TDLLPred(L);
			dec_var_control(L, elsenode, params);
        }
        if (L->Act->tdata.type == t_FOR) {           
            enter_for_body(L, elsenode, params, id);  
        }
        if (L->Act->tdata.type == t_IF) {
            TDLLSucc(L);          
			enter_if_body(L, elsenode, params, id);
        }
        if (L->Act->tdata.type == t_RETURN) {
            checkReturnStatement(L, id, elsenode);
        }
        
        TDLLSucc(L);
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1010, %rsp           # imm = 0x1010
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
leaq 0x1040(%rsp), %r12
callq 0x1695
movq %r15, %rdi
callq 0x1695
movq 0x8(%r15), %rax
movl 0x8(%rax), %ecx
cmpl $0x13, %ecx
je 0x5569
cmpl $0x33, %ecx
jne 0x558b
jmp 0x5678
movq 0x10(%rax), %rcx
cmpl $0x1c, 0x8(%rcx)
je 0x558b
movq 0x18(%rax), %rcx
cmpl $0x6, 0x8(%rcx)
jne 0x558b
movq (%rax), %rsi
movq %r15, %rdi
movq %r14, %rdx
callq 0x4e67
movq 0x8(%r15), %r13
cmpl $0x13, 0x8(%r13)
jne 0x55d8
movq 0x18(%r13), %rax
cmpl $0x3, 0x8(%rax)
jne 0x55d8
cmpl $0x2f, 0x8(%r13)
je 0x55d8
movq 0x10(%r13), %rax
cmpl $0x2f, 0x8(%rax)
je 0x55bf
movq %r15, %rdi
callq 0x19a1
movq 0x10(%r13), %r13
jmp 0x55a0
movl $0x201, %ecx            # imm = 0x201
movq %rsp, %rdi
movq %r12, %rsi
rep  movsq (%rsi), %es:(%rdi)
movq %r15, %rdi
movq %r14, %rsi
callq 0x5689
movq 0x8(%r15), %rax
cmpl $0x32, 0x8(%rax)
jne 0x5603
movq %r15, %rdi
callq 0x19a1
movl $0x201, %ecx            # imm = 0x201
movq %rsp, %rdi
movq %r12, %rsi
rep  movsq (%rsi), %es:(%rdi)
movq %r15, %rdi
movq %r14, %rsi
callq 0x611b
movq 0x8(%r15), %rax
cmpl $0x1a, 0x8(%rax)
jne 0x5629
movl $0x201, %ecx            # imm = 0x201
movq %rsp, %rdi
movq %r12, %rsi
rep  movsq (%rsi), %es:(%rdi)
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x671f
movq 0x8(%r15), %rax
cmpl $0x16, 0x8(%rax)
jne 0x5657
movq %r15, %rdi
callq 0x1695
movl $0x201, %ecx            # imm = 0x201
movq %rsp, %rdi
movq %r12, %rsi
rep  movsq (%rsi), %es:(%rdi)
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x6928
movq 0x8(%r15), %rax
cmpl $0x19, 0x8(%rax)
jne 0x554b
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x4c12
jmp 0x554b
addq $0x1010, %rsp           # imm = 0x1010
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq