// File: /workspace/github_cpp_makefile_star2_O3/besm6[P]pascal-re/pascompl.cc
// Function: forStatement()
void forStatement()
{
    TypesPtr l4typ1z;
    ExprPtr l4exp2z, l4var3z, l4var4z;
    int64_t l4int5z, l4int6z, l4int7z, l4int8z;
    bool l4var9z;

    inSymbol();
    disableNorm();
    curExpr = NULL;
    if (SY == IDENT) {
        if (hashTravPtr != NULL and hashTravPtr->cl == VARID) {
            parseLval();
            if (curExpr->op != GETVAR)
                error(errNoSimpleVarForLoop);
        } else
            error(errNoSimpleVarForLoop);
    } else {
        errAndSkip(errNoIdent, skipToSet + Bits(BECOMES, DOSY, TOSY, DOWNTOSY));
    } /* 15251 */
    if (curExpr == NULL)
        curExpr = uVarPtr;
    l4exp2z = curExpr;
    l4typ1z = l4exp2z->typ;
    if (not (l4typ1z->k == kindScalar || l4typ1z->k == kindRange))
        error(25); /* errExprNotOfADiscreteType */
    if (typeCheck(IntegerType, l4typ1z))
      l4int5z = KATX+PLUS1;
    else
      l4int5z = KATX+E1;
    if (SY == BECOMES) {
        expression();
        l4var9z = true;
    } else {
        l4var9z = false;
    }
    l4var3z = curExpr;
    l4int6z = InsnTemp[ADD];
    if (not typeCheck(l4typ1z, l4var3z->typ))
        error(31); /* errIncompatibleTypesOfLoopIndexAndExpr */

    if (SY == TOSY) {
        // Do nothing
    } else if (SY == DOWNTOSY)
        l4int6z = InsnTemp[SUB];
    else {
        error(70); /* errNeitherToNorDownto */
    }
    expression();
    if (not typeCheck(l4typ1z, curExpr->typ))
        error(31); /* errIncompatibleTypesOfLoopIndexAndExpr */
    (void) formOperator(gen0);
    l4var4z = curExpr;
    if (l4var9z) {
        curExpr = l4var3z;
        (void) formOperator(LOAD);
    } else {
        form1Insn(InsnTemp[XTA] + l4int5z);
    }
    l4int7z = 0;
    disableNorm();
    formJump(l4int7z);
    padToLeft();
    l4int8z = moduleOffset;
    checkSymAndRead(DOSY);
    Statement();
    disableNorm();
    curExpr = l4exp2z;
    (void) formOperator(LOAD);
    form1Insn(l4int6z + l4int5z);
    P0715(0, l4int7z);
    (void) formOperator(STORE);
    curExpr = l4var4z;
    if (l4int6z == InsnTemp[SUB])
        curVal.i = l4int6z;
    else
        curVal.i = InsnTemp[RSUB];
    /*15401*/
    (void) formOperator(LOOPCOND);
    form1Insn(InsnTemp[UZA] + l4int8z);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x428, %rsp            # imm = 0x428
leaq 0x2b8(%rsp), %rdi
callq 0x6f40
cmpq $0x1, 0x55055(%rip)     # 0x648d8
je 0xf89c
movq 0x149fc(%rip), %rdi     # 0x24288
callq 0x59a2
movq $0x1, 0x5503c(%rip) # 0x648d8
movq $0x0, 0x551f9(%rip) # 0x64aa0
cmpl $0x0, 0x54f6e(%rip)     # 0x6481c
je 0xf8d4
movabsq $0xffffefffffe3, %rsi   # imm = 0xFFFFEFFFFFE3
andq 0x54f27(%rip), %rsi     # 0x647e8
orq $0x1000001c, %rsi       # imm = 0x1000001C
movl $0x3, %edi
callq 0x8112
jmp 0xf904
movq 0x550c5(%rip), %rax     # 0x649a0
testq %rax, %rax
je 0xf8fa
cmpl $0x3, 0x20(%rax)
jne 0xf8fa
callq 0xeb22
movq 0x551ae(%rip), %r12     # 0x64aa0
cmpl $0x1d, 0x8(%r12)
je 0xf91e
movl $0x1e, %edi
callq 0x58ff
movq 0x55195(%rip), %r12     # 0x64aa0
testq %r12, %r12
jne 0xf91e
movq 0x55181(%rip), %r12     # 0x64a98
movq %r12, 0x55182(%rip)     # 0x64aa0
movq (%r12), %r14
movl 0x10(%r14), %eax
decl %eax
cmpl $0x2, %eax
jb 0xf937
movl $0x19, %edi
callq 0x58ff
movq 0x550aa(%rip), %rsi     # 0x649e8
leaq 0x10(%rsp), %rbx
movq %rbx, %rdi
movq %r14, %rdx
callq 0x84c6
addq $-0x8, 0xada52(%rip)    # 0xbd3a8
movzbl (%rbx), %eax
movq %rax, 0x8(%rsp)
movl 0x54eb8(%rip), %ebp     # 0x6481c
cmpl $0x13, %ebp
jne 0xf96e
callq 0xee5e
movq 0x5512b(%rip), %r13     # 0x64aa0
movq 0x59a14(%rip), %rbx     # 0x69390
movq (%r13), %rdx
leaq 0x10(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x84c6
addq $-0x8, 0xada10(%rip)    # 0xbd3a8
cmpb $0x0, (%r15)
jne 0xf9a8
movl $0x1f, %edi
callq 0x58ff
movl 0x54e6e(%rip), %eax     # 0x6481c
cmpl $0x2c, %eax
je 0xf9cb
cmpl $0x2d, %eax
jne 0xf9c1
movq 0x599d9(%rip), %rbx     # 0x69398
jmp 0xf9cb
movl $0x46, %edi
callq 0x58ff
callq 0xee5e
movq 0x550c9(%rip), %rax     # 0x64aa0
movq (%rax), %rdx
leaq 0x10(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x84c6
addq $-0x8, 0xad9b6(%rip)    # 0xbd3a8
cmpb $0x0, (%r15)
jne 0xfa02
movl $0x1f, %edi
callq 0x58ff
movq 0x8(%rsp), %rax
leaq (%rax,%rax,8), %r14
addq $0x100008, %r14         # imm = 0x100008
leaq 0x250(%rsp), %rdi
xorl %esi, %esi
callq 0xc308
addq $-0x8, 0xad997(%rip)    # 0xbd3c0
movq 0x55070(%rip), %rax     # 0x64aa0
movq %rax, 0x8(%rsp)
cmpl $0x13, %ebp
jne 0xfa5d
movq %r13, 0x5505f(%rip)     # 0x64aa0
leaq 0x1e8(%rsp), %rdi
movl $0x2, %esi
callq 0xc308
addq $-0x8, 0xad965(%rip)    # 0xbd3c0
jmp 0xfa6c
movq 0x5994c(%rip), %rdi     # 0x693b0
addq %r14, %rdi
callq 0x59a2
movq $0x0, 0x10(%rsp)
cmpq $0x1, 0x54e5b(%rip)     # 0x648d8
je 0xfa96
movq 0x14802(%rip), %rdi     # 0x24288
callq 0x59a2
movq $0x1, 0x54e42(%rip) # 0x648d8
leaq 0x10(%rsp), %rdi
callq 0x5b33
cmpb $0x0, 0x54ecd(%rip)     # 0x64974
jne 0xfab5
movq 0x599f8(%rip), %rdi     # 0x694a8
callq 0x59a2
movq $0x0, 0x54e98(%rip) # 0x64958
movq 0x54dc1(%rip), %r15     # 0x64888
movl $0x2b, %edi
callq 0x83e7
leaq 0x58(%rsp), %rdi
callq 0x108ce
addq $-0x8, 0xad945(%rip)    # 0xbd428
cmpq $0x1, 0x54ded(%rip)     # 0x648d8
je 0xfb04
movq 0x14794(%rip), %rdi     # 0x24288
callq 0x59a2
movq $0x1, 0x54dd4(%rip) # 0x648d8
movq %r12, 0x54f95(%rip)     # 0x64aa0
leaq 0x180(%rsp), %rdi
movl $0x2, %esi
callq 0xc308
addq $-0x8, 0xad89b(%rip)    # 0xbd3c0
addq %rbx, %r14
movq %r14, %rdi
callq 0x59a2
movq 0x10(%rsp), %rsi
xorl %edi, %edi
callq 0x61d5
leaq 0x118(%rsp), %rdi
movl $0x1, %esi
callq 0xc308
addq $-0x8, 0xad86a(%rip)    # 0xbd3c0
movq 0x8(%rsp), %rax
movq %rax, 0x54f3e(%rip)     # 0x64aa0
cmpq 0x5982f(%rip), %rbx     # 0x69398
je 0xfb72
movq 0x5982e(%rip), %rbx     # 0x693a0
leaq 0x54eb7(%rip), %rdi     # 0x64a30
movq %rbx, %rsi
callq 0x3c48
leaq 0xb0(%rsp), %rdi
movl $0x3, %esi
callq 0xc308
addq $-0x8, 0xad825(%rip)    # 0xbd3c0
addq 0x59926(%rip), %r15     # 0x694c8
movq %r15, %rdi
callq 0x59a2
addq $0x428, %rsp            # imm = 0x428
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq