// File: 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
movq %rsp, %rbp
subq $0x150, %rsp            # imm = 0x150
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x148(%rbp)
movq $0x0, -0x10(%rbp)
movq $0x1, -0x18(%rbp)
movq $0x2, -0x20(%rbp)
movq $0x3, -0x28(%rbp)
movq $0x4, -0x30(%rbp)
movq $0x5, -0x38(%rbp)
movq $0x6, -0x40(%rbp)
movq $0x7, -0x48(%rbp)
movq 0x40(%rax), %rdi
callq 0x27580
movq (%rax), %rsi
leaq 0x591d3(%rip), %rdi     # 0x800f0
callq 0x4ad0
leaq 0x591c7(%rip), %rdi     # 0x800f0
callq 0x1dfb0
movq %rax, -0x70(%rbp)
cmpl $0x7, 0x58fa3(%rip)     # 0x7fedc
je 0x26f68
movl $0x7, %edi
callq 0x90f0
movl $0x4, %edi
callq 0x4130
movq %rax, %rdi
movl $0x22b8, (%rdi)         # imm = 0x22B8
movq 0x18021(%rip), %rsi     # 0x3ef80
xorl %eax, %eax
movl %eax, %edx
callq 0x44b0
callq 0x14e90
cmpq $0xe, -0x70(%rbp)
jl 0x26fac
movl $0x10, %eax
cmpq -0x70(%rbp), %rax
jl 0x26fac
movq 0x591da(%rip), %rcx     # 0x80160
movl $0x1c, %eax
cmpl 0x8(%rcx), %eax
jg 0x26f9d
movq 0x591c9(%rip), %rax     # 0x80160
cmpl $0x23, 0x8(%rax)
jle 0x26fac
movl $0x1b, %edi
callq 0x7b40
jmp 0x27532
movq 0x591ad(%rip), %rax     # 0x80160
movq (%rax), %rax
movq %rax, 0x5910b(%rip)     # 0x800c8
movq 0x59104(%rip), %rax     # 0x800c8
cmpl $0x2, 0x10(%rax)
jne 0x26fe1
movq 0x590f7(%rip), %rdi     # 0x800c8
callq 0x1ea10
movq 0x18(%rax), %rax
movq %rax, 0x590e7(%rip)     # 0x800c8
movq 0x590e0(%rip), %rax     # 0x800c8
movl 0x10(%rax), %eax
movl %eax, -0x5c(%rbp)
movq 0x590d3(%rip), %rax     # 0x800c8
cmpq 0x590b4(%rip), %rax     # 0x800b0
jne 0x2700b
movq $0x0, -0x78(%rbp)
jmp 0x27093
movq 0x590b6(%rip), %rax     # 0x800c8
cmpq 0x5908f(%rip), %rax     # 0x800a8
jne 0x27025
movq $0x1, -0x78(%rbp)
jmp 0x27091
movq 0x5909c(%rip), %rax     # 0x800c8
cmpq 0x59085(%rip), %rax     # 0x800b8
jne 0x2703f
movq $0x2, -0x78(%rbp)
jmp 0x2708f
cmpl $0x1, -0x5c(%rbp)
jne 0x2704f
movq $0x3, -0x78(%rbp)
jmp 0x2708d
cmpl $0x3, -0x5c(%rbp)
jne 0x2705f
movq $0x4, -0x78(%rbp)
jmp 0x2708b
cmpl $0x7, -0x5c(%rbp)
jne 0x2706f
movq $0x5, -0x78(%rbp)
jmp 0x27089
cmpl $0x4, -0x5c(%rbp)
jne 0x2707f
movq $0x6, -0x78(%rbp)
jmp 0x27087
movq $0x7, -0x78(%rbp)
jmp 0x27089
jmp 0x2708b
jmp 0x2708d
jmp 0x2708f
jmp 0x27091
jmp 0x27093
movq -0x70(%rbp), %rdi
callq 0x48e0
movq %rax, -0x80(%rbp)
movq -0x80(%rbp), %rax
movq %rax, -0x68(%rbp)
cmpq $0x0, -0x78(%rbp)
jne 0x27121
xorl %eax, %eax
movl %eax, %edi
movl $0x8, %esi
callq 0x4a60
movq %rax, -0x90(%rbp)
movl $0xf, %edi
movl $0x11, %esi
movl $0x12, %edx
movl $0x1d, %ecx
callq 0x4a00
movq %rax, -0x98(%rbp)
movq -0x98(%rbp), %rsi
leaq -0x90(%rbp), %rdi
callq 0x1db20
movq %rax, -0x88(%rbp)
movq -0x88(%rbp), %rsi
leaq -0x68(%rbp), %rdi
callq 0x27540
movb %al, %cl
movb $0x1, %al
testb $0x1, %cl
movb %al, -0x149(%rbp)
jne 0x272e8
cmpq $0x1, -0x78(%rbp)
jne 0x271c9
xorl %eax, %eax
movl %eax, %edi
movl $0x7, %esi
callq 0x4a60
movq %rax, -0xb0(%rbp)
movl $0x9, %edi
movl $0xb, %esi
movl $0xf, %edx
callq 0x4990
movq %rax, -0xb8(%rbp)
movq -0xb8(%rbp), %rsi
leaq -0xb0(%rbp), %rdi
callq 0x1db20
movq %rax, -0xa8(%rbp)
movl $0x11, %edi
movl $0x15, %esi
callq 0x4940
movq %rax, -0xc0(%rbp)
movq -0xc0(%rbp), %rsi
leaq -0xa8(%rbp), %rdi
callq 0x1db20
movq %rax, -0xa0(%rbp)
movq -0xa0(%rbp), %rsi
leaq -0x68(%rbp), %rdi
callq 0x27540
movb %al, %cl
movb $0x1, %al
testb $0x1, %cl
movb %al, -0x149(%rbp)
jne 0x272e8
movl $0x2, %edi
movl $0x3, %esi
movl $0x4, %edx
callq 0x4990
movq %rax, -0xc8(%rbp)
movq -0x78(%rbp), %rsi
leaq -0xc8(%rbp), %rdi
callq 0x1e5f0
testb $0x1, %al
jne 0x271fa
jmp 0x2723d
movl $0xa, %edi
movl $0xc, %esi
movl $0xd, %edx
movl $0xf, %ecx
callq 0x4a00
movq %rax, -0xd0(%rbp)
movq -0xd0(%rbp), %rsi
leaq -0x68(%rbp), %rdi
callq 0x27540
movb %al, %cl
movb $0x1, %al
testb $0x1, %cl
movb %al, -0x149(%rbp)
jne 0x272e8
cmpq $0x5, -0x78(%rbp)
jne 0x2727e
movl $0xe, %edi
movl $0xf, %esi
movl $0x10, %edx
callq 0x4990
movq %rax, -0xd8(%rbp)
movq -0xd8(%rbp), %rsi
leaq -0x68(%rbp), %rdi
callq 0x27540
movb %al, %cl
movb $0x1, %al
testb $0x1, %cl
movb %al, -0x149(%rbp)
jne 0x272e8
cmpq $0x6, -0x78(%rbp)
jne 0x272bf
movl $0xf, %edi
movl $0x13, %esi
movl $0x14, %edx
callq 0x4990
movq %rax, -0xe0(%rbp)
movq -0xe0(%rbp), %rsi
leaq -0x68(%rbp), %rdi
callq 0x27540
movb %al, %cl
movb $0x1, %al
testb $0x1, %cl
movb %al, -0x149(%rbp)
jne 0x272e8
xorl %eax, %eax
cmpq $0x7, -0x78(%rbp)
movb %al, -0x14a(%rbp)
jne 0x272dc
cmpq $0xf, -0x70(%rbp)
sete %al
movb %al, -0x14a(%rbp)
movb -0x14a(%rbp), %al
movb %al, -0x149(%rbp)
movb -0x149(%rbp), %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x272f6
jmp 0x27300
movl $0x15, %edi
callq 0x7b40
movl $0x7, %edi
movl $0xc, %esi
movl $0xd, %edx
movl $0x11, %ecx
callq 0x4a00
movq %rax, -0xe8(%rbp)
movq -0xe8(%rbp), %rsi
leaq -0x68(%rbp), %rdi
callq 0x27540
testb $0x1, %al
jne 0x2734c
movq -0x148(%rbp), %rax
movq 0x40(%rax), %rax
movq 0x18(%rax), %rax
movq %rax, 0x58d7e(%rip)     # 0x800c8
jmp 0x2739c
cmpq $0x1, -0x78(%rbp)
jne 0x2739a
movl $0x7, %edi
movl $0x11, %esi
callq 0x4940
movq %rax, -0xf0(%rbp)
movq -0xf0(%rbp), %rsi
leaq -0x68(%rbp), %rdi
callq 0x27540
testb $0x1, %al
jne 0x2737f
jmp 0x2739a
cmpq $0x7, -0x70(%rbp)
jne 0x27390
movq $0x16, -0x70(%rbp)
jmp 0x27398
movq $0x17, -0x70(%rbp)
jmp 0x2739a
jmp 0x2739c
movl $0x20, %edi
callq 0x1e2e0
movq %rax, %rcx
movq -0x148(%rbp), %rax
movq %rcx, 0x28(%rax)
movq 0x28(%rax), %rcx
movl $0x2d, 0x8(%rcx)
movq 0x58d9a(%rip), %rdx     # 0x80160
movq 0x28(%rax), %rcx
movq %rdx, 0x10(%rcx)
movq -0x70(%rbp), %rcx
movq 0x28(%rax), %rax
movq %rcx, 0x18(%rax)
cmpq $0x18, -0x70(%rbp)
jne 0x27505
cmpl $0xe, 0x58af0(%rip)     # 0x7fedc
je 0x2741b
movl $0xe, %edi
callq 0x90f0
movl $0x4, %edi
callq 0x4130
movq %rax, %rdi
movl $0x22b8, (%rdi)         # imm = 0x22B8
movq 0x17b6e(%rip), %rsi     # 0x3ef80
xorl %eax, %eax
movl %eax, %edx
callq 0x44b0
callq 0x14e90
movq 0x58d39(%rip), %rax     # 0x80160
movq (%rax), %rax
movq %rax, -0x58(%rbp)
movl $0x17, -0x4c(%rbp)
movq -0x58(%rbp), %rcx
movq 0x58c70(%rip), %rdx     # 0x800b0
movb $0x0, -0x139(%rbp)
xorl %eax, %eax
cmpq %rdx, %rcx
movb %al, -0x14b(%rbp)
je 0x27486
movq -0x58(%rbp), %rsi
movq 0x58c49(%rip), %rdx     # 0x800a8
leaq -0x138(%rbp), %rdi
callq 0xb280
movb $0x1, -0x139(%rbp)
leaq -0x138(%rbp), %rdi
callq 0x1e950
xorb $-0x1, %al
movb %al, -0x14b(%rbp)
movb -0x14b(%rbp), %al
movb %al, -0x14c(%rbp)
testb $0x1, -0x139(%rbp)
jne 0x2749d
jmp 0x274a9
leaq -0x138(%rbp), %rdi
callq 0x1e9c0
movb -0x14c(%rbp), %al
testb $0x1, %al
jne 0x274b5
jmp 0x274bf
movl $0x15, %edi
callq 0x7b40
movq -0x58(%rbp), %rax
cmpq 0x58be6(%rip), %rax     # 0x800b0
jne 0x274d5
movl $0x18, -0x4c(%rbp)
jmp 0x274e5
cmpq $0x0, -0x78(%rbp)
jne 0x274e3
movl $0x19, -0x4c(%rbp)
jmp 0x274e5
movq -0x148(%rbp), %rax
movq 0x58c6d(%rip), %rdx     # 0x80160
movq 0x28(%rax), %rcx
movq %rdx, 0x18(%rcx)
movl -0x4c(%rbp), %ecx
movq 0x28(%rax), %rax
movl %ecx, 0x8(%rax)
movq -0x148(%rbp), %rax
movq 0x28(%rax), %rax
movq %rax, 0x58c49(%rip)     # 0x80160
movq 0x58baa(%rip), %rcx     # 0x800c8
movq 0x58c3b(%rip), %rax     # 0x80160
movq %rcx, (%rax)
movl $0xc, %edi
callq 0xb110
addq $0x150, %rsp            # imm = 0x150
popq %rbp
retq
nopl (%rax,%rax)