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

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


open (const char * __path, int __oflag)
{
  int D.17946;
  int D.17949;
  int D.17954;
  int D.17956;
  int D.17957;
  int D.17960;
  int D.17961;

  D.17946 = __builtin_va_arg_pack_len ();
  if (D.17946 > 1) goto <D.17947>; else goto <D.17948>;
  <D.17947>:
  __open_too_many_args ();
  <D.17948>:
  D.17949 = __builtin_constant_p (__oflag);
  if (D.17949 != 0) goto <D.17950>; else goto <D.17951>;
  <D.17950>:
  D.17954 = __oflag & 64;
  if (D.17954 != 0) goto <D.17952>; else goto <D.17955>;
  <D.17955>:
  D.17956 = __oflag & 4259840;
  if (D.17956 == 4259840) goto <D.17952>; else goto <D.17953>;
  <D.17952>:
  D.17957 = __builtin_va_arg_pack_len ();
  if (D.17957 <= 0) goto <D.17958>; else goto <D.17959>;
  <D.17958>:
  __open_missing_mode ();
  D.17960 = __open_2 (__path, __oflag);
  return D.17960;
  <D.17959>:
  <D.17953>:
  D.17960 = __open_alias (__path, __oflag, __builtin_va_arg_pack ());
  return D.17960;
  <D.17951>:
  D.17961 = __builtin_va_arg_pack_len ();
  if (D.17961 <= 0) goto <D.17962>; else goto <D.17963>;
  <D.17962>:
  D.17960 = __open_2 (__path, __oflag);
  return D.17960;
  <D.17963>:
  D.17960 = __open_alias (__path, __oflag, __builtin_va_arg_pack ());
  return D.17960;
}


ves_icall_System_ConsoleDriver_Isatty (void * handle)
{
  MonoBoolean D.17965;
  int handle.1;
  int D.17967;

  handle.1 = (int) handle;
  D.17967 = isatty (handle.1);
  D.17965 = (MonoBoolean) D.17967;
  return D.17965;
}


ves_icall_System_ConsoleDriver_SetEcho (MonoBoolean want_echo)
{
  MonoBoolean D.17969;
  int D.17970;

  D.17970 = (int) want_echo;
  D.17969 = set_property (8, D.17970);
  return D.17969;
}


set_property (gint property, gboolean value)
{
  int D.17972;
  MonoBoolean D.17975;
  unsigned int D.17976;
  unsigned int property.2;
  unsigned int D.17978;
  _Bool D.17979;
  int D.17980;
  _Bool D.17983;
  _Bool D.17984;
  _Bool D.17985;
  unsigned int D.17990;
  int D.17992;
  unsigned int D.17993;
  unsigned int D.17994;
  int D.17997;
  struct termios attr;
  gboolean callset;
  gboolean check;

  try
    {
      callset = 0;
      D.17972 = tcgetattr (0, &attr);
      if (D.17972 == -1) goto <D.17973>; else goto <D.17974>;
      <D.17973>:
      D.17975 = 0;
      return D.17975;
      <D.17974>:
      D.17976 = attr.c_lflag;
      property.2 = (unsigned int) property;
      D.17978 = D.17976 & property.2;
      D.17979 = D.17978 != 0;
      check = (gboolean) D.17979;
      D.17980 = value | check;
      if (D.17980 != 0) goto <D.17981>; else goto <D.17982>;
      <D.17981>:
      D.17983 = value == 0;
      D.17984 = check == 0;
      D.17985 = D.17983 | D.17984;
      if (D.17985 != 0) goto <D.17986>; else goto <D.17987>;
      <D.17986>:
      callset = 1;
      if (value != 0) goto <D.17988>; else goto <D.17989>;
      <D.17988>:
      D.17976 = attr.c_lflag;
      property.2 = (unsigned int) property;
      D.17990 = D.17976 | property.2;
      attr.c_lflag = D.17990;
      goto <D.17991>;
      <D.17989>:
      D.17976 = attr.c_lflag;
      D.17992 = ~property;
      D.17993 = (unsigned int) D.17992;
      D.17994 = D.17976 & D.17993;
      attr.c_lflag = D.17994;
      <D.17991>:
      <D.17987>:
      <D.17982>:
      if (callset == 0) goto <D.17995>; else goto <D.17996>;
      <D.17995>:
      D.17975 = 1;
      return D.17975;
      <D.17996>:
      D.17997 = tcsetattr (0, 0, &attr);
      if (D.17997 == -1) goto <D.17998>; else goto <D.17999>;
      <D.17998>:
      D.17975 = 0;
      return D.17975;
      <D.17999>:
      mono_attr = attr;
      D.17975 = 1;
      return D.17975;
    }
  finally
    {
      attr = {CLOBBER};
    }
}


ves_icall_System_ConsoleDriver_SetBreak (MonoBoolean want_break)
{
  MonoBoolean D.18002;
  _Bool D.18003;
  int D.18004;

  D.18003 = want_break == 0;
  D.18004 = (int) D.18003;
  D.18002 = set_property (1, D.18004);
  return D.18002;
}


ves_icall_System_ConsoleDriver_InternalKeyAvailable (gint32 timeout)
{
  long int D.17859;
  long int iftmp.3;
  int D.18007;
  long int iftmp.4;
  unsigned int __d.5;
  long int D.18016;
  long int D.18017;
  long int D.18018;
  int D.18021;
  int D.18022;
  int * D.18025;
  int D.18026;
  gint32 D.18031;
  struct fd_set rfds;
  struct timeval tv;
  struct timeval * tvptr;
  struct div_t divvy;
  int ret;
  int nbytes;

  try
    {
      <D.17860>:
      {
        int __d0;
        int __d1;

        __asm__ __volatile__("cld; rep; stosl" : "=c" __d0, "=D" __d1 : "a" 0, "0" 32, "1" &rfds.fds_bits[0] : "memory");
      }
      {
        long int __d;

        __d = 0;
        D.18007 = __builtin_constant_p (__d);
        if (D.18007 != 0) goto <D.18008>; else goto <D.18009>;
        <D.18008>:
        __d.5 = (unsigned int) __d;
        if (__d.5 <= 1023) goto <D.18012>; else goto <D.18013>;
        <D.18012>:
        iftmp.4 = __d / 32;
        goto <D.18014>;
        <D.18013>:
        iftmp.4 = __fdelt_warn (__d);
        <D.18014>:
        iftmp.3 = iftmp.4;
        goto <D.18015>;
        <D.18009>:
        iftmp.3 = __fdelt_chk (__d);
        <D.18015>:
        D.17859 = iftmp.3;
      }
      D.18016 = D.17859;
      D.18017 = rfds.fds_bits[D.18016];
      D.18018 = D.18017 | 1;
      rfds.fds_bits[D.18016] = D.18018;
      if (timeout >= 0) goto <D.18019>; else goto <D.18020>;
      <D.18019>:
      divvy = div (timeout, 1000); [return slot optimization]
      D.18021 = divvy.quot;
      tv.tv_sec = D.18021;
      D.18022 = divvy.rem;
      tv.tv_usec = D.18022;
      tvptr = &tv;
      goto <D.18023>;
      <D.18020>:
      tvptr = 0B;
      <D.18023>:
      ret = select (1, &rfds, 0B, 0B, tvptr);
      if (ret == -1) goto <D.18024>; else goto <D.17861>;
      <D.18024>:
      D.18025 = __errno_location ();
      D.18026 = *D.18025;
      if (D.18026 == 4) goto <D.17860>; else goto <D.17861>;
      <D.17861>:
      if (ret > 0) goto <D.18027>; else goto <D.18028>;
      <D.18027>:
      nbytes = 0;
      ret = ioctl (0, 21531, &nbytes);
      if (ret >= 0) goto <D.18029>; else goto <D.18030>;
      <D.18029>:
      ret = nbytes;
      <D.18030>:
      <D.18028>:
      D.18031 = MAX_EXPR <ret, 0>;
      return D.18031;
    }
  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.18035>; else goto <D.18036>;
  <D.18035>:
  need_cancel = 0;
  do_console_cancel_event ();
  <D.18036>:
}


do_console_cancel_event ()
{
  struct MonoAppDomain * D.18037;
  struct MonoImage * D.18040;
  struct MonoClassField * cancel_handler_field.7;
  struct MonoClassField * cancel_handler_field.8;
  _Bool D.18047;
  long int D.18048;
  long int D.18049;
  struct MonoDelegate * load_value.9;
  struct MonoVTable * D.18057;
  _Bool D.18058;
  long int D.18059;
  long int D.18060;
  struct MonoClass * D.18063;
  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.18037 = domain->domain;
      if (D.18037 == 0B) goto <D.18038>; else goto <D.18039>;
      <D.18038>:
      return;
      <D.18039>:
      D.18040 = mono_defaults.corlib;
      klass = mono_class_from_name (D.18040, "System", "Console");
      if (klass == 0B) goto <D.18041>; else goto <D.18042>;
      <D.18041>:
      return;
      <D.18042>:
      cancel_handler_field.7 = cancel_handler_field;
      if (cancel_handler_field.7 == 0B) goto <D.18044>; else goto <D.18045>;
      <D.18044>:
      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.18047 = cancel_handler_field.7 == 0B;
      D.18048 = (long int) D.18047;
      D.18049 = __builtin_expect (D.18048, 0);
      if (D.18049 != 0) goto <D.18050>; else goto <D.18051>;
      <D.18050>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "console-unix.c", 246, "cancel_handler_field");
      <D.18051>:
      <D.18045>:
      vtable = mono_class_vtable_full (domain, klass, 0);
      if (vtable == 0B) goto <D.18052>; else goto <D.18053>;
      <D.18052>:
      return;
      <D.18053>:
      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.18055>; else goto <D.18056>;
      <D.18055>:
      return;
      <D.18056>:
      load_value.9 = load_value;
      D.18057 = load_value.9->object.vtable;
      klass = D.18057->klass;
      method = mono_class_get_method_from_name (klass, "BeginInvoke", -1);
      D.18058 = method == 0B;
      D.18059 = (long int) D.18058;
      D.18060 = __builtin_expect (D.18059, 0);
      if (D.18060 != 0) goto <D.18061>; else goto <D.18062>;
      <D.18061>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "console-unix.c", 258, "method != NULL");
      <D.18062>:
      D.18063 = method->klass;
      im = mono_get_delegate_invoke (D.18063);
      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)
{
  _Bool D.18073;
  _Bool D.18074;
  _Bool D.18075;
  int D.18078;
  int cols_and_lines.10;
  struct MonoClass * D.18082;
  struct MonoDomain * D.18083;
  struct MonoArray * D.18084;
  int D.18085;
  MonoBoolean D.18088;
  unsigned int D.18089;
  unsigned int D.18090;
  unsigned int D.18091;
  unsigned int D.18092;
  int D.18093;
  struct MonoArray * D.18096;
  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.18067>; else goto <D.18068>;
  <D.18067>:
  {
    int cols;
    int rows;
    const char * str;

    cols = 0;
    rows = 0;
    str = monoeg_g_getenv ("COLUMNS");
    if (str != 0B) goto <D.18069>; else goto <D.18070>;
    <D.18069>:
    cols = atoi (str);
    <D.18070>:
    str = monoeg_g_getenv ("LINES");
    if (str != 0B) goto <D.18071>; else goto <D.18072>;
    <D.18071>:
    rows = atoi (str);
    <D.18072>:
    D.18073 = cols != 0;
    D.18074 = rows != 0;
    D.18075 = D.18073 & D.18074;
    if (D.18075 != 0) goto <D.18076>; else goto <D.18077>;
    <D.18076>:
    D.18078 = cols << 16;
    cols_and_lines.10 = D.18078 | rows;
    cols_and_lines = cols_and_lines.10;
    goto <D.18080>;
    <D.18077>:
    cols_and_lines = -1;
    <D.18080>:
  }
  goto <D.18081>;
  <D.18068>:
  cols_and_lines = dims;
  <D.18081>:
  *size = &cols_and_lines;
  D.18082 = mono_defaults.byte_class;
  D.18083 = mono_domain_get ();
  D.18084 = mono_array_new (D.18083, D.18082, 17);
  mono_gc_wbarrier_generic_store (control_chars, D.18084);
  D.18085 = tcgetattr (0, &initial_attr);
  if (D.18085 == -1) goto <D.18086>; else goto <D.18087>;
  <D.18086>:
  D.18088 = 0;
  return D.18088;
  <D.18087>:
  mono_attr = initial_attr;
  D.18089 = mono_attr.c_lflag;
  D.18090 = D.18089 & 4294967293;
  mono_attr.c_lflag = D.18090;
  D.18091 = mono_attr.c_iflag;
  D.18092 = D.18091 & 4294962175;
  mono_attr.c_iflag = D.18092;
  mono_attr.c_cc[6] = 1;
  mono_attr.c_cc[5] = 0;
  D.18093 = tcsetattr (0, 0, &mono_attr);
  if (D.18093 == -1) goto <D.18094>; else goto <D.18095>;
  <D.18094>:
  D.18088 = 0;
  return D.18088;
  <D.18095>:
  D.18096 = *control_chars;
  set_control_chars (D.18096, &mono_attr.c_cc);
  setup_finished.11 = setup_finished;
  if (setup_finished.11 != 0) goto <D.18098>; else goto <D.18099>;
  <D.18098>:
  D.18088 = 1;
  return D.18088;
  <D.18099>:
  if (keypad != 0B) goto <D.18101>; else goto <D.18102>;
  <D.18101>:
  iftmp.12 = mono_string_to_utf8 (keypad);
  goto <D.18103>;
  <D.18102>:
  iftmp.12 = 0B;
  <D.18103>:
  keypad_xmit_str = iftmp.12;
  console_set_signal_handlers ();
  setup_finished = 1;
  atexit_called.13 = atexit_called;
  if (atexit_called.13 == 0) goto <D.18105>; else goto <D.18106>;
  <D.18105>:
  if (teardown != 0B) goto <D.18107>; else goto <D.18108>;
  <D.18107>:
  teardown_str.14 = mono_string_to_utf8 (teardown);
  teardown_str = teardown_str.14;
  <D.18108>:
  atexit (tty_teardown);
  <D.18106>:
  D.18088 = 1;
  return D.18088;
}


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

  setup_finished.15 = setup_finished;
  if (setup_finished.15 == 0) goto <D.18112>; else goto <D.18113>;
  <D.18112>:
  return;
  <D.18113>:
  teardown_str.16 = teardown_str;
  if (teardown_str.16 != 0B) goto <D.18115>; else goto <D.18116>;
  <D.18115>:
  teardown_str.16 = teardown_str;
  D.18117 = strlen (teardown_str.16);
  teardown_str.16 = teardown_str;
  unused = write (1, teardown_str.16, D.18117);
  teardown_str.16 = teardown_str;
  monoeg_g_free (teardown_str.16);
  teardown_str = 0B;
  <D.18116>:
  tcflush (0, 0);
  tcsetattr (0, 0, &initial_attr);
  set_property (8, 1);
  setup_finished = 0;
}


terminal_get_dimensions ()
{
  int * D.18119;
  int D.18120;
  short unsigned int D.18123;
  int D.18124;
  int D.18125;
  short unsigned int D.18126;
  int D.18127;
  int D.18128;
  struct winsize ws;
  int ret;
  int save_errno;

  try
    {
      D.18119 = __errno_location ();
      save_errno = *D.18119;
      D.18120 = ioctl (0, 21523, &ws);
      if (D.18120 == 0) goto <D.18121>; else goto <D.18122>;
      <D.18121>:
      D.18123 = ws.ws_col;
      D.18124 = (int) D.18123;
      D.18125 = D.18124 << 16;
      D.18126 = ws.ws_row;
      D.18127 = (int) D.18126;
      ret = D.18125 | D.18127;
      D.18119 = __errno_location ();
      *D.18119 = save_errno;
      D.18128 = ret;
      return D.18128;
      <D.18122>:
      D.18128 = -1;
      return D.18128;
    }
  finally
    {
      ws = {CLOBBER};
    }
}


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

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


set_control_chars (struct MonoArray * control_chars, const guchar * cc)
{
  unsigned char D.18133;
  char D.18134;
  const guchar * D.18135;
  unsigned char D.18136;
  char D.18137;
  const guchar * D.18138;
  unsigned char D.18139;
  char D.18140;
  const guchar * D.18141;
  unsigned char D.18142;
  char D.18143;
  const guchar * D.18144;
  unsigned char D.18145;
  char D.18146;
  const guchar * D.18147;
  unsigned char D.18148;
  char D.18149;
  const guchar * D.18150;
  unsigned char D.18151;
  char D.18152;
  const guchar * D.18153;
  unsigned char D.18154;
  char D.18155;
  const guchar * D.18156;
  unsigned char D.18157;
  char D.18158;
  const guchar * D.18159;
  unsigned char D.18160;
  char D.18161;
  const guchar * D.18162;
  unsigned char D.18163;
  char D.18164;
  const guchar * D.18165;
  unsigned char D.18166;
  char D.18167;
  const guchar * D.18168;
  unsigned char D.18169;
  char D.18170;
  const guchar * D.18171;
  unsigned char D.18172;
  char D.18173;
  const guchar * D.18174;
  unsigned char D.18175;
  char D.18176;
  const guchar * D.18177;
  unsigned char D.18178;
  char D.18179;
  const guchar * D.18180;
  unsigned char D.18181;
  char D.18182;

  {
    gchar * __p;

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

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

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

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

    __p = mono_array_addr_with_size (control_chars, 1, 4);
    D.18144 = cc + 4;
    D.18145 = *D.18144;
    D.18146 = (char) D.18145;
    *__p = D.18146;
  }
  {
    gchar * __p;

    __p = mono_array_addr_with_size (control_chars, 1, 5);
    D.18147 = cc + 5;
    D.18148 = *D.18147;
    D.18149 = (char) D.18148;
    *__p = D.18149;
  }
  {
    gchar * __p;

    __p = mono_array_addr_with_size (control_chars, 1, 6);
    D.18150 = cc + 6;
    D.18151 = *D.18150;
    D.18152 = (char) D.18151;
    *__p = D.18152;
  }
  {
    gchar * __p;

    __p = mono_array_addr_with_size (control_chars, 1, 7);
    D.18153 = cc + 7;
    D.18154 = *D.18153;
    D.18155 = (char) D.18154;
    *__p = D.18155;
  }
  {
    gchar * __p;

    __p = mono_array_addr_with_size (control_chars, 1, 8);
    D.18156 = cc + 8;
    D.18157 = *D.18156;
    D.18158 = (char) D.18157;
    *__p = D.18158;
  }
  {
    gchar * __p;

    __p = mono_array_addr_with_size (control_chars, 1, 9);
    D.18159 = cc + 9;
    D.18160 = *D.18159;
    D.18161 = (char) D.18160;
    *__p = D.18161;
  }
  {
    gchar * __p;

    __p = mono_array_addr_with_size (control_chars, 1, 10);
    D.18162 = cc + 10;
    D.18163 = *D.18162;
    D.18164 = (char) D.18163;
    *__p = D.18164;
  }
  {
    gchar * __p;

    __p = mono_array_addr_with_size (control_chars, 1, 11);
    D.18165 = cc + 11;
    D.18166 = *D.18165;
    D.18167 = (char) D.18166;
    *__p = D.18167;
  }
  {
    gchar * __p;

    __p = mono_array_addr_with_size (control_chars, 1, 12);
    D.18168 = cc + 12;
    D.18169 = *D.18168;
    D.18170 = (char) D.18169;
    *__p = D.18170;
  }
  {
    gchar * __p;

    __p = mono_array_addr_with_size (control_chars, 1, 13);
    D.18171 = cc + 13;
    D.18172 = *D.18171;
    D.18173 = (char) D.18172;
    *__p = D.18173;
  }
  {
    gchar * __p;

    __p = mono_array_addr_with_size (control_chars, 1, 14);
    D.18174 = cc + 14;
    D.18175 = *D.18174;
    D.18176 = (char) D.18175;
    *__p = D.18176;
  }
  {
    gchar * __p;

    __p = mono_array_addr_with_size (control_chars, 1, 15);
    D.18177 = cc + 15;
    D.18178 = *D.18177;
    D.18179 = (char) D.18178;
    *__p = D.18179;
  }
  {
    gchar * __p;

    __p = mono_array_addr_with_size (control_chars, 1, 16);
    D.18180 = cc + 16;
    D.18181 = *D.18180;
    D.18182 = (char) D.18181;
    *__p = D.18182;
  }
}


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

  try
    {
      memset (&sigcont, 0, 140);
      memset (&sigint, 0, 140);
      memset (&sigwinch, 0, 140);
      sigcont.__sigaction_handler.sa_handler = sigcont_handler;
      sigcont.sa_flags = 0;
      sigemptyset (&sigcont.sa_mask);
      sigaction (18, &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 (28, &sigwinch, &save_sigwinch);
    }
  finally
    {
      sigcont = {CLOBBER};
      sigint = {CLOBBER};
      sigwinch = {CLOBBER};
    }
}


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

  dims = terminal_get_dimensions ();
  if (dims != -1) goto <D.18183>; else goto <D.18184>;
  <D.18183>:
  cols_and_lines = dims;
  <D.18184>:
  D.18185 = save_sigwinch.__sigaction_handler.sa_sigaction;
  if (D.18185 > 1B) goto <D.18186>; else goto <D.18187>;
  <D.18186>:
  D.18185 = save_sigwinch.__sigaction_handler.sa_sigaction;
  D.18185 (signo, the_siginfo, data);
  <D.18187>:
}


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

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


sigcont_handler (int signo, void * the_siginfo, void * data)
{
  gchar * keypad_xmit_str.18;
  unsigned int D.18196;
  void (*<Tef1>) (int, struct siginfo_t *, void *) D.18197;
  int unused;

  tcsetattr (0, 0, &mono_attr);
  keypad_xmit_str.18 = keypad_xmit_str;
  if (keypad_xmit_str.18 != 0B) goto <D.18194>; else goto <D.18195>;
  <D.18194>:
  keypad_xmit_str.18 = keypad_xmit_str;
  D.18196 = strlen (keypad_xmit_str.18);
  keypad_xmit_str.18 = keypad_xmit_str;
  unused = write (1, keypad_xmit_str.18, D.18196);
  <D.18195>:
  D.18197 = save_sigcont.__sigaction_handler.sa_sigaction;
  if (D.18197 > 1B) goto <D.18198>; else goto <D.18199>;
  <D.18198>:
  D.18197 = save_sigcont.__sigaction_handler.sa_sigaction;
  D.18197 (signo, the_siginfo, data);
  <D.18199>:
}


memset (void * __dest, int __ch, size_t __len)
{
  int D.18202;
  int D.18207;
  void * D.18209;
  unsigned int D.18210;

  D.18202 = __builtin_constant_p (__len);
  if (D.18202 != 0) goto <D.18203>; else goto <D.18204>;
  <D.18203>:
  if (__len == 0) goto <D.18205>; else goto <D.18206>;
  <D.18205>:
  D.18207 = __builtin_constant_p (__ch);
  if (D.18207 == 0) goto <D.18200>; else goto <D.18208>;
  <D.18208>:
  if (__ch != 0) goto <D.18200>; else goto <D.18201>;
  <D.18200>:
  __warn_memset_zero_len ();
  D.18209 = __dest;
  return D.18209;
  <D.18201>:
  <D.18206>:
  <D.18204>:
  D.18210 = __builtin_object_size (__dest, 0);
  D.18209 = __builtin___memset_chk (__dest, __ch, __len, D.18210);
  return D.18209;
}


