// File: /workspace/github_cpp_makefile_star2_O2/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 0x6316
callq 0x5107
andq $0x0, 0x5613a(%rip)     # 0x63aa0
cmpl $0x0, 0x55eaf(%rip)     # 0x6381c
je 0xd991
movabsq $0xffffefffffe3, %rsi   # imm = 0xFFFFEFFFFFE3
andq 0x55e68(%rip), %rsi     # 0x637e8
orq $0x1000001c, %rsi       # imm = 0x1000001C
pushq $0x3
popq %rdi
callq 0x71de
jmp 0xd9be
movq 0x56008(%rip), %rax     # 0x639a0
testq %rax, %rax
je 0xd9b6
cmpl $0x3, 0x20(%rax)
jne 0xd9b6
callq 0xcda9
movq 0x560f1(%rip), %r13     # 0x63aa0
cmpl $0x1d, 0x8(%r13)
je 0xd9d8
pushq $0x1e
popq %rdi
callq 0x4f2c
movq 0x560db(%rip), %r13     # 0x63aa0
testq %r13, %r13
jne 0xd9d8
movq 0x560c7(%rip), %r13     # 0x63a98
movq %r13, 0x560c8(%rip)     # 0x63aa0
movq (%r13), %r14
movl 0x10(%r14), %eax
decl %eax
cmpl $0x2, %eax
jb 0xd9ef
pushq $0x19
popq %rdi
callq 0x4f2c
movq 0x55ff2(%rip), %rsi     # 0x639e8
leaq 0x10(%rsp), %rbx
movq %rbx, %rdi
movq %r14, %rdx
callq 0x74d4
addq $-0x8, 0xae99a(%rip)    # 0xbc3a8
movzbl (%rbx), %eax
movq %rax, 0x8(%rsp)
movl 0x55e00(%rip), %ebp     # 0x6381c
cmpl $0x13, %ebp
jne 0xda26
callq 0xd048
movq 0x56073(%rip), %r12     # 0x63aa0
movq 0x5a95c(%rip), %rbx     # 0x68390
movq (%r12), %rdx
leaq 0x10(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x74d4
addq $-0x8, 0xae958(%rip)    # 0xbc3a8
cmpb $0x0, (%r15)
jne 0xda5e
pushq $0x1f
popq %rdi
callq 0x4f2c
movl 0x55db8(%rip), %eax     # 0x6381c
cmpl $0x2c, %eax
je 0xda7f
cmpl $0x2d, %eax
jne 0xda77
movq 0x5a923(%rip), %rbx     # 0x68398
jmp 0xda7f
pushq $0x46
popq %rdi
callq 0x4f2c
callq 0xd048
movq 0x56015(%rip), %rax     # 0x63aa0
movq (%rax), %rdx
leaq 0x10(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x74d4
addq $-0x8, 0xae902(%rip)    # 0xbc3a8
cmpb $0x0, (%r15)
jne 0xdab4
pushq $0x1f
popq %rdi
callq 0x4f2c
movq 0x8(%rsp), %rax
leaq (%rax,%rax,8), %r14
addq $0x100008, %r14         # imm = 0x100008
leaq 0x250(%rsp), %rdi
xorl %esi, %esi
callq 0xaa9a
addq $-0x8, 0xae8e5(%rip)    # 0xbc3c0
movq 0x55fbe(%rip), %rax     # 0x63aa0
movq %rax, 0x8(%rsp)
cmpl $0x13, %ebp
jne 0xdb0d
movq %r12, 0x55fad(%rip)     # 0x63aa0
leaq 0x1e8(%rsp), %rdi
pushq $0x2
popq %rsi
callq 0xaa9a
addq $-0x8, 0xae8b5(%rip)    # 0xbc3c0
jmp 0xdb1c
movq 0x5a89c(%rip), %rdi     # 0x683b0
addq %r14, %rdi
callq 0x4fcb
leaq 0x10(%rsp), %r12
andq $0x0, (%r12)
callq 0x5107
movq %r12, %rdi
callq 0x5148
callq 0x51a1
movq 0x55d49(%rip), %r15     # 0x63888
pushq $0x2b
popq %rdi
callq 0x7429
leaq 0x58(%rsp), %rdi
callq 0xe7dc
addq $-0x8, 0xae8cf(%rip)    # 0xbc428
callq 0x5107
movq %r13, 0x55f3b(%rip)     # 0x63aa0
leaq 0x180(%rsp), %rdi
pushq $0x2
popq %rsi
callq 0xaa9a
addq $-0x8, 0xae843(%rip)    # 0xbc3c0
addq %rbx, %r14
movq %r14, %rdi
callq 0x4fcb
movq (%r12), %rsi
xorl %edi, %edi
callq 0x56f1
leaq 0x118(%rsp), %rdi
pushq $0x1
popq %rsi
callq 0xaa9a
addq $-0x8, 0xae815(%rip)    # 0xbc3c0
movq 0x8(%rsp), %rax
movq %rax, 0x55ee9(%rip)     # 0x63aa0
cmpq 0x5a7da(%rip), %rbx     # 0x68398
je 0xdbc7
movq 0x5a7d9(%rip), %rbx     # 0x683a0
leaq 0x55e62(%rip), %rdi     # 0x63a30
movq %rbx, %rsi
callq 0x381c
leaq 0xb0(%rsp), %rdi
pushq $0x3
popq %rsi
callq 0xaa9a
addq $-0x8, 0xae7d2(%rip)    # 0xbc3c0
addq 0x5a8d3(%rip), %r15     # 0x684c8
movq %r15, %rdi
callq 0x4fcb
addq $0x428, %rsp            # imm = 0x428
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq