// File: besm6[P]pascal-re/pascompl.cc
// Function: defineRoutine()
void defineRoutine()
{
    int64_t l3var1z;
    Word l3var2z;
    // Word l3var3z; unused
    int64_t l3int4z;
    IdentRecPtr l3idr5z;
    // Word l3var6z; unused
    Word l3var7z;
    IdentRecPtr &l2idr2z = programme::super.back()->l2idr2z;
    int64_t &l2int11z = programme::super.back()->l2int11z;
    int64_t &l2int21z = programme::super.back()->l2int21z;
    int64_t &jj = programme::super.back()->jj;
    int64_t &localSize = programme::super.back()->localSize;
    bool &l2bool8z = programme::super.back()->l2bool8z;

    objBufIdx = 1;
    objBuffer[objBufIdx] = 0;
    curInsnTemplate = InsnTemp[XTA];
    bool48z = l2idr2z->flags().has(22);
    lineStartOffset = moduleOffset;
    l3var1z = moduleOffset;
    int92z = 2;
    expr63z = NULL;
    arithMode = 1;
    set146z = Bits();
    set147z = BitRange(curProcNesting+1, 6);
    set148z = set147z - Bits(minel(set147z));
    l3var7z.m = set147z;
    int53z = 0;
    regsUsed = BitRange(1,15) - set147z;
    if (curProcNesting != 1)
        parseDecls(2);
    l2int21z = localSize;
    if (SY != BEGINSY)
        requiredSymErr(BEGINSY);
    if (l2idr2z->flags().has(23)) {
        l3idr5z = l2idr2z->argList();
        l3int4z = 3;
        if (l2idr2z->typ != NULL)
            l3int4z = 4;
        while (l3idr5z != l2idr2z) {
            if (l3idr5z->cl == VARID) {
                l3var2z.i = l3idr5z->typ->size;
                if (l3var2z.i != 1) {
                    form3Insn(KVTM+I14 + l3int4z,
                              KVTM+I12 + l3var2z.i,
                              KVTM+I11 + l3idr5z->value());
                    formAndAlign(getHelperProc(73)); /* "P/LNGPAR" */
                }
            }
            l3int4z = l3int4z + 1;
            l3idr5z = l3idr5z->list();
        }
    } /* 21105 */
    if (checkBounds or not optSflags.m.has(NoStackCheck))
        P0715(-1, 95); /* P/SC */
    l3var2z.i = lineNesting;
    do {
        Statement();
        if (SY == SEMICOLON) {
            if (curProcNesting == 1)
                requiredSymErr(PERIOD);
            inSymbol();
            l2bool8z = blockBegSys.has(SY);
            if (not l2bool8z and not errors)
                error(84); /* errErrorInDeclarations */
        } else {
            if (SY == PERIOD and curProcNesting == 1)
                l2bool8z = true;
            else {
                errAndSkip(errBadSymbol, skipToSet);
                l2bool8z = blockBegSys.has(SY);
            }
        }
    } while (!l2bool8z);
    l2idr2z->flags() = (regsUsed * BitRange(0,15)) + (l2idr2z->flags() - l3var7z.m);
    lineNesting = l3var2z.i - 1;
    if (int53z != 0)
        P0715(0, int53z);
    if (not bool48z and not doPMD and (l2int21z == 3) and
        (curProcNesting != 1) and (regsUsed * BitRange(1,15) != BitRange(1,15))) {
        objBuffer[1] = int64_t(KNTR+7) << 24 | KUTC;
        l2idr2z->flags() = l2idr2z->flags() + Bits(25);
        if (objBufIdx == 2) {
            objBuffer[1] = int64_t(KUJ+I13) << 24;
            putLeft = true;
        } else {
            l2idr2z->pos() = l3var1z;
            if (regsUsed.has(13)) {
                curVal.i = minel(BitRange(1,15) - regsUsed);
                l3var7z.m = curVal.m << 24;
                objBuffer[2] |= int64_t(I13+KMTJ) << 24 | l3var7z.ii;
            } else {
                curVal.i = 13;
            }
            form1Insn(InsnTemp[UJ] + indexreg[curVal.i]);
        }
    } else /* 21220 */ {
        if (l2int11z == 0)
            jj = 27;    /* P/E */
        else
            jj = 28;   /* P/EF */
        form1Insn(getHelperProc(jj) + (-I13-0100000));
        if (curProcNesting == 1) {
            parseDecls(2);
            if (optSflags.m.has(S3))
                formAndAlign(getHelperProc(78)); /* "P/PMDSET" */
            form1Insn(InsnTemp[UJ] + l3var1z);
            curVal.i = l2idr2z->pos() - 040000;
            symTab[074002] = 041000000 | (curVal.ii & halfWord);
        }
        curVal.i = l2int21z;
        if (curProcNesting != 1) {
            curVal.i = curVal.i - 2;
            l3var7z.m = curVal.m << 24;
            objBuffer[savedObjIdx] |= l3var7z.ii | int64_t(KUTM+SP) << 24;
        }
    } /* 21261 */
    outputObjFile();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x310, %rsp            # imm = 0x310
leaq 0xc087e(%rip), %rdi     # 0xd8a30
callq 0x1e890
movq (%rax), %rax
movq %rax, -0x30(%rbp)
leaq 0xc086b(%rip), %rdi     # 0xd8a30
callq 0x1e890
movq (%rax), %rax
addq $0x48, %rax
movq %rax, -0x38(%rbp)
leaq 0xc0854(%rip), %rdi     # 0xd8a30
callq 0x1e890
movq (%rax), %rax
addq $0x98, %rax
movq %rax, -0x40(%rbp)
leaq 0xc083b(%rip), %rdi     # 0xd8a30
callq 0x1e890
movq (%rax), %rax
addq $0xa0, %rax
movq %rax, -0x48(%rbp)
leaq 0xc0822(%rip), %rdi     # 0xd8a30
callq 0x1e890
movq (%rax), %rax
addq $0x90, %rax
movq %rax, -0x50(%rbp)
leaq 0xc0809(%rip), %rdi     # 0xd8a30
callq 0x1e890
movq (%rax), %rax
addq $0x39, %rax
movq %rax, -0x58(%rbp)
movq $0x1, 0x67db6(%rip) # 0x7fff8
movq 0x67daf(%rip), %rcx     # 0x7fff8
leaq 0xb0690(%rip), %rax     # 0xc88e0
movq $0x0, (%rax,%rcx,8)
movq 0x6c811(%rip), %rax     # 0x84a70
movq %rax, 0x67cba(%rip)     # 0x7ff20
movq -0x30(%rbp), %rax
movq (%rax), %rdi
callq 0x20960
movq %rax, %rdi
movl $0x16, %esi
callq 0x1e5f0
andb $0x1, %al
movb %al, 0x67c32(%rip)      # 0x7feb9
movq 0x67cba(%rip), %rax     # 0x7ff48
movq %rax, 0x67cbb(%rip)     # 0x7ff50
movq 0x67cac(%rip), %rax     # 0x7ff48
movq %rax, -0x8(%rbp)
movq $0x2, 0x67d55(%rip) # 0x80000
movq $0x0, 0x67c62(%rip) # 0x7ff18
movq $0x1, 0x67cd7(%rip) # 0x7ff98
callq 0x48c0
movq %rax, -0x60(%rbp)
movq -0x60(%rbp), %rax
movq %rax, 0x67e43(%rip)     # 0x80118
movq 0x67c84(%rip), %rdi     # 0x7ff60
addq $0x1, %rdi
movl $0x6, %esi
callq 0x4a60
movq %rax, -0x68(%rbp)
movq -0x68(%rbp), %rax
movq %rax, 0x67e27(%rip)     # 0x80120
movq 0x67e20(%rip), %rax     # 0x80120
movq %rax, -0x80(%rbp)
movq -0x80(%rbp), %rdi
callq 0x85f0
movq %rax, %rdi
callq 0x48e0
movq %rax, -0x78(%rbp)
movq -0x78(%rbp), %rsi
leaq 0x67dfc(%rip), %rdi     # 0x80120
callq 0x1e4e0
movq %rax, -0x70(%rbp)
movq -0x70(%rbp), %rax
movq %rax, 0x67df0(%rip)     # 0x80128
movq 0x67de1(%rip), %rax     # 0x80120
movq %rax, -0x28(%rbp)
movq $0x0, 0x67b82(%rip) # 0x7fed0
movl $0x1, %edi
movl $0xf, %esi
callq 0x4a60
movq %rax, -0x90(%rbp)
movq 0x67db5(%rip), %rax     # 0x80120
movq %rax, -0x98(%rbp)
movq -0x98(%rbp), %rsi
leaq -0x90(%rbp), %rdi
callq 0x1e4e0
movq %rax, -0x88(%rbp)
movq -0x88(%rbp), %rax
movq %rax, 0x67d76(%rip)     # 0x80110
cmpq $0x1, 0x67bbe(%rip)     # 0x7ff60
je 0x183ae
movl $0x2, %edi
callq 0x145e0
movq -0x50(%rbp), %rax
movq (%rax), %rcx
movq -0x40(%rbp), %rax
movq %rcx, (%rax)
cmpl $0x1f, 0x67b19(%rip)    # 0x7fedc
je 0x183cf
movl $0x1f, %edi
callq 0x90f0
movq -0x30(%rbp), %rax
movq (%rax), %rdi
callq 0x20960
movq %rax, %rdi
movl $0x17, %esi
callq 0x1e5f0
testb $0x1, %al
jne 0x183f1
jmp 0x184ea
movq -0x30(%rbp), %rax
movq (%rax), %rdi
callq 0x1ec30
movq (%rax), %rax
movq %rax, -0x20(%rbp)
movq $0x3, -0x18(%rbp)
movq -0x30(%rbp), %rax
movq (%rax), %rax
cmpq $0x0, 0x18(%rax)
je 0x18422
movq $0x4, -0x18(%rbp)
jmp 0x18424
movq -0x20(%rbp), %rax
movq -0x30(%rbp), %rcx
cmpq (%rcx), %rax
je 0x184e8
movq -0x20(%rbp), %rax
cmpl $0x3, 0x20(%rax)
jne 0x184c7
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rax
movq (%rax), %rsi
leaq -0x10(%rbp), %rdi
callq 0x4ad0
leaq -0x10(%rbp), %rdi
callq 0x1dfb0
cmpq $0x1, %rax
je 0x184c5
movq -0x18(%rbp), %rax
addq $0xea0000, %rax         # imm = 0xEA0000
movq %rax, -0x2f0(%rbp)
leaq -0x10(%rbp), %rdi
callq 0x1dfb0
addq $0xca0000, %rax         # imm = 0xCA0000
movq %rax, -0x2e8(%rbp)
movq -0x20(%rbp), %rdi
callq 0x1e6b0
movq -0x2f0(%rbp), %rdi
movq -0x2e8(%rbp), %rsi
movq (%rax), %rdx
addq $0xba0000, %rdx         # imm = 0xBA0000
callq 0x7dd0
movl $0x49, %edi
callq 0x80d0
movq %rax, %rdi
callq 0x7f20
jmp 0x184c7
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
movq -0x20(%rbp), %rdi
callq 0x1e970
movq (%rax), %rax
movq %rax, -0x20(%rbp)
jmp 0x18424
jmp 0x184ea
testb $0x1, 0x67b49(%rip)     # 0x8003a
jne 0x18508
leaq 0x67c36(%rip), %rdi     # 0x80130
movl $0x5, %esi
callq 0x1e5f0
testb $0x1, %al
jne 0x18519
movq $-0x1, %rdi
movl $0x5f, %esi
callq 0x8910
movq 0x67ac8(%rip), %rsi     # 0x7ffe8
leaq -0x10(%rbp), %rdi
callq 0x4ad0
leaq -0xf0(%rbp), %rdi
callq 0x173f0
leaq -0xf0(%rbp), %rdi
callq 0x229f0
cmpl $0xf, 0x67994(%rip)     # 0x7fedc
jne 0x185a7
cmpq $0x1, 0x67a0e(%rip)     # 0x7ff60
jne 0x1855e
movl $0x10, %edi
callq 0x90f0
leaq -0x260(%rbp), %rdi
callq 0x9790
movl 0x6796c(%rip), %eax     # 0x7fedc
movl %eax, %esi
leaq 0x6791f(%rip), %rdi     # 0x7fe98
callq 0x1e5f0
movb %al, %cl
movq -0x58(%rbp), %rax
andb $0x1, %cl
movb %cl, (%rax)
movq -0x58(%rbp), %rax
testb $0x1, (%rax)
jne 0x185a5
testb $0x1, 0x67a9d(%rip)     # 0x80036
jne 0x185a5
movl $0x54, %edi
callq 0x7b40
jmp 0x18603
cmpl $0x10, 0x6792e(%rip)    # 0x7fedc
jne 0x185c3
cmpq $0x1, 0x679a8(%rip)     # 0x7ff60
jne 0x185c3
movq -0x58(%rbp), %rax
movb $0x1, (%rax)
jmp 0x18601
movq 0x678de(%rip), %rax     # 0x7fea8
movq %rax, -0x268(%rbp)
movq -0x268(%rbp), %rsi
movl $0xc, %edi
callq 0xacf0
movl 0x678f4(%rip), %eax     # 0x7fedc
movl %eax, %esi
leaq 0x678a7(%rip), %rdi     # 0x7fe98
callq 0x1e5f0
movb %al, %cl
movq -0x58(%rbp), %rax
andb $0x1, %cl
movb %cl, (%rax)
jmp 0x18603
jmp 0x18605
movq -0x58(%rbp), %rax
movb (%rax), %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x18529
xorl %eax, %eax
movl %eax, %edi
movl $0xf, %esi
callq 0x4a60
movq %rax, -0x280(%rbp)
movq -0x280(%rbp), %rsi
leaq 0x67ad8(%rip), %rdi     # 0x80110
callq 0x1e580
movq %rax, -0x278(%rbp)
movq -0x30(%rbp), %rax
movq (%rax), %rdi
callq 0x20960
movq %rax, %rdi
movq -0x28(%rbp), %rax
movq %rax, -0x290(%rbp)
movq -0x290(%rbp), %rsi
callq 0x1e4e0
movq %rax, -0x288(%rbp)
movq -0x288(%rbp), %rsi
leaq -0x278(%rbp), %rdi
callq 0x1db20
movq %rax, -0x270(%rbp)
movq -0x30(%rbp), %rax
movq (%rax), %rdi
callq 0x20960
movq -0x270(%rbp), %rcx
movq %rcx, (%rax)
leaq -0x10(%rbp), %rdi
callq 0x1dfb0
subq $0x1, %rax
movq %rax, 0x67933(%rip)     # 0x7ffe8
cmpq $0x0, 0x67813(%rip)     # 0x7fed0
je 0x186cf
movq 0x6780a(%rip), %rsi     # 0x7fed0
xorl %eax, %eax
movl %eax, %edi
callq 0x8910
xorl %eax, %eax
testb $0x1, 0x677e1(%rip)     # 0x7feb9
movb %al, -0x2f1(%rbp)
jne 0x1877c
xorl %eax, %eax
testb $0x1, 0x6794c(%rip)     # 0x80039
movb %al, -0x2f1(%rbp)
jne 0x1877c
movq -0x40(%rbp), %rcx
xorl %eax, %eax
cmpq $0x3, (%rcx)
movb %al, -0x2f1(%rbp)
jne 0x1877c
xorl %eax, %eax
cmpq $0x1, 0x6784b(%rip)     # 0x7ff60
movb %al, -0x2f1(%rbp)
je 0x1877c
movl $0x1, %edi
movl $0xf, %esi
callq 0x4a60
movq %rax, -0x2a0(%rbp)
movq -0x2a0(%rbp), %rsi
leaq 0x679cf(%rip), %rdi     # 0x80110
callq 0x1e580
movq %rax, -0x298(%rbp)
movl $0x1, %edi
movl $0xf, %esi
callq 0x4a60
movq %rax, -0x2a8(%rbp)
movq -0x2a8(%rbp), %rsi
leaq -0x298(%rbp), %rdi
callq 0x1e550
movb %al, -0x2f1(%rbp)
movb -0x2f1(%rbp), %al
testb $0x1, %al
jne 0x1878b
jmp 0x18936
movabsq $0x1f007090000, %rax    # imm = 0x1F007090000
movq %rax, 0xb014c(%rip)     # 0xc88e8
movq -0x30(%rbp), %rax
movq (%rax), %rdi
callq 0x20960
movq %rax, -0x300(%rbp)
movl $0x19, %edi
callq 0x48e0
movq -0x300(%rbp), %rdi
movq %rax, -0x2b8(%rbp)
movq -0x2b8(%rbp), %rsi
callq 0x1db20
movq %rax, -0x2b0(%rbp)
movq -0x30(%rbp), %rax
movq (%rax), %rdi
callq 0x20960
movq -0x2b0(%rbp), %rcx
movq %rcx, (%rax)
cmpq $0x2, 0x67800(%rip)     # 0x7fff8
jne 0x18817
movabsq $0xdc0000000000, %rax   # imm = 0xDC0000000000
movq %rax, 0xb00dd(%rip)     # 0xc88e8
movb $0x1, 0x67822(%rip)     # 0x80034
jmp 0x18931
movq -0x8(%rbp), %rax
movq %rax, -0x308(%rbp)
movq -0x30(%rbp), %rax
movq (%rax), %rdi
callq 0x20910
movq -0x308(%rbp), %rcx
movq %rcx, (%rax)
leaq 0x678d1(%rip), %rdi     # 0x80110
movl $0xd, %esi
callq 0x1e5f0
testb $0x1, %al
jne 0x18852
jmp 0x188ec
movl $0x1, %edi
movl $0xf, %esi
callq 0x4a60
movq %rax, -0x2c8(%rbp)
movq 0x678a1(%rip), %rax     # 0x80110
movq %rax, -0x2d0(%rbp)
movq -0x2d0(%rbp), %rsi
leaq -0x2c8(%rbp), %rdi
callq 0x1e4e0
movq %rax, -0x2c0(%rbp)
movq -0x2c0(%rbp), %rdi
callq 0x85f0
movq %rax, %rsi
leaq 0x6784a(%rip), %rdi     # 0x800f0
callq 0x4ad0
leaq 0x6783e(%rip), %rdi     # 0x800f0
movl $0x18, %esi
callq 0x1e650
movq %rax, -0x2d8(%rbp)
movq -0x2d8(%rbp), %rax
movq %rax, -0x28(%rbp)
movabsq $0xd24000000000, %rax   # imm = 0xD24000000000
orq -0x28(%rbp), %rax
orq 0xb000d(%rip), %rax     # 0xc88f0
movq %rax, 0xb0006(%rip)     # 0xc88f0
jmp 0x188fd
leaq 0x677fd(%rip), %rdi     # 0x800f0
movl $0xd, %esi
callq 0x4ad0
movq 0x6c294(%rip), %rax     # 0x84b98
movq %rax, -0x310(%rbp)
leaq 0x677de(%rip), %rdi     # 0x800f0
callq 0x1dfb0
movq -0x310(%rbp), %rdi
movq %rax, %rcx
leaq 0x6bc08(%rip), %rax     # 0x84530
addq (%rax,%rcx,8), %rdi
callq 0x7c20
jmp 0x18a87
movq -0x38(%rbp), %rax
cmpq $0x0, (%rax)
jne 0x1894d
movq -0x48(%rbp), %rax
movq $0x1b, (%rax)
jmp 0x18958
movq -0x48(%rbp), %rax
movq $0x1c, (%rax)
movq -0x48(%rbp), %rax
movq (%rax), %rdi
callq 0x80d0
movq %rax, %rdi
addq $-0xd08000, %rdi        # imm = 0xFF2F8000
callq 0x7c20
cmpq $0x1, 0x675e5(%rip)     # 0x7ff60
jne 0x189fb
movl $0x2, %edi
callq 0x145e0
leaq 0x677a2(%rip), %rdi     # 0x80130
xorl %eax, %eax
movl %eax, %esi
callq 0x1e5f0
testb $0x1, %al
jne 0x1899d
jmp 0x189af
movl $0x4e, %edi
callq 0x80d0
movq %rax, %rdi
callq 0x7f20
movq 0x6c1e2(%rip), %rdi     # 0x84b98
addq -0x8(%rbp), %rdi
callq 0x7c20
movq -0x30(%rbp), %rax
movq (%rax), %rdi
callq 0x20910
movq (%rax), %rsi
subq $0x4000, %rsi           # imm = 0x4000
leaq 0x67714(%rip), %rdi     # 0x800f0
callq 0x4ad0
movq 0x67708(%rip), %rax     # 0x800f0
andq $0xffffff, %rax         # imm = 0xFFFFFF
orq $0x840000, %rax         # imm = 0x840000
movq %rax, 0xa99c5(%rip)     # 0xc23c0
movq -0x40(%rbp), %rax
movq (%rax), %rsi
leaq 0x676e7(%rip), %rdi     # 0x800f0
callq 0x4ad0
cmpq $0x1, 0x6754a(%rip)     # 0x7ff60
je 0x18a85
leaq 0x676d1(%rip), %rdi     # 0x800f0
callq 0x1dfb0
movq %rax, %rsi
subq $0x2, %rsi
leaq 0x676be(%rip), %rdi     # 0x800f0
callq 0x4ad0
leaq 0x676b2(%rip), %rdi     # 0x800f0
movl $0x18, %esi
callq 0x1e650
movq %rax, -0x2e0(%rbp)
movq -0x2e0(%rbp), %rax
movq %rax, -0x28(%rbp)
movabsq $0xfa8000000000, %rdx   # imm = 0xFA8000000000
orq -0x28(%rbp), %rdx
movq 0x67479(%rip), %rcx     # 0x7fee8
leaq 0xafe6a(%rip), %rax     # 0xc88e0
orq (%rax,%rcx,8), %rdx
leaq 0xafe5f(%rip), %rax     # 0xc88e0
movq %rdx, (%rax,%rcx,8)
jmp 0x18a87
callq 0x18120
addq $0x310, %rsp            # imm = 0x310
popq %rbp
retq
nopw %cs:(%rax,%rax)