// File: /workspace/github_cpp_makefile_star2_O2/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 0xd048
movq 0x4c80c(%rip), %rax     # 0x63aa0
movq (%rax), %rcx
movq %rcx, 0x10(%r14)
movq %rax, 0x30(%r14)
testl %ebx, %ebx
jne 0x172c8
movl 0x8(%rax), %eax
cmpq $0x2f, %rax
ja 0x172c0
movq 0x4c53d(%rip), %rcx     # 0x637f0
movb $0x2f, %dl
subb %al, %dl
movzbl %dl, %eax
btq %rax, %rcx
jb 0x172c8
pushq $0x1b
popq %rdi
callq 0x4f2c
cmpq $0x0, 0x40(%r14)
jne 0x173e8
movq 0x10(%r14), %rax
testq %rax, %rax
je 0x172ef
cmpl $0x7, 0x10(%rax)
jne 0x172ef
movq 0x4c7b7(%rip), %rax     # 0x63aa0
movq %rax, 0x40(%r14)
jmp 0x1733e
pushq $0x20
popq %rdi
callq 0x390b
movq %rax, 0x40(%r14)
movq 0x4c6de(%rip), %rcx     # 0x639e0
movq %rcx, (%rax)
movq 0x40(%r14), %rax
movl $0x1d, 0x8(%rax)
testb %bl, %bl
je 0x17324
movq 0x4c66d(%rip), %rcx     # 0x63988
testq %rcx, %rcx
jne 0x17330
pushq $0x4d
jmp 0x17338
movq 0x4c665(%rip), %rcx     # 0x63990
testq %rcx, %rcx
je 0x17336
movq %rcx, 0x10(%rax)
jmp 0x1733e
pushq $0x25
popq %rdi
callq 0x4f2c
movq 0x40(%r14), %rax
movq (%rax), %rdi
movq %rdi, 0x4c6c4(%rip)     # 0x63a10
callq 0x12e72
movq 0x18(%rax), %rsi
movq 0x4c69c(%rip), %rdx     # 0x639f8
leaq 0x8(%rsp), %r15
movq %r15, %rdi
callq 0x74d4
movzbl (%r15), %eax
movq %rax, 0x50(%r14)
addq $-0x8, 0xa502f(%rip)    # 0xbc3a8
movb $0x1, 0x4a(%r14)
pushq $0x20
popq %r15
movq %r15, %rdi
callq 0x390b
movq %rax, 0x38(%r14)
movq 0x4c67b(%rip), %rdi     # 0x63a10
callq 0x12e72
movq 0x18(%rax), %rax
movq 0x38(%r14), %rcx
movq %rax, (%rcx)
movq 0x38(%r14), %rax
movl $0x23, 0x8(%rax)
movq 0x40(%r14), %rcx
movq %rcx, 0x10(%rax)
movq %r15, %rdi
callq 0x390b
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