#include <perms.h>
int _imp_mainep(int _imp_argc, char **_imp_argv) {
  void Unlink(_imp_string * S) {
    {
      extern void Unlink(_imp_string * Fname);
      _imp_string Fname = _imp_join(*S, Tostring(0));
      Unlink(*String(Addr(Fname) + 1));
    }
  }
  static _imp_string Fname = _imp_str_literal("/tmp/dscond-test.txt");
  int Getchar(void) {
    int Sym;
    Readsymbol(Sym);
    Printstring(_imp_str_literal("Call returned "));
    Printsymbol(Sym);
    Newline();
    return (Sym);
  }
  Openoutput(2, Fname);
  Selectoutput(2);
  Printstring(_imp_str_literal("BUG"));
  Newline();
  Closeoutput();
  Selectoutput(1);
  Openinput(3, Fname);
  Selectinput(3);
  if ('A' <= Getchar() && Getchar() <= 'C') {
    Printstring(_imp_str_literal("Test successful."));
    Newline();
  } else {
    Printstring(_imp_str_literal("Test failed - getchar was called twice."));
    Newline();
  }
  Closeinput();
  Selectinput(0);
  Unlink(Fname);
  exit(0);
  return (1);
}
