// File: /workspace/github_cpp_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1e8, %rsp            # imm = 0x1E8
movabsq $0xffffffffffff, %rbp   # imm = 0xFFFFFFFFFFFF
movq 0xad219(%rip), %rax     # 0xbc378
movq -0x8(%rax), %r15
pushq $0x1
popq %rbx
andq $0x0, 0x9d0ba(%rip)     # 0xac228
movq %rbx, 0x547c3(%rip)     # 0x63938
movq 0x59234(%rip), %rax     # 0x683b0
movq %rax, 0x546dd(%rip)     # 0x63860
movq (%r15), %rdi
callq 0x13ee4
movl (%rax), %eax
shrl $0x19, %eax
andb $0x1, %al
movb %al, 0x54661(%rip)      # 0x637f9
movq 0x546e9(%rip), %rax     # 0x63888
andq $0x0, 0x546b1(%rip)     # 0x63858
movq %rax, 0x10(%rsp)
movq %rax, 0x546dd(%rip)     # 0x63890
andq $0x0, 0x5489d(%rip)     # 0x63a58
movq $0x2, 0x5477a(%rip) # 0x63940
movq %rbx, 0x5470b(%rip)     # 0x638d8
movq 0x546cc(%rip), %r14     # 0x638a0
leaq 0x1(%r14), %rdi
pushq $0x6
popq %rsi
callq 0x37ec
movq %rax, %r13
movq %rax, %r12
notq %r12
movq %rax, 0x54870(%rip)     # 0x63a60
movq %rax, %rdi
callq 0x5593
movb $0x2f, %cl
subb %al, %cl
movq %r13, %rax
btrq %rcx, %rax
andq %rbp, %rax
movq %rax, 0x5485b(%rip)     # 0x63a68
andq $0x0, 0x545fb(%rip)     # 0x63810
pushq $0xf
popq %rsi
movq %rbx, %rdi
callq 0x37ec
andq %rbp, %r12
movq %rax, 0x8(%rsp)
movq %r12, 0x18(%rsp)
andq %r12, %rax
movq %r13, %r12
movabsq $-0x1000000000000, %rcx # imm = 0xFFFF000000000000
andq %rcx, %r12
orq %r12, %rax
movq %rax, 0x54806(%rip)     # 0x63a50
cmpq %rbx, %r14
je 0xf257
pushq $0x2
popq %rdi
callq 0xca1b
movq 0x90(%r15), %rax
movq %rax, 0x98(%r15)
cmpl $0x1f, 0x545b0(%rip)    # 0x6381c
je 0xf276
pushq $0x1f
popq %rdi
callq 0x5c72
movq (%r15), %rdi
callq 0x13ee4
testb $0x1, 0x3(%rax)
jne 0xf39c
cmpb $0x0, 0x546eb(%rip)     # 0x6397a
jne 0xf29a
testb $0x4, 0x547dd(%rip)     # 0x63a75
jne 0xf2a5
pushq $-0x1
popq %rdi
pushq $0x5f
popq %rsi
callq 0x56f1
movq 0x5467c(%rip), %rsi     # 0x63928
movq %rsp, %rdi
callq 0x381c
leaq 0x20(%rsp), %r13
leaq 0x78(%rsp), %rbx
pushq $0x54
popq %rbp
pushq $0xc
popq %r14
movq %r13, %rdi
callq 0xe7dc
addq $-0x8, 0xad153(%rip)    # 0xbc428
movl 0x54541(%rip), %eax     # 0x6381c
cmpl $0xf, %eax
jne 0xf324
cmpq $0x1, 0x545b8(%rip)     # 0x638a0
jne 0xf2f2
pushq $0x10
popq %rdi
callq 0x5c72
movq %rbx, %rdi
callq 0x6316
movl 0x5451c(%rip), %eax     # 0x6381c
cmpq $0x30, %rax
jae 0xf369
movq 0x544cb(%rip), %rcx     # 0x637d8
movb $0x2f, %dl
subb %al, %dl
movzbl %dl, %eax
btq %rax, %rcx
setb 0x39(%r15)
jae 0xf36e
jmp 0xf439
cmpl $0x10, %eax
jne 0xf337
cmpq $0x1, 0x5456f(%rip)     # 0x638a0
je 0xf434
movq 0x544aa(%rip), %rsi     # 0x637e8
movq %r14, %rdi
callq 0x71de
movl 0x544d0(%rip), %eax     # 0x6381c
cmpq $0x2f, %rax
ja 0xf389
movq 0x5447f(%rip), %rcx     # 0x637d8
movb $0x2f, %dl
subb %al, %dl
movzbl %dl, %eax
btq %rax, %rcx
setb %al
jmp 0xf38b
movb $0x0, 0x39(%r15)
cmpb $0x0, 0x54601(%rip)     # 0x63976
je 0xf37b
xorl %eax, %eax
jmp 0xf38f
movq %rbp, %rdi
callq 0x4f2c
movb 0x39(%r15), %al
jmp 0xf38f
xorl %eax, %eax
movb %al, 0x39(%r15)
testb $0x1, %al
je 0xf2c5
jmp 0xf439
movq (%r15), %rdi
callq 0x12e9c
movq (%r15), %rcx
cmpq $0x1, 0x18(%rcx)
movl $0xea0004, %ebx         # imm = 0xEA0004
sbbq $0x0, %rbx
movq %rsp, %r14
movq (%rax), %r13
cmpq %rcx, %r13
je 0xf288
cmpl $0x3, 0x20(%r13)
jne 0xf424
movq 0x18(%r13), %rax
movq (%rax), %rsi
movq %r14, %rdi
callq 0x381c
movq (%rsp), %rbp
shlq $0x17, %rbp
cmpq $0x800000, %rbp         # imm = 0x800000
je 0xf424
sarq $0x17, %rbp
addq $0xca0000, %rbp         # imm = 0xCA0000
movq %r13, %rdi
callq 0x12c80
movq (%rax), %rdx
movl $0xba0000, %eax         # imm = 0xBA0000
addq %rax, %rdx
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x50f5
pushq $0x49
popq %rdi
callq 0x52d1
movq %rax, %rdi
callq 0x51c4
movq %r13, %rdi
callq 0x12d6e
movq (%r15), %rcx
incq %rbx
jmp 0xf3b8
movb $0x1, 0x39(%r15)
pushq $0xf
popq %rsi
xorl %edi, %edi
callq 0x37ec
movq %rax, %rbx
movq (%r15), %rdi
movabsq $0xffffffffffff, %r14   # imm = 0xFFFFFFFFFFFF
andq %r14, %rbx
andq 0x545f3(%rip), %rbx     # 0x63a50
callq 0x13ee4
movq 0x18(%rsp), %rcx
andq (%rax), %rcx
orq %r12, %rbx
orq %rcx, %rbx
movq (%r15), %rdi
callq 0x13ee4
movq %rbx, (%rax)
movq (%rsp), %rax
shlq $0x17, %rax
sarq $0x17, %rax
decq %rax
movq %rax, 0x54497(%rip)     # 0x63928
movq 0x54378(%rip), %rsi     # 0x63810
testq %rsi, %rsi
je 0xf4a4
xorl %edi, %edi
callq 0x56f1
cmpb $0x0, 0x5434e(%rip)     # 0x637f9
jne 0xf4ba
cmpb $0x0, 0x544c5(%rip)     # 0x63979
je 0xf5d7
cmpq $0x1, 0x48(%r15)
pushq $0x1c
popq %rdi
sbbq $0x0, %rdi
movq %rdi, 0xa0(%r15)
callq 0x52d1
leaq -0xd08000(%rax), %rdi
callq 0x4fcb
cmpq $0x1, 0x543ba(%rip)     # 0x638a0
jne 0xf551
pushq $0x2
popq %rdi
callq 0xca1b
testb $-0x80, 0x5457e(%rip)   # 0x63a75
je 0xf509
pushq $0x4e
popq %rdi
callq 0x52d1
movq %rax, %rdi
callq 0x51c4
movq 0x10(%rsp), %rdi
addq 0x58fc3(%rip), %rdi     # 0x684d8
callq 0x4fcb
movq (%r15), %rdi
callq 0x13eb6
movq $-0x4000, %rsi          # imm = 0xC000
addq (%rax), %rsi
leaq 0x544fd(%rip), %rdi     # 0x63a30
callq 0x381c
movq 0x544f1(%rip), %rax     # 0x63a30
andl $0x7bffff, %eax         # imm = 0x7BFFFF
orq $0x840000, %rax         # imm = 0x840000
movq %rax, 0x967af(%rip)     # 0xa5d00
movq 0x98(%r15), %rsi
leaq 0x544d1(%rip), %rdi     # 0x63a30
callq 0x381c
cmpq $0x1, 0x54334(%rip)     # 0x638a0
je 0xf5c0
leaq 0x544bb(%rip), %rdi     # 0x63a30
movq 0x544b4(%rip), %rsi     # 0x63a30
shlq $0x17, %rsi
sarq $0x17, %rsi
addq $-0x2, %rsi
callq 0x381c
movq 0x5449c(%rip), %rax     # 0x63a30
andl $0x57fff, %eax          # imm = 0x57FFF
shlq $0x18, %rax
movq 0x54284(%rip), %rcx     # 0x63828
leaq 0x9cc75(%rip), %rdx     # 0xac220
orq (%rdx,%rcx,8), %rax
movabsq $0xfa8000000000, %rsi   # imm = 0xFA8000000000
orq %rax, %rsi
movq %rsi, (%rdx,%rcx,8)
callq 0xf0d4
addq $0x1e8, %rsp            # imm = 0x1E8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpq $0x3, 0x98(%r15)
jne 0xf4ba
cmpq $0x1, 0x542b3(%rip)     # 0x638a0
je 0xf4ba
movq 0x54456(%rip), %rax     # 0x63a50
notq %rax
andq %r14, %rax
testq %rax, 0x8(%rsp)
je 0xf4ba
movabsq $0x1f007090000, %rax    # imm = 0x1F007090000
movq %rax, 0x9cc0c(%rip)     # 0xac228
movq (%r15), %rdi
callq 0x13ee4
addq $-0x400000, %r14        # imm = 0xFFC00000
andq (%rax), %r14
orq $0x400000, %r14         # imm = 0x400000
movq (%r15), %rdi
callq 0x13ee4
movq %r14, (%rax)
cmpq $0x2, 0x542f0(%rip)     # 0x63938
jne 0xf667
movabsq $0xdc0000000000, %rax   # imm = 0xDC0000000000
movq %rax, 0x9cbcd(%rip)     # 0xac228
movb $0x1, 0x54312(%rip)     # 0x63974
jmp 0xf5c0
movq (%r15), %rdi
callq 0x13eb6
movq 0x10(%rsp), %rcx
movq %rcx, (%rax)
movq 0x543d2(%rip), %rax     # 0x63a50
btq $0x22, %rax
jb 0xf6ac
movabsq $-0x1000000000000, %rcx # imm = 0xFFFF000000000000
andq 0x5439a(%rip), %rcx     # 0x63a30
movabsq $0xd0000000000d, %rax   # imm = 0xD0000000000D
orq %rcx, %rax
movq %rax, 0x54386(%rip)     # 0x63a30
jmp 0xf719
movq %rax, %rcx
notq %rcx
movabsq $0xfffbffffffff, %rdx   # imm = 0xFFFBFFFFFFFF
movq 0x8(%rsp), %rsi
andq %rdx, %rsi
andq %rcx, %rsi
movabsq $-0x1000000000000, %rdi # imm = 0xFFFF000000000000
andq %rax, %rdi
orq %rsi, %rdi
callq 0x5593
leaq 0x5434d(%rip), %rdi     # 0x63a30
movq %rax, %rsi
callq 0x381c
movq 0x5433e(%rip), %rax     # 0x63a30
movl %eax, %ecx
andl $0x2dbfff, %ecx         # imm = 0x2DBFFF
shlq $0x18, %rcx
orq 0x9cb2b(%rip), %rcx     # 0xac230
movabsq $0xd24000000000, %rdx   # imm = 0xD24000000000
orq %rcx, %rdx
movq %rdx, 0x9cb17(%rip)     # 0xac230
shlq $0x17, %rax
sarq $0x17, %rax
leaq 0x58748(%rip), %rcx     # 0x67e70
movq (%rcx,%rax,8), %rdi
addq 0x58da5(%rip), %rdi     # 0x684d8
callq 0x4fcb
jmp 0xf5c0
nop