__attribute__((visibility ("hidden")))
mono_networkinterface_list (int * size)
{
  void * * D.5151;
  char * D.5152;
  char * D.5154;
  char * ptr.0;
  int D.5158;
  long unsigned int D.5165;
  long unsigned int D.5166;
  int i.1;
  long unsigned int D.5168;
  long unsigned int D.5169;
  void * * D.5170;
  gchar * D.5171;
  char * D.5172;
  long unsigned int D.5179;
  long unsigned int D.5180;
  void * * D.5181;
  int i;
  int count;
  void * * nilist;
  char buf[512];
  struct FILE * f;
  char name[256];
  void out = <<< error >>>;

  try
    {
      i = 0;
      count = 0;
      nilist = 0B;
      f = fopen ("/proc/net/dev", "r");
      if (f == 0B) goto <D.5149>; else goto <D.5150>;
      <D.5149>:
      D.5151 = 0B;
      return D.5151;
      <D.5150>:
      D.5152 = fgets (&buf, 512, f);
      if (D.5152 == 0B) goto out; else goto <D.5153>;
      <D.5153>:
      D.5154 = fgets (&buf, 512, f);
      if (D.5154 == 0B) goto out; else goto <D.5155>;
      <D.5155>:
      goto <D.5115>;
      <D.5114>:
      {
        char * ptr;

        buf[511] = 0;
        ptr = __builtin_strchr (&buf, 58);
        if (ptr == 0B) goto out; else goto <D.5156>;
        <D.5156>:
        ptr.0 = ptr;
        ptr = ptr.0 + 1;
        *ptr.0 = 0;
        D.5158 = sscanf (&buf, "%s", &name);
        if (D.5158 != 1) goto out; else goto <D.5159>;
        <D.5159>:
        if (i >= count) goto <D.5160>; else goto <D.5161>;
        <D.5160>:
        if (count == 0) goto <D.5162>; else goto <D.5163>;
        <D.5162>:
        count = 16;
        goto <D.5164>;
        <D.5163>:
        count = count * 2;
        <D.5164>:
        <D.5161>:
        D.5165 = (long unsigned int) count;
        D.5166 = D.5165 * 8;
        nilist = monoeg_realloc (nilist, D.5166);
        i.1 = i;
        i = i.1 + 1;
        D.5168 = (long unsigned int) i.1;
        D.5169 = D.5168 * 8;
        D.5170 = nilist + D.5169;
        D.5171 = monoeg_strdup (&name);
        *D.5170 = D.5171;
      }
      <D.5115>:
      D.5172 = fgets (&buf, 512, f);
      if (D.5172 != 0B) goto <D.5114>; else goto <D.5116>;
      <D.5116>:
      out:
      if (f != 0B) goto <D.5173>; else goto <D.5174>;
      <D.5173>:
      fclose (f);
      <D.5174>:
      if (size != 0B) goto <D.5175>; else goto <D.5176>;
      <D.5175>:
      *size = i;
      <D.5176>:
      if (nilist == 0B) goto <D.5177>; else goto <D.5178>;
      <D.5177>:
      nilist = monoeg_malloc (8);
      <D.5178>:
      D.5179 = (long unsigned int) i;
      D.5180 = D.5179 * 8;
      D.5181 = nilist + D.5180;
      *D.5181 = 0B;
      D.5151 = nilist;
      return D.5151;
    }
  finally
    {
      buf = {CLOBBER};
      name = {CLOBBER};
    }
}


monoeg_strdup (const gchar * str)
{
  gchar * D.5186;

  if (str != 0B) goto <D.5184>; else goto <D.5185>;
  <D.5184>:
  D.5186 = __strdup (str);
  return D.5186;
  <D.5185>:
  D.5186 = 0B;
  return D.5186;
}


__attribute__((__artificial__, __gnu_inline__, __always_inline__))
fgets (char * restrict __s, int __n, struct FILE * restrict __stream)
{
  long unsigned int D.5188;
  int D.5193;
  char * D.5195;
  long unsigned int D.5196;
  long unsigned int D.5197;
  long unsigned int D.5198;
  long unsigned int D.5201;

  D.5188 = __builtin_object_size (__s, 1);
  if (D.5188 != 18446744073709551615) goto <D.5189>; else goto <D.5190>;
  <D.5189>:
  D.5193 = __builtin_constant_p (__n);
  if (D.5193 == 0) goto <D.5191>; else goto <D.5194>;
  <D.5194>:
  if (__n <= 0) goto <D.5191>; else goto <D.5192>;
  <D.5191>:
  D.5196 = __builtin_object_size (__s, 1);
  D.5195 = __fgets_chk (__s, D.5196, __n, __stream);
  return D.5195;
  <D.5192>:
  D.5197 = (long unsigned int) __n;
  D.5198 = __builtin_object_size (__s, 1);
  if (D.5197 > D.5198) goto <D.5199>; else goto <D.5200>;
  <D.5199>:
  D.5201 = __builtin_object_size (__s, 1);
  D.5195 = __fgets_chk_warn (__s, D.5201, __n, __stream);
  return D.5195;
  <D.5200>:
  <D.5190>:
  D.5195 = __fgets_alias (__s, __n, __stream);
  return D.5195;
}


__attribute__((visibility ("hidden")))
mono_network_get_data (char * name, MonoNetworkData data, MonoNetworkError * error)
{
  gint64 D.5205;
  char * D.5206;
  char * D.5208;
  char * ptr.2;
  int D.5212;
  int D.5214;
  int D.5217;
  long unsigned int tx_bytes.3;
  long unsigned int rx_bytes.4;
  long unsigned int D.5221;
  char * D.5223;
  gint64 val;
  char buf[512];
  char cname[256];
  struct FILE * f;
  long unsigned int rx_bytes;
  long unsigned int rx_packets;
  long unsigned int rx_errs;
  long unsigned int rx_drops;
  long unsigned int rx_fifo;
  long unsigned int rx_frame;
  long unsigned int tx_bytes;
  long unsigned int tx_packets;
  long unsigned int tx_errs;
  long unsigned int tx_drops;
  long unsigned int tx_fifo;
  long unsigned int tx_colls;
  long unsigned int tx_carrier;
  long unsigned int rx_multi;
  void out = <<< error >>>;

  try
    {
      val = 0;
      *error = 2;
      f = fopen ("/proc/net/dev", "r");
      if (f == 0B) goto <D.5203>; else goto <D.5204>;
      <D.5203>:
      D.5205 = -1;
      return D.5205;
      <D.5204>:
      D.5206 = fgets (&buf, 512, f);
      if (D.5206 == 0B) goto out; else goto <D.5207>;
      <D.5207>:
      D.5208 = fgets (&buf, 512, f);
      if (D.5208 == 0B) goto out; else goto <D.5209>;
      <D.5209>:
      goto <D.5142>;
      <D.5146>:
      {
        char * ptr;

        buf[511] = 0;
        ptr = __builtin_strchr (&buf, 58);
        if (ptr == 0B) goto out; else goto <D.5210>;
        <D.5210>:
        ptr.2 = ptr;
        ptr = ptr.2 + 1;
        *ptr.2 = 0;
        D.5212 = sscanf (&buf, "%s", &cname);
        if (D.5212 != 1) goto out; else goto <D.5213>;
        <D.5213>:
        D.5214 = strcmp (name, &cname);
        if (D.5214 != 0) goto <D.5215>; else goto <D.5216>;
        <D.5215>:
        // predicted unlikely by continue predictor.
        goto <D.5142>;
        <D.5216>:
        D.5217 = sscanf (ptr, "%ld%ld%ld%ld%ld%ld%ld%*d%ld%ld%ld%ld%ld%ld%ld", &rx_bytes, &rx_packets, &rx_errs, &rx_drops, &rx_fifo, &rx_frame, &rx_multi, &tx_bytes, &tx_packets, &tx_errs, &tx_drops, &tx_fifo, &tx_colls, &tx_carrier);
        if (D.5217 != 14) goto out; else goto <D.5218>;
        <D.5218>:
        switch (data) <default: <D.5222>, case 0: <D.5144>, case 1: <D.5143>, case 2: <D.5145>>
        <D.5143>:
        tx_bytes.3 = tx_bytes;
        val = (gint64) tx_bytes.3;
        *error = 0;
        goto out;
        <D.5144>:
        rx_bytes.4 = rx_bytes;
        val = (gint64) rx_bytes.4;
        *error = 0;
        goto out;
        <D.5145>:
        rx_bytes.4 = rx_bytes;
        tx_bytes.3 = tx_bytes;
        D.5221 = rx_bytes.4 + tx_bytes.3;
        val = (gint64) D.5221;
        *error = 0;
        goto out;
        <D.5222>:
      }
      <D.5142>:
      D.5223 = fgets (&buf, 512, f);
      if (D.5223 != 0B) goto <D.5146>; else goto <D.5147>;
      <D.5147>:
      out:
      if (f != 0B) goto <D.5224>; else goto <D.5225>;
      <D.5224>:
      fclose (f);
      <D.5225>:
      D.5205 = val;
      return D.5205;
    }
  finally
    {
      buf = {CLOBBER};
      cname = {CLOBBER};
      rx_bytes = {CLOBBER};
      rx_packets = {CLOBBER};
      rx_errs = {CLOBBER};
      rx_drops = {CLOBBER};
      rx_fifo = {CLOBBER};
      rx_frame = {CLOBBER};
      tx_bytes = {CLOBBER};
      tx_packets = {CLOBBER};
      tx_errs = {CLOBBER};
      tx_drops = {CLOBBER};
      tx_fifo = {CLOBBER};
      tx_colls = {CLOBBER};
      tx_carrier = {CLOBBER};
      rx_multi = {CLOBBER};
    }
}


__attribute__((__gnu_inline__, nothrow, leaf, pure))
strcmp (const char * __s1, const char * __s2)
{
  int iftmp.5;
  int iftmp.6;
  int D.5236;
  char * __p1;
  char * __p2;
  int __ret;

  __p1 = __s1;
  __p2 = __s2;
  __asm__ __volatile__("   slr   0,0
0: clst  %1,%2
   jo    0b
   ipm   %0
   srl   %0,28" : "=d" __ret, "=&a" __p1, "=&a" __p2 : "1" __p1, "2" __p2 : "0", "memory", "cc");
  if (__ret != 0) goto <D.5229>; else goto <D.5230>;
  <D.5229>:
  if (__ret == 1) goto <D.5232>; else goto <D.5233>;
  <D.5232>:
  iftmp.6 = -1;
  goto <D.5234>;
  <D.5233>:
  iftmp.6 = 1;
  <D.5234>:
  iftmp.5 = iftmp.6;
  goto <D.5235>;
  <D.5230>:
  iftmp.5 = 0;
  <D.5235>:
  __ret = iftmp.5;
  D.5236 = __ret;
  return D.5236;
}


