// File: /workspace/github_cpp_makefile_star2_O2/AndreyVV-100[P]GachiLang/Frontend/Frontend.cpp
// Function: GetCond(element**)
element* GetCond      (element** el_now)
{
    parse_ass;
    require_ind;

    // Old code:

/*     const size_t without_backslash_0 = 1;

    const size_t    if_size  = sizeof (IF_STR)    - without_backslash_0;
    const size_t while_size  = sizeof (WHILE_STR) - without_backslash_0;

    if ((*el_now)->len != if_size    + 2 * MALE_LEN && 
        (*el_now)->len != while_size + 2 * MALE_LEN) 
        require_exit;

         if (strncmp (IF_STR,    (*el_now)->ind + MALE_LEN,    if_size) == 0)
        (*el_now)->type = IF;
    else if (strncmp (WHILE_STR, (*el_now)->ind + MALE_LEN, while_size) == 0)
        (*el_now)->type = WHILE;
    else
        require_exit;
 */

    if (strcmp (IF_STR, (*el_now)->ind) == 0)
        (*el_now)->type = IF;
    else if (strcmp (WHILE_STR, (*el_now)->ind) == 0)
        (*el_now)->type = WHILE;
    else
        require_exit;

    element* el_result = *el_now;
    next;

    el_result->left = GetE (el_now);
    check_parse (el_result->left);

    if ((*el_now)->type == ARITH && 
        (*el_now)->len  == 1     &&
      *((*el_now)->ind) != '>'   &&
      *((*el_now)->ind) != '<')
            require_exit;
            
    (*el_now)->left       = el_result->left;
    el_result->left       = *el_now;
    el_result->left->type = COND;
    next;

    el_result->left->right = GetE (el_now);
    check_parse (el_result->left->right);

    el_result->right = GetBody (el_now);
    check_parse (el_result->right);
    
    // Gypsy focuses
    if ((*el_now - 1)->type == LR)
    {
        // *el_now - 1 == el_result->right
        el_result->right    = el_result->right->left;
    }

    else
    {
        // (*el_now - 1)->type == BODY - useless element, I can use it for good deed.
        (*el_now - 1)->type = LR;
        strcpy((*el_now - 1)->ind, "$");    
    }

    (*el_now - 1)->left = el_result;
    el_result = *el_now - 1;
    // End of gypsy focuses
    return el_result;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x2311
movq %rdi, %rbx
movq (%rdi), %r15
testq %r15, %r15
je 0x231a
cmpl $0x9, (%r15)
jne 0x21bd
movq 0x18(%r15), %r14
testq %r14, %r14
je 0x21bd
leaq 0x2287(%rip), %rdi      # 0x4410
movq %r14, %rsi
callq 0x1130
testl %eax, %eax
je 0x2201
leaq 0x2284(%rip), %rdi      # 0x4420
movq %r14, %rsi
callq 0x1130
testl %eax, %eax
je 0x2205
leaq 0x2065(%rip), %rdi      # 0x4214
leaq 0x2173(%rip), %rsi      # 0x4329
movl $0x203, %edx            # imm = 0x203
jmp 0x21d0
leaq 0x2050(%rip), %rdi      # 0x4214
leaq 0x215e(%rip), %rsi      # 0x4329
movl $0x1e9, %edx            # imm = 0x1E9
xorl %eax, %eax
callq 0x1040
movq (%rbx), %rax
movq 0x18(%rax), %rsi
leaq 0x2056(%rip), %rdi      # 0x423b
xorl %eax, %eax
callq 0x1040
leaq 0x4f6d(%rip), %rax      # 0x7160
movq (%rax), %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
pushq $0xb
jmp 0x2207
pushq $0xc
popq %rax
movl %eax, (%r15)
leaq 0x30(%r15), %rax
movq %rax, (%rbx)
movq %rbx, %rdi
callq 0x2339
movq %rax, %rcx
movq %rax, 0x8(%r15)
leaq 0x4f38(%rip), %r14      # 0x7160
movq (%r14), %rax
cmpq %rax, %rcx
je 0x21f6
movq (%rbx), %rax
cmpl $0x6, (%rax)
jne 0x2252
cmpq $0x1, 0x20(%rax)
jne 0x2252
movq 0x18(%rax), %rdx
movzbl (%rdx), %edx
orl $0x2, %edx
cmpl $0x3e, %edx
jne 0x22da
movq %rcx, 0x8(%rax)
movq (%rbx), %rax
movq %rax, 0x8(%r15)
movl $0xf, (%rax)
addq $0x30, %rax
movq %rax, (%rbx)
movq %rbx, %rdi
callq 0x2339
movq %rax, %rcx
movq 0x8(%r15), %rax
movq %rcx, 0x10(%rax)
movq (%r14), %rax
cmpq %rax, %rcx
je 0x21f6
movq %rbx, %rdi
callq 0x1c3f
movq %rax, %rcx
movq %rax, 0x10(%r15)
movq (%r14), %rax
cmpq %rax, %rcx
je 0x21f6
movq (%rbx), %rax
cmpl $0x3, -0x30(%rax)
jne 0x22b7
movq 0x8(%rcx), %rax
movq %rax, 0x10(%r15)
jmp 0x22c7
movl $0x3, -0x30(%rax)
movq -0x18(%rax), %rax
movw $0x24, (%rax)
movq (%rbx), %rax
movq %r15, -0x28(%rax)
movq (%rbx), %rax
addq $-0x30, %rax
jmp 0x21f6
leaq 0x1f33(%rip), %rdi      # 0x4214
leaq 0x2041(%rip), %rsi      # 0x4329
movl $0x20f, %edx            # imm = 0x20F
xorl %eax, %eax
callq 0x1040
movq (%rbx), %rax
movq 0x18(%rax), %rsi
leaq 0x1f39(%rip), %rdi      # 0x423b
xorl %eax, %eax
callq 0x1040
movq (%r14), %rax
jmp 0x21f6
leaq 0x1ef5(%rip), %rdi      # 0x420d
jmp 0x2321
leaq 0x1eeb(%rip), %rdi      # 0x420c
leaq 0x1ce1(%rip), %rsi      # 0x4009
leaq 0x1ffa(%rip), %rcx      # 0x4329
movl $0x1e8, %edx            # imm = 0x1E8
callq 0x1090