mono_hwcap_arch_init ()
{
  int D.5515;
  int edx.0;
  int D.5519;
  int D.5522;
  int D.5525;
  int D.5528;
  int ecx.1;
  int D.5532;
  int D.5535;
  int D.5538;
  int D.5541;
  int D.5544;
  int eax.2;
  unsigned int eax.3;
  int ebx.4;
  int D.5558;
  int D.5561;
  int D.5564;
  _Bool D.5565;
  int mono_hwcap_x86_is_xen.5;
  int eax;
  int ebx;
  int ecx;
  int edx;

  try
    {
      D.5515 = cpuid (1, &eax, &ebx, &ecx, &edx);
      if (D.5515 != 0) goto <D.5516>; else goto <D.5517>;
      <D.5516>:
      edx.0 = edx;
      D.5519 = edx.0 & 32768;
      if (D.5519 != 0) goto <D.5520>; else goto <D.5521>;
      <D.5520>:
      mono_hwcap_x86_has_cmov = 1;
      edx.0 = edx;
      D.5522 = edx.0 & 1;
      if (D.5522 != 0) goto <D.5523>; else goto <D.5524>;
      <D.5523>:
      mono_hwcap_x86_has_fcmov = 1;
      <D.5524>:
      <D.5521>:
      edx.0 = edx;
      D.5525 = edx.0 & 33554432;
      if (D.5525 != 0) goto <D.5526>; else goto <D.5527>;
      <D.5526>:
      mono_hwcap_x86_has_sse1 = 1;
      <D.5527>:
      edx.0 = edx;
      D.5528 = edx.0 & 67108864;
      if (D.5528 != 0) goto <D.5529>; else goto <D.5530>;
      <D.5529>:
      mono_hwcap_x86_has_sse2 = 1;
      <D.5530>:
      ecx.1 = ecx;
      D.5532 = ecx.1 & 1;
      if (D.5532 != 0) goto <D.5533>; else goto <D.5534>;
      <D.5533>:
      mono_hwcap_x86_has_sse3 = 1;
      <D.5534>:
      ecx.1 = ecx;
      D.5535 = ecx.1 & 512;
      if (D.5535 != 0) goto <D.5536>; else goto <D.5537>;
      <D.5536>:
      mono_hwcap_x86_has_ssse3 = 1;
      <D.5537>:
      ecx.1 = ecx;
      D.5538 = ecx.1 & 524288;
      if (D.5538 != 0) goto <D.5539>; else goto <D.5540>;
      <D.5539>:
      mono_hwcap_x86_has_sse41 = 1;
      <D.5540>:
      ecx.1 = ecx;
      D.5541 = ecx.1 & 1048576;
      if (D.5541 != 0) goto <D.5542>; else goto <D.5543>;
      <D.5542>:
      mono_hwcap_x86_has_sse42 = 1;
      <D.5543>:
      <D.5517>:
      D.5544 = cpuid (-2147483648, &eax, &ebx, &ecx, &edx);
      if (D.5544 != 0) goto <D.5545>; else goto <D.5546>;
      <D.5545>:
      eax.2 = eax;
      eax.3 = (unsigned int) eax.2;
      if (eax.3 > 2147483648) goto <D.5549>; else goto <D.5550>;
      <D.5549>:
      ebx.4 = ebx;
      if (ebx.4 == 1752462657) goto <D.5552>; else goto <D.5553>;
      <D.5552>:
      ecx.1 = ecx;
      if (ecx.1 == 1145913699) goto <D.5554>; else goto <D.5555>;
      <D.5554>:
      edx.0 = edx;
      if (edx.0 == 1769238117) goto <D.5556>; else goto <D.5557>;
      <D.5556>:
      D.5558 = cpuid (-2147483647, &eax, &ebx, &ecx, &edx);
      if (D.5558 != 0) goto <D.5559>; else goto <D.5560>;
      <D.5559>:
      ecx.1 = ecx;
      D.5561 = ecx.1 & 64;
      if (D.5561 != 0) goto <D.5562>; else goto <D.5563>;
      <D.5562>:
      mono_hwcap_x86_has_sse4a = 1;
      <D.5563>:
      <D.5560>:
      <D.5557>:
      <D.5555>:
      <D.5553>:
      <D.5550>:
      <D.5546>:
      D.5564 = access ("/proc/xen", 0);
      D.5565 = D.5564 == 0;
      mono_hwcap_x86_is_xen.5 = (int) D.5565;
      mono_hwcap_x86_is_xen = mono_hwcap_x86_is_xen.5;
    }
  finally
    {
      eax = {CLOBBER};
      ebx = {CLOBBER};
      ecx = {CLOBBER};
      edx = {CLOBBER};
    }
}


cpuid (int id, int * p_eax, int * p_ebx, int * p_ecx, int * p_edx)
{
  gboolean D.5569;
  gboolean have_cpuid;

  have_cpuid = 0;
  __asm__ __volatile__("pushfl
	popl	%%eax
	movl	%%eax, %%edx
	xorl	$0x200000, %%eax
	pushl	%%eax
	popfl
	pushfl
	popl	%%eax
	xorl	%%edx, %%eax
	andl	$0x200000, %%eax
	movl	%%eax, %0
	" : "=r" have_cpuid :  : "%edx", "%eax");
  if (have_cpuid == 0) goto <D.5567>; else goto <D.5568>;
  <D.5567>:
  D.5569 = 0;
  return D.5569;
  <D.5568>:
  __asm__ __volatile__("xchgl	%%ebx, %k1
	cpuid
	xchgl	%%ebx, %k1
	" : "=a" *p_eax, "=&r" *p_ebx, "=c" *p_ecx, "=d" *p_edx : "0" id);
  D.5569 = 1;
  return D.5569;
}


mono_hwcap_print (struct FILE * f)
{
  int mono_hwcap_x86_is_xen.6;
  int mono_hwcap_x86_has_cmov.7;
  int mono_hwcap_x86_has_fcmov.8;
  int mono_hwcap_x86_has_sse1.9;
  int mono_hwcap_x86_has_sse2.10;
  int mono_hwcap_x86_has_sse3.11;
  int mono_hwcap_x86_has_ssse3.12;
  int mono_hwcap_x86_has_sse41.13;
  int mono_hwcap_x86_has_sse42.14;
  int mono_hwcap_x86_has_sse4a.15;

  mono_hwcap_x86_is_xen.6 = mono_hwcap_x86_is_xen;
  monoeg_g_fprintf (f, "mono_hwcap_x86_is_xen = %i\n", mono_hwcap_x86_is_xen.6);
  mono_hwcap_x86_has_cmov.7 = mono_hwcap_x86_has_cmov;
  monoeg_g_fprintf (f, "mono_hwcap_x86_has_cmov = %i\n", mono_hwcap_x86_has_cmov.7);
  mono_hwcap_x86_has_fcmov.8 = mono_hwcap_x86_has_fcmov;
  monoeg_g_fprintf (f, "mono_hwcap_x86_has_fcmov = %i\n", mono_hwcap_x86_has_fcmov.8);
  mono_hwcap_x86_has_sse1.9 = mono_hwcap_x86_has_sse1;
  monoeg_g_fprintf (f, "mono_hwcap_x86_has_sse1 = %i\n", mono_hwcap_x86_has_sse1.9);
  mono_hwcap_x86_has_sse2.10 = mono_hwcap_x86_has_sse2;
  monoeg_g_fprintf (f, "mono_hwcap_x86_has_sse2 = %i\n", mono_hwcap_x86_has_sse2.10);
  mono_hwcap_x86_has_sse3.11 = mono_hwcap_x86_has_sse3;
  monoeg_g_fprintf (f, "mono_hwcap_x86_has_sse3 = %i\n", mono_hwcap_x86_has_sse3.11);
  mono_hwcap_x86_has_ssse3.12 = mono_hwcap_x86_has_ssse3;
  monoeg_g_fprintf (f, "mono_hwcap_x86_has_ssse3 = %i\n", mono_hwcap_x86_has_ssse3.12);
  mono_hwcap_x86_has_sse41.13 = mono_hwcap_x86_has_sse41;
  monoeg_g_fprintf (f, "mono_hwcap_x86_has_sse41 = %i\n", mono_hwcap_x86_has_sse41.13);
  mono_hwcap_x86_has_sse42.14 = mono_hwcap_x86_has_sse42;
  monoeg_g_fprintf (f, "mono_hwcap_x86_has_sse42 = %i\n", mono_hwcap_x86_has_sse42.14);
  mono_hwcap_x86_has_sse4a.15 = mono_hwcap_x86_has_sse4a;
  monoeg_g_fprintf (f, "mono_hwcap_x86_has_sse4a = %i\n", mono_hwcap_x86_has_sse4a.15);
}


