// File: /workspace/github_cpp_makefile_star2_O3/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 0x2376
movq %rdi, %rbx
movq (%rdi), %r15
testq %r15, %r15
je 0x237f
cmpl $0x9, (%r15)
jne 0x221d
movq 0x18(%r15), %r14
testq %r14, %r14
je 0x221d
leaq 0x2227(%rip), %rdi      # 0x4410
movq %r14, %rsi
callq 0x1130
testl %eax, %eax
je 0x2261
leaq 0x2224(%rip), %rdi      # 0x4420
movq %r14, %rsi
callq 0x1130
testl %eax, %eax
je 0x2268
leaq 0x2005(%rip), %rdi      # 0x4214
leaq 0x2113(%rip), %rsi      # 0x4329
movl $0x203, %edx            # imm = 0x203
jmp 0x2230
leaq 0x1ff0(%rip), %rdi      # 0x4214
leaq 0x20fe(%rip), %rsi      # 0x4329
movl $0x1e9, %edx            # imm = 0x1E9
xorl %eax, %eax
callq 0x1040
movq (%rbx), %rax
movq 0x18(%rax), %rsi
leaq 0x1ff6(%rip), %rdi      # 0x423b
xorl %eax, %eax
callq 0x1040
leaq 0x4f0d(%rip), %rax      # 0x7160
movq (%rax), %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movl $0xb, %eax
jmp 0x226d
movl $0xc, %eax
movl %eax, (%r15)
leaq 0x30(%r15), %rax
movq %rax, (%rbx)
movq %rbx, %rdi
callq 0x239e
movq %rax, %rcx
movq %rax, 0x8(%r15)
leaq 0x4ed3(%rip), %r14      # 0x7160
movq (%r14), %rax
cmpq %rax, %rcx
je 0x2256
movq (%rbx), %rax
cmpl $0x6, (%rax)
jne 0x22b7
cmpq $0x1, 0x20(%rax)
jne 0x22b7
movq 0x18(%rax), %rdx
movzbl (%rdx), %edx
orl $0x2, %edx
cmpl $0x3e, %edx
jne 0x233f
movq %rcx, 0x8(%rax)
movq (%rbx), %rax
movq %rax, 0x8(%r15)
movl $0xf, (%rax)
addq $0x30, %rax
movq %rax, (%rbx)
movq %rbx, %rdi
callq 0x239e
movq %rax, %rcx
movq 0x8(%r15), %rax
movq %rcx, 0x10(%rax)
movq (%r14), %rax
cmpq %rax, %rcx
je 0x2256
movq %rbx, %rdi
callq 0x1c9f
movq %rax, %rcx
movq %rax, 0x10(%r15)
movq (%r14), %rax
cmpq %rax, %rcx
je 0x2256
movq (%rbx), %rax
cmpl $0x3, -0x30(%rax)
jne 0x231c
movq 0x8(%rcx), %rax
movq %rax, 0x10(%r15)
jmp 0x232c
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 0x2256
leaq 0x1ece(%rip), %rdi      # 0x4214
leaq 0x1fdc(%rip), %rsi      # 0x4329
movl $0x20f, %edx            # imm = 0x20F
xorl %eax, %eax
callq 0x1040
movq (%rbx), %rax
movq 0x18(%rax), %rsi
leaq 0x1ed4(%rip), %rdi      # 0x423b
xorl %eax, %eax
callq 0x1040
movq (%r14), %rax
jmp 0x2256
leaq 0x1e90(%rip), %rdi      # 0x420d
jmp 0x2386
leaq 0x1e86(%rip), %rdi      # 0x420c
leaq 0x1c7c(%rip), %rsi      # 0x4009
leaq 0x1f95(%rip), %rcx      # 0x4329
movl $0x1e8, %edx            # imm = 0x1E8
callq 0x1090