# 1 "m_main.c"
# 1 "/root/mountpoint-genprog/genprog-many-bugs/valgrind-bug-12854-12855/valgrind/coregrind//"
# 1 "<built-in>"
# 1 "<command-line>"
# 1 "m_main.c"
# 31 "m_main.c"
# 1 "pub_core_basics.h" 1
# 40 "pub_core_basics.h"
# 1 "../include/pub_tool_basics.h" 1
# 47 "../include/pub_tool_basics.h"
# 1 "../VEX/pub/libvex_basictypes.h" 1
# 44 "../VEX/pub/libvex_basictypes.h"
typedef unsigned char UChar;
typedef signed char Char;
typedef char HChar;




typedef unsigned short UShort;
typedef signed short Short;


typedef unsigned int UInt;
typedef signed int Int;


typedef unsigned long long int ULong;
typedef signed long long int Long;


typedef UInt U128[4];


typedef UInt U256[8];


typedef
   union {
      UChar w8[16];
      UShort w16[8];
      UInt w32[4];
      ULong w64[2];
   }
   V128;


typedef float Float;
typedef double Double;


typedef unsigned char Bool;






static inline Bool toBool ( Int x ) {
   Int r = (x == 0) ? ((Bool)0) : ((Bool)1);
   return (Bool)r;
}
static inline UChar toUChar ( Int x ) {
   x &= 0xFF;
   return (UChar)x;
}
static inline HChar toHChar ( Int x ) {
   x &= 0xFF;
   return (HChar)x;
}
static inline UShort toUShort ( Int x ) {
   x &= 0xFFFF;
   return (UShort)x;
}
static inline Short toShort ( Int x ) {
   x &= 0xFFFF;
   return (Short)x;
}
static inline UInt toUInt ( Long x ) {
   x &= 0xFFFFFFFFLL;
   return (UInt)x;
}


typedef UInt Addr32;
typedef ULong Addr64;





typedef unsigned long HWord;
# 194 "../VEX/pub/libvex_basictypes.h"
   static inline ULong Ptr_to_ULong ( void* p ) {
      UInt w = (UInt)p;
      return (ULong)w;
   }
   static inline void* ULong_to_Ptr ( ULong n ) {
      UInt w = (UInt)n;
      return (void*)w;
   }
# 48 "../include/pub_tool_basics.h" 2


# 1 "/usr/lib/gcc/i686-redhat-linux/4.4.5/include/stdarg.h" 1 3 4
# 40 "/usr/lib/gcc/i686-redhat-linux/4.4.5/include/stdarg.h" 3 4
typedef __builtin_va_list __gnuc_va_list;
# 102 "/usr/lib/gcc/i686-redhat-linux/4.4.5/include/stdarg.h" 3 4
typedef __gnuc_va_list va_list;
# 51 "../include/pub_tool_basics.h" 2
# 86 "../include/pub_tool_basics.h"
typedef unsigned long UWord;
typedef signed long Word;





typedef UWord Addr;
typedef UWord AddrH;




typedef UWord SizeT;
typedef Word SSizeT;





typedef Word PtrdiffT;
# 115 "../include/pub_tool_basics.h"
typedef Word OffT;





typedef Long Off64T;






typedef struct { UWord uw1; UWord uw2; } UWordPair;
# 139 "../include/pub_tool_basics.h"
typedef UInt ThreadId;
# 163 "../include/pub_tool_basics.h"
typedef
   struct {
      UWord _val;
      UWord _valEx;
      Bool _isError;
   }
   SysRes;
# 195 "../include/pub_tool_basics.h"
static inline Bool sr_isError ( SysRes sr ) {
   return sr._isError;
}
static inline UWord sr_Res ( SysRes sr ) {
   return sr._isError ? 0 : sr._val;
}
static inline UWord sr_ResEx ( SysRes sr ) {
   return sr._isError ? 0 : sr._valEx;
}
static inline UWord sr_ResHI ( SysRes sr ) {
   return 0;
}
static inline UWord sr_Err ( SysRes sr ) {
   return sr._isError ? sr._val : 0;
}
static inline Bool sr_EQ ( SysRes sr1, SysRes sr2 ) {
   return sr1._val == sr2._val
          && ((sr1._isError && sr2._isError)
              || (!sr1._isError && !sr2._isError));
}
# 41 "pub_core_basics.h" 2
# 49 "pub_core_basics.h"
# 1 "../VEX/pub/libvex.h" 1
# 40 "../VEX/pub/libvex.h"
# 1 "../VEX/pub/libvex_basictypes.h" 1
# 41 "../VEX/pub/libvex.h" 2
# 1 "../VEX/pub/libvex_ir.h" 1
# 219 "../VEX/pub/libvex_ir.h"
typedef
   enum {
      Ity_INVALID=0x11000,
      Ity_I1,
      Ity_I8,
      Ity_I16,
      Ity_I32,
      Ity_I64,
      Ity_I128,
      Ity_F32,
      Ity_F64,
      Ity_D32,
      Ity_D64,
      Ity_D128,
      Ity_F128,
      Ity_V128,
      Ity_V256
   }
   IRType;


extern void ppIRType ( IRType );


extern Int sizeofIRType ( IRType );





typedef
   enum {
      Iend_LE=0x12000,
      Iend_BE
   }
   IREndness;







typedef
   enum {
      Ico_U1=0x13000,
      Ico_U8,
      Ico_U16,
      Ico_U32,
      Ico_U64,
      Ico_F32,
      Ico_F32i,

      Ico_F64,
      Ico_F64i,

      Ico_V128,

      Ico_V256

   }
   IRConstTag;





typedef
   struct _IRConst {
      IRConstTag tag;
      union {
         Bool U1;
         UChar U8;
         UShort U16;
         UInt U32;
         ULong U64;
         Float F32;
         UInt F32i;
         Double F64;
         ULong F64i;
         UShort V128;
         UInt V256;
      } Ico;
   }
   IRConst;


extern IRConst* IRConst_U1 ( Bool );
extern IRConst* IRConst_U8 ( UChar );
extern IRConst* IRConst_U16 ( UShort );
extern IRConst* IRConst_U32 ( UInt );
extern IRConst* IRConst_U64 ( ULong );
extern IRConst* IRConst_F32 ( Float );
extern IRConst* IRConst_F32i ( UInt );
extern IRConst* IRConst_F64 ( Double );
extern IRConst* IRConst_F64i ( ULong );
extern IRConst* IRConst_V128 ( UShort );
extern IRConst* IRConst_V256 ( UInt );


extern IRConst* deepCopyIRConst ( IRConst* );


extern void ppIRConst ( IRConst* );


extern Bool eqIRConst ( IRConst*, IRConst* );
# 345 "../VEX/pub/libvex_ir.h"
typedef
   struct {
      Int regparms;
      HChar* name;
      void* addr;
      UInt mcx_mask;
   }
   IRCallee;


extern IRCallee* mkIRCallee ( Int regparms, HChar* name, void* addr );


extern IRCallee* deepCopyIRCallee ( IRCallee* );


extern void ppIRCallee ( IRCallee* );







typedef
   struct {
      Int base;
      IRType elemTy;
      Int nElems;
   }
   IRRegArray;

extern IRRegArray* mkIRRegArray ( Int, IRType, Int );

extern IRRegArray* deepCopyIRRegArray ( IRRegArray* );

extern void ppIRRegArray ( IRRegArray* );
extern Bool eqIRRegArray ( IRRegArray*, IRRegArray* );







typedef UInt IRTemp;


extern void ppIRTemp ( IRTemp );
# 410 "../VEX/pub/libvex_ir.h"
typedef
   enum {



      Iop_INVALID=0x14000,
      Iop_Add8, Iop_Add16, Iop_Add32, Iop_Add64,
      Iop_Sub8, Iop_Sub16, Iop_Sub32, Iop_Sub64,

      Iop_Mul8, Iop_Mul16, Iop_Mul32, Iop_Mul64,
      Iop_Or8, Iop_Or16, Iop_Or32, Iop_Or64,
      Iop_And8, Iop_And16, Iop_And32, Iop_And64,
      Iop_Xor8, Iop_Xor16, Iop_Xor32, Iop_Xor64,
      Iop_Shl8, Iop_Shl16, Iop_Shl32, Iop_Shl64,
      Iop_Shr8, Iop_Shr16, Iop_Shr32, Iop_Shr64,
      Iop_Sar8, Iop_Sar16, Iop_Sar32, Iop_Sar64,

      Iop_CmpEQ8, Iop_CmpEQ16, Iop_CmpEQ32, Iop_CmpEQ64,
      Iop_CmpNE8, Iop_CmpNE16, Iop_CmpNE32, Iop_CmpNE64,

      Iop_Not8, Iop_Not16, Iop_Not32, Iop_Not64,






      Iop_CasCmpEQ8, Iop_CasCmpEQ16, Iop_CasCmpEQ32, Iop_CasCmpEQ64,
      Iop_CasCmpNE8, Iop_CasCmpNE16, Iop_CasCmpNE32, Iop_CasCmpNE64,




      Iop_MullS8, Iop_MullS16, Iop_MullS32, Iop_MullS64,
      Iop_MullU8, Iop_MullU16, Iop_MullU32, Iop_MullU64,


      Iop_Clz64, Iop_Clz32,
      Iop_Ctz64, Iop_Ctz32,





      Iop_CmpLT32S, Iop_CmpLT64S,
      Iop_CmpLE32S, Iop_CmpLE64S,
      Iop_CmpLT32U, Iop_CmpLT64U,
      Iop_CmpLE32U, Iop_CmpLE64U,


      Iop_CmpNEZ8, Iop_CmpNEZ16, Iop_CmpNEZ32, Iop_CmpNEZ64,
      Iop_CmpwNEZ32, Iop_CmpwNEZ64,
      Iop_Left8, Iop_Left16, Iop_Left32, Iop_Left64,
      Iop_Max32U,







      Iop_CmpORD32U, Iop_CmpORD64U,
      Iop_CmpORD32S, Iop_CmpORD64S,



      Iop_DivU32,
      Iop_DivS32,
      Iop_DivU64,
      Iop_DivS64,
      Iop_DivU64E,
      Iop_DivS64E,
      Iop_DivU32E,
      Iop_DivS32E,

      Iop_DivModU64to32,

      Iop_DivModS64to32,

      Iop_DivModU128to64,

      Iop_DivModS128to64,

      Iop_DivModS64to64,
# 502 "../VEX/pub/libvex_ir.h"
      Iop_8Uto16, Iop_8Uto32, Iop_8Uto64,
                  Iop_16Uto32, Iop_16Uto64,
                               Iop_32Uto64,
      Iop_8Sto16, Iop_8Sto32, Iop_8Sto64,
                  Iop_16Sto32, Iop_16Sto64,
                               Iop_32Sto64,


      Iop_64to8, Iop_32to8, Iop_64to16,

      Iop_16to8,
      Iop_16HIto8,
      Iop_8HLto16,

      Iop_32to16,
      Iop_32HIto16,
      Iop_16HLto32,

      Iop_64to32,
      Iop_64HIto32,
      Iop_32HLto64,

      Iop_128to64,
      Iop_128HIto64,
      Iop_64HLto128,

      Iop_Not1,
      Iop_32to1,
      Iop_64to1,
      Iop_1Uto8,
      Iop_1Uto32,
      Iop_1Uto64,
      Iop_1Sto8,
      Iop_1Sto16,
      Iop_1Sto32,
      Iop_1Sto64,







      Iop_AddF64, Iop_SubF64, Iop_MulF64, Iop_DivF64,


      Iop_AddF32, Iop_SubF32, Iop_MulF32, Iop_DivF32,




      Iop_AddF64r32, Iop_SubF64r32, Iop_MulF64r32, Iop_DivF64r32,



      Iop_NegF64, Iop_AbsF64,


      Iop_NegF32, Iop_AbsF32,



      Iop_SqrtF64, Iop_SqrtF64r32,


      Iop_SqrtF32,
# 578 "../VEX/pub/libvex_ir.h"
      Iop_CmpF64,
      Iop_CmpF32,
      Iop_CmpF128,
# 623 "../VEX/pub/libvex_ir.h"
      Iop_F64toI16S,
      Iop_F64toI32S,
      Iop_F64toI64S,
      Iop_F64toI64U,

      Iop_F64toI32U,

      Iop_I16StoF64,
      Iop_I32StoF64,
      Iop_I64StoF64,
      Iop_I64UtoF64,
      Iop_I64UtoF32,

      Iop_I32UtoF64,

      Iop_F32toI16S,
      Iop_F32toI32S,
      Iop_F32toI64S,

      Iop_I16StoF32,
      Iop_I32StoF32,
      Iop_I64StoF32,


      Iop_F32toF64,
      Iop_F64toF32,



      Iop_ReinterpF64asI64, Iop_ReinterpI64asF64,
      Iop_ReinterpF32asI32, Iop_ReinterpI32asF32,


      Iop_F64HLtoF128,
      Iop_F128HItoF64,
      Iop_F128LOtoF64,


      Iop_AddF128, Iop_SubF128, Iop_MulF128, Iop_DivF128,


      Iop_NegF128, Iop_AbsF128,


      Iop_SqrtF128,

      Iop_I32StoF128,
      Iop_I64StoF128,
      Iop_F32toF128,
      Iop_F64toF128,

      Iop_F128toI32S,
      Iop_F128toI64S,
      Iop_F128toF64,
      Iop_F128toF32,





      Iop_AtanF64,
      Iop_Yl2xF64,
      Iop_Yl2xp1F64,
      Iop_PRemF64,
      Iop_PRemC3210F64,
      Iop_PRem1F64,
      Iop_PRem1C3210F64,
      Iop_ScaleF64,






      Iop_SinF64,
      Iop_CosF64,
      Iop_TanF64,
      Iop_2xm1F64,
      Iop_RoundF64toInt,

      Iop_RoundF32toInt,







      Iop_MAddF32, Iop_MSubF32,
# 721 "../VEX/pub/libvex_ir.h"
      Iop_MAddF64, Iop_MSubF64,




      Iop_MAddF64r32, Iop_MSubF64r32,


      Iop_Est5FRSqrt,
      Iop_RoundF64toF64_NEAREST,
      Iop_RoundF64toF64_NegINF,
      Iop_RoundF64toF64_PosINF,
      Iop_RoundF64toF64_ZERO,


      Iop_TruncF64asF32,


      Iop_RoundF64toF32,




      Iop_CalcFPRF,





      Iop_QAdd32S,
      Iop_QSub32S,


      Iop_Add16x2, Iop_Sub16x2,
      Iop_QAdd16Sx2, Iop_QAdd16Ux2,
      Iop_QSub16Sx2, Iop_QSub16Ux2,




      Iop_HAdd16Ux2, Iop_HAdd16Sx2,
      Iop_HSub16Ux2, Iop_HSub16Sx2,


      Iop_Add8x4, Iop_Sub8x4,
      Iop_QAdd8Sx4, Iop_QAdd8Ux4,
      Iop_QSub8Sx4, Iop_QSub8Ux4,




      Iop_HAdd8Ux4, Iop_HAdd8Sx4,
      Iop_HSub8Ux4, Iop_HSub8Sx4,


      Iop_Sad8Ux4,


      Iop_CmpNEZ16x2, Iop_CmpNEZ8x4,




      Iop_I32UtoFx2, Iop_I32StoFx2,
      Iop_FtoI32Ux2_RZ, Iop_FtoI32Sx2_RZ,



      Iop_F32ToFixed32Ux2_RZ, Iop_F32ToFixed32Sx2_RZ,
      Iop_Fixed32UToF32x2_RN, Iop_Fixed32SToF32x2_RN,


      Iop_Max32Fx2, Iop_Min32Fx2,


      Iop_PwMax32Fx2, Iop_PwMin32Fx2,


      Iop_CmpEQ32Fx2, Iop_CmpGT32Fx2, Iop_CmpGE32Fx2,




      Iop_Recip32Fx2,




      Iop_Recps32Fx2,



      Iop_Rsqrte32Fx2,




      Iop_Rsqrts32Fx2,


      Iop_Neg32Fx2, Iop_Abs32Fx2,




      Iop_CmpNEZ8x8, Iop_CmpNEZ16x4, Iop_CmpNEZ32x2,


      Iop_Add8x8, Iop_Add16x4, Iop_Add32x2,
      Iop_QAdd8Ux8, Iop_QAdd16Ux4, Iop_QAdd32Ux2, Iop_QAdd64Ux1,
      Iop_QAdd8Sx8, Iop_QAdd16Sx4, Iop_QAdd32Sx2, Iop_QAdd64Sx1,




      Iop_PwAdd8x8, Iop_PwAdd16x4, Iop_PwAdd32x2,
      Iop_PwMax8Sx8, Iop_PwMax16Sx4, Iop_PwMax32Sx2,
      Iop_PwMax8Ux8, Iop_PwMax16Ux4, Iop_PwMax32Ux2,
      Iop_PwMin8Sx8, Iop_PwMin16Sx4, Iop_PwMin32Sx2,
      Iop_PwMin8Ux8, Iop_PwMin16Ux4, Iop_PwMin32Ux2,





      Iop_PwAddL8Ux8, Iop_PwAddL16Ux4, Iop_PwAddL32Ux2,
      Iop_PwAddL8Sx8, Iop_PwAddL16Sx4, Iop_PwAddL32Sx2,


      Iop_Sub8x8, Iop_Sub16x4, Iop_Sub32x2,
      Iop_QSub8Ux8, Iop_QSub16Ux4, Iop_QSub32Ux2, Iop_QSub64Ux1,
      Iop_QSub8Sx8, Iop_QSub16Sx4, Iop_QSub32Sx2, Iop_QSub64Sx1,


      Iop_Abs8x8, Iop_Abs16x4, Iop_Abs32x2,


      Iop_Mul8x8, Iop_Mul16x4, Iop_Mul32x2,
      Iop_Mul32Fx2,
      Iop_MulHi16Ux4,
      Iop_MulHi16Sx4,


      Iop_PolynomialMul8x8,







      Iop_QDMulHi16Sx4, Iop_QDMulHi32Sx2,
      Iop_QRDMulHi16Sx4, Iop_QRDMulHi32Sx2,


      Iop_Avg8Ux8,
      Iop_Avg16Ux4,


      Iop_Max8Sx8, Iop_Max16Sx4, Iop_Max32Sx2,
      Iop_Max8Ux8, Iop_Max16Ux4, Iop_Max32Ux2,
      Iop_Min8Sx8, Iop_Min16Sx4, Iop_Min32Sx2,
      Iop_Min8Ux8, Iop_Min16Ux4, Iop_Min32Ux2,


      Iop_CmpEQ8x8, Iop_CmpEQ16x4, Iop_CmpEQ32x2,
      Iop_CmpGT8Ux8, Iop_CmpGT16Ux4, Iop_CmpGT32Ux2,
      Iop_CmpGT8Sx8, Iop_CmpGT16Sx4, Iop_CmpGT32Sx2,



      Iop_Cnt8x8,
      Iop_Clz8Sx8, Iop_Clz16Sx4, Iop_Clz32Sx2,
      Iop_Cls8Sx8, Iop_Cls16Sx4, Iop_Cls32Sx2,


      Iop_Shl8x8, Iop_Shl16x4, Iop_Shl32x2,
      Iop_Shr8x8, Iop_Shr16x4, Iop_Shr32x2,
      Iop_Sar8x8, Iop_Sar16x4, Iop_Sar32x2,
      Iop_Sal8x8, Iop_Sal16x4, Iop_Sal32x2, Iop_Sal64x1,


      Iop_ShlN8x8, Iop_ShlN16x4, Iop_ShlN32x2,
      Iop_ShrN8x8, Iop_ShrN16x4, Iop_ShrN32x2,
      Iop_SarN8x8, Iop_SarN16x4, Iop_SarN32x2,


      Iop_QShl8x8, Iop_QShl16x4, Iop_QShl32x2, Iop_QShl64x1,
      Iop_QSal8x8, Iop_QSal16x4, Iop_QSal32x2, Iop_QSal64x1,

      Iop_QShlN8Sx8, Iop_QShlN16Sx4, Iop_QShlN32Sx2, Iop_QShlN64Sx1,
      Iop_QShlN8x8, Iop_QShlN16x4, Iop_QShlN32x2, Iop_QShlN64x1,
      Iop_QSalN8x8, Iop_QSalN16x4, Iop_QSalN32x2, Iop_QSalN64x1,
# 936 "../VEX/pub/libvex_ir.h"
      Iop_QNarrowBin16Sto8Ux8,
      Iop_QNarrowBin16Sto8Sx8, Iop_QNarrowBin32Sto16Sx4,
      Iop_NarrowBin16to8x8, Iop_NarrowBin32to16x4,





      Iop_InterleaveHI8x8, Iop_InterleaveHI16x4, Iop_InterleaveHI32x2,
      Iop_InterleaveLO8x8, Iop_InterleaveLO16x4, Iop_InterleaveLO32x2,



      Iop_InterleaveOddLanes8x8, Iop_InterleaveEvenLanes8x8,
      Iop_InterleaveOddLanes16x4, Iop_InterleaveEvenLanes16x4,






      Iop_CatOddLanes8x8, Iop_CatOddLanes16x4,
      Iop_CatEvenLanes8x8, Iop_CatEvenLanes16x4,





      Iop_GetElem8x8, Iop_GetElem16x4, Iop_GetElem32x2,
      Iop_SetElem8x8, Iop_SetElem16x4, Iop_SetElem32x2,


      Iop_Dup8x8, Iop_Dup16x4, Iop_Dup32x2,






      Iop_Extract64,







      Iop_Reverse16_8x8,
      Iop_Reverse32_8x8, Iop_Reverse32_16x4,
      Iop_Reverse64_8x8, Iop_Reverse64_16x4, Iop_Reverse64_32x2,






      Iop_Perm8x8,



      Iop_Recip32x2, Iop_Rsqrte32x2,







      Iop_AddD64, Iop_SubD64, Iop_MulD64, Iop_DivD64,





      Iop_AddD128, Iop_SubD128, Iop_MulD128, Iop_DivD128,
# 1020 "../VEX/pub/libvex_ir.h"
      Iop_ShlD64, Iop_ShrD64,


      Iop_ShlD128, Iop_ShrD128,





      Iop_D32toD64,


      Iop_D64toD128,


      Iop_I64StoD128,


      Iop_D64toD32,


      Iop_D128toD64,


      Iop_I64StoD64,


      Iop_D64toI64S,


      Iop_D128toI64S,





      Iop_RoundD64toInt,


      Iop_RoundD128toInt,



      Iop_CmpD64,


      Iop_CmpD128,
# 1077 "../VEX/pub/libvex_ir.h"
      Iop_QuantizeD64,


      Iop_QuantizeD128,






      Iop_SignificanceRoundD64,


      Iop_SignificanceRoundD128,






      Iop_ExtractExpD64,


      Iop_ExtractExpD128,







      Iop_InsertExpD64,


      Iop_InsertExpD128,


      Iop_D64HLtoD128, Iop_D128HItoD64, Iop_D128LOtoD64,




      Iop_DPBtoBCD,




      Iop_BCDtoDPB,


      Iop_ReinterpI64asD64,


      Iop_ReinterpD64asI64,






      Iop_Add32Fx4, Iop_Sub32Fx4, Iop_Mul32Fx4, Iop_Div32Fx4,
      Iop_Max32Fx4, Iop_Min32Fx4,
      Iop_Add32Fx2, Iop_Sub32Fx2,


      Iop_CmpEQ32Fx4, Iop_CmpLT32Fx4, Iop_CmpLE32Fx4, Iop_CmpUN32Fx4,
      Iop_CmpGT32Fx4, Iop_CmpGE32Fx4,


      Iop_Abs32Fx4,


      Iop_PwMax32Fx4, Iop_PwMin32Fx4,


      Iop_Sqrt32Fx4, Iop_RSqrt32Fx4,
      Iop_Neg32Fx4,




      Iop_Recip32Fx4,




      Iop_Recps32Fx4,



      Iop_Rsqrte32Fx4,




      Iop_Rsqrts32Fx4,






      Iop_I32UtoFx4, Iop_I32StoFx4,
      Iop_FtoI32Ux4_RZ, Iop_FtoI32Sx4_RZ,
      Iop_QFtoI32Ux4_RZ, Iop_QFtoI32Sx4_RZ,
      Iop_RoundF32x4_RM, Iop_RoundF32x4_RP,
      Iop_RoundF32x4_RN, Iop_RoundF32x4_RZ,



      Iop_F32ToFixed32Ux4_RZ, Iop_F32ToFixed32Sx4_RZ,
      Iop_Fixed32UToF32x4_RN, Iop_Fixed32SToF32x4_RN,



      Iop_F32toF16x4, Iop_F16toF32x4,







      Iop_Add32F0x4, Iop_Sub32F0x4, Iop_Mul32F0x4, Iop_Div32F0x4,
      Iop_Max32F0x4, Iop_Min32F0x4,
      Iop_CmpEQ32F0x4, Iop_CmpLT32F0x4, Iop_CmpLE32F0x4, Iop_CmpUN32F0x4,


      Iop_Recip32F0x4, Iop_Sqrt32F0x4, Iop_RSqrt32F0x4,




      Iop_Add64Fx2, Iop_Sub64Fx2, Iop_Mul64Fx2, Iop_Div64Fx2,
      Iop_Max64Fx2, Iop_Min64Fx2,
      Iop_CmpEQ64Fx2, Iop_CmpLT64Fx2, Iop_CmpLE64Fx2, Iop_CmpUN64Fx2,


      Iop_Recip64Fx2, Iop_Sqrt64Fx2, Iop_RSqrt64Fx2,







      Iop_Add64F0x2, Iop_Sub64F0x2, Iop_Mul64F0x2, Iop_Div64F0x2,
      Iop_Max64F0x2, Iop_Min64F0x2,
      Iop_CmpEQ64F0x2, Iop_CmpLT64F0x2, Iop_CmpLE64F0x2, Iop_CmpUN64F0x2,


      Iop_Recip64F0x2, Iop_Sqrt64F0x2, Iop_RSqrt64F0x2,




      Iop_V128to64,
      Iop_V128HIto64,
      Iop_64HLtoV128,

      Iop_64UtoV128,
      Iop_SetV128lo64,


      Iop_32UtoV128,
      Iop_V128to32,
      Iop_SetV128lo32,




      Iop_NotV128,
      Iop_AndV128, Iop_OrV128, Iop_XorV128,


      Iop_ShlV128, Iop_ShrV128,


      Iop_CmpNEZ8x16, Iop_CmpNEZ16x8, Iop_CmpNEZ32x4, Iop_CmpNEZ64x2,


      Iop_Add8x16, Iop_Add16x8, Iop_Add32x4, Iop_Add64x2,
      Iop_QAdd8Ux16, Iop_QAdd16Ux8, Iop_QAdd32Ux4, Iop_QAdd64Ux2,
      Iop_QAdd8Sx16, Iop_QAdd16Sx8, Iop_QAdd32Sx4, Iop_QAdd64Sx2,


      Iop_Sub8x16, Iop_Sub16x8, Iop_Sub32x4, Iop_Sub64x2,
      Iop_QSub8Ux16, Iop_QSub16Ux8, Iop_QSub32Ux4, Iop_QSub64Ux2,
      Iop_QSub8Sx16, Iop_QSub16Sx8, Iop_QSub32Sx4, Iop_QSub64Sx2,


      Iop_Mul8x16, Iop_Mul16x8, Iop_Mul32x4,
                    Iop_MulHi16Ux8, Iop_MulHi32Ux4,
                    Iop_MulHi16Sx8, Iop_MulHi32Sx4,

      Iop_MullEven8Ux16, Iop_MullEven16Ux8,
      Iop_MullEven8Sx16, Iop_MullEven16Sx8,

      Iop_Mull8Ux8, Iop_Mull8Sx8,
      Iop_Mull16Ux4, Iop_Mull16Sx4,
      Iop_Mull32Ux2, Iop_Mull32Sx2,






      Iop_QDMulHi16Sx8, Iop_QDMulHi32Sx4,
      Iop_QRDMulHi16Sx8, Iop_QRDMulHi32Sx4,

      Iop_QDMulLong16Sx4, Iop_QDMulLong32Sx2,


      Iop_PolynomialMul8x16,
      Iop_PolynomialMull8x8,




      Iop_PwAdd8x16, Iop_PwAdd16x8, Iop_PwAdd32x4,
      Iop_PwAdd32Fx2,





      Iop_PwAddL8Ux16, Iop_PwAddL16Ux8, Iop_PwAddL32Ux4,
      Iop_PwAddL8Sx16, Iop_PwAddL16Sx8, Iop_PwAddL32Sx4,


      Iop_Abs8x16, Iop_Abs16x8, Iop_Abs32x4,


      Iop_Avg8Ux16, Iop_Avg16Ux8, Iop_Avg32Ux4,
      Iop_Avg8Sx16, Iop_Avg16Sx8, Iop_Avg32Sx4,


      Iop_Max8Sx16, Iop_Max16Sx8, Iop_Max32Sx4,
      Iop_Max8Ux16, Iop_Max16Ux8, Iop_Max32Ux4,
      Iop_Min8Sx16, Iop_Min16Sx8, Iop_Min32Sx4,
      Iop_Min8Ux16, Iop_Min16Ux8, Iop_Min32Ux4,


      Iop_CmpEQ8x16, Iop_CmpEQ16x8, Iop_CmpEQ32x4, Iop_CmpEQ64x2,
      Iop_CmpGT8Sx16, Iop_CmpGT16Sx8, Iop_CmpGT32Sx4, Iop_CmpGT64Sx2,
      Iop_CmpGT8Ux16, Iop_CmpGT16Ux8, Iop_CmpGT32Ux4,



      Iop_Cnt8x16,
      Iop_Clz8Sx16, Iop_Clz16Sx8, Iop_Clz32Sx4,
      Iop_Cls8Sx16, Iop_Cls16Sx8, Iop_Cls32Sx4,


      Iop_ShlN8x16, Iop_ShlN16x8, Iop_ShlN32x4, Iop_ShlN64x2,
      Iop_ShrN8x16, Iop_ShrN16x8, Iop_ShrN32x4, Iop_ShrN64x2,
      Iop_SarN8x16, Iop_SarN16x8, Iop_SarN32x4, Iop_SarN64x2,


      Iop_Shl8x16, Iop_Shl16x8, Iop_Shl32x4, Iop_Shl64x2,
      Iop_Shr8x16, Iop_Shr16x8, Iop_Shr32x4, Iop_Shr64x2,
      Iop_Sar8x16, Iop_Sar16x8, Iop_Sar32x4, Iop_Sar64x2,
      Iop_Sal8x16, Iop_Sal16x8, Iop_Sal32x4, Iop_Sal64x2,
      Iop_Rol8x16, Iop_Rol16x8, Iop_Rol32x4,


      Iop_QShl8x16, Iop_QShl16x8, Iop_QShl32x4, Iop_QShl64x2,
      Iop_QSal8x16, Iop_QSal16x8, Iop_QSal32x4, Iop_QSal64x2,

      Iop_QShlN8Sx16, Iop_QShlN16Sx8, Iop_QShlN32Sx4, Iop_QShlN64Sx2,
      Iop_QShlN8x16, Iop_QShlN16x8, Iop_QShlN32x4, Iop_QShlN64x2,
      Iop_QSalN8x16, Iop_QSalN16x8, Iop_QSalN32x4, Iop_QSalN64x2,




      Iop_QNarrowBin16Sto8Ux16, Iop_QNarrowBin32Sto16Ux8,
      Iop_QNarrowBin16Sto8Sx16, Iop_QNarrowBin32Sto16Sx8,
      Iop_QNarrowBin16Uto8Ux16, Iop_QNarrowBin32Uto16Ux8,
      Iop_NarrowBin16to8x16, Iop_NarrowBin32to16x8,


      Iop_NarrowUn16to8x8, Iop_NarrowUn32to16x4, Iop_NarrowUn64to32x2,

      Iop_QNarrowUn16Sto8Sx8, Iop_QNarrowUn32Sto16Sx4, Iop_QNarrowUn64Sto32Sx2,
      Iop_QNarrowUn16Sto8Ux8, Iop_QNarrowUn32Sto16Ux4, Iop_QNarrowUn64Sto32Ux2,

      Iop_QNarrowUn16Uto8Ux8, Iop_QNarrowUn32Uto16Ux4, Iop_QNarrowUn64Uto32Ux2,
# 1374 "../VEX/pub/libvex_ir.h"
      Iop_Widen8Uto16x8, Iop_Widen16Uto32x4, Iop_Widen32Uto64x2,
      Iop_Widen8Sto16x8, Iop_Widen16Sto32x4, Iop_Widen32Sto64x2,





      Iop_InterleaveHI8x16, Iop_InterleaveHI16x8,
      Iop_InterleaveHI32x4, Iop_InterleaveHI64x2,
      Iop_InterleaveLO8x16, Iop_InterleaveLO16x8,
      Iop_InterleaveLO32x4, Iop_InterleaveLO64x2,


      Iop_InterleaveOddLanes8x16, Iop_InterleaveEvenLanes8x16,
      Iop_InterleaveOddLanes16x8, Iop_InterleaveEvenLanes16x8,
      Iop_InterleaveOddLanes32x4, Iop_InterleaveEvenLanes32x4,



      Iop_CatOddLanes8x16, Iop_CatOddLanes16x8, Iop_CatOddLanes32x4,
      Iop_CatEvenLanes8x16, Iop_CatEvenLanes16x8, Iop_CatEvenLanes32x4,




      Iop_GetElem8x16, Iop_GetElem16x8, Iop_GetElem32x4, Iop_GetElem64x2,


      Iop_Dup8x16, Iop_Dup16x8, Iop_Dup32x4,






      Iop_ExtractV128,






      Iop_Reverse16_8x16,
      Iop_Reverse32_8x16, Iop_Reverse32_16x8,
      Iop_Reverse64_8x16, Iop_Reverse64_16x8, Iop_Reverse64_32x4,






      Iop_Perm8x16,
      Iop_Perm32x4,



      Iop_Recip32x4, Iop_Rsqrte32x4,




      Iop_V256to64_0,
      Iop_V256to64_1,
      Iop_V256to64_2,
      Iop_V256to64_3,

      Iop_64x4toV256,


      Iop_V256toV128_0,
      Iop_V256toV128_1,
      Iop_V128HLtoV256,

      Iop_AndV256,
      Iop_OrV256,
      Iop_XorV256,
      Iop_NotV256,


      Iop_CmpNEZ32x8, Iop_CmpNEZ64x4,


      Iop_Add64Fx4,
      Iop_Sub64Fx4,
      Iop_Mul64Fx4,
      Iop_Div64Fx4,
      Iop_Add32Fx8,
      Iop_Sub32Fx8,
      Iop_Mul32Fx8,
      Iop_Div32Fx8,

      Iop_Sqrt32Fx8,
      Iop_Sqrt64Fx4,
      Iop_RSqrt32Fx8,
      Iop_Recip32Fx8,

      Iop_Max32Fx8, Iop_Min32Fx8,
      Iop_Max64Fx4, Iop_Min64Fx4
   }
   IROp;


extern void ppIROp ( IROp );






typedef
   enum {
      Irrm_NEAREST = 0,
      Irrm_NegINF = 1,
      Irrm_PosINF = 2,
      Irrm_ZERO = 3
   }
   IRRoundingMode;
# 1499 "../VEX/pub/libvex_ir.h"
typedef
   enum {
      Irrm_DFP_NEAREST = 0,
      Irrm_DFP_NegINF = 1,
      Irrm_DFP_PosINF = 2,
      Irrm_DFP_ZERO = 3,
      Irrm_DFP_NEAREST_TIE_AWAY_0 = 4,
      Irrm_DFP_PREPARE_SHORTER = 5,

      Irrm_DFP_AWAY_FROM_ZERO = 6,
      Irrm_DFP_NEAREST_TIE_TOWARD_0 = 7
   }
   IRRoundingModeDFP;



typedef
   enum {
      Ircr_UN = 0x45,
      Ircr_LT = 0x01,
      Ircr_GT = 0x00,
      Ircr_EQ = 0x40
   }
   IRCmpF64Result;

typedef IRCmpF64Result IRCmpF32Result;
typedef IRCmpF64Result IRCmpF128Result;



typedef struct _IRQop IRQop;
typedef struct _IRTriop IRTriop;




typedef
   enum {
      Iex_Binder=0x15000,
      Iex_Get,
      Iex_GetI,
      Iex_RdTmp,
      Iex_Qop,
      Iex_Triop,
      Iex_Binop,
      Iex_Unop,
      Iex_Load,
      Iex_Const,
      Iex_Mux0X,
      Iex_CCall
   }
   IRExprTag;
# 1561 "../VEX/pub/libvex_ir.h"
typedef
   struct _IRExpr
   IRExpr;

struct _IRExpr {
   IRExprTag tag;
   union {


      struct {
         Int binder;
      } Binder;




      struct {
         Int offset;
         IRType ty;
      } Get;
# 1618 "../VEX/pub/libvex_ir.h"
      struct {
         IRRegArray* descr;
         IRExpr* ix;
         Int bias;
      } GetI;




      struct {
         IRTemp tmp;
      } RdTmp;





      struct {
        IRQop* details;
      } Qop;





      struct {
        IRTriop* details;
      } Triop;




      struct {
         IROp op;
         IRExpr* arg1;
         IRExpr* arg2;
      } Binop;




      struct {
         IROp op;
         IRExpr* arg;
      } Unop;







      struct {
         IREndness end;
         IRType ty;
         IRExpr* addr;
      } Load;




      struct {
         IRConst* con;
      } Const;
# 1725 "../VEX/pub/libvex_ir.h"
      struct {
         IRCallee* cee;
         IRType retty;
         IRExpr** args;
      } CCall;
# 1738 "../VEX/pub/libvex_ir.h"
      struct {
         IRExpr* cond;
         IRExpr* expr0;
         IRExpr* exprX;
      } Mux0X;
   } Iex;
};


struct _IRTriop {
   IROp op;
   IRExpr* arg1;
   IRExpr* arg2;
   IRExpr* arg3;
};


struct _IRQop {
   IROp op;
   IRExpr* arg1;
   IRExpr* arg2;
   IRExpr* arg3;
   IRExpr* arg4;
};


extern IRExpr* IRExpr_Binder ( Int binder );
extern IRExpr* IRExpr_Get ( Int off, IRType ty );
extern IRExpr* IRExpr_GetI ( IRRegArray* descr, IRExpr* ix, Int bias );
extern IRExpr* IRExpr_RdTmp ( IRTemp tmp );
extern IRExpr* IRExpr_Qop ( IROp op, IRExpr* arg1, IRExpr* arg2,
                                        IRExpr* arg3, IRExpr* arg4 );
extern IRExpr* IRExpr_Triop ( IROp op, IRExpr* arg1,
                                        IRExpr* arg2, IRExpr* arg3 );
extern IRExpr* IRExpr_Binop ( IROp op, IRExpr* arg1, IRExpr* arg2 );
extern IRExpr* IRExpr_Unop ( IROp op, IRExpr* arg );
extern IRExpr* IRExpr_Load ( IREndness end, IRType ty, IRExpr* addr );
extern IRExpr* IRExpr_Const ( IRConst* con );
extern IRExpr* IRExpr_CCall ( IRCallee* cee, IRType retty, IRExpr** args );
extern IRExpr* IRExpr_Mux0X ( IRExpr* cond, IRExpr* expr0, IRExpr* exprX );


extern IRExpr* deepCopyIRExpr ( IRExpr* );


extern void ppIRExpr ( IRExpr* );



extern IRExpr** mkIRExprVec_0 ( void );
extern IRExpr** mkIRExprVec_1 ( IRExpr* );
extern IRExpr** mkIRExprVec_2 ( IRExpr*, IRExpr* );
extern IRExpr** mkIRExprVec_3 ( IRExpr*, IRExpr*, IRExpr* );
extern IRExpr** mkIRExprVec_4 ( IRExpr*, IRExpr*, IRExpr*, IRExpr* );
extern IRExpr** mkIRExprVec_5 ( IRExpr*, IRExpr*, IRExpr*, IRExpr*,
                                IRExpr* );
extern IRExpr** mkIRExprVec_6 ( IRExpr*, IRExpr*, IRExpr*, IRExpr*,
                                IRExpr*, IRExpr* );
extern IRExpr** mkIRExprVec_7 ( IRExpr*, IRExpr*, IRExpr*, IRExpr*,
                                IRExpr*, IRExpr*, IRExpr* );
extern IRExpr** mkIRExprVec_8 ( IRExpr*, IRExpr*, IRExpr*, IRExpr*,
                                IRExpr*, IRExpr*, IRExpr*, IRExpr*);





extern IRExpr** shallowCopyIRExprVec ( IRExpr** );
extern IRExpr** deepCopyIRExprVec ( IRExpr** );



extern IRExpr* mkIRExpr_HWord ( HWord );


extern
IRExpr* mkIRExprCCall ( IRType retty,
                        Int regparms, HChar* name, void* addr,
                        IRExpr** args );




static inline Bool isIRAtom ( IRExpr* e ) {
   return toBool(e->tag == Iex_RdTmp || e->tag == Iex_Const);
}



extern Bool eqIRAtom ( IRExpr*, IRExpr* );
# 1857 "../VEX/pub/libvex_ir.h"
typedef
   enum {
      Ijk_INVALID=0x16000,
      Ijk_Boring,
      Ijk_Call,
      Ijk_Ret,
      Ijk_ClientReq,
      Ijk_Yield,
      Ijk_EmWarn,
      Ijk_EmFail,
      Ijk_NoDecode,
      Ijk_MapFail,
      Ijk_TInval,
      Ijk_NoRedir,
      Ijk_SigTRAP,
      Ijk_SigSEGV,
      Ijk_SigBUS,


      Ijk_Sys_syscall,
      Ijk_Sys_int32,
      Ijk_Sys_int128,
      Ijk_Sys_int129,
      Ijk_Sys_int130,
      Ijk_Sys_sysenter

   }
   IRJumpKind;

extern void ppIRJumpKind ( IRJumpKind );
# 1934 "../VEX/pub/libvex_ir.h"
typedef
   enum {
      Ifx_None = 0x1700,
      Ifx_Read,
      Ifx_Write,
      Ifx_Modify,
   }
   IREffect;


extern void ppIREffect ( IREffect );


typedef
   struct _IRDirty {






      IRCallee* cee;
      IRExpr* guard;
      IRExpr** args;
      IRTemp tmp;


      IREffect mFx;
      IRExpr* mAddr;
      Int mSize;


      Bool needsBBP;
      Int nFxState;
      struct {
         IREffect fx:16;
         UShort offset;
         UShort size;
         UChar nRepeats;
         UChar repeatLen;
      } fxState[7];
# 1989 "../VEX/pub/libvex_ir.h"
   }
   IRDirty;


extern void ppIRDirty ( IRDirty* );


extern IRDirty* emptyIRDirty ( void );


extern IRDirty* deepCopyIRDirty ( IRDirty* );







extern
IRDirty* unsafeIRDirty_0_N ( Int regparms, HChar* name, void* addr,
                             IRExpr** args );



extern
IRDirty* unsafeIRDirty_1_N ( IRTemp dst,
                             Int regparms, HChar* name, void* addr,
                             IRExpr** args );




typedef
   enum {
      Imbe_Fence=0x18000,



      Imbe_CancelReservation
   }
   IRMBusEvent;

extern void ppIRMBusEvent ( IRMBusEvent );
# 2099 "../VEX/pub/libvex_ir.h"
typedef
   struct {
      IRTemp oldHi;
      IRTemp oldLo;
      IREndness end;
      IRExpr* addr;
      IRExpr* expdHi;
      IRExpr* expdLo;
      IRExpr* dataHi;
      IRExpr* dataLo;
   }
   IRCAS;

extern void ppIRCAS ( IRCAS* cas );

extern IRCAS* mkIRCAS ( IRTemp oldHi, IRTemp oldLo,
                        IREndness end, IRExpr* addr,
                        IRExpr* expdHi, IRExpr* expdLo,
                        IRExpr* dataHi, IRExpr* dataLo );

extern IRCAS* deepCopyIRCAS ( IRCAS* );



typedef
   struct {
      IRRegArray* descr;
      IRExpr* ix;
      Int bias;
      IRExpr* data;
   } IRPutI;

extern void ppIRPutI ( IRPutI* puti );

extern IRPutI* mkIRPutI ( IRRegArray* descr, IRExpr* ix,
                          Int bias, IRExpr* data );

extern IRPutI* deepCopyIRPutI ( IRPutI* );
# 2151 "../VEX/pub/libvex_ir.h"
typedef
   enum {
      Ist_NoOp=0x19000,
      Ist_IMark,
      Ist_AbiHint,
      Ist_Put,
      Ist_PutI,
      Ist_WrTmp,
      Ist_Store,
      Ist_CAS,
      Ist_LLSC,
      Ist_Dirty,
      Ist_MBE,
      Ist_Exit
   }
   IRStmtTag;
# 2177 "../VEX/pub/libvex_ir.h"
typedef
   struct _IRStmt {
      IRStmtTag tag;
      union {





         struct {
  } NoOp;
# 2211 "../VEX/pub/libvex_ir.h"
         struct {
            Addr64 addr;
            Int len;
            UChar delta;

         } IMark;
# 2232 "../VEX/pub/libvex_ir.h"
         struct {
            IRExpr* base;
            Int len;
            IRExpr* nia;
         } AbiHint;




         struct {
            Int offset;
            IRExpr* data;
         } Put;
# 2253 "../VEX/pub/libvex_ir.h"
         struct {
            IRPutI* details;
         } PutI;
# 2264 "../VEX/pub/libvex_ir.h"
         struct {
            IRTemp tmp;
            IRExpr* data;
         } WrTmp;






         struct {
            IREndness end;
            IRExpr* addr;
            IRExpr* data;
         } Store;
# 2294 "../VEX/pub/libvex_ir.h"
         struct {
            IRCAS* details;
         } CAS;
# 2342 "../VEX/pub/libvex_ir.h"
         struct {
            IREndness end;
            IRTemp result;
            IRExpr* addr;
            IRExpr* storedata;
         } LLSC;
# 2360 "../VEX/pub/libvex_ir.h"
         struct {
            IRDirty* details;
         } Dirty;







         struct {
            IRMBusEvent event;
         } MBE;
# 2381 "../VEX/pub/libvex_ir.h"
         struct {
            IRExpr* guard;
            IRConst* dst;
            IRJumpKind jk;
            Int offsIP;
         } Exit;
      } Ist;
   }
   IRStmt;


extern IRStmt* IRStmt_NoOp ( void );
extern IRStmt* IRStmt_IMark ( Addr64 addr, Int len, UChar delta );
extern IRStmt* IRStmt_AbiHint ( IRExpr* base, Int len, IRExpr* nia );
extern IRStmt* IRStmt_Put ( Int off, IRExpr* data );
extern IRStmt* IRStmt_PutI ( IRPutI* details );
extern IRStmt* IRStmt_WrTmp ( IRTemp tmp, IRExpr* data );
extern IRStmt* IRStmt_Store ( IREndness end, IRExpr* addr, IRExpr* data );
extern IRStmt* IRStmt_CAS ( IRCAS* details );
extern IRStmt* IRStmt_LLSC ( IREndness end, IRTemp result,
                                IRExpr* addr, IRExpr* storedata );
extern IRStmt* IRStmt_Dirty ( IRDirty* details );
extern IRStmt* IRStmt_MBE ( IRMBusEvent event );
extern IRStmt* IRStmt_Exit ( IRExpr* guard, IRJumpKind jk, IRConst* dst,
                                Int offsIP );


extern IRStmt* deepCopyIRStmt ( IRStmt* );


extern void ppIRStmt ( IRStmt* );
# 2422 "../VEX/pub/libvex_ir.h"
typedef
   struct {
      IRType* types;
      Int types_size;
      Int types_used;
   }
   IRTypeEnv;


extern IRTemp newIRTemp ( IRTypeEnv*, IRType );


extern IRTypeEnv* deepCopyIRTypeEnv ( IRTypeEnv* );


extern void ppIRTypeEnv ( IRTypeEnv* );
# 2455 "../VEX/pub/libvex_ir.h"
typedef
   struct {
      IRTypeEnv* tyenv;
      IRStmt** stmts;
      Int stmts_size;
      Int stmts_used;
      IRExpr* next;
      IRJumpKind jumpkind;
      Int offsIP;
   }
   IRSB;


extern IRSB* emptyIRSB ( void );


extern IRSB* deepCopyIRSB ( IRSB* );



extern IRSB* deepCopyIRSBExceptStmts ( IRSB* );


extern void ppIRSB ( IRSB* );


extern void addStmtToIRSB ( IRSB*, IRStmt* );







extern IRTypeEnv* emptyIRTypeEnv ( void );


extern IRType typeOfIRConst ( IRConst* );
extern IRType typeOfIRTemp ( IRTypeEnv*, IRTemp );
extern IRType typeOfIRExpr ( IRTypeEnv*, IRExpr* );


extern void sanityCheckIRSB ( IRSB* bb,
                              HChar* caller,
                              Bool require_flatness,
                              IRType guest_word_size );
extern Bool isFlatIRStmt ( IRStmt* );


extern Bool isPlausibleIRType ( IRType ty );
# 42 "../VEX/pub/libvex.h" 2
# 52 "../VEX/pub/libvex.h"
typedef
   enum {
      VexArch_INVALID,
      VexArchX86,
      VexArchAMD64,
      VexArchARM,
      VexArchPPC32,
      VexArchPPC64,
      VexArchS390X,
      VexArchMIPS32
   }
   VexArch;
# 176 "../VEX/pub/libvex.h"
extern const HChar* LibVEX_ppVexArch ( VexArch );
extern const HChar* LibVEX_ppVexHwCaps ( VexArch, UInt );






typedef
   struct {

      UInt hwcaps;

      Int ppc_cache_line_szB;


      UInt ppc_dcbz_szB;
      UInt ppc_dcbzl_szB;
   }
   VexArchInfo;


extern
void LibVEX_default_VexArchInfo ( VexArchInfo* vai );
# 258 "../VEX/pub/libvex.h"
typedef
   struct {


      Int guest_stack_redzone_size;




      Bool guest_amd64_assume_fs_is_zero;




      Bool guest_amd64_assume_gs_is_0x60;



      Bool guest_ppc_zap_RZ_at_blr;





      Bool (*guest_ppc_zap_RZ_at_bl)(Addr64);




      Bool guest_ppc_sc_continues_at_LR;




      Bool host_ppc_calls_use_fndescrs;




      Bool host_ppc32_regalign_int64_args;
   }
   VexAbiInfo;


extern
void LibVEX_default_VexAbiInfo ( VexAbiInfo* vbi );
# 323 "../VEX/pub/libvex.h"
typedef enum { VexRegUpdUnwindregsAtMemAccess,
               VexRegUpdAllregsAtMemAccess,
               VexRegUpdAllregsAtEachInsn } VexRegisterUpdates;



typedef
   struct {

      Int iropt_verbosity;


      Int iropt_level;

      VexRegisterUpdates iropt_register_updates;



      Int iropt_unroll_thresh;



      Int guest_max_insns;





      Int guest_chase_thresh;


      Bool guest_chase_cond;
   }
   VexControl;




extern
void LibVEX_default_VexControl ( VexControl* vcon );
# 375 "../VEX/pub/libvex.h"
extern HChar* private_LibVEX_alloc_first;
extern HChar* private_LibVEX_alloc_curr;
extern HChar* private_LibVEX_alloc_last;
extern void private_LibVEX_alloc_OOM(void) __attribute__((noreturn));

static inline void* LibVEX_Alloc ( Int nbytes )
{
   struct align {
      char c;
      union {
         char c;
         short s;
         int i;
         long l;
         long long ll;
         float f;
         double d;



         void *pto;
         void (*ptf)(void);
      } x;
   };





   HChar* curr;
   HChar* next;
   Int ALIGN;
   ALIGN = ((Int)(HWord)&((struct align*)0)->x) - 1;
   nbytes = (nbytes + ALIGN) & ~ALIGN;
   curr = private_LibVEX_alloc_curr;
   next = curr + nbytes;
   if (next >= private_LibVEX_alloc_last)
      private_LibVEX_alloc_OOM();
   private_LibVEX_alloc_curr = next;
   return curr;

}


extern void LibVEX_ShowAllocStats ( void );
# 433 "../VEX/pub/libvex.h"
typedef
   struct {


      Int total_sizeB;

      Int offset_SP;
      Int sizeof_SP;

      Int offset_FP;
      Int sizeof_FP;

      Int offset_IP;
      Int sizeof_IP;


      Int n_alwaysDefd;
      struct {
         Int offset;
         Int size;
      } alwaysDefd[24];
   }
   VexGuestLayout;
# 483 "../VEX/pub/libvex.h"
extern void LibVEX_Init (






   __attribute__ ((noreturn))

   void (*failure_exit) ( void ),


   void (*log_bytes) ( HChar*, Int nbytes ),


   Int debuglevel,


   Bool valgrind_support,


               VexControl* vcon
);







typedef
   struct {

      enum { VexTransOK,
             VexTransAccessFail, VexTransOutputFull } status;

      UInt n_sc_extents;


      Int offs_profInc;


      UInt n_guest_instrs;
   }
   VexTranslateResult;
# 538 "../VEX/pub/libvex.h"
typedef
   struct {
      Addr64 base[3];
      UShort len[3];
      UShort n_used;
   }
   VexGuestExtents;




typedef
   struct {


      VexArch arch_guest;
      VexArchInfo archinfo_guest;
      VexArch arch_host;
      VexArchInfo archinfo_host;
      VexAbiInfo abiinfo_both;




      void* callback_opaque;



      UChar* guest_bytes;




      Addr64 guest_bytes_addr;



      Bool (*chase_into_ok) ( void*, Addr64 );


      VexGuestExtents* guest_extents;


      UChar* host_bytes;
      Int host_bytes_size;

      Int* host_bytes_used;



      IRSB* (*instrument1) ( void*,
                               IRSB*,
                               VexGuestLayout*,
                               VexGuestExtents*,
                               IRType gWordTy, IRType hWordTy );
      IRSB* (*instrument2) ( void*,
                               IRSB*,
                               VexGuestLayout*,
                               VexGuestExtents*,
                               IRType gWordTy, IRType hWordTy );

      IRSB* (*finaltidy) ( IRSB* );






      UInt (*needs_self_check)( void*,
                                VexGuestExtents* );
# 618 "../VEX/pub/libvex.h"
      Bool (*preamble_function)( void*, IRSB*);


      Int traceflags;



      Bool addProfInc;
# 662 "../VEX/pub/libvex.h"
      void* disp_cp_chain_me_to_slowEP;
      void* disp_cp_chain_me_to_fastEP;
      void* disp_cp_xindir;
      void* disp_cp_xassisted;
   }
   VexTranslateArgs;


extern
VexTranslateResult LibVEX_Translate ( VexTranslateArgs* );
# 696 "../VEX/pub/libvex.h"
typedef
   struct {
      HWord start;
      HWord len;
   }
   VexInvalRange;





extern
VexInvalRange LibVEX_Chain ( VexArch arch_host,
                             void* place_to_chain,
                             void* disp_cp_chain_me_EXPECTED,
                             void* place_to_jump_to );





extern
VexInvalRange LibVEX_UnChain ( VexArch arch_host,
                               void* place_to_unchain,
                               void* place_to_jump_to_EXPECTED,
                               void* disp_cp_chain_me );





extern
Int LibVEX_evCheckSzB ( VexArch arch_host );




extern
VexInvalRange LibVEX_PatchProfInc ( VexArch arch_host,
                                    void* place_to_patch,
                                    ULong* location_of_counter );






extern void LibVEX_ShowStats ( void );
# 50 "pub_core_basics.h" 2


# 1 "../VEX/pub/libvex_guest_x86.h" 1
# 40 "../VEX/pub/libvex_guest_x86.h"
# 1 "../VEX/pub/libvex_emwarn.h" 1
# 56 "../VEX/pub/libvex_emwarn.h"
typedef
   enum {

      EmWarn_NONE=0,


      EmWarn_X86_x87exns,


      EmWarn_X86_x87precision,


      EmWarn_X86_sseExns,


      EmWarn_X86_fz,


      EmWarn_X86_daz,


      EmWarn_X86_acFlag,


      EmWarn_PPCexns,


      EmWarn_PPC64_redir_overflow,
      EmWarn_PPC64_redir_underflow,

      EmWarn_NUMBER
   }
   VexEmWarn;



extern HChar* LibVEX_EmWarn_string ( VexEmWarn );
# 41 "../VEX/pub/libvex_guest_x86.h" 2
# 142 "../VEX/pub/libvex_guest_x86.h"
typedef
   struct {

      UInt host_EvC_FAILADDR;
      UInt host_EvC_COUNTER;
      UInt guest_EAX;
      UInt guest_ECX;
      UInt guest_EDX;
      UInt guest_EBX;
      UInt guest_ESP;
      UInt guest_EBP;
      UInt guest_ESI;
      UInt guest_EDI;


      UInt guest_CC_OP;
      UInt guest_CC_DEP1;
      UInt guest_CC_DEP2;
      UInt guest_CC_NDEP;

      UInt guest_DFLAG;

      UInt guest_IDFLAG;

      UInt guest_ACFLAG;


      UInt guest_EIP;


      ULong guest_FPREG[8];
      UChar guest_FPTAG[8];
      UInt guest_FPROUND;
      UInt guest_FC3210;
      UInt guest_FTOP;


      UInt guest_SSEROUND;
      U128 guest_XMM0;
      U128 guest_XMM1;
      U128 guest_XMM2;
      U128 guest_XMM3;
      U128 guest_XMM4;
      U128 guest_XMM5;
      U128 guest_XMM6;
      U128 guest_XMM7;


      UShort guest_CS;
      UShort guest_DS;
      UShort guest_ES;
      UShort guest_FS;
      UShort guest_GS;
      UShort guest_SS;

      HWord guest_LDT;
      HWord guest_GDT;


      UInt guest_EMWARN;


      UInt guest_TISTART;
      UInt guest_TILEN;







      UInt guest_NRADDR;


      UInt guest_SC_CLASS;





      UInt guest_IP_AT_SYSCALL;


      UInt padding[5];
   }
   VexGuestX86State;
# 242 "../VEX/pub/libvex_guest_x86.h"
typedef struct {
    union {
       struct {
          UShort LimitLow;
          UShort BaseLow;
          UInt BaseMid : 8;
          UInt Type : 5;
          UInt Dpl : 2;
          UInt Pres : 1;
          UInt LimitHi : 4;
          UInt Sys : 1;
          UInt Reserved_0 : 1;
          UInt Default_Big : 1;
          UInt Granularity : 1;
          UInt BaseHi : 8;
       } Bits;
       struct {
          UInt word1;
          UInt word2;
       } Words;
    }
    LdtEnt;
} VexGuestX86SegDescr;
# 274 "../VEX/pub/libvex_guest_x86.h"
extern
void LibVEX_GuestX86_initialise ( VexGuestX86State* vex_state );




extern
UInt LibVEX_GuestX86_get_eflags ( VexGuestX86State* vex_state );



extern
void
LibVEX_GuestX86_put_eflag_c ( UInt new_carry_flag,
                                     VexGuestX86State* vex_state );
# 53 "pub_core_basics.h" 2
# 86 "pub_core_basics.h"
typedef
   struct {
      ULong r_pc;
      ULong r_sp;
      union {
         struct {
            UInt r_ebp;
         } X86;
         struct {
            ULong r_rbp;
         } AMD64;
         struct {
            UInt r_lr;
         } PPC32;
         struct {
            ULong r_lr;
         } PPC64;
         struct {
            UInt r14;
            UInt r12;
            UInt r11;
            UInt r7;
         } ARM;
         struct {
            ULong r_fp;
            ULong r_lr;
         } S390X;
         struct {
            UInt r30;
            UInt r31;
            UInt r28;
         } MIPS32;
      } misc;
   }
   UnwindStartRegs;
# 32 "m_main.c" 2
# 1 "pub_core_vki.h" 1
# 44 "pub_core_vki.h"
# 1 "../include/pub_tool_vki.h" 1
# 49 "../include/pub_tool_vki.h"
# 1 "../include/vki/vki-linux.h" 1
# 83 "../include/vki/vki-linux.h"
# 1 "../include/vki/vki-posixtypes-x86-linux.h" 1
# 39 "../include/vki/vki-posixtypes-x86-linux.h"
typedef unsigned short __vki_kernel_mode_t;
typedef long __vki_kernel_off_t;
typedef int __vki_kernel_pid_t;
typedef unsigned short __vki_kernel_ipc_pid_t;
typedef unsigned short __vki_kernel_uid_t;
typedef unsigned short __vki_kernel_gid_t;
typedef unsigned int __vki_kernel_size_t;
typedef long __vki_kernel_time_t;
typedef long __vki_kernel_suseconds_t;
typedef long __vki_kernel_clock_t;
typedef int __vki_kernel_timer_t;
typedef int __vki_kernel_clockid_t;
typedef char * __vki_kernel_caddr_t;
typedef unsigned int __vki_kernel_uid32_t;
typedef unsigned int __vki_kernel_gid32_t;

typedef unsigned short __vki_kernel_old_uid_t;
typedef unsigned short __vki_kernel_old_gid_t;

typedef long long __vki_kernel_loff_t;

typedef struct {
 int val[2];
} __vki_kernel_fsid_t;
# 84 "../include/vki/vki-linux.h" 2
# 161 "../include/vki/vki-linux.h"
typedef struct {
 unsigned long fds_bits [(1024/(8 * sizeof(unsigned long)))];
} __vki_kernel_fd_set;

typedef int __vki_kernel_key_t;
typedef int __vki_kernel_mqd_t;





typedef __vki_kernel_fd_set vki_fd_set;
typedef __vki_kernel_mode_t vki_mode_t;
typedef __vki_kernel_off_t vki_off_t;
typedef __vki_kernel_pid_t vki_pid_t;
typedef __vki_kernel_key_t vki_key_t;
typedef __vki_kernel_suseconds_t vki_suseconds_t;
typedef __vki_kernel_timer_t vki_timer_t;
typedef __vki_kernel_clockid_t vki_clockid_t;
typedef __vki_kernel_mqd_t vki_mqd_t;


typedef __vki_kernel_uid32_t vki_uid_t;
typedef __vki_kernel_gid32_t vki_gid_t;

typedef __vki_kernel_old_uid_t vki_old_uid_t;
typedef __vki_kernel_old_gid_t vki_old_gid_t;

typedef __vki_kernel_loff_t vki_loff_t;

typedef __vki_kernel_size_t vki_size_t;
typedef __vki_kernel_time_t vki_time_t;
typedef __vki_kernel_clock_t vki_clock_t;
typedef __vki_kernel_caddr_t vki_caddr_t;

typedef unsigned long vki_u_long;

typedef unsigned int vki_uint;






# 1 "../include/vki/vki-x86-linux.h" 1
# 41 "../include/vki/vki-x86-linux.h"
typedef unsigned char __vki_u8;

typedef __signed__ short __vki_s16;
typedef unsigned short __vki_u16;

typedef __signed__ int __vki_s32;
typedef unsigned int __vki_u32;

typedef __signed__ long long __vki_s64;
typedef unsigned long long __vki_u64;

typedef unsigned short vki_u16;

typedef unsigned int vki_u32;
# 83 "../include/vki/vki-x86-linux.h"
typedef void __vki_signalfn_t(int);
typedef __vki_signalfn_t *__vki_sighandler_t;

typedef void __vki_restorefn_t(void);
typedef __vki_restorefn_t *__vki_sigrestore_t;
# 96 "../include/vki/vki-x86-linux.h"
typedef unsigned long vki_old_sigset_t;

typedef struct {
 unsigned long sig[(64 / 32)];
} vki_sigset_t;
# 162 "../include/vki/vki-x86-linux.h"
struct vki_old_sigaction {




        __vki_sighandler_t ksa_handler;
        vki_old_sigset_t sa_mask;
        unsigned long sa_flags;
        __vki_sigrestore_t sa_restorer;
};

struct vki_sigaction_base {

 __vki_sighandler_t ksa_handler;
 unsigned long sa_flags;
 __vki_sigrestore_t sa_restorer;
 vki_sigset_t sa_mask;
};



typedef struct vki_sigaction_base vki_sigaction_toK_t;
typedef struct vki_sigaction_base vki_sigaction_fromK_t;


typedef struct vki_sigaltstack {
 void *ss_sp;
 int ss_flags;
 vki_size_t ss_size;
} vki_stack_t;





struct _vki_fpreg {
 unsigned short significand[4];
 unsigned short exponent;
};

struct _vki_fpxreg {
 unsigned short significand[4];
 unsigned short exponent;
 unsigned short padding[3];
};

struct _vki_xmmreg {
 unsigned long element[4];
};

struct _vki_fpstate {

 unsigned long cw;
 unsigned long sw;
 unsigned long tag;
 unsigned long ipoff;
 unsigned long cssel;
 unsigned long dataoff;
 unsigned long datasel;
 struct _vki_fpreg _st[8];
 unsigned short status;
 unsigned short magic;


 unsigned long _fxsr_env[6];
 unsigned long mxcsr;
 unsigned long reserved;
 struct _vki_fpxreg _fxsr_st[8];
 struct _vki_xmmreg _xmm[8];
 unsigned long padding[56];
};

struct vki_sigcontext {
 unsigned short gs, __gsh;
 unsigned short fs, __fsh;
 unsigned short es, __esh;
 unsigned short ds, __dsh;
 unsigned long edi;
 unsigned long esi;
 unsigned long ebp;
 unsigned long esp;
 unsigned long ebx;
 unsigned long edx;
 unsigned long ecx;
 unsigned long eax;
 unsigned long trapno;
 unsigned long err;
 unsigned long eip;
 unsigned short cs, __csh;
 unsigned long eflags;
 unsigned long esp_at_signal;
 unsigned short ss, __ssh;
 struct _vki_fpstate * fpstate;
 unsigned long oldmask;
 unsigned long cr2;
};
# 318 "../include/vki/vki-x86-linux.h"
struct vki_f_owner_ex {
 int type;
 __vki_kernel_pid_t pid;
};
# 358 "../include/vki/vki-x86-linux.h"
struct vki_stat {
 unsigned long st_dev;
 unsigned long st_ino;
 unsigned short st_mode;
 unsigned short st_nlink;
 unsigned short st_uid;
 unsigned short st_gid;
 unsigned long st_rdev;
 unsigned long st_size;
 unsigned long st_blksize;
 unsigned long st_blocks;
 unsigned long st_atime;
 unsigned long st_atime_nsec;
 unsigned long st_mtime;
 unsigned long st_mtime_nsec;
 unsigned long st_ctime;
 unsigned long st_ctime_nsec;
 unsigned long __unused4;
 unsigned long __unused5;
};

struct vki_stat64 {
 unsigned long long st_dev;
 unsigned char __pad0[4];


 unsigned long __st_ino;

 unsigned int st_mode;
 unsigned int st_nlink;

 unsigned long st_uid;
 unsigned long st_gid;

 unsigned long long st_rdev;
 unsigned char __pad3[4];

 long long st_size;
 unsigned long st_blksize;

 unsigned long st_blocks;
 unsigned long __pad4;

 unsigned long st_atime;
 unsigned long st_atime_nsec;

 unsigned long st_mtime;
 unsigned int st_mtime_nsec;

 unsigned long st_ctime;
 unsigned long st_ctime_nsec;

 unsigned long long st_ino;
};






struct vki_statfs {
 __vki_u32 f_type;
 __vki_u32 f_bsize;
 __vki_u32 f_blocks;
 __vki_u32 f_bfree;
 __vki_u32 f_bavail;
 __vki_u32 f_files;
 __vki_u32 f_ffree;
 __vki_kernel_fsid_t f_fsid;
 __vki_u32 f_namelen;
 __vki_u32 f_frsize;
 __vki_u32 f_spare[5];
};





struct vki_winsize {
 unsigned short ws_row;
 unsigned short ws_col;
 unsigned short ws_xpixel;
 unsigned short ws_ypixel;
};


struct vki_termio {
 unsigned short c_iflag;
 unsigned short c_oflag;
 unsigned short c_cflag;
 unsigned short c_lflag;
 unsigned char c_line;
 unsigned char c_cc[8];
};






typedef unsigned char vki_cc_t;
typedef unsigned int vki_tcflag_t;


struct vki_termios {
 vki_tcflag_t c_iflag;
 vki_tcflag_t c_oflag;
 vki_tcflag_t c_cflag;
 vki_tcflag_t c_lflag;
 vki_cc_t c_line;
 vki_cc_t c_cc[19];
};
# 556 "../include/vki/vki-x86-linux.h"
struct vki_pollfd {
 int fd;
 short events;
 short revents;
};





struct vki_user_i387_struct {
 long cwd;
 long swd;
 long twd;
 long fip;
 long fcs;
 long foo;
 long fos;
 long st_space[20];
};

struct vki_user_fxsr_struct {
 unsigned short cwd;
 unsigned short swd;
 unsigned short twd;
 unsigned short fop;
 long fip;
 long fcs;
 long foo;
 long fos;
 long mxcsr;
 long reserved;
 long st_space[32];
 long xmm_space[32];
 long padding[56];
};







struct vki_user_regs_struct {
 long ebx, ecx, edx, esi, edi, ebp, eax;
 unsigned short ds, __ds, es, __es;
 unsigned short fs, __fs, gs, __gs;
 long orig_eax, eip;
 unsigned short cs, __cs;
 long eflags, esp;
 unsigned short ss, __ss;
};





typedef unsigned long vki_elf_greg_t;


typedef vki_elf_greg_t vki_elf_gregset_t[(sizeof (struct vki_user_regs_struct) / sizeof(vki_elf_greg_t))];

typedef struct vki_user_i387_struct vki_elf_fpregset_t;
typedef struct vki_user_fxsr_struct vki_elf_fpxregset_t;







struct vki_ucontext {
 unsigned long uc_flags;
 struct vki_ucontext *uc_link;
 vki_stack_t uc_stack;
 struct vki_sigcontext uc_mcontext;
 vki_sigset_t uc_sigmask;
};
# 651 "../include/vki/vki-x86-linux.h"
struct vki_user_desc {
 unsigned int entry_number;
 unsigned long base_addr;
 unsigned int limit;
 unsigned int seg_32bit:1;
 unsigned int contents:2;
 unsigned int read_exec_only:1;
 unsigned int limit_in_pages:1;
 unsigned int seg_not_present:1;
 unsigned int useable:1;





 unsigned int reserved:25;
};


typedef struct vki_user_desc vki_modify_ldt_t;





struct vki_ipc64_perm
{
 __vki_kernel_key_t key;
 __vki_kernel_uid32_t uid;
 __vki_kernel_gid32_t gid;
 __vki_kernel_uid32_t cuid;
 __vki_kernel_gid32_t cgid;
 __vki_kernel_mode_t mode;
 unsigned short __pad1;
 unsigned short seq;
 unsigned short __pad2;
 unsigned long __unused1;
 unsigned long __unused2;
};





struct vki_semid64_ds {
 struct vki_ipc64_perm sem_perm;
 __vki_kernel_time_t sem_otime;
 unsigned long __unused1;
 __vki_kernel_time_t sem_ctime;
 unsigned long __unused2;
 unsigned long sem_nsems;
 unsigned long __unused3;
 unsigned long __unused4;
};





struct vki_msqid64_ds {
 struct vki_ipc64_perm msg_perm;
 __vki_kernel_time_t msg_stime;
 unsigned long __unused1;
 __vki_kernel_time_t msg_rtime;
 unsigned long __unused2;
 __vki_kernel_time_t msg_ctime;
 unsigned long __unused3;
 unsigned long msg_cbytes;
 unsigned long msg_qnum;
 unsigned long msg_qbytes;
 __vki_kernel_pid_t msg_lspid;
 __vki_kernel_pid_t msg_lrpid;
 unsigned long __unused4;
 unsigned long __unused5;
};





struct vki_ipc_kludge {
 struct vki_msgbuf *msgp;
 long msgtyp;
};
# 754 "../include/vki/vki-x86-linux.h"
struct vki_shmid64_ds {
 struct vki_ipc64_perm shm_perm;
 vki_size_t shm_segsz;
 __vki_kernel_time_t shm_atime;
 unsigned long __unused1;
 __vki_kernel_time_t shm_dtime;
 unsigned long __unused2;
 __vki_kernel_time_t shm_ctime;
 unsigned long __unused3;
 __vki_kernel_pid_t shm_cpid;
 __vki_kernel_pid_t shm_lpid;
 unsigned long shm_nattch;
 unsigned long __unused4;
 unsigned long __unused5;
};

struct vki_shminfo64 {
 unsigned long shmmax;
 unsigned long shmmin;
 unsigned long shmmni;
 unsigned long shmseg;
 unsigned long shmall;
 unsigned long __unused1;
 unsigned long __unused2;
 unsigned long __unused3;
 unsigned long __unused4;
};
# 827 "../include/vki/vki-x86-linux.h"
struct vki_vm86_regs {



 long ebx;
 long ecx;
 long edx;
 long esi;
 long edi;
 long ebp;
 long eax;
 long __null_ds;
 long __null_es;
 long __null_fs;
 long __null_gs;
 long orig_eax;
 long eip;
 unsigned short cs, __csh;
 long eflags;
 long esp;
 unsigned short ss, __ssh;



 unsigned short es, __esh;
 unsigned short ds, __dsh;
 unsigned short fs, __fsh;
 unsigned short gs, __gsh;
};

struct vki_revectored_struct {
 unsigned long __map[8];
};

struct vki_vm86_struct {
 struct vki_vm86_regs regs;
 unsigned long flags;
 unsigned long screen_bitmap;
 unsigned long cpu_type;
 struct vki_revectored_struct int_revectored;
 struct vki_revectored_struct int21_revectored;
};

struct vki_vm86plus_info_struct {
 unsigned long force_return_for_pic:1;
 unsigned long vm86dbg_active:1;
 unsigned long vm86dbg_TFpendig:1;
 unsigned long unused:28;
 unsigned long is_vm86pus:1;
 unsigned char vm86dbg_intxxtab[32];
};

struct vki_vm86plus_struct {
 struct vki_vm86_regs regs;
 unsigned long flags;
 unsigned long screen_bitmap;
 unsigned long cpu_type;
 struct vki_revectored_struct int_revectored;
 struct vki_revectored_struct int21_revectored;
 struct vki_vm86plus_info_struct vm86plus;
};
# 206 "../include/vki/vki-linux.h" 2
# 226 "../include/vki/vki-linux.h"
typedef __vki_s32 vki_int32_t;
typedef __vki_s64 vki_int64_t;

typedef __vki_u8 vki_uint8_t;
typedef __vki_u16 vki_uint16_t;
typedef __vki_u32 vki_uint32_t;

typedef __vki_u16 __vki_le16;
# 245 "../include/vki/vki-linux.h"
struct vki_sysinfo {
 long uptime;
 unsigned long loads[3];
 unsigned long totalram;
 unsigned long freeram;
 unsigned long sharedram;
 unsigned long bufferram;
 unsigned long totalswap;
 unsigned long freeswap;
 unsigned short procs;
 unsigned short pad;
 unsigned long totalhigh;
 unsigned long freehigh;
 unsigned int mem_unit;
 char _f[20-2*sizeof(long)-sizeof(int)];
};
# 271 "../include/vki/vki-linux.h"
struct vki_timespec {
 vki_time_t tv_sec;
 long tv_nsec;
};

struct vki_timeval {
 vki_time_t tv_sec;
 vki_suseconds_t tv_usec;
};

struct vki_timezone {
 int tz_minuteswest;
 int tz_dsttime;
};

struct vki_itimerspec {
        struct vki_timespec it_interval;
        struct vki_timespec it_value;
};

struct vki_itimerval {
 struct vki_timeval it_interval;
 struct vki_timeval it_value;
};





struct vki_timex {
 unsigned int modes;
 long offset;
 long freq;
 long maxerror;
 long esterror;
 int status;
 long constant;
 long precision;
 long tolerance;


 struct vki_timeval time;
 long tick;

 long ppsfreq;
 long jitter;
 int shift;
 long stabil;
 long jitcnt;
 long calcnt;
 long errcnt;
 long stbcnt;

 int :32; int :32; int :32; int :32;
 int :32; int :32; int :32; int :32;
 int :32; int :32; int :32; int :32;
};
# 345 "../include/vki/vki-linux.h"
struct vki_tms {
 vki_clock_t tms_utime;
 vki_clock_t tms_stime;
 vki_clock_t tms_cutime;
 vki_clock_t tms_cstime;
};





struct vki_utimbuf {
 vki_time_t actime;
 vki_time_t modtime;
};
# 380 "../include/vki/vki-linux.h"
struct vki_sched_param {
 int sched_priority;
};
# 392 "../include/vki/vki-linux.h"
typedef union vki_sigval {
 int sival_int;
 void *sival_ptr;
} vki_sigval_t;
# 417 "../include/vki/vki-linux.h"
typedef struct vki_siginfo {
 int si_signo;
 int si_errno;
 int si_code;

 union {
  int _pad[((128 - (3 * sizeof(int))) / sizeof(int))];


  struct {
   vki_pid_t _pid;
   vki_uid_t _uid;
  } _kill;


  struct {
   vki_timer_t _tid;
   int _overrun;
   char _pad[sizeof( vki_uid_t) - sizeof(int)];
   vki_sigval_t _sigval;
   int _sys_private;
  } _timer;


  struct {
   vki_pid_t _pid;
   vki_uid_t _uid;
   vki_sigval_t _sigval;
  } _rt;


  struct {
   vki_pid_t _pid;
   vki_uid_t _uid;
   int _status;
   vki_clock_t _utime;
   vki_clock_t _stime;
  } _sigchld;


  struct {
   void *_addr;



  } _sigfault;


  struct {
   long _band;
   int _fd;
  } _sigpoll;
 } _sifields;
} vki_siginfo_t;
# 537 "../include/vki/vki-linux.h"
typedef struct vki_sigevent {
 vki_sigval_t sigev_value;
 int sigev_signo;
 int sigev_notify;
 union {
  int _pad[((64 - (sizeof(int) * 2 + sizeof(vki_sigval_t))) / sizeof(int))];
   int _tid;

  struct {
   void (*_function)(vki_sigval_t);
   void *_attribute;
  } _sigev_thread;
 } _sigev_un;
} vki_sigevent_t;
# 585 "../include/vki/vki-linux.h"
enum vki_sock_type {
 VKI_SOCK_STREAM = 1,

};





struct vki_iovec
{
 void *iov_base;
 __vki_kernel_size_t iov_len;
};
# 608 "../include/vki/vki-linux.h"
typedef unsigned short vki_sa_family_t;

struct vki_sockaddr {
 vki_sa_family_t sa_family;
 char sa_data[14];
};

struct vki_msghdr {
 void * msg_name;
 int msg_namelen;
 struct vki_iovec * msg_iov;
 __vki_kernel_size_t msg_iovlen;
 void * msg_control;
 __vki_kernel_size_t msg_controllen;
 unsigned msg_flags;
};

struct vki_mmsghdr {
 struct vki_msghdr msg_hdr;
 unsigned msg_len;
};

struct vki_cmsghdr {
 __vki_kernel_size_t cmsg_len;
        int cmsg_level;
        int cmsg_type;
};
# 649 "../include/vki/vki-linux.h"
static __inline__ struct vki_cmsghdr * __vki_cmsg_nxthdr(void *__ctl, __vki_kernel_size_t __size,
            struct vki_cmsghdr *__cmsg)
{
 struct vki_cmsghdr * __ptr;

 __ptr = (struct vki_cmsghdr*)(((unsigned char *) __cmsg) + ( ((__cmsg->cmsg_len)+sizeof(long)-1) & ~(sizeof(long)-1) ));
 if ((unsigned long)((char*)(__ptr+1) - (char *) __ctl) > __size)
  return (struct vki_cmsghdr *)0;

 return __ptr;
}

static __inline__ struct vki_cmsghdr * vki_cmsg_nxthdr (struct vki_msghdr *__msg, struct vki_cmsghdr *__cmsg)
{
 return __vki_cmsg_nxthdr(__msg->msg_control, __msg->msg_controllen, __cmsg);
}
# 680 "../include/vki/vki-linux.h"
struct vki_in_addr {
 __vki_u32 s_addr;
};



struct vki_sockaddr_in {
  vki_sa_family_t sin_family;
  unsigned short int sin_port;
  struct vki_in_addr sin_addr;


  unsigned char __pad[16 - sizeof(short int) -
   sizeof(unsigned short int) - sizeof(struct vki_in_addr)];
};





struct vki_in6_addr
{
 union
 {
  __vki_u8 u6_addr8[16];
  __vki_u16 u6_addr16[8];
  __vki_u32 u6_addr32[4];
 } vki_in6_u;



};

struct vki_sockaddr_in6 {
 unsigned short int sin6_family;
 __vki_u16 sin6_port;
 __vki_u32 sin6_flowinfo;
 struct vki_in6_addr sin6_addr;
 __vki_u32 sin6_scope_id;
};







struct vki_sockaddr_un {
 vki_sa_family_t sun_family;
 char sun_path[108];
};







struct vki_ifmap
{
 unsigned long mem_start;
 unsigned long mem_end;
 unsigned short base_addr;
 unsigned char irq;
 unsigned char dma;
 unsigned char port;

};

struct vki_if_settings
{
 unsigned int type;
 unsigned int size;
 union {



  void *raw_hdlc;
  void *cisco;
  void *fr;
  void *fr_pvc;
  void *fr_pvc_info;


  void *sync;
  void *te1;
 } ifs_ifsu;
};

struct vki_ifreq
{

 union
 {
  char ifrn_name[16];
 } ifr_ifrn;

 union {
  struct vki_sockaddr ifru_addr;
  struct vki_sockaddr ifru_dstaddr;
  struct vki_sockaddr ifru_broadaddr;
  struct vki_sockaddr ifru_netmask;
  struct vki_sockaddr ifru_hwaddr;
  short ifru_flags;
  int ifru_ivalue;
  int ifru_mtu;
  struct vki_ifmap ifru_map;
  char ifru_slave[16];
  char ifru_newname[16];
  void * ifru_data;
  struct vki_if_settings ifru_settings;
 } ifr_ifru;
};
# 812 "../include/vki/vki-linux.h"
struct vki_ifconf
{
 int ifc_len;
 union
 {
  char *ifcu_buf;
  struct vki_ifreq *ifcu_req;
 } ifc_ifcu;
};






struct vki_arpreq {
  struct vki_sockaddr arp_pa;
  struct vki_sockaddr arp_ha;
  int arp_flags;
  struct vki_sockaddr arp_netmask;
  char arp_dev[16];
};





struct vki_rtentry
{
 unsigned long rt_pad1;
 struct vki_sockaddr rt_dst;
 struct vki_sockaddr rt_gateway;
 struct vki_sockaddr rt_genmask;
 unsigned short rt_flags;
 short rt_pad2;
 unsigned long rt_pad3;
 void *rt_pad4;
 short rt_metric;
 char *rt_dev;
 unsigned long rt_mtu;




 unsigned long rt_window;
 unsigned short rt_irtt;
};





typedef __vki_s32 vki_sctp_assoc_t;

enum vki_sctp_optname {
 VKI_SCTP_RTOINFO,

 VKI_SCTP_ASSOCINFO,

 VKI_SCTP_INITMSG,

 VKI_SCTP_NODELAY,

 VKI_SCTP_AUTOCLOSE,

 VKI_SCTP_SET_PEER_PRIMARY_ADDR,

 VKI_SCTP_PRIMARY_ADDR,

 VKI_SCTP_ADAPTION_LAYER,

 VKI_SCTP_DISABLE_FRAGMENTS,

 VKI_SCTP_PEER_ADDR_PARAMS,

 VKI_SCTP_DEFAULT_SEND_PARAM,

 VKI_SCTP_EVENTS,

 VKI_SCTP_I_WANT_MAPPED_V4_ADDR,

 VKI_SCTP_MAXSEG,

 VKI_SCTP_STATUS,

 VKI_SCTP_GET_PEER_ADDR_INFO,





 VKI_SCTP_SOCKOPT_BINDX_ADD = 100,

 VKI_SCTP_SOCKOPT_BINDX_REM,

 VKI_SCTP_SOCKOPT_PEELOFF,

 VKI_SCTP_GET_PEER_ADDRS_NUM,

 VKI_SCTP_GET_PEER_ADDRS,

 VKI_SCTP_GET_LOCAL_ADDRS_NUM,

 VKI_SCTP_GET_LOCAL_ADDRS,

 VKI_SCTP_SOCKOPT_CONNECTX,

};

struct vki_sctp_getaddrs {
 vki_sctp_assoc_t assoc_id;
 int addr_num;
 struct vki_sockaddr *addrs;
};





struct vki_rusage {
 struct vki_timeval ru_utime;
 struct vki_timeval ru_stime;
 long ru_maxrss;
 long ru_ixrss;
 long ru_idrss;
 long ru_isrss;
 long ru_minflt;
 long ru_majflt;
 long ru_nswap;
 long ru_inblock;
 long ru_oublock;
 long ru_msgsnd;
 long ru_msgrcv;
 long ru_nsignals;
 long ru_nvcsw;
 long ru_nivcsw;
};

struct vki_rlimit {
 unsigned long rlim_cur;
 unsigned long rlim_max;
};

struct vki_rlimit64 {
 __vki_u64 rlim_cur;
 __vki_u64 rlim_max;
};





struct vki_elf_siginfo
{
 int si_signo;
 int si_code;
 int si_errno;
};


struct vki_elf_prstatus
{
 struct vki_elf_siginfo pr_info;
 short pr_cursig;
 unsigned long pr_sigpend;
 unsigned long pr_sighold;
 vki_pid_t pr_pid;
 vki_pid_t pr_ppid;
 vki_pid_t pr_pgrp;
 vki_pid_t pr_sid;
 struct vki_timeval pr_utime;
 struct vki_timeval pr_stime;
 struct vki_timeval pr_cutime;
 struct vki_timeval pr_cstime;
 vki_elf_gregset_t pr_reg;
 int pr_fpvalid;
};



struct vki_elf_prpsinfo
{
 char pr_state;
 char pr_sname;
 char pr_zomb;
 char pr_nice;
 unsigned long pr_flag;
 __vki_kernel_uid_t pr_uid;
 __vki_kernel_gid_t pr_gid;
 vki_pid_t pr_pid, pr_ppid, pr_pgrp, pr_sid;

 char pr_fname[16];
 char pr_psargs[(80)];
};
# 1022 "../include/vki/vki-linux.h"
struct vki_epoll_event {
 __vki_u32 events;
 __vki_u64 data;
} ;






struct vki_mq_attr {
 long mq_flags;
 long mq_maxmsg;
 long mq_msgsize;
 long mq_curmsgs;
 long __reserved[4];
};





struct vki_new_utsname {
 char sysname[65];
 char nodename[65];
 char release[65];
 char version[65];
 char machine[65];
 char domainname[65];
};






struct vki_mii_ioctl_data {
 vki_u16 phy_id;
 vki_u16 reg_num;
 vki_u16 val_in;
 vki_u16 val_out;
};
# 1077 "../include/vki/vki-linux.h"
typedef struct __vki_user_cap_header_struct {
 __vki_u32 version;
 int pid;
} *vki_cap_user_header_t;

typedef struct __vki_user_cap_data_struct {
        __vki_u32 effective;
        __vki_u32 permitted;
        __vki_u32 inheritable;
} *vki_cap_user_data_t;
# 1101 "../include/vki/vki-linux.h"
struct vki_ipc_perm
{
 __vki_kernel_key_t key;
 __vki_kernel_uid_t uid;
 __vki_kernel_gid_t gid;
 __vki_kernel_uid_t cuid;
 __vki_kernel_gid_t cgid;
 __vki_kernel_mode_t mode;
 unsigned short seq;
};
# 1136 "../include/vki/vki-linux.h"
struct vki_semid_ds {
 struct vki_ipc_perm sem_perm;
 __vki_kernel_time_t sem_otime;
 __vki_kernel_time_t sem_ctime;

 void *sem_base;
 void *sem_pending;
 void **sem_pending_last;
 void *undo;
 unsigned short sem_nsems;
};

struct vki_sembuf {
 unsigned short sem_num;
 short sem_op;
 short sem_flg;
};

union vki_semun {
 int val;
 struct vki_semid_ds *buf;
 unsigned short *array;
 struct vki_seminfo *__buf;
 void *__pad;
};

struct vki_seminfo {
 int semmap;
 int semmni;
 int semmns;
 int semmnu;
 int semmsl;
 int semopm;
 int semume;
 int semusz;
 int semvmx;
 int semaem;
};
# 1259 "../include/vki/vki-linux.h"
struct vki_robust_list {
 struct vki_robust_list *next;
};

struct vki_robust_list_head {



 struct vki_robust_list list;







 long futex_offset;
# 1287 "../include/vki/vki-linux.h"
 struct vki_robust_list *list_op_pending;
};
# 1339 "../include/vki/vki-linux.h"
struct vki_dirent {
 long d_ino;
 __vki_kernel_off_t d_off;
 unsigned short d_reclen;
 char d_name[256];
};
# 1366 "../include/vki/vki-linux.h"
struct __vki_sysctl_args {
 int *name;
 int nlen;
 void *oldval;
 vki_size_t *oldlenp;
 void *newval;
 vki_size_t newlen;
 unsigned long __unused[4];
};





typedef unsigned long vki_aio_context_t;

enum {
 VKI_IOCB_CMD_PREAD = 0,
 VKI_IOCB_CMD_PWRITE = 1,
 VKI_IOCB_CMD_FSYNC = 2,
 VKI_IOCB_CMD_FDSYNC = 3,
 VKI_IOCB_CMD_PREADV = 7,
 VKI_IOCB_CMD_PWRITEV = 8,
};


struct vki_io_event {
 __vki_u64 data;
 __vki_u64 obj;


 __vki_s64 result;
 __vki_s64 result2;
};
# 1409 "../include/vki/vki-linux.h"
struct vki_iocb {

 __vki_u64 aio_data;
 __vki_u32 aio_key, aio_reserved1;



 __vki_u16 aio_lio_opcode;
 __vki_s16 aio_reqprio;
 __vki_u32 aio_fildes;

 __vki_u64 aio_buf;
 __vki_u64 aio_nbytes;
 __vki_s64 aio_offset;


 __vki_u64 aio_reserved2;
 __vki_u64 aio_reserved3;
};





struct vki_aio_ring {
 unsigned id;
 unsigned nr;
 unsigned head;
 unsigned tail;

 unsigned magic;
 unsigned compat_features;
 unsigned incompat_features;
 unsigned header_length;

 struct vki_io_event io_events[0];
};
# 1454 "../include/vki/vki-linux.h"
struct vki_msqid_ds {
 struct vki_ipc_perm msg_perm;
 struct vki_msg *msg_first;
 struct vki_msg *msg_last;
 __vki_kernel_time_t msg_stime;
 __vki_kernel_time_t msg_rtime;
 __vki_kernel_time_t msg_ctime;
 unsigned long msg_lcbytes;
 unsigned long msg_lqbytes;
 unsigned short msg_cbytes;
 unsigned short msg_qnum;
 unsigned short msg_qbytes;
 __vki_kernel_ipc_pid_t msg_lspid;
 __vki_kernel_ipc_pid_t msg_lrpid;
};

struct vki_msgbuf {
 long mtype;
 char mtext[1];
};

struct vki_msginfo {
 int msgpool;
 int msgmap;
 int msgmax;
 int msgmnb;
 int msgmni;
 int msgssz;
 int msgtql;
 unsigned short msgseg;
};





struct vki_shmid_ds {
 struct vki_ipc_perm shm_perm;
 int shm_segsz;
 __vki_kernel_time_t shm_atime;
 __vki_kernel_time_t shm_dtime;
 __vki_kernel_time_t shm_ctime;
 __vki_kernel_ipc_pid_t shm_cpid;
 __vki_kernel_ipc_pid_t shm_lpid;
 unsigned short shm_nattch;
 unsigned short shm_unused;
 void *shm_unused2;
 void *shm_unused3;
};
# 1511 "../include/vki/vki-linux.h"
struct vki_shminfo {
 int shmmax;
 int shmmin;
 int shmmni;
 int shmseg;
 int shmall;
};

struct vki_shm_info {
 int used_ids;
 unsigned long shm_tot;
 unsigned long shm_rss;
 unsigned long shm_swp;
 unsigned long swap_attempts;
 unsigned long swap_successes;
};





struct vki_rtc_time {
 int tm_sec;
 int tm_min;
 int tm_hour;
 int tm_mday;
 int tm_mon;
 int tm_year;
 int tm_wday;
 int tm_yday;
 int tm_isdst;
};
# 1572 "../include/vki/vki-linux.h"
typedef struct {
  char name[10];
  char phone[32];
  int outgoing;
} vki_isdn_net_ioctl_phone;
# 1646 "../include/vki/vki-linux.h"
struct vki_ppdev_frob_struct {
 unsigned char mask;
 unsigned char val;
};
# 1720 "../include/vki/vki-linux.h"
typedef struct vki_sg_io_hdr
{
    int interface_id;
    int dxfer_direction;
    unsigned char cmd_len;
    unsigned char mx_sb_len;
    unsigned short iovec_count;
    unsigned int dxfer_len;
    void *dxferp;

    unsigned char *cmdp;
    void *sbp;
    unsigned int timeout;
    unsigned int flags;
    int pack_id;
    void * usr_ptr;
    unsigned char status;
    unsigned char masked_status;
    unsigned char msg_status;
    unsigned char sb_len_wr;
    unsigned short host_status;
    unsigned short driver_status;
    int resid;
    unsigned int duration;
    unsigned int info;
} vki_sg_io_hdr_t;

typedef struct vki_sg_scsi_id {
    int host_no;
    int channel;
    int scsi_id;
    int lun;
    int scsi_type;
    short h_cmd_per_lun;
    short d_queue_depth;
    int unused[2];
} vki_sg_scsi_id_t;
# 1786 "../include/vki/vki-linux.h"
struct vki_scsi_idlun {
 __vki_u32 dev_id;
 __vki_u32 host_unique_id;
};
# 1820 "../include/vki/vki-linux.h"
struct vki_cdrom_msf0
{
 __vki_u8 minute;
 __vki_u8 second;
 __vki_u8 frame;
};

union vki_cdrom_addr
{
 struct vki_cdrom_msf0 msf;
 int lba;
};

struct vki_cdrom_msf
{
 __vki_u8 cdmsf_min0;
 __vki_u8 cdmsf_sec0;
 __vki_u8 cdmsf_frame0;
 __vki_u8 cdmsf_min1;
 __vki_u8 cdmsf_sec1;
 __vki_u8 cdmsf_frame1;
};

struct vki_cdrom_tochdr
{
 __vki_u8 cdth_trk0;
 __vki_u8 cdth_trk1;
};

struct vki_cdrom_volctrl
{
 __vki_u8 channel0;
 __vki_u8 channel1;
 __vki_u8 channel2;
 __vki_u8 channel3;
};

struct vki_cdrom_subchnl
{
 __vki_u8 cdsc_format;
 __vki_u8 cdsc_audiostatus;
 __vki_u8 cdsc_adr: 4;
 __vki_u8 cdsc_ctrl: 4;
 __vki_u8 cdsc_trk;
 __vki_u8 cdsc_ind;
 union vki_cdrom_addr cdsc_absaddr;
 union vki_cdrom_addr cdsc_reladdr;
};

struct vki_cdrom_tocentry
{
 __vki_u8 cdte_track;
 __vki_u8 cdte_adr :4;
 __vki_u8 cdte_ctrl :4;
 __vki_u8 cdte_format;
 union vki_cdrom_addr cdte_addr;
 __vki_u8 cdte_datamode;
};

struct vki_cdrom_read
{
 int cdread_lba;
 char *cdread_bufaddr;
 int cdread_buflen;
};

struct vki_cdrom_read_audio
{
 union vki_cdrom_addr addr;
 __vki_u8 addr_format;
 int nframes;
 __vki_u8 *buf;
};

struct vki_cdrom_multisession
{
 union vki_cdrom_addr addr;


 __vki_u8 xa_flag;
 __vki_u8 addr_format;
};

struct vki_cdrom_mcn
{
  __vki_u8 medium_catalog_number[14];
};



struct vki_cdrom_generic_command
{
 unsigned char cmd[12];
 unsigned char *buffer;
 unsigned int buflen;
 int stat;

 void *sense;
 unsigned char data_direction;
 int quiet;
 int timeout;
 void *reserved[1];
};
# 1977 "../include/vki/vki-linux.h"
typedef struct vki_audio_buf_info {
   int fragments;
   int fragstotal;
   int fragsize;

   int bytes;

  } vki_audio_buf_info;
# 2014 "../include/vki/vki-linux.h"
struct vki_hd_geometry {
      unsigned char heads;
      unsigned char sectors;
      unsigned short cylinders;
      unsigned long start;
};
# 2038 "../include/vki/vki-linux.h"
struct vki_fb_fix_screeninfo {
 char id[16];
 unsigned long smem_start;

 __vki_u32 smem_len;
 __vki_u32 type;
 __vki_u32 type_aux;
 __vki_u32 visual;
 __vki_u16 xpanstep;
 __vki_u16 ypanstep;
 __vki_u16 ywrapstep;
 __vki_u32 line_length;
 unsigned long mmio_start;

 __vki_u32 mmio_len;
 __vki_u32 accel;

 __vki_u16 reserved[3];
};

struct vki_fb_bitfield {
 __vki_u32 offset;
 __vki_u32 length;
 __vki_u32 msb_right;

};

struct vki_fb_var_screeninfo {
 __vki_u32 xres;
 __vki_u32 yres;
 __vki_u32 xres_virtual;
 __vki_u32 yres_virtual;
 __vki_u32 xoffset;
 __vki_u32 yoffset;

 __vki_u32 bits_per_pixel;
 __vki_u32 grayscale;

 struct vki_fb_bitfield red;
 struct vki_fb_bitfield green;
 struct vki_fb_bitfield blue;
 struct vki_fb_bitfield transp;

 __vki_u32 nonstd;

 __vki_u32 activate;

 __vki_u32 height;
 __vki_u32 width;

 __vki_u32 accel_flags;


 __vki_u32 pixclock;
 __vki_u32 left_margin;
 __vki_u32 right_margin;
 __vki_u32 upper_margin;
 __vki_u32 lower_margin;
 __vki_u32 hsync_len;
 __vki_u32 vsync_len;
 __vki_u32 sync;
 __vki_u32 vmode;
 __vki_u32 rotate;
 __vki_u32 reserved[5];
};
# 2113 "../include/vki/vki-linux.h"
struct vki_consolefontdesc {
 unsigned short charcount;
 unsigned short charheight;
 char *chardata;
};
# 2150 "../include/vki/vki-linux.h"
struct vki_unipair {
 unsigned short unicode;
 unsigned short fontpos;
};
struct vki_unimapdesc {
 unsigned short entry_ct;
 struct vki_unipair *entries;
};


struct vki_unimapinit {
 unsigned short advised_hashsize;
 unsigned short advised_hashstep;
 unsigned short advised_hashlevel;
};
# 2175 "../include/vki/vki-linux.h"
struct vki_kbentry {
 unsigned char kb_table;
 unsigned char kb_index;
 unsigned short kb_value;
};



struct vki_kbsentry {
 unsigned char kb_func;
 unsigned char kb_string[512];
};



struct vki_kbdiacr {
        unsigned char diacr, base, result;
};
struct vki_kbdiacrs {
        unsigned int kb_cnt;
 struct vki_kbdiacr kbdiacr[256];
};



struct vki_kbkeycode {
 unsigned int scancode, keycode;
};





struct vki_kbd_repeat {
 int delay;
 int period;

};





struct vki_console_font_op {
 unsigned int op;
 unsigned int flags;
 unsigned int width, height;
 unsigned int charcount;
 unsigned char *data;
};
# 2235 "../include/vki/vki-linux.h"
typedef __vki_kernel_uid32_t vki_qid_t;
# 2257 "../include/vki/vki-linux.h"
enum {
 VKI_SNDRV_PCM_IOCTL_HW_FREE = (((0U) << (((0 +8)+8)+14)) | ((('A')) << (0 +8)) | (((0x12)) << 0) | ((0) << ((0 +8)+8))),
 VKI_SNDRV_PCM_IOCTL_HWSYNC = (((0U) << (((0 +8)+8)+14)) | ((('A')) << (0 +8)) | (((0x22)) << 0) | ((0) << ((0 +8)+8))),
 VKI_SNDRV_PCM_IOCTL_PREPARE = (((0U) << (((0 +8)+8)+14)) | ((('A')) << (0 +8)) | (((0x40)) << 0) | ((0) << ((0 +8)+8))),
 VKI_SNDRV_PCM_IOCTL_RESET = (((0U) << (((0 +8)+8)+14)) | ((('A')) << (0 +8)) | (((0x41)) << 0) | ((0) << ((0 +8)+8))),
 VKI_SNDRV_PCM_IOCTL_START = (((0U) << (((0 +8)+8)+14)) | ((('A')) << (0 +8)) | (((0x42)) << 0) | ((0) << ((0 +8)+8))),
 VKI_SNDRV_PCM_IOCTL_DROP = (((0U) << (((0 +8)+8)+14)) | ((('A')) << (0 +8)) | (((0x43)) << 0) | ((0) << ((0 +8)+8))),
 VKI_SNDRV_PCM_IOCTL_DRAIN = (((0U) << (((0 +8)+8)+14)) | ((('A')) << (0 +8)) | (((0x44)) << 0) | ((0) << ((0 +8)+8))),
 VKI_SNDRV_PCM_IOCTL_PAUSE = (((1U) << (((0 +8)+8)+14)) | ((('A')) << (0 +8)) | (((0x45)) << 0) | (((((sizeof(struct { int:-!((sizeof(int) == sizeof(int[1]) && sizeof(int) < (1 << 14))); })) + sizeof(int)))) << ((0 +8)+8))),
 VKI_SNDRV_PCM_IOCTL_RESUME = (((0U) << (((0 +8)+8)+14)) | ((('A')) << (0 +8)) | (((0x47)) << 0) | ((0) << ((0 +8)+8))),
 VKI_SNDRV_PCM_IOCTL_XRUN = (((0U) << (((0 +8)+8)+14)) | ((('A')) << (0 +8)) | (((0x48)) << 0) | ((0) << ((0 +8)+8))),
 VKI_SNDRV_PCM_IOCTL_LINK = (((1U) << (((0 +8)+8)+14)) | ((('A')) << (0 +8)) | (((0x60)) << 0) | (((((sizeof(struct { int:-!((sizeof(int) == sizeof(int[1]) && sizeof(int) < (1 << 14))); })) + sizeof(int)))) << ((0 +8)+8))),
 VKI_SNDRV_PCM_IOCTL_UNLINK = (((0U) << (((0 +8)+8)+14)) | ((('A')) << (0 +8)) | (((0x61)) << 0) | ((0) << ((0 +8)+8))),
};

enum {
 VKI_SNDRV_TIMER_IOCTL_START = (((0U) << (((0 +8)+8)+14)) | ((('T')) << (0 +8)) | (((0xa0)) << 0) | ((0) << ((0 +8)+8))),
 VKI_SNDRV_TIMER_IOCTL_STOP = (((0U) << (((0 +8)+8)+14)) | ((('T')) << (0 +8)) | (((0xa1)) << 0) | ((0) << ((0 +8)+8))),
 VKI_SNDRV_TIMER_IOCTL_CONTINUE = (((0U) << (((0 +8)+8)+14)) | ((('T')) << (0 +8)) | (((0xa2)) << 0) | ((0) << ((0 +8)+8))),
 VKI_SNDRV_TIMER_IOCTL_PAUSE = (((0U) << (((0 +8)+8)+14)) | ((('T')) << (0 +8)) | (((0xa3)) << 0) | ((0) << ((0 +8)+8))),
};





struct vki_serial_icounter_struct {
 int cts, dsr, rng, dcd;
 int rx, tx;
 int frame, overrun, parity, brk;
 int buf_overrun;
 int reserved[9];
};







struct vki_vt_mode {
 char mode;
 char waitv;
 short relsig;
 short acqsig;
 short frsig;
};



struct vki_vt_stat {
 unsigned short v_active;
 unsigned short v_signal;
 unsigned short v_state;
};
# 2321 "../include/vki/vki-linux.h"
struct vki_vt_sizes {
 unsigned short v_rows;
 unsigned short v_cols;
 unsigned short v_scrollsize;
};


struct vki_vt_consize {
 unsigned short v_rows;
 unsigned short v_cols;
 unsigned short v_vlin;
 unsigned short v_clin;
 unsigned short v_vcol;
 unsigned short v_ccol;
};
# 2396 "../include/vki/vki-linux.h"
struct vki_usbdevfs_ctrltransfer {
 __vki_u8 bRequestType;
 __vki_u8 bRequest;
 __vki_u16 wValue;
 __vki_u16 wIndex;
 __vki_u16 wLength;
 __vki_u32 timeout;
  void *data;
};

struct vki_usbdevfs_bulktransfer {
 unsigned int ep;
 unsigned int len;
 unsigned int timeout;
 void *data;
};



struct vki_usbdevfs_getdriver {
 unsigned int interface;
 char driver[255 + 1];
};

struct vki_usbdevfs_connectinfo {
 unsigned int devnum;
 unsigned char slow;
};

struct vki_usbdevfs_iso_packet_desc {
 unsigned int length;
 unsigned int actual_length;
 unsigned int status;
};

struct vki_usbdevfs_urb {
 unsigned char type;
 unsigned char endpoint;
 int status;
 unsigned int flags;
 void *buffer;
 int buffer_length;
 int actual_length;
 int start_frame;
 int number_of_packets;
 int error_count;
 unsigned int signr;
 void *usercontext;
 struct vki_usbdevfs_iso_packet_desc iso_frame_desc[0];
};

struct vki_usbdevfs_ioctl {
 int ifno;
 int ioctl_code;

 void *data;
};
# 2471 "../include/vki/vki-linux.h"
struct vki_usbdevfs_setuppacket {
       __vki_u8 bRequestType;
       __vki_u8 bRequest;
       __vki_u16 wValue;
       __vki_u16 wIndex;
       __vki_u16 wLength;
};
# 2494 "../include/vki/vki-linux.h"
struct vki_i2c_msg {
 __vki_u16 addr;
 __vki_u16 flags;







 __vki_u16 len;
 __vki_u8 *buf;
};

struct vki_i2c_rdwr_ioctl_data {
 struct vki_i2c_msg *msgs;
 __vki_u32 nmsgs;
};
# 2541 "../include/vki/vki-linux.h"
typedef vki_int32_t vki_key_serial_t;


typedef vki_uint32_t vki_key_perm_t;
# 2638 "../include/vki/vki-linux.h"
struct vki_iw_param
{
  __vki_s32 value;
  __vki_u8 fixed;
  __vki_u8 disabled;
  __vki_u16 flags;
};

struct vki_iw_point
{
  void *pointer;
  __vki_u16 length;
  __vki_u16 flags;
};

struct vki_iw_freq
{
 __vki_s32 m;
 __vki_s16 e;
 __vki_u8 i;
 __vki_u8 flags;
};

struct vki_iw_quality
{
 __vki_u8 qual;

 __vki_u8 level;
 __vki_u8 noise;
 __vki_u8 updated;
};

union vki_iwreq_data
{

 char name[16];



 struct vki_iw_point essid;
 struct vki_iw_param nwid;
 struct vki_iw_freq freq;



 struct vki_iw_param sens;
 struct vki_iw_param bitrate;
 struct vki_iw_param txpower;
 struct vki_iw_param rts;
 struct vki_iw_param frag;
 __vki_u32 mode;
 struct vki_iw_param retry;

 struct vki_iw_point encoding;
 struct vki_iw_param power;
 struct vki_iw_quality qual;

 struct vki_sockaddr ap_addr;
 struct vki_sockaddr addr;

 struct vki_iw_param param;
 struct vki_iw_point data;
};

struct vki_iwreq
{
 union
 {
  char ifrn_name[16];
 } ifr_ifrn;


 union vki_iwreq_data u;
};





struct vki_perf_event_attr {




 __vki_u32 type;




 __vki_u32 size;




 __vki_u64 config;

 union {
  __vki_u64 sample_period;
  __vki_u64 sample_freq;
 };

 __vki_u64 sample_type;
 __vki_u64 read_format;

 __vki_u64 disabled : 1,
     inherit : 1,
     pinned : 1,
     exclusive : 1,
     exclude_user : 1,
     exclude_kernel : 1,
     exclude_hv : 1,
     exclude_idle : 1,
     mmap : 1,
     comm : 1,
     freq : 1,
     inherit_stat : 1,
     enable_on_exec : 1,
     task : 1,
     watermark : 1,
# 2767 "../include/vki/vki-linux.h"
     precise_ip : 2,
     mmap_data : 1,
     sample_id_all : 1,

     __reserved_1 : 45;

 union {
  __vki_u32 wakeup_events;
  __vki_u32 wakeup_watermark;
 };

 __vki_u32 bp_type;
 union {
  __vki_u64 bp_addr;
  __vki_u64 config1;
 };
 union {
  __vki_u64 bp_len;
  __vki_u64 config2;
 };
};





struct vki_getcpu_cache {
 unsigned long blob[128 / sizeof(long)];
};
# 2908 "../include/vki/vki-linux.h"
typedef struct {
   __vki_u8 b[6];
} __attribute__((packed)) vki_bdaddr_t;
# 2942 "../include/vki/vki-linux.h"
struct vki_inquiry_info {
   vki_bdaddr_t bdaddr;
   __vki_u8 pscan_rep_mode;
   __vki_u8 pscan_period_mode;
   __vki_u8 pscan_mode;
   __vki_u8 dev_class[3];
   __vki_le16 clock_offset;
} __attribute__((packed));

struct vki_hci_inquiry_req {
   __vki_u16 dev_id;
   __vki_u16 flags;
   __vki_u8 lap[3];
   __vki_u8 length;
   __vki_u8 num_rsp;
};
# 2987 "../include/vki/vki-linux.h"
struct vki_hwtstamp_config {
 int flags;
 int tx_type;
 int rx_filter;
};
# 50 "../include/pub_tool_vki.h" 2
# 45 "pub_core_vki.h" 2





void vgPlain_vki_do_initial_consistency_checks(void);
# 33 "m_main.c" 2
# 1 "pub_core_vkiscnums.h" 1
# 60 "pub_core_vkiscnums.h"
# 1 "pub_core_vkiscnums_asm.h" 1
# 43 "pub_core_vkiscnums_asm.h"
# 1 "../include/pub_tool_vkiscnums_asm.h" 1
# 37 "../include/pub_tool_vkiscnums_asm.h"
# 1 "../include/vki/vki-scnums-x86-linux.h" 1
# 38 "../include/pub_tool_vkiscnums_asm.h" 2
# 44 "pub_core_vkiscnums_asm.h" 2
# 61 "pub_core_vkiscnums.h" 2
# 1 "../include/pub_tool_vkiscnums.h" 1
# 36 "../include/pub_tool_vkiscnums.h"
# 1 "../include/pub_tool_vkiscnums_asm.h" 1
# 37 "../include/pub_tool_vkiscnums.h" 2





extern Char* vgPlain_sysnum_string (Word sysnum, SizeT n_buf, Char* buf);



extern Char* vgPlain_sysnum_string_extra(Word sysnum, SizeT n_buf, Char* buf);
# 62 "pub_core_vkiscnums.h" 2
# 34 "m_main.c" 2
# 1 "pub_core_libcsetjmp.h" 1
# 43 "pub_core_libcsetjmp.h"
# 1 "../include/pub_tool_libcsetjmp.h" 1
# 53 "../include/pub_tool_libcsetjmp.h"
# 1 "/usr/include/setjmp.h" 1 3 4
# 26 "/usr/include/setjmp.h" 3 4
# 1 "/usr/include/features.h" 1 3 4
# 361 "/usr/include/features.h" 3 4
# 1 "/usr/include/sys/cdefs.h" 1 3 4
# 365 "/usr/include/sys/cdefs.h" 3 4
# 1 "/usr/include/bits/wordsize.h" 1 3 4
# 366 "/usr/include/sys/cdefs.h" 2 3 4
# 362 "/usr/include/features.h" 2 3 4
# 385 "/usr/include/features.h" 3 4
# 1 "/usr/include/gnu/stubs.h" 1 3 4



# 1 "/usr/include/bits/wordsize.h" 1 3 4
# 5 "/usr/include/gnu/stubs.h" 2 3 4


# 1 "/usr/include/gnu/stubs-32.h" 1 3 4
# 8 "/usr/include/gnu/stubs.h" 2 3 4
# 386 "/usr/include/features.h" 2 3 4
# 27 "/usr/include/setjmp.h" 2 3 4



# 1 "/usr/include/bits/setjmp.h" 1 3 4
# 29 "/usr/include/bits/setjmp.h" 3 4
typedef int __jmp_buf[6];
# 31 "/usr/include/setjmp.h" 2 3 4
# 1 "/usr/include/bits/sigset.h" 1 3 4
# 24 "/usr/include/bits/sigset.h" 3 4
typedef int __sig_atomic_t;




typedef struct
  {
    unsigned long int __val[(1024 / (8 * sizeof (unsigned long int)))];
  } __sigset_t;
# 32 "/usr/include/setjmp.h" 2 3 4



struct __jmp_buf_tag
  {




    __jmp_buf __jmpbuf;
    int __mask_was_saved;
    __sigset_t __saved_mask;
  };




typedef struct __jmp_buf_tag jmp_buf[1];



extern int setjmp (jmp_buf __env) __attribute__ ((__nothrow__));






extern int __sigsetjmp (struct __jmp_buf_tag __env[1], int __savemask) __attribute__ ((__nothrow__));




extern int _setjmp (struct __jmp_buf_tag __env[1]) __attribute__ ((__nothrow__));
# 78 "/usr/include/setjmp.h" 3 4




extern void longjmp (struct __jmp_buf_tag __env[1], int __val)
     __attribute__ ((__nothrow__)) __attribute__ ((__noreturn__));







extern void _longjmp (struct __jmp_buf_tag __env[1], int __val)
     __attribute__ ((__nothrow__)) __attribute__ ((__noreturn__));







typedef struct __jmp_buf_tag sigjmp_buf[1];
# 110 "/usr/include/setjmp.h" 3 4
extern void siglongjmp (sigjmp_buf __env, int __val)
     __attribute__ ((__nothrow__)) __attribute__ ((__noreturn__));
# 120 "/usr/include/setjmp.h" 3 4

# 54 "../include/pub_tool_libcsetjmp.h" 2
# 104 "../include/pub_tool_libcsetjmp.h"
__attribute__((returns_twice))
__attribute__((regparm(1)))
UWord VG_MINIMAL_SETJMP(UInt _env [8+1]);
__attribute__((noreturn))
__attribute__((regparm(1)))
void VG_MINIMAL_LONGJMP(UInt _env [8+1]);
# 44 "pub_core_libcsetjmp.h" 2
# 35 "m_main.c" 2
# 1 "pub_core_threadstate.h" 1
# 42 "pub_core_threadstate.h"
# 1 "../include/pub_tool_threadstate.h" 1
# 47 "../include/pub_tool_threadstate.h"
extern ThreadId vgPlain_get_running_tid ( void );
# 43 "pub_core_threadstate.h" 2
# 55 "pub_core_threadstate.h"
typedef
   enum ThreadStatus {
      VgTs_Empty,
      VgTs_Init,
      VgTs_Runnable,
      VgTs_WaitSys,
      VgTs_Yielding,
      VgTs_Zombie,
   }
   ThreadStatus;


typedef
   enum {
      VgSrc_None,
      VgSrc_ExitThread,
      VgSrc_ExitProcess,
      VgSrc_FatalSig

   }
   VgSchedReturnCode;



   typedef VexGuestX86State VexGuestArchState;
# 97 "pub_core_threadstate.h"
struct SyscallStatus;
struct SyscallArgs;


typedef
   struct {
# 112 "pub_core_threadstate.h"
      VexGuestArchState vex __attribute__((aligned(16)));


      VexGuestArchState vex_shadow1 __attribute__((aligned(16)));
      VexGuestArchState vex_shadow2 __attribute__((aligned(16)));


      UChar vex_spill[4096] __attribute__((aligned(16)));


   }
   ThreadArchState;





typedef
   struct {

      Int lwpid;
      Int threadgroup;

      ThreadId parent;


      Addr valgrind_stack_base;
      Addr valgrind_stack_init_SP;


      Word exitcode;
      Int fatalsig;
# 273 "pub_core_threadstate.h"
   }
   ThreadOSstate;



typedef struct {







   ThreadId tid;


   ThreadStatus status;




   VgSchedReturnCode exitreason;


   ThreadArchState arch;







   vki_sigset_t sig_mask;







   vki_sigset_t tmp_sig_mask;




   struct SigQueue *sig_queue;
# 331 "pub_core_threadstate.h"
   SizeT client_stack_szB;





   Addr client_stack_highest_word;


   vki_stack_t altstack;


   ThreadOSstate os_state;







   UInt err_disablement_level;


   Bool sched_jmpbuf_valid;
   UInt sched_jmpbuf [8+1];
}
ThreadState;
# 367 "pub_core_threadstate.h"
extern ThreadState vgPlain_threads[500];



extern ThreadId vgPlain_running_tid;







void vgPlain_init_Threads(void);


const HChar* vgPlain_name_of_ThreadStatus ( ThreadStatus status );


extern ThreadState *vgPlain_get_ThreadState ( ThreadId tid );


extern Bool vgPlain_is_valid_tid ( ThreadId tid );


extern Bool vgPlain_is_running_thread(ThreadId tid);


extern Bool vgPlain_is_exiting(ThreadId tid);


extern Int vgPlain_count_living_threads(void);


extern Int vgPlain_count_runnable_threads(void);



extern ThreadId vgPlain_lwpid_to_vgtid(Int lwpid);
# 36 "m_main.c" 2
# 1 "pub_core_xarray.h" 1
# 43 "pub_core_xarray.h"
# 1 "../include/pub_tool_xarray.h" 1
# 47 "../include/pub_tool_xarray.h"
typedef struct _XArray XArray;




extern XArray* vgPlain_newXA ( void*(*alloc_fn)(HChar*,SizeT),
                            HChar* cc,
                            void(*free_fn)(void*),
                            Word elemSzB );


extern void vgPlain_deleteXA ( XArray* );




extern void vgPlain_setCmpFnXA ( XArray*, Int (*compar)(void*,void*) );




extern Word vgPlain_addToXA ( XArray*, void* elem );




extern Word vgPlain_addBytesToXA ( XArray* xao, void* bytesV, Word nbytes );



extern void vgPlain_sortXA ( XArray* );






extern Bool vgPlain_lookupXA ( XArray*, void* key,
                                   Word* first, Word* last );
# 95 "../include/pub_tool_xarray.h"
extern Bool vgPlain_lookupXA_UNSAFE ( XArray* xao, void* key,
                                          Word* first, Word* last,
                                   Int(*cmpFn)(void*,void*) );


extern Word vgPlain_sizeXA ( XArray* );
# 109 "../include/pub_tool_xarray.h"
extern void* vgPlain_indexXA ( XArray*, Word );



extern void vgPlain_dropTailXA ( XArray*, Word );




extern void vgPlain_dropHeadXA ( XArray*, Word );





extern void vgPlain_removeIndexXA( XArray*, Word );







extern XArray* vgPlain_cloneXA( HChar* cc, XArray* xa );







extern void vgPlain_getContentsXA_UNSAFE( XArray* sr,
                                              void** ctsP,
                                              Word* usedP );





extern void vgPlain_xaprintf( XArray* dst, const HChar* format, ... )
                         __attribute__((format(__printf__, 2, 3)));
# 44 "pub_core_xarray.h" 2
# 37 "m_main.c" 2
# 1 "pub_core_clientstate.h" 1
# 41 "pub_core_clientstate.h"
# 1 "../include/pub_tool_clientstate.h" 1
# 41 "../include/pub_tool_clientstate.h"
extern XArray* vgPlain_args_for_client;
# 55 "../include/pub_tool_clientstate.h"
extern XArray* vgPlain_args_for_valgrind;



extern Int vgPlain_args_for_valgrind_noexecpass;



extern const HChar* vgPlain_args_the_exename;
# 42 "pub_core_clientstate.h" 2



extern Addr vgPlain_clstk_base;
extern Addr vgPlain_clstk_end;
extern UWord vgPlain_clstk_id;



extern UWord* vgPlain_client_auxv;

extern Addr vgPlain_brk_base;
extern Addr vgPlain_brk_limit;


extern Int vgPlain_cl_exec_fd;
# 68 "pub_core_clientstate.h"
extern Int vgPlain_cl_cmdline_fd;


extern struct vki_rlimit vgPlain_client_rlimit_data;
extern struct vki_rlimit vgPlain_client_rlimit_stack;



extern HChar* vgPlain_name_of_launcher;


extern Int vgPlain_fd_soft_limit;
extern Int vgPlain_fd_hard_limit;



extern Addr vgPlain_client___libc_freeres_wrapper;





extern Addr vgPlain_client__dl_sysinfo_int80;
# 38 "m_main.c" 2
# 1 "pub_core_aspacemgr.h" 1
# 42 "pub_core_aspacemgr.h"
# 1 "../include/pub_tool_aspacemgr.h" 1
# 39 "../include/pub_tool_aspacemgr.h"
typedef
   enum {
      SkFree,
      SkAnonC,
      SkAnonV,
      SkFileC,
      SkFileV,
      SkShmC,
      SkResvn
   }
   SegKind;


typedef
   enum {
      SmLower,
      SmFixed,
      SmUpper
   }
   ShrinkMode;
# 93 "../include/pub_tool_aspacemgr.h"
typedef
   struct {
      SegKind kind;

      Addr start;
      Addr end;

      ShrinkMode smode;

      ULong dev;
      ULong ino;
      Off64T offset;
      UInt mode;
      Int fnIdx;

      Bool hasR;
      Bool hasW;
      Bool hasX;
      Bool hasT;

      Bool isCH;

      Bool mark;
   }
   NSegment;
# 133 "../include/pub_tool_aspacemgr.h"
extern Int vgPlain_am_get_segment_starts( Addr* starts, Int nStarts );



extern NSegment const * vgPlain_am_find_nsegment ( Addr a );


extern HChar* vgPlain_am_get_filename( NSegment const * );


extern Bool vgPlain_am_is_valid_for_client ( Addr start, SizeT len,
                                          UInt prot );



extern void* vgPlain_am_shadow_alloc(SizeT size);



extern SysRes vgPlain_am_munmap_valgrind( Addr start, SizeT length );
# 43 "pub_core_aspacemgr.h" 2
# 62 "pub_core_aspacemgr.h"
extern Addr vgPlain_am_startup ( Addr sp_at_startup );
# 76 "pub_core_aspacemgr.h"
extern NSegment const* vgPlain_am_next_nsegment ( NSegment* here, Bool fwds );
# 92 "pub_core_aspacemgr.h"
extern Bool vgPlain_am_is_valid_for_client_or_free_or_resvn
   ( Addr start, SizeT len, UInt prot );




extern ULong vgPlain_am_get_anonsize_total( void );


extern void vgPlain_am_show_nsegments ( Int logLevel, HChar* who );
# 120 "pub_core_aspacemgr.h"
extern Bool vgPlain_am_do_sync_check ( const HChar* fn,
                                    const HChar* file, Int line );







typedef
   struct {
      enum { MFixed, MHint, MAny } rkind;
      Addr start;
      Addr len;
   }
   MapRequest;
# 144 "pub_core_aspacemgr.h"
extern Addr vgPlain_am_get_advisory
   ( MapRequest* req, Bool forClient, Bool* ok );





extern Addr vgPlain_am_get_advisory_client_simple
   ( Addr start, SizeT len, Bool* ok );
# 162 "pub_core_aspacemgr.h"
extern Bool vgPlain_am_covered_by_single_free_segment
   ( Addr start, SizeT len);





extern Bool vgPlain_am_notify_client_mmap
   ( Addr a, SizeT len, UInt prot, UInt flags, Int fd, Off64T offset );





extern Bool vgPlain_am_notify_client_shmat( Addr a, SizeT len, UInt prot );
# 187 "pub_core_aspacemgr.h"
extern Bool vgPlain_am_notify_mprotect( Addr start, SizeT len, UInt prot );







extern Bool vgPlain_am_notify_munmap( Addr start, SizeT len );






extern SysRes vgPlain_am_do_mmap_NO_NOTIFY
   ( Addr start, SizeT length, UInt prot, UInt flags, Int fd, Off64T offset);
# 216 "pub_core_aspacemgr.h"
extern SysRes vgPlain_am_mmap_file_fixed_client
   ( Addr start, SizeT length, UInt prot, Int fd, Off64T offset );
extern SysRes vgPlain_am_mmap_named_file_fixed_client
   ( Addr start, SizeT length, UInt prot, Int fd, Off64T offset, const HChar *name );



extern SysRes vgPlain_am_mmap_anon_fixed_client
   ( Addr start, SizeT length, UInt prot );




extern SysRes vgPlain_am_mmap_anon_float_client ( SizeT length, Int prot );
# 239 "pub_core_aspacemgr.h"
extern SysRes vgPlain_am_sbrk_anon_float_client ( SizeT length, Int prot );





extern SysRes vgPlain_am_mmap_anon_float_valgrind( SizeT cszB );



extern SysRes vgPlain_am_sbrk_anon_float_valgrind( SizeT cszB );





extern SysRes vgPlain_am_mmap_file_float_valgrind
   ( SizeT length, UInt prot, Int fd, Off64T offset );




extern SysRes vgPlain_am_shared_mmap_file_float_valgrind
   ( SizeT length, UInt prot, Int fd, Off64T offset );






extern SysRes vgPlain_am_munmap_client( Bool* need_discard,
                                     Addr start, SizeT length );





extern Bool vgPlain_am_change_ownership_v_to_c( Addr start, SizeT len );







extern void vgPlain_am_set_segment_isCH_if_SkAnonC( NSegment* seg );




extern void vgPlain_am_set_segment_hasT_if_SkFileC_or_SkAnonC( NSegment* );
# 301 "pub_core_aspacemgr.h"
extern Bool vgPlain_am_create_reservation
   ( Addr start, SizeT length, ShrinkMode smode, SSizeT extra );
# 314 "pub_core_aspacemgr.h"
extern Bool vgPlain_am_extend_into_adjacent_reservation_client
   ( NSegment* seg, SSizeT delta );
# 326 "pub_core_aspacemgr.h"
extern Bool vgPlain_am_extend_map_client( Bool* need_discard,
                                       NSegment* seg, SizeT delta );
# 337 "pub_core_aspacemgr.h"
extern Bool vgPlain_am_relocate_nooverlap_client( Bool* need_discard,
                                               Addr old_addr, SizeT old_len,
                                               Addr new_addr, SizeT new_len );
# 355 "pub_core_aspacemgr.h"
typedef
   struct {
      HChar bytes[8192
                  + (4096 * 256)
                  + 8192];
   }
   VgStack;
# 370 "pub_core_aspacemgr.h"
extern VgStack* vgPlain_am_alloc_VgStack( Addr* initial_sp );




extern SizeT vgPlain_am_get_VgStack_unused_szB( VgStack* stack, SizeT limit );
# 39 "m_main.c" 2
# 1 "pub_core_aspacehl.h" 1
# 40 "pub_core_aspacehl.h"
# 1 "../include/pub_tool_aspacehl.h" 1
# 38 "../include/pub_tool_aspacehl.h"
extern Addr* vgPlain_get_segment_starts ( Int* n_acquired );
# 41 "pub_core_aspacehl.h" 2
# 40 "m_main.c" 2
# 1 "pub_core_commandline.h" 1
# 40 "pub_core_commandline.h"
extern void vgPlain_split_up_argv( Int argc, HChar** argv );
# 41 "m_main.c" 2
# 1 "pub_core_debuglog.h" 1
# 58 "pub_core_debuglog.h"
extern
void vgPlain_debugLog_startup ( Int level, HChar* who );



extern void vgPlain_debugLog_setXml(Bool xml);





extern
Int vgPlain_debugLog_getLevel ( void );




extern
void vgPlain_debugLog ( Int level, const HChar* modulename,
                                const HChar* format, ... )
     __attribute__((format(__printf__, 3, 4)));




extern
UInt vgPlain_debugLog_vprintf (
        void (*send_fn)(HChar,void*),
        void* send_arg2,
        const HChar *format,
        va_list vargs
     );
# 42 "m_main.c" 2
# 1 "pub_core_errormgr.h" 1
# 40 "pub_core_errormgr.h"
# 1 "../include/pub_tool_errormgr.h" 1
# 34 "../include/pub_tool_errormgr.h"
# 1 "../include/pub_tool_execontext.h" 1
# 34 "../include/pub_tool_execontext.h"
typedef
   struct _ExeContext
   ExeContext;



typedef
   enum { Vg_LowRes, Vg_MedRes, Vg_HighRes }
   VgRes;
# 60 "../include/pub_tool_execontext.h"
extern
ExeContext* vgPlain_record_ExeContext ( ThreadId tid, Word first_ip_delta );







extern
ExeContext* vgPlain_record_depth_1_ExeContext(ThreadId tid, Word first_ip_delta);




extern void vgPlain_apply_ExeContext( void(*action)(UInt n, Addr ip),
                                   ExeContext* ec, UInt n_ips );





extern Bool vgPlain_eq_ExeContext ( VgRes res, ExeContext* e1, ExeContext* e2 );


extern void vgPlain_pp_ExeContext ( ExeContext* ec );





extern UInt vgPlain_get_ECU_from_ExeContext( ExeContext* e );


extern Int vgPlain_get_ExeContext_n_ips( ExeContext* e );



extern ExeContext* vgPlain_get_ExeContext_from_ECU( UInt uniq );


ExeContext* vgPlain_make_depth_1_ExeContext_from_Addr( Addr a );




static inline Bool vgPlain_is_plausible_ECU( UInt ecu ) {
   return (ecu > 0) && ((ecu & 3) == 0);
}


ExeContext* vgPlain_make_ExeContext_from_StackTrace( Addr* ips, UInt n_ips );
# 35 "../include/pub_tool_errormgr.h" 2
# 43 "../include/pub_tool_errormgr.h"
typedef
   Int
   ErrorKind;







typedef
   struct _Error
   Error;



ExeContext* vgPlain_get_error_where ( Error* err );
ErrorKind vgPlain_get_error_kind ( Error* err );
Addr vgPlain_get_error_address ( Error* err );
Char* vgPlain_get_error_string ( Error* err );
void* vgPlain_get_error_extra ( Error* err );
# 75 "../include/pub_tool_errormgr.h"
extern void vgPlain_maybe_record_error ( ThreadId tid, ErrorKind ekind,
                                      Addr a, Char* s, void* extra );
# 85 "../include/pub_tool_errormgr.h"
extern Bool vgPlain_unique_error ( ThreadId tid, ErrorKind ekind,
                                Addr a, Char* s, void* extra,
                                ExeContext* where, Bool print_error,
                                Bool allow_GDB_attach, Bool count_error );
# 97 "../include/pub_tool_errormgr.h"
extern Bool vgPlain_get_line ( Int fd, Char** bufpp, SizeT* nBufp, Int* lineno );
# 107 "../include/pub_tool_errormgr.h"
typedef
   Int
   SuppKind;






typedef
   struct _Supp
   Supp;


SuppKind vgPlain_get_supp_kind ( Supp* su );
Char* vgPlain_get_supp_string ( Supp* su );
void* vgPlain_get_supp_extra ( Supp* su );


void vgPlain_set_supp_kind ( Supp* su, SuppKind suppkind );

void vgPlain_set_supp_string ( Supp* su, Char* string );
void vgPlain_set_supp_extra ( Supp* su, void* extra );
# 41 "pub_core_errormgr.h" 2


typedef
   enum {



      ThreadErr = -1,
   }
   CoreErrorKind;

extern void vgPlain_load_suppressions ( void );





extern void vgPlain_show_all_errors ( Int verbosity, Bool xml );


extern void vgPlain_show_last_error ( void );

extern void vgPlain_show_error_counts_as_XML ( void );

extern Bool vgPlain_is_action_requested ( Char* action, Bool* clo );

extern Bool vgPlain_showing_core_errors ( void );

extern UInt vgPlain_get_n_errs_found ( void );
extern UInt vgPlain_get_n_errs_shown ( void );

extern void vgPlain_print_errormgr_stats ( void );
# 43 "m_main.c" 2
# 1 "pub_core_execontext.h" 1
# 41 "pub_core_execontext.h"
# 1 "../include/pub_tool_execontext.h" 1
# 42 "pub_core_execontext.h" 2





extern void vgPlain_print_ExeContext_stats ( void );





extern
              Addr* vgPlain_get_ExeContext_StackTrace ( ExeContext* e );
# 44 "m_main.c" 2
# 1 "pub_core_gdbserver.h" 1
# 33 "pub_core_gdbserver.h"
# 1 "../include/pub_tool_gdbserver.h" 1
# 34 "../include/pub_tool_gdbserver.h"
# 1 "../VEX/pub/libvex_ir.h" 1
# 35 "../include/pub_tool_gdbserver.h" 2
# 57 "../include/pub_tool_gdbserver.h"
extern void vgPlain_gdbserver ( ThreadId tid );
# 67 "../include/pub_tool_gdbserver.h"
extern Int vgPlain_dyn_vgdb_error;
# 90 "../include/pub_tool_gdbserver.h"
typedef
   enum {
      software_breakpoint,
      hardware_breakpoint,
      write_watchpoint,
      read_watchpoint,
      access_watchpoint } PointKind;
extern char* vgPlain_ppPointKind (PointKind kind);
# 111 "../include/pub_tool_gdbserver.h"
extern Bool vgPlain_is_watched(PointKind kind, Addr addr, Int szB);

extern void vgPlain_needs_watchpoint (
# 127 "../include/pub_tool_gdbserver.h"
   Bool (*watchpoint) (PointKind kind, Bool insert, Addr addr, SizeT len)
);




extern UInt vgPlain_gdb_printf ( const HChar *format, ... ) __attribute__((format(__printf__, 1, 2)));
# 158 "../include/pub_tool_gdbserver.h"
typedef
   enum {
      kwd_report_none,
      kwd_report_all,
      kwd_report_duplicated_matches } kwd_report_error;
extern Int vgPlain_keyword_id (Char* keywords, Char* input_word,
                            kwd_report_error report);






extern void vgPlain_strtok_get_address_and_size (Addr* address,
                                              SizeT* szB,
                                              Char **ssaveptr);
# 34 "pub_core_gdbserver.h" 2



HChar* vgPlain_vgdb_prefix_default(void);






void vgPlain_gdbserver_prerun_action (ThreadId tid);




extern Bool vgPlain_gdbserver_activity (ThreadId tid);
# 71 "pub_core_gdbserver.h"
Bool vgPlain_gdbserver_point (PointKind kind, Bool insert,
                           Addr addr, int len);




extern void vgPlain_invoke_gdbserver ( int check );






extern Bool vgPlain_gdbserver_report_signal (Int signo, ThreadId tid);
# 115 "pub_core_gdbserver.h"
extern IRSB* vgPlain_instrument_for_gdbserver_if_needed
     (IRSB* sb_in,
      VexGuestLayout* layout,
      VexGuestExtents* vge,
      IRType gWordTy, IRType hWordTy);


typedef
   enum {
      orderly_finish,
      reset_after_error,
      reset_after_fork} FinishReason;


extern void vgPlain_gdbserver_status_output(void);
# 144 "pub_core_gdbserver.h"
typedef
   struct {

      volatile int written_by_vgdb;

      volatile int seen_by_valgrind;


      Addr32 invoke_gdbserver;



      Addr32 threads;
      int sizeof_ThreadState;
      int offset_status;
      int offset_lwpid;



      int vgdb_pid;
   } VgdbShared32;


typedef
   struct {
      volatile int written_by_vgdb;
      volatile int seen_by_valgrind;

      Addr64 invoke_gdbserver;

      Addr64 threads;
      int sizeof_ThreadState;
      int offset_status;
      int offset_lwpid;

      int vgdb_pid;
   } VgdbShared64;







typedef VgdbShared32 VgdbShared;
# 45 "m_main.c" 2
# 1 "pub_core_initimg.h" 1
# 43 "pub_core_initimg.h"
typedef struct _IICreateImageInfo IICreateImageInfo;
typedef struct _IIFinaliseImageInfo IIFinaliseImageInfo;






extern
IIFinaliseImageInfo vgPlain_ii_create_image( IICreateImageInfo );






extern
void vgPlain_ii_finalise_image( IIFinaliseImageInfo );
# 70 "pub_core_initimg.h"
struct _IICreateImageInfo {

   HChar* toolname;
   Addr sp_at_startup;
   Addr clstack_top;

   HChar** argv;
   HChar** envp;
};

struct _IIFinaliseImageInfo {

   SizeT clstack_max_size;
   Addr initial_client_SP;

   Addr initial_client_IP;
   Addr initial_client_TOC;
   UInt* client_auxv;
};
# 46 "m_main.c" 2
# 1 "pub_core_libcbase.h" 1
# 40 "pub_core_libcbase.h"
# 1 "../include/pub_tool_libcbase.h" 1
# 38 "../include/pub_tool_libcbase.h"
extern Bool vgPlain_isspace ( Char c );
extern Bool vgPlain_isdigit ( Char c );
extern Char vgPlain_tolower ( Char c );
# 64 "../include/pub_tool_libcbase.h"
extern Long vgPlain_strtoll10 ( Char* str, Char** endptr );
extern Long vgPlain_strtoll16 ( Char* str, Char** endptr );
extern ULong vgPlain_strtoull10 ( Char* str, Char** endptr );
extern ULong vgPlain_strtoull16 ( Char* str, Char** endptr );





extern double vgPlain_strtod ( Char* str, Char** endptr );
# 85 "../include/pub_tool_libcbase.h"
extern SizeT vgPlain_strlen ( const Char* str );
extern Char* vgPlain_strcat ( Char* dest, const Char* src );
extern Char* vgPlain_strncat ( Char* dest, const Char* src, SizeT n );
extern Char* vgPlain_strpbrk ( const Char* s, const Char* accpt );
extern Char* vgPlain_strcpy ( Char* dest, const Char* src );
extern Char* vgPlain_strncpy ( Char* dest, const Char* src, SizeT ndest );
extern Int vgPlain_strcmp ( const Char* s1, const Char* s2 );
extern Int vgPlain_strcasecmp ( const Char* s1, const Char* s2 );
extern Int vgPlain_strncmp ( const Char* s1, const Char* s2, SizeT nmax );
extern Int vgPlain_strncasecmp ( const Char* s1, const Char* s2, SizeT nmax );
extern Char* vgPlain_strstr ( const Char* haystack, Char* needle );
extern Char* vgPlain_strcasestr ( const Char* haystack, Char* needle );
extern Char* vgPlain_strchr ( const Char* s, Char c );
extern Char* vgPlain_strrchr ( const Char* s, Char c );
extern SizeT vgPlain_strspn ( const Char* s, const Char* accpt );
extern SizeT vgPlain_strcspn ( const Char* s, const char* reject );


extern Char* vgPlain_strtok_r (Char* s, const Char* delim, Char** saveptr);
extern Char* vgPlain_strtok (Char* s, const Char* delim);





extern Bool vgPlain_parse_Addr ( UChar** ppc, Addr* result );



extern void vgPlain_strncpy_safely ( Char* dest, const Char* src, SizeT ndest );





extern void* vgPlain_memcpy ( void *d, const void *s, SizeT sz );
extern void* vgPlain_memmove( void *d, const void *s, SizeT sz );
extern void* vgPlain_memset ( void *s, Int c, SizeT sz );
extern Int vgPlain_memcmp ( const void* s1, const void* s2, SizeT n );





inline __attribute__((always_inline))
static void vgPlain_bzero_inline ( void* s, SizeT sz )
{
   if (__builtin_expect(!!(0 == (((Addr)sz) & (Addr)(sizeof(UWord)-1))), 1)
       && __builtin_expect(!!(0 == (((Addr)s) & (Addr)(sizeof(UWord)-1))), 1)) {
      UWord* p = (UWord*)s;
      switch (sz / (SizeT)sizeof(UWord)) {
          case 8: p[0] = p[1] = p[2] = p[3]
                  = p[4] = p[5] = p[6] = p[7] = 0UL; return;
          case 7: p[0] = p[1] = p[2] = p[3]
                  = p[4] = p[5] = p[6] = 0UL; return;
          case 6: p[0] = p[1] = p[2] = p[3]
                  = p[4] = p[5] = 0UL; return;
          case 5: p[0] = p[1] = p[2] = p[3] = p[4] = 0UL; return;
          case 4: p[0] = p[1] = p[2] = p[3] = 0UL; return;
          case 3: p[0] = p[1] = p[2] = 0UL; return;
          case 2: p[0] = p[1] = 0UL; return;
          case 1: p[0] = 0UL; return;
          case 0: return;
          default: break;
      }
   }
   vgPlain_memset(s, 0, sz);
}
# 181 "../include/pub_tool_libcbase.h"
extern void vgPlain_ssort( void* base, SizeT nmemb, SizeT size,
                        Int (*compar)(void*, void*) );



extern Int vgPlain_log2 ( UInt x );


extern Int vgPlain_log2_64( ULong x );




extern UInt vgPlain_random ( UInt* pSeed );
# 41 "pub_core_libcbase.h" 2
# 47 "m_main.c" 2
# 1 "pub_core_libcassert.h" 1
# 39 "pub_core_libcassert.h"
# 1 "../include/pub_tool_libcassert.h" 1
# 50 "../include/pub_tool_libcassert.h"
__attribute__ ((__noreturn__))
extern void vgPlain_exit( Int status );


__attribute__ ((__noreturn__))
extern void vgPlain_tool_panic ( Char* str );

__attribute__ ((__noreturn__))
extern void vgPlain_assert_fail ( Bool isCore, const Char* expr, const Char* file,
                               Int line, const Char* fn,
                               const HChar* format, ... );
# 40 "pub_core_libcassert.h" 2
# 63 "pub_core_libcassert.h"
__attribute__ ((__noreturn__))
extern void vgPlain_core_panic ( Char* str );
__attribute__ ((__noreturn__))
extern void vgPlain_core_panic_at ( Char* str, UnwindStartRegs* );



extern void vgPlain_unimplemented ( Char* msg )
            __attribute__((__noreturn__));


extern void vgPlain_show_sched_status ( void );
# 48 "m_main.c" 2
# 1 "pub_core_libcfile.h" 1
# 40 "pub_core_libcfile.h"
# 1 "../include/pub_tool_libcfile.h" 1
# 52 "../include/pub_tool_libcfile.h"
struct vg_stat {
   ULong dev;
   ULong ino;
   ULong nlink;
   UInt mode;
   UInt uid;
   UInt gid;
   ULong rdev;
   Long size;
   ULong blksize;
   ULong blocks;
   ULong atime;
   ULong atime_nsec;
   ULong mtime;
   ULong mtime_nsec;
   ULong ctime;
   ULong ctime_nsec;
};

extern SysRes vgPlain_mknod ( const Char* pathname, Int mode, UWord dev );
extern SysRes vgPlain_open ( const Char* pathname, Int flags, Int mode );


extern Int vgPlain_fd_open (const Char* pathname, Int flags, Int mode);
extern void vgPlain_close ( Int fd );
extern Int vgPlain_read ( Int fd, void* buf, Int count);
extern Int vgPlain_write ( Int fd, const void* buf, Int count);
extern Int vgPlain_pipe ( Int fd[2] );
extern Off64T vgPlain_lseek ( Int fd, Off64T offset, Int whence );

extern SysRes vgPlain_stat ( const Char* file_name, struct vg_stat* buf );
extern Int vgPlain_fstat ( Int fd, struct vg_stat* buf );
extern SysRes vgPlain_dup ( Int oldfd );
extern SysRes vgPlain_dup2 ( Int oldfd, Int newfd );
extern Int vgPlain_rename ( const Char* old_name, const Char* new_name );
extern Int vgPlain_unlink ( const Char* file_name );

extern Int vgPlain_poll (struct vki_pollfd *fds, Int nfds, Int timeout);

extern Int vgPlain_readlink( const Char* path, Char* buf, UInt bufsize );
extern Int vgPlain_getdents( Int fd, struct vki_dirent *dirp, UInt count );

extern Char* vgPlain_basename( const Char* path );
extern Char* vgPlain_dirname ( const Char* path );


extern const HChar* vgPlain_tmpdir(void);



extern Bool vgPlain_get_startup_wd ( Char* buf, SizeT size );
# 41 "pub_core_libcfile.h" 2


extern Int vgPlain_safe_fd ( Int oldfd );
extern Int vgPlain_fcntl ( Int fd, Int cmd, Addr arg );


extern Bool vgPlain_resolve_filename ( Int fd, HChar* buf, Int n_buf );


extern Long vgPlain_fsize ( Int fd );


extern Bool vgPlain_is_dir ( const HChar* f );





extern Int vgPlain_connect_via_socket( UChar* str );

extern UInt vgPlain_htonl ( UInt x );
extern UInt vgPlain_ntohl ( UInt x );
extern UShort vgPlain_htons ( UShort x );
extern UShort vgPlain_ntohs ( UShort x );

extern Int vgPlain_socket ( Int domain, Int type, Int protocol );

extern Int vgPlain_write_socket( Int sd, void *msg, Int count );
extern Int vgPlain_getsockname ( Int sd, struct vki_sockaddr *name, Int *namelen );
extern Int vgPlain_getpeername ( Int sd, struct vki_sockaddr *name, Int *namelen );
extern Int vgPlain_getsockopt ( Int sd, Int level, Int optname,
                              void *optval, Int *optlen );

extern Int vgPlain_access ( const HChar* path, Bool irusr, Bool iwusr,
                                            Bool ixusr );


extern Int vgPlain_check_executable( Bool* is_setuid,
                                 const HChar* f, Bool allow_setuid);





extern SysRes vgPlain_pread ( Int fd, void* buf, Int count, OffT offset );





extern Int vgPlain_mkstemp ( HChar* part_of_name, HChar* fullname );







extern Bool vgPlain_record_startup_wd ( void );
# 49 "m_main.c" 2
# 1 "pub_core_libcprint.h" 1
# 39 "pub_core_libcprint.h"
# 1 "../include/pub_tool_libcprint.h" 1
# 38 "../include/pub_tool_libcprint.h"
extern UInt vgPlain_sprintf ( Char* buf, const HChar* format, ... )
                          __attribute__((format(__printf__, 2, 3)));

extern UInt vgPlain_vsprintf ( Char* buf, const HChar* format, va_list vargs )
                          __attribute__((format(__printf__, 2, 0)));

extern UInt vgPlain_snprintf ( Char* buf, Int size,
                                       const HChar *format, ... )
                          __attribute__((format(__printf__, 3, 4)));

extern UInt vgPlain_vsnprintf( Char* buf, Int size,
                                       const HChar *format, va_list vargs )
                          __attribute__((format(__printf__, 3, 0)));



extern void vgPlain_percentify(ULong n, ULong m, UInt d, Int n_buf, char buf[]);
# 73 "../include/pub_tool_libcprint.h"
typedef
   enum {
      Vg_FailMsg,
      Vg_UserMsg,
      Vg_DebugMsg,
      Vg_ClientMsg
   }
   VgMsgKind;



extern UInt vgPlain_printf ( const HChar *format, ... )
                          __attribute__((format(__printf__, 1, 2)));
extern UInt vgPlain_vprintf ( const HChar *format, va_list vargs )
                          __attribute__((format(__printf__, 1, 0)));

extern UInt vgPlain_printf_xml ( const HChar *format, ... )
                             __attribute__((format(__printf__, 1, 2)));

extern UInt vgPlain_vprintf_xml ( const HChar *format, va_list vargs )
                             __attribute__((format(__printf__, 1, 0)));



extern void vgPlain_vcbprintf( void(*char_sink)(HChar, void* opaque),
                            void* opaque,
                            const HChar* format, va_list vargs );

extern UInt vgPlain_message( VgMsgKind kind, const HChar* format, ... )
   __attribute__((format(__printf__, 2, 3)));

extern UInt vgPlain_vmessage( VgMsgKind kind, const HChar* format, va_list vargs )
   __attribute__((format(__printf__, 2, 0)));





extern UInt vgPlain_fmsg( const HChar* format, ... ) __attribute__((format(__printf__, 1, 2)));






__attribute__((noreturn))
extern void vgPlain_fmsg_bad_option ( HChar* opt, const HChar* format, ... )
   __attribute__((format(__printf__, 2, 3)));




extern UInt vgPlain_umsg( const HChar* format, ... ) __attribute__((format(__printf__, 1, 2)));


extern UInt vgPlain_dmsg( const HChar* format, ... ) __attribute__((format(__printf__, 1, 2)));


extern void vgPlain_message_flush ( void );
# 40 "pub_core_libcprint.h" 2



typedef
   struct { Int fd; Bool is_socket; }
   OutputSink;


extern OutputSink vgPlain_log_output_sink;
extern OutputSink vgPlain_xml_output_sink;





void vgPlain_elapsed_wallclock_time ( HChar* buf );



__attribute__((noreturn))
extern void vgPlain_err_missing_prog ( void );



__attribute__((noreturn))
extern void vgPlain_err_config_error ( Char* format, ... );
# 50 "m_main.c" 2
# 1 "pub_core_libcproc.h" 1
# 39 "pub_core_libcproc.h"
# 1 "../config.h" 1
# 40 "pub_core_libcproc.h" 2
# 1 "../include/pub_tool_libcproc.h" 1
# 39 "../include/pub_tool_libcproc.h"
extern Char** vgPlain_client_envp;


extern Char* vgPlain_getenv ( Char* name );


extern const Char *vgPlain_libdir;



extern const Char* vgPlain_LD_PRELOAD_var_name;





extern Int vgPlain_waitpid( Int pid, Int *status, Int options );
extern Int vgPlain_system ( Char* cmd );
extern Int vgPlain_fork ( void);
extern void vgPlain_execv ( Char* filename, Char** argv );





extern Int vgPlain_getrlimit ( Int resource, struct vki_rlimit *rlim );
extern Int vgPlain_setrlimit ( Int resource, const struct vki_rlimit *rlim );
extern Int vgPlain_prctl (Int option,
                       ULong arg2, ULong arg3, ULong arg4, ULong arg5);





extern Int vgPlain_gettid ( void );
extern Int vgPlain_getpid ( void );
extern Int vgPlain_getppid ( void );
extern Int vgPlain_getpgrp ( void );
extern Int vgPlain_geteuid ( void );
extern Int vgPlain_getegid ( void );
# 87 "../include/pub_tool_libcproc.h"
extern UInt vgPlain_read_millisecond_timer ( void );





typedef void (*vg_atfork_t)(ThreadId);
extern void vgPlain_atfork(vg_atfork_t pre, vg_atfork_t parent, vg_atfork_t child);
# 41 "pub_core_libcproc.h" 2
# 72 "pub_core_libcproc.h"
extern Char **vgPlain_env_setenv ( Char ***envp, const Char* varname,
                                  const Char *val );
extern void vgPlain_env_unsetenv ( Char **env, const Char *varname );
extern void vgPlain_env_remove_valgrind_env_stuff ( Char** env );
extern Char **vgPlain_env_clone ( Char **env_clone );


extern Int vgPlain_getgroups( Int size, UInt* list );
extern Int vgPlain_ptrace( Int request, Int pid, void *addr, void *data );


extern void vgPlain_do_atfork_pre ( ThreadId tid );
extern void vgPlain_do_atfork_parent ( ThreadId tid );
extern void vgPlain_do_atfork_child ( ThreadId tid );


extern void vgPlain_invalidate_icache ( void *ptr, SizeT nbytes );
# 51 "m_main.c" 2
# 1 "pub_core_libcsignal.h" 1
# 38 "pub_core_libcsignal.h"
# 1 "../include/pub_tool_libcsignal.h" 1
# 40 "../include/pub_tool_libcsignal.h"
extern Int vgPlain_sigprocmask ( Int how, const vki_sigset_t* set,
                              vki_sigset_t* oldset );
# 39 "pub_core_libcsignal.h" 2







extern Int vgPlain_sigfillset ( vki_sigset_t* set );
extern Int vgPlain_sigemptyset ( vki_sigset_t* set );

extern Bool vgPlain_isfullsigset ( const vki_sigset_t* set );
extern Bool vgPlain_isemptysigset ( const vki_sigset_t* set );
extern Bool vgPlain_iseqsigset ( const vki_sigset_t* set1,
                                 const vki_sigset_t* set2 );

extern Int vgPlain_sigaddset ( vki_sigset_t* set, Int signum );
extern Int vgPlain_sigdelset ( vki_sigset_t* set, Int signum );
extern Int vgPlain_sigismember ( const vki_sigset_t* set, Int signum );

extern void vgPlain_sigaddset_from_set ( vki_sigset_t* dst, vki_sigset_t* src );
extern void vgPlain_sigdelset_from_set ( vki_sigset_t* dst, vki_sigset_t* src );
extern void vgPlain_sigintersectset ( vki_sigset_t* dst, vki_sigset_t* src );
extern void vgPlain_sigcomplementset ( vki_sigset_t* dst, vki_sigset_t* src );




extern Int vgPlain_sigaction ( Int signum,
                              const vki_sigaction_toK_t* act,
                              vki_sigaction_fromK_t* oldact );





extern void vgPlain_convert_sigaction_fromK_to_toK(
               vki_sigaction_fromK_t*, vki_sigaction_toK_t*);


extern Int vgPlain_kill ( Int pid, Int signo );
extern Int vgPlain_tkill ( Int lwpid, Int signo );
# 90 "pub_core_libcsignal.h"
extern Int vgPlain_sigtimedwait_zero( const vki_sigset_t *, vki_siginfo_t * );
# 52 "m_main.c" 2
# 1 "pub_core_syscall.h" 1
# 47 "pub_core_syscall.h"
extern SysRes vgPlain_do_syscall ( UWord sysno,
                                UWord, UWord, UWord,
                                UWord, UWord, UWord,
                                UWord, UWord );
# 72 "pub_core_syscall.h"
extern SysRes vgPlain_mk_SysRes_x86_linux ( Int val );
extern SysRes vgPlain_mk_SysRes_amd64_linux ( Long val );
extern SysRes vgPlain_mk_SysRes_ppc32_linux ( UInt val, UInt cr0so );
extern SysRes vgPlain_mk_SysRes_ppc64_linux ( ULong val, ULong cr0so );
extern SysRes vgPlain_mk_SysRes_arm_linux ( Int val );
extern SysRes vgPlain_mk_SysRes_x86_darwin ( UChar scclass, Bool isErr,
                                           UInt wHI, UInt wLO );
extern SysRes vgPlain_mk_SysRes_amd64_darwin( UChar scclass, Bool isErr,
                                           ULong wHI, ULong wLO );
extern SysRes vgPlain_mk_SysRes_s390x_linux ( Long val );
extern SysRes vgPlain_mk_SysRes_mips32_linux( UWord v0, UWord v1,
                                           UWord a3 );
extern SysRes vgPlain_mk_SysRes_Error ( UWord val );
extern SysRes vgPlain_mk_SysRes_Success ( UWord val );







extern const HChar* vgPlain_strerror ( UWord errnum );
# 53 "m_main.c" 2
# 1 "pub_core_mach.h" 1
# 54 "m_main.c" 2
# 1 "pub_core_machine.h" 1
# 40 "pub_core_machine.h"
# 1 "../include/pub_tool_machine.h" 1
# 99 "../include/pub_tool_machine.h"
Addr vgPlain_get_IP ( ThreadId tid );
Addr vgPlain_get_SP ( ThreadId tid );
# 109 "../include/pub_tool_machine.h"
void
vgPlain_get_shadow_regs_area ( ThreadId tid,
                                   UChar* dst,
                                   Int shadowNo, PtrdiffT offset, SizeT size );
void
vgPlain_set_shadow_regs_area ( ThreadId tid,
                                   Int shadowNo, PtrdiffT offset, SizeT size,
                                   const UChar* src );



void vgPlain_set_syscall_return_shadows ( ThreadId tid,

                                       UWord s1res, UWord s2res,

                                       UWord s1err, UWord s2err );





extern void vgPlain_apply_to_GP_regs(void (*f)(ThreadId tid,
                                            HChar* regname, UWord val));




extern void vgPlain_thread_stack_reset_iter ( ThreadId* tid );
extern Bool vgPlain_thread_stack_next ( ThreadId* tid,
                                                  Addr* stack_min,
                                                  Addr* stack_max );


extern Addr vgPlain_thread_get_stack_max ( ThreadId tid );


extern SizeT vgPlain_thread_get_stack_size ( ThreadId tid );



extern Addr vgPlain_thread_get_altstack_min ( ThreadId tid );



extern SizeT vgPlain_thread_get_altstack_size ( ThreadId tid );





extern void* vgPlain_fnptr_to_fnentry( void* );





extern Int vgPlain_machine_get_size_of_largest_guest_register ( void );
# 41 "pub_core_machine.h" 2
# 139 "pub_core_machine.h"
Addr vgPlain_get_FP ( ThreadId tid );

void vgPlain_set_IP ( ThreadId tid, Addr encip );
void vgPlain_set_SP ( ThreadId tid, Addr sp );





void vgPlain_get_UnwindStartRegs ( UnwindStartRegs* regs,
                                ThreadId tid );
# 200 "pub_core_machine.h"
extern Bool vgPlain_machine_get_hwcaps( void );


extern void vgPlain_machine_get_VexArchInfo( VexArch*,
                                                 VexArchInfo* );
# 223 "pub_core_machine.h"
extern UInt vgPlain_machine_x86_have_mxcsr;
# 55 "m_main.c" 2
# 1 "pub_core_mallocfree.h" 1
# 34 "pub_core_mallocfree.h"
# 1 "../include/pub_tool_mallocfree.h" 1
# 40 "../include/pub_tool_mallocfree.h"
extern void* vgPlain_malloc ( HChar* cc, SizeT nbytes );
extern void vgPlain_free ( void* p );
extern void* vgPlain_calloc ( HChar* cc, SizeT n, SizeT bytes_per_elem );
extern void* vgPlain_realloc ( HChar* cc, void* p, SizeT size );
extern Char* vgPlain_strdup ( HChar* cc, const Char* s );



extern SizeT vgPlain_malloc_usable_size( void* p );







extern SizeT vgPlain_malloc_effective_client_redzone_size(void);



__attribute__((noreturn))
extern void vgPlain_out_of_memory_NORETURN ( HChar* who, SizeT szB );
# 35 "pub_core_mallocfree.h" 2
# 56 "pub_core_mallocfree.h"
typedef Int ArenaId;
# 93 "pub_core_mallocfree.h"
struct vg_mallinfo {
   int arena;
   int ordblks;
   int smblks;
   int hblks;
   int hblkhd;
   int usmblks;
   int fsmblks;
   int uordblks;
   int fordblks;
   int keepcost;
};

extern void* vgPlain_arena_malloc ( ArenaId arena, HChar* cc, SizeT nbytes );
extern void vgPlain_arena_free ( ArenaId arena, void* ptr );
extern void* vgPlain_arena_calloc ( ArenaId arena, HChar* cc,
                                  SizeT nmemb, SizeT bytes_per_memb );
extern void* vgPlain_arena_realloc ( ArenaId arena, HChar* cc,
                                  void* ptr, SizeT size );
extern void* vgPlain_arena_memalign( ArenaId aid, HChar* cc,
                                  SizeT req_alignB, SizeT req_pszB );
extern Char* vgPlain_arena_strdup ( ArenaId aid, HChar* cc,
                                  const Char* s);

extern SizeT vgPlain_arena_malloc_usable_size ( ArenaId aid, void* payload );

extern void vgPlain_mallinfo ( ThreadId tid, struct vg_mallinfo* mi );

extern void vgPlain_sanity_check_malloc_all ( void );

extern void vgPlain_print_all_arena_stats ( void );

extern void vgPlain_print_arena_cc_analysis ( void );
# 56 "m_main.c" 2
# 1 "pub_core_options.h" 1
# 40 "pub_core_options.h"
# 1 "../include/pub_tool_options.h" 1
# 146 "../include/pub_tool_options.h"
extern Int vgPlain_clo_verbosity;


extern Bool vgPlain_clo_stats;





extern Int vgPlain_clo_vgdb_error;




extern Bool vgPlain_clo_xml;



extern HChar* vgPlain_clo_xml_user_comment;



extern VexControl vgPlain_clo_vex_control;


extern Int vgPlain_clo_backtrace_size;


extern Bool vgPlain_clo_show_below_main;
# 195 "../include/pub_tool_options.h"
extern Char* vgPlain_expand_file_name(Char* option_name, Char* format);
# 41 "pub_core_options.h" 2
# 52 "pub_core_options.h"
extern Bool vgPlain_clo_error_limit;



extern Int vgPlain_clo_error_exitcode;

typedef
   enum {
      Vg_VgdbNo,
      Vg_VgdbYes,
      Vg_VgdbFull,


   }
   VgVgdb;

extern VgVgdb vgPlain_clo_vgdb;

extern Int vgPlain_clo_vgdb_poll;

extern HChar* vgPlain_clo_vgdb_prefix;


extern Bool vgPlain_clo_vgdb_shadow_registers;


extern Bool vgPlain_clo_db_attach;

extern Char* vgPlain_clo_db_command;


extern Int vgPlain_clo_gen_suppressions;

extern Int vgPlain_clo_sanity_level;

extern Bool vgPlain_clo_demangle;




extern HChar* vgPlain_clo_soname_synonyms;
extern Bool vgPlain_clo_trace_children;


extern HChar* vgPlain_clo_trace_children_skip;



extern HChar* vgPlain_clo_trace_children_skip_by_arg;






extern Bool vgPlain_clo_child_silent_after_fork;



extern Char* vgPlain_clo_log_fname_expanded;
extern Char* vgPlain_clo_xml_fname_expanded;


extern Bool vgPlain_clo_time_stamp;


extern Int vgPlain_clo_input_fd;


extern Int vgPlain_clo_n_suppressions;

extern Char* vgPlain_clo_suppressions[100];


extern Int vgPlain_clo_n_fullpath_after;
extern Char* vgPlain_clo_fullpath_after[100];


extern UChar vgPlain_clo_trace_flags;

extern UChar vgPlain_clo_profile_flags;

extern Int vgPlain_clo_trace_notbelow;

extern Int vgPlain_clo_trace_notabove;

extern Bool vgPlain_clo_trace_syscalls;

extern Bool vgPlain_clo_trace_signals;

extern Bool vgPlain_clo_trace_symtab;

extern HChar* vgPlain_clo_trace_symtab_patt;

extern Bool vgPlain_clo_trace_cfi;

extern Bool vgPlain_clo_debug_dump_syms;

extern Bool vgPlain_clo_debug_dump_line;

extern Bool vgPlain_clo_debug_dump_frames;

extern Bool vgPlain_clo_trace_redir;

enum FairSchedType { disable_fair_sched, enable_fair_sched, try_fair_sched };
extern enum FairSchedType vgPlain_clo_fair_sched;

extern Bool vgPlain_clo_trace_sched;

extern Bool vgPlain_clo_profile_heap;
# 170 "pub_core_options.h"
extern Int vgPlain_clo_core_redzone_size;


extern Int vgPlain_clo_redzone_size;


extern Int vgPlain_clo_dump_error;

extern Char* vgPlain_clo_sim_hints;

extern Bool vgPlain_clo_sym_offsets;

extern Bool vgPlain_clo_read_var_info;

extern Char* vgPlain_clo_prefix_to_strip;
# 216 "pub_core_options.h"
extern Int vgPlain_clo_n_req_tsyms;
extern HChar* vgPlain_clo_req_tsyms[100];


extern Bool vgPlain_clo_track_fds;






extern Bool vgPlain_clo_run_libc_freeres;


extern Bool vgPlain_clo_show_emwarns;




extern Word vgPlain_clo_max_stackframe;


extern Word vgPlain_clo_main_stacksize;


extern Bool vgPlain_clo_wait_for_gdb;




typedef
   enum {
      Vg_SmcNone,
      Vg_SmcStack,

      Vg_SmcAll,
      Vg_SmcAllNonFile

   }
   VgSmc;



extern VgSmc vgPlain_clo_smc_check;



extern HChar* vgPlain_clo_kernel_variant;



extern Bool vgPlain_clo_dsymutil;







extern Bool vgPlain_should_we_trace_this_child ( HChar* child_exe_name,
                                              HChar** child_argv );
# 57 "m_main.c" 2
# 1 "pub_core_debuginfo.h" 1
# 40 "pub_core_debuginfo.h"
# 1 "../include/pub_tool_debuginfo.h" 1
# 44 "../include/pub_tool_debuginfo.h"
extern Bool vgPlain_get_filename ( Addr a, Char* filename, Int n_filename );
extern Bool vgPlain_get_fnname ( Addr a, Char* fnname, Int n_fnname );
extern Bool vgPlain_get_linenum ( Addr a, UInt* linenum );
extern Bool vgPlain_get_fnname_w_offset
                              ( Addr a, Char* fnname, Int n_fnname );
# 61 "../include/pub_tool_debuginfo.h"
extern Bool vgPlain_get_filename_linenum
                              ( Addr a,
                                       Char* filename, Int n_filename,
                                       Char* dirname, Int n_dirname,
                                       Bool* dirname_available,
                                       UInt* linenum );
# 75 "../include/pub_tool_debuginfo.h"
extern Bool vgPlain_get_fnname_if_entry ( Addr a, Char* fnname, Int n_fnname );

typedef
   enum {
      Vg_FnNameNormal,
      Vg_FnNameMain,
      Vg_FnNameBelowMain
   } Vg_FnNameKind;


extern Vg_FnNameKind vgPlain_get_fnname_kind ( Char* name );


extern Vg_FnNameKind vgPlain_get_fnname_kind_from_IP ( Addr ip );





extern Bool vgPlain_get_datasym_and_offset( Addr data_addr,
                                                Char* dname, Int n_dname,
                                                PtrdiffT* offset );
# 111 "../include/pub_tool_debuginfo.h"
Bool vgPlain_get_data_description(
                void* dname1v,
                void* dname2v,
        Addr data_addr
     );



extern Bool vgPlain_get_objname ( Addr a, Char* objname, Int n_objname );
# 128 "../include/pub_tool_debuginfo.h"
extern Char* vgPlain_describe_IP(Addr eip, Char* buf, Int n_buf);







typedef
   struct {
      PtrdiffT base;
      SizeT szB;
      Bool spRel;
      Bool isVec;
      HChar name[16];
   }
   StackBlock;

extern void*
             vgPlain_di_get_stack_blocks_at_ip( Addr ip, Bool arrays_only );
# 157 "../include/pub_tool_debuginfo.h"
typedef
   struct {
      Addr addr;
      SizeT szB;
      Bool isVec;
      HChar name[16];
      HChar soname[16];
   }
   GlobalBlock;

extern void*
vgPlain_di_get_global_blocks_from_dihandle ( ULong di_handle,
                                          Bool arrays_only );
# 178 "../include/pub_tool_debuginfo.h"
typedef struct _DebugInfo DebugInfo;



DebugInfo* vgPlain_find_DebugInfo ( Addr a );


Addr vgPlain_DebugInfo_get_text_avma ( const DebugInfo *di );
SizeT vgPlain_DebugInfo_get_text_size ( const DebugInfo *di );
Addr vgPlain_DebugInfo_get_plt_avma ( const DebugInfo *di );
SizeT vgPlain_DebugInfo_get_plt_size ( const DebugInfo *di );
Addr vgPlain_DebugInfo_get_gotplt_avma ( const DebugInfo *di );
SizeT vgPlain_DebugInfo_get_gotplt_size ( const DebugInfo *di );
const UChar* vgPlain_DebugInfo_get_soname ( const DebugInfo *di );
const UChar* vgPlain_DebugInfo_get_filename ( const DebugInfo *di );
PtrdiffT vgPlain_DebugInfo_get_text_bias ( const DebugInfo *di );
# 202 "../include/pub_tool_debuginfo.h"
const DebugInfo* vgPlain_next_DebugInfo ( const DebugInfo *di );
# 211 "../include/pub_tool_debuginfo.h"
Int vgPlain_DebugInfo_syms_howmany ( const DebugInfo *di );
void vgPlain_DebugInfo_syms_getidx ( const DebugInfo *di,
                                   Int idx,
                                          Addr* avma,
                                          Addr* tocptr,
                                          UInt* size,
                                          UChar** pri_name,
                                          UChar*** sec_names,
                                          Bool* isText,
                                          Bool* isIFunc );



typedef
   enum {
      Vg_SectUnknown,
      Vg_SectText,
      Vg_SectData,
      Vg_SectBSS,
      Vg_SectGOT,
      Vg_SectPLT,
      Vg_SectGOTPLT,
      Vg_SectOPD
   }
   VgSectKind;



const HChar* vgPlain_pp_SectKind( VgSectKind kind );





VgSectKind vgPlain_DebugInfo_sect_kind( UChar* name, SizeT n_name,
                                     Addr a);
# 41 "pub_core_debuginfo.h" 2


extern void vgPlain_di_initialise ( void );
# 66 "pub_core_debuginfo.h"
extern ULong vgPlain_di_notify_mmap( Addr a, Bool allow_SkFileV, Int use_fd );

extern void vgPlain_di_notify_munmap( Addr a, SizeT len );

extern void vgPlain_di_notify_mprotect( Addr a, SizeT len, UInt prot );


extern void vgPlain_di_notify_pdb_debuginfo( Int fd, Addr avma,
                                          SizeT total_size,
                                          PtrdiffT bias );


extern void vgPlain_di_notify_vm_protect( Addr a, SizeT len, UInt prot );


extern void vgPlain_di_discard_ALL_debuginfo( void );






extern
Bool vgPlain_get_fnname_raw ( Addr a, Char* buf, Int nbuf );



extern
Bool vgPlain_get_fnname_no_cxx_demangle ( Addr a, Char* buf, Int nbuf );




extern
Bool vgPlain_get_inst_offset_in_function( Addr a, PtrdiffT* offset );







typedef
   struct { Addr xip; Addr xsp; Addr xbp; }
   D3UnwindRegs;
# 131 "pub_core_debuginfo.h"
extern Bool vgPlain_use_CF_info ( D3UnwindRegs* uregs,
                               Addr min_accessible,
                               Addr max_accessible );



extern Bool vgPlain_use_FPO_info ( Addr* ipP,
                                       Addr* spP,
                                       Addr* fpP,
                                Addr min_accessible,
                                Addr max_accessible );




extern Addr vgPlain_get_tocptr ( Addr guest_code_addr );
# 155 "pub_core_debuginfo.h"
extern
Bool vgPlain_lookup_symbol_SLOW(UChar* sopatt, UChar* name, Addr* pEnt, Addr* pToc);
# 58 "m_main.c" 2
# 1 "pub_core_redir.h" 1
# 57 "pub_core_redir.h"
# 1 "../include/pub_tool_redir.h" 1
# 34 "../include/pub_tool_redir.h"
# 1 "../config.h" 1
# 35 "../include/pub_tool_redir.h" 2
# 58 "pub_core_redir.h" 2







extern void vgPlain_redir_notify_new_DebugInfo( DebugInfo* );



extern void vgPlain_redir_notify_delete_DebugInfo( DebugInfo* );


extern void vgPlain_redir_initialise( void );


extern void vgPlain_redir_add_ifunc_target( Addr old_from, Addr new_from );
# 86 "pub_core_redir.h"
extern Addr vgPlain_redir_do_lookup ( Addr orig, Bool* isWrap );
# 59 "m_main.c" 2
# 1 "pub_core_scheduler.h" 1
# 41 "pub_core_scheduler.h"
extern ThreadId vgPlain_alloc_ThreadState(void);


extern void vgPlain_exit_thread(ThreadId tid);




extern void vgPlain_get_thread_out_of_syscall(ThreadId tid);


extern void vgPlain_nuke_all_threads_except ( ThreadId me,
                                           VgSchedReturnCode reason );






extern void vgPlain_acquire_BigLock ( ThreadId tid, HChar* who );




extern void vgPlain_acquire_BigLock_LL ( HChar* who );
# 75 "pub_core_scheduler.h"
extern void vgPlain_release_BigLock ( ThreadId tid,
                                   ThreadStatus state, HChar* who );


extern void vgPlain_release_BigLock_LL ( HChar* who );


extern Bool vgPlain_owns_BigLock_LL ( ThreadId tid );



extern void vgPlain_vg_yield(void);


extern VgSchedReturnCode vgPlain_scheduler ( ThreadId tid );



extern ThreadId vgPlain_scheduler_init_phase1 ( void );



extern void vgPlain_scheduler_init_phase2 ( ThreadId main_tid,
                                         Addr clstack_end,
                                         SizeT clstack_size );



extern void vgPlain_disable_vgdb_poll (void );
extern void vgPlain_force_vgdb_poll ( void );


extern void vgPlain_print_scheduler_stats ( void );


extern Bool vgPlain_in_generated_code;


extern void vgPlain_sanity_check_general ( Bool force_expensive );
# 60 "m_main.c" 2
# 1 "pub_core_seqmatch.h" 1
# 45 "pub_core_seqmatch.h"
# 1 "../include/pub_tool_seqmatch.h" 1
# 79 "../include/pub_tool_seqmatch.h"
Bool vgPlain_generic_match (
        Bool matchAll,
        void* patt, SizeT szbPatt, UWord nPatt, UWord ixPatt,
        void* input, SizeT szbInput, UWord nInput, UWord ixInput,
        Bool (*pIsStar)(void*),
        Bool (*pIsQuery)(void*),
        Bool (*pattEQinp)(void*,void*,void*,UWord),
        void* inputCompleter
     );




Bool vgPlain_string_match ( const Char* pat, const Char* str );
# 46 "pub_core_seqmatch.h" 2
# 61 "m_main.c" 2
# 1 "pub_core_signals.h" 1
# 38 "pub_core_signals.h"
# 1 "../include/pub_tool_signals.h" 1
# 41 "../include/pub_tool_signals.h"
extern void vgPlain_set_fault_catcher(void (*catcher)(Int sig, Addr addr));
# 39 "pub_core_signals.h" 2


extern Int vgPlain_max_signal;


extern const Char *vgPlain_signame(Int sigNo);





extern void vgPlain_sigstartup_actions ( void );



extern void vgPlain_poll_signals ( ThreadId );


extern SysRes vgPlain_do_sys_sigaltstack ( ThreadId tid, vki_stack_t* ss,
                                                      vki_stack_t* oss );
extern SysRes vgPlain_do_sys_sigaction ( Int signo,
                                        const vki_sigaction_toK_t* new_act,
                                        vki_sigaction_fromK_t* old_act );
extern SysRes vgPlain_do_sys_sigprocmask ( ThreadId tid, Int how,
                                        vki_sigset_t* set,
                                        vki_sigset_t* oldset );

extern void vgPlain_clear_out_queued_signals
                  ( ThreadId tid, vki_sigset_t* saved_mask );

extern void vgPlain_kill_self(Int sigNo);




extern void vgPlain_synth_fault (ThreadId tid);
extern void vgPlain_synth_fault_mapping(ThreadId tid, Addr addr);
extern void vgPlain_synth_fault_perms (ThreadId tid, Addr addr);
extern void vgPlain_synth_sigill (ThreadId tid, Addr addr);
extern void vgPlain_synth_sigtrap (ThreadId tid);
extern void vgPlain_synth_sigbus (ThreadId tid);


extern Bool vgPlain_extend_stack(Addr addr, UInt maxsize);



extern void vgPlain_set_default_handler(Int sig);
# 62 "m_main.c" 2
# 1 "pub_core_stacks.h" 1
# 39 "pub_core_stacks.h"
extern UWord vgPlain_register_stack ( Addr start, Addr end );
extern void vgPlain_deregister_stack ( UWord id );
extern void vgPlain_change_stack ( UWord id, Addr start, Addr end );
extern void vgPlain_stack_limits ( Addr SP, Addr *start, Addr *end );

extern __attribute__((regparm(3)))
       void vgPlain_unknown_SP_update ( Addr old_SP, Addr new_SP, UInt otag );
# 63 "m_main.c" 2
# 1 "pub_core_syswrap.h" 1
# 41 "pub_core_syswrap.h"
extern void vgPlain_main_thread_wrapper_NORETURN(ThreadId tid);

extern void vgPlain_client_syscall ( ThreadId tid, UInt trc );

extern void vgPlain_post_syscall ( ThreadId tid );


extern void vgPlain_clear_syscallInfo ( Int tid );


extern void vgPlain_fixup_guest_state_after_syscall_interrupted(
               ThreadId tid,
               Addr ip,
               SysRes sysret,
               Bool restart
            );


extern void vgPlain_reap_threads(ThreadId self);


extern void vgPlain_cleanup_thread ( ThreadArchState* );


extern void vgPlain_init_preopened_fds ( void );
extern void vgPlain_show_open_fds ( void );







extern void (* vgPlain_address_of_m_main_shutdown_actions_NORETURN )
            (ThreadId,VgSchedReturnCode);
# 64 "m_main.c" 2
# 1 "pub_core_tooliface.h" 1
# 34 "pub_core_tooliface.h"
# 1 "../include/pub_tool_tooliface.h" 1
# 34 "../include/pub_tool_tooliface.h"
# 1 "../include/pub_tool_errormgr.h" 1
# 35 "../include/pub_tool_tooliface.h" 2
# 48 "../include/pub_tool_tooliface.h"
extern void (*vgPlain_tl_pre_clo_init) ( void );
# 65 "../include/pub_tool_tooliface.h"
typedef
   struct {
      Addr64 nraddr;
      Addr64 readdr;
      ThreadId tid;
   }
   VgCallbackClosure;

extern void vgPlain_basic_tool_funcs(


   void (*post_clo_init)(void),
# 219 "../include/pub_tool_tooliface.h"
   IRSB*(*instrument)(VgCallbackClosure* closure,
                      IRSB* sb_in,
                      VexGuestLayout* layout,
                      VexGuestExtents* vge,
                      IRType gWordTy,
                      IRType hWordTy),



   void (*fini)(Int)
);
# 245 "../include/pub_tool_tooliface.h"
extern void vgPlain_details_name ( Char* name );
extern void vgPlain_details_version ( Char* version );
extern void vgPlain_details_description ( Char* description );
extern void vgPlain_details_copyright_author ( Char* copyright_author );




extern void vgPlain_details_avg_translation_sizeB ( UInt size );



extern void vgPlain_details_bug_reports_to ( Char* bug_reports_to );





extern void vgPlain_needs_libc_freeres ( void );







extern void vgPlain_needs_core_errors ( void );






extern void vgPlain_needs_tool_errors (







   Bool (*eq_Error)(VgRes res, Error* e1, Error* e2),
# 296 "../include/pub_tool_tooliface.h"
   void (*before_pp_Error)(Error* err),


   void (*pp_Error)(Error* err),


   Bool show_ThreadIDs_for_errors,
# 311 "../include/pub_tool_tooliface.h"
   UInt (*update_extra)(Error* err),



   Bool (*recognised_suppression)(Char* name, Supp* su),






   Bool (*read_extra_suppression_info)(Int fd, Char** bufpp, SizeT* nBufp,
                                       Supp* su),




   Bool (*error_matches_suppression)(Error* err, Supp* su),




   Char* (*get_error_name)(Error* err),
# 344 "../include/pub_tool_tooliface.h"
   Bool (*print_extra_suppression_info)(Error* err,
                                               Char* buf, Int nBuf)
);
# 355 "../include/pub_tool_tooliface.h"
extern void vgPlain_needs_superblock_discards (
# 372 "../include/pub_tool_tooliface.h"
   void (*discard_superblock_info)(Addr64 orig_addr, VexGuestExtents extents)
);


extern void vgPlain_needs_command_line_options (
# 388 "../include/pub_tool_tooliface.h"
   Bool (*process_cmd_line_option)(Char* argv),


   void (*print_usage)(void),


   void (*print_debug_usage)(void)
);


extern void vgPlain_needs_client_requests (
# 410 "../include/pub_tool_tooliface.h"
   Bool (*handle_client_request)(ThreadId tid, UWord* arg_block, UWord* ret)
);
# 424 "../include/pub_tool_tooliface.h"
extern void vgPlain_needs_syscall_wrapper (
               void (* pre_syscall)(ThreadId tid, UInt syscallno,
                                    UWord* args, UInt nArgs),
               void (*post_syscall)(ThreadId tid, UInt syscallno,
                                    UWord* args, UInt nArgs, SysRes res)
);





extern void vgPlain_needs_sanity_checks (
   Bool(*cheap_sanity_check)(void),
   Bool(*expensive_sanity_check)(void)
);


extern void vgPlain_needs_var_info ( void );





extern void vgPlain_needs_malloc_replacement(
   void* (*pmalloc) ( ThreadId tid, SizeT n ),
   void* (*p__builtin_new) ( ThreadId tid, SizeT n ),
   void* (*p__builtin_vec_new) ( ThreadId tid, SizeT n ),
   void* (*pmemalign) ( ThreadId tid, SizeT align, SizeT n ),
   void* (*pcalloc) ( ThreadId tid, SizeT nmemb, SizeT size1 ),
   void (*pfree) ( ThreadId tid, void* p ),
   void (*p__builtin_delete) ( ThreadId tid, void* p ),
   void (*p__builtin_vec_delete) ( ThreadId tid, void* p ),
   void* (*prealloc) ( ThreadId tid, void* p, SizeT new_size ),
   SizeT (*pmalloc_usable_size) ( ThreadId tid, void* p),
   SizeT client_malloc_redzone_szB
);




extern void vgPlain_needs_xml_output ( void );




extern void vgPlain_needs_final_IR_tidy_pass ( IRSB*(*final_tidy)(IRSB*) );







typedef
   enum { Vg_CoreStartup=1, Vg_CoreSignal, Vg_CoreSysCall,





          Vg_CoreSysCallArgInMem,
          Vg_CoreTranslate, Vg_CoreClientReq
   } CorePart;
# 512 "../include/pub_tool_tooliface.h"
void vgPlain_track_new_mem_startup (void(*f)(Addr a, SizeT len,
                                              Bool rr, Bool ww, Bool xx,
                                              ULong di_handle));
void vgPlain_track_new_mem_stack_signal(void(*f)(Addr a, SizeT len, ThreadId tid));
void vgPlain_track_new_mem_brk (void(*f)(Addr a, SizeT len, ThreadId tid));
void vgPlain_track_new_mem_mmap (void(*f)(Addr a, SizeT len,
                                              Bool rr, Bool ww, Bool xx,
                                              ULong di_handle));

void vgPlain_track_copy_mem_remap (void(*f)(Addr from, Addr to, SizeT len));
void vgPlain_track_change_mem_mprotect (void(*f)(Addr a, SizeT len,
                                              Bool rr, Bool ww, Bool xx));
void vgPlain_track_die_mem_stack_signal(void(*f)(Addr a, SizeT len));
void vgPlain_track_die_mem_brk (void(*f)(Addr a, SizeT len));
void vgPlain_track_die_mem_munmap (void(*f)(Addr a, SizeT len));
# 548 "../include/pub_tool_tooliface.h"
void vgPlain_track_new_mem_stack_4_w_ECU (__attribute__((regparm(2))) void(*f)(Addr new_ESP, UInt ecu));
void vgPlain_track_new_mem_stack_8_w_ECU (__attribute__((regparm(2))) void(*f)(Addr new_ESP, UInt ecu));
void vgPlain_track_new_mem_stack_12_w_ECU (__attribute__((regparm(2))) void(*f)(Addr new_ESP, UInt ecu));
void vgPlain_track_new_mem_stack_16_w_ECU (__attribute__((regparm(2))) void(*f)(Addr new_ESP, UInt ecu));
void vgPlain_track_new_mem_stack_32_w_ECU (__attribute__((regparm(2))) void(*f)(Addr new_ESP, UInt ecu));
void vgPlain_track_new_mem_stack_112_w_ECU(__attribute__((regparm(2))) void(*f)(Addr new_ESP, UInt ecu));
void vgPlain_track_new_mem_stack_128_w_ECU(__attribute__((regparm(2))) void(*f)(Addr new_ESP, UInt ecu));
void vgPlain_track_new_mem_stack_144_w_ECU(__attribute__((regparm(2))) void(*f)(Addr new_ESP, UInt ecu));
void vgPlain_track_new_mem_stack_160_w_ECU(__attribute__((regparm(2))) void(*f)(Addr new_ESP, UInt ecu));
void vgPlain_track_new_mem_stack_w_ECU (void(*f)(Addr a, SizeT len,
                                                                       UInt ecu));

void vgPlain_track_new_mem_stack_4 (__attribute__((regparm(1))) void(*f)(Addr new_ESP));
void vgPlain_track_new_mem_stack_8 (__attribute__((regparm(1))) void(*f)(Addr new_ESP));
void vgPlain_track_new_mem_stack_12 (__attribute__((regparm(1))) void(*f)(Addr new_ESP));
void vgPlain_track_new_mem_stack_16 (__attribute__((regparm(1))) void(*f)(Addr new_ESP));
void vgPlain_track_new_mem_stack_32 (__attribute__((regparm(1))) void(*f)(Addr new_ESP));
void vgPlain_track_new_mem_stack_112(__attribute__((regparm(1))) void(*f)(Addr new_ESP));
void vgPlain_track_new_mem_stack_128(__attribute__((regparm(1))) void(*f)(Addr new_ESP));
void vgPlain_track_new_mem_stack_144(__attribute__((regparm(1))) void(*f)(Addr new_ESP));
void vgPlain_track_new_mem_stack_160(__attribute__((regparm(1))) void(*f)(Addr new_ESP));
void vgPlain_track_new_mem_stack (void(*f)(Addr a, SizeT len));

void vgPlain_track_die_mem_stack_4 (__attribute__((regparm(1))) void(*f)(Addr die_ESP));
void vgPlain_track_die_mem_stack_8 (__attribute__((regparm(1))) void(*f)(Addr die_ESP));
void vgPlain_track_die_mem_stack_12 (__attribute__((regparm(1))) void(*f)(Addr die_ESP));
void vgPlain_track_die_mem_stack_16 (__attribute__((regparm(1))) void(*f)(Addr die_ESP));
void vgPlain_track_die_mem_stack_32 (__attribute__((regparm(1))) void(*f)(Addr die_ESP));
void vgPlain_track_die_mem_stack_112(__attribute__((regparm(1))) void(*f)(Addr die_ESP));
void vgPlain_track_die_mem_stack_128(__attribute__((regparm(1))) void(*f)(Addr die_ESP));
void vgPlain_track_die_mem_stack_144(__attribute__((regparm(1))) void(*f)(Addr die_ESP));
void vgPlain_track_die_mem_stack_160(__attribute__((regparm(1))) void(*f)(Addr die_ESP));
void vgPlain_track_die_mem_stack (void(*f)(Addr a, SizeT len));


void vgPlain_track_ban_mem_stack (void(*f)(Addr a, SizeT len));


void vgPlain_track_pre_mem_read (void(*f)(CorePart part, ThreadId tid,
                                             Char* s, Addr a, SizeT size));
void vgPlain_track_pre_mem_read_asciiz(void(*f)(CorePart part, ThreadId tid,
                                             Char* s, Addr a));
void vgPlain_track_pre_mem_write (void(*f)(CorePart part, ThreadId tid,
                                             Char* s, Addr a, SizeT size));
void vgPlain_track_post_mem_write (void(*f)(CorePart part, ThreadId tid,
                                             Addr a, SizeT size));



void vgPlain_track_pre_reg_read (void(*f)(CorePart part, ThreadId tid,
                                        Char* s, PtrdiffT guest_state_offset,
                                        SizeT size));
void vgPlain_track_post_reg_write(void(*f)(CorePart part, ThreadId tid,
                                        PtrdiffT guest_state_offset,
                                        SizeT size));


void vgPlain_track_post_reg_write_clientcall_return(
      void(*f)(ThreadId tid, PtrdiffT guest_state_offset, SizeT size, Addr f));
# 621 "../include/pub_tool_tooliface.h"
void vgPlain_track_start_client_code(
        void(*f)(ThreadId tid, ULong blocks_dispatched)
     );
void vgPlain_track_stop_client_code(
        void(*f)(ThreadId tid, ULong blocks_dispatched)
     );
# 665 "../include/pub_tool_tooliface.h"
void vgPlain_track_pre_thread_ll_create (void(*f)(ThreadId tid, ThreadId child));
void vgPlain_track_pre_thread_first_insn(void(*f)(ThreadId tid));
void vgPlain_track_pre_thread_ll_exit (void(*f)(ThreadId tid));
# 676 "../include/pub_tool_tooliface.h"
void vgPlain_track_pre_deliver_signal (void(*f)(ThreadId tid, Int sigNo,
                                             Bool alt_stack));


void vgPlain_track_post_deliver_signal(void(*f)(ThreadId tid, Int sigNo));
# 35 "pub_core_tooliface.h" 2
# 64 "pub_core_tooliface.h"
typedef
   struct {
      Char* name;
      Char* version;
      Char* description;
      Char* copyright_author;
      Char* bug_reports_to;
      UInt avg_translation_sizeB;
   }
   VgDetails;

extern VgDetails vgPlain_details;





typedef
   struct {
      Bool libc_freeres;
      Bool core_errors;
      Bool tool_errors;
      Bool superblock_discards;
      Bool command_line_options;
      Bool client_requests;
      Bool syscall_wrapper;
      Bool sanity_checks;
      Bool var_info;
      Bool malloc_replacement;
      Bool xml_output;
      Bool final_IR_tidy_pass;
   }
   VgNeeds;

extern VgNeeds vgPlain_needs;





typedef struct {


   void (*tool_pre_clo_init) (void);
   void (*tool_post_clo_init)(void);
   IRSB* (*tool_instrument) (VgCallbackClosure*,
                               IRSB*,
                               VexGuestLayout*, VexGuestExtents*,
                               IRType, IRType);
   void (*tool_fini) (Int);





   Bool (*tool_eq_Error) (VgRes, Error*, Error*);
   void (*tool_before_pp_Error) (Error*);
   void (*tool_pp_Error) (Error*);
   Bool tool_show_ThreadIDs_for_errors;
   UInt (*tool_update_extra) (Error*);
   Bool (*tool_recognised_suppression) (Char*, Supp*);
   Bool (*tool_read_extra_suppression_info) (Int, Char**, SizeT*, Supp*);
   Bool (*tool_error_matches_suppression) (Error*, Supp*);
   Char* (*tool_get_error_name) (Error*);
   Bool (*tool_get_extra_suppression_info) (Error*, Char*,Int);


   void (*tool_discard_superblock_info)(Addr64, VexGuestExtents);


   Bool (*tool_process_cmd_line_option)(Char*);
   void (*tool_print_usage) (void);
   void (*tool_print_debug_usage) (void);


   Bool (*tool_handle_client_request)(ThreadId, UWord*, UWord*);


   void (*tool_pre_syscall) (ThreadId, UInt, UWord*, UInt);
   void (*tool_post_syscall)(ThreadId, UInt, UWord*, UInt, SysRes);


   Bool (*tool_cheap_sanity_check)(void);
   Bool (*tool_expensive_sanity_check)(void);


   void* (*tool_malloc) (ThreadId, SizeT);
   void* (*tool___builtin_new) (ThreadId, SizeT);
   void* (*tool___builtin_vec_new) (ThreadId, SizeT);
   void* (*tool_memalign) (ThreadId, SizeT, SizeT);
   void* (*tool_calloc) (ThreadId, SizeT, SizeT);
   void (*tool_free) (ThreadId, void*);
   void (*tool___builtin_delete) (ThreadId, void*);
   void (*tool___builtin_vec_delete)(ThreadId, void*);
   void* (*tool_realloc) (ThreadId, void*, SizeT);
   SizeT (*tool_malloc_usable_size) (ThreadId, void*);
   SizeT tool_client_redzone_szB;


   IRSB* (*tool_final_IR_tidy_pass) (IRSB*);





   void (*track_new_mem_startup) (Addr, SizeT, Bool, Bool, Bool, ULong);
   void (*track_new_mem_stack_signal)(Addr, SizeT, ThreadId);
   void (*track_new_mem_brk) (Addr, SizeT, ThreadId);
   void (*track_new_mem_mmap) (Addr, SizeT, Bool, Bool, Bool, ULong);

   void (*track_copy_mem_remap) (Addr src, Addr dst, SizeT);
   void (*track_change_mem_mprotect) (Addr, SizeT, Bool, Bool, Bool);
   void (*track_die_mem_stack_signal)(Addr, SizeT);
   void (*track_die_mem_brk) (Addr, SizeT);
   void (*track_die_mem_munmap) (Addr, SizeT);

   void __attribute__((regparm(2))) (*track_new_mem_stack_4_w_ECU) (Addr,UInt);
   void __attribute__((regparm(2))) (*track_new_mem_stack_8_w_ECU) (Addr,UInt);
   void __attribute__((regparm(2))) (*track_new_mem_stack_12_w_ECU) (Addr,UInt);
   void __attribute__((regparm(2))) (*track_new_mem_stack_16_w_ECU) (Addr,UInt);
   void __attribute__((regparm(2))) (*track_new_mem_stack_32_w_ECU) (Addr,UInt);
   void __attribute__((regparm(2))) (*track_new_mem_stack_112_w_ECU)(Addr,UInt);
   void __attribute__((regparm(2))) (*track_new_mem_stack_128_w_ECU)(Addr,UInt);
   void __attribute__((regparm(2))) (*track_new_mem_stack_144_w_ECU)(Addr,UInt);
   void __attribute__((regparm(2))) (*track_new_mem_stack_160_w_ECU)(Addr,UInt);
   void (*track_new_mem_stack_w_ECU)(Addr,SizeT,UInt);

   void __attribute__((regparm(1))) (*track_new_mem_stack_4) (Addr);
   void __attribute__((regparm(1))) (*track_new_mem_stack_8) (Addr);
   void __attribute__((regparm(1))) (*track_new_mem_stack_12) (Addr);
   void __attribute__((regparm(1))) (*track_new_mem_stack_16) (Addr);
   void __attribute__((regparm(1))) (*track_new_mem_stack_32) (Addr);
   void __attribute__((regparm(1))) (*track_new_mem_stack_112)(Addr);
   void __attribute__((regparm(1))) (*track_new_mem_stack_128)(Addr);
   void __attribute__((regparm(1))) (*track_new_mem_stack_144)(Addr);
   void __attribute__((regparm(1))) (*track_new_mem_stack_160)(Addr);
   void (*track_new_mem_stack)(Addr,SizeT);

   void __attribute__((regparm(1))) (*track_die_mem_stack_4) (Addr);
   void __attribute__((regparm(1))) (*track_die_mem_stack_8) (Addr);
   void __attribute__((regparm(1))) (*track_die_mem_stack_12) (Addr);
   void __attribute__((regparm(1))) (*track_die_mem_stack_16) (Addr);
   void __attribute__((regparm(1))) (*track_die_mem_stack_32) (Addr);
   void __attribute__((regparm(1))) (*track_die_mem_stack_112)(Addr);
   void __attribute__((regparm(1))) (*track_die_mem_stack_128)(Addr);
   void __attribute__((regparm(1))) (*track_die_mem_stack_144)(Addr);
   void __attribute__((regparm(1))) (*track_die_mem_stack_160)(Addr);
   void (*track_die_mem_stack)(Addr, SizeT);

   void (*track_ban_mem_stack)(Addr, SizeT);

   void (*track_pre_mem_read) (CorePart, ThreadId, Char*, Addr, SizeT);
   void (*track_pre_mem_read_asciiz)(CorePart, ThreadId, Char*, Addr);
   void (*track_pre_mem_write) (CorePart, ThreadId, Char*, Addr, SizeT);
   void (*track_post_mem_write) (CorePart, ThreadId, Addr, SizeT);

   void (*track_pre_reg_read) (CorePart, ThreadId, Char*, PtrdiffT, SizeT);
   void (*track_post_reg_write)(CorePart, ThreadId, PtrdiffT, SizeT);
   void (*track_post_reg_write_clientcall_return)(ThreadId, PtrdiffT, SizeT,
                                                  Addr);

   void (*track_start_client_code)(ThreadId, ULong);
   void (*track_stop_client_code) (ThreadId, ULong);

   void (*track_pre_thread_ll_create)(ThreadId, ThreadId);
   void (*track_pre_thread_first_insn)(ThreadId);
   void (*track_pre_thread_ll_exit) (ThreadId);

   void (*track_pre_deliver_signal) (ThreadId, Int sigNo, Bool);
   void (*track_post_deliver_signal)(ThreadId, Int sigNo);

} VgToolInterface;

extern VgToolInterface vgPlain_tdict;





Bool vgPlain_sanity_check_needs ( Char** failmsg );
# 65 "m_main.c" 2
# 1 "pub_core_translate.h" 1
# 39 "pub_core_translate.h"
extern
Bool vgPlain_translate ( ThreadId tid,
                      Addr64 orig_addr,
                      Bool debugging_translation,
                      Int debugging_verbosity,
                      ULong bbs_done,
                      Bool allow_redirection );

extern void vgPlain_print_translation_stats ( void );
# 66 "m_main.c" 2
# 1 "pub_core_trampoline.h" 1
# 56 "pub_core_trampoline.h"
extern Addr vgPlain_trampoline_stuff_start;
extern Addr vgPlain_trampoline_stuff_end;


extern Addr vgPlain_x86_linux_SUBST_FOR_sigreturn;
extern Addr vgPlain_x86_linux_SUBST_FOR_rt_sigreturn;
extern Char* vgPlain_x86_linux_REDIR_FOR_index ( const Char*, Int );
extern UInt vgPlain_x86_linux_REDIR_FOR_strlen( void* );
# 67 "m_main.c" 2
# 1 "pub_core_transtab.h" 1
# 40 "pub_core_transtab.h"
# 1 "pub_core_transtab_asm.h" 1
# 41 "pub_core_transtab.h" 2



typedef
   struct {
      Addr guest;
      Addr host;
   }
   FastCacheEntry;

extern __attribute__((aligned(16)))
       FastCacheEntry vgPlain_tt_fast [(1 << 15)];



extern void vgPlain_init_tt_tc ( void );

extern
void vgPlain_add_to_transtab( VexGuestExtents* vge,
                           Addr64 entry,
                           AddrH code,
                           UInt code_len,
                           Bool is_self_checking,
                           Int offs_profInc,
                           UInt n_guest_instrs,
                           VexArch arch_host );

extern
void vgPlain_tt_tc_do_chaining ( void* from__patch_addr,
                              UInt to_sNo,
                              UInt to_tteNo,
                              Bool to_fastEP );

extern Bool vgPlain_search_transtab ( AddrH* res_hcode,
                                          UInt* res_sNo,
                                          UInt* res_tteNo,
                                   Addr64 guest_addr,
                                   Bool upd_cache );

extern void vgPlain_discard_translations ( Addr64 start, ULong range,
                                        HChar* who );

extern void vgPlain_print_tt_tc_stats ( void );

extern UInt vgPlain_get_bbs_translated ( void );




extern
void vgPlain_add_to_unredir_transtab( VexGuestExtents* vge,
                                   Addr64 entry,
                                   AddrH code,
                                   UInt code_len );
extern
Bool vgPlain_search_unredir_transtab ( AddrH* result,
                                    Addr64 guest_addr );



typedef struct _BBProfEntry {
   Addr64 addr;
   ULong score;
} BBProfEntry;

extern ULong vgPlain_get_BB_profile ( BBProfEntry tops[], UInt n_tops );
# 68 "m_main.c" 2
# 1 "../include/pub_tool_inner.h" 1
# 42 "../include/pub_tool_inner.h"
# 1 "../config.h" 1
# 43 "../include/pub_tool_inner.h" 2
# 69 "m_main.c" 2
# 78 "m_main.c"
static void print_all_stats ( void )
{
   vgPlain_print_translation_stats();
   vgPlain_print_tt_tc_stats();
   vgPlain_print_scheduler_stats();
   vgPlain_print_ExeContext_stats();
   vgPlain_print_errormgr_stats();


   if (vgPlain_clo_verbosity > 2) {
      vgPlain_message(Vg_DebugMsg, "\n");
      vgPlain_message(Vg_DebugMsg,
         "------ Valgrind's internal memory use stats follow ------\n" );
      vgPlain_sanity_check_malloc_all();
      vgPlain_message(Vg_DebugMsg, "------\n" );
      vgPlain_print_all_arena_stats();
      vgPlain_message(Vg_DebugMsg, "\n");
   }
}
# 105 "m_main.c"
static void usage_NORETURN ( Bool debug_help )
{




   Char* usage1 =
"usage: valgrind [options] prog-and-args\n"
"\n"
"  tool-selection option, with default in [ ]:\n"
"    --tool=<name>             use the Valgrind tool named <name> [memcheck]\n"
"\n"
"  basic user options for all Valgrind tools, with defaults in [ ]:\n"
"    -h --help                 show this message\n"
"    --help-debug              show this message, plus debugging options\n"
"    --version                 show version\n"
"    -q --quiet                run silently; only print error msgs\n"
"    -v --verbose              be more verbose -- show misc extra info\n"
"    --trace-children=no|yes   Valgrind-ise child processes (follow execve)? [no]\n"
"    --trace-children-skip=patt1,patt2,...    specifies a list of executables\n"
"                              that --trace-children=yes should not trace into\n"
"    --trace-children-skip-by-arg=patt1,patt2,...   same as --trace-children-skip=\n"
"                              but check the argv[] entries for children, rather\n"
"                              than the exe name, to make a follow/no-follow decision\n"
"    --child-silent-after-fork=no|yes omit child output between fork & exec? [no]\n"
"    --vgdb=no|yes|full        activate gdbserver? [yes]\n"
"                              full is slower but provides precise watchpoint/step\n"
"    --vgdb-error=<number>     invoke gdbserver after <number> errors [%d]\n"
"                              to get started quickly, use --vgdb-error=0\n"
"                              and follow the on-screen directions\n"
"    --track-fds=no|yes        track open file descriptors? [no]\n"
"    --time-stamp=no|yes       add timestamps to log messages? [no]\n"
"    --log-fd=<number>         log messages to file descriptor [2=stderr]\n"
"    --log-file=<file>         log messages to <file>\n"
"    --log-socket=ipaddr:port  log messages to socket ipaddr:port\n"
"\n"
"  user options for Valgrind tools that report errors:\n"
"    --xml=yes                 emit error output in XML (some tools only)\n"
"    --xml-fd=<number>         XML output to file descriptor\n"
"    --xml-file=<file>         XML output to <file>\n"
"    --xml-socket=ipaddr:port  XML output to socket ipaddr:port\n"
"    --xml-user-comment=STR    copy STR verbatim into XML output\n"
"    --demangle=no|yes         automatically demangle C++ names? [yes]\n"
"    --num-callers=<number>    show <number> callers in stack traces [12]\n"
"    --error-limit=no|yes      stop showing new errors if too many? [yes]\n"
"    --error-exitcode=<number> exit code to return if errors found [0=disable]\n"
"    --show-below-main=no|yes  continue stack traces below main() [no]\n"
"    --suppressions=<filename> suppress errors described in <filename>\n"
"    --gen-suppressions=no|yes|all    print suppressions for errors? [no]\n"
"    --db-attach=no|yes        start debugger when errors detected? [no]\n"
"    --db-command=<command>    command to start debugger [%s -nw %%f %%p]\n"
"    --input-fd=<number>       file descriptor for input [0=stdin]\n"
"    --dsymutil=no|yes         run dsymutil on Mac OS X when helpful? [no]\n"
"    --max-stackframe=<number> assume stack switch for SP changes larger\n"
"                              than <number> bytes [2000000]\n"
"    --main-stacksize=<number> set size of main thread's stack (in bytes)\n"
"                              [use current 'ulimit' value]\n"
"\n"
"  user options for Valgrind tools that replace malloc:\n"
"    --alignment=<number>      set minimum alignment of heap allocations [%s]\n"
"    --redzone-size=<number>   set minimum size of redzones added before/after\n"
"                              heap blocks (in bytes). [%s]\n"
"\n"
"  uncommon user options for all Valgrind tools:\n"
"    --fullpath-after=         (with nothing after the '=')\n"
"                              show full source paths in call stacks\n"
"    --fullpath-after=string   like --fullpath-after=, but only show the\n"
"                              part of the path after 'string'.  Allows removal\n"
"                              of path prefixes.  Use this flag multiple times\n"
"                              to specify a set of prefixes to remove.\n"
"    --smc-check=none|stack|all|all-non-file [stack]\n"
"                              checks for self-modifying code: none, only for\n"
"                              code found in stacks, for all code, or for all\n"
"                              code except that from file-backed mappings\n"
"    --read-var-info=yes|no    read debug info on stack and global variables\n"
"                              and use it to print better error messages in\n"
"                              tools that make use of it (Memcheck, Helgrind,\n"
"                              DRD) [no]\n"
"    --vgdb-poll=<number>      gdbserver poll max every <number> basic blocks [%d] \n"
"    --vgdb-shadow-registers=no|yes   let gdb see the shadow registers [no]\n"
"    --vgdb-prefix=<prefix>    prefix for vgdb FIFOs [%s]\n"
"    --run-libc-freeres=no|yes free up glibc memory at exit on Linux? [yes]\n"
"    --sim-hints=hint1,hint2,...  known hints:\n"
"                                 lax-ioctls, enable-outer, fuse-compatible [none]\n"
"    --fair-sched=no|yes|try   schedule threads fairly on multicore systems [no]\n"
"    --kernel-variant=variant1,variant2,...  known variants: bproc [none]\n"
"                              handle non-standard kernel variants\n"
"    --show-emwarns=no|yes     show warnings about emulation limits? [no]\n"
"    --require-text-symbol=:sonamepattern:symbolpattern    abort run if the\n"
"                              stated shared object doesn't have the stated\n"
"                              text symbol.  Patterns can contain ? and *.\n"
"    --soname-synonyms=syn1=pattern1,syn2=pattern2,... synonym soname\n"
"              specify patterns for function wrapping or replacement.\n"
"              To use a non-libc malloc library that is\n"
"                  in the main exe:  --soname-synonyms=somalloc=NONE\n"
"                  in libxyzzy.so:   --soname-synonyms=somalloc=libxyzzy.so\n"
"\n";

   Char* usage2 =
"\n"
"  debugging options for all Valgrind tools:\n"
"    -d                        show verbose debugging output\n"
"    --stats=no|yes            show tool and core statistics [no]\n"
"    --sanity-level=<number>   level of sanity checking to do [1]\n"
"    --trace-flags=<XXXXXXXX>   show generated code? (X = 0|1) [00000000]\n"
"    --profile-flags=<XXXXXXXX> ditto, but for profiling (X = 0|1) [00000000]\n"
"    --trace-notbelow=<number> only show BBs above <number> [999999999]\n"
"    --trace-notabove=<number> only show BBs below <number> [0]\n"
"    --trace-syscalls=no|yes   show all system calls? [no]\n"
"    --trace-signals=no|yes    show signal handling details? [no]\n"
"    --trace-symtab=no|yes     show symbol table details? [no]\n"
"    --trace-symtab-patt=<patt> limit debuginfo tracing to obj name <patt>\n"
"    --trace-cfi=no|yes        show call-frame-info details? [no]\n"
"    --debug-dump=syms         mimic /usr/bin/readelf --syms\n"
"    --debug-dump=line         mimic /usr/bin/readelf --debug-dump=line\n"
"    --debug-dump=frames       mimic /usr/bin/readelf --debug-dump=frames\n"
"    --trace-redir=no|yes      show redirection details? [no]\n"
"    --trace-sched=no|yes      show thread scheduler details? [no]\n"
"    --profile-heap=no|yes     profile Valgrind's own space use\n"
"    --core-redzone=<number>   set minimum size of redzones added before/after\n"
"                              heap blocks allocated for Valgrind internal use (in bytes) [4]\n"
"    --wait-for-gdb=yes|no     pause on startup to wait for gdb attach\n"
"    --sym-offsets=yes|no      show syms in form 'name+offset' ? [no]\n"
"    --command-line-only=no|yes  only use command line options [no]\n"
"\n"
"  Vex options for all Valgrind tools:\n"
"    --vex-iropt-verbosity=<0..9>           [0]\n"
"    --vex-iropt-level=<0..2>               [2]\n"
"    --vex-iropt-register-updates=unwindregs-at-mem-access\n"
"                                |allregs-at-mem-access\n"
"                                |allregs-at-each-insn  [unwindregs-at-mem-access]\n"
"    --vex-iropt-unroll-thresh=<0..400>     [120]\n"
"    --vex-guest-max-insns=<1..100>         [50]\n"
"    --vex-guest-chase-thresh=<0..99>       [10]\n"
"    --vex-guest-chase-cond=no|yes          [no]\n"
"    --trace-flags and --profile-flags values (omit the middle space):\n"
"       1000 0000   show conversion into IR\n"
"       0100 0000   show after initial opt\n"
"       0010 0000   show after instrumentation\n"
"       0001 0000   show after second opt\n"
"       0000 1000   show after tree building\n"
"       0000 0100   show selecting insns\n"
"       0000 0010   show after reg-alloc\n"
"       0000 0001   show final assembly\n"
"      (Nb: you need --trace-notbelow and/or --trace-notabove with --trace-flags for full details)\n"
"\n"
"  debugging options for Valgrind tools that report errors\n"
"    --dump-error=<number>     show translation for basic block associated\n"
"                              with <number>'th error context [0=show none]\n"
"\n"
"  debugging options for Valgrind tools that replace malloc:\n"
"    --trace-malloc=no|yes     show client malloc details? [no]\n"
"\n";

   Char* usage3 =
"\n"
"  Extra options read from ~/.valgrindrc, $VALGRIND_OPTS, ./.valgrindrc\n"
"\n"
"  %s is %s\n"
"  Valgrind is Copyright (C) 2000-2012, and GNU GPL'd, by Julian Seward et al.\n"
"  LibVEX is Copyright (C) 2004-2012, and GNU GPL'd, by OpenWorks LLP et al.\n"
"\n"
"  Bug reports, feedback, admiration, abuse, etc, to: %s.\n"
"\n";

   Char* gdb_path = "/no/gdb/was/found/at/configure/time";
   Char default_alignment[30];
   Char default_redzone_size[30];


   vgPlain_log_output_sink.fd = 1;
   vgPlain_log_output_sink.is_socket = ((Bool)0);

   if (vgPlain_needs.malloc_replacement) {
      vgPlain_sprintf(default_alignment, "%d", 8);
      vgPlain_sprintf(default_redzone_size, "%lu", vgPlain_tdict.tool_client_redzone_szB);
   } else {
      vgPlain_strcpy(default_alignment, "not used by this tool");
      vgPlain_strcpy(default_redzone_size, "not used by this tool");
   }

   vgPlain_printf(usage1,
               vgPlain_clo_vgdb_error ,
               gdb_path ,
               default_alignment ,
               default_redzone_size ,
               vgPlain_clo_vgdb_poll ,
               vgPlain_vgdb_prefix_default()
               );
   if (vgPlain_details.name) {
      vgPlain_printf("  user options for %s:\n", vgPlain_details.name);
      if (vgPlain_needs.command_line_options)
  ( ((void) (__builtin_expect(!!(vgPlain_tdict.tool_print_usage), 1) ? 0 : (vgPlain_assert_fail ( ((Bool)0), (const Char*)"VG_(tdict).tool_print_usage", (const Char*)"m_main.c", 297, (const Char*)__PRETTY_FUNCTION__, "you forgot to set VgToolInterface function '" "tool_print_usage" "'"), 0))), vgPlain_tdict.tool_print_usage() );
      else
  vgPlain_printf("    (none)\n");
   }
   if (debug_help) {
      vgPlain_printf("%s", usage2);

      if (vgPlain_details.name) {
         vgPlain_printf("  debugging options for %s:\n", vgPlain_details.name);

         if (vgPlain_needs.command_line_options)
            ( ((void) (__builtin_expect(!!(vgPlain_tdict.tool_print_debug_usage), 1) ? 0 : (vgPlain_assert_fail ( ((Bool)0), (const Char*)"VG_(tdict).tool_print_debug_usage", (const Char*)"m_main.c", 308, (const Char*)__PRETTY_FUNCTION__, "you forgot to set VgToolInterface function '" "tool_print_debug_usage" "'"), 0))), vgPlain_tdict.tool_print_debug_usage() );
         else
            vgPlain_printf("    (none)\n");
      }
   }
   vgPlain_printf(usage3, vgPlain_details.name, vgPlain_details.copyright_author,
               "www.valgrind.org");
   vgPlain_exit(0);
}
# 334 "m_main.c"
static void early_process_cmd_line_options ( Int* need_help,
                                                    HChar** tool )
{
   UInt i;
   HChar* str;

   ((void) (__builtin_expect(!!(vgPlain_args_for_valgrind), 1) ? 0 : (vgPlain_assert_fail ( ((Bool)1), "VG_(args_for_valgrind)", "m_main.c", 340, __PRETTY_FUNCTION__, ""), 0)));


   for (i = 0; i < vgPlain_sizeXA( vgPlain_args_for_valgrind ); i++) {

      str = * (HChar**) vgPlain_indexXA( vgPlain_args_for_valgrind, i );
      ((void) (__builtin_expect(!!(str), 1) ? 0 : (vgPlain_assert_fail ( ((Bool)1), "str", "m_main.c", 346, __PRETTY_FUNCTION__, ""), 0)));


      if (( ((str) != ((void*)0) && ("--version") != ((void*)0) && vgPlain_strcmp(((str)),(("--version")))==0) ? ((Bool)1) : ((Bool)0) ) && ({ (vgPlain_log_output_sink.fd) = (1); ((Bool)1); }) ) {
         vgPlain_log_output_sink.is_socket = ((Bool)0);
         vgPlain_printf("valgrind-" "3.8.0-PRE1" "\n");
         vgPlain_exit(0);
      }
      else if (( ((str) != ((void*)0) && ("--help") != ((void*)0) && vgPlain_strcmp(((str)),(("--help")))==0) ? ((Bool)1) : ((Bool)0) ) && ({ (*need_help) = (*need_help+1); ((Bool)1); }) ) {}
      else if (( ((str) != ((void*)0) && ("-h") != ((void*)0) && vgPlain_strcmp(((str)),(("-h")))==0) ? ((Bool)1) : ((Bool)0) ) && ({ (*need_help) = (*need_help+1); ((Bool)1); }) ) {}

      else if (( ((str) != ((void*)0) && ("--help-debug") != ((void*)0) && vgPlain_strcmp(((str)),(("--help-debug")))==0) ? ((Bool)1) : ((Bool)0) ) && ({ (*need_help) = (*need_help+2); ((Bool)1); }) ) {}



      else if (( (str != ((void*)0) && "--tool""=" != ((void*)0) && vgPlain_strncmp((str),("--tool""="),(vgPlain_strlen("--tool")+1))==0) ? ((Bool)1) : ((Bool)0) ) && ({ Char* val = &(str)[ vgPlain_strlen("--tool")+1 ]; (*tool) = val; ((Bool)1); }) ) {}




      else if (( (str != ((void*)0) && "--max-stackframe""=" != ((void*)0) && vgPlain_strncmp((str),("--max-stackframe""="),(vgPlain_strlen("--max-stackframe")+1))==0) ? ((Bool)1) : ((Bool)0) ) && ({ Char* val = &(str)[ vgPlain_strlen("--max-stackframe")+1 ]; Char* s; Long n = vgPlain_strtoll10( val, &s ); (vgPlain_clo_max_stackframe) = n; if ('\0' != s[0] || (vgPlain_clo_max_stackframe) != n) vgPlain_fmsg_bad_option(str, ""); ((Bool)1); }) ) {}
      else if (( (str != ((void*)0) && "--main-stacksize""=" != ((void*)0) && vgPlain_strncmp((str),("--main-stacksize""="),(vgPlain_strlen("--main-stacksize")+1))==0) ? ((Bool)1) : ((Bool)0) ) && ({ Char* val = &(str)[ vgPlain_strlen("--main-stacksize")+1 ]; Char* s; Long n = vgPlain_strtoll10( val, &s ); (vgPlain_clo_main_stacksize) = n; if ('\0' != s[0] || (vgPlain_clo_main_stacksize) != n) vgPlain_fmsg_bad_option(str, ""); ((Bool)1); }) ) {}




      else if (( (str != ((void*)0) && "--sim-hints""=" != ((void*)0) && vgPlain_strncmp((str),("--sim-hints""="),(vgPlain_strlen("--sim-hints")+1))==0) ? ((Bool)1) : ((Bool)0) ) && ({ Char* val = &(str)[ vgPlain_strlen("--sim-hints")+1 ]; (vgPlain_clo_sim_hints) = val; ((Bool)1); }) ) {}
   }
}
# 400 "m_main.c"
static
void main_process_cmd_line_options ( Bool* logging_to_fd,
                                            Char** xml_fname_unexpanded,
                                     const HChar* toolname )
{



   SysRes sres;
   Int i, tmp_log_fd, tmp_xml_fd;
   Int toolname_len = vgPlain_strlen(toolname);
   Char* tmp_str;
   enum {
      VgLogTo_Fd,
      VgLogTo_File,
      VgLogTo_Socket
   } log_to = VgLogTo_Fd,
     xml_to = VgLogTo_Fd;




   Char* log_fsname_unexpanded = ((void*)0);
   Char* xml_fsname_unexpanded = ((void*)0);



   tmp_log_fd = 2;
   tmp_xml_fd = -1;


   if ("/root/mountpoint-genprog/genprog-many-bugs/valgrind-bug-12854-12855/valgrind/../local-root/lib/valgrind"[0] != '/')
      vgPlain_err_config_error("Please use absolute paths in "
                            "./configure --prefix=... or --libdir=...\n");

   ((void) (__builtin_expect(!!(vgPlain_args_for_valgrind), 1) ? 0 : (vgPlain_assert_fail ( ((Bool)1), "VG_(args_for_valgrind)", "m_main.c", 435, __PRETTY_FUNCTION__, ""), 0)));



   for (i = 0; i < vgPlain_sizeXA( vgPlain_args_for_valgrind ); i++) {

      HChar* arg = * (HChar**) vgPlain_indexXA( vgPlain_args_for_valgrind, i );
      HChar* colon = arg;


      while (*colon && *colon != ':' && *colon != '=')
         colon++;




      if (*colon == ':') {
         if (( (arg != ((void*)0) && "--" != ((void*)0) && vgPlain_strncmp((arg),("--"),(2))==0) ? ((Bool)1) : ((Bool)0) ) &&
             ( (arg+2 != ((void*)0) && toolname != ((void*)0) && vgPlain_strncmp((arg+2),(toolname),(toolname_len))==0) ? ((Bool)1) : ((Bool)0) ) &&
             ( (arg+2+toolname_len != ((void*)0) && ":" != ((void*)0) && vgPlain_strncmp((arg+2+toolname_len),(":"),(1))==0) ? ((Bool)1) : ((Bool)0) ))
         {
# 471 "m_main.c"
            if (0)
               vgPlain_printf("tool-specific arg: %s\n", arg);
            arg = vgPlain_strdup("main.mpclo.1", arg + toolname_len + 1);
            arg[0] = '-';
            arg[1] = '-';

         } else {

            continue;
         }
      }


      if ( (arg != ((void*)0) && "--tool=" != ((void*)0) && vgPlain_strncmp((arg),("--tool="),(7))==0) ? ((Bool)1) : ((Bool)0) ) {}
      else if ( (arg != ((void*)0) && "--command-line-only=" != ((void*)0) && vgPlain_strncmp((arg),("--command-line-only="),(20))==0) ? ((Bool)1) : ((Bool)0) ) {}
      else if ( (arg != ((void*)0) && "--" != ((void*)0) && vgPlain_strcmp((arg),("--"))==0) ? ((Bool)1) : ((Bool)0) ) {}
      else if ( (arg != ((void*)0) && "-d" != ((void*)0) && vgPlain_strcmp((arg),("-d"))==0) ? ((Bool)1) : ((Bool)0) ) {}
      else if ( (arg != ((void*)0) && "--max-stackframe" != ((void*)0) && vgPlain_strncmp((arg),("--max-stackframe"),(16))==0) ? ((Bool)1) : ((Bool)0) ) {}
      else if ( (arg != ((void*)0) && "--main-stacksize" != ((void*)0) && vgPlain_strncmp((arg),("--main-stacksize"),(16))==0) ? ((Bool)1) : ((Bool)0) ) {}
      else if ( (arg != ((void*)0) && "--sim-hints" != ((void*)0) && vgPlain_strncmp((arg),("--sim-hints"),(11))==0) ? ((Bool)1) : ((Bool)0) ) {}
      else if ( (arg != ((void*)0) && "--profile-heap" != ((void*)0) && vgPlain_strncmp((arg),("--profile-heap"),(14))==0) ? ((Bool)1) : ((Bool)0) ) {}
      else if ( (arg != ((void*)0) && "--core-redzone-size" != ((void*)0) && vgPlain_strncmp((arg),("--core-redzone-size"),(14))==0) ? ((Bool)1) : ((Bool)0) ) {}
      else if ( (arg != ((void*)0) && "--redzone-size" != ((void*)0) && vgPlain_strncmp((arg),("--redzone-size"),(14))==0) ? ((Bool)1) : ((Bool)0) ) {}


      else if ( (arg != ((void*)0) && "--vex-iropt-precise-memory-exns=no" != ((void*)0) && vgPlain_strncmp((arg),("--vex-iropt-precise-memory-exns=no"),(34))==0) ? ((Bool)1) : ((Bool)0) ) {
         vgPlain_fmsg_bad_option
            (arg,
             "--vex-iropt-precise-memory-exns is obsolete\n"
             "Use --vex-iropt-register-updates=unwindregs-at-mem-access instead\n");
      }
      else if ( (arg != ((void*)0) && "--vex-iropt-precise-memory-exns=yes" != ((void*)0) && vgPlain_strncmp((arg),("--vex-iropt-precise-memory-exns=yes"),(35))==0) ? ((Bool)1) : ((Bool)0) ) {
         vgPlain_fmsg_bad_option
            (arg,
             "--vex-iropt-precise-memory-exns is obsolete\n"
             "Use --vex-iropt-register-updates=allregs-at-mem-access instead\n"
             " (or --vex-iropt-register-updates=allregs-at-each-insn)\n");
      }


      else if (( (arg != ((void*)0) && "-v" != ((void*)0) && vgPlain_strcmp((arg),("-v"))==0) ? ((Bool)1) : ((Bool)0) ) ||
               ( (arg != ((void*)0) && "--verbose" != ((void*)0) && vgPlain_strcmp((arg),("--verbose"))==0) ? ((Bool)1) : ((Bool)0) ))
         vgPlain_clo_verbosity++;

      else if (( (arg != ((void*)0) && "-q" != ((void*)0) && vgPlain_strcmp((arg),("-q"))==0) ? ((Bool)1) : ((Bool)0) ) ||
               ( (arg != ((void*)0) && "--quiet" != ((void*)0) && vgPlain_strcmp((arg),("--quiet"))==0) ? ((Bool)1) : ((Bool)0) ))
         vgPlain_clo_verbosity--;

      else if (( (arg != ((void*)0) && "--stats""=" != ((void*)0) && vgPlain_strncmp((arg),("--stats""="),(vgPlain_strlen("--stats")+1))==0) ? ((Bool)1) : ((Bool)0) ) && ({ Char* val = &(arg)[ vgPlain_strlen("--stats")+1 ]; if ( (val != ((void*)0) && "yes" != ((void*)0) && vgPlain_strcmp((val),("yes"))==0) ? ((Bool)1) : ((Bool)0) ) (vgPlain_clo_stats) = ((Bool)1); else if ( (val != ((void*)0) && "no" != ((void*)0) && vgPlain_strcmp((val),("no"))==0) ? ((Bool)1) : ((Bool)0) ) (vgPlain_clo_stats) = ((Bool)0); else vgPlain_fmsg_bad_option(arg, "Invalid boolean value '%s'" " (should be 'yes' or 'no')\n", val); ((Bool)1); }) ) {}
      else if (( (arg != ((void*)0) && "--xml""=" != ((void*)0) && vgPlain_strncmp((arg),("--xml""="),(vgPlain_strlen("--xml")+1))==0) ? ((Bool)1) : ((Bool)0) ) && ({ Char* val = &(arg)[ vgPlain_strlen("--xml")+1 ]; if ( (val != ((void*)0) && "yes" != ((void*)0) && vgPlain_strcmp((val),("yes"))==0) ? ((Bool)1) : ((Bool)0) ) (vgPlain_clo_xml) = ((Bool)1); else if ( (val != ((void*)0) && "no" != ((void*)0) && vgPlain_strcmp((val),("no"))==0) ? ((Bool)1) : ((Bool)0) ) (vgPlain_clo_xml) = ((Bool)0); else vgPlain_fmsg_bad_option(arg, "Invalid boolean value '%s'" " (should be 'yes' or 'no')\n", val); ((Bool)1); }) )
         vgPlain_debugLog_setXml(vgPlain_clo_xml);

      else if (( ((arg) != ((void*)0) && ("--vgdb=no") != ((void*)0) && vgPlain_strcmp(((arg)),(("--vgdb=no")))==0) ? ((Bool)1) : ((Bool)0) ) && ({ (vgPlain_clo_vgdb) = (Vg_VgdbNo); ((Bool)1); }) ) {}
      else if (( ((arg) != ((void*)0) && ("--vgdb=yes") != ((void*)0) && vgPlain_strcmp(((arg)),(("--vgdb=yes")))==0) ? ((Bool)1) : ((Bool)0) ) && ({ (vgPlain_clo_vgdb) = (Vg_VgdbYes); ((Bool)1); }) ) {}
      else if (( ((arg) != ((void*)0) && ("--vgdb=full") != ((void*)0) && vgPlain_strcmp(((arg)),(("--vgdb=full")))==0) ? ((Bool)1) : ((Bool)0) ) && ({ (vgPlain_clo_vgdb) = (Vg_VgdbFull); ((Bool)1); }) ) {


         vgPlain_clo_vex_control.iropt_register_updates
            = VexRegUpdAllregsAtEachInsn;
      }
      else if (( (arg != ((void*)0) && "--vgdb-poll""=" != ((void*)0) && vgPlain_strncmp((arg),("--vgdb-poll""="),(vgPlain_strlen("--vgdb-poll")+1))==0) ? ((Bool)1) : ((Bool)0) ) && ({ Char* val = &(arg)[ vgPlain_strlen("--vgdb-poll")+1 ]; Char* s; Long n = vgPlain_strtoll10( val, &s ); (vgPlain_clo_vgdb_poll) = n; if ('\0' != s[0] || (vgPlain_clo_vgdb_poll) != n) vgPlain_fmsg_bad_option(arg, ""); ((Bool)1); }) ) {}
      else if (( (arg != ((void*)0) && "--vgdb-error""=" != ((void*)0) && vgPlain_strncmp((arg),("--vgdb-error""="),(vgPlain_strlen("--vgdb-error")+1))==0) ? ((Bool)1) : ((Bool)0) ) && ({ Char* val = &(arg)[ vgPlain_strlen("--vgdb-error")+1 ]; Char* s; Long n = vgPlain_strtoll10( val, &s ); (vgPlain_clo_vgdb_error) = n; if ('\0' != s[0] || (vgPlain_clo_vgdb_error) != n) vgPlain_fmsg_bad_option(arg, ""); ((Bool)1); }) ) {}
      else if (( (arg != ((void*)0) && "--vgdb-prefix""=" != ((void*)0) && vgPlain_strncmp((arg),("--vgdb-prefix""="),(vgPlain_strlen("--vgdb-prefix")+1))==0) ? ((Bool)1) : ((Bool)0) ) && ({ Char* val = &(arg)[ vgPlain_strlen("--vgdb-prefix")+1 ]; (vgPlain_clo_vgdb_prefix) = val; ((Bool)1); }) ) {}
      else if (( (arg != ((void*)0) && "--vgdb-shadow-registers""=" != ((void*)0) &&
 vgPlain_strncmp
# 534 "m_main.c"
              ((arg),("--vgdb-shadow-registers""="),(vgPlain_strlen("--vgdb-shadow-registers")+1))==0) ? ((Bool)1) : ((Bool)0) ) && ({ Char* val = &(arg)[
 vgPlain_strlen
# 534 "m_main.c"
              ("--vgdb-shadow-registers")+1 ]; if ( (val != ((void*)0) && "yes" != ((void*)0) &&
 vgPlain_strcmp
# 534 "m_main.c"
              ((val),("yes"))==0) ? ((Bool)1) : ((Bool)0) ) (vgPlain_clo_vgdb_shadow_registers) = ((Bool)1); else if ( (val != ((void*)0) && "no" != ((void*)0) &&
 vgPlain_strcmp
# 534 "m_main.c"
              ((val),("no"))==0) ? ((Bool)1) : ((Bool)0) ) (vgPlain_clo_vgdb_shadow_registers) = ((Bool)0); else
 vgPlain_fmsg_bad_option
# 534 "m_main.c"
              (arg, "Invalid boolean value '%s'" " (should be 'yes' or 'no')\n", val); ((Bool)1); }) )
                                                            {}
      else if (( (arg != ((void*)0) && "--db-attach""=" != ((void*)0) && vgPlain_strncmp((arg),("--db-attach""="),(vgPlain_strlen("--db-attach")+1))==0) ? ((Bool)1) : ((Bool)0) ) && ({ Char* val = &(arg)[ vgPlain_strlen("--db-attach")+1 ]; if ( (val != ((void*)0) && "yes" != ((void*)0) && vgPlain_strcmp((val),("yes"))==0) ? ((Bool)1) : ((Bool)0) ) (vgPlain_clo_db_attach) = ((Bool)1); else if ( (val != ((void*)0) && "no" != ((void*)0) && vgPlain_strcmp((val),("no"))==0) ? ((Bool)1) : ((Bool)0) ) (vgPlain_clo_db_attach) = ((Bool)0); else vgPlain_fmsg_bad_option(arg, "Invalid boolean value '%s'" " (should be 'yes' or 'no')\n", val); ((Bool)1); }) ) {}
      else if (( (arg != ((void*)0) && "--demangle""=" != ((void*)0) && vgPlain_strncmp((arg),("--demangle""="),(vgPlain_strlen("--demangle")+1))==0) ? ((Bool)1) : ((Bool)0) ) && ({ Char* val = &(arg)[ vgPlain_strlen("--demangle")+1 ]; if ( (val != ((void*)0) && "yes" != ((void*)0) && vgPlain_strcmp((val),("yes"))==0) ? ((Bool)1) : ((Bool)0) ) (vgPlain_clo_demangle) = ((Bool)1); else if ( (val != ((void*)0) && "no" != ((void*)0) && vgPlain_strcmp((val),("no"))==0) ? ((Bool)1) : ((Bool)0) ) (vgPlain_clo_demangle) = ((Bool)0); else vgPlain_fmsg_bad_option(arg, "Invalid boolean value '%s'" " (should be 'yes' or 'no')\n", val); ((Bool)1); }) ) {}
      else if (( (arg != ((void*)0) && "--soname-synonyms""=" != ((void*)0) && vgPlain_strncmp((arg),("--soname-synonyms""="),(vgPlain_strlen("--soname-synonyms")+1))==0) ? ((Bool)1) : ((Bool)0) ) && ({ Char* val = &(arg)[ vgPlain_strlen("--soname-synonyms")+1 ]; (vgPlain_clo_soname_synonyms) = val; ((Bool)1); }) ) {}
      else if (( (arg != ((void*)0) && "--error-limit""=" != ((void*)0) && vgPlain_strncmp((arg),("--error-limit""="),(vgPlain_strlen("--error-limit")+1))==0) ? ((Bool)1) : ((Bool)0) ) && ({ Char* val = &(arg)[ vgPlain_strlen("--error-limit")+1 ]; if ( (val != ((void*)0) && "yes" != ((void*)0) && vgPlain_strcmp((val),("yes"))==0) ? ((Bool)1) : ((Bool)0) ) (vgPlain_clo_error_limit) = ((Bool)1); else if ( (val != ((void*)0) && "no" != ((void*)0) && vgPlain_strcmp((val),("no"))==0) ? ((Bool)1) : ((Bool)0) ) (vgPlain_clo_error_limit) = ((Bool)0); else vgPlain_fmsg_bad_option(arg, "Invalid boolean value '%s'" " (should be 'yes' or 'no')\n", val); ((Bool)1); }) ) {}
      else if (( (arg != ((void*)0) && "--error-exitcode""=" != ((void*)0) && vgPlain_strncmp((arg),("--error-exitcode""="),(vgPlain_strlen("--error-exitcode")+1))==0) ? ((Bool)1) : ((Bool)0) ) && ({ Char* val = &(arg)[ vgPlain_strlen("--error-exitcode")+1 ]; Char* s; Long n = vgPlain_strtoll10( val, &s ); (vgPlain_clo_error_exitcode) = n; if ('\0' != s[0] || (vgPlain_clo_error_exitcode) != n) vgPlain_fmsg_bad_option(arg, ""); ((Bool)1); }) ) {}
      else if (( (arg != ((void*)0) && "--show-emwarns""=" != ((void*)0) && vgPlain_strncmp((arg),("--show-emwarns""="),(vgPlain_strlen("--show-emwarns")+1))==0) ? ((Bool)1) : ((Bool)0) ) && ({ Char* val = &(arg)[ vgPlain_strlen("--show-emwarns")+1 ]; if ( (val != ((void*)0) && "yes" != ((void*)0) && vgPlain_strcmp((val),("yes"))==0) ? ((Bool)1) : ((Bool)0) ) (vgPlain_clo_show_emwarns) = ((Bool)1); else if ( (val != ((void*)0) && "no" != ((void*)0) && vgPlain_strcmp((val),("no"))==0) ? ((Bool)1) : ((Bool)0) ) (vgPlain_clo_show_emwarns) = ((Bool)0); else vgPlain_fmsg_bad_option(arg, "Invalid boolean value '%s'" " (should be 'yes' or 'no')\n", val); ((Bool)1); }) ) {}

      else if (( (arg != ((void*)0) && "--run-libc-freeres""=" != ((void*)0) && vgPlain_strncmp((arg),("--run-libc-freeres""="),(vgPlain_strlen("--run-libc-freeres")+1))==0) ? ((Bool)1) : ((Bool)0) ) && ({ Char* val = &(arg)[ vgPlain_strlen("--run-libc-freeres")+1 ]; if ( (val != ((void*)0) && "yes" != ((void*)0) && vgPlain_strcmp((val),("yes"))==0) ? ((Bool)1) : ((Bool)0) ) (vgPlain_clo_run_libc_freeres) = ((Bool)1); else if ( (val != ((void*)0) && "no" != ((void*)0) && vgPlain_strcmp((val),("no"))==0) ? ((Bool)1) : ((Bool)0) ) (vgPlain_clo_run_libc_freeres) = ((Bool)0); else vgPlain_fmsg_bad_option(arg, "Invalid boolean value '%s'" " (should be 'yes' or 'no')\n", val); ((Bool)1); }) ) {}
      else if (( (arg != ((void*)0) && "--show-below-main""=" != ((void*)0) && vgPlain_strncmp((arg),("--show-below-main""="),(vgPlain_strlen("--show-below-main")+1))==0) ? ((Bool)1) : ((Bool)0) ) && ({ Char* val = &(arg)[ vgPlain_strlen("--show-below-main")+1 ]; if ( (val != ((void*)0) && "yes" != ((void*)0) && vgPlain_strcmp((val),("yes"))==0) ? ((Bool)1) : ((Bool)0) ) (vgPlain_clo_show_below_main) = ((Bool)1); else if ( (val != ((void*)0) && "no" != ((void*)0) && vgPlain_strcmp((val),("no"))==0) ? ((Bool)1) : ((Bool)0) ) (vgPlain_clo_show_below_main) = ((Bool)0); else vgPlain_fmsg_bad_option(arg, "Invalid boolean value '%s'" " (should be 'yes' or 'no')\n", val); ((Bool)1); }) ) {}
      else if (( (arg != ((void*)0) && "--time-stamp""=" != ((void*)0) && vgPlain_strncmp((arg),("--time-stamp""="),(vgPlain_strlen("--time-stamp")+1))==0) ? ((Bool)1) : ((Bool)0) ) && ({ Char* val = &(arg)[ vgPlain_strlen("--time-stamp")+1 ]; if ( (val != ((void*)0) && "yes" != ((void*)0) && vgPlain_strcmp((val),("yes"))==0) ? ((Bool)1) : ((Bool)0) ) (vgPlain_clo_time_stamp) = ((Bool)1); else if ( (val != ((void*)0) && "no" != ((void*)0) && vgPlain_strcmp((val),("no"))==0) ? ((Bool)1) : ((Bool)0) ) (vgPlain_clo_time_stamp) = ((Bool)0); else vgPlain_fmsg_bad_option(arg, "Invalid boolean value '%s'" " (should be 'yes' or 'no')\n", val); ((Bool)1); }) ) {}
      else if (( (arg != ((void*)0) && "--track-fds""=" != ((void*)0) && vgPlain_strncmp((arg),("--track-fds""="),(vgPlain_strlen("--track-fds")+1))==0) ? ((Bool)1) : ((Bool)0) ) && ({ Char* val = &(arg)[ vgPlain_strlen("--track-fds")+1 ]; if ( (val != ((void*)0) && "yes" != ((void*)0) && vgPlain_strcmp((val),("yes"))==0) ? ((Bool)1) : ((Bool)0) ) (vgPlain_clo_track_fds) = ((Bool)1); else if ( (val != ((void*)0) && "no" != ((void*)0) && vgPlain_strcmp((val),("no"))==0) ? ((Bool)1) : ((Bool)0) ) (vgPlain_clo_track_fds) = ((Bool)0); else vgPlain_fmsg_bad_option(arg, "Invalid boolean value '%s'" " (should be 'yes' or 'no')\n", val); ((Bool)1); }) ) {}
      else if (( (arg != ((void*)0) && "--trace-children""=" != ((void*)0) && vgPlain_strncmp((arg),("--trace-children""="),(vgPlain_strlen("--trace-children")+1))==0) ? ((Bool)1) : ((Bool)0) ) && ({ Char* val = &(arg)[ vgPlain_strlen("--trace-children")+1 ]; if ( (val != ((void*)0) && "yes" != ((void*)0) && vgPlain_strcmp((val),("yes"))==0) ? ((Bool)1) : ((Bool)0) ) (vgPlain_clo_trace_children) = ((Bool)1); else if ( (val != ((void*)0) && "no" != ((void*)0) && vgPlain_strcmp((val),("no"))==0) ? ((Bool)1) : ((Bool)0) ) (vgPlain_clo_trace_children) = ((Bool)0); else vgPlain_fmsg_bad_option(arg, "Invalid boolean value '%s'" " (should be 'yes' or 'no')\n", val); ((Bool)1); }) ) {}
      else if (( (arg != ((void*)0) && "--child-silent-after-fork""=" != ((void*)0) &&
 vgPlain_strncmp
# 548 "m_main.c"
              ((arg),("--child-silent-after-fork""="),(vgPlain_strlen("--child-silent-after-fork")+1))==0) ? ((Bool)1) : ((Bool)0) ) && ({ Char* val = &(arg)[
 vgPlain_strlen
# 548 "m_main.c"
              ("--child-silent-after-fork")+1 ]; if ( (val != ((void*)0) && "yes" != ((void*)0) &&
 vgPlain_strcmp
# 548 "m_main.c"
              ((val),("yes"))==0) ? ((Bool)1) : ((Bool)0) ) (vgPlain_clo_child_silent_after_fork) = ((Bool)1); else if ( (val != ((void*)0) && "no" != ((void*)0) &&
 vgPlain_strcmp
# 548 "m_main.c"
              ((val),("no"))==0) ? ((Bool)1) : ((Bool)0) ) (vgPlain_clo_child_silent_after_fork) = ((Bool)0); else
 vgPlain_fmsg_bad_option
# 548 "m_main.c"
              (arg, "Invalid boolean value '%s'" " (should be 'yes' or 'no')\n", val); ((Bool)1); }) )
                                                              {}
      else if (( (arg != ((void*)0) && "--fair-sched""=" != ((void*)0) && vgPlain_strncmp((arg),("--fair-sched""="),(vgPlain_strlen("--fair-sched")+1))==0) ? ((Bool)1) : ((Bool)0) ) && ({ Char* val = &(arg)[ vgPlain_strlen("--fair-sched")+1 ]; (tmp_str) = val; ((Bool)1); }) ) {
         if (vgPlain_strcmp(tmp_str, "yes") == 0)
            vgPlain_clo_fair_sched = enable_fair_sched;
         else if (vgPlain_strcmp(tmp_str, "try") == 0)
            vgPlain_clo_fair_sched = try_fair_sched;
         else if (vgPlain_strcmp(tmp_str, "no") == 0)
            vgPlain_clo_fair_sched = disable_fair_sched;
         else
            vgPlain_fmsg_bad_option(arg, "");

      }
      else if (( (arg != ((void*)0) && "--trace-sched""=" != ((void*)0) && vgPlain_strncmp((arg),("--trace-sched""="),(vgPlain_strlen("--trace-sched")+1))==0) ? ((Bool)1) : ((Bool)0) ) && ({ Char* val = &(arg)[ vgPlain_strlen("--trace-sched")+1 ]; if ( (val != ((void*)0) && "yes" != ((void*)0) && vgPlain_strcmp((val),("yes"))==0) ? ((Bool)1) : ((Bool)0) ) (vgPlain_clo_trace_sched) = ((Bool)1); else if ( (val != ((void*)0) && "no" != ((void*)0) && vgPlain_strcmp((val),("no"))==0) ? ((Bool)1) : ((Bool)0) ) (vgPlain_clo_trace_sched) = ((Bool)0); else vgPlain_fmsg_bad_option(arg, "Invalid boolean value '%s'" " (should be 'yes' or 'no')\n", val); ((Bool)1); }) ) {}
      else if (( (arg != ((void*)0) && "--trace-signals""=" != ((void*)0) && vgPlain_strncmp((arg),("--trace-signals""="),(vgPlain_strlen("--trace-signals")+1))==0) ? ((Bool)1) : ((Bool)0) ) && ({ Char* val = &(arg)[ vgPlain_strlen("--trace-signals")+1 ]; if ( (val != ((void*)0) && "yes" != ((void*)0) && vgPlain_strcmp((val),("yes"))==0) ? ((Bool)1) : ((Bool)0) ) (vgPlain_clo_trace_signals) = ((Bool)1); else if ( (val != ((void*)0) && "no" != ((void*)0) && vgPlain_strcmp((val),("no"))==0) ? ((Bool)1) : ((Bool)0) ) (vgPlain_clo_trace_signals) = ((Bool)0); else vgPlain_fmsg_bad_option(arg, "Invalid boolean value '%s'" " (should be 'yes' or 'no')\n", val); ((Bool)1); }) ) {}
      else if (( (arg != ((void*)0) && "--trace-symtab""=" != ((void*)0) && vgPlain_strncmp((arg),("--trace-symtab""="),(vgPlain_strlen("--trace-symtab")+1))==0) ? ((Bool)1) : ((Bool)0) ) && ({ Char* val = &(arg)[ vgPlain_strlen("--trace-symtab")+1 ]; if ( (val != ((void*)0) && "yes" != ((void*)0) && vgPlain_strcmp((val),("yes"))==0) ? ((Bool)1) : ((Bool)0) ) (vgPlain_clo_trace_symtab) = ((Bool)1); else if ( (val != ((void*)0) && "no" != ((void*)0) && vgPlain_strcmp((val),("no"))==0) ? ((Bool)1) : ((Bool)0) ) (vgPlain_clo_trace_symtab) = ((Bool)0); else vgPlain_fmsg_bad_option(arg, "Invalid boolean value '%s'" " (should be 'yes' or 'no')\n", val); ((Bool)1); }) ) {}
      else if (( (arg != ((void*)0) && "--trace-symtab-patt""=" != ((void*)0) && vgPlain_strncmp((arg),("--trace-symtab-patt""="),(vgPlain_strlen("--trace-symtab-patt")+1))==0) ? ((Bool)1) : ((Bool)0) ) && ({ Char* val = &(arg)[ vgPlain_strlen("--trace-symtab-patt")+1 ]; (vgPlain_clo_trace_symtab_patt) = val; ((Bool)1); }) ) {}
      else if (( (arg != ((void*)0) && "--trace-cfi""=" != ((void*)0) && vgPlain_strncmp((arg),("--trace-cfi""="),(vgPlain_strlen("--trace-cfi")+1))==0) ? ((Bool)1) : ((Bool)0) ) && ({ Char* val = &(arg)[ vgPlain_strlen("--trace-cfi")+1 ]; if ( (val != ((void*)0) && "yes" != ((void*)0) && vgPlain_strcmp((val),("yes"))==0) ? ((Bool)1) : ((Bool)0) ) (vgPlain_clo_trace_cfi) = ((Bool)1); else if ( (val != ((void*)0) && "no" != ((void*)0) && vgPlain_strcmp((val),("no"))==0) ? ((Bool)1) : ((Bool)0) ) (vgPlain_clo_trace_cfi) = ((Bool)0); else vgPlain_fmsg_bad_option(arg, "Invalid boolean value '%s'" " (should be 'yes' or 'no')\n", val); ((Bool)1); }) ) {}
      else if (( ((arg) != ((void*)0) && ("--debug-dump=syms") != ((void*)0) &&
 vgPlain_strcmp
# 566 "m_main.c"
              (((arg)),(("--debug-dump=syms")))==0) ? ((Bool)1) : ((Bool)0) ) && ({ (vgPlain_clo_debug_dump_syms) = (((Bool)1)); ((Bool)1); }) )
                                                           {}
      else if (( ((arg) != ((void*)0) && ("--debug-dump=line") != ((void*)0) &&
 vgPlain_strcmp
# 568 "m_main.c"
              (((arg)),(("--debug-dump=line")))==0) ? ((Bool)1) : ((Bool)0) ) && ({ (vgPlain_clo_debug_dump_line) = (((Bool)1)); ((Bool)1); }) )
                                                           {}
      else if (( ((arg) != ((void*)0) && ("--debug-dump=frames") != ((void*)0) &&
 vgPlain_strcmp
# 570 "m_main.c"
              (((arg)),(("--debug-dump=frames")))==0) ? ((Bool)1) : ((Bool)0) ) && ({ (vgPlain_clo_debug_dump_frames) = (((Bool)1)); ((Bool)1); }) )
                                                                 {}
      else if (( (arg != ((void*)0) && "--trace-redir""=" != ((void*)0) && vgPlain_strncmp((arg),("--trace-redir""="),(vgPlain_strlen("--trace-redir")+1))==0) ? ((Bool)1) : ((Bool)0) ) && ({ Char* val = &(arg)[ vgPlain_strlen("--trace-redir")+1 ]; if ( (val != ((void*)0) && "yes" != ((void*)0) && vgPlain_strcmp((val),("yes"))==0) ? ((Bool)1) : ((Bool)0) ) (vgPlain_clo_trace_redir) = ((Bool)1); else if ( (val != ((void*)0) && "no" != ((void*)0) && vgPlain_strcmp((val),("no"))==0) ? ((Bool)1) : ((Bool)0) ) (vgPlain_clo_trace_redir) = ((Bool)0); else vgPlain_fmsg_bad_option(arg, "Invalid boolean value '%s'" " (should be 'yes' or 'no')\n", val); ((Bool)1); }) ) {}

      else if (( (arg != ((void*)0) && "--trace-syscalls""=" != ((void*)0) && vgPlain_strncmp((arg),("--trace-syscalls""="),(vgPlain_strlen("--trace-syscalls")+1))==0) ? ((Bool)1) : ((Bool)0) ) && ({ Char* val = &(arg)[ vgPlain_strlen("--trace-syscalls")+1 ]; if ( (val != ((void*)0) && "yes" != ((void*)0) && vgPlain_strcmp((val),("yes"))==0) ? ((Bool)1) : ((Bool)0) ) (vgPlain_clo_trace_syscalls) = ((Bool)1); else if ( (val != ((void*)0) && "no" != ((void*)0) && vgPlain_strcmp((val),("no"))==0) ? ((Bool)1) : ((Bool)0) ) (vgPlain_clo_trace_syscalls) = ((Bool)0); else vgPlain_fmsg_bad_option(arg, "Invalid boolean value '%s'" " (should be 'yes' or 'no')\n", val); ((Bool)1); }) ) {}
      else if (( (arg != ((void*)0) && "--wait-for-gdb""=" != ((void*)0) && vgPlain_strncmp((arg),("--wait-for-gdb""="),(vgPlain_strlen("--wait-for-gdb")+1))==0) ? ((Bool)1) : ((Bool)0) ) && ({ Char* val = &(arg)[ vgPlain_strlen("--wait-for-gdb")+1 ]; if ( (val != ((void*)0) && "yes" != ((void*)0) && vgPlain_strcmp((val),("yes"))==0) ? ((Bool)1) : ((Bool)0) ) (vgPlain_clo_wait_for_gdb) = ((Bool)1); else if ( (val != ((void*)0) && "no" != ((void*)0) && vgPlain_strcmp((val),("no"))==0) ? ((Bool)1) : ((Bool)0) ) (vgPlain_clo_wait_for_gdb) = ((Bool)0); else vgPlain_fmsg_bad_option(arg, "Invalid boolean value '%s'" " (should be 'yes' or 'no')\n", val); ((Bool)1); }) ) {}
      else if (( (arg != ((void*)0) && "--db-command""=" != ((void*)0) && vgPlain_strncmp((arg),("--db-command""="),(vgPlain_strlen("--db-command")+1))==0) ? ((Bool)1) : ((Bool)0) ) && ({ Char* val = &(arg)[ vgPlain_strlen("--db-command")+1 ]; (vgPlain_clo_db_command) = val; ((Bool)1); }) ) {}
      else if (( (arg != ((void*)0) && "--sym-offsets""=" != ((void*)0) && vgPlain_strncmp((arg),("--sym-offsets""="),(vgPlain_strlen("--sym-offsets")+1))==0) ? ((Bool)1) : ((Bool)0) ) && ({ Char* val = &(arg)[ vgPlain_strlen("--sym-offsets")+1 ]; if ( (val != ((void*)0) && "yes" != ((void*)0) && vgPlain_strcmp((val),("yes"))==0) ? ((Bool)1) : ((Bool)0) ) (vgPlain_clo_sym_offsets) = ((Bool)1); else if ( (val != ((void*)0) && "no" != ((void*)0) && vgPlain_strcmp((val),("no"))==0) ? ((Bool)1) : ((Bool)0) ) (vgPlain_clo_sym_offsets) = ((Bool)0); else vgPlain_fmsg_bad_option(arg, "Invalid boolean value '%s'" " (should be 'yes' or 'no')\n", val); ((Bool)1); }) ) {}
      else if (( (arg != ((void*)0) && "--read-var-info""=" != ((void*)0) && vgPlain_strncmp((arg),("--read-var-info""="),(vgPlain_strlen("--read-var-info")+1))==0) ? ((Bool)1) : ((Bool)0) ) && ({ Char* val = &(arg)[ vgPlain_strlen("--read-var-info")+1 ]; if ( (val != ((void*)0) && "yes" != ((void*)0) && vgPlain_strcmp((val),("yes"))==0) ? ((Bool)1) : ((Bool)0) ) (vgPlain_clo_read_var_info) = ((Bool)1); else if ( (val != ((void*)0) && "no" != ((void*)0) && vgPlain_strcmp((val),("no"))==0) ? ((Bool)1) : ((Bool)0) ) (vgPlain_clo_read_var_info) = ((Bool)0); else vgPlain_fmsg_bad_option(arg, "Invalid boolean value '%s'" " (should be 'yes' or 'no')\n", val); ((Bool)1); }) ) {}

      else if (( (arg != ((void*)0) && "--dump-error""=" != ((void*)0) && vgPlain_strncmp((arg),("--dump-error""="),(vgPlain_strlen("--dump-error")+1))==0) ? ((Bool)1) : ((Bool)0) ) && ({ Char* val = &(arg)[ vgPlain_strlen("--dump-error")+1 ]; Char* s; Long n = vgPlain_strtoll10( val, &s ); (vgPlain_clo_dump_error) = n; if ('\0' != s[0] || (vgPlain_clo_dump_error) != n) vgPlain_fmsg_bad_option(arg, ""); ((Bool)1); }) ) {}
      else if (( (arg != ((void*)0) && "--input-fd""=" != ((void*)0) && vgPlain_strncmp((arg),("--input-fd""="),(vgPlain_strlen("--input-fd")+1))==0) ? ((Bool)1) : ((Bool)0) ) && ({ Char* val = &(arg)[ vgPlain_strlen("--input-fd")+1 ]; Char* s; Long n = vgPlain_strtoll10( val, &s ); (vgPlain_clo_input_fd) = n; if ('\0' != s[0] || (vgPlain_clo_input_fd) != n) vgPlain_fmsg_bad_option(arg, ""); ((Bool)1); }) ) {}
      else if (( (arg != ((void*)0) && "--sanity-level""=" != ((void*)0) && vgPlain_strncmp((arg),("--sanity-level""="),(vgPlain_strlen("--sanity-level")+1))==0) ? ((Bool)1) : ((Bool)0) ) && ({ Char* val = &(arg)[ vgPlain_strlen("--sanity-level")+1 ]; Char* s; Long n = vgPlain_strtoll10( val, &s ); (vgPlain_clo_sanity_level) = n; if ('\0' != s[0] || (vgPlain_clo_sanity_level) != n) vgPlain_fmsg_bad_option(arg, ""); ((Bool)1); }) ) {}
      else if (( ((arg) != ((void*)0) && "--num-callers""=" != ((void*)0) &&
 vgPlain_strncmp
# 583 "m_main.c"
              (((arg)),("--num-callers""="),(vgPlain_strlen("--num-callers")+1))==0) ? ((Bool)1) : ((Bool)0) ) && ({ Char* val = &((arg))[
 vgPlain_strlen
# 583 "m_main.c"
              ("--num-callers")+1 ]; Char* s; Long n =
 vgPlain_strtoll10
# 583 "m_main.c"
              ( val, &s ); ((vgPlain_clo_backtrace_size)) = n; if ('\0' != s[0] || ((vgPlain_clo_backtrace_size)) != n)
 vgPlain_fmsg_bad_option
# 583 "m_main.c"
              ((arg), ""); if (((vgPlain_clo_backtrace_size)) < ((1)) || ((vgPlain_clo_backtrace_size)) > ((500))) {
 vgPlain_fmsg_bad_option
# 583 "m_main.c"
              ((arg), "'%s' argument must be between %lld and %lld\n", ("--num-callers"), (Long)((1)), (Long)((500))); } ((Bool)1); }) )
                                                                           {}

      else if (( ((arg) != ((void*)0) && ("--smc-check=none") != ((void*)0) &&
 vgPlain_strcmp
# 586 "m_main.c"
              (((arg)),(("--smc-check=none")))==0) ? ((Bool)1) : ((Bool)0) ) && ({ (vgPlain_clo_smc_check) = (Vg_SmcNone); ((Bool)1); }) )
                                                               ;
      else if (( ((arg) != ((void*)0) && ("--smc-check=stack") != ((void*)0) &&
 vgPlain_strcmp
# 588 "m_main.c"
              (((arg)),(("--smc-check=stack")))==0) ? ((Bool)1) : ((Bool)0) ) && ({ (vgPlain_clo_smc_check) = (Vg_SmcStack); ((Bool)1); }) )
                                                                ;
      else if (( ((arg) != ((void*)0) && ("--smc-check=all") != ((void*)0) &&
 vgPlain_strcmp
# 590 "m_main.c"
              (((arg)),(("--smc-check=all")))==0) ? ((Bool)1) : ((Bool)0) ) && ({ (vgPlain_clo_smc_check) = (Vg_SmcAll); ((Bool)1); }) )
                                                              ;
      else if (( ((arg) != ((void*)0) && ("--smc-check=all-non-file") != ((void*)0) &&

 vgPlain_strcmp
# 592 "m_main.c"
              (((arg)),(("--smc-check=all-non-file")))==0) ? ((Bool)1) : ((Bool)0) ) && ({ (vgPlain_clo_smc_check) = (Vg_SmcAllNonFile); ((Bool)1); }) )

                                                                     ;

      else if (( (arg != ((void*)0) && "--kernel-variant""=" != ((void*)0) && vgPlain_strncmp((arg),("--kernel-variant""="),(vgPlain_strlen("--kernel-variant")+1))==0) ? ((Bool)1) : ((Bool)0) ) && ({ Char* val = &(arg)[ vgPlain_strlen("--kernel-variant")+1 ]; (vgPlain_clo_kernel_variant) = val; ((Bool)1); }) ) {}

      else if (( (arg != ((void*)0) && "--dsymutil""=" != ((void*)0) && vgPlain_strncmp((arg),("--dsymutil""="),(vgPlain_strlen("--dsymutil")+1))==0) ? ((Bool)1) : ((Bool)0) ) && ({ Char* val = &(arg)[ vgPlain_strlen("--dsymutil")+1 ]; if ( (val != ((void*)0) && "yes" != ((void*)0) && vgPlain_strcmp((val),("yes"))==0) ? ((Bool)1) : ((Bool)0) ) (vgPlain_clo_dsymutil) = ((Bool)1); else if ( (val != ((void*)0) && "no" != ((void*)0) && vgPlain_strcmp((val),("no"))==0) ? ((Bool)1) : ((Bool)0) ) (vgPlain_clo_dsymutil) = ((Bool)0); else vgPlain_fmsg_bad_option(arg, "Invalid boolean value '%s'" " (should be 'yes' or 'no')\n", val); ((Bool)1); }) ) {}

      else if (( (arg != ((void*)0) && "--trace-children-skip""=" != ((void*)0) &&
 vgPlain_strncmp
# 600 "m_main.c"
              ((arg),("--trace-children-skip""="),(vgPlain_strlen("--trace-children-skip")+1))==0) ? ((Bool)1) : ((Bool)0) ) && ({ Char* val = &(arg)[
 vgPlain_strlen
# 600 "m_main.c"
              ("--trace-children-skip")+1 ]; (vgPlain_clo_trace_children_skip) = val; ((Bool)1); }) )
                                                             {}
      else if (( (arg != ((void*)0) && "--trace-children-skip-by-arg""=" != ((void*)0) &&
 vgPlain_strncmp
# 602 "m_main.c"
              ((arg),("--trace-children-skip-by-arg""="),(vgPlain_strlen("--trace-children-skip-by-arg")+1))==0) ? ((Bool)1) : ((Bool)0) ) && ({ Char* val = &(arg)[
 vgPlain_strlen
# 602 "m_main.c"
              ("--trace-children-skip-by-arg")+1 ]; (vgPlain_clo_trace_children_skip_by_arg) = val; ((Bool)1); }) )
                                                                    {}

      else if (( ((arg) != ((void*)0) && "--vex-iropt-verbosity""=" != ((void*)0) &&
 vgPlain_strncmp
# 605 "m_main.c"
              (((arg)),("--vex-iropt-verbosity""="),(vgPlain_strlen("--vex-iropt-verbosity")+1))==0) ? ((Bool)1) : ((Bool)0) ) && ({ Char* val = &((arg))[
 vgPlain_strlen
# 605 "m_main.c"
              ("--vex-iropt-verbosity")+1 ]; Char* s; Long n =
 vgPlain_strtoll10
# 605 "m_main.c"
              ( val, &s ); ((vgPlain_clo_vex_control.iropt_verbosity)) = n; if ('\0' != s[0] || ((vgPlain_clo_vex_control.iropt_verbosity)) != n)
 vgPlain_fmsg_bad_option
# 605 "m_main.c"
              ((arg), ""); if (((vgPlain_clo_vex_control.iropt_verbosity)) < ((0)) || ((vgPlain_clo_vex_control.iropt_verbosity)) > ((10))) {
 vgPlain_fmsg_bad_option
# 605 "m_main.c"
              ((arg), "'%s' argument must be between %lld and %lld\n", ("--vex-iropt-verbosity"), (Long)((0)), (Long)((10))); } ((Bool)1); }) )
                                                                    {}
      else if (( ((arg) != ((void*)0) && "--vex-iropt-level""=" != ((void*)0) &&
 vgPlain_strncmp
# 607 "m_main.c"
              (((arg)),("--vex-iropt-level""="),(vgPlain_strlen("--vex-iropt-level")+1))==0) ? ((Bool)1) : ((Bool)0) ) && ({ Char* val = &((arg))[
 vgPlain_strlen
# 607 "m_main.c"
              ("--vex-iropt-level")+1 ]; Char* s; Long n =
 vgPlain_strtoll10
# 607 "m_main.c"
              ( val, &s ); ((vgPlain_clo_vex_control.iropt_level)) = n; if ('\0' != s[0] || ((vgPlain_clo_vex_control.iropt_level)) != n)
 vgPlain_fmsg_bad_option
# 607 "m_main.c"
              ((arg), ""); if (((vgPlain_clo_vex_control.iropt_level)) < ((0)) || ((vgPlain_clo_vex_control.iropt_level)) > ((2))) {
 vgPlain_fmsg_bad_option
# 607 "m_main.c"
              ((arg), "'%s' argument must be between %lld and %lld\n", ("--vex-iropt-level"), (Long)((0)), (Long)((2))); } ((Bool)1); }) )
                                                               {}
      else if (( ((arg) != ((void*)0) && ("--vex-iropt-register-updates=unwindregs-at-mem-access") != ((void*)0) &&


 vgPlain_strcmp
# 609 "m_main.c"
              (((arg)),(("--vex-iropt-register-updates=unwindregs-at-mem-access")))==0) ? ((Bool)1) : ((Bool)0) ) && ({ (vgPlain_clo_vex_control.iropt_register_updates) = (VexRegUpdUnwindregsAtMemAccess); ((Bool)1); }) )


                                                      ;
      else if (( ((arg) != ((void*)0) && ("--vex-iropt-register-updates=allregs-at-mem-access") != ((void*)0) &&


 vgPlain_strcmp
# 613 "m_main.c"
              (((arg)),(("--vex-iropt-register-updates=allregs-at-mem-access")))==0) ? ((Bool)1) : ((Bool)0) ) && ({ (vgPlain_clo_vex_control.iropt_register_updates) = (VexRegUpdAllregsAtMemAccess); ((Bool)1); }) )


                                                   ;
      else if (( ((arg) != ((void*)0) && ("--vex-iropt-register-updates=allregs-at-each-insn") != ((void*)0) &&


 vgPlain_strcmp
# 617 "m_main.c"
              (((arg)),(("--vex-iropt-register-updates=allregs-at-each-insn")))==0) ? ((Bool)1) : ((Bool)0) ) && ({ (vgPlain_clo_vex_control.iropt_register_updates) = (VexRegUpdAllregsAtEachInsn); ((Bool)1); }) )


                                                  ;
      else if (( ((arg) != ((void*)0) && "--vex-iropt-unroll-thresh""=" != ((void*)0) &&
 vgPlain_strncmp
# 621 "m_main.c"
              (((arg)),("--vex-iropt-unroll-thresh""="),(vgPlain_strlen("--vex-iropt-unroll-thresh")+1))==0) ? ((Bool)1) : ((Bool)0) ) && ({ Char* val = &((arg))[
 vgPlain_strlen
# 621 "m_main.c"
              ("--vex-iropt-unroll-thresh")+1 ]; Char* s; Long n =
 vgPlain_strtoll10
# 621 "m_main.c"
              ( val, &s ); ((vgPlain_clo_vex_control.iropt_unroll_thresh)) = n; if ('\0' != s[0] || ((vgPlain_clo_vex_control.iropt_unroll_thresh)) != n)
 vgPlain_fmsg_bad_option
# 621 "m_main.c"
              ((arg), ""); if (((vgPlain_clo_vex_control.iropt_unroll_thresh)) < ((0)) || ((vgPlain_clo_vex_control.iropt_unroll_thresh)) > ((400))) {
 vgPlain_fmsg_bad_option
# 621 "m_main.c"
              ((arg), "'%s' argument must be between %lld and %lld\n", ("--vex-iropt-unroll-thresh"), (Long)((0)), (Long)((400))); } ((Bool)1); }) )
                                                                         {}
      else if (( ((arg) != ((void*)0) && "--vex-guest-max-insns""=" != ((void*)0) &&
 vgPlain_strncmp
# 623 "m_main.c"
              (((arg)),("--vex-guest-max-insns""="),(vgPlain_strlen("--vex-guest-max-insns")+1))==0) ? ((Bool)1) : ((Bool)0) ) && ({ Char* val = &((arg))[
 vgPlain_strlen
# 623 "m_main.c"
              ("--vex-guest-max-insns")+1 ]; Char* s; Long n =
 vgPlain_strtoll10
# 623 "m_main.c"
              ( val, &s ); ((vgPlain_clo_vex_control.guest_max_insns)) = n; if ('\0' != s[0] || ((vgPlain_clo_vex_control.guest_max_insns)) != n)
 vgPlain_fmsg_bad_option
# 623 "m_main.c"
              ((arg), ""); if (((vgPlain_clo_vex_control.guest_max_insns)) < ((1)) || ((vgPlain_clo_vex_control.guest_max_insns)) > ((100))) {
 vgPlain_fmsg_bad_option
# 623 "m_main.c"
              ((arg), "'%s' argument must be between %lld and %lld\n", ("--vex-guest-max-insns"), (Long)((1)), (Long)((100))); } ((Bool)1); }) )
                                                                     {}
      else if (( ((arg) != ((void*)0) && "--vex-guest-chase-thresh""=" != ((void*)0) &&
 vgPlain_strncmp
# 625 "m_main.c"
              (((arg)),("--vex-guest-chase-thresh""="),(vgPlain_strlen("--vex-guest-chase-thresh")+1))==0) ? ((Bool)1) : ((Bool)0) ) && ({ Char* val = &((arg))[
 vgPlain_strlen
# 625 "m_main.c"
              ("--vex-guest-chase-thresh")+1 ]; Char* s; Long n =
 vgPlain_strtoll10
# 625 "m_main.c"
              ( val, &s ); ((vgPlain_clo_vex_control.guest_chase_thresh)) = n; if ('\0' != s[0] || ((vgPlain_clo_vex_control.guest_chase_thresh)) != n)
 vgPlain_fmsg_bad_option
# 625 "m_main.c"
              ((arg), ""); if (((vgPlain_clo_vex_control.guest_chase_thresh)) < ((0)) || ((vgPlain_clo_vex_control.guest_chase_thresh)) > ((99))) {
 vgPlain_fmsg_bad_option
# 625 "m_main.c"
              ((arg), "'%s' argument must be between %lld and %lld\n", ("--vex-guest-chase-thresh"), (Long)((0)), (Long)((99))); } ((Bool)1); }) )
                                                                       {}
      else if (( (arg != ((void*)0) && "--vex-guest-chase-cond""=" != ((void*)0) &&
 vgPlain_strncmp
# 627 "m_main.c"
              ((arg),("--vex-guest-chase-cond""="),(vgPlain_strlen("--vex-guest-chase-cond")+1))==0) ? ((Bool)1) : ((Bool)0) ) && ({ Char* val = &(arg)[
 vgPlain_strlen
# 627 "m_main.c"
              ("--vex-guest-chase-cond")+1 ]; if ( (val != ((void*)0) && "yes" != ((void*)0) &&
 vgPlain_strcmp
# 627 "m_main.c"
              ((val),("yes"))==0) ? ((Bool)1) : ((Bool)0) ) (vgPlain_clo_vex_control.guest_chase_cond) = ((Bool)1); else if ( (val != ((void*)0) && "no" != ((void*)0) &&
 vgPlain_strcmp
# 627 "m_main.c"
              ((val),("no"))==0) ? ((Bool)1) : ((Bool)0) ) (vgPlain_clo_vex_control.guest_chase_cond) = ((Bool)0); else
 vgPlain_fmsg_bad_option
# 627 "m_main.c"
              (arg, "Invalid boolean value '%s'" " (should be 'yes' or 'no')\n", val); ((Bool)1); }) )
                                                              {}

      else if (( (arg != ((void*)0) && "--log-fd""=" != ((void*)0) && vgPlain_strncmp((arg),("--log-fd""="),(vgPlain_strlen("--log-fd")+1))==0) ? ((Bool)1) : ((Bool)0) ) && ({ Char* val = &(arg)[ vgPlain_strlen("--log-fd")+1 ]; Char* s; Long n = vgPlain_strtoll10( val, &s ); (tmp_log_fd) = n; if ('\0' != s[0] || (tmp_log_fd) != n) vgPlain_fmsg_bad_option(arg, ""); ((Bool)1); }) ) {
         log_to = VgLogTo_Fd;
         log_fsname_unexpanded = ((void*)0);
      }
      else if (( (arg != ((void*)0) && "--xml-fd""=" != ((void*)0) && vgPlain_strncmp((arg),("--xml-fd""="),(vgPlain_strlen("--xml-fd")+1))==0) ? ((Bool)1) : ((Bool)0) ) && ({ Char* val = &(arg)[ vgPlain_strlen("--xml-fd")+1 ]; Char* s; Long n = vgPlain_strtoll10( val, &s ); (tmp_xml_fd) = n; if ('\0' != s[0] || (tmp_xml_fd) != n) vgPlain_fmsg_bad_option(arg, ""); ((Bool)1); }) ) {
         xml_to = VgLogTo_Fd;
         xml_fsname_unexpanded = ((void*)0);
      }

      else if (( (arg != ((void*)0) && "--log-file""=" != ((void*)0) && vgPlain_strncmp((arg),("--log-file""="),(vgPlain_strlen("--log-file")+1))==0) ? ((Bool)1) : ((Bool)0) ) && ({ Char* val = &(arg)[ vgPlain_strlen("--log-file")+1 ]; (log_fsname_unexpanded) = val; ((Bool)1); }) ) {
         log_to = VgLogTo_File;
      }
      else if (( (arg != ((void*)0) && "--xml-file""=" != ((void*)0) && vgPlain_strncmp((arg),("--xml-file""="),(vgPlain_strlen("--xml-file")+1))==0) ? ((Bool)1) : ((Bool)0) ) && ({ Char* val = &(arg)[ vgPlain_strlen("--xml-file")+1 ]; (xml_fsname_unexpanded) = val; ((Bool)1); }) ) {
         xml_to = VgLogTo_File;
      }

      else if (( (arg != ((void*)0) && "--log-socket""=" != ((void*)0) && vgPlain_strncmp((arg),("--log-socket""="),(vgPlain_strlen("--log-socket")+1))==0) ? ((Bool)1) : ((Bool)0) ) && ({ Char* val = &(arg)[ vgPlain_strlen("--log-socket")+1 ]; (log_fsname_unexpanded) = val; ((Bool)1); }) ) {
         log_to = VgLogTo_Socket;
      }
      else if (( (arg != ((void*)0) && "--xml-socket""=" != ((void*)0) && vgPlain_strncmp((arg),("--xml-socket""="),(vgPlain_strlen("--xml-socket")+1))==0) ? ((Bool)1) : ((Bool)0) ) && ({ Char* val = &(arg)[ vgPlain_strlen("--xml-socket")+1 ]; (xml_fsname_unexpanded) = val; ((Bool)1); }) ) {
         xml_to = VgLogTo_Socket;
      }

      else if (( (arg != ((void*)0) && "--xml-user-comment""=" != ((void*)0) &&
 vgPlain_strncmp
# 653 "m_main.c"
              ((arg),("--xml-user-comment""="),(vgPlain_strlen("--xml-user-comment")+1))==0) ? ((Bool)1) : ((Bool)0) ) && ({ Char* val = &(arg)[
 vgPlain_strlen
# 653 "m_main.c"
              ("--xml-user-comment")+1 ]; (vgPlain_clo_xml_user_comment) = val; ((Bool)1); }) )
                                                         {}

      else if (( (arg != ((void*)0) && "--suppressions""=" != ((void*)0) && vgPlain_strncmp((arg),("--suppressions""="),(vgPlain_strlen("--suppressions")+1))==0) ? ((Bool)1) : ((Bool)0) ) && ({ Char* val = &(arg)[ vgPlain_strlen("--suppressions")+1 ]; (tmp_str) = val; ((Bool)1); }) ) {
         if (vgPlain_clo_n_suppressions >= 100) {
            vgPlain_fmsg_bad_option(arg,
               "Too many suppression files specified.\n"
               "Increase VG_CLO_MAX_SFILES and recompile.\n");
         }
         vgPlain_clo_suppressions[vgPlain_clo_n_suppressions] = tmp_str;
         vgPlain_clo_n_suppressions++;
      }

      else if (( (arg != ((void*)0) && "--fullpath-after""=" != ((void*)0) && vgPlain_strncmp((arg),("--fullpath-after""="),(vgPlain_strlen("--fullpath-after")+1))==0) ? ((Bool)1) : ((Bool)0) ) && ({ Char* val = &(arg)[ vgPlain_strlen("--fullpath-after")+1 ]; (tmp_str) = val; ((Bool)1); }) ) {
         if (vgPlain_clo_n_fullpath_after >= 100) {
            vgPlain_fmsg_bad_option(arg,
               "Too many --fullpath-after= specifications.\n"
               "Increase VG_CLO_MAX_FULLPATH_AFTER and recompile.\n");
         }
         vgPlain_clo_fullpath_after[vgPlain_clo_n_fullpath_after] = tmp_str;
         vgPlain_clo_n_fullpath_after++;
      }

      else if (( (arg != ((void*)0) && "--require-text-symbol""=" != ((void*)0) && vgPlain_strncmp((arg),("--require-text-symbol""="),(vgPlain_strlen("--require-text-symbol")+1))==0) ? ((Bool)1) : ((Bool)0) ) && ({ Char* val = &(arg)[ vgPlain_strlen("--require-text-symbol")+1 ]; (tmp_str) = val; ((Bool)1); }) ) {
         if (vgPlain_clo_n_req_tsyms >= 100) {
            vgPlain_fmsg_bad_option(arg,
               "Too many --require-text-symbol= specifications.\n"
               "Increase VG_CLO_MAX_REQ_TSYMS and recompile.\n");
         }






         Char patt[7];
         Bool ok = ((Bool)1);
         ok = tmp_str && vgPlain_strlen(tmp_str) > 0;
         if (ok) {
           patt[0] = patt[3] = tmp_str[0];
           patt[1] = patt[4] = '?';
           patt[2] = patt[5] = '*';
           patt[6] = 0;
           ok = vgPlain_string_match(patt, tmp_str);
         }
         if (!ok) {
            vgPlain_fmsg_bad_option(arg,
               "Invalid --require-text-symbol= specification.\n");
         }
         vgPlain_clo_req_tsyms[vgPlain_clo_n_req_tsyms] = tmp_str;
         vgPlain_clo_n_req_tsyms++;
      }


      else if (( (arg != ((void*)0) && "--trace-flags""=" != ((void*)0) && vgPlain_strncmp((arg),("--trace-flags""="),(vgPlain_strlen("--trace-flags")+1))==0) ? ((Bool)1) : ((Bool)0) ) && ({ Char* val = &(arg)[ vgPlain_strlen("--trace-flags")+1 ]; (tmp_str) = val; ((Bool)1); }) ) {
         Int j;

         if (8 != vgPlain_strlen(tmp_str)) {
            vgPlain_fmsg_bad_option(arg,
               "--trace-flags argument must have 8 digits\n");
         }
         for (j = 0; j < 8; j++) {
            if ('0' == tmp_str[j]) { }
            else if ('1' == tmp_str[j]) vgPlain_clo_trace_flags |= (1 << (7-j));
            else {
               vgPlain_fmsg_bad_option(arg,
                  "--trace-flags argument can only contain 0s and 1s\n");
            }
         }
      }


      else if (( (arg != ((void*)0) && "--profile-flags""=" != ((void*)0) && vgPlain_strncmp((arg),("--profile-flags""="),(vgPlain_strlen("--profile-flags")+1))==0) ? ((Bool)1) : ((Bool)0) ) && ({ Char* val = &(arg)[ vgPlain_strlen("--profile-flags")+1 ]; (tmp_str) = val; ((Bool)1); }) ) {
         Int j;

         if (8 != vgPlain_strlen(tmp_str)) {
            vgPlain_fmsg_bad_option(arg,
               "--profile-flags argument must have 8 digits\n");
         }
         for (j = 0; j < 8; j++) {
            if ('0' == tmp_str[j]) { }
            else if ('1' == tmp_str[j]) vgPlain_clo_profile_flags |= (1 << (7-j));
            else {
               vgPlain_fmsg_bad_option(arg,
                  "--profile-flags argument can only contain 0s and 1s\n");
            }
         }
      }

      else if (( (arg != ((void*)0) && "--trace-notbelow""=" != ((void*)0) && vgPlain_strncmp((arg),("--trace-notbelow""="),(vgPlain_strlen("--trace-notbelow")+1))==0) ? ((Bool)1) : ((Bool)0) ) && ({ Char* val = &(arg)[ vgPlain_strlen("--trace-notbelow")+1 ]; Char* s; Long n = vgPlain_strtoll10( val, &s ); (vgPlain_clo_trace_notbelow) = n; if ('\0' != s[0] || (vgPlain_clo_trace_notbelow) != n) vgPlain_fmsg_bad_option(arg, ""); ((Bool)1); }) ) {}

      else if (( (arg != ((void*)0) && "--trace-notabove""=" != ((void*)0) && vgPlain_strncmp((arg),("--trace-notabove""="),(vgPlain_strlen("--trace-notabove")+1))==0) ? ((Bool)1) : ((Bool)0) ) && ({ Char* val = &(arg)[ vgPlain_strlen("--trace-notabove")+1 ]; Char* s; Long n = vgPlain_strtoll10( val, &s ); (vgPlain_clo_trace_notabove) = n; if ('\0' != s[0] || (vgPlain_clo_trace_notabove) != n) vgPlain_fmsg_bad_option(arg, ""); ((Bool)1); }) ) {}

      else if (( ((arg) != ((void*)0) && ("--gen-suppressions=no") != ((void*)0) &&
 vgPlain_strcmp
# 746 "m_main.c"
              (((arg)),(("--gen-suppressions=no")))==0) ? ((Bool)1) : ((Bool)0) ) && ({ (vgPlain_clo_gen_suppressions) = (0); ((Bool)1); }) )
                                                             {}
      else if (( ((arg) != ((void*)0) && ("--gen-suppressions=yes") != ((void*)0) &&
 vgPlain_strcmp
# 748 "m_main.c"
              (((arg)),(("--gen-suppressions=yes")))==0) ? ((Bool)1) : ((Bool)0) ) && ({ (vgPlain_clo_gen_suppressions) = (1); ((Bool)1); }) )
                                                             {}
      else if (( ((arg) != ((void*)0) && ("--gen-suppressions=all") != ((void*)0) &&
 vgPlain_strcmp
# 750 "m_main.c"
              (((arg)),(("--gen-suppressions=all")))==0) ? ((Bool)1) : ((Bool)0) ) && ({ (vgPlain_clo_gen_suppressions) = (2); ((Bool)1); }) )
                                                             {}

      else if ( ! vgPlain_needs.command_line_options
             || ! ( ((void) (__builtin_expect(!!(vgPlain_tdict.tool_process_cmd_line_option), 1) ? 0 : (vgPlain_assert_fail ( ((Bool)0), (const Char*)"VG_(tdict).tool_process_cmd_line_option", (const Char*)"m_main.c", 754, (const Char*)__PRETTY_FUNCTION__, "you forgot to set VgToolInterface function '" "tool_process_cmd_line_option" "'"), 0))), vgPlain_tdict.tool_process_cmd_line_option(arg) ) ) {
         vgPlain_fmsg_bad_option(arg, "");
      }
   }




   if (vgPlain_clo_vgdb_prefix == ((void*)0))
     vgPlain_clo_vgdb_prefix = vgPlain_vgdb_prefix_default();



   if (vgPlain_clo_vex_control.guest_chase_thresh
       >= vgPlain_clo_vex_control.guest_max_insns)
      vgPlain_clo_vex_control.guest_chase_thresh
         = vgPlain_clo_vex_control.guest_max_insns - 1;

   if (vgPlain_clo_vex_control.guest_chase_thresh < 0)
      vgPlain_clo_vex_control.guest_chase_thresh = 0;



   if (vgPlain_clo_verbosity < 0)
      vgPlain_clo_verbosity = 0;

   if (vgPlain_clo_trace_notbelow == -1) {
     if (vgPlain_clo_trace_notabove == -1) {

       vgPlain_clo_trace_notbelow = 2147483647;
       vgPlain_clo_trace_notabove = 0;
     } else {

       vgPlain_clo_trace_notbelow = 0;
     }
   } else {
     if (vgPlain_clo_trace_notabove == -1) {

       vgPlain_clo_trace_notabove = 2147483647;
     } else {

     }
   }

   vgPlain_dyn_vgdb_error = vgPlain_clo_vgdb_error;

   if (vgPlain_clo_gen_suppressions > 0 &&
       !vgPlain_needs.core_errors && !vgPlain_needs.tool_errors) {
      vgPlain_fmsg_bad_option("--gen-suppressions=yes",
         "Can't use --gen-suppressions= with %s\n"
         "because it doesn't generate errors.\n", vgPlain_details.name);
   }



   if (vgPlain_clo_xml && !vgPlain_needs.xml_output) {
      vgPlain_clo_xml = ((Bool)0);
      vgPlain_fmsg_bad_option("--xml=yes",
         "%s does not support XML output.\n", vgPlain_details.name);

   }

   ((void) (__builtin_expect(!!(vgPlain_clo_gen_suppressions >= 0), 1) ? 0 : (vgPlain_assert_fail ( ((Bool)1), "VG_(clo_gen_suppressions) >= 0", "m_main.c", 816, __PRETTY_FUNCTION__, ""), 0)));
   ((void) (__builtin_expect(!!(vgPlain_clo_gen_suppressions <= 2), 1) ? 0 : (vgPlain_assert_fail ( ((Bool)1), "VG_(clo_gen_suppressions) <= 2", "m_main.c", 817, __PRETTY_FUNCTION__, ""), 0)));





   if (vgPlain_clo_xml) {
# 832 "m_main.c"
      if (vgPlain_clo_gen_suppressions == 1) {
         vgPlain_fmsg_bad_option(
            "--xml=yes together with --gen-suppressions=yes",
            "When --xml=yes is specified, --gen-suppressions=no\n"
            "or --gen-suppressions=all is allowed, but not "
            "--gen-suppressions=yes.\n");
      }




      if (vgPlain_clo_db_attach) {
         vgPlain_fmsg_bad_option(
            "--xml=yes together with --db-attach=yes",
            "--db-attach=yes is not allowed with --xml=yes\n"
            "because it would require user input.\n");
      }




      if (vgPlain_clo_dump_error > 0) {
         vgPlain_fmsg_bad_option("--xml=yes together with --dump-error", "");
      }


      vgPlain_clo_error_limit = ((Bool)0);





   }
# 879 "m_main.c"
   ((void) (__builtin_expect(!!(vgPlain_log_output_sink.fd == 2), 1) ? 0 : (vgPlain_assert_fail ( ((Bool)1), "VG_(log_output_sink).fd == 2", "m_main.c", 879, __PRETTY_FUNCTION__, ""), 0)));
   ((void) (__builtin_expect(!!(vgPlain_log_output_sink.is_socket == ((Bool)0)), 1) ? 0 : (vgPlain_assert_fail ( ((Bool)1), "VG_(log_output_sink).is_socket == False", "m_main.c", 880, __PRETTY_FUNCTION__, ""), 0)));
   ((void) (__builtin_expect(!!(vgPlain_clo_log_fname_expanded == ((void*)0)), 1) ? 0 : (vgPlain_assert_fail ( ((Bool)1), "VG_(clo_log_fname_expanded) == NULL", "m_main.c", 881, __PRETTY_FUNCTION__, ""), 0)));

   ((void) (__builtin_expect(!!(vgPlain_xml_output_sink.fd == -1), 1) ? 0 : (vgPlain_assert_fail ( ((Bool)1), "VG_(xml_output_sink).fd == -1", "m_main.c", 883, __PRETTY_FUNCTION__, ""), 0)));
   ((void) (__builtin_expect(!!(vgPlain_xml_output_sink.is_socket == ((Bool)0)), 1) ? 0 : (vgPlain_assert_fail ( ((Bool)1), "VG_(xml_output_sink).is_socket == False", "m_main.c", 884, __PRETTY_FUNCTION__, ""), 0)));
   ((void) (__builtin_expect(!!(vgPlain_clo_xml_fname_expanded == ((void*)0)), 1) ? 0 : (vgPlain_assert_fail ( ((Bool)1), "VG_(clo_xml_fname_expanded) == NULL", "m_main.c", 885, __PRETTY_FUNCTION__, ""), 0)));



   switch (log_to) {

      case VgLogTo_Fd:
         ((void) (__builtin_expect(!!(log_fsname_unexpanded == ((void*)0)), 1) ? 0 : (vgPlain_assert_fail ( ((Bool)1), "log_fsname_unexpanded == NULL", "m_main.c", 892, __PRETTY_FUNCTION__, ""), 0)));
         break;

      case VgLogTo_File: {
         Char* logfilename;

         ((void) (__builtin_expect(!!(log_fsname_unexpanded != ((void*)0)), 1) ? 0 : (vgPlain_assert_fail ( ((Bool)1), "log_fsname_unexpanded != NULL", "m_main.c", 898, __PRETTY_FUNCTION__, ""), 0)));
         ((void) (__builtin_expect(!!(vgPlain_strlen(log_fsname_unexpanded) <= 900), 1) ? 0 : (vgPlain_assert_fail ( ((Bool)1), "VG_(strlen)(log_fsname_unexpanded) <= 900", "m_main.c", 899, __PRETTY_FUNCTION__, ""), 0)));



         logfilename = vgPlain_expand_file_name("--log-file",
                                             log_fsname_unexpanded);
         sres = vgPlain_open(logfilename,
                          0100|01|01000,
                          00400|00200);
         if (!sr_isError(sres)) {
            tmp_log_fd = sr_Res(sres);
            vgPlain_clo_log_fname_expanded = logfilename;
         } else {
            vgPlain_fmsg("can't create log file '%s': %s\n",
                      logfilename, vgPlain_strerror(sr_Err(sres)));
            vgPlain_exit(1);

         }
         break;
      }

      case VgLogTo_Socket: {
         ((void) (__builtin_expect(!!(log_fsname_unexpanded != ((void*)0)), 1) ? 0 : (vgPlain_assert_fail ( ((Bool)1), "log_fsname_unexpanded != NULL", "m_main.c", 921, __PRETTY_FUNCTION__, ""), 0)));
         ((void) (__builtin_expect(!!(vgPlain_strlen(log_fsname_unexpanded) <= 900), 1) ? 0 : (vgPlain_assert_fail ( ((Bool)1), "VG_(strlen)(log_fsname_unexpanded) <= 900", "m_main.c", 922, __PRETTY_FUNCTION__, ""), 0)));
         tmp_log_fd = vgPlain_connect_via_socket( log_fsname_unexpanded );
         if (tmp_log_fd == -1) {
            vgPlain_fmsg("Invalid --log-socket spec of '%s'\n",
                      log_fsname_unexpanded);
            vgPlain_exit(1);

  }
         if (tmp_log_fd == -2) {
            vgPlain_umsg("failed to connect to logging server '%s'.\n"
                      "Log messages will sent to stderr instead.\n",
                      log_fsname_unexpanded );


            ((void) (__builtin_expect(!!(vgPlain_log_output_sink.fd == 2), 1) ? 0 : (vgPlain_assert_fail ( ((Bool)1), "VG_(log_output_sink).fd == 2", "m_main.c", 936, __PRETTY_FUNCTION__, ""), 0)));
            tmp_log_fd = 2;
  } else {
            ((void) (__builtin_expect(!!(tmp_log_fd > 0), 1) ? 0 : (vgPlain_assert_fail ( ((Bool)1), "tmp_log_fd > 0", "m_main.c", 939, __PRETTY_FUNCTION__, ""), 0)));
            vgPlain_log_output_sink.is_socket = ((Bool)1);
         }
         break;
      }
   }



   switch (xml_to) {

      case VgLogTo_Fd:
         ((void) (__builtin_expect(!!(xml_fsname_unexpanded == ((void*)0)), 1) ? 0 : (vgPlain_assert_fail ( ((Bool)1), "xml_fsname_unexpanded == NULL", "m_main.c", 951, __PRETTY_FUNCTION__, ""), 0)));
         break;

      case VgLogTo_File: {
         Char* xmlfilename;

         ((void) (__builtin_expect(!!(xml_fsname_unexpanded != ((void*)0)), 1) ? 0 : (vgPlain_assert_fail ( ((Bool)1), "xml_fsname_unexpanded != NULL", "m_main.c", 957, __PRETTY_FUNCTION__, ""), 0)));
         ((void) (__builtin_expect(!!(vgPlain_strlen(xml_fsname_unexpanded) <= 900), 1) ? 0 : (vgPlain_assert_fail ( ((Bool)1), "VG_(strlen)(xml_fsname_unexpanded) <= 900", "m_main.c", 958, __PRETTY_FUNCTION__, ""), 0)));



         xmlfilename = vgPlain_expand_file_name("--xml-file",
                                             xml_fsname_unexpanded);
         sres = vgPlain_open(xmlfilename,
                          0100|01|01000,
                          00400|00200);
         if (!sr_isError(sres)) {
            tmp_xml_fd = sr_Res(sres);
            vgPlain_clo_xml_fname_expanded = xmlfilename;

            *xml_fname_unexpanded = vgPlain_strdup( "main.mpclo.2",
                                                 xml_fsname_unexpanded );
         } else {
            vgPlain_fmsg("can't create XML file '%s': %s\n",
                      xmlfilename, vgPlain_strerror(sr_Err(sres)));
            vgPlain_exit(1);

         }
         break;
      }

      case VgLogTo_Socket: {
         ((void) (__builtin_expect(!!(xml_fsname_unexpanded != ((void*)0)), 1) ? 0 : (vgPlain_assert_fail ( ((Bool)1), "xml_fsname_unexpanded != NULL", "m_main.c", 983, __PRETTY_FUNCTION__, ""), 0)));
         ((void) (__builtin_expect(!!(vgPlain_strlen(xml_fsname_unexpanded) <= 900), 1) ? 0 : (vgPlain_assert_fail ( ((Bool)1), "VG_(strlen)(xml_fsname_unexpanded) <= 900", "m_main.c", 984, __PRETTY_FUNCTION__, ""), 0)));
         tmp_xml_fd = vgPlain_connect_via_socket( xml_fsname_unexpanded );
         if (tmp_xml_fd == -1) {
            vgPlain_fmsg("Invalid --xml-socket spec of '%s'\n",
                      xml_fsname_unexpanded );
            vgPlain_exit(1);

  }
         if (tmp_xml_fd == -2) {
            vgPlain_umsg("failed to connect to XML logging server '%s'.\n"
                      "XML output will sent to stderr instead.\n",
                      xml_fsname_unexpanded);

            ((void) (__builtin_expect(!!(vgPlain_xml_output_sink.fd == 2), 1) ? 0 : (vgPlain_assert_fail ( ((Bool)1), "VG_(xml_output_sink).fd == 2", "m_main.c", 997, __PRETTY_FUNCTION__, ""), 0)));
            tmp_xml_fd = 2;
  } else {
            ((void) (__builtin_expect(!!(tmp_xml_fd > 0), 1) ? 0 : (vgPlain_assert_fail ( ((Bool)1), "tmp_xml_fd > 0", "m_main.c", 1000, __PRETTY_FUNCTION__, ""), 0)));
            vgPlain_xml_output_sink.is_socket = ((Bool)1);
         }
         break;
      }
   }






   if (vgPlain_clo_xml && tmp_xml_fd == -1) {
      vgPlain_fmsg_bad_option(
          "--xml=yes, but no XML destination specified",
          "--xml=yes has been specified, but there is no XML output\n"
          "destination.  You must specify an XML output destination\n"
          "using --xml-fd, --xml-file or --xml-socket.\n"
      );
   }



   if (tmp_log_fd >= 0) {


      tmp_log_fd = vgPlain_fcntl(tmp_log_fd, 0, vgPlain_fd_hard_limit);
      if (tmp_log_fd < 0) {
         vgPlain_message(Vg_UserMsg, "valgrind: failed to move logfile fd "
                                  "into safe range, using stderr\n");
         vgPlain_log_output_sink.fd = 2;
         vgPlain_log_output_sink.is_socket = ((Bool)0);
      } else {
         vgPlain_log_output_sink.fd = tmp_log_fd;
         vgPlain_fcntl(vgPlain_log_output_sink.fd, 2, 1);
      }
   } else {


      vgPlain_log_output_sink.fd = -1;
      vgPlain_log_output_sink.is_socket = ((Bool)0);
   }



   if (tmp_xml_fd >= 0) {


      tmp_xml_fd = vgPlain_fcntl(tmp_xml_fd, 0, vgPlain_fd_hard_limit);
      if (tmp_xml_fd < 0) {
         vgPlain_message(Vg_UserMsg, "valgrind: failed to move XML file fd "
                                  "into safe range, using stderr\n");
         vgPlain_xml_output_sink.fd = 2;
         vgPlain_xml_output_sink.is_socket = ((Bool)0);
      } else {
         vgPlain_xml_output_sink.fd = tmp_xml_fd;
         vgPlain_fcntl(vgPlain_xml_output_sink.fd, 2, 1);
      }
   } else {


      vgPlain_xml_output_sink.fd = -1;
      vgPlain_xml_output_sink.is_socket = ((Bool)0);
   }



   if (vgPlain_clo_n_suppressions < 100 -1 &&
       (vgPlain_needs.core_errors || vgPlain_needs.tool_errors)) {


      static const Char default_supp[] = "default.supp";
      Int len = vgPlain_strlen(vgPlain_libdir) + 1 + sizeof(default_supp);
      Char *buf = vgPlain_arena_malloc(0, "main.mpclo.3", len);
      vgPlain_sprintf(buf, "%s/%s", vgPlain_libdir, default_supp);
      vgPlain_clo_suppressions[vgPlain_clo_n_suppressions] = buf;
      vgPlain_clo_n_suppressions++;
   }

   *logging_to_fd = log_to == VgLogTo_Fd || log_to == VgLogTo_Socket;
}


static void print_file_vars(Char* format)
{
   Int i = 0;

   while (format[i]) {
      if (format[i] == '%') {

         i++;
  if ('q' == format[i]) {
            i++;
            if ('{' == format[i]) {

        Char* qualname;
               Char* qual;
               i++;
               qualname = &format[i];
               while (((Bool)1)) {
    if ('}' == format[i]) {


       format[i] = 0;
                     qual = vgPlain_getenv(qualname);
       break;
                  }
                  i++;
               }

               vgPlain_printf_xml(
                  "<logfilequalifier> <var>%pS</var> "
                  "<value>%pS</value> </logfilequalifier>\n",
                  qualname,qual
               );
        format[i] = '}';
        i++;
     }
         }
      } else {
  i++;
      }
   }
}







static void umsg_arg(const Char* arg)
{
   SizeT len = vgPlain_strlen(arg);
   Char* special = " \\<>";
   Int i;
   for (i = 0; i < len; i++) {
      if (vgPlain_strchr(special, arg[i])) {
         vgPlain_umsg("\\");
      }
      vgPlain_umsg("%c", arg[i]);
   }
}


static void xml_arg(const Char* arg)
{
   vgPlain_printf_xml("%pS", arg);
}





static void print_preamble ( Bool logging_to_fd,
                             Char* xml_fname_unexpanded,
                             const HChar* toolname )
{
   Int i;
   HChar* xpre = vgPlain_clo_xml ? "  <line>" : "";
   HChar* xpost = vgPlain_clo_xml ? "</line>" : "";
   UInt (*umsg_or_xml)( const HChar*, ... )
      = vgPlain_clo_xml ? vgPlain_printf_xml : vgPlain_umsg;

   void (*umsg_or_xml_arg)( const Char* )
      = vgPlain_clo_xml ? xml_arg : umsg_arg;

   ((void) (__builtin_expect(!!(vgPlain_args_for_client), 1) ? 0 : (vgPlain_assert_fail ( ((Bool)1), "VG_(args_for_client)", "m_main.c", 1167, __PRETTY_FUNCTION__, ""), 0)));
   ((void) (__builtin_expect(!!(vgPlain_args_for_valgrind), 1) ? 0 : (vgPlain_assert_fail ( ((Bool)1), "VG_(args_for_valgrind)", "m_main.c", 1168, __PRETTY_FUNCTION__, ""), 0)));
   ((void) (__builtin_expect(!!(toolname), 1) ? 0 : (vgPlain_assert_fail ( ((Bool)1), "toolname", "m_main.c", 1169, __PRETTY_FUNCTION__, ""), 0)));

   if (vgPlain_clo_xml) {
      vgPlain_printf_xml("<?xml version=\"1.0\"?>\n");
      vgPlain_printf_xml("\n");
      vgPlain_printf_xml("<valgrindoutput>\n");
      vgPlain_printf_xml("\n");
      vgPlain_printf_xml("<protocolversion>4</protocolversion>\n");
      vgPlain_printf_xml("<protocoltool>%s</protocoltool>\n", toolname);
      vgPlain_printf_xml("\n");
   }

   if (vgPlain_clo_xml || vgPlain_clo_verbosity > 0) {

      if (vgPlain_clo_xml)
         vgPlain_printf_xml("<preamble>\n");


      umsg_or_xml( vgPlain_clo_xml ? "%s%pS%pS%pS, %pS%s\n" : "%s%s%s%s, %s%s\n",
                   xpre,
                   vgPlain_details.name,
                   ((void*)0) == vgPlain_details.version ? "" : "-",
                   ((void*)0) == vgPlain_details.version
                      ? (Char*)"" : vgPlain_details.version,
                   vgPlain_details.description,
                   xpost );

      if (vgPlain_strlen(toolname) >= 4 && ( (toolname != ((void*)0) && "exp-" != ((void*)0) && vgPlain_strncmp((toolname),("exp-"),(4))==0) ? ((Bool)1) : ((Bool)0) )) {
         umsg_or_xml(
            "%sNOTE: This is an Experimental-Class Valgrind Tool%s\n",
            xpre, xpost
         );
      }

      umsg_or_xml( vgPlain_clo_xml ? "%s%pS%s\n" : "%s%s%s\n",
                   xpre, vgPlain_details.copyright_author, xpost );


      umsg_or_xml(
         "%sUsing Valgrind-%s and LibVEX; rerun with -h for copyright info%s\n",
         xpre, "3.8.0-PRE1", xpost
      );





      umsg_or_xml("%sCommand: ", xpre);
      if (vgPlain_args_the_exename)
         umsg_or_xml_arg(vgPlain_args_the_exename);

      for (i = 0; i < vgPlain_sizeXA( vgPlain_args_for_client ); i++) {
         HChar* s = *(HChar**)vgPlain_indexXA( vgPlain_args_for_client, i );
         umsg_or_xml(" ");
         umsg_or_xml_arg(s);
      }
      umsg_or_xml("%s\n", xpost);

      if (vgPlain_clo_xml)
         vgPlain_printf_xml("</preamble>\n");
   }


   if (!vgPlain_clo_xml && vgPlain_clo_verbosity > 0 && !logging_to_fd) {
      vgPlain_umsg("Parent PID: %d\n", vgPlain_getppid());
   }
   else
   if (vgPlain_clo_xml) {
      vgPlain_printf_xml("\n");
      vgPlain_printf_xml("<pid>%d</pid>\n", vgPlain_getpid());
      vgPlain_printf_xml("<ppid>%d</ppid>\n", vgPlain_getppid());
      vgPlain_printf_xml("<tool>%pS</tool>\n", toolname);
      if (xml_fname_unexpanded)
         print_file_vars(xml_fname_unexpanded);
      if (vgPlain_clo_xml_user_comment) {



         vgPlain_printf_xml("<usercomment>%s</usercomment>\n",
                         vgPlain_clo_xml_user_comment);
      }
      vgPlain_printf_xml("\n");
      vgPlain_printf_xml("<args>\n");

      vgPlain_printf_xml("  <vargv>\n");
      if (vgPlain_name_of_launcher)
         vgPlain_printf_xml("    <exe>%pS</exe>\n",
                                vgPlain_name_of_launcher);
      else
         vgPlain_printf_xml("    <exe>%pS</exe>\n",
                                "(launcher name unknown)");
      for (i = 0; i < vgPlain_sizeXA( vgPlain_args_for_valgrind ); i++) {
         vgPlain_printf_xml(
            "    <arg>%pS</arg>\n",
            * (HChar**) vgPlain_indexXA( vgPlain_args_for_valgrind, i )
         );
      }
      vgPlain_printf_xml("  </vargv>\n");

      vgPlain_printf_xml("  <argv>\n");
      if (vgPlain_args_the_exename)
         vgPlain_printf_xml("    <exe>%pS</exe>\n",
                                vgPlain_args_the_exename);
      for (i = 0; i < vgPlain_sizeXA( vgPlain_args_for_client ); i++) {
         vgPlain_printf_xml(
            "    <arg>%pS</arg>\n",
            * (HChar**) vgPlain_indexXA( vgPlain_args_for_client, i )
         );
      }
      vgPlain_printf_xml("  </argv>\n");

      vgPlain_printf_xml("</args>\n");
   }


   if (vgPlain_clo_xml)
      vgPlain_printf_xml("\n");
   else if (vgPlain_clo_verbosity > 0)
      vgPlain_umsg("\n");
# 1298 "m_main.c"
   if (vgPlain_clo_verbosity > 1) {
      SysRes fd;
      VexArch vex_arch;
      VexArchInfo vex_archinfo;
      if (!logging_to_fd)
         vgPlain_message(Vg_DebugMsg, "\n");
      vgPlain_message(Vg_DebugMsg, "Valgrind options:\n");
      for (i = 0; i < vgPlain_sizeXA( vgPlain_args_for_valgrind ); i++) {
         vgPlain_message(Vg_DebugMsg,
                     "   %s\n",
                     * (HChar**) vgPlain_indexXA( vgPlain_args_for_valgrind, i ));
      }

      vgPlain_message(Vg_DebugMsg, "Contents of /proc/version:\n");
      fd = vgPlain_open ( "/proc/version", 00, 0 );
      if (sr_isError(fd)) {
         vgPlain_message(Vg_DebugMsg, "  can't open /proc/version\n");
      } else {

         Char version_buf[256];
         Int n = vgPlain_read ( sr_Res(fd), version_buf, 256 );
         ((void) (__builtin_expect(!!(n <= 256), 1) ? 0 : (vgPlain_assert_fail ( ((Bool)1), "n <= BUF_LEN", "m_main.c", 1319, __PRETTY_FUNCTION__, ""), 0)));
         if (n > 0) {
            version_buf[n-1] = '\0';
            vgPlain_message(Vg_DebugMsg, "  %s\n", version_buf);
         } else {
            vgPlain_message(Vg_DebugMsg, "  (empty?)\n");
         }
         vgPlain_close(sr_Res(fd));

      }

      vgPlain_machine_get_VexArchInfo( &vex_arch, &vex_archinfo );
      vgPlain_message(
         Vg_DebugMsg,
         "Arch and hwcaps: %s, %s\n",
         LibVEX_ppVexArch ( vex_arch ),
         LibVEX_ppVexHwCaps ( vex_arch, vex_archinfo.hwcaps )
      );
      vgPlain_message(
         Vg_DebugMsg,
         "Page sizes: currently %d, max supported %d\n",
         (Int)(1UL << 12), (Int)(1UL << 12)
      );
      vgPlain_message(Vg_DebugMsg,
                   "Valgrind library directory: %s\n", vgPlain_libdir);
   }
}
# 1356 "m_main.c"
static void setup_file_descriptors(void)
{
   struct vki_rlimit rl;
   Bool show = ((Bool)0);


   if (vgPlain_getrlimit(7, &rl) < 0) {
      rl.rlim_cur = 1024;
      rl.rlim_max = 1024;
   }
# 1375 "m_main.c"
   if (show)
      vgPlain_printf("fd limits: host, before: cur %lu max %lu\n",
                  (UWord)rl.rlim_cur, (UWord)rl.rlim_max);


   if (rl.rlim_cur + (10) <= rl.rlim_max) {
      rl.rlim_cur = rl.rlim_cur + (10);
   } else {
      rl.rlim_cur = rl.rlim_max;
   }


   vgPlain_fd_soft_limit = rl.rlim_cur - (10);
   vgPlain_fd_hard_limit = rl.rlim_cur - (10);


   vgPlain_setrlimit(7, &rl);

   if (show) {
      vgPlain_printf("fd limits: host,  after: cur %lu max %lu\n",
                  (UWord)rl.rlim_cur, (UWord)rl.rlim_max);
      vgPlain_printf("fd limits: guest       : cur %u max %u\n",
                  vgPlain_fd_soft_limit, vgPlain_fd_hard_limit);
   }

   if (vgPlain_cl_exec_fd != -1)
      vgPlain_cl_exec_fd = vgPlain_safe_fd( vgPlain_cl_exec_fd );
}






static
void show_BB_profile ( BBProfEntry tops[], UInt n_tops, ULong score_total )
{
   ULong score_cumul, score_here;
   Char buf_cumul[10], buf_here[10];
   Char name[64];
   Int r;

   vgPlain_printf("\n");
   vgPlain_printf("-----------------------------------------------------------\n");
   vgPlain_printf("--- BEGIN BB Profile (summary of scores)                ---\n");
   vgPlain_printf("-----------------------------------------------------------\n");
   vgPlain_printf("\n");

   vgPlain_printf("Total score = %lld\n\n", score_total);

   score_cumul = 0;
   for (r = 0; r < n_tops; r++) {
      if (tops[r].addr == 0)
         continue;
      name[0] = 0;
      vgPlain_get_fnname_w_offset(tops[r].addr, name, 64);
      name[63] = 0;
      score_here = tops[r].score;
      score_cumul += score_here;
      vgPlain_percentify(score_cumul, score_total, 2, 6, buf_cumul);
      vgPlain_percentify(score_here, score_total, 2, 6, buf_here);
      vgPlain_printf("%3d: (%9lld %s)   %9lld %s      0x%llx %s\n",
                  r,
                  score_cumul, buf_cumul,
                  score_here, buf_here, tops[r].addr, name );
   }

   vgPlain_printf("\n");
   vgPlain_printf("-----------------------------------------------------------\n");
   vgPlain_printf("--- BB Profile (BB details)                             ---\n");
   vgPlain_printf("-----------------------------------------------------------\n");
   vgPlain_printf("\n");

   score_cumul = 0;
   for (r = 0; r < n_tops; r++) {
      if (tops[r].addr == 0)
         continue;
      name[0] = 0;
      vgPlain_get_fnname_w_offset(tops[r].addr, name, 64);
      name[63] = 0;
      score_here = tops[r].score;
      score_cumul += score_here;
      vgPlain_percentify(score_cumul, score_total, 2, 6, buf_cumul);
      vgPlain_percentify(score_here, score_total, 2, 6, buf_here);
      vgPlain_printf("\n");
      vgPlain_printf("=-=-=-=-=-=-=-=-=-=-=-=-=-= begin BB rank %d "
                  "=-=-=-=-=-=-=-=-=-=-=-=-=-=\n\n", r);
      vgPlain_printf("%3d: (%9lld %s)   %9lld %s      0x%llx %s\n",
                  r,
                  score_cumul, buf_cumul,
                  score_here, buf_here, tops[r].addr, name );
      vgPlain_printf("\n");
      vgPlain_discard_translations(tops[r].addr, 1, "bb profile");
      vgPlain_translate(0, tops[r].addr, ((Bool)1), vgPlain_clo_profile_flags, 0, ((Bool)1));
      vgPlain_printf("=-=-=-=-=-=-=-=-=-=-=-=-=-=  end BB rank %d  "
                  "=-=-=-=-=-=-=-=-=-=-=-=-=-=\n\n", r);
   }

   vgPlain_printf("\n");
   vgPlain_printf("-----------------------------------------------------------\n");
   vgPlain_printf("--- END BB Profile                                      ---\n");
   vgPlain_printf("-----------------------------------------------------------\n");
   vgPlain_printf("\n");
}
# 1493 "m_main.c"
           VgStack vgPlain_interim_stack;
# 1511 "m_main.c"
static IICreateImageInfo the_iicii;
static IIFinaliseImageInfo the_iifii;




typedef struct { Addr a; ULong ull; } Addr_n_ULong;




static void final_tidyup(ThreadId tid);


static
void shutdown_actions_NORETURN( ThreadId tid,
                                VgSchedReturnCode tids_schedretcode );
# 1536 "m_main.c"
static
Int valgrind_main ( Int argc, HChar **argv, HChar **envp )
{
   HChar* toolname = "memcheck";
   Int need_help = 0;
   ThreadId tid_main = ((ThreadId)(0));
   Bool logging_to_fd = ((Bool)0);
   Char* xml_fname_unexpanded = ((void*)0);
   Int loglevel, i;
   struct vki_rlimit zero = { 0, 0 };
   XArray* addr2dihandle = ((void*)0);
# 1555 "m_main.c"
   do {} while (0)


                                                                   ;
# 1573 "m_main.c"
   vgPlain_client_envp = (Char**)envp;
# 1591 "m_main.c"
   loglevel = 0;
   for (i = 1; i < argc; i++) {
      if (argv[i][0] != '-') break;
      if ( (argv[i] != ((void*)0) && "--" != ((void*)0) && vgPlain_strcmp((argv[i]),("--"))==0) ? ((Bool)1) : ((Bool)0) ) break;
      if ( (argv[i] != ((void*)0) && "-d" != ((void*)0) && vgPlain_strcmp((argv[i]),("-d"))==0) ? ((Bool)1) : ((Bool)0) ) loglevel++;
      if (( (argv[i] != ((void*)0) && "--profile-heap""=" != ((void*)0) && vgPlain_strncmp((argv[i]),("--profile-heap""="),(vgPlain_strlen("--profile-heap")+1))==0) ? ((Bool)1) : ((Bool)0) ) && ({ Char* val = &(argv[i])[ vgPlain_strlen("--profile-heap")+1 ]; if ( (val != ((void*)0) && "yes" != ((void*)0) && vgPlain_strcmp((val),("yes"))==0) ? ((Bool)1) : ((Bool)0) ) (vgPlain_clo_profile_heap) = ((Bool)1); else if ( (val != ((void*)0) && "no" != ((void*)0) && vgPlain_strcmp((val),("no"))==0) ? ((Bool)1) : ((Bool)0) ) (vgPlain_clo_profile_heap) = ((Bool)0); else vgPlain_fmsg_bad_option(argv[i], "Invalid boolean value '%s'" " (should be 'yes' or 'no')\n", val); ((Bool)1); }) ) {}
      if (( ((argv[i]) != ((void*)0) && "--core-redzone-size""=" != ((void*)0) &&
 vgPlain_strncmp
# 1597 "m_main.c"
         (((argv[i])),("--core-redzone-size""="),(vgPlain_strlen("--core-redzone-size")+1))==0) ? ((Bool)1) : ((Bool)0) ) && ({ Char* val = &((argv[i]))[
 vgPlain_strlen
# 1597 "m_main.c"
         ("--core-redzone-size")+1 ]; Char* s; Long n =
 vgPlain_strtoll10
# 1597 "m_main.c"
         ( val, &s ); ((vgPlain_clo_core_redzone_size)) = n; if ('\0' != s[0] || ((vgPlain_clo_core_redzone_size)) != n)
 vgPlain_fmsg_bad_option
# 1597 "m_main.c"
         ((argv[i]), ""); if (((vgPlain_clo_core_redzone_size)) < ((0)) || ((vgPlain_clo_core_redzone_size)) > ((4096))) {
 vgPlain_fmsg_bad_option
# 1597 "m_main.c"
         ((argv[i]), "'%s' argument must be between %lld and %lld\n", ("--core-redzone-size"), (Long)((0)), (Long)((4096))); } ((Bool)1); }) )
                                             {}
      if (( ((argv[i]) != ((void*)0) && "--redzone-size""=" != ((void*)0) &&
 vgPlain_strncmp
# 1599 "m_main.c"
         (((argv[i])),("--redzone-size""="),(vgPlain_strlen("--redzone-size")+1))==0) ? ((Bool)1) : ((Bool)0) ) && ({ Char* val = &((argv[i]))[
 vgPlain_strlen
# 1599 "m_main.c"
         ("--redzone-size")+1 ]; Char* s; Long n =
 vgPlain_strtoll10
# 1599 "m_main.c"
         ( val, &s ); ((vgPlain_clo_redzone_size)) = n; if ('\0' != s[0] || ((vgPlain_clo_redzone_size)) != n)
 vgPlain_fmsg_bad_option
# 1599 "m_main.c"
         ((argv[i]), ""); if (((vgPlain_clo_redzone_size)) < ((0)) || ((vgPlain_clo_redzone_size)) > ((4096))) {
 vgPlain_fmsg_bad_option
# 1599 "m_main.c"
         ((argv[i]), "'%s' argument must be between %lld and %lld\n", ("--redzone-size"), (Long)((0)), (Long)((4096))); } ((Bool)1); }) )
                                             {}
   }



   vgPlain_debugLog_startup(loglevel, "Stage 2 (main)");
   vgPlain_debugLog(1, "main", "Welcome to Valgrind version "
                            "3.8.0-PRE1" " debug logging\n");





   vgPlain_debugLog(1, "main", "Checking current stack is plausible\n");
   { HChar* limLo = (HChar*)(&vgPlain_interim_stack.bytes[0]);
     HChar* limHi = limLo + sizeof(vgPlain_interim_stack);
     HChar* aLocal = (HChar*)&limLo;





     if (aLocal < limLo || aLocal >= limHi) {

        vgPlain_debugLog(0, "main", "Root stack %p to %p, a local %p\n",
                          limLo, limHi, aLocal );
        vgPlain_debugLog(0, "main", "Valgrind: FATAL: "
                                 "Initial stack switched failed.\n");
        vgPlain_debugLog(0, "main", "   Cannot continue.  Sorry.\n");
        vgPlain_exit(1);
     }
   }






   vgPlain_debugLog(1, "main", "Checking initial stack was noted\n");
   if (the_iicii.sp_at_startup == 0) {
      vgPlain_debugLog(0, "main", "Valgrind: FATAL: "
                               "Initial stack was not noted.\n");
      vgPlain_debugLog(0, "main", "   Cannot continue.  Sorry.\n");
      vgPlain_exit(1);
   }






   vgPlain_debugLog(1, "main", "Starting the address space manager\n");
   ((void) (__builtin_expect(!!((1UL << 12) == 4096 || (1UL << 12) == 65536 || (1UL << 12) == 16384), 1) ? 0 : (
 vgPlain_assert_fail
# 1652 "m_main.c"
   ( ((Bool)1), "VKI_PAGE_SIZE == 4096 || VKI_PAGE_SIZE == 65536 || VKI_PAGE_SIZE == 16384",
 "m_main.c"
# 1652 "m_main.c"
   ,
 1653
# 1652 "m_main.c"
   , __PRETTY_FUNCTION__, ""), 0)))
                                           ;
   ((void) (__builtin_expect(!!((1UL << 12) == 4096 || (1UL << 12) == 65536 || (1UL << 12) == 16384), 1) ? 0 : (
 vgPlain_assert_fail
# 1654 "m_main.c"
   ( ((Bool)1), "VKI_MAX_PAGE_SIZE == 4096 || VKI_MAX_PAGE_SIZE == 65536 || VKI_MAX_PAGE_SIZE == 16384",
 "m_main.c"
# 1654 "m_main.c"
   ,
 1655
# 1654 "m_main.c"
   , __PRETTY_FUNCTION__, ""), 0)))
                                           ;
   ((void) (__builtin_expect(!!((1UL << 12) <= (1UL << 12)), 1) ? 0 : (vgPlain_assert_fail ( ((Bool)1), "VKI_PAGE_SIZE <= VKI_MAX_PAGE_SIZE", "m_main.c", 1656, __PRETTY_FUNCTION__, ""), 0)));
   ((void) (__builtin_expect(!!((1UL << 12) == (1 << 12)), 1) ? 0 : (vgPlain_assert_fail ( ((Bool)1), "VKI_PAGE_SIZE == (1 << VKI_PAGE_SHIFT)", "m_main.c", 1657, __PRETTY_FUNCTION__, ""), 0)));
   ((void) (__builtin_expect(!!((1UL << 12) == (1 << 12)), 1) ? 0 : (vgPlain_assert_fail ( ((Bool)1), "VKI_MAX_PAGE_SIZE == (1 << VKI_MAX_PAGE_SHIFT)", "m_main.c", 1658, __PRETTY_FUNCTION__, ""), 0)));
   the_iicii.clstack_top = vgPlain_am_startup( the_iicii.sp_at_startup );
   vgPlain_debugLog(1, "main", "Address space manager is running\n");
# 1670 "m_main.c"
   vgPlain_debugLog(1, "main", "Starting the dynamic memory manager\n");
   { void* p = vgPlain_malloc( "main.vm.1", 12345 );
     if (p) vgPlain_free( p );
   }
   vgPlain_debugLog(1, "main", "Dynamic memory manager is running\n");
# 1685 "m_main.c"
   vgPlain_debugLog(1, "main", "Initialise m_debuginfo\n");
   vgPlain_di_initialise();



   { HChar *cp = vgPlain_getenv("VALGRIND_LIB");
     if (cp != ((void*)0))
        vgPlain_libdir = cp;
     vgPlain_debugLog(1, "main", "VG_(libdir) = %s\n", vgPlain_libdir);
   }



   vgPlain_debugLog(1, "main", "Getting launcher's name ...\n");
   vgPlain_name_of_launcher = vgPlain_getenv("VALGRIND_LAUNCHER");
   if (vgPlain_name_of_launcher == ((void*)0)) {
      vgPlain_printf("valgrind: You cannot run '%s' directly.\n", argv[0]);
      vgPlain_printf("valgrind: You should use $prefix/bin/valgrind.\n");
      vgPlain_exit(1);
   }
   vgPlain_debugLog(1, "main", "... %s\n", vgPlain_name_of_launcher);






   vgPlain_getrlimit(2, &vgPlain_client_rlimit_data);
   zero.rlim_max = vgPlain_client_rlimit_data.rlim_max;
   vgPlain_setrlimit(2, &zero);


   vgPlain_getrlimit(3, &vgPlain_client_rlimit_stack);




   vgPlain_debugLog(1, "main", "Get hardware capabilities ...\n");
   { VexArch vex_arch;
     VexArchInfo vex_archinfo;
     Bool ok = vgPlain_machine_get_hwcaps();
     if (!ok) {
        vgPlain_printf("\n");
        vgPlain_printf("valgrind: fatal error: unsupported CPU.\n");
        vgPlain_printf("   Supported CPUs are:\n");
        vgPlain_printf("   * x86 (practically any; Pentium-I or above), "
                    "AMD Athlon or above)\n");
        vgPlain_printf("   * AMD Athlon64/Opteron\n");
        vgPlain_printf("   * PowerPC (most; ppc405 and above)\n");
        vgPlain_printf("   * System z (64bit only - s390x; z900 and above)\n");
        vgPlain_printf("\n");
        vgPlain_exit(1);
     }
     vgPlain_machine_get_VexArchInfo( &vex_arch, &vex_archinfo );
     vgPlain_debugLog(
        1, "main", "... arch = %s, hwcaps = %s\n",
           LibVEX_ppVexArch ( vex_arch ),
           LibVEX_ppVexHwCaps ( vex_arch, vex_archinfo.hwcaps )
     );
   }




   vgPlain_debugLog(1, "main", "Getting the working directory at startup\n");
   { Bool ok = vgPlain_record_startup_wd();
     if (!ok)
        vgPlain_err_config_error( "Can't establish current working "
                               "directory at startup\n");
   }
   { Char buf[4096 +1];
     Bool ok = vgPlain_get_startup_wd( buf, sizeof(buf) );
     ((void) (__builtin_expect(!!(ok), 1) ? 0 : (vgPlain_assert_fail ( ((Bool)1), "ok", "m_main.c", 1757, __PRETTY_FUNCTION__, ""), 0)));
     buf[4096] = 0;
     vgPlain_debugLog(1, "main", "... %s\n", buf );
   }
# 1775 "m_main.c"
   vgPlain_debugLog(1, "main", "Split up command line\n");
   vgPlain_split_up_argv( argc, argv );
   ((void) (__builtin_expect(!!(vgPlain_args_for_valgrind), 1) ? 0 : (vgPlain_assert_fail ( ((Bool)1), "VG_(args_for_valgrind)", "m_main.c", 1777, __PRETTY_FUNCTION__, ""), 0)));
   ((void) (__builtin_expect(!!(vgPlain_args_for_client), 1) ? 0 : (vgPlain_assert_fail ( ((Bool)1), "VG_(args_for_client)", "m_main.c", 1778, __PRETTY_FUNCTION__, ""), 0)));
   if (0) {
      for (i = 0; i < vgPlain_sizeXA( vgPlain_args_for_valgrind ); i++)
         vgPlain_printf(
            "varg %s\n",
            * (HChar**) vgPlain_indexXA( vgPlain_args_for_valgrind, i )
         );
      vgPlain_printf(" exe %s\n", vgPlain_args_the_exename);
      for (i = 0; i < vgPlain_sizeXA( vgPlain_args_for_client ); i++)
         vgPlain_printf(
            "carg %s\n",
            * (HChar**) vgPlain_indexXA( vgPlain_args_for_client, i )
         );
   }







   vgPlain_debugLog(1, "main",
                    "(early_) Process Valgrind's command line options\n");
   early_process_cmd_line_options(&need_help, &toolname);


   LibVEX_default_VexControl(& vgPlain_clo_vex_control);
# 1828 "m_main.c"
   if (!need_help) {
      vgPlain_debugLog(1, "main", "Create initial image\n");


      the_iicii.argv = argv;
      the_iicii.envp = envp;
      the_iicii.toolname = toolname;





      the_iifii = vgPlain_ii_create_image( the_iicii );
   }
# 1853 "m_main.c"
   vgPlain_debugLog(1, "main", "Setup file descriptors\n");
   setup_file_descriptors();
# 1866 "m_main.c"
   if (!need_help) {
      HChar buf[50], buf2[50+64];
      HChar nul[1];
      Int fd, r;
      const HChar* exename;

      vgPlain_debugLog(1, "main", "Create fake /proc/<pid>/cmdline\n");

      vgPlain_sprintf(buf, "proc_%d_cmdline", vgPlain_getpid());
      fd = vgPlain_mkstemp( buf, buf2 );
      if (fd == -1)
         vgPlain_err_config_error("Can't create client cmdline file in %s\n", buf2);

      nul[0] = 0;
      exename = vgPlain_args_the_exename ? vgPlain_args_the_exename
                                      : "unknown_exename";
      vgPlain_write(fd, exename, vgPlain_strlen( exename ));
      vgPlain_write(fd, nul, 1);

      for (i = 0; i < vgPlain_sizeXA( vgPlain_args_for_client ); i++) {
         HChar* arg = * (HChar**) vgPlain_indexXA( vgPlain_args_for_client, i );
         vgPlain_write(fd, arg, vgPlain_strlen( arg ));
         vgPlain_write(fd, nul, 1);
      }






      r = vgPlain_unlink( buf2 );
      if (r)
         vgPlain_err_config_error("Can't delete client cmdline file in %s\n", buf2);

      vgPlain_cl_cmdline_fd = fd;
   }







   vgPlain_debugLog(1, "main", "Initialise the tool part 1 (pre_clo_init)\n");
   vgPlain_tl_pre_clo_init();







   vgPlain_debugLog(1, "main", "Print help and quit, if requested\n");
   if (need_help) {
      usage_NORETURN( need_help >= 2);
   }






   vgPlain_debugLog(1, "main",
                    "(main_) Process Valgrind's command line options, "
                    "setup logging\n");
   main_process_cmd_line_options ( &logging_to_fd, &xml_fname_unexpanded,
                                   toolname );





   (void) vgPlain_read_millisecond_timer();
# 1947 "m_main.c"
   vgPlain_debugLog(1, "main", "Print the preamble...\n");
   print_preamble(logging_to_fd, xml_fname_unexpanded, toolname);
   vgPlain_debugLog(1, "main", "...finished the preamble\n");
# 1958 "m_main.c"
   vgPlain_debugLog(1, "main", "Initialise the tool part 2 (post_clo_init)\n");
   ( ((void) (__builtin_expect(!!(vgPlain_tdict.tool_post_clo_init), 1) ? 0 : (vgPlain_assert_fail ( ((Bool)0), (const Char*)"VG_(tdict).tool_post_clo_init", (const Char*)"m_main.c", 1959, (const Char*)__PRETTY_FUNCTION__, "you forgot to set VgToolInterface function '" "tool_post_clo_init" "'"), 0))), vgPlain_tdict.tool_post_clo_init() );
   {



      Char* s;
      Bool ok;
      ok = vgPlain_sanity_check_needs( &s );
      if (!ok) {
         vgPlain_tool_panic(s);
      }
   }






   vgPlain_debugLog(1, "main", "Initialise TT/TC\n");
   vgPlain_init_tt_tc();






   vgPlain_debugLog(1, "main", "Initialise redirects\n");
   vgPlain_redir_initialise();







   if (vgPlain_clo_wait_for_gdb) {
      ULong iters, q;
      vgPlain_debugLog(1, "main", "Wait for GDB\n");
      vgPlain_printf("pid=%d, entering delay loop\n", vgPlain_getpid());


      iters = 10;
# 2017 "m_main.c"
      iters *= 1000ULL * 1000 * 1000;
      for (q = 0; q < iters; q++)
         __asm__ __volatile__("" ::: "memory","cc");
   }





   if (vgPlain_clo_track_fds) {
      vgPlain_debugLog(1, "main", "Init preopened fds\n");
      vgPlain_init_preopened_fds();
   }
# 2049 "m_main.c"
   vgPlain_debugLog(1, "main", "Load initial debug info\n");

   ((void) (__builtin_expect(!!(!addr2dihandle), 1) ? 0 : (vgPlain_assert_fail ( ((Bool)0), (const Char*)"!addr2dihandle", (const Char*)"m_main.c", 2051, (const Char*)__PRETTY_FUNCTION__, (const HChar*)""), 0)));
   addr2dihandle = vgPlain_newXA( vgPlain_malloc, "main.vm.2",
                               vgPlain_free, sizeof(Addr_n_ULong) );
   ((void) (__builtin_expect(!!(addr2dihandle), 1) ? 0 : (vgPlain_assert_fail ( ((Bool)0), (const Char*)"addr2dihandle", (const Char*)"m_main.c", 2054, (const Char*)__PRETTY_FUNCTION__, (const HChar*)""), 0)));


   { Addr* seg_starts;
     Int n_seg_starts;
     Addr_n_ULong anu;

     seg_starts = vgPlain_get_segment_starts( &n_seg_starts );
     ((void) (__builtin_expect(!!(seg_starts && n_seg_starts >= 0), 1) ? 0 : (vgPlain_assert_fail ( ((Bool)1), "seg_starts && n_seg_starts >= 0", "m_main.c", 2062, __PRETTY_FUNCTION__, ""), 0)));




     for (i = 0; i < n_seg_starts; i++) {
        anu.ull = vgPlain_di_notify_mmap( seg_starts[i], ((Bool)1) ,
                                       -1 );


        if (anu.ull > 0) {
           anu.a = seg_starts[i];
           vgPlain_addToXA( addr2dihandle, &anu );
        }
     }

     vgPlain_free( seg_starts );
   }
# 2107 "m_main.c"
   { Bool change_ownership_v_c_OK;
     Addr co_start = ((Addr)((Addr)&vgPlain_trampoline_stuff_start) & ~((Addr)((1UL << 12))-1));
     Addr co_endPlus = ((Addr)(((Addr)&vgPlain_trampoline_stuff_end)+((1UL << 12))-1) & ~((Addr)(((1UL << 12)))-1));
     vgPlain_debugLog(1,"redir",
                     "transfer ownership V -> C of 0x%llx .. 0x%llx\n",
                     (ULong)co_start, (ULong)co_endPlus-1 );

     change_ownership_v_c_OK
        = vgPlain_am_change_ownership_v_to_c( co_start, co_endPlus - co_start );
     ((void) (__builtin_expect(!!(change_ownership_v_c_OK), 1) ? 0 : (vgPlain_assert_fail ( ((Bool)1), "change_ownership_v_c_OK", "m_main.c", 2116, __PRETTY_FUNCTION__, ""), 0)));
   }

   if (vgPlain_clo_xml) {
      HChar buf[50];
      vgPlain_elapsed_wallclock_time(buf);
      vgPlain_printf_xml( "<status>\n"
                       "  <state>RUNNING</state>\n"
                       "  <time>%pS</time>\n"
                       "</status>\n",
                       buf );
      vgPlain_printf_xml( "\n" );
   }

   vgPlain_init_Threads();





   vgPlain_debugLog(1, "main", "Initialise scheduler (phase 1)\n");
   tid_main = vgPlain_scheduler_init_phase1();
   ((void) (__builtin_expect(!!(tid_main >= 0 && tid_main < 500 && tid_main != ((ThreadId)(0))), 1) ? 0 : (
 vgPlain_assert_fail
# 2138 "m_main.c"
   ( ((Bool)1), "tid_main >= 0 && tid_main < VG_N_THREADS && tid_main != VG_INVALID_THREADID",
 "m_main.c"
# 2138 "m_main.c"
   ,
 2139
# 2138 "m_main.c"
   , __PRETTY_FUNCTION__, ""), 0)))
                                                ;

   do { if (vgPlain_tdict.track_pre_thread_ll_create) vgPlain_tdict.track_pre_thread_ll_create(((ThreadId)(0)), tid_main); } while(0);
# 2155 "m_main.c"
   vgPlain_debugLog(1, "main", "Tell tool about initial permissions\n");
   { Addr* seg_starts;
     Int n_seg_starts;

     ((void) (__builtin_expect(!!(addr2dihandle), 1) ? 0 : (vgPlain_assert_fail ( ((Bool)0), (const Char*)"addr2dihandle", (const Char*)"m_main.c", 2159, (const Char*)__PRETTY_FUNCTION__, (const HChar*)""), 0)));




     ((void) (__builtin_expect(!!(vgPlain_running_tid == ((ThreadId)(0))), 1) ? 0 : (vgPlain_assert_fail ( ((Bool)0), (const Char*)"VG_(running_tid) == VG_INVALID_THREADID", (const Char*)"m_main.c", 2164, (const Char*)__PRETTY_FUNCTION__, (const HChar*)""), 0)));
     vgPlain_running_tid = tid_main;

     seg_starts = vgPlain_get_segment_starts( &n_seg_starts );
     ((void) (__builtin_expect(!!(seg_starts && n_seg_starts >= 0), 1) ? 0 : (vgPlain_assert_fail ( ((Bool)1), "seg_starts && n_seg_starts >= 0", "m_main.c", 2168, __PRETTY_FUNCTION__, ""), 0)));


     for (i = 0; i < n_seg_starts; i++) {
        Word j, n;
        NSegment const* seg
           = vgPlain_am_find_nsegment( seg_starts[i] );
        ((void) (__builtin_expect(!!(seg), 1) ? 0 : (vgPlain_assert_fail ( ((Bool)1), "seg", "m_main.c", 2175, __PRETTY_FUNCTION__, ""), 0)));
        if (seg->kind == SkFileC || seg->kind == SkAnonC) {
# 2198 "m_main.c"
           ((void) (__builtin_expect(!!(seg->start == seg_starts[i]), 1) ? 0 : (vgPlain_assert_fail ( ((Bool)1), "seg->start == seg_starts[i]", "m_main.c", 2198, __PRETTY_FUNCTION__, ""), 0)));
           vgPlain_debugLog(2, "main",
                            "tell tool about %010lx-%010lx %c%c%c\n",
                             seg->start, seg->end,
                             seg->hasR ? 'r' : '-',
                             seg->hasW ? 'w' : '-',
                             seg->hasX ? 'x' : '-' );


           n = vgPlain_sizeXA( addr2dihandle );
           for (j = 0; j < n; j++) {
              Addr_n_ULong* anl = vgPlain_indexXA( addr2dihandle, j );
              if (anl->a == seg->start) {
                  ((void) (__builtin_expect(!!(anl->ull > 0), 1) ? 0 : (vgPlain_assert_fail ( ((Bool)0), (const Char*)"anl->ull > 0", (const Char*)"m_main.c", 2211, (const Char*)__PRETTY_FUNCTION__, (const HChar*)""), 0)));
                  break;
              }
           }
           ((void) (__builtin_expect(!!(j >= 0 && j <= n), 1) ? 0 : (vgPlain_assert_fail ( ((Bool)1), "j >= 0 && j <= n", "m_main.c", 2215, __PRETTY_FUNCTION__, ""), 0)));
           do { if (




 vgPlain_tdict
# 2216 "m_main.c"
           .




 track_new_mem_startup
# 2216 "m_main.c"
           )




 vgPlain_tdict
# 2216 "m_main.c"
           .




 track_new_mem_startup
# 2216 "m_main.c"
           (seg->start, seg->end+1-seg->start, seg->hasR, seg->hasW, seg->hasX, j < n ? ((Addr_n_ULong*)vgPlain_indexXA( addr2dihandle, j ))->ull : 0); } while(0)




                             ;
        }
     }

     vgPlain_free( seg_starts );
     vgPlain_deleteXA( addr2dihandle );


     {
       SSizeT inaccessible_len;
       NSegment const* seg
          = vgPlain_am_find_nsegment( the_iifii.initial_client_SP );
       ((void) (__builtin_expect(!!(seg), 1) ? 0 : (vgPlain_assert_fail ( ((Bool)1), "seg", "m_main.c", 2233, __PRETTY_FUNCTION__, ""), 0)));
       ((void) (__builtin_expect(!!(seg->kind == SkAnonC), 1) ? 0 : (vgPlain_assert_fail ( ((Bool)1), "seg->kind == SkAnonC", "m_main.c", 2234, __PRETTY_FUNCTION__, ""), 0)));
       ((void) (__builtin_expect(!!(the_iifii.initial_client_SP >= seg->start), 1) ? 0 : (vgPlain_assert_fail ( ((Bool)1), "the_iifii.initial_client_SP >= seg->start", "m_main.c", 2235, __PRETTY_FUNCTION__, ""), 0)));
       ((void) (__builtin_expect(!!(the_iifii.initial_client_SP <= seg->end), 1) ? 0 : (vgPlain_assert_fail ( ((Bool)1), "the_iifii.initial_client_SP <= seg->end", "m_main.c", 2236, __PRETTY_FUNCTION__, ""), 0)));






       inaccessible_len = the_iifii.initial_client_SP - 0
                          - seg->start;
       ((void) (__builtin_expect(!!(inaccessible_len >= 0), 1) ? 0 : (vgPlain_assert_fail ( ((Bool)1), "inaccessible_len >= 0", "m_main.c", 2245, __PRETTY_FUNCTION__, ""), 0)));
       if (inaccessible_len > 0)
          do { if (

 vgPlain_tdict
# 2247 "m_main.c"
          .

 track_die_mem_stack
# 2247 "m_main.c"
          )

 vgPlain_tdict
# 2247 "m_main.c"
          .

 track_die_mem_stack
# 2247 "m_main.c"
          (seg->start, inaccessible_len); } while(0)

                                      ;
       vgPlain_debugLog(2, "main", "mark stack inaccessible %010lx-%010lx\n",
                        seg->start,
                        the_iifii.initial_client_SP-1 - 0);
     }


     do { if (






 vgPlain_tdict
# 2256 "m_main.c"
     .






 track_new_mem_startup
# 2256 "m_main.c"
     )






 vgPlain_tdict
# 2256 "m_main.c"
     .






 track_new_mem_startup
# 2256 "m_main.c"
     ((Addr)&vgPlain_trampoline_stuff_start, (Addr)&vgPlain_trampoline_stuff_end - (Addr)&vgPlain_trampoline_stuff_start, ((Bool)0), ((Bool)0), ((Bool)1) , 0); } while(0)






                                                            ;


     vgPlain_running_tid = ((ThreadId)(0));
     ((void) (__builtin_expect(!!(vgPlain_running_tid == ((ThreadId)(0))), 1) ? 0 : (vgPlain_assert_fail ( ((Bool)0), (const Char*)"VG_(running_tid) == VG_INVALID_THREADID", (const Char*)"m_main.c", 2267, (const Char*)__PRETTY_FUNCTION__, (const HChar*)""), 0)));
   }







   vgPlain_debugLog(1, "main", "Initialise scheduler (phase 2)\n");
   { NSegment const* seg
        = vgPlain_am_find_nsegment( the_iifii.initial_client_SP );
     ((void) (__builtin_expect(!!(seg), 1) ? 0 : (vgPlain_assert_fail ( ((Bool)1), "seg", "m_main.c", 2279, __PRETTY_FUNCTION__, ""), 0)));
     ((void) (__builtin_expect(!!(seg->kind == SkAnonC), 1) ? 0 : (vgPlain_assert_fail ( ((Bool)1), "seg->kind == SkAnonC", "m_main.c", 2280, __PRETTY_FUNCTION__, ""), 0)));
     ((void) (__builtin_expect(!!(the_iifii.initial_client_SP >= seg->start), 1) ? 0 : (vgPlain_assert_fail ( ((Bool)1), "the_iifii.initial_client_SP >= seg->start", "m_main.c", 2281, __PRETTY_FUNCTION__, ""), 0)));
     ((void) (__builtin_expect(!!(the_iifii.initial_client_SP <= seg->end), 1) ? 0 : (vgPlain_assert_fail ( ((Bool)1), "the_iifii.initial_client_SP <= seg->end", "m_main.c", 2282, __PRETTY_FUNCTION__, ""), 0)));
     vgPlain_scheduler_init_phase2( tid_main,
                                 seg->end, the_iifii.clstack_max_size );
   }







   vgPlain_debugLog(1, "main", "Finalise initial image\n");
   vgPlain_ii_finalise_image( the_iifii );






   vgPlain_debugLog(1, "main", "Initialise signal management\n");

   vgPlain_vki_do_initial_consistency_checks();

   vgPlain_sigstartup_actions();





   if (vgPlain_needs.core_errors || vgPlain_needs.tool_errors) {
      vgPlain_debugLog(1, "main", "Load suppressions\n");
      vgPlain_load_suppressions();
   }




   vgPlain_clstk_id = vgPlain_register_stack(vgPlain_clstk_base, vgPlain_clstk_end);




   vgPlain_debugLog(1, "main", "\n");
   vgPlain_debugLog(1, "main", "\n");
   vgPlain_am_show_nsegments(1,"Memory layout at client startup");
   vgPlain_debugLog(1, "main", "\n");
   vgPlain_debugLog(1, "main", "\n");




   vgPlain_debugLog(1, "main", "Running thread 1\n");
# 2345 "m_main.c"
   vgPlain_address_of_m_main_shutdown_actions_NORETURN
      = & shutdown_actions_NORETURN;



   vgPlain_main_thread_wrapper_NORETURN(1);


   ((void) (__builtin_expect(!!(0), 1) ? 0 : (vgPlain_assert_fail ( ((Bool)1), "0", "m_main.c", 2353, __PRETTY_FUNCTION__, ""), 0)));
}
# 2373 "m_main.c"
static
void shutdown_actions_NORETURN( ThreadId tid,
                                VgSchedReturnCode tids_schedretcode )
{
   vgPlain_debugLog(1, "main", "entering VG_(shutdown_actions_NORETURN)\n");
   vgPlain_am_show_nsegments(1,"Memory layout at client shutdown");

   ((void) (__builtin_expect(!!(vgPlain_is_running_thread(tid)), 1) ? 0 : (vgPlain_assert_fail ( ((Bool)1), "VG_(is_running_thread)(tid)", "m_main.c", 2380, __PRETTY_FUNCTION__, ""), 0)));

   ((void) (__builtin_expect(!!(tids_schedretcode == VgSrc_ExitThread || tids_schedretcode == VgSrc_ExitProcess || tids_schedretcode == VgSrc_FatalSig), 1) ? 0 : (

 vgPlain_assert_fail
# 2382 "m_main.c"
   ( ((Bool)1), "tids_schedretcode == VgSrc_ExitThread || tids_schedretcode == VgSrc_ExitProcess || tids_schedretcode == VgSrc_FatalSig",

 "m_main.c"
# 2382 "m_main.c"
   ,

 2384
# 2382 "m_main.c"
   , __PRETTY_FUNCTION__, ""), 0)))

                                                     ;

   if (tids_schedretcode == VgSrc_ExitThread) {


      ((void) (__builtin_expect(!!(vgPlain_count_living_threads() == 1), 1) ? 0 : (vgPlain_assert_fail ( ((Bool)1), "VG_(count_living_threads)() == 1", "m_main.c", 2389, __PRETTY_FUNCTION__, ""), 0)));



      vgPlain_reap_threads(tid);



      final_tidyup(tid);


      ((void) (__builtin_expect(!!(vgPlain_is_running_thread(tid)), 1) ? 0 : (vgPlain_assert_fail ( ((Bool)1), "VG_(is_running_thread)(tid)", "m_main.c", 2400, __PRETTY_FUNCTION__, ""), 0)));
      ((void) (__builtin_expect(!!(vgPlain_count_living_threads() == 1), 1) ? 0 : (vgPlain_assert_fail ( ((Bool)1), "VG_(count_living_threads)() == 1", "m_main.c", 2401, __PRETTY_FUNCTION__, ""), 0)));

   } else {





      ((void) (__builtin_expect(!!(vgPlain_count_living_threads() >= 1), 1) ? 0 : (vgPlain_assert_fail ( ((Bool)1), "VG_(count_living_threads)() >= 1", "m_main.c", 2409, __PRETTY_FUNCTION__, ""), 0)));




      final_tidyup(tid);


      ((void) (__builtin_expect(!!(vgPlain_is_running_thread(tid)), 1) ? 0 : (vgPlain_assert_fail ( ((Bool)1), "VG_(is_running_thread)(tid)", "m_main.c", 2417, __PRETTY_FUNCTION__, ""), 0)));
      ((void) (__builtin_expect(!!(vgPlain_count_living_threads() >= 1), 1) ? 0 : (vgPlain_assert_fail ( ((Bool)1), "VG_(count_living_threads)() >= 1", "m_main.c", 2418, __PRETTY_FUNCTION__, ""), 0)));
   }

   vgPlain_threads[tid].status = VgTs_Empty;





   if (vgPlain_clo_xml)
      vgPlain_printf_xml("\n");
   else if (vgPlain_clo_verbosity > 0)
      vgPlain_message(Vg_UserMsg, "\n");

   if (vgPlain_clo_xml) {
      HChar buf[50];
      vgPlain_elapsed_wallclock_time(buf);
      vgPlain_printf_xml( "<status>\n"
                              "  <state>FINISHED</state>\n"
                              "  <time>%pS</time>\n"
                              "</status>\n"
                              "\n",
                              buf);
   }


   if (vgPlain_clo_track_fds)
      vgPlain_show_open_fds();




   ( ((void) (__builtin_expect(!!(vgPlain_tdict.tool_fini), 1) ? 0 : (vgPlain_assert_fail ( ((Bool)0), (const Char*)"VG_(tdict).tool_fini", (const Char*)"m_main.c", 2450, (const Char*)__PRETTY_FUNCTION__, "you forgot to set VgToolInterface function '" "tool_fini" "'"), 0))), vgPlain_tdict.tool_fini(0) );


   if (vgPlain_clo_xml
       && (vgPlain_needs.core_errors || vgPlain_needs.tool_errors)) {
      vgPlain_show_error_counts_as_XML();
   }


   if (vgPlain_needs.core_errors || vgPlain_needs.tool_errors)
      vgPlain_show_all_errors(vgPlain_clo_verbosity, vgPlain_clo_xml);

   if (vgPlain_clo_xml) {
      vgPlain_printf_xml("\n");
      vgPlain_printf_xml("</valgrindoutput>\n");
      vgPlain_printf_xml("\n");
   }

   vgPlain_sanity_check_general( ((Bool)1) );

   if (vgPlain_clo_stats)
      print_all_stats();




   if (vgPlain_clo_profile_heap) {
      if (0) vgPlain_di_discard_ALL_debuginfo();
      vgPlain_print_arena_cc_analysis();
   }

   if (vgPlain_clo_profile_flags > 0) {

      BBProfEntry tops[200];
      ULong score_total = vgPlain_get_BB_profile (tops, 200);
      show_BB_profile(tops, 200, score_total);
   }


   if (0)
       LibVEX_ShowAllocStats();


   vgPlain_message_flush();



   vgPlain_gdbserver (0);





   vgPlain_debugLog(1, "core_os",
                    "VG_(terminate_NORETURN)(tid=%lld)\n", (ULong)tid);

   switch (tids_schedretcode) {
   case VgSrc_ExitThread:
   case VgSrc_ExitProcess:


      if (vgPlain_clo_error_exitcode > 0
          && vgPlain_get_n_errs_found() > 0) {
         vgPlain_exit( vgPlain_clo_error_exitcode );
      } else {


         vgPlain_exit( vgPlain_threads[tid].os_state.exitcode );
      }

      vgPlain_core_panic("entered the afterlife in main() -- ExitT/P");
      break;

   case VgSrc_FatalSig:

      ((void) (__builtin_expect(!!(vgPlain_threads[tid].os_state.fatalsig != 0), 1) ? 0 : (vgPlain_assert_fail ( ((Bool)1), "VG_(threads)[tid].os_state.fatalsig != 0", "m_main.c", 2525, __PRETTY_FUNCTION__, ""), 0)));
      vgPlain_kill_self(vgPlain_threads[tid].os_state.fatalsig);







      vgPlain_core_panic("main(): signal was supposed to be fatal");
      break;

   default:
      vgPlain_core_panic("main(): unexpected scheduler return code");
   }
}
# 2549 "m_main.c"
static void final_tidyup(ThreadId tid)
{




   Addr __libc_freeres_wrapper = vgPlain_client___libc_freeres_wrapper;

   ((void) (__builtin_expect(!!(vgPlain_is_running_thread(tid)), 1) ? 0 : (vgPlain_assert_fail ( ((Bool)1), "VG_(is_running_thread)(tid)", "m_main.c", 2557, __PRETTY_FUNCTION__, ""), 0)));

   if ( !vgPlain_needs.libc_freeres ||
        !vgPlain_clo_run_libc_freeres ||
        0 == __libc_freeres_wrapper )
      return;
# 2575 "m_main.c"
   if (vgPlain_clo_verbosity > 2 ||
       vgPlain_clo_trace_syscalls ||
       vgPlain_clo_trace_sched)
      vgPlain_message(Vg_DebugMsg,
     "Caught __NR_exit; running __libc_freeres()\n");






   vgPlain_set_IP(tid, __libc_freeres_wrapper);
# 2597 "m_main.c"
   vgPlain_sigprocmask(0, ((void*)0), &vgPlain_threads[tid].sig_mask);
   vgPlain_threads[tid].tmp_sig_mask = vgPlain_threads[tid].sig_mask;


   vgPlain_set_default_handler(11);
   vgPlain_set_default_handler(7);
   vgPlain_set_default_handler(4);
   vgPlain_set_default_handler(8);


   ((void) (__builtin_expect(!!(vgPlain_is_exiting(tid)), 1) ? 0 : (vgPlain_assert_fail ( ((Bool)1), "VG_(is_exiting)(tid)", "m_main.c", 2607, __PRETTY_FUNCTION__, ""), 0)));

   vgPlain_threads[tid].exitreason = VgSrc_None;



   vgPlain_scheduler(tid);

   ((void) (__builtin_expect(!!(vgPlain_is_exiting(tid)), 1) ? 0 : (vgPlain_assert_fail ( ((Bool)1), "VG_(is_exiting)(tid)", "m_main.c", 2615, __PRETTY_FUNCTION__, ""), 0)));

}
# 2647 "m_main.c"
void* memcpy(void *dest, const void *src, SizeT n);
void* memcpy(void *dest, const void *src, SizeT n) {
   return vgPlain_memcpy(dest,src,n);
}
void* memset(void *s, int c, SizeT n);
void* memset(void *s, int c, SizeT n) {
  return vgPlain_memset(s,c,n);
}


void abort(void);
void abort(void){
   vgPlain_printf("Something called raise().\n");
   ((void) (__builtin_expect(!!(0), 1) ? 0 : (vgPlain_assert_fail ( ((Bool)1), "0", "m_main.c", 2660, __PRETTY_FUNCTION__, ""), 0)));
}
# 2717 "m_main.c"
asm("\n"
    ".text\n"
    "\t.globl _start\n"
    "\t.type _start,@function\n"
    "_start:\n"

    "\tmovl  $vgPlain_interim_stack, %eax\n"
    "\taddl  $""8192"", %eax\n"
    "\taddl  $""(4096 * 256)"", %eax\n"
    "\tsubl  $16, %eax\n"
    "\tandl  $~15, %eax\n"

    "\txchgl %eax, %esp\n"

    "\tpushl %eax\n"
    "\tcall  _start_in_C_linux\n"
    "\thlt\n"
    ".previous\n"
);
# 2941 "m_main.c"
# 1 "/usr/include/elf.h" 1 3 4
# 26 "/usr/include/elf.h" 3 4




# 1 "/usr/include/stdint.h" 1 3 4
# 27 "/usr/include/stdint.h" 3 4
# 1 "/usr/include/bits/wchar.h" 1 3 4
# 28 "/usr/include/stdint.h" 2 3 4
# 1 "/usr/include/bits/wordsize.h" 1 3 4
# 29 "/usr/include/stdint.h" 2 3 4
# 37 "/usr/include/stdint.h" 3 4
typedef signed char int8_t;
typedef short int int16_t;
typedef int int32_t;



__extension__
typedef long long int int64_t;




typedef unsigned char uint8_t;
typedef unsigned short int uint16_t;

typedef unsigned int uint32_t;





__extension__
typedef unsigned long long int uint64_t;






typedef signed char int_least8_t;
typedef short int int_least16_t;
typedef int int_least32_t;



__extension__
typedef long long int int_least64_t;



typedef unsigned char uint_least8_t;
typedef unsigned short int uint_least16_t;
typedef unsigned int uint_least32_t;



__extension__
typedef unsigned long long int uint_least64_t;






typedef signed char int_fast8_t;





typedef int int_fast16_t;
typedef int int_fast32_t;
__extension__
typedef long long int int_fast64_t;



typedef unsigned char uint_fast8_t;





typedef unsigned int uint_fast16_t;
typedef unsigned int uint_fast32_t;
__extension__
typedef unsigned long long int uint_fast64_t;
# 126 "/usr/include/stdint.h" 3 4
typedef int intptr_t;


typedef unsigned int uintptr_t;
# 138 "/usr/include/stdint.h" 3 4
__extension__
typedef long long int intmax_t;
__extension__
typedef unsigned long long int uintmax_t;
# 31 "/usr/include/elf.h" 2 3 4


typedef uint16_t Elf32_Half;
typedef uint16_t Elf64_Half;


typedef uint32_t Elf32_Word;
typedef int32_t Elf32_Sword;
typedef uint32_t Elf64_Word;
typedef int32_t Elf64_Sword;


typedef uint64_t Elf32_Xword;
typedef int64_t Elf32_Sxword;
typedef uint64_t Elf64_Xword;
typedef int64_t Elf64_Sxword;


typedef uint32_t Elf32_Addr;
typedef uint64_t Elf64_Addr;


typedef uint32_t Elf32_Off;
typedef uint64_t Elf64_Off;


typedef uint16_t Elf32_Section;
typedef uint16_t Elf64_Section;


typedef Elf32_Half Elf32_Versym;
typedef Elf64_Half Elf64_Versym;






typedef struct
{
  unsigned char e_ident[(16)];
  Elf32_Half e_type;
  Elf32_Half e_machine;
  Elf32_Word e_version;
  Elf32_Addr e_entry;
  Elf32_Off e_phoff;
  Elf32_Off e_shoff;
  Elf32_Word e_flags;
  Elf32_Half e_ehsize;
  Elf32_Half e_phentsize;
  Elf32_Half e_phnum;
  Elf32_Half e_shentsize;
  Elf32_Half e_shnum;
  Elf32_Half e_shstrndx;
} Elf32_Ehdr;

typedef struct
{
  unsigned char e_ident[(16)];
  Elf64_Half e_type;
  Elf64_Half e_machine;
  Elf64_Word e_version;
  Elf64_Addr e_entry;
  Elf64_Off e_phoff;
  Elf64_Off e_shoff;
  Elf64_Word e_flags;
  Elf64_Half e_ehsize;
  Elf64_Half e_phentsize;
  Elf64_Half e_phnum;
  Elf64_Half e_shentsize;
  Elf64_Half e_shnum;
  Elf64_Half e_shstrndx;
} Elf64_Ehdr;
# 269 "/usr/include/elf.h" 3 4
typedef struct
{
  Elf32_Word sh_name;
  Elf32_Word sh_type;
  Elf32_Word sh_flags;
  Elf32_Addr sh_addr;
  Elf32_Off sh_offset;
  Elf32_Word sh_size;
  Elf32_Word sh_link;
  Elf32_Word sh_info;
  Elf32_Word sh_addralign;
  Elf32_Word sh_entsize;
} Elf32_Shdr;

typedef struct
{
  Elf64_Word sh_name;
  Elf64_Word sh_type;
  Elf64_Xword sh_flags;
  Elf64_Addr sh_addr;
  Elf64_Off sh_offset;
  Elf64_Xword sh_size;
  Elf64_Word sh_link;
  Elf64_Word sh_info;
  Elf64_Xword sh_addralign;
  Elf64_Xword sh_entsize;
} Elf64_Shdr;
# 378 "/usr/include/elf.h" 3 4
typedef struct
{
  Elf32_Word st_name;
  Elf32_Addr st_value;
  Elf32_Word st_size;
  unsigned char st_info;
  unsigned char st_other;
  Elf32_Section st_shndx;
} Elf32_Sym;

typedef struct
{
  Elf64_Word st_name;
  unsigned char st_info;
  unsigned char st_other;
  Elf64_Section st_shndx;
  Elf64_Addr st_value;
  Elf64_Xword st_size;
} Elf64_Sym;




typedef struct
{
  Elf32_Half si_boundto;
  Elf32_Half si_flags;
} Elf32_Syminfo;

typedef struct
{
  Elf64_Half si_boundto;
  Elf64_Half si_flags;
} Elf64_Syminfo;
# 493 "/usr/include/elf.h" 3 4
typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
} Elf32_Rel;






typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
} Elf64_Rel;



typedef struct
{
  Elf32_Addr r_offset;
  Elf32_Word r_info;
  Elf32_Sword r_addend;
} Elf32_Rela;

typedef struct
{
  Elf64_Addr r_offset;
  Elf64_Xword r_info;
  Elf64_Sxword r_addend;
} Elf64_Rela;
# 538 "/usr/include/elf.h" 3 4
typedef struct
{
  Elf32_Word p_type;
  Elf32_Off p_offset;
  Elf32_Addr p_vaddr;
  Elf32_Addr p_paddr;
  Elf32_Word p_filesz;
  Elf32_Word p_memsz;
  Elf32_Word p_flags;
  Elf32_Word p_align;
} Elf32_Phdr;

typedef struct
{
  Elf64_Word p_type;
  Elf64_Word p_flags;
  Elf64_Off p_offset;
  Elf64_Addr p_vaddr;
  Elf64_Addr p_paddr;
  Elf64_Xword p_filesz;
  Elf64_Xword p_memsz;
  Elf64_Xword p_align;
} Elf64_Phdr;
# 632 "/usr/include/elf.h" 3 4
typedef struct
{
  Elf32_Sword d_tag;
  union
    {
      Elf32_Word d_val;
      Elf32_Addr d_ptr;
    } d_un;
} Elf32_Dyn;

typedef struct
{
  Elf64_Sxword d_tag;
  union
    {
      Elf64_Xword d_val;
      Elf64_Addr d_ptr;
    } d_un;
} Elf64_Dyn;
# 799 "/usr/include/elf.h" 3 4
typedef struct
{
  Elf32_Half vd_version;
  Elf32_Half vd_flags;
  Elf32_Half vd_ndx;
  Elf32_Half vd_cnt;
  Elf32_Word vd_hash;
  Elf32_Word vd_aux;
  Elf32_Word vd_next;

} Elf32_Verdef;

typedef struct
{
  Elf64_Half vd_version;
  Elf64_Half vd_flags;
  Elf64_Half vd_ndx;
  Elf64_Half vd_cnt;
  Elf64_Word vd_hash;
  Elf64_Word vd_aux;
  Elf64_Word vd_next;

} Elf64_Verdef;
# 841 "/usr/include/elf.h" 3 4
typedef struct
{
  Elf32_Word vda_name;
  Elf32_Word vda_next;

} Elf32_Verdaux;

typedef struct
{
  Elf64_Word vda_name;
  Elf64_Word vda_next;

} Elf64_Verdaux;




typedef struct
{
  Elf32_Half vn_version;
  Elf32_Half vn_cnt;
  Elf32_Word vn_file;

  Elf32_Word vn_aux;
  Elf32_Word vn_next;

} Elf32_Verneed;

typedef struct
{
  Elf64_Half vn_version;
  Elf64_Half vn_cnt;
  Elf64_Word vn_file;

  Elf64_Word vn_aux;
  Elf64_Word vn_next;

} Elf64_Verneed;
# 888 "/usr/include/elf.h" 3 4
typedef struct
{
  Elf32_Word vna_hash;
  Elf32_Half vna_flags;
  Elf32_Half vna_other;
  Elf32_Word vna_name;
  Elf32_Word vna_next;

} Elf32_Vernaux;

typedef struct
{
  Elf64_Word vna_hash;
  Elf64_Half vna_flags;
  Elf64_Half vna_other;
  Elf64_Word vna_name;
  Elf64_Word vna_next;

} Elf64_Vernaux;
# 922 "/usr/include/elf.h" 3 4
typedef struct
{
  uint32_t a_type;
  union
    {
      uint32_t a_val;



    } a_un;
} Elf32_auxv_t;

typedef struct
{
  uint64_t a_type;
  union
    {
      uint64_t a_val;



    } a_un;
} Elf64_auxv_t;
# 1006 "/usr/include/elf.h" 3 4
typedef struct
{
  Elf32_Word n_namesz;
  Elf32_Word n_descsz;
  Elf32_Word n_type;
} Elf32_Nhdr;

typedef struct
{
  Elf64_Word n_namesz;
  Elf64_Word n_descsz;
  Elf64_Word n_type;
} Elf64_Nhdr;
# 1070 "/usr/include/elf.h" 3 4
typedef struct
{
  Elf32_Xword m_value;
  Elf32_Word m_info;
  Elf32_Word m_poffset;
  Elf32_Half m_repeat;
  Elf32_Half m_stride;
} Elf32_Move;

typedef struct
{
  Elf64_Xword m_value;
  Elf64_Xword m_info;
  Elf64_Xword m_poffset;
  Elf64_Half m_repeat;
  Elf64_Half m_stride;
} Elf64_Move;
# 1463 "/usr/include/elf.h" 3 4
typedef union
{
  struct
    {
      Elf32_Word gt_current_g_value;
      Elf32_Word gt_unused;
    } gt_header;
  struct
    {
      Elf32_Word gt_g_value;
      Elf32_Word gt_bytes;
    } gt_entry;
} Elf32_gptab;



typedef struct
{
  Elf32_Word ri_gprmask;
  Elf32_Word ri_cprmask[4];
  Elf32_Sword ri_gp_value;
} Elf32_RegInfo;



typedef struct
{
  unsigned char kind;

  unsigned char size;
  Elf32_Section section;

  Elf32_Word info;
} Elf_Options;
# 1539 "/usr/include/elf.h" 3 4
typedef struct
{
  Elf32_Word hwp_flags1;
  Elf32_Word hwp_flags2;
} Elf_Options_Hw;
# 1700 "/usr/include/elf.h" 3 4
typedef struct
{
  Elf32_Word l_name;
  Elf32_Word l_time_stamp;
  Elf32_Word l_checksum;
  Elf32_Word l_version;
  Elf32_Word l_flags;
} Elf32_Lib;

typedef struct
{
  Elf64_Word l_name;
  Elf64_Word l_time_stamp;
  Elf64_Word l_checksum;
  Elf64_Word l_version;
  Elf64_Word l_flags;
} Elf64_Lib;
# 1731 "/usr/include/elf.h" 3 4
typedef Elf32_Addr Elf32_Conflict;
# 2797 "/usr/include/elf.h" 3 4

# 2942 "m_main.c" 2






__attribute__ ((used))
void _start_in_C_linux ( UWord* pArgc );
__attribute__ ((used))
void _start_in_C_linux ( UWord* pArgc )
{
   Int r;
   Word argc = pArgc[0];
   HChar** argv = (HChar**)&pArgc[1];
   HChar** envp = (HChar**)&pArgc[1+argc+1];

   vgPlain_memset( &the_iicii, 0, sizeof(the_iicii) );
   vgPlain_memset( &the_iifii, 0, sizeof(the_iifii) );

   the_iicii.sp_at_startup = (Addr)pArgc;
# 2982 "m_main.c"
   r = valgrind_main( (Int)argc, argv, envp );

   vgPlain_exit(r);
}
