// File: 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
movq %rsp, %rbp
subq $0x550, %rsp            # imm = 0x550
leaq -0x1b8(%rbp), %rdi
callq 0x9790
callq 0x7e00
movq $0x0, 0x6a3f9(%rip) # 0x80160
cmpl $0x0, 0x6a16e(%rip)     # 0x7fedc
jne 0x15db1
cmpq $0x0, 0x6a2e8(%rip)     # 0x80060
je 0x15da5
movq 0x6a2df(%rip), %rax     # 0x80060
cmpl $0x3, 0x20(%rax)
jne 0x15da5
callq 0x14ae0
movq 0x6a3cd(%rip), %rax     # 0x80160
cmpl $0x1d, 0x8(%rax)
je 0x15da3
movl $0x1e, %edi
callq 0x7b40
jmp 0x15daf
movl $0x1e, %edi
callq 0x7b40
jmp 0x15dfc
movl $0x13, %edi
movl $0x2b, %esi
movl $0x2c, %edx
movl $0x2d, %ecx
callq 0x4a00
movq %rax, -0x1c8(%rbp)
movq -0x1c8(%rbp), %rsi
leaq 0x6a0c9(%rip), %rdi     # 0x7fea8
callq 0x1db20
movq %rax, -0x1c0(%rbp)
movq -0x1c0(%rbp), %rsi
movl $0x3, %edi
callq 0xacf0
cmpq $0x0, 0x6a35c(%rip)     # 0x80160
jne 0x15e14
movq 0x6a34b(%rip), %rax     # 0x80158
movq %rax, 0x6a34c(%rip)     # 0x80160
movq 0x6a345(%rip), %rax     # 0x80160
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
cmpl $0x1, 0x10(%rax)
je 0x15e48
movq -0x8(%rbp), %rax
cmpl $0x2, 0x10(%rax)
je 0x15e48
movl $0x19, %edi
callq 0x7b40
movq 0x6a259(%rip), %rsi     # 0x800a8
movq -0x8(%rbp), %rdx
leaq -0x210(%rbp), %rdi
movq %rdi, -0x520(%rbp)
callq 0xb280
movq -0x520(%rbp), %rdi
callq 0x1e950
movb %al, -0x511(%rbp)
jmp 0x15e7a
leaq -0x210(%rbp), %rdi
callq 0x1e9c0
movb -0x511(%rbp), %al
testb $0x1, %al
jne 0x15e92
jmp 0x15ebf
movq $0x100011, -0x28(%rbp)  # imm = 0x100011
jmp 0x15ec7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x218(%rbp)
movl %eax, -0x21c(%rbp)
leaq -0x210(%rbp), %rdi
callq 0x1e9c0
jmp 0x161bc
movq $0x100008, -0x28(%rbp)  # imm = 0x100008
cmpl $0x13, 0x6a00e(%rip)    # 0x7fedc
jne 0x15edb
callq 0x14e90
movb $0x1, -0x41(%rbp)
jmp 0x15edf
movb $0x0, -0x41(%rbp)
movq 0x6a27a(%rip), %rax     # 0x80160
movq %rax, -0x18(%rbp)
movq 0x6eb5f(%rip), %rax     # 0x84a50
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rsi
movq -0x18(%rbp), %rax
movq (%rax), %rdx
leaq -0x268(%rbp), %rdi
movq %rdi, -0x530(%rbp)
callq 0xb280
movq -0x530(%rbp), %rdi
callq 0x1e950
movb %al, -0x521(%rbp)
jmp 0x15f27
movb -0x521(%rbp), %al
xorb $-0x1, %al
movb %al, -0x531(%rbp)
leaq -0x268(%rbp), %rdi
callq 0x1e9c0
movb -0x531(%rbp), %al
testb $0x1, %al
jne 0x15f4d
jmp 0x15f7c
movl $0x1f, %edi
callq 0x7b40
jmp 0x15f7c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x218(%rbp)
movl %eax, -0x21c(%rbp)
leaq -0x268(%rbp), %rdi
callq 0x1e9c0
jmp 0x161bc
cmpl $0x2c, 0x69f59(%rip)    # 0x7fedc
jne 0x15f87
jmp 0x15fa9
cmpl $0x2d, 0x69f4e(%rip)    # 0x7fedc
jne 0x15f9d
movq 0x6eac1(%rip), %rax     # 0x84a58
movq %rax, -0x30(%rbp)
jmp 0x15fa7
movl $0x46, %edi
callq 0x7b40
jmp 0x15fa9
callq 0x14e90
movq -0x8(%rbp), %rsi
movq 0x6a1a7(%rip), %rax     # 0x80160
movq (%rax), %rdx
leaq -0x2b0(%rbp), %rdi
movq %rdi, -0x540(%rbp)
callq 0xb280
movq -0x540(%rbp), %rdi
callq 0x1e950
movb %al, -0x532(%rbp)
jmp 0x15fe3
movb -0x532(%rbp), %al
xorb $-0x1, %al
movb %al, -0x541(%rbp)
leaq -0x2b0(%rbp), %rdi
callq 0x1e9c0
movb -0x541(%rbp), %al
testb $0x1, %al
jne 0x16009
jmp 0x16038
movl $0x1f, %edi
callq 0x7b40
jmp 0x16038
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x218(%rbp)
movl %eax, -0x21c(%rbp)
leaq -0x2b0(%rbp), %rdi
callq 0x1e9c0
jmp 0x161bc
leaq -0x318(%rbp), %rdi
xorl %esi, %esi
callq 0x112d0
leaq -0x318(%rbp), %rdi
callq 0x21850
movq 0x6a107(%rip), %rax     # 0x80160
movq %rax, -0x20(%rbp)
testb $0x1, -0x41(%rbp)
je 0x1608d
movq -0x18(%rbp), %rax
movq %rax, 0x6a0f2(%rip)     # 0x80160
leaq -0x380(%rbp), %rdi
movl $0x2, %esi
callq 0x112d0
leaq -0x380(%rbp), %rdi
callq 0x21850
jmp 0x1609d
movq 0x6e9dc(%rip), %rdi     # 0x84a70
addq -0x28(%rbp), %rdi
callq 0x7c20
movq $0x0, -0x38(%rbp)
callq 0x7e00
leaq -0x38(%rbp), %rdi
callq 0x7e70
callq 0x7ef0
movq 0x69e89(%rip), %rax     # 0x7ff48
movq %rax, -0x40(%rbp)
movl $0x2b, %edi
callq 0xb110
leaq -0x3d8(%rbp), %rdi
callq 0x173f0
leaq -0x3d8(%rbp), %rdi
callq 0x229f0
callq 0x7e00
movq -0x10(%rbp), %rax
movq %rax, 0x6a06b(%rip)     # 0x80160
leaq -0x440(%rbp), %rdi
movl $0x2, %esi
callq 0x112d0
leaq -0x440(%rbp), %rdi
callq 0x21850
movq -0x30(%rbp), %rdi
addq -0x28(%rbp), %rdi
callq 0x7c20
movq -0x38(%rbp), %rsi
xorl %eax, %eax
movl %eax, %edi
callq 0x8910
leaq -0x4a8(%rbp), %rdi
movl $0x1, %esi
callq 0x112d0
leaq -0x4a8(%rbp), %rdi
callq 0x21850
movq -0x20(%rbp), %rax
movq %rax, 0x6a00c(%rip)     # 0x80160
movq -0x30(%rbp), %rax
cmpq 0x6e8f9(%rip), %rax     # 0x84a58
jne 0x16173
movq -0x30(%rbp), %rsi
leaq 0x69f84(%rip), %rdi     # 0x800f0
callq 0x4ad0
jmp 0x16186
movq 0x6e8e6(%rip), %rsi     # 0x84a60
leaq 0x69f6f(%rip), %rdi     # 0x800f0
callq 0x4ad0
leaq -0x510(%rbp), %rdi
movl $0x3, %esi
callq 0x112d0
leaq -0x510(%rbp), %rdi
callq 0x21850
movq 0x6e9de(%rip), %rdi     # 0x84b88
addq -0x40(%rbp), %rdi
callq 0x7c20
addq $0x550, %rsp            # imm = 0x550
popq %rbp
retq
movq -0x218(%rbp), %rdi
callq 0x44c0
nopl (%rax,%rax)