// File: /workspace/github_cpp_makefile_star2_O1/besm6[P]pascal-re/pascompl.cc
// Function: standProc::startReadOrWrite(bool)
void startReadOrWrite(bool l5arg1z) {
        expression();
        l4typ3z = curExpr->typ;
        l4exp7z = curExpr;
        if (not l5arg1z) {
            if (not lvalOpSet.has(curExpr->op))
                error(27); /* errExpressionWhereVariableExpected */
        }
        if (l4exp9z == NULL) {
            if (l4typ3z && l4typ3z->k == kindFile) {
                l4exp9z = curExpr;
            } else {
                l4exp9z = new Expr;
                l4exp9z->typ = textType;
                l4exp9z->op = GETVAR;
                if (l5arg1z) {
                    if (outputFile != NULL)
                        l4exp9z->id1 = outputFile;
                    else
                        error(77); /* errNoOutput */
                } else {
                    if (inputFile != NULL)
                        l4exp9z->id1 = inputFile;
                    else {
                        error(37); /* errInputMissingInProgramHeader */
                    }
                }
            }
            arg2Type = l4exp9z->typ;
            l4var13z.ii = typeCheck(arg2Type->cast<FileT>().fbase, CharType);
            l4bool12z = true;
            l4exp8z = new Expr;
            l4exp8z->typ = arg2Type->cast<FileT>().fbase;
            l4exp8z->op = FILEPTR;
            l4exp8z->expr1 = l4exp9z;
            l4exp6z = new Expr;
            l4exp6z->typ = l4exp8z->typ;
            l4exp6z->op = ASSIGNOP;
            if (l5arg1z)
                l4exp6z->expr1 = l4exp8z;
            else
                l4exp6z->expr2 = l4exp8z;
        } /* 17002 */
    }

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x50, %rsp
movl %esi, %ebx
movq %rdi, %r14
callq 0xebcc
movq 0x4a768(%rip), %rax     # 0x64ab0
movq (%rax), %rcx
movq %rcx, 0x10(%r14)
movq %rax, 0x30(%r14)
testl %ebx, %ebx
jne 0x1a383
movl 0x8(%rax), %eax
cmpq $0x2f, %rax
ja 0x1a379
movb $0x2f, %cl
subb %al, %cl
movl $0x1, %eax
shlq %cl, %rax
andq 0x4a48d(%rip), %rax     # 0x64800
shlq $0x10, %rax
jne 0x1a383
movl $0x1b, %edi
callq 0x589e
cmpq $0x0, 0x40(%r14)
jne 0x1a4ac
movq 0x10(%r14), %rax
testq %rax, %rax
je 0x1a3aa
cmpl $0x7, 0x10(%rax)
jne 0x1a3aa
movq 0x4a70c(%rip), %rax     # 0x64ab0
movq %rax, 0x40(%r14)
jmp 0x1a400
movl $0x20, %edi
callq 0x3d03
movq %rax, 0x40(%r14)
movq 0x4a631(%rip), %rcx     # 0x649f0
movq %rcx, (%rax)
movq 0x40(%r14), %rax
movl $0x1d, 0x8(%rax)
testb %bl, %bl
je 0x1a3e4
movq 0x4a5c0(%rip), %rcx     # 0x64998
testq %rcx, %rcx
jne 0x1a3f0
movl $0x4d, %edi
jmp 0x1a3fb
movq 0x4a5b5(%rip), %rcx     # 0x649a0
testq %rcx, %rcx
je 0x1a3f6
movq %rcx, 0x10(%rax)
jmp 0x1a400
movl $0x25, %edi
callq 0x589e
movq 0x40(%r14), %rax
movq (%rax), %rax
movq %rax, 0x4a612(%rip)     # 0x64a20
cmpl $0x7, 0x10(%rax)
jne 0x1a4b6
movq 0x18(%rax), %rsi
movq 0x4a5e5(%rip), %rdx     # 0x64a08
leaq 0x8(%rsp), %r15
movq %r15, %rdi
callq 0x83b2
movzbl (%r15), %eax
movq %rax, 0x50(%r14)
addq $-0x8, 0xa2f78(%rip)    # 0xbd3b8
movb $0x1, 0x4a(%r14)
movl $0x20, %edi
callq 0x3d03
movq %rax, 0x38(%r14)
movq 0x4a5c6(%rip), %rcx     # 0x64a20
cmpl $0x7, 0x10(%rcx)
jne 0x1a4b6
movq 0x18(%rcx), %rcx
movq %rcx, (%rax)
movq 0x38(%r14), %rax
movl $0x23, 0x8(%rax)
movq 0x40(%r14), %rcx
movq %rcx, 0x10(%rax)
movl $0x20, %edi
callq 0x3d03
movq %rax, 0x28(%r14)
movq 0x38(%r14), %rcx
movq (%rcx), %rcx
movq %rcx, (%rax)
movq 0x28(%r14), %rax
movl $0x1b, 0x8(%rax)
movq 0x38(%r14), %rcx
xorb $0x1, %bl
movzbl %bl, %edx
movq %rcx, 0x10(%rax,%rdx,8)
addq $0x50, %rsp
popq %rbx
popq %r14
popq %r15
retq
leaq 0x338b(%rip), %rdi      # 0x1d848
leaq 0x30f0(%rip), %rsi      # 0x1d5b4
leaq 0x34ed(%rip), %rcx      # 0x1d9b8
movl $0x1f7, %edx            # imm = 0x1F7
callq 0x3170
nop