mono_console_init ()
{
  unsigned int fd.0;
  int fd;

  fd = open ("/dev/null", 2);
  goto <D.17795>;
  <D.17794>:
  fd = open ("/dev/null", 2);
  <D.17795>:
  fd.0 = (unsigned int) fd;
  if (fd.0 <= 2) goto <D.17794>; else goto <D.17796>;
  <D.17796>:
  close (fd);
}


open (const char * __path, int __oflag)
{
  int D.17916;
  int D.17919;
  int D.17924;
  int D.17926;
  int D.17927;
  int D.17930;
  int D.17931;

  D.17916 = __builtin_va_arg_pack_len ();
  if (D.17916 > 1) goto <D.17917>; else goto <D.17918>;
  <D.17917>:
  __open_too_many_args ();
  <D.17918>:
  D.17919 = __builtin_constant_p (__oflag);
  if (D.17919 != 0) goto <D.17920>; else goto <D.17921>;
  <D.17920>:
  D.17924 = __oflag & 256;
  if (D.17924 != 0) goto <D.17922>; else goto <D.17925>;
  <D.17925>:
  D.17926 = __oflag & 4259840;
  if (D.17926 == 4259840) goto <D.17922>; else goto <D.17923>;
  <D.17922>:
  D.17927 = __builtin_va_arg_pack_len ();
  if (D.17927 <= 0) goto <D.17928>; else goto <D.17929>;
  <D.17928>:
  __open_missing_mode ();
  D.17930 = __open_2 (__path, __oflag);
  return D.17930;
  <D.17929>:
  <D.17923>:
  D.17930 = __open_alias (__path, __oflag, __builtin_va_arg_pack ());
  return D.17930;
  <D.17921>:
  D.17931 = __builtin_va_arg_pack_len ();
  if (D.17931 <= 0) goto <D.17932>; else goto <D.17933>;
  <D.17932>:
  D.17930 = __open_2 (__path, __oflag);
  return D.17930;
  <D.17933>:
  D.17930 = __open_alias (__path, __oflag, __builtin_va_arg_pack ());
  return D.17930;
}


ves_icall_System_ConsoleDriver_Isatty (void * handle)
{
  MonoBoolean D.17935;
  int handle.1;
  int D.17937;

  handle.1 = (int) handle;
  D.17937 = isatty (handle.1);
  D.17935 = (MonoBoolean) D.17937;
  return D.17935;
}


ves_icall_System_ConsoleDriver_SetEcho (MonoBoolean want_echo)
{
  MonoBoolean D.17939;
  int D.17940;

  D.17940 = (int) want_echo;
  D.17939 = set_property (8, D.17940);
  return D.17939;
}


set_property (gint property, gboolean value)
{
  int D.17942;
  MonoBoolean D.17945;
  unsigned int D.17946;
  unsigned int property.2;
  unsigned int D.17948;
  _Bool D.17949;
  unsigned int D.17957;
  int D.17959;
  unsigned int D.17960;
  unsigned int D.17961;
  int D.17964;
  struct termios attr;
  gboolean callset;
  gboolean check;

  try
    {
      callset = 0;
      D.17942 = tcgetattr (0, &attr);
      if (D.17942 == -1) goto <D.17943>; else goto <D.17944>;
      <D.17943>:
      D.17945 = 0;
      return D.17945;
      <D.17944>:
      D.17946 = attr.c_lflag;
      property.2 = (unsigned int) property;
      D.17948 = D.17946 & property.2;
      D.17949 = D.17948 != 0;
      check = (gboolean) D.17949;
      if (value != 0) goto <D.17952>; else goto <D.17953>;
      <D.17953>:
      if (check != 0) goto <D.17952>; else goto <D.17951>;
      <D.17952>:
      if (value == 0) goto <D.17950>; else goto <D.17954>;
      <D.17954>:
      if (check == 0) goto <D.17950>; else goto <D.17951>;
      <D.17950>:
      callset = 1;
      if (value != 0) goto <D.17955>; else goto <D.17956>;
      <D.17955>:
      D.17946 = attr.c_lflag;
      property.2 = (unsigned int) property;
      D.17957 = D.17946 | property.2;
      attr.c_lflag = D.17957;
      goto <D.17958>;
      <D.17956>:
      D.17946 = attr.c_lflag;
      D.17959 = ~property;
      D.17960 = (unsigned int) D.17959;
      D.17961 = D.17946 & D.17960;
      attr.c_lflag = D.17961;
      <D.17958>:
      <D.17951>:
      if (callset == 0) goto <D.17962>; else goto <D.17963>;
      <D.17962>:
      D.17945 = 1;
      return D.17945;
      <D.17963>:
      D.17964 = tcsetattr (0, 21518, &attr);
      if (D.17964 == -1) goto <D.17965>; else goto <D.17966>;
      <D.17965>:
      D.17945 = 0;
      return D.17945;
      <D.17966>:
      mono_attr = attr;
      D.17945 = 1;
      return D.17945;
    }
  finally
    {
      attr = {CLOBBER};
    }
}


ves_icall_System_ConsoleDriver_SetBreak (MonoBoolean want_break)
{
  MonoBoolean D.17969;
  _Bool D.17970;
  int D.17971;

  D.17970 = want_break == 0;
  D.17971 = (int) D.17970;
  D.17969 = set_property (1, D.17971);
  return D.17969;
}


ves_icall_System_ConsoleDriver_InternalKeyAvailable (gint32 timeout)
{
  long int D.17829;
  long int iftmp.3;
  int D.17974;
  long int iftmp.4;
  unsigned int __d.5;
  long int D.17983;
  long int D.17984;
  long int D.17985;
  int D.17988;
  int D.17989;
  int * D.17992;
  int D.17993;
  gint32 D.17998;
  struct fd_set rfds;
  struct timeval tv;
  struct timeval * tvptr;
  struct div_t divvy;
  int ret;
  int nbytes;

  try
    {
      <D.17830>:
      {
        unsigned int __i;
        struct fd_set * __arr;

        __arr = &rfds;
        __i = 0;
        goto <D.17826>;
        <D.17825>:
        __arr->fds_bits[__i] = 0;
        __i = __i + 1;
        <D.17826>:
        if (__i <= 31) goto <D.17825>; else goto <D.17827>;
        <D.17827>:
      }
      {
        long int __d;

        __d = 0;
        D.17974 = __builtin_constant_p (__d);
        if (D.17974 != 0) goto <D.17975>; else goto <D.17976>;
        <D.17975>:
        __d.5 = (unsigned int) __d;
        if (__d.5 <= 1023) goto <D.17979>; else goto <D.17980>;
        <D.17979>:
        iftmp.4 = __d / 32;
        goto <D.17981>;
        <D.17980>:
        iftmp.4 = __fdelt_warn (__d);
        <D.17981>:
        iftmp.3 = iftmp.4;
        goto <D.17982>;
        <D.17976>:
        iftmp.3 = __fdelt_chk (__d);
        <D.17982>:
        D.17829 = iftmp.3;
      }
      D.17983 = D.17829;
      D.17984 = rfds.fds_bits[D.17983];
      D.17985 = D.17984 | 1;
      rfds.fds_bits[D.17983] = D.17985;
      if (timeout >= 0) goto <D.17986>; else goto <D.17987>;
      <D.17986>:
      divvy = div (timeout, 1000); [return slot optimization]
      D.17988 = divvy.quot;
      tv.tv_sec = D.17988;
      D.17989 = divvy.rem;
      tv.tv_usec = D.17989;
      tvptr = &tv;
      goto <D.17990>;
      <D.17987>:
      tvptr = 0B;
      <D.17990>:
      ret = select (1, &rfds, 0B, 0B, tvptr);
      if (ret == -1) goto <D.17991>; else goto <D.17831>;
      <D.17991>:
      D.17992 = __errno_location ();
      D.17993 = *D.17992;
      if (D.17993 == 4) goto <D.17830>; else goto <D.17831>;
      <D.17831>:
      if (ret > 0) goto <D.17994>; else goto <D.17995>;
      <D.17994>:
      nbytes = 0;
      ret = ioctl (0, 18047, &nbytes);
      if (ret >= 0) goto <D.17996>; else goto <D.17997>;
      <D.17996>:
      ret = nbytes;
      <D.17997>:
      <D.17995>:
      D.17998 = MAX_EXPR <ret, 0>;
      return D.17998;
    }
  finally
    {
      rfds = {CLOBBER};
      tv = {CLOBBER};
      divvy = {CLOBBER};
      nbytes = {CLOBBER};
    }
}


mono_console_handle_async_ops ()
{
  int need_cancel.6;

  need_cancel.6 = need_cancel;
  if (need_cancel.6 != 0) goto <D.18002>; else goto <D.18003>;
  <D.18002>:
  need_cancel = 0;
  do_console_cancel_event ();
  <D.18003>:
}


do_console_cancel_event ()
{
  struct MonoAppDomain * D.18004;
  struct MonoImage * D.18007;
  struct MonoClassField * cancel_handler_field.7;
  struct MonoClassField * cancel_handler_field.8;
  _Bool D.18014;
  long int D.18015;
  long int D.18016;
  struct MonoDelegate * load_value.9;
  struct MonoVTable * D.18024;
  _Bool D.18025;
  long int D.18026;
  long int D.18027;
  struct MonoClass * D.18030;
  static struct MonoClassField * cancel_handler_field;
  struct MonoDomain * domain;
  struct MonoClass * klass;
  struct MonoDelegate * load_value;
  struct MonoMethod * method;
  struct MonoMethodMessage * msg;
  struct MonoMethod * im;
  struct MonoVTable * vtable;

  try
    {
      domain = mono_domain_get ();
      D.18004 = domain->domain;
      if (D.18004 == 0B) goto <D.18005>; else goto <D.18006>;
      <D.18005>:
      return;
      <D.18006>:
      D.18007 = mono_defaults.corlib;
      klass = mono_class_from_name (D.18007, "System", "Console");
      if (klass == 0B) goto <D.18008>; else goto <D.18009>;
      <D.18008>:
      return;
      <D.18009>:
      cancel_handler_field.7 = cancel_handler_field;
      if (cancel_handler_field.7 == 0B) goto <D.18011>; else goto <D.18012>;
      <D.18011>:
      cancel_handler_field.8 = mono_class_get_field_from_name (klass, "cancel_handler");
      cancel_handler_field = cancel_handler_field.8;
      cancel_handler_field.7 = cancel_handler_field;
      D.18014 = cancel_handler_field.7 == 0B;
      D.18015 = (long int) D.18014;
      D.18016 = __builtin_expect (D.18015, 0);
      if (D.18016 != 0) goto <D.18017>; else goto <D.18018>;
      <D.18017>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "console-unix.c", 246, "cancel_handler_field");
      <D.18018>:
      <D.18012>:
      vtable = mono_class_vtable_full (domain, klass, 0);
      if (vtable == 0B) goto <D.18019>; else goto <D.18020>;
      <D.18019>:
      return;
      <D.18020>:
      cancel_handler_field.7 = cancel_handler_field;
      mono_field_static_get_value (vtable, cancel_handler_field.7, &load_value);
      load_value.9 = load_value;
      if (load_value.9 == 0B) goto <D.18022>; else goto <D.18023>;
      <D.18022>:
      return;
      <D.18023>:
      load_value.9 = load_value;
      D.18024 = load_value.9->object.vtable;
      klass = D.18024->klass;
      method = mono_class_get_method_from_name (klass, "BeginInvoke", -1);
      D.18025 = method == 0B;
      D.18026 = (long int) D.18025;
      D.18027 = __builtin_expect (D.18026, 0);
      if (D.18027 != 0) goto <D.18028>; else goto <D.18029>;
      <D.18028>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "console-unix.c", 258, "method != NULL");
      <D.18029>:
      D.18030 = method->klass;
      im = mono_get_delegate_invoke (D.18030);
      msg = mono_method_call_message_new (method, 0B, im, 0B, 0B);
      load_value.9 = load_value;
      mono_thread_pool_add (load_value.9, msg, 0B, 0B);
    }
  finally
    {
      load_value = {CLOBBER};
    }
}


ves_icall_System_ConsoleDriver_TtySetup (struct MonoString * keypad, struct MonoString * teardown, struct MonoArray * * control_chars, int * * size)
{
  int D.18044;
  int cols_and_lines.10;
  struct MonoDomain * D.18047;
  struct MonoClass * D.18048;
  struct MonoArray * D.18049;
  int D.18050;
  MonoBoolean D.18053;
  unsigned int D.18054;
  unsigned int D.18055;
  unsigned int D.18056;
  unsigned int D.18057;
  int D.18058;
  struct MonoArray * D.18061;
  int setup_finished.11;
  gchar * iftmp.12;
  int atexit_called.13;
  char * teardown_str.14;
  int dims;

  dims = terminal_get_dimensions ();
  if (dims == -1) goto <D.18034>; else goto <D.18035>;
  <D.18034>:
  {
    int cols;
    int rows;
    const char * str;

    cols = 0;
    rows = 0;
    str = monoeg_g_getenv ("COLUMNS");
    if (str != 0B) goto <D.18036>; else goto <D.18037>;
    <D.18036>:
    cols = atoi (str);
    <D.18037>:
    str = monoeg_g_getenv ("LINES");
    if (str != 0B) goto <D.18038>; else goto <D.18039>;
    <D.18038>:
    rows = atoi (str);
    <D.18039>:
    if (cols != 0) goto <D.18042>; else goto <D.18040>;
    <D.18042>:
    if (rows != 0) goto <D.18043>; else goto <D.18040>;
    <D.18043>:
    D.18044 = cols << 16;
    cols_and_lines.10 = D.18044 | rows;
    cols_and_lines = cols_and_lines.10;
    goto <D.18041>;
    <D.18040>:
    cols_and_lines = -1;
    <D.18041>:
  }
  goto <D.18046>;
  <D.18035>:
  cols_and_lines = dims;
  <D.18046>:
  *size = &cols_and_lines;
  D.18047 = mono_domain_get ();
  D.18048 = mono_defaults.byte_class;
  D.18049 = mono_array_new (D.18047, D.18048, 17);
  mono_gc_wbarrier_generic_store (control_chars, D.18049);
  D.18050 = tcgetattr (0, &initial_attr);
  if (D.18050 == -1) goto <D.18051>; else goto <D.18052>;
  <D.18051>:
  D.18053 = 0;
  return D.18053;
  <D.18052>:
  mono_attr = initial_attr;
  D.18054 = mono_attr.c_lflag;
  D.18055 = D.18054 & 4294967293;
  mono_attr.c_lflag = D.18055;
  D.18056 = mono_attr.c_iflag;
  D.18057 = D.18056 & 4294962175;
  mono_attr.c_iflag = D.18057;
  mono_attr.c_cc[4] = 1;
  mono_attr.c_cc[5] = 0;
  D.18058 = tcsetattr (0, 21518, &mono_attr);
  if (D.18058 == -1) goto <D.18059>; else goto <D.18060>;
  <D.18059>:
  D.18053 = 0;
  return D.18053;
  <D.18060>:
  D.18061 = *control_chars;
  set_control_chars (D.18061, &mono_attr.c_cc);
  setup_finished.11 = setup_finished;
  if (setup_finished.11 != 0) goto <D.18063>; else goto <D.18064>;
  <D.18063>:
  D.18053 = 1;
  return D.18053;
  <D.18064>:
  if (keypad != 0B) goto <D.18066>; else goto <D.18067>;
  <D.18066>:
  iftmp.12 = mono_string_to_utf8 (keypad);
  goto <D.18068>;
  <D.18067>:
  iftmp.12 = 0B;
  <D.18068>:
  keypad_xmit_str = iftmp.12;
  console_set_signal_handlers ();
  setup_finished = 1;
  atexit_called.13 = atexit_called;
  if (atexit_called.13 == 0) goto <D.18070>; else goto <D.18071>;
  <D.18070>:
  if (teardown != 0B) goto <D.18072>; else goto <D.18073>;
  <D.18072>:
  teardown_str.14 = mono_string_to_utf8 (teardown);
  teardown_str = teardown_str.14;
  <D.18073>:
  atexit (tty_teardown);
  <D.18071>:
  D.18053 = 1;
  return D.18053;
}


tty_teardown ()
{
  int setup_finished.15;
  gchar * teardown_str.16;
  unsigned int D.18082;
  int unused;

  setup_finished.15 = setup_finished;
  if (setup_finished.15 == 0) goto <D.18077>; else goto <D.18078>;
  <D.18077>:
  return;
  <D.18078>:
  teardown_str.16 = teardown_str;
  if (teardown_str.16 != 0B) goto <D.18080>; else goto <D.18081>;
  <D.18080>:
  teardown_str.16 = teardown_str;
  teardown_str.16 = teardown_str;
  D.18082 = strlen (teardown_str.16);
  unused = write (1, teardown_str.16, D.18082);
  teardown_str.16 = teardown_str;
  monoeg_g_free (teardown_str.16);
  teardown_str = 0B;
  <D.18081>:
  tcflush (0, 0);
  tcsetattr (0, 21518, &initial_attr);
  set_property (8, 1);
  setup_finished = 0;
}


terminal_get_dimensions ()
{
  int * D.18084;
  int D.18085;
  short unsigned int D.18088;
  int D.18089;
  int D.18090;
  short unsigned int D.18091;
  int D.18092;
  int D.18093;
  struct winsize ws;
  int ret;
  int save_errno;

  try
    {
      D.18084 = __errno_location ();
      save_errno = *D.18084;
      D.18085 = ioctl (0, 1074295912, &ws);
      if (D.18085 == 0) goto <D.18086>; else goto <D.18087>;
      <D.18086>:
      D.18088 = ws.ws_col;
      D.18089 = (int) D.18088;
      D.18090 = D.18089 << 16;
      D.18091 = ws.ws_row;
      D.18092 = (int) D.18091;
      ret = D.18090 | D.18092;
      D.18084 = __errno_location ();
      *D.18084 = save_errno;
      D.18093 = ret;
      return D.18093;
      <D.18087>:
      D.18093 = -1;
      return D.18093;
    }
  finally
    {
      ws = {CLOBBER};
    }
}


atoi (const char * __nptr)
{
  int D.18096;

  D.18096 = strtol (__nptr, 0B, 10);
  return D.18096;
}


set_control_chars (struct MonoArray * control_chars, const guchar * cc)
{
  unsigned char D.18098;
  char D.18099;
  const guchar * D.18100;
  unsigned char D.18101;
  char D.18102;
  const guchar * D.18103;
  unsigned char D.18104;
  char D.18105;
  const guchar * D.18106;
  unsigned char D.18107;
  char D.18108;
  const guchar * D.18109;
  unsigned char D.18110;
  char D.18111;
  const guchar * D.18112;
  unsigned char D.18113;
  char D.18114;
  const guchar * D.18115;
  unsigned char D.18116;
  char D.18117;
  const guchar * D.18118;
  unsigned char D.18119;
  char D.18120;
  const guchar * D.18121;
  unsigned char D.18122;
  char D.18123;
  const guchar * D.18124;
  unsigned char D.18125;
  char D.18126;
  const guchar * D.18127;
  unsigned char D.18128;
  char D.18129;
  const guchar * D.18130;
  unsigned char D.18131;
  char D.18132;
  const guchar * D.18133;
  unsigned char D.18134;
  char D.18135;
  const guchar * D.18136;
  unsigned char D.18137;
  char D.18138;
  const guchar * D.18139;
  unsigned char D.18140;
  char D.18141;
  const guchar * D.18142;
  unsigned char D.18143;
  char D.18144;
  const guchar * D.18145;
  unsigned char D.18146;
  char D.18147;

  {
    gchar * __p;

    __p = mono_array_addr_with_size (control_chars, 1, 0);
    D.18098 = *cc;
    D.18099 = (char) D.18098;
    *__p = D.18099;
  }
  {
    gchar * __p;

    __p = mono_array_addr_with_size (control_chars, 1, 1);
    D.18100 = cc + 1;
    D.18101 = *D.18100;
    D.18102 = (char) D.18101;
    *__p = D.18102;
  }
  {
    gchar * __p;

    __p = mono_array_addr_with_size (control_chars, 1, 2);
    D.18103 = cc + 2;
    D.18104 = *D.18103;
    D.18105 = (char) D.18104;
    *__p = D.18105;
  }
  {
    gchar * __p;

    __p = mono_array_addr_with_size (control_chars, 1, 3);
    D.18106 = cc + 3;
    D.18107 = *D.18106;
    D.18108 = (char) D.18107;
    *__p = D.18108;
  }
  {
    gchar * __p;

    __p = mono_array_addr_with_size (control_chars, 1, 4);
    D.18109 = cc + 16;
    D.18110 = *D.18109;
    D.18111 = (char) D.18110;
    *__p = D.18111;
  }
  {
    gchar * __p;

    __p = mono_array_addr_with_size (control_chars, 1, 5);
    D.18112 = cc + 5;
    D.18113 = *D.18112;
    D.18114 = (char) D.18113;
    *__p = D.18114;
  }
  {
    gchar * __p;

    __p = mono_array_addr_with_size (control_chars, 1, 6);
    D.18115 = cc + 4;
    D.18116 = *D.18115;
    D.18117 = (char) D.18116;
    *__p = D.18117;
  }
  {
    gchar * __p;

    __p = mono_array_addr_with_size (control_chars, 1, 7);
    D.18118 = cc + 7;
    D.18119 = *D.18118;
    D.18120 = (char) D.18119;
    *__p = D.18120;
  }
  {
    gchar * __p;

    __p = mono_array_addr_with_size (control_chars, 1, 8);
    D.18121 = cc + 8;
    D.18122 = *D.18121;
    D.18123 = (char) D.18122;
    *__p = D.18123;
  }
  {
    gchar * __p;

    __p = mono_array_addr_with_size (control_chars, 1, 9);
    D.18124 = cc + 9;
    D.18125 = *D.18124;
    D.18126 = (char) D.18125;
    *__p = D.18126;
  }
  {
    gchar * __p;

    __p = mono_array_addr_with_size (control_chars, 1, 10);
    D.18127 = cc + 10;
    D.18128 = *D.18127;
    D.18129 = (char) D.18128;
    *__p = D.18129;
  }
  {
    gchar * __p;

    __p = mono_array_addr_with_size (control_chars, 1, 11);
    D.18130 = cc + 17;
    D.18131 = *D.18130;
    D.18132 = (char) D.18131;
    *__p = D.18132;
  }
  {
    gchar * __p;

    __p = mono_array_addr_with_size (control_chars, 1, 12);
    D.18133 = cc + 12;
    D.18134 = *D.18133;
    D.18135 = (char) D.18134;
    *__p = D.18135;
  }
  {
    gchar * __p;

    __p = mono_array_addr_with_size (control_chars, 1, 13);
    D.18136 = cc + 13;
    D.18137 = *D.18136;
    D.18138 = (char) D.18137;
    *__p = D.18138;
  }
  {
    gchar * __p;

    __p = mono_array_addr_with_size (control_chars, 1, 14);
    D.18139 = cc + 14;
    D.18140 = *D.18139;
    D.18141 = (char) D.18140;
    *__p = D.18141;
  }
  {
    gchar * __p;

    __p = mono_array_addr_with_size (control_chars, 1, 15);
    D.18142 = cc + 15;
    D.18143 = *D.18142;
    D.18144 = (char) D.18143;
    *__p = D.18144;
  }
  {
    gchar * __p;

    __p = mono_array_addr_with_size (control_chars, 1, 16);
    D.18145 = cc + 6;
    D.18146 = *D.18145;
    D.18147 = (char) D.18146;
    *__p = D.18147;
  }
}


console_set_signal_handlers ()
{
  struct sigaction sigcont;
  struct sigaction sigint;
  struct sigaction sigwinch;

  try
    {
      memset (&sigcont, 0, 144);
      memset (&sigint, 0, 144);
      memset (&sigwinch, 0, 144);
      sigcont.__sigaction_handler.sa_handler = sigcont_handler;
      sigcont.sa_flags = 0;
      sigemptyset (&sigcont.sa_mask);
      sigaction (25, &sigcont, &save_sigcont);
      sigint.__sigaction_handler.sa_handler = sigint_handler;
      sigint.sa_flags = 0;
      sigemptyset (&sigint.sa_mask);
      sigaction (2, &sigint, &save_sigint);
      sigwinch.__sigaction_handler.sa_handler = sigwinch_handler;
      sigwinch.sa_flags = 0;
      sigemptyset (&sigwinch.sa_mask);
      sigaction (20, &sigwinch, &save_sigwinch);
    }
  finally
    {
      sigcont = {CLOBBER};
      sigint = {CLOBBER};
      sigwinch = {CLOBBER};
    }
}


sigwinch_handler (int signo, void * the_siginfo, void * data)
{
  void (*<Tf08>) (int, struct siginfo_t *, void *) D.18150;
  int dims;

  dims = terminal_get_dimensions ();
  if (dims != -1) goto <D.18148>; else goto <D.18149>;
  <D.18148>:
  cols_and_lines = dims;
  <D.18149>:
  D.18150 = save_sigwinch.__sigaction_handler.sa_sigaction;
  if (D.18150 > 1B) goto <D.18151>; else goto <D.18152>;
  <D.18151>:
  D.18150 = save_sigwinch.__sigaction_handler.sa_sigaction;
  D.18150 (signo, the_siginfo, data);
  <D.18152>:
}


sigint_handler (int signo)
{
  int in_sigint.17;
  int * D.18156;
  int save_errno;

  in_sigint.17 = in_sigint;
  if (in_sigint.17 != 0) goto <D.18154>; else goto <D.18155>;
  <D.18154>:
  return;
  <D.18155>:
  in_sigint = 1;
  D.18156 = __errno_location ();
  save_errno = *D.18156;
  need_cancel = 1;
  mono_gc_finalize_notify ();
  D.18156 = __errno_location ();
  *D.18156 = save_errno;
  in_sigint = 0;
}


sigcont_handler (int signo, void * the_siginfo, void * data)
{
  gchar * keypad_xmit_str.18;
  unsigned int D.18161;
  void (*<Tf08>) (int, struct siginfo_t *, void *) D.18162;
  int unused;

  tcsetattr (0, 21518, &mono_attr);
  keypad_xmit_str.18 = keypad_xmit_str;
  if (keypad_xmit_str.18 != 0B) goto <D.18159>; else goto <D.18160>;
  <D.18159>:
  keypad_xmit_str.18 = keypad_xmit_str;
  keypad_xmit_str.18 = keypad_xmit_str;
  D.18161 = strlen (keypad_xmit_str.18);
  unused = write (1, keypad_xmit_str.18, D.18161);
  <D.18160>:
  D.18162 = save_sigcont.__sigaction_handler.sa_sigaction;
  if (D.18162 > 1B) goto <D.18163>; else goto <D.18164>;
  <D.18163>:
  D.18162 = save_sigcont.__sigaction_handler.sa_sigaction;
  D.18162 (signo, the_siginfo, data);
  <D.18164>:
}


memset (void * __dest, int __ch, size_t __len)
{
  int D.18167;
  int D.18172;
  void * D.18174;
  unsigned int D.18175;

  D.18167 = __builtin_constant_p (__len);
  if (D.18167 != 0) goto <D.18168>; else goto <D.18169>;
  <D.18168>:
  if (__len == 0) goto <D.18170>; else goto <D.18171>;
  <D.18170>:
  D.18172 = __builtin_constant_p (__ch);
  if (D.18172 == 0) goto <D.18165>; else goto <D.18173>;
  <D.18173>:
  if (__ch != 0) goto <D.18165>; else goto <D.18166>;
  <D.18165>:
  __warn_memset_zero_len ();
  D.18174 = __dest;
  return D.18174;
  <D.18166>:
  <D.18171>:
  <D.18169>:
  D.18175 = __builtin_object_size (__dest, 0);
  D.18174 = __builtin___memset_chk (__dest, __ch, __len, D.18175);
  return D.18174;
}


