// File: /workspace/github_cpp_makefile_star2_O3/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 0xee5e
movq 0x4a364(%rip), %rax     # 0x64aa0
movq (%rax), %rcx
movq %rcx, 0x10(%r14)
movq %rax, 0x30(%r14)
testl %ebx, %ebx
jne 0x1a772
movl 0x8(%rax), %eax
cmpq $0x2f, %rax
ja 0x1a768
movq 0x4a095(%rip), %rcx     # 0x647f0
movb $0x2f, %dl
subb %al, %dl
movzbl %dl, %eax
btq %rax, %rcx
jb 0x1a772
movl $0x1b, %edi
callq 0x58ff
cmpq $0x0, 0x40(%r14)
jne 0x1a89b
movq 0x10(%r14), %rax
testq %rax, %rax
je 0x1a799
cmpl $0x7, 0x10(%rax)
jne 0x1a799
movq 0x4a30d(%rip), %rax     # 0x64aa0
movq %rax, 0x40(%r14)
jmp 0x1a7ef
movl $0x20, %edi
callq 0x3d77
movq %rax, 0x40(%r14)
movq 0x4a232(%rip), %rcx     # 0x649e0
movq %rcx, (%rax)
movq 0x40(%r14), %rax
movl $0x1d, 0x8(%rax)
testb %bl, %bl
je 0x1a7d3
movq 0x4a1c1(%rip), %rcx     # 0x64988
testq %rcx, %rcx
jne 0x1a7df
movl $0x4d, %edi
jmp 0x1a7ea
movq 0x4a1b6(%rip), %rcx     # 0x64990
testq %rcx, %rcx
je 0x1a7e5
movq %rcx, 0x10(%rax)
jmp 0x1a7ef
movl $0x25, %edi
callq 0x58ff
movq 0x40(%r14), %rax
movq (%rax), %rax
movq %rax, 0x4a213(%rip)     # 0x64a10
cmpl $0x7, 0x10(%rax)
jne 0x1a8a5
movq 0x18(%rax), %rsi
movq 0x4a1e6(%rip), %rdx     # 0x649f8
leaq 0x8(%rsp), %r15
movq %r15, %rdi
callq 0x84c6
movzbl (%r15), %eax
movq %rax, 0x50(%r14)
addq $-0x8, 0xa2b79(%rip)    # 0xbd3a8
movb $0x1, 0x4a(%r14)
movl $0x20, %edi
callq 0x3d77
movq %rax, 0x38(%r14)
movq 0x4a1c7(%rip), %rcx     # 0x64a10
cmpl $0x7, 0x10(%rcx)
jne 0x1a8a5
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 0x3d77
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 0x3059(%rip), %rdi      # 0x1d905
leaq 0x2dc1(%rip), %rsi      # 0x1d674
leaq 0x31bb(%rip), %rcx      # 0x1da75
movl $0x1f7, %edx            # imm = 0x1F7
callq 0x3170