// File: /workspace/github_c_makefile_star2_O3/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 0x1691
movq %r15, %rdi
callq 0x1691
movq 0x8(%r15), %r13
movl 0x8(%r13), %eax
cmpl $0x13, %eax
je 0x549d
cmpl $0x33, %eax
jne 0x550d
jmp 0x55b5
movq 0x10(%r13), %rax
cmpl $0x1c, 0x8(%rax)
je 0x54cb
movq 0x18(%r13), %rax
cmpl $0x6, 0x8(%rax)
jne 0x54cb
movq (%r13), %rsi
movq %r15, %rdi
movq %r14, %rdx
callq 0x4e01
movq 0x8(%r15), %r13
cmpl $0x13, 0x8(%r13)
jne 0x550d
movq 0x18(%r13), %rax
cmpl $0x3, 0x8(%rax)
jne 0x550d
movq 0x10(%r13), %rax
cmpl $0x2f, 0x8(%rax)
je 0x54f4
movq %r15, %rdi
callq 0x1985
movq 0x10(%r13), %r13
cmpl $0x2f, 0x8(%r13)
jne 0x54d5
jmp 0x550d
movl $0x201, %ecx            # imm = 0x201
movq %rsp, %rdi
movq %r12, %rsi
rep  movsq (%rsi), %es:(%rdi)
movq %r15, %rdi
movq %r14, %rsi
callq 0x55c6
movq 0x8(%r15), %rax
movl 0x8(%rax), %eax
cmpl $0x32, %eax
jne 0x5541
movq %r15, %rdi
callq 0x1985
movl $0x201, %ecx            # imm = 0x201
movq %rsp, %rdi
movq %r12, %rsi
rep  movsq (%rsi), %es:(%rdi)
movq %r15, %rdi
movq %r14, %rsi
callq 0x6072
movq 0x8(%r15), %rax
movl 0x8(%rax), %eax
cmpl $0x1a, %eax
jne 0x5569
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 0x66f3
movq 0x8(%r15), %rax
movl 0x8(%rax), %eax
cmpl $0x16, %eax
jne 0x5599
movq %r15, %rdi
callq 0x1691
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 0x6906
movq 0x8(%r15), %rax
movl 0x8(%rax), %eax
cmpl $0x19, %eax
jne 0x547e
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x4bb1
jmp 0x547e
addq $0x1010, %rsp           # imm = 0x1010
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq