// File: /workspace/github_cpp_makefile_star2_O1/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 0x2398
movq %rdi, %rbx
movq (%rdi), %r15
testq %r15, %r15
je 0x23a1
cmpl $0x9, (%r15)
jne 0x2242
movq 0x18(%r15), %r14
testq %r14, %r14
je 0x2242
leaq 0x2212(%rip), %rdi      # 0x4420
movq %r14, %rsi
callq 0x1130
testl %eax, %eax
je 0x2286
leaq 0x220f(%rip), %rdi      # 0x4430
movq %r14, %rsi
callq 0x1130
testl %eax, %eax
je 0x228d
leaq 0x1fe4(%rip), %rdi      # 0x4218
leaq 0x20f4(%rip), %rsi      # 0x432f
movl $0x203, %edx            # imm = 0x203
jmp 0x2255
leaq 0x1fcf(%rip), %rdi      # 0x4218
leaq 0x20df(%rip), %rsi      # 0x432f
movl $0x1e9, %edx            # imm = 0x1E9
xorl %eax, %eax
callq 0x1040
movq (%rbx), %rax
movq 0x18(%rax), %rsi
leaq 0x1fd5(%rip), %rdi      # 0x423f
xorl %eax, %eax
callq 0x1040
leaq 0x4ee8(%rip), %rax      # 0x7160
movq (%rax), %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movl $0xb, %eax
jmp 0x2292
movl $0xc, %eax
movl %eax, (%r15)
leaq 0x30(%r15), %rax
movq %rax, (%rbx)
movq %rbx, %rdi
callq 0x23c0
movq %rax, %rcx
movq %rax, 0x8(%r15)
leaq 0x4eae(%rip), %r14      # 0x7160
movq (%r14), %rax
cmpq %rax, %rcx
je 0x227b
movq (%rbx), %rax
cmpl $0x6, (%rax)
jne 0x22dc
cmpq $0x1, 0x20(%rax)
jne 0x22dc
movq 0x18(%rax), %rdx
movzbl (%rdx), %edx
orl $0x2, %edx
cmpl $0x3e, %edx
jne 0x2361
movq %rcx, 0x8(%rax)
movq (%rbx), %rax
movq %rax, 0x8(%r15)
movl $0xf, (%rax)
addq $0x30, (%rbx)
movq %rbx, %rdi
callq 0x23c0
movq %rax, %rcx
movq 0x8(%r15), %rax
movq %rcx, 0x10(%rax)
movq (%r14), %rax
cmpq %rax, %rcx
je 0x227b
movq %rbx, %rdi
callq 0x1cc6
movq %rax, %rcx
movq %rax, 0x10(%r15)
movq (%r14), %rax
cmpq %rax, %rcx
je 0x227b
movq (%rbx), %rax
cmpl $0x3, -0x30(%rax)
jne 0x233e
movq 0x8(%rcx), %rax
movq %rax, 0x10(%r15)
jmp 0x234e
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 0x227b
leaq 0x1eb0(%rip), %rdi      # 0x4218
leaq 0x1fc0(%rip), %rsi      # 0x432f
movl $0x20f, %edx            # imm = 0x20F
xorl %eax, %eax
callq 0x1040
movq (%rbx), %rax
movq 0x18(%rax), %rsi
leaq 0x1eb6(%rip), %rdi      # 0x423f
xorl %eax, %eax
callq 0x1040
movq (%r14), %rax
jmp 0x227b
leaq 0x1e72(%rip), %rdi      # 0x4211
jmp 0x23a8
leaq 0x1e68(%rip), %rdi      # 0x4210
leaq 0x1c5a(%rip), %rsi      # 0x4009
leaq 0x1f79(%rip), %rcx      # 0x432f
movl $0x1e8, %edx            # imm = 0x1E8
callq 0x1090