// File: /workspace/github_cpp_makefile_star2_O1/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 0x6e26
cmpq $0x1, 0x552e7(%rip)     # 0x648e8
je 0xf61a
movq 0x14c8e(%rip), %rdi     # 0x24298
callq 0x5941
movq $0x1, 0x552ce(%rip) # 0x648e8
movq $0x0, 0x5548b(%rip) # 0x64ab0
cmpl $0x0, 0x55200(%rip)     # 0x6482c
je 0xf65a
movabsq $0xffffefffffe3, %rbx   # imm = 0xFFFFEFFFFFE3
andq 0x551b9(%rip), %rbx     # 0x647f8
orq $0x1000001c, %rbx       # imm = 0x1000001C
movl $0x3, %edi
callq 0x589e
movq %rbx, %rdi
callq 0x7f7c
jmp 0xf688
movq 0x5534f(%rip), %rax     # 0x649b0
testq %rax, %rax
je 0xf67e
cmpl $0x3, 0x20(%rax)
jne 0xf67e
callq 0xe885
movq 0x55438(%rip), %rax     # 0x64ab0
cmpl $0x1d, 0x8(%rax)
je 0xf688
movl $0x1e, %edi
callq 0x589e
cmpq $0x0, 0x55420(%rip)     # 0x64ab0
jne 0xf6a0
movq 0x5540f(%rip), %rax     # 0x64aa8
movq %rax, 0x55410(%rip)     # 0x64ab0
movq 0x55409(%rip), %rax     # 0x64ab0
movq %rax, 0x8(%rsp)
movq (%rax), %r14
movl 0x10(%r14), %eax
decl %eax
cmpl $0x2, %eax
jb 0xf6c4
movl $0x19, %edi
callq 0x589e
movq 0x5532d(%rip), %rsi     # 0x649f8
leaq 0x10(%rsp), %rbx
movq %rbx, %rdi
movq %r14, %rdx
callq 0x83b2
addq $-0x8, 0xadcd5(%rip)    # 0xbd3b8
movzbl (%rbx), %r13d
movl 0x5513f(%rip), %ebp     # 0x6482c
cmpl $0x13, %ebp
jne 0xf6f7
callq 0xebcc
movq 0x553b2(%rip), %r12     # 0x64ab0
movq 0x59c9b(%rip), %rbx     # 0x693a0
movq (%r12), %rdx
leaq 0x10(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x83b2
addq $-0x8, 0xadc97(%rip)    # 0xbd3b8
cmpb $0x0, (%r15)
jne 0xf731
movl $0x1f, %edi
callq 0x589e
movl 0x550f5(%rip), %eax     # 0x6482c
cmpl $0x2c, %eax
je 0xf754
cmpl $0x2d, %eax
jne 0xf74a
movq 0x59c60(%rip), %rbx     # 0x693a8
jmp 0xf754
movl $0x46, %edi
callq 0x589e
callq 0xebcc
movq 0x55350(%rip), %rax     # 0x64ab0
movq (%rax), %rdx
leaq 0x10(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x83b2
addq $-0x8, 0xadc3d(%rip)    # 0xbd3b8
cmpb $0x0, (%r15)
jne 0xf78b
movl $0x1f, %edi
callq 0x589e
leaq 0x100008(,%r13,8), %r14
addq %r13, %r14
leaq 0x250(%rsp), %rdi
xorl %esi, %esi
callq 0xc044
addq $-0x8, 0xadc23(%rip)    # 0xbd3d0
movq 0x552fc(%rip), %r13     # 0x64ab0
cmpl $0x13, %ebp
jne 0xf7dc
movq %r12, 0x552f0(%rip)     # 0x64ab0
leaq 0x1e8(%rsp), %rdi
movl $0x2, %esi
callq 0xc044
addq $-0x8, 0xadbf6(%rip)    # 0xbd3d0
jmp 0xf7eb
movq 0x59bdd(%rip), %rdi     # 0x693c0
addq %r14, %rdi
callq 0x5941
movq $0x0, 0x10(%rsp)
cmpq $0x1, 0x550ec(%rip)     # 0x648e8
je 0xf815
movq 0x14a93(%rip), %rdi     # 0x24298
callq 0x5941
movq $0x1, 0x550d3(%rip) # 0x648e8
leaq 0x10(%rsp), %rdi
callq 0x5ac6
cmpb $0x0, 0x5515e(%rip)     # 0x64984
jne 0xf834
movq 0x59c89(%rip), %rdi     # 0x694b8
callq 0x5941
movq $0x0, 0x55129(%rip) # 0x64968
movq 0x55052(%rip), %r15     # 0x64898
movl $0x2b, %edi
callq 0x82d3
leaq 0x58(%rsp), %rdi
callq 0x10652
addq $-0x8, 0xadbd6(%rip)    # 0xbd438
cmpq $0x1, 0x5507e(%rip)     # 0x648e8
je 0xf883
movq 0x14a25(%rip), %rdi     # 0x24298
callq 0x5941
movq $0x1, 0x55065(%rip) # 0x648e8
movq 0x8(%rsp), %rax
movq %rax, 0x55221(%rip)     # 0x64ab0
leaq 0x180(%rsp), %rdi
movl $0x2, %esi
callq 0xc044
addq $-0x8, 0xadb27(%rip)    # 0xbd3d0
addq %rbx, %r14
movq %r14, %rdi
callq 0x5941
movq 0x10(%rsp), %rsi
xorl %edi, %edi
callq 0x617f
leaq 0x118(%rsp), %rdi
movl $0x1, %esi
callq 0xc044
addq $-0x8, 0xadaf6(%rip)    # 0xbd3d0
movq %r13, 0x551cf(%rip)     # 0x64ab0
cmpq 0x59ac0(%rip), %rbx     # 0x693a8
je 0xf8f1
movq 0x59abf(%rip), %rbx     # 0x693b0
leaq 0x55148(%rip), %rdi     # 0x64a40
movq %rbx, %rsi
callq 0x3bf2
leaq 0xb0(%rsp), %rdi
movl $0x3, %esi
callq 0xc044
addq $-0x8, 0xadab6(%rip)    # 0xbd3d0
addq 0x59bb7(%rip), %r15     # 0x694d8
movq %r15, %rdi
callq 0x5941
addq $0x428, %rsp            # imm = 0x428
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq