// File: /workspace/github_cpp_makefile_star2_O2/besm6[P]pascal-re/pascompl.cc
// Function: Factor::stdCall()
void stdCall() {
        const int64_t chkREAL = 0,  chkINT    = 1,  chkCHAR = 2,    chkSCALAR = 3,
            chkPTR  = 4,  chkFILE   = 5,  chkSET  = 6,    chkOTHER  = 7;

        Operator l5op1z;
        TypesPtr l5var2z;
        Kind argKind;
        Bitset asBitset;
        int64_t stProcNo, checkMode;

        curVal.i = routine->procno();
        stProcNo = curVal.i;
        if (SY != LPAREN) {
            requiredSymErr(LPAREN);
            throw 8888;
        }
        expression();
        if (stProcNo >= fnEOF and
            fnEOLN >= stProcNo and
            not (GETELT<=curExpr->op && curExpr->op <=FILEPTR)) {
            error(27); /* errExpressionWhereVariableExpected */
            return;
        }
        arg1Type = curExpr->typ;
        if (arg1Type->k == kindRange)
            arg1Type = arg1Type->cast<RangeT>().base;
        argKind = arg1Type->k;
        if (arg1Type == RealType)
            checkMode = chkREAL;
        else if (arg1Type == IntegerType)
            checkMode = chkINT;
        else if (arg1Type == CharType)
            checkMode = chkCHAR;
        else if (argKind == kindScalar)
            checkMode = chkSCALAR;
        else if (argKind == kindPtr)
            checkMode = chkPTR;
        else if (argKind == kindFile)
            checkMode = chkFILE;
        else if (argKind == kindSet)
            checkMode = chkSET;
        else {
            checkMode = chkOTHER;
        }
        asBitset = Bits(stProcNo);

        if (not ((checkMode == chkREAL and
                 asBitset <= BitRange(fnSQRT,fnTRUNC) + Bits(fnREF, fnSQR, fnROUND, fn29))
                 or ((checkMode == chkINT and
                     asBitset <= BitRange(fnSQRT,fnABS) + Bits(fnODD, fnCHR, fnREF) + Bits(fnSQR, fnPTR)))
                 or (Bits(chkCHAR, chkSCALAR, chkPTR).has(checkMode) and
                     (asBitset <= Bits(fnORD, fnSUCC, fnPRED, fnREF)))
                 or ((checkMode == chkFILE) and
                     (asBitset <= Bits(fnEOF, fnREF, fnEOLN)))
                 or ((checkMode == chkSET) and
                     (asBitset <= Bits(fnREF, fnCARD, fnMINEL)))
                 or ((checkMode == chkOTHER) and
                     (stProcNo == fnREF))))
            error(errNeedOtherTypesOfOperands);

        if (not (asBitset <= Bits(fnABS, fnSUCC, fnPRED, fnSQR))) {
            arg1Type = routine->typ;
        } else if ((checkMode == chkINT) and (asBitset <= Bits(fnABS, fnSQR))) {
            if (stProcNo == fnABS)
                stProcNo = fnABSI;
            else
              stProcNo = fnSQRI;
        }
        l4exp6z = new Expr;
        l4exp6z->op = STANDPROC;
        l4exp6z->expr1 = curExpr;
        l4exp6z->num2 = stProcNo;
        if (stProcNo == fn24) {
            if (SY != COMMA) {
                requiredSymErr(COMMA);
                throw 8888;
            }
            expression();
            l5var2z = curExpr->typ;
            l5op1z = badop27;
            if ((l5var2z != RealType) and
                not typeCheck(l5var2z, IntegerType))
                error(errNeedOtherTypesOfOperands);
            if (l5var2z == RealType)
                l5op1z = badop30;
            else if (checkMode == chkREAL)
                l5op1z = badop31;
            l4exp6z->expr2 = curExpr;
            l4exp6z->op = l5op1z;
        }
        curExpr = l4exp6z;
        curExpr->typ = arg1Type;
        checkSymAndRead(RPAREN);
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rdi, %rbx
movq 0x40(%rdi), %rdi
callq 0x1683e
movq (%rax), %rsi
leaq 0x4d5ac(%rip), %rdi     # 0x63a30
callq 0x381c
cmpl $0x7, 0x4d38c(%rip)     # 0x6381c
jne 0x16812
movq 0x4d593(%rip), %r12     # 0x63a30
shlq $0x17, %r12
movq %r12, %r15
sarq $0x17, %r15
callq 0xd048
leaq -0xe(%r15), %rcx
movq 0x4d5e8(%rip), %rax     # 0x63aa0
cmpq $0x2, %rcx
ja 0x164cd
movl 0x8(%rax), %ecx
addl $-0x1c, %ecx
cmpl $0x8, %ecx
jae 0x1659e
movq (%rax), %r14
movq %r14, 0x4d531(%rip)     # 0x63a08
movl 0x10(%r14), %ecx
cmpl $0x2, %ecx
jne 0x164f7
movq %r14, %rdi
callq 0x12d9c
movq 0x18(%rax), %r14
movq %r14, 0x4d515(%rip)     # 0x63a08
movl 0x10(%r14), %ecx
movabsq $0xfef3bfffffff, %rdi   # imm = 0xFEF3BFFFFFFF
movq 0x4d4e8(%rip), %rax     # 0x639f0
movabsq $0xfffe9ffbffff, %r8    # imm = 0xFFFE9FFBFFFF
movq %rax, 0x8(%rsp)
cmpq %rax, %r14
je 0x1655a
cmpq 0x4d4c5(%rip), %r14     # 0x639e8
je 0x165b4
movb $0x1, %al
cmpq 0x4d4c6(%rip), %r14     # 0x639f8
je 0x16602
decl %ecx
cmpl $0x6, %ecx
ja 0x16803
leaq 0x3526(%rip), %rdx      # 0x19a70
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
pushq $0x2c
jmp 0x16641
movb $0x2f, %cl
subb %r15b, %cl
pushq $0x1
popq %r13
shlq %cl, %r13
pushq $0x8
popq %rsi
xorl %edi, %edi
movq %r8, %rbp
callq 0x37ec
notq %rax
andq %r13, %rax
testq %rbp, %rax
je 0x16606
movq %rbp, %r8
pushq $0x2f
popq %rdx
movb $0x1, %sil
xorl %ebp, %ebp
movb $0x1, %al
movabsq $0xfef3bfffffff, %rdi   # imm = 0xFEF3BFFFFFFF
jmp 0x16653
pushq $0x1b
popq %rdi
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x4f2c
movb $0x2f, %cl
subb %r15b, %cl
pushq $0x1
popq %r13
shlq %cl, %r13
xorl %ebp, %ebp
pushq $0x7
popq %rsi
xorl %edi, %edi
callq 0x37ec
notq %rax
andq %r13, %rax
movabsq $0xffaebbffffff, %rcx   # imm = 0xFFAEBBFFFFFF
testq %rcx, %rax
je 0x1661e
pushq $0x2e
popq %rdx
movb $0x1, %r9b
movb $0x1, %sil
movb $0x1, %al
movabsq $0xfef3bfffffff, %rdi   # imm = 0xFEF3BFFFFFFF
movabsq $0xfffe9ffbffff, %r8    # imm = 0xFFFE9FFBFFFF
jmp 0x16656
pushq $0x2d
jmp 0x16641
movabsq $0xfef3bfffffff, %rax   # imm = 0xFEF3BFFFFFFF
testq %rax, %r13
jne 0x166cf
jmp 0x166de
movabsq $0xfef3bfffffff, %rax   # imm = 0xFEF3BFFFFFFF
testq %rax, %r13
jne 0x166cf
jmp 0x167c9
pushq $0x29
popq %rdx
xorl %ebp, %ebp
xorl %esi, %esi
jmp 0x16647
pushq $0x2b
popq %rdx
xorl %ebp, %ebp
movb $0x1, %sil
movb $0x2f, %cl
subb %r15b, %cl
pushq $0x1
popq %r13
shlq %cl, %r13
xorl %r9d, %r9d
movabsq $0x380000000000, %rcx   # imm = 0x380000000000
btq %rdx, %rcx
jae 0x16675
movabsq $0xffd2ffffffff, %rcx   # imm = 0xFFD2FFFFFFFF
andq %r13, %rcx
je 0x166c6
movabsq $0xfffc7fffffff, %rcx   # imm = 0xFFFC7FFFFFFF
testq %rcx, %r13
sete %cl
testb %cl, %bpl
jne 0x166c6
addq $0x48040000, %r8        # imm = 0x48040000
testq %r8, %r13
setne %cl
orb %cl, %sil
cmpq $0x7800000, %r12        # imm = 0x7800000
setne %cl
orb %al, %cl
andb %sil, %cl
cmpb $0x1, %cl
jne 0x166c6
pushq $0x15
popq %rdi
movq %r9, %rbp
callq 0x4f2c
movq %rbp, %r9
movabsq $0xfef3bfffffff, %rdi   # imm = 0xFEF3BFFFFFFF
testq %rdi, %r13
je 0x167c0
movq 0x40(%rbx), %rax
movq 0x18(%rax), %rax
movq %rax, 0x4d32a(%rip)     # 0x63a08
pushq $0x20
popq %rdi
callq 0x390b
movq %rax, 0x28(%rbx)
movl $0x2d, 0x8(%rax)
movq 0x4d3a8(%rip), %rcx     # 0x63aa0
movq %rcx, 0x10(%rax)
movq 0x28(%rbx), %rax
movq %r15, 0x18(%rax)
cmpq $0x18, %r15
jne 0x16794
cmpl $0xe, 0x4d107(%rip)     # 0x6381c
jne 0x16816
callq 0xd048
movq 0x4d379(%rip), %rax     # 0x63aa0
movq (%rax), %r15
cmpq 0x4d2bf(%rip), %r15     # 0x639f0
je 0x16761
movq 0x4d2ae(%rip), %rdx     # 0x639e8
leaq 0x10(%rsp), %r12
movq %r12, %rdi
movq %r15, %rsi
callq 0x74d4
addq $-0x8, 0xa5c56(%rip)    # 0xbc3a8
cmpb $0x0, (%r12)
jne 0x16761
pushq $0x15
popq %rdi
callq 0x4f2c
xorl %eax, %eax
cmpq 0x8(%rsp), %r14
sete %al
cmpq 0x4d27e(%rip), %r15     # 0x639f0
leal 0x17(%rax,%rax), %eax
pushq $0x18
popq %rcx
cmovnel %eax, %ecx
movq 0x4d31d(%rip), %rax     # 0x63aa0
movq 0x28(%rbx), %rdx
movq %rax, 0x18(%rdx)
movq 0x28(%rbx), %rax
movl %ecx, 0x8(%rax)
jmp 0x16798
movq 0x28(%rbx), %rax
movq %rax, 0x4d301(%rip)     # 0x63aa0
movq 0x4d262(%rip), %rcx     # 0x63a08
movq %rcx, (%rax)
pushq $0xc
popq %rdi
callq 0x7429
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
testb %r9b, %r9b
je 0x166de
movabsq $0xfeffbfffffff, %rax   # imm = 0xFEFFBFFFFFFF
testq %rax, %r13
jne 0x166de
xorl %r15d, %r15d
cmpq $0x3800000, %r12        # imm = 0x3800000
sete %r15b
xorq $0x17, %r15
jmp 0x166de
pushq $0x2a
popq %rdx
movb $0x1, %bpl
movb $0x1, %sil
movb $0x1, %al
jmp 0x16647
pushq $0x28
popq %rdx
xorl %ebp, %ebp
movb $0x1, %sil
xorl %eax, %eax
jmp 0x16647
pushq $0x7
jmp 0x16818
pushq $0xe
popq %rdi
callq 0x5c72
pushq $0x4
popq %rdi
callq 0x3110
movl $0x22b8, (%rax)         # imm = 0x22B8
movq 0xc74d(%rip), %rsi      # 0x22f80
movq %rax, %rdi
xorl %edx, %edx
callq 0x33e0
nop