LinuxTWIWrite

decompiled_code:
__int64 __fastcall LinuxTWIWrite(__int64 a1, __int64 a2, int a3, int a4, const void *a5)
{
int v7; // ebx
int buf[11]; // [rsp+Ch] [rbp-2Ch] BYREF

buf[0] = a4;
v7 = ArrayLength((__int64)a5);
ioctl(*(_DWORD *)(a1 + 88), 0x703uLL);
write(*(_DWORD *)(a1 + 88), buf, a3);
write(*(_DWORD *)(a1 + 88), a5, v7);
return 1LL;
}

canonical_decompiled_code:
__int64 __fastcall func10(__int64 a1, __int64 a2, int a3, int a4, const void *a5)
{
int v7; // ebx
int buf[11]; // [rsp+Ch] [rbp-2Ch] BYREF

buf[0] = a4;
v7 = func9((__int64)a5);
ioctl(*(_DWORD *)(a1 + 88), 0x703uLL);
write(*(_DWORD *)(a1 + 88), buf, a3);
write(*(_DWORD *)(a1 + 88), a5, v7);
return 1LL;
}

original_code:
int LinuxTWIWrite(LinuxTWI *twi,int devadrs,int adrslen,int adrs,const char* bytes){
  int len = ArrayLength(bytes);
  ioctl(twi->f,0x0703,devadrs);
  write(twi->f,&adrs,adrslen);
  write(twi->f,bytes,len);
  return 1;
}

canonical_original_code:
int LinuxTWIWrite(struct LinuxTWI *twi, int devadrs, int adrslen, int adrs, char *bytes){
  int len = ArrayLength(bytes);
  ioctl(twi->f,0x0703,devadrs);
  write(twi->f,&adrs,adrslen);
  write(twi->f,bytes,len);
  return 1;
}

variable_types: devadrs int

variable_types: adrslen int

variable_types: adrs int

variable_types:
bytes
char *

variable_types: len int


LinuxTWIRead

repo: embeddedarm/libtsctl

decompiled_code:
__int64 __fastcall LinuxTWIRead(__int64 a1, __int64 a2, int a3, int a4, void *a5)
{
int v7; // ebx
int buf[11]; // [rsp+Ch] [rbp-2Ch] BYREF

buf[0] = a4;
v7 = ArrayLength((__int64)a5);
ioctl(*(_DWORD *)(a1 + 88), 0x703uLL);
write(*(_DWORD *)(a1 + 88), buf, a3);
read(*(_DWORD *)(a1 + 88), a5, v7);
return 1LL;
}

canonical_decompiled_code:
__int64 __fastcall func11(__int64 a1, __int64 a2, int a3, int a4, void *a5)
{
int v7; // ebx
int buf[11]; // [rsp+Ch] [rbp-2Ch] BYREF

buf[0] = a4;
v7 = func9((__int64)a5);
ioctl(*(_DWORD *)(a1 + 88), 0x703uLL);
write(*(_DWORD *)(a1 + 88), buf, a3);
read(*(_DWORD *)(a1 + 88), a5, v7);
return 1LL;
}

original_code:
int LinuxTWIRead(LinuxTWI *twi,int devadrs,int adrslen,int adrs,char* bytes){
  int len = ArrayLength(bytes);
  ioctl(twi->f,0x0703,devadrs);
  write(twi->f,&adrs,adrslen);
  read(twi->f,bytes,len);
  return 1;
}

canonical_original_code:
int LinuxTWIRead(struct LinuxTWI *twi, int devadrs, int adrslen, int adrs, char *bytes){
  int len = ArrayLength(bytes);
  ioctl(twi->f,0x0703,devadrs);
  write(twi->f,&adrs,adrslen);
  read(twi->f,bytes,len);
  return 1;
}

variable_types: struct LinuxTWI { void *(*Init)(struct LinuxTWI *me, char *devfile); void (*Fini)(struct LinuxTWI *me); int (*Lock)(struct LinuxTWI *me, unsigned int num, int flags); int (*Unlock)(struct LinuxTWI *me, unsigned int num, int flags); int (*Preempt)(struct LinuxTWI *me); enum TWIResult { TWISuccess=1, TWIErrorPortInvalid=-1, TWIErrorModeUnsupported=-2, TWIErrorBaudUnconstrained=-3, TWIErrorHardware=-4, TWIErrorHandle=-5, TWIErrorWriteNAck=-6, TWIErrorDataNAck=-7, TWIErrorReadNack=-8, TWIErrorSDALow=-9, TWIErrorSCLLow=-10, TWIErrorAdrsLen=-11, TWIErrorTimeout=-12, TWIErrorOverrun=-13, TWIErrorArbLost=-14, TWIErrorUnknown=-999, TWIErrorOpInvalid=-15 } (*Write)(struct LinuxTWI *me, int devadr, int adrslen, int adrs, char *bytes); enum TWIResult { TWISuccess=1, TWIErrorPortInvalid=-1, TWIErrorModeUnsupported=-2, TWIErrorBaudUnconstrained=-3, TWIErrorHardware=-4, TWIErrorHandle=-5, TWIErrorWriteNAck=-6, TWIErrorDataNAck=-7, TWIErrorReadNack=-8, TWIErrorSDALow=-9, TWIErrorSCLLow=-10, TWIErrorAdrsLen=-11, TWIErrorTimeout=-12, TWIErrorOverrun=-13, TWIErrorArbLost=-14, TWIErrorUnknown=-999, TWIErrorOpInvalid=-15 } (*Read)(struct LinuxTWI *me, int devadr, int adrslen, int adrs, char *bytes); int InitStatus; struct Bus { void *(*Init)(void *me, ...); void (*Fini)(void *me); int (*Lock)(void *me, unsigned int num, int flags); int (*Unlock)(void *me, unsigned int num, int flags); int (*Preempt)(void *me); unsigned char (*Peek8)(void *me, int Address); void (*Poke8)(void *me, int Address, unsigned char Value); unsigned short (*Peek16)(void *me, int Address); void (*Poke16)(void *me, int Address, unsigned short Value); unsigned int (*Peek32)(void *me, int Address); void (*Poke32)(void *me, int Address, unsigned int Value); int (*BitGet8)(void *me, int Address, int BitNumber); void (*BitAssign8)(void *me, int Address, int BitNumber, int Value); void (*BitSet8)(void *me, int Address, int BitNumber); void (*BitClear8)(void *me, int Address, int BitNumber); int (*BitGet16)(void *me, int Address, int BitNumber); void (*BitAssign16)(void *me, int Address, int BitNumber, int Value); void (*BitSet16)(void *me, int Address, int BitNumber); void (*BitClear16)(void *me, int Address, int BitNumber); int (*BitGet32)(void *me, int Address, int BitNumber); void (*BitAssign32)(void *me, int Address, int BitNumber, int Value); void (*BitSet32)(void *me, int Address, int BitNumber); void (*BitClear32)(void *me, int Address, int BitNumber); void (*PeekStream)(void *me, int address, int direction, char *dest); void (*PokeStream)(void *me, int address, int direction, char *data); void (*Refresh)(void *me); void (*Commit)(void *me, int ForceAll); int (*BitToggle8)(void *me, int Address, int BitNumber); int (*BitToggle16)(void *me, int Address, int BitNumber); int (*BitToggle32)(void *me, int Address, int BitNumber); unsigned char (*Assign8X)(void *me, int Address, int BitMSB, int BitLSB, int Value); unsigned short (*Assign16X)(void *me, int Address, int BitMSB, int BitLSB, int Value); unsigned int (*Assign32X)(void *me, int Address, int BitMSB, int BitLSB, int Value); unsigned char (*BitsGet8)(void *me, int Address, int BitMSB, int BitLSB); unsigned short (*BitsGet16)(void *me, int Address, int BitMSB, int BitLSB); unsigned int (*BitsGet32)(void *me, int Address, int BitMSB, int BitLSB); int InitStatus; unsigned int LockBase; int deferlockW; int deferlockR; } *bus; int LockNum; char *devfile; int f; } *

return_type: int

user_defined_types: struct LinuxTWI { void *(*Init)(struct LinuxTWI *me, char *devfile); void (*Fini)(struct LinuxTWI *me); int (*Lock)(struct LinuxTWI *me, unsigned int num, int flags); int (*Unlock)(struct LinuxTWI *me, unsigned int num, int flags); int (*Preempt)(struct LinuxTWI *me); enum TWIResult (*Write)(struct LinuxTWI *me, int devadr, int adrslen, int adrs, char *bytes); enum TWIResult (*Read)(struct LinuxTWI *me, int devadr, int adrslen, int adrs, char *bytes); int InitStatus; struct Bus *bus; int LockNum; char *devfile; int f; }


ArrayFreeFree

decompiled_code:
void __fastcall ArrayFreeFree(__int64 a1)
{
__int64 v2; // rbx
__int64 v3; // rdi

if ( *(_DWORD *)(a1 - 4) )
{
v2 = 0LL;
do
{
v3 = *(_QWORD *)(a1 + 8 * v2);
if ( v3 )
ArrayFree(v3);
++v2;
}
while ( *(_DWORD *)(a1 - 4) > (unsigned int)v2 );
}
ArrayFree(a1);
}

original_code:
void ArrayFreeFree(const void *arr0) {
  const void * const *arr = (const void * const *)arr0;
  int i;
  for (i=0;i<_ArrayLength(arr);i++) {
    if (arr[i]) ArrayFree(arr[i]);
  }
  ArrayFree(arr);
}

canonical_original_code:
void ArrayFreeFree(void *arr0) {
  void **arr = (const void * const *)arr0;
  int i;
  for (i=0;i<_ArrayLength(arr);i++) {
    if (arr[i]) ArrayFree(arr[i]);
  }
  ArrayFree(arr);
}

variable_types:
arr
void **

variable_types: i int

return_type: void


ArrayFreeFreeFree

decompiled_code:
void __fastcall ArrayFreeFreeFree(__int64 a1)
{
__int64 v2; // rbp
__int64 v3; // rdi
__int64 v4; // rbx

if ( *(_DWORD *)(a1 - 4) )
{
v2 = 0LL;
do
{
while ( 1 )
{
v3 = *(_QWORD *)(a1 + 8 * v2);
if ( v3 )
break;
if ( *(_DWORD *)(a1 - 4) <= (unsigned int)++v2 )
goto LABEL_11;
}
if ( *(_DWORD *)(v3 - 4) )
{
v4 = 0LL;
do
{
if ( *(_QWORD *)(v3 + 8 * v4) )
{
ArrayFree(*(_QWORD *)(v3 + 8 * v4));
v3 = *(_QWORD *)(a1 + 8 * v2);
}
++v4;
}
while ( *(_DWORD *)(v3 - 4) > (unsigned int)v4 );
}
ArrayFree(v3);
++v2;
}
while ( *(_DWORD *)(a1 - 4) > (unsigned int)v2 );
}
LABEL_11:
ArrayFree(a1);
}

original_code:
void ArrayFreeFreeFree(const void *arr0) {
  const void ** const *arr = (const void ** const *)arr0;
  int i,j;
  for (i=0;i<_ArrayLength(arr);i++) {
    if (arr[i]) {
      for (j=0;j<_ArrayLength(arr[i]);j++) {
 if (arr[i][j]) ArrayFree(arr[i][j]);
      }
      ArrayFree(arr[i]);
    }
  }
  ArrayFree(arr);
}

canonical_original_code:
void ArrayFreeFreeFree(void *arr0) {
  void ***arr = (const void ** const *)arr0;
  int i; int j;
  for (i=0;i<_ArrayLength(arr);i++) {
    if (arr[i]) {
      for (j=0;j<_ArrayLength(arr[i]);j++) {
 if (arr[i][j]) ArrayFree(arr[i][j]);
      }
      ArrayFree(arr[i]);
    }
  }
  ArrayFree(arr);
}

variable_types:
arr
void ***

variable_types: j int


ArrayCompareFunction

decompiled_code:
// attributes: thunk
void __noreturn ArrayCompareFunction()
{
while ( 1 )
;
}

canonical_decompiled_code:
void __noreturn func14()
{
while ( 1 )
;
}

original_code:
void *ArrayCompareFunction(const void *array) {
  return ArrayCompareFunction(array);
}

canonical_original_code:
void *ArrayCompareFunction(void *array) {
  return ArrayCompareFunction(array);
}

variable_types:
array
void *

return_type: void *


decompiled_code:
__int64 __fastcall ts8900PinInit(__int64 a1, __int64 a2, __int64 a3, int a4)
{
__int64 result; // rax
int v5; // edi
__int64 v6; // rdi

result = a1;
if ( *(int *)(a1 + 56) <= 0 )
{
v5 = *(_DWORD *)(a2 + 60);
*(_QWORD *)result = ts8900PinInit;
*(_QWORD *)(result + 8) = ts8900PinFini;
*(_DWORD *)(result + 60) = v5;
*(_QWORD *)(result + 16) = *(_QWORD *)(a2 + 16);
*(_QWORD *)(result + 24) = *(_QWORD *)(a2 + 24);
v6 = *(_QWORD *)(a2 + 32);
*(_QWORD *)(result + 40) = ts8900PinModeGet;
*(_QWORD *)(result + 32) = v6;
*(_QWORD *)(result + 48) = ts8900PinModeSet;
*(_QWORD *)(result + 80) = a2;
*(_QWORD *)(result + 88) = a3;
*(_DWORD *)(result + 56) = 1;
*(_DWORD *)(result + 96) = a4;
}
return result;
}

canonical_decompiled_code:
__int64 __fastcall func0(__int64 a1, __int64 a2, __int64 a3, int a4)
{
__int64 result; // rax
int v5; // edi
__int64 v6; // rdi

result = a1;
if ( *(int *)(a1 + 56) <= 0 )
{
v5 = *(_DWORD *)(a2 + 60);
*(_QWORD *)result = ts8900PinInit;
*(_QWORD *)(result + 8) = ts8900PinFini;
*(_DWORD *)(result + 60) = v5;
*(_QWORD *)(result + 16) = *(_QWORD *)(a2 + 16);
*(_QWORD *)(result + 24) = *(_QWORD *)(a2 + 24);
v6 = *(_QWORD *)(a2 + 32);
*(_QWORD *)(result + 40) = ts8900PinModeGet;
*(_QWORD *)(result + 32) = v6;
*(_QWORD *)(result + 48) = ts8900PinModeSet;
*(_QWORD *)(result + 80) = a2;
*(_QWORD *)(result + 88) = a3;
*(_DWORD *)(result + 56) = 1;
*(_DWORD *)(result + 96) = a4;
}
return result;
}

original_code:
void *ts8900PinInit(ts8900Pin *pin,void *parent,void *bus,int start) {
  if (pin->InitStatus > 0) return pin;
  pin->LockBase = ((Pin *)parent)->LockBase;
  pin->Init = (void *)ts8900PinInit;
  pin->Fini = (void *)ts8900PinFini;
  pin->Lock = ((ts8900Pin *)parent)->Lock;
  pin->Unlock = ((ts8900Pin *)parent)->Unlock;
  pin->Preempt = ((ts8900Pin *)parent)->Preempt;
  pin->ModeGet = (void *)ts8900PinModeGet;
  pin->ModeSet = (void *)ts8900PinModeSet;
  pin->parent = parent;
  pin->bus = bus;
  pin->InitStatus = 1;
  pin->start = start;
  return pin;
}

canonical_original_code:
void *ts8900PinInit(struct ts8900Pin *pin, void *parent, void *bus, int start) {
  if (pin->InitStatus > 0) return pin;
  pin->LockBase = ((struct Pin *)parent)->LockBase;
  pin->Init = (void *)ts8900PinInit;
  pin->Fini = (void *)ts8900PinFini;
  pin->Lock = ((struct ts8900Pin *)parent)->Lock;
  pin->Unlock = ((struct ts8900Pin *)parent)->Unlock;
  pin->Preempt = ((struct ts8900Pin *)parent)->Preempt;
  pin->ModeGet = (void *)ts8900PinModeGet;
  pin->ModeSet = (void *)ts8900PinModeSet;
  pin->parent = parent;
  pin->bus = bus;
  pin->InitStatus = 1;
  pin->start = start;
  return pin;
}

variable_types: struct ts8900Pin { void *(*Init)(struct ts8900Pin *me, void *parent, void *bus, int start); void (*Fini)(struct ts8900Pin *me); int (*Lock)(struct ts8900Pin *me, unsigned int num, int flags); int (*Unlock)(struct ts8900Pin *me, unsigned int num, int flags); int (*Preempt)(struct ts8900Pin *me); enum PinMode { MODE_DIO=0, MODE_CAN=1, MODE_SPI=2, MODE_ADC=3, MODE_TWI=4, MODE_UART=5, MODE_TS=6, MODE_BUS=7, MODE_PWM=8, MODE_CLK=9, MODE_UNKNOWN=-1 } (*ModeGet)(struct ts8900Pin *me, int PinNumber); enum PinResult { PinSuccess=1, PinErrorModeInvalid=-13 } (*ModeSet)(struct ts8900Pin *me, int PinNumber, enum PinMode { MODE_DIO=0, MODE_CAN=1, MODE_SPI=2, MODE_ADC=3, MODE_TWI=4, MODE_UART=5, MODE_TS=6, MODE_BUS=7, MODE_PWM=8, MODE_CLK=9, MODE_UNKNOWN=-1 } Mode); int InitStatus; unsigned int LockBase; int deferlock; int deferlockR; int deferlockW; struct Pin { void *(*Init)(void *me, ...); void (*Fini)(void *me); int (*Lock)(void *me, unsigned int num, int flags); int (*Unlock)(void *me, unsigned int num, int flags); int (*Preempt)(void *me); enum PinMode { MODE_DIO=0, MODE_CAN=1, MODE_SPI=2, MODE_ADC=3, MODE_TWI=4, MODE_UART=5, MODE_TS=6, MODE_BUS=7, MODE_PWM=8, MODE_CLK=9, MODE_UNKNOWN=-1 } (*ModeGet)(void *me, int PinNumber); enum PinResult { PinSuccess=1, PinErrorModeInvalid=-13 } (*ModeSet)(void *me, int PinNumber, enum PinMode { MODE_DIO=0, MODE_CAN=1, MODE_SPI=2, MODE_ADC=3, MODE_TWI=4, MODE_UART=5, MODE_TS=6, MODE_BUS=7, MODE_PWM=8, MODE_CLK=9, MODE_UNKNOWN=-1 } Mode); int InitStatus; unsigned int LockBase; int deferlock; } *parent; struct Bus { void *(*Init)(void *me, ...); void (*Fini)(void *me); int (*Lock)(void *me, unsigned int num, int flags); int (*Unlock)(void *me, unsigned int num, int flags); int (*Preempt)(void *me); unsigned char (*Peek8)(void *me, int Address); void (*Poke8)(void *me, int Address, unsigned char Value); unsigned short (*Peek16)(void *me, int Address); void (*Poke16)(void *me, int Address, unsigned short Value); unsigned int (*Peek32)(void *me, int Address); void (*Poke32)(void *me, int Address, unsigned int Value); int (*BitGet8)(void *me, int Address, int BitNumber); void (*BitAssign8)(void *me, int Address, int BitNumber, int Value); void (*BitSet8)(void *me, int Address, int BitNumber); void (*BitClear8)(void *me, int Address, int BitNumber); int (*BitGet16)(void *me, int Address, int BitNumber); void (*BitAssign16)(void *me, int Address, int BitNumber, int Value); void (*BitSet16)(void *me, int Address, int BitNumber); void (*BitClear16)(void *me, int Address, int BitNumber); int (*BitGet32)(void *me, int Address, int BitNumber); void (*BitAssign32)(void *me, int Address, int BitNumber, int Value); void (*BitSet32)(void *me, int Address, int BitNumber); void (*BitClear32)(void *me, int Address, int BitNumber); void (*PeekStream)(void *me, int address, int direction, char *dest); void (*PokeStream)(void *me, int address, int direction, char *data); void (*Refresh)(void *me); void (*Commit)(void *me, int ForceAll); int (*BitToggle8)(void *me, int Address, int BitNumber); int (*BitToggle16)(void *me, int Address, int BitNumber); int (*BitToggle32)(void *me, int Address, int BitNumber); unsigned char (*Assign8X)(void *me, int Address, int BitMSB, int BitLSB, int Value); unsigned short (*Assign16X)(void *me, int Address, int BitMSB, int BitLSB, int Value); unsigned int (*Assign32X)(void *me, int Address, int BitMSB, int BitLSB, int Value); unsigned char (*BitsGet8)(void *me, int Address, int BitMSB, int BitLSB); unsigned short (*BitsGet16)(void *me, int Address, int BitMSB, int BitLSB); unsigned int (*BitsGet32)(void *me, int Address, int BitMSB, int BitLSB); int InitStatus; unsigned int LockBase; int deferlockW; int deferlockR; } *bus; int start; } *

variable_types:
parent
void *

variable_types:
bus
void *

variable_types: start int

user_defined_types: struct ts8900Pin { void *(*Init)(struct ts8900Pin *me, void *parent, void *bus, int start); void (*Fini)(struct ts8900Pin *me); int (*Lock)(struct ts8900Pin *me, unsigned int num, int flags); int (*Unlock)(struct ts8900Pin *me, unsigned int num, int flags); int (*Preempt)(struct ts8900Pin *me); enum PinMode (*ModeGet)(struct ts8900Pin *me, int PinNumber); enum PinResult (*ModeSet)(struct ts8900Pin *me, int PinNumber, enum PinMode Mode); int InitStatus; unsigned int LockBase; int deferlock; int deferlockR; int deferlockW; struct Pin *parent; struct Bus *bus; int start; }

user_defined_types: struct Pin { void *(*Init)(void *me, ...); void (*Fini)(void *me); int (*Lock)(void *me, unsigned int num, int flags); int (*Unlock)(void *me, unsigned int num, int flags); int (*Preempt)(void *me); enum PinMode (*ModeGet)(void *me, int PinNumber); enum PinResult (*ModeSet)(void *me, int PinNumber, enum PinMode Mode); int InitStatus; unsigned int LockBase; int deferlock; }


decompiled_code:
__int64 __fastcall ts8900PinFini(__int64 a1)
{
__int64 result; // rax

result = *(unsigned int *)(a1 + 56);
if ( (int)result > 0 )
*(_DWORD *)(a1 + 56) = 0;
return result;
}

canonical_decompiled_code:
__int64 __fastcall func1(__int64 a1)
{
__int64 result; // rax

result = *(unsigned int *)(a1 + 56);
if ( (int)result > 0 )
*(_DWORD *)(a1 + 56) = 0;
return result;
}

original_code:
void ts8900PinFini(ts8900Pin *pin) {
  if (pin->InitStatus > 0) pin->InitStatus = 0;
}

canonical_original_code:
void ts8900PinFini(struct ts8900Pin *pin) {
  if (pin->InitStatus > 0) pin->InitStatus = 0;
}

user_defined_types: struct Bus { void *(*Init)(void *me, ...); void (*Fini)(void *me); int (*Lock)(void *me, unsigned int num, int flags); int (*Unlock)(void *me, unsigned int num, int flags); int (*Preempt)(void *me); unsigned char (*Peek8)(void *me, int Address); void (*Poke8)(void *me, int Address, unsigned char Value); unsigned short (*Peek16)(void *me, int Address); void (*Poke16)(void *me, int Address, unsigned short Value); unsigned int (*Peek32)(void *me, int Address); void (*Poke32)(void *me, int Address, unsigned int Value); int (*BitGet8)(void *me, int Address, int BitNumber); void (*BitAssign8)(void *me, int Address, int BitNumber, int Value); void (*BitSet8)(void *me, int Address, int BitNumber); void (*BitClear8)(void *me, int Address, int BitNumber); int (*BitGet16)(void *me, int Address, int BitNumber); void (*BitAssign16)(void *me, int Address, int BitNumber, int Value); void (*BitSet16)(void *me, int Address, int BitNumber); void (*BitClear16)(void *me, int Address, int BitNumber); int (*BitGet32)(void *me, int Address, int BitNumber); void (*BitAssign32)(void *me, int Address, int BitNumber, int Value); void (*BitSet32)(void *me, int Address, int BitNumber); void (*BitClear32)(void *me, int Address, int BitNumber); void (*PeekStream)(void *me, int address, int direction, char *dest); void (*PokeStream)(void *me, int address, int direction, char *data); void (*Refresh)(void *me); void (*Commit)(void *me, int ForceAll); int (*BitToggle8)(void *me, int Address, int BitNumber); int (*BitToggle16)(void *me, int Address, int BitNumber); int (*BitToggle32)(void *me, int Address, int BitNumber); unsigned char (*Assign8X)(void *me, int Address, int BitMSB, int BitLSB, int Value); unsigned short (*Assign16X)(void *me, int Address, int BitMSB, int BitLSB, int Value); unsigned int (*Assign32X)(void *me, int Address, int BitMSB, int BitLSB, int Value); unsigned char (*BitsGet8)(void *me, int Address, int BitMSB, int BitLSB); unsigned short (*BitsGet16)(void *me, int Address, int BitMSB, int BitLSB); unsigned int (*BitsGet32)(void *me, int Address, int BitMSB, int BitLSB); int InitStatus; unsigned int LockBase; int deferlockW; int deferlockR; }

user_defined_types: enum PinMode { MODE_DIO=0, MODE_CAN=1, MODE_SPI=2, MODE_ADC=3, MODE_TWI=4, MODE_UART=5, MODE_TS=6, MODE_BUS=7, MODE_PWM=8, MODE_CLK=9, MODE_UNKNOWN=-1 }

user_defined_types: enum PinResult { PinSuccess=1, PinErrorModeInvalid=-13 }


original_code:
PinMode ts8900PinModeGet(ts8900Pin *pin,int npin) {
  int ret;
  npin -= pin->start;
  if (npin >= 16 && npin <= 31) {
    pin->bus->Lock(pin->bus,0,SHARED);
    ret=pin->bus->BitGet16(pin->bus,0x08,npin-16) ? MODE_DIO:MODE_BUS;
    pin->bus->Unlock(pin->bus,0,SHARED);
    return ret;
  } else if (npin == 32) {
    pin->bus->Lock(pin->bus,0,SHARED);
    ret=pin->bus->BitGet16(pin->bus,0x0A,8) ? MODE_DIO:MODE_BUS;
    pin->bus->Unlock(pin->bus,0,SHARED);
    return ret;
  } else if (npin >= 33 && npin <= 41) {
    pin->bus->Lock(pin->bus,0,SHARED);
    ret=pin->bus->BitGet16(pin->bus,0x0A,npin-33) ? MODE_DIO:MODE_BUS;
    pin->bus->Unlock(pin->bus,0,SHARED);
    return ret;
  }
  npin += pin->start;
  return pin->parent->ModeGet(pin->parent,npin);
}

canonical_original_code:
enum PinMode ts8900PinModeGet(struct ts8900Pin *pin, int npin) {
  int ret;
  npin -= pin->start;
  if (npin >= 16 && npin <= 31) {
    pin->bus->Lock(pin->bus,0,SHARED);
    ret=pin->bus->BitGet16(pin->bus,0x08,npin-16) ? MODE_DIO:MODE_BUS;
    pin->bus->Unlock(pin->bus,0,SHARED);
    return ret;
  } else if (npin == 32) {
    pin->bus->Lock(pin->bus,0,SHARED);
    ret=pin->bus->BitGet16(pin->bus,0x0A,8) ? MODE_DIO:MODE_BUS;
    pin->bus->Unlock(pin->bus,0,SHARED);
    return ret;
  } else if (npin >= 33 && npin <= 41) {
    pin->bus->Lock(pin->bus,0,SHARED);
    ret=pin->bus->BitGet16(pin->bus,0x0A,npin-33) ? MODE_DIO:MODE_BUS;
    pin->bus->Unlock(pin->bus,0,SHARED);
    return ret;
  }
  npin += pin->start;
  return pin->parent->ModeGet(pin->parent,npin);
}

variable_types: npin int

variable_types: ret int

return_type: enum PinMode { MODE_DIO=0, MODE_CAN=1, MODE_SPI=2, MODE_ADC=3, MODE_TWI=4, MODE_UART=5, MODE_TS=6, MODE_BUS=7, MODE_PWM=8, MODE_CLK=9, MODE_UNKNOWN=-1 }


original_code:
PinResult ts8900PinModeSet(ts8900Pin *pin,int npin,PinMode mode) {
  int ret;
  npin -= pin->start;
  if (npin >= 16 && npin <= 31) {
    pin->bus->Lock(pin->bus,0,0);
    if (mode == MODE_DIO) {
      pin->bus->BitSet16(pin->bus,0x08,npin-16);
      ret=PinSuccess;
    } else if (mode == MODE_BUS) {
      pin->bus->BitClear16(pin->bus,0x08,npin-16);
      ret=PinSuccess;
    } else {
      ret=PinErrorModeInvalid;
    }
    pin->bus->Unlock(pin->bus,0,0);
    return ret;
  } else if (npin == 32) {
    pin->bus->Lock(pin->bus,0,0);
    if (mode == MODE_DIO) {
      pin->bus->BitSet16(pin->bus,0x0A,8);
      ret=PinSuccess;
    } else if (mode == MODE_BUS) {
      pin->bus->BitClear16(pin->bus,0x0A,8);
      ret=PinSuccess;
    } else {
      ret=PinErrorModeInvalid;
    }
    pin->bus->Unlock(pin->bus,0,0);
    return ret;
  } else if (npin >= 33 && npin <= 41) {
    pin->bus->Lock(pin->bus,0,0);
    if (mode == MODE_DIO) {
      pin->bus->BitSet16(pin->bus,0x0A,npin-33);
      ret=PinSuccess;
    } else if (mode == MODE_BUS) {
      pin->bus->BitClear16(pin->bus,0x0A,npin-33);
      ret=PinSuccess;
    } else {
      ret=PinErrorModeInvalid;
    }
    pin->bus->Unlock(pin->bus,0,0);
    return ret;
  }
  npin += pin->start;
  return pin->parent->ModeSet(pin->parent,npin,mode);
}

canonical_original_code:
enum PinResult ts8900PinModeSet(struct ts8900Pin *pin, int npin, enum PinMode mode) {
  int ret;
  npin -= pin->start;
  if (npin >= 16 && npin <= 31) {
    pin->bus->Lock(pin->bus,0,0);
    if (mode == MODE_DIO) {
      pin->bus->BitSet16(pin->bus,0x08,npin-16);
      ret=PinSuccess;
    } else if (mode == MODE_BUS) {
      pin->bus->BitClear16(pin->bus,0x08,npin-16);
      ret=PinSuccess;
    } else {
      ret=PinErrorModeInvalid;
    }
    pin->bus->Unlock(pin->bus,0,0);
    return ret;
  } else if (npin == 32) {
    pin->bus->Lock(pin->bus,0,0);
    if (mode == MODE_DIO) {
      pin->bus->BitSet16(pin->bus,0x0A,8);
      ret=PinSuccess;
    } else if (mode == MODE_BUS) {
      pin->bus->BitClear16(pin->bus,0x0A,8);
      ret=PinSuccess;
    } else {
      ret=PinErrorModeInvalid;
    }
    pin->bus->Unlock(pin->bus,0,0);
    return ret;
  } else if (npin >= 33 && npin <= 41) {
    pin->bus->Lock(pin->bus,0,0);
    if (mode == MODE_DIO) {
      pin->bus->BitSet16(pin->bus,0x0A,npin-33);
      ret=PinSuccess;
    } else if (mode == MODE_BUS) {
      pin->bus->BitClear16(pin->bus,0x0A,npin-33);
      ret=PinSuccess;
    } else {
      ret=PinErrorModeInvalid;
    }
    pin->bus->Unlock(pin->bus,0,0);
    return ret;
  }
  npin += pin->start;
  return pin->parent->ModeSet(pin->parent,npin,mode);
}

variable_types: enum PinMode { MODE_DIO=0, MODE_CAN=1, MODE_SPI=2, MODE_ADC=3, MODE_TWI=4, MODE_UART=5, MODE_TS=6, MODE_BUS=7, MODE_PWM=8, MODE_CLK=9, MODE_UNKNOWN=-1 }

return_type: enum PinResult { PinSuccess=1, PinErrorModeInvalid=-13 }


decompiled_code:
__int64 ts8200ArchNextSubArch()
{
return 0LL;
}

canonical_decompiled_code:
__int64 func0()
{
return 0LL;
}

canonical_original_code:
struct Arch *ts8200ArchNextSubArch() {
  return 0;
}

return_type: struct Arch { struct Arch *(*Init)(); void *(*Function)(int class, int inst); struct Arch *(*NextSubArch)(); void (*NextSubArchSet)(struct Arch *); int (*CANBusId)(int inst); } *


decompiled_code:
__int64 ts8200Function()
{
return 0LL;
}

canonical_decompiled_code:
__int64 func1()
{
return 0LL;
}

original_code:
void *ts8200Function(int class,int inst) {
  return 0;
}

canonical_original_code:
void *ts8200Function(int class, int inst) {
  return 0;
}

variable_types: class int

variable_types: inst int


decompiled_code:
__int64 ts8200ArchInit()
{
__int64 result; // rax

result = ts8200_0;
if ( !ts8200_0 )
{
ts8200_0 = (__int64)ts8200Arch;
dioctl_config_add2(
&Xts8200_dioctl_config,
(unsigned int)Xts8200_dioctl_config_len,
(unsigned int)Yts8200_dioctl_config_len);
result = ts8200_0;
}
return result;
}

canonical_decompiled_code:
__int64 func2()
{
__int64 result; // rax

result = ts8200_0;
if ( !ts8200_0 )
{
ts8200_0 = (__int64)ts8200Arch;
dioctl_config_add2(
&Xts8200_dioctl_config,
(unsigned int)Xts8200_dioctl_config_len,
(unsigned int)Yts8200_dioctl_config_len);
result = ts8200_0;
}
return result;
}

original_code:
Arch *ts8200ArchInit() {
  static Arch *ts8200;
  if (ts8200) return ts8200;
  ts8200 = &ts8200Arch;
  dioctl_config_add2(Xts8200_dioctl_config,Xts8200_dioctl_config_len,Yts8200_dioctl_config_len);
  return ts8200;
}

canonical_original_code:
struct Arch *ts8200ArchInit() {
  static struct Arch *ts8200;
  if (ts8200) return ts8200;
  ts8200 = &ts8200Arch;
  dioctl_config_add2(Xts8200_dioctl_config,Xts8200_dioctl_config_len,Yts8200_dioctl_config_len);
  return ts8200;
}

variable_types: struct Arch { struct Arch *(*Init)(); void *(*Function)(int class, int inst); struct Arch *(*NextSubArch)(); void (*NextSubArchSet)(struct Arch *); int (*CANBusId)(int inst); } *


ArrayFree

decompiled_code:
void __fastcall ArrayFree(__int64 a1)
{
free((void *)(a1 - 12));
}

canonical_decompiled_code:
void __fastcall func3(__int64 a1)
{
free((void *)(a1 - 12));
}

original_code:
void ArrayFree(const void *arr) {
  unsigned *ptr = (unsigned *)arr;
  free(ptr-3);
}

canonical_original_code:
void ArrayFree(void *arr) {
  unsigned int *ptr = (unsigned *)arr;
  free(ptr-3);
}

variable_types:
arr
void *

variable_types:
ptr
unsigned int *


ASCIIZ

decompiled_code:
char *__fastcall ASCIIZ(char *src)
{
unsigned int v1; // ebx
char *v2; // rax

v1 = strlen(src);
v2 = (char *)ArrayAlloc(v1, 1u);
return strncpy(v2, src, v1);
}

canonical_decompiled_code:
char *__fastcall func4(char *src)
{
unsigned int v1; // ebx
char *v2; // rax

v1 = strlen(src);
v2 = (char *)ArrayAlloc(v1, 1u);
return strncpy(v2, src, v1);
}

original_code:
char *ASCIIZ(const char *str) {
  unsigned len = strlen(str);
  char *str2 = (char *)ArrayAlloc(len,1);
  strncpy(str2,str,len);
  return str2;
}

canonical_original_code:
char *ASCIIZ(char *str) {
  unsigned int len = strlen(str);
  char *str2 = (char *)ArrayAlloc(len,1);
  strncpy(str2,str,len);
  return str2;
}

variable_types:
str
char *

variable_types:
len
unsigned int

return_type: char *


ArraySizeAuto

decompiled_code:
__int64 __fastcall ArraySizeAuto(__int64 a1, int a2)
{
*(_DWORD *)(a1 - 4) = a2;
return a1;
}

canonical_decompiled_code:
__int64 __fastcall func5(__int64 a1, int a2)
{
*(_DWORD *)(a1 - 4) = a2;
return a1;
}

original_code:
void *ArraySizeAuto(void *arr,unsigned count) {
  unsigned *ptr = (unsigned *)arr;
  ptr -= 3;
  ptr[2] = count;
  return &ptr[3];
}

canonical_original_code:
void *ArraySizeAuto(void *arr, unsigned int count) {
  unsigned int *ptr = (unsigned *)arr;
  ptr -= 3;
  ptr[2] = count;
  return &ptr[3];
}

variable_types:
count
unsigned int


ArrayElementSize

decompiled_code:
__int64 __fastcall ArrayElementSize(__int64 a1)
{
return *(unsigned int *)(a1 - 8);
}

canonical_decompiled_code:
__int64 __fastcall func6(__int64 a1)
{
return *(unsigned int *)(a1 - 8);
}

original_code:
unsigned ArrayElementSize(const void *array) {
  return _ArrayElementSize(array);
}

canonical_original_code:
unsigned int ArrayElementSize(void *array) {
  return _ArrayElementSize(array);
}

return_type: unsigned int


ArrayLength

decompiled_code:
__int64 __fastcall ArrayLength(__int64 a1)
{
return *(unsigned int *)(a1 - 4);
}

canonical_decompiled_code:
__int64 __fastcall func7(__int64 a1)
{
return *(unsigned int *)(a1 - 4);
}

original_code:
unsigned ArrayLength(const void *array) {
  return _ArrayLength(array);
}

canonical_original_code:
unsigned int ArrayLength(void *array) {
  return _ArrayLength(array);
}


ArrayFreeFree

variable_types:
arr
void **

variable_types: i int


ArrayFreeFreeFree

variable_types:
arr
void ***

variable_types: j int


ArrayCompareFunction

canonical_decompiled_code:
void __noreturn func10()
{
while ( 1 )
;
}

variable_types:
array
void *


ArrayFree

canonical_decompiled_code:
void __fastcall func0(__int64 a1)
{
free((void *)(a1 - 12));
}


ASCIIZ

canonical_decompiled_code:
char *__fastcall func1(char *src)
{
unsigned int v1; // ebx
char *v2; // rax

v1 = strlen(src);
v2 = (char *)ArrayAlloc(v1, 1u);
return strncpy(v2, src, v1);
}


ArraySizeAuto

canonical_decompiled_code:
__int64 __fastcall func2(__int64 a1, int a2)
{
*(_DWORD *)(a1 - 4) = a2;
return a1;
}


ArrayElementSize

canonical_decompiled_code:
__int64 __fastcall func3(__int64 a1)
{
return *(unsigned int *)(a1 - 8);
}


ArrayLength

canonical_decompiled_code:
__int64 __fastcall func4(__int64 a1)
{
return *(unsigned int *)(a1 - 4);
}


ArrayCompareFunction

canonical_decompiled_code:
void __noreturn func7()
{
while ( 1 )
;
}


TsctlClient

decompiled_code:
void *__fastcall TsctlClient(__int64 a1, int a2)
{
void *v2; // r12
int v3; // eax
unsigned int v4; // ebp
__int64 v5; // rax

v2 = 0LL;
v3 = ClientSocketNew(a1, 5001LL);
if ( v3 >= 0 )
{
v4 = v3;
v2 = malloc(0xD8uLL);
memset(v2, 0, 0xC8uLL);
v5 = DescriptorStreamInit2(v4, v4, 1436LL);
*((_DWORD *)v2 + 52) = a2;
*((_QWORD *)v2 + 25) = v5;
*((_DWORD *)v2 + 53) = 0;
}
return v2;
}

canonical_decompiled_code:
void *__fastcall func8(__int64 a1, int a2)
{
void *v2; // r12
int v3; // eax
unsigned int v4; // ebp
__int64 v5; // rax

v2 = 0LL;
v3 = ClientSocketNew(a1, 5001LL);
if ( v3 >= 0 )
{
v4 = v3;
v2 = malloc(0xD8uLL);
memset(v2, 0, 0xC8uLL);
v5 = DescriptorStreamInit2(v4, v4, 1436LL);
*((_DWORD *)v2 + 52) = a2;
*((_QWORD *)v2 + 25) = v5;
*((_DWORD *)v2 + 53) = 0;
}
return v2;
}

original_code:
tsctl *TsctlClient(char *host,int mode) {
  int socket;
  tsctl *ret;
  socket = ClientSocketNew(host,5001);
  if (socket < 0) {
    return 0;
  }
  ret = malloc(sizeof(tsctl));
  memset(ret->exception,0,sizeof(jmp_buf));
  ret->st = DescriptorStreamInit2(socket,socket,1436);
  ret->mode = mode;
  ret->count = 0;
  return ret;
}

canonical_original_code:
struct tsctl *TsctlClient(char *host, int mode) {
  int socket;
  struct tsctl *ret;
  socket = ClientSocketNew(host,5001);
  if (socket < 0) {
    return 0;
  }
  ret = malloc(sizeof(tsctl));
  memset(ret->exception,0,sizeof(jmp_buf));
  ret->st = DescriptorStreamInit2(socket,socket,1436);
  ret->mode = mode;
  ret->count = 0;
  return ret;
}

variable_types:
host
char *

variable_types: mode int

variable_types: socket int

variable_types: struct tsctl { struct __jmp_buf_tag { long __jmpbuf[8]; int __mask_was_saved; struct __sigset_t { unsigned long __val[-1]; } __saved_mask; } exception[1]; struct Stream { void (*Fini)(struct Stream *); int (*Read)(struct Stream *, char *bytes, int len); int (*Unread)(struct Stream *st, int ch); int (*ReadChar)(struct Stream *st); unsigned int (*InputReady)(struct Stream *st); int (*Write)(struct Stream *, char *bytes, int len); int (*WriteChar)(struct Stream *st, char byte); int (*isEOF)(struct Stream *st); void (*Flush)(struct Stream *st); int outputOffset; } *st; int mode; } *

user_defined_types: struct tsctl { struct __jmp_buf_tag exception[1]; struct Stream *st; int mode; }

user_defined_types: struct __jmp_buf_tag { long __jmpbuf[8]; int __mask_was_saved; struct __sigset_t __saved_mask; }


decompiled_code:
void *__fastcall TsctlClient2(__int64 a1, int a2)
{
void *v2; // r8
void *result; // rax

v2 = malloc(0xD8uLL);
memset(v2, 0, 0xC8uLL);
*((_QWORD *)v2 + 25) = a1;
result = v2;
*((_DWORD *)v2 + 52) = a2;
*((_DWORD *)v2 + 53) = 0;
return result;
}

canonical_decompiled_code:
void *__fastcall func9(__int64 a1, int a2)
{
void *v2; // r8
void *result; // rax

v2 = malloc(0xD8uLL);
memset(v2, 0, 0xC8uLL);
*((_QWORD *)v2 + 25) = a1;
result = v2;
*((_DWORD *)v2 + 52) = a2;
*((_DWORD *)v2 + 53) = 0;
return result;
}

original_code:
tsctl *TsctlClient2(Stream *st,int mode) {
  tsctl *ret;
  ret = malloc(sizeof(tsctl));
  memset(ret->exception,0,sizeof(jmp_buf));
  ret->st = st;
  ret->mode = mode;
  ret->count = 0;
  return ret;
}

canonical_original_code:
struct tsctl *TsctlClient2(struct Stream *st, int mode) {
  struct tsctl *ret;
  ret = malloc(sizeof(tsctl));
  memset(ret->exception,0,sizeof(jmp_buf));
  ret->st = st;
  ret->mode = mode;
  ret->count = 0;
  return ret;
}

variable_types:
st
struct Stream *

return_type: struct tsctl { struct __jmp_buf_tag { long __jmpbuf[8]; int __mask_was_saved; struct __sigset_t { unsigned long __val[-1]; } __saved_mask; } exception[1]; struct Stream { void (*Fini)(struct Stream *); int (*Read)(struct Stream *, char *bytes, int len); int (*Unread)(struct Stream *st, int ch); int (*ReadChar)(struct Stream *st); unsigned int (*InputReady)(struct Stream *st); int (*Write)(struct Stream *, char *bytes, int len); int (*WriteChar)(struct Stream *st, char byte); int (*isEOF)(struct Stream *st); void (*Flush)(struct Stream *st); int outputOffset; } *st; int mode; } *


ArrayFree

canonical_decompiled_code:
void __fastcall func7(__int64 a1)
{
free((void *)(a1 - 12));
}


ASCIIZ

canonical_decompiled_code:
char *__fastcall func8(char *src)
{
unsigned int v1; // ebx
char *v2; // rax

v1 = strlen(src);
v2 = (char *)ArrayAlloc(v1, 1u);
return strncpy(v2, src, v1);
}


ArraySizeAuto

canonical_decompiled_code:
__int64 __fastcall func9(__int64 a1, int a2)
{
*(_DWORD *)(a1 - 4) = a2;
return a1;
}


ArrayElementSize

canonical_decompiled_code:
__int64 __fastcall func10(__int64 a1)
{
return *(unsigned int *)(a1 - 8);
}


ArrayLength

canonical_decompiled_code:
__int64 __fastcall func11(__int64 a1)
{
return *(unsigned int *)(a1 - 4);
}


ArrayFreeFree

canonical_original_code:
void ArrayFreeFree(void *arr0) {
  void **arr = (const void * const *)arr0;
  int i;
  for (i=0;i<_ArrayLength(arr);i++) {
    if (arr[i]) ArrayFree(arr[i]);
  }
  ArrayFree(arr);
}


ArrayFreeFreeFree

canonical_original_code:
void ArrayFreeFreeFree(void *arr0) {
  void ***arr = (const void ** const *)arr0;
  int i; int j;
  for (i=0;i<_ArrayLength(arr);i++) {
    if (arr[i]) {
      for (j=0;j<_ArrayLength(arr[i]);j++) {
 if (arr[i][j]) ArrayFree(arr[i][j]);
      }
      ArrayFree(arr[i]);
    }
  }
  ArrayFree(arr);
}


ArrayCompareFunction

canonical_decompiled_code:
void __noreturn func14()
{
while ( 1 )
;
}

canonical_original_code:
void *ArrayCompareFunction(void *array) {
  return ArrayCompareFunction(array);
}


main

canonical_name: main

repo: emptymonkey/pretend

decompiled_code:
int __cdecl __noreturn main(int argc, const char **argv, const char **envp)
{
__uid_t v3; // er14
__gid_t v4; // er13
int *v5; // rax
int v6; // edx
int *v7; // r12
char *v8; // rdi
__int64 i; // r15
__gid_t v10; // eax
char *endptr; // [rsp+8h] [rbp-240h] BYREF
__gid_t groups[142]; // [rsp+10h] [rbp-238h] BYREF

if ( argc > 2 )
{
memset(groups, 0, 0x200uLL);
v3 = strtol(argv[1], &endptr, 10);
v4 = strtol(endptr + 1, &endptr, 10);
v5 = __errno_location();
v6 = *v5;
v7 = v5;
if ( !*v5 )
{
v8 = endptr;
for ( i = 1LL; *v8; ++i )
{
v10 = strtol(v8 + 1, &endptr, 10);
v8 = endptr;
v6 = i;
groups[i - 1] = v10;
}
if ( setgroups(v6, groups) )
{
error(-1, *v7, "setgroups()");
}
else if ( setresgid(v4, v4, v4) )
{
error(-1, *v7, "setresgid()");
goto LABEL_8;
}
if ( setresuid(v3, v3, v3) )
error(-1, *v7, "setresuid()");
execvp(argv[2], (char *const *)argv + 2);
error(-1, *v7, "execv()");
start();
}
}
LABEL_8:
fprintf(stderr, "Usage: %s uid:gid[:gid1:gid2:...] COMMAND [ARGS]\n", *argv);
exit(-1);
}

canonical_decompiled_code:
int __cdecl __noreturn main(int argc, const char **argv, const char **envp)
{
__uid_t v3; // er14
__gid_t v4; // er13
int *v5; // rax
int v6; // edx
int *v7; // r12
char *v8; // rdi
__int64 i; // r15
__gid_t v10; // eax
char *endptr; // [rsp+8h] [rbp-240h] BYREF
__gid_t groups[142]; // [rsp+10h] [rbp-238h] BYREF

if ( argc > 2 )
{
memset(groups, 0, 0x200uLL);
v3 = strtol(argv[1], &endptr, 10);
v4 = strtol(endptr + 1, &endptr, 10);
v5 = __errno_location();
v6 = *v5;
v7 = v5;
if ( !*v5 )
{
v8 = endptr;
for ( i = 1LL; *v8; ++i )
{
v10 = strtol(v8 + 1, &endptr, 10);
v8 = endptr;
v6 = i;
groups[i - 1] = v10;
}
if ( setgroups(v6, groups) )
{
error(-1, *v7, "setgroups()");
}
else if ( setresgid(v4, v4, v4) )
{
error(-1, *v7, "setresgid()");
goto LABEL_8;
}
if ( setresuid(v3, v3, v3) )
error(-1, *v7, "setresuid()");
execvp(argv[2], (char *const *)argv + 2);
error(-1, *v7, "execv()");
func1();
}
}
LABEL_8:
fprintf(stderr, "Usage: %s uid:gid[:gid1:gid2:...] COMMAND [ARGS]\n", *argv);
exit(-1);
}

original_code:
int main(int argc, char **argv){
 uid_t uid;
 gid_t gid, gid_list[128];
 int i;
 char *end_ptr;
 if(argc < 3){
  fprintf(stderr, "Usage: %s uid:gid[:gid1:gid2:...] COMMAND [ARGS]\n", argv[0]);
  exit(-1);
 }
 memset(gid_list, 0, sizeof(gid_list));
 uid = (uid_t) strtol(argv[1], &end_ptr, 10);
 gid = (gid_t) strtol(end_ptr + 1, &end_ptr, 10);
 if((*__errno_location ())){
  fprintf(stderr, "Usage: %s uid:gid[:gid1:gid2:...] COMMAND [ARGS]\n", argv[0]);
  exit(-1);
 }
 i = 0;
 while(*end_ptr != 0){
  gid_list[i++] = (gid_t) strtol(end_ptr + 1, &end_ptr, 10);
 }
 if(setgroups((size_t) i, gid_list)){
  error(-1, (*__errno_location ()), "setgroups()");
 }
 if(setresgid(gid, gid, gid)){
  error(-1, (*__errno_location ()), "setresgid()");
 }
 if(setresuid(uid, uid, uid)){
  error(-1, (*__errno_location ()), "setresuid()");
 }
 execvp(argv[2], argv + 2);
 error(-1, (*__errno_location ()), "execv()");
 return(-1);
}

canonical_original_code:
int main(int argc, char **argv){
 unsigned int uid;
 unsigned int gid; unsigned int gid_list[128];
 int i;
 char *end_ptr;
 if(argc < 3){
  fprintf(stderr, "Usage: %s uid:gid[:gid1:gid2:...] COMMAND [ARGS]\n", argv[0]);
  exit(-1);
 }
 memset(gid_list, 0, sizeof(gid_list));
 uid = (unsigned int) strtol(argv[1], &end_ptr, 10);
 gid = (unsigned int) strtol(end_ptr + 1, &end_ptr, 10);
 if((*__errno_location ())){
  fprintf(stderr, "Usage: %s uid:gid[:gid1:gid2:...] COMMAND [ARGS]\n", argv[0]);
  exit(-1);
 }
 i = 0;
 while(*end_ptr != 0){
  gid_list[i++] = (unsigned int) strtol(end_ptr + 1, &end_ptr, 10);
 }
 if(setgroups((unsigned long) i, gid_list)){
  error(-1, (*__errno_location ()), "setgroups()");
 }
 if(setresgid(gid, gid, gid)){
  error(-1, (*__errno_location ()), "setresgid()");
 }
 if(setresuid(uid, uid, uid)){
  error(-1, (*__errno_location ()), "setresuid()");
 }
 execvp(argv[2], argv + 2);
 error(-1, (*__errno_location ()), "execv()");
 return(-1);
}

variable_types: argc int

variable_types:
argv
char **

variable_types:
uid
unsigned int

variable_types:
gid
unsigned int


repo: felixhandte/Maze-Solver

decompiled_code:
int __cdecl main(int argc, const char **argv, const char **envp)
{
const char *v4; // rdi
int v6; // eax
const char *v7; // rdi
bool v8; // cf
bool v9; // zf
const char *v10; // rdi
__int64 v11; // rcx
const char *v12; // rsi

if ( (unsigned int)(argc - 5) > 1 )
{
puts(
"Usage: ./genmaze OUTPUT_FILE ALGORITHM WIDTH HEIGHT [RANDOMNESS]\n"
"\n"
"ALGORITHM: rand OR dfs\n"
"RANDOMNESS: odds of adding a(n extra, for dfs) connection, out of 256\n");
}
else
{
v4 = argv[1];
if ( *(_WORD *)v4 == 45 )
stream = (FILE *)stdout;
else
stream = fopen(v4, "w");
v6 = atoi(argv[3]);
v7 = argv[4];
mx = v6;
my = atoi(v7);
if ( argc == 6 )
odds = atoi(argv[5]);
else
odds = strcmp(argv[2], "rand") == 0 ? 0x80 : 0;
rf = fopen("/dev/urandom", "r");
fwrite("Allocating...\n", 1uLL, 0xEuLL, stderr);
alloc_maze();
fwrite("Generating...\n", 1uLL, 0xEuLL, stderr);
v10 = "rand";
v11 = 5LL;
v12 = argv[2];
do
{
if ( !v11 )
break;
v8 = *v12 < (unsigned int)*v10;
v9 = *v12++ == *v10++;
--v11;
}
while ( v9 );
if ( (!v8 && !v9) == v8 )
{
random_connections(v10, v12);
}
else
{
if ( strcmp(argv[2], "dfs") )
{
puts("Invalid algorithm.");
return 0;
}
depth_first();
}
fwrite("Printing...\n", 1uLL, 0xCuLL, stderr);
print_maze();
fwrite("Done.\n", 1uLL, 6uLL, stderr);
}
return 0;
}

canonical_decompiled_code:
int __cdecl main(int argc, const char **argv, const char **envp)
{
const char *v4; // rdi
int v6; // eax
const char *v7; // rdi
bool v8; // cf
bool v9; // zf
const char *v10; // rdi
__int64 v11; // rcx
const char *v12; // rsi

if ( (unsigned int)(argc - 5) > 1 )
{
puts(
"Usage: ./genmaze OUTPUT_FILE ALGORITHM WIDTH HEIGHT [RANDOMNESS]\n"
"\n"
"ALGORITHM: rand OR dfs\n"
"RANDOMNESS: odds of adding a(n extra, for dfs) connection, out of 256\n");
}
else
{
v4 = argv[1];
if ( *(_WORD *)v4 == 45 )
stream = (FILE *)stdout;
else
stream = fopen(v4, "w");
v6 = atoi(argv[3]);
v7 = argv[4];
mx = v6;
my = atoi(v7);
if ( argc == 6 )
odds = atoi(argv[5]);
else
odds = strcmp(argv[2], "rand") == 0 ? 0x80 : 0;
rf = fopen("/dev/urandom", "r");
fwrite("Allocating...\n", 1uLL, 0xEuLL, stderr);
func8();
fwrite("Generating...\n", 1uLL, 0xEuLL, stderr);
v10 = "rand";
v11 = 5LL;
v12 = argv[2];
do
{
if ( !v11 )
break;
v8 = *v12 < (unsigned int)*v10;
v9 = *v12++ == *v10++;
--v11;
}
while ( v9 );
if ( (!v8 && !v9) == v8 )
{
func7(v10, v12);
}
else
{
if ( strcmp(argv[2], "dfs") )
{
puts("Invalid algorithm.");
return 0;
}
func11();
}
fwrite("Printing...\n", 1uLL, 0xCuLL, stderr);
func9();
fwrite("Done.\n", 1uLL, 6uLL, stderr);
}
return 0;
}

original_code:
int main(int argc, char *argv[]){
 if(argc != 5 && argc != 6){
  printf("Usage: ./genmaze OUTPUT_FILE ALGORITHM WIDTH HEIGHT [RANDOMNESS]\n"
         "\n"
         "ALGORITHM: rand OR dfs\n"
         "RANDOMNESS: odds of adding a(n extra, for dfs) connection, out of 256\n\n");
  return 0;
 }
 if(!strcmp(argv[1], "-")){
  of = stdout;
 } else {
  of = fopen(argv[1], "w");
 }
 mx = atoi(argv[3]);
 my = atoi(argv[4]);
 if(argc == 6){
  odds = atoi(argv[5]);
 } else {
  if(!strcmp(argv[2], "rand")){
   odds = 128;
  } else {
   odds = 0;
  }
 }
 rf = fopen("/dev/urandom", "r");
 fprintf(stderr, "Allocating...\n");
 alloc_maze();
 fprintf(stderr, "Generating...\n");
 if(!strcmp(argv[2], "rand")){
  random_connections();
 } else
 if(!strcmp(argv[2], "dfs")){
  depth_first();
 } else {
  printf("Invalid algorithm.\n");
  return 0;
 }
 fprintf(stderr, "Printing...\n");
 print_maze();
 fprintf(stderr, "Done.\n");
 return 0;
}

variable_types:
argv
char *[]


original_code:
void random_connections(void){
 int i, j;
 for(i = 0; i < my; i++){
  for(j = 0; j < mx; j++){
   maze[i][j] |= (fgetc(rf) < odds) * 2 + (fgetc(rf) < odds);
   if(j < mx - 1 && (maze[i][j] & 1)){
    maze[i][j + 1] |= 4;
   }
   if(i < my - 1 && (maze[i][j] & 2)){
    maze[i + 1][j] |= 8;
   }
  }
 }
}

canonical_original_code:
void random_connections(){
 int i; int j;
 for(i = 0; i < my; i++){
  for(j = 0; j < mx; j++){
   maze[i][j] |= (fgetc(rf) < odds) * 2 + (fgetc(rf) < odds);
   if(j < mx - 1 && (maze[i][j] & 1)){
    maze[i][j + 1] |= 4;
   }
   if(i < my - 1 && (maze[i][j] & 2)){
    maze[i + 1][j] |= 8;
   }
  }
 }
}


randdir

original_code:
int randdir(int opts){
 int dir = 0;
 char bitcounts[16] = {0,1,1,2,
                       1,2,2,3,
                       1,2,2,3,
                       2,3,3,4};
 unsigned int rb = fgetc(rf);
 switch(bitcounts[opts]){
  case 0:
   break;
  case 1:
   dir = opts;
   break;
  case 2:
   if(rb & 1){
    if(opts & 1){
     if(opts & 2){
      dir = 2;
     } else
     if(opts & 4){
      dir = 4;
     } else {
      dir = 8;
     }
    } else
    if(opts & 2){
     if(opts & 4){
      dir = 4;
     } else {
      dir = 8;
     }
    } else {
     dir = 8;
    }
   } else {
    if(opts & 1){
     dir = 1;
    } else
    if(opts & 2){
     dir = 2;
    } else {
     dir = 4;
    }
   }
   break;
  case 3:
   while(rb == 0xFF){
    rb = fgetc(rf);
   }
   if(~opts & 1){
    dir = 2 << (rb % 3);
   } else
   if(~opts & 2){
    switch(rb % 3){
     case 0:
      dir = 1;
      break;
     case 1:
      dir = 4;
      break;
     case 2:
      dir = 8;
      break;
    }
   } else
   if(~opts & 4){
    switch(rb % 3){
     case 0:
      dir = 1;
      break;
     case 1:
      dir = 2;
      break;
     case 2:
      dir = 8;
      break;
    }
   } else {
    dir = 1 << (rb % 3);
   }
   break;
 }
 return dir;
}

variable_types: opts int

variable_types: dir int

variable_types:
bitcounts
char [16]

variable_types:
rb
unsigned int


original_code:
void depth_first(void){
 int *xstack = malloc(mx * my * sizeof(int));
 int *ystack = malloc(mx * my * sizeof(int));
 xstack[0] = 0;
 ystack[0] = 0;
 int sp = 0;
 int x, y;
 int dir;
 while(sp >= 0){
  if(sp >= mx * my){
   return;
  }
  x = xstack[sp];
  y = ystack[sp];
  if((y == 0 || maze[y - 1][x]) &&
     (y == my - 1 || maze[y + 1][x]) &&
     (x == 0 || maze[y][x - 1]) &&
     (x == mx - 1 || maze[y][x + 1])){
   sp--;
   continue;
  }
  dir = randdir(((y > 0 && !maze[y - 1][x]) << 3) |
                ((y < my - 1 && !maze[y + 1][x]) << 1) |
                ((x > 0 && !maze[y][x - 1]) << 2) |
                ((x < mx - 1 && !maze[y][x + 1]) << 0));
  sp++;
  maze[y][x] |= dir;
  switch(dir){
   case 1:
    maze[y ][x + 1] |= 4;
    xstack[sp] = x + 1;
    ystack[sp] = y;
    break;
   case 2:
    maze[y + 1][x ] |= 8;
    xstack[sp] = x;
    ystack[sp] = y + 1;
    break;
   case 4:
    maze[y ][x - 1] |= 1;
    xstack[sp] = x - 1;
    ystack[sp] = y;
    break;
   case 8:
    maze[y - 1][x ] |= 2;
    xstack[sp] = x;
    ystack[sp] = y - 1;
    break;
   default:
    fprintf(stderr, "INVALID DIRECTION.\n");
    break;
  }
 }
 if(odds){
  random_connections();
 }
}

canonical_original_code:
void depth_first(){
 int *xstack = malloc(mx * my * sizeof(int));
 int *ystack = malloc(mx * my * sizeof(int));
 xstack[0] = 0;
 ystack[0] = 0;
 int sp = 0;
 int x; int y;
 int dir;
 while(sp >= 0){
  if(sp >= mx * my){
   return;
  }
  x = xstack[sp];
  y = ystack[sp];
  if((y == 0 || maze[y - 1][x]) &&
     (y == my - 1 || maze[y + 1][x]) &&
     (x == 0 || maze[y][x - 1]) &&
     (x == mx - 1 || maze[y][x + 1])){
   sp--;
   continue;
  }
  dir = randdir(((y > 0 && !maze[y - 1][x]) << 3) |
                ((y < my - 1 && !maze[y + 1][x]) << 1) |
                ((x > 0 && !maze[y][x - 1]) << 2) |
                ((x < mx - 1 && !maze[y][x + 1]) << 0));
  sp++;
  maze[y][x] |= dir;
  switch(dir){
   case 1:
    maze[y ][x + 1] |= 4;
    xstack[sp] = x + 1;
    ystack[sp] = y;
    break;
   case 2:
    maze[y + 1][x ] |= 8;
    xstack[sp] = x;
    ystack[sp] = y + 1;
    break;
   case 4:
    maze[y ][x - 1] |= 1;
    xstack[sp] = x - 1;
    ystack[sp] = y;
    break;
   case 8:
    maze[y - 1][x ] |= 2;
    xstack[sp] = x;
    ystack[sp] = y - 1;
    break;
   default:
    fprintf(stderr, "INVALID DIRECTION.\n");
    break;
  }
 }
 if(odds){
  random_connections();
 }
}

variable_types:
xstack
int *

variable_types:
ystack
int *

variable_types: sp int

variable_types: x int

variable_types: y int


decompiled_code:
char *alloc_maze()
{
int v0; // er12
char **v1; // rax
int v2; // ebp
char **v3; // rbx
char *result; // rax
char *v5; // rdx
__int64 v6; // rsi
char *v7; // rdx

v0 = my;
v1 = (char **)malloc(8LL * my);
v2 = mx;
v3 = v1;
maze = (__int64)v1;
result = (char *)malloc(mx * v0);
*v3 = result;
if ( v0 > 0 )
{
v5 = result;
v6 = 0LL;
while ( 1 )
{
result = (char *)((int)v6 * v2);
v7 = &v5[(_QWORD)result];
v3[v6] = v7;
if ( v2 > 0 )
{
result = 0LL;
while ( 1 )
{
(result++)[(_QWORD)v7] = 0;
if ( mx <= (int)result )
break;
v7 = *(char **)(maze + 8 * v6);
}
}
if ( my <= (int)++v6 )
break;
v3 = (char **)maze;
v2 = mx;
v5 = *(char **)maze;
}
}
return result;
}

canonical_decompiled_code:
char *func8()
{
int v0; // er12
char **v1; // rax
int v2; // ebp
char **v3; // rbx
char *result; // rax
char *v5; // rdx
__int64 v6; // rsi
char *v7; // rdx

v0 = my;
v1 = (char **)malloc(8LL * my);
v2 = mx;
v3 = v1;
maze = (__int64)v1;
result = (char *)malloc(mx * v0);
*v3 = result;
if ( v0 > 0 )
{
v5 = result;
v6 = 0LL;
while ( 1 )
{
result = (char *)((int)v6 * v2);
v7 = &v5[(_QWORD)result];
v3[v6] = v7;
if ( v2 > 0 )
{
result = 0LL;
while ( 1 )
{
(result++)[(_QWORD)v7] = 0;
if ( mx <= (int)result )
break;
v7 = *(char **)(maze + 8 * v6);
}
}
if ( my <= (int)++v6 )
break;
v3 = (char **)maze;
v2 = mx;
v5 = *(char **)maze;
}
}
return result;
}

original_code:
void alloc_maze(void){
 int i, j;
 maze = malloc(my * sizeof(char *));
 maze[0] = malloc(my * mx * sizeof(char ));
 for(i = 0; i < my; i++){
  maze[i] = maze[0] + i * mx;
  for(j = 0; j < mx; j++){
   maze[i][j] = 0;
  }
 }
}

canonical_original_code:
void alloc_maze(){
 int i; int j;
 maze = malloc(my * sizeof(char *));
 maze[0] = malloc(my * mx * sizeof(char ));
 for(i = 0; i < my; i++){
  maze[i] = maze[0] + i * mx;
  for(j = 0; j < mx; j++){
   maze[i][j] = 0;
  }
 }
}

variable_types: i int

variable_types: j int


decompiled_code:
size_t print_maze()
{
int v0; // er12
__int64 v1; // rbp
__int64 v2; // rbx
__int64 v3; // rbx
__int64 v4; // rdx
__int64 v5; // rbp

v0 = 0;
v1 = 0LL;
fprintf(stream, "%d %d\n", (unsigned int)my, (unsigned int)mx);
if ( my > 1 )
{
do
{
v2 = 0LL;
if ( mx > 1 )
{
do
{
if ( (*(_BYTE *)(*(_QWORD *)(maze + v1) + v2) & 1) != 0 )
fwrite("O . ", 1uLL, 4uLL, stream);
else
fwrite("O | ", 1uLL, 4uLL, stream);
++v2;
}
while ( mx - 1 > (int)v2 );
}
fwrite("O\n", 1uLL, 2uLL, stream);
if ( mx <= 1 )
{
v4 = 0LL;
}
else
{
v3 = 0LL;
do
{
if ( (*(_BYTE *)(*(_QWORD *)(maze + v1) + v3) & 2) != 0 )
fwrite(". ", 1uLL, 4uLL, stream);
else
fwrite("- ", 1uLL, 4uLL, stream);
LODWORD(v4) = ++v3;
}
while ( mx - 1 > (int)v3 );
v4 = (int)v4;
}
if ( (*(_BYTE *)(*(_QWORD *)(maze + v1) + v4) & 2) != 0 )
fwrite(".\n", 1uLL, 2uLL, stream);
else
fwrite("-\n", 1uLL, 2uLL, stream);
++v0;
v1 += 8LL;
}
while ( my - 1 > v0 );
}
v5 = 0LL;
if ( mx > 1 )
{
do
{
if ( (*(_BYTE *)(*(_QWORD *)(maze + 8LL * v0) + v5) & 1) != 0 )
fwrite("O . ", 1uLL, 4uLL, stream);
else
fwrite("O | ", 1uLL, 4uLL, stream);
++v5;
}
while ( mx - 1 > (int)v5 );
}
return fwrite("O\n", 1uLL, 2uLL, stream);
}

canonical_decompiled_code:
size_t func9()
{
int v0; // er12
__int64 v1; // rbp
__int64 v2; // rbx
__int64 v3; // rbx
__int64 v4; // rdx
__int64 v5; // rbp

v0 = 0;
v1 = 0LL;
fprintf(stream, "%d %d\n", (unsigned int)my, (unsigned int)mx);
if ( my > 1 )
{
do
{
v2 = 0LL;
if ( mx > 1 )
{
do
{
if ( (*(_BYTE *)(*(_QWORD *)(maze + v1) + v2) & 1) != 0 )
fwrite("O . ", 1uLL, 4uLL, stream);
else
fwrite("O | ", 1uLL, 4uLL, stream);
++v2;
}
while ( mx - 1 > (int)v2 );
}
fwrite("O\n", 1uLL, 2uLL, stream);
if ( mx <= 1 )
{
v4 = 0LL;
}
else
{
v3 = 0LL;
do
{
if ( (*(_BYTE *)(*(_QWORD *)(maze + v1) + v3) & 2) != 0 )
fwrite(". ", 1uLL, 4uLL, stream);
else
fwrite("- ", 1uLL, 4uLL, stream);
LODWORD(v4) = ++v3;
}
while ( mx - 1 > (int)v3 );
v4 = (int)v4;
}
if ( (*(_BYTE *)(*(_QWORD *)(maze + v1) + v4) & 2) != 0 )
fwrite(".\n", 1uLL, 2uLL, stream);
else
fwrite("-\n", 1uLL, 2uLL, stream);
++v0;
v1 += 8LL;
}
while ( my - 1 > v0 );
}
v5 = 0LL;
if ( mx > 1 )
{
do
{
if ( (*(_BYTE *)(*(_QWORD *)(maze + 8LL * v0) + v5) & 1) != 0 )
fwrite("O . ", 1uLL, 4uLL, stream);
else
fwrite("O | ", 1uLL, 4uLL, stream);
++v5;
}
while ( mx - 1 > (int)v5 );
}
return fwrite("O\n", 1uLL, 2uLL, stream);
}

original_code:
void print_maze(void){
 int i, j;
 fprintf(of, "%d %d\n", my, mx);
 for(i = 0; i < my - 1; i++){
  for(j = 0; j < mx - 1; j++){
   if(maze[i][j] & 1){
    fprintf(of, "O . ");
   } else {
    fprintf(of, "O | ");
   }
  }
  fprintf(of, "O\n");
  for(j = 0; j < mx - 1; j++){
   if(maze[i][j] & 2){
    fprintf(of, ".   ");
   } else {
    fprintf(of, "-   ");
   }
  }
  if(maze[i][j] & 2){
   fprintf(of, ".\n");
  } else {
   fprintf(of, "-\n");
  }
 }
 for(j = 0; j < mx - 1; j++){
  if(maze[i][j] & 1){
   fprintf(of, "O . ");
  } else {
   fprintf(of, "O | ");
  }
 }
 fprintf(of, "O\n");
}

canonical_original_code:
void print_maze(){
 int i; int j;
 fprintf(of, "%d %d\n", my, mx);
 for(i = 0; i < my - 1; i++){
  for(j = 0; j < mx - 1; j++){
   if(maze[i][j] & 1){
    fprintf(of, "O . ");
   } else {
    fprintf(of, "O | ");
   }
  }
  fprintf(of, "O\n");
  for(j = 0; j < mx - 1; j++){
   if(maze[i][j] & 2){
    fprintf(of, ".   ");
   } else {
    fprintf(of, "-   ");
   }
  }
  if(maze[i][j] & 2){
   fprintf(of, ".\n");
  } else {
   fprintf(of, "-\n");
  }
 }
 for(j = 0; j < mx - 1; j++){
  if(maze[i][j] & 1){
   fprintf(of, "O . ");
  } else {
   fprintf(of, "O | ");
  }
 }
 fprintf(of, "O\n");
}


forward

repo: fleitner/Ethernet-Tunnel

decompiled_code:
__int64 __fastcall forward(int fd, int a2, void *buf, size_t nbytes)
{
int v6; // eax

while ( 1 )
{
v6 = read(fd, buf, nbytes);
if ( v6 <= 0 )
break;
write(a2, buf, v6);
}
return (unsigned int)nbytes;
}

canonical_decompiled_code:
__int64 __fastcall func0(int fd, int a2, void *buf, size_t nbytes)
{
int v6; // eax

while ( 1 )
{
v6 = read(fd, buf, nbytes);
if ( v6 <= 0 )
break;
write(a2, buf, v6);
}
return (unsigned int)nbytes;
}

original_code:
static int forward(int orig, int dest, char *buffer, size_t len)
{
 ssize_t bytes;
 while ((bytes = read(orig, buffer, len)) > 0)
  write(dest, buffer, bytes);
 return len;
}

canonical_original_code:
static int forward(int orig, int dest, char *buffer, unsigned long len)
{
 long bytes;
 while ((bytes = read(orig, buffer, len)) > 0)
  write(dest, buffer, bytes);
 return len;
}

variable_types: orig int

variable_types: dest int

variable_types:
buffer
char *

variable_types:
len
unsigned long

variable_types: bytes long


decompiled_code:
__int64 __fastcall sysrw_init(_QWORD *a1)
{
_QWORD *v1; // rax
_QWORD *v2; // rbp
void *v3; // rax
void *v4; // r12
void *v5; // rax
__int64 result; // rax

v1 = malloc(0x18uLL);
if ( !v1 )
return 4294967284LL;
v2 = v1;
v3 = malloc(0x2328uLL);
*v2 = v3;
v4 = v3;
if ( v3 )
{
v5 = malloc(0x2328uLL);
v2[1] = v5;
if ( v5 )
{
v2[2] = 9000LL;
result = 0LL;
*a1 = v2;
return result;
}
free(v4);
}
free(v2);
return 4294967284LL;
}

canonical_decompiled_code:
__int64 __fastcall func1(_QWORD *a1)
{
_QWORD *v1; // rax
_QWORD *v2; // rbp
void *v3; // rax
void *v4; // r12
void *v5; // rax
__int64 result; // rax

v1 = malloc(0x18uLL);
if ( !v1 )
return 4294967284LL;
v2 = v1;
v3 = malloc(0x2328uLL);
*v2 = v3;
v4 = v3;
if ( v3 )
{
v5 = malloc(0x2328uLL);
v2[1] = v5;
if ( v5 )
{
v2[2] = 9000LL;
result = 0LL;
*a1 = v2;
return result;
}
free(v4);
}
free(v2);
return 4294967284LL;
}

original_code:
int sysrw_init(void *data)
{
 unsigned long *ptr = data;
 struct sysrw_data *s;
 s = malloc(sizeof(struct sysrw_data));
 if (!s)
  return -12;
 s->in_buffer = malloc(9000);
 if (!s->in_buffer) {
  free(s);
  return -12;
 }
 s->out_buffer = malloc(9000);
 if (!s->out_buffer) {
  free(s->in_buffer);
  free(s);
  return -12;
 }
 s->length = 9000;
 *ptr = (unsigned long)s;
 return 0;
}

variable_types:
data
void *

variable_types:
ptr
unsigned long *

variable_types: struct sysrw_data { char *in_buffer; char *out_buffer; unsigned long length; } *


decompiled_code:
__int64 __fastcall sysrw_destroy(void *ptr)
{
void *v2; // rdi
void *v3; // rdi

v2 = *(void **)ptr;
if ( v2 )
free(v2);
v3 = (void *)*((_QWORD *)ptr + 1);
if ( v3 )
free(v3);
free(ptr);
return 0LL;
}

canonical_decompiled_code:
__int64 __fastcall func2(void *ptr)
{
void *v2; // rdi
void *v3; // rdi

v2 = *(void **)ptr;
if ( v2 )
free(v2);
v3 = (void *)*((_QWORD *)ptr + 1);
if ( v3 )
free(v3);
free(ptr);
return 0LL;
}

original_code:
int sysrw_destroy(void *data)
{
 struct sysrw_data *s = (struct sysrw_data *)data;
 if (s->in_buffer)
  free(s->in_buffer);
 if (s->out_buffer)
  free(s->out_buffer);
 free(s);
 return 0;
}

user_defined_types: struct sysrw_data { char *in_buffer; char *out_buffer; unsigned long length; }


decompiled_code:
__int64 __fastcall sysrw_forward(__int64 a1, __int64 a2)
{
size_t v2; // rcx
__int64 result; // rax
int v4; // er9
int v5; // er8

v2 = *(_QWORD *)(a2 + 8);
result = -12LL;
if ( v2 <= *(_QWORD *)(a1 + 16) )
{
v4 = *(_DWORD *)a2;
v5 = *(_DWORD *)(a2 + 4);
if ( *(_DWORD *)(a2 + 16) )
result = (int)forward(v5, v4, *(void **)a1, v2);
else
result = (int)forward(v4, v5, *(void **)(a1 + 8), v2);
}
return result;
}

canonical_decompiled_code:
__int64 __fastcall func3(__int64 a1, __int64 a2)
{
size_t v2; // rcx
__int64 result; // rax
int v4; // er9
int v5; // er8

v2 = *(_QWORD *)(a2 + 8);
result = -12LL;
if ( v2 <= *(_QWORD *)(a1 + 16) )
{
v4 = *(_DWORD *)a2;
v5 = *(_DWORD *)(a2 + 4);
if ( *(_DWORD *)(a2 + 16) )
result = (int)func0(v5, v4, *(void **)a1, v2);
else
result = (int)func0(v4, v5, *(void **)(a1 + 8), v2);
}
return result;
}

original_code:
ssize_t sysrw_forward(void *data, struct forward_cmd *cmd)
{
 struct sysrw_data *s = (struct sysrw_data *)data;
 size_t len;
 len = -12;
 if (cmd->length > s->length)
  goto out;
 if (cmd->dir == fd1TOfd2)
  len = forward(cmd->fd1, cmd->fd2, s->out_buffer, cmd->length);
 else
  len = forward(cmd->fd2, cmd->fd1, s->in_buffer, cmd->length);
out:
 return len;
}

canonical_original_code:
long sysrw_forward(void *data, struct forward_cmd *cmd)
{
 struct sysrw_data *s = (struct sysrw_data *)data;
 unsigned long len;
 len = -12;
 if (cmd->length > s->length)
  goto out;
 if (cmd->dir == fd1TOfd2)
  len = forward(cmd->fd1, cmd->fd2, s->out_buffer, cmd->length);
 else
  len = forward(cmd->fd2, cmd->fd1, s->in_buffer, cmd->length);
out:
 return len;
}

variable_types: struct forward_cmd { int fd1; int fd2; long length; enum direction { fd1TOfd2=0, fd2TOfd1=1 } dir; } *

return_type: long

user_defined_types: struct forward_cmd { int fd1; int fd2; long length; enum direction dir; }


usage

repo: flon-io/rodzo

decompiled_code:
__int64 __fastcall usage(const char *a1)
{
fputc(10, _bss_start);
fprintf(_bss_start, "Usage: %s {func_name} {source_path}\n", a1);
fwrite("Turns the source into a function (writing the source)\n", 1uLL, 0x36uLL, _bss_start);
fputc(10, _bss_start);
return 1LL;
}

canonical_decompiled_code:
__int64 __fastcall func7(const char *a1)
{
fputc(10, _bss_start);
fprintf(_bss_start, "Usage: %s {func_name} {source_path}\n", a1);
fwrite("Turns the source into a function (writing the source)\n", 1uLL, 0x36uLL, _bss_start);
fputc(10, _bss_start);
return 1LL;
}

original_code:
int usage(char *pname)
{
  fprintf(stderr, "\n");
  fprintf(stderr, "Usage: %s {func_name} {source_path}\n", pname);
  fprintf(stderr, "Turns the source into a function (writing the source)\n");
  fprintf(stderr, "\n");
  return 1;
}

variable_types:
pname
char *


decompiled_code:
char *__fastcall mne_tos(__int64 a1)
{
__int64 v1; // rbp
char *v2; // r12

v1 = a1;
v2 = (char *)calloc(0x93uLL, 1uLL);
if ( a1 < 0 )
{
v1 = -a1;
strncat(v2, (const char *)neg, 2uLL);
}
tos_localalias(v2, v1);
return v2;
}

canonical_decompiled_code:
char *__fastcall func7(__int64 a1)
{
__int64 v1; // rbp
char *v2; // r12

v1 = a1;
v2 = (char *)calloc(0x93uLL, 1uLL);
if ( a1 < 0 )
{
v1 = -a1;
strncat(v2, (const char *)neg, 2uLL);
}
func6(v2, v1);
return v2;
}

original_code:
char *mne_tos(long l)
{
  char *r = calloc(147, sizeof(char));
  if (l < 0)
  {
    strncat(r, neg, 2);
    l = l * -1;
  }
  tos(r, l);
  return r;
}

variable_types: l long

variable_types:
r
char *


decompiled_code:
__int64 __fastcall mne_tol(__int64 a1)
{
return tol_localalias(1LL, a1, 0LL);
}

canonical_decompiled_code:
__int64 __fastcall func9(__int64 a1)
{
return func8(1LL, a1, 0LL);
}

canonical_original_code:
struct mne_tol_result mne_tol(char *s)
{
  return tol(1, s, 0);
}

variable_types:
s
char *

return_type: struct mne_tol_result { int err; long result; }


decompiled_code:
_BOOL8 __fastcall mne_ismnemo(__int64 a1)
{
int v1; // eax
_BOOL4 v2; // er8

v1 = tol_localalias(1LL, a1, 0LL);
v2 = v1;
if ( v1 != -1 )
v2 = v1 == 0;
return v2;
}

canonical_decompiled_code:
_BOOL8 __fastcall func10(__int64 a1)
{
int v1; // eax
_BOOL4 v2; // er8

v1 = func8(1LL, a1, 0LL);
v2 = v1;
if ( v1 != -1 )
v2 = v1 == 0;
return v2;
}

original_code:
int mne_ismnemo(char *s)
{
  mne_tol_result mtr = tol(1, s, 0);
  if (mtr.err == -1) return mtr.err;
  return (mtr.err == 0);
}

canonical_original_code:
int mne_ismnemo(char *s)
{
  struct mne_tol_result mtr = tol(1, s, 0);
  if (mtr.err == -1) return mtr.err;
  return (mtr.err == 0);
}

variable_types: struct mne_tol_result { int err; long result; }


repo: floodlight/loxigen-artifacts

decompiled_code:
// attributes: thunk
__int64 of_flow_stats_reply_delete()
{
return of_object_delete();
}

canonical_decompiled_code:
__int64 func0()
{
return of_object_delete();
}

original_code:
static inline void
of_flow_stats_reply_delete(of_object_t *obj) {
    of_object_delete(obj);
}

canonical_original_code:
static inline void of_flow_stats_reply_delete(struct of_object_s *obj) {
    of_object_delete(obj);
}

variable_types: struct of_object_s { struct of_wire_buffer_s { unsigned char *buf; int alloc_bytes; int current_bytes; void (*free)(void *buf); } *wbuf; int obj_offset; enum of_object_id_e { OF_OBJECT_INVALID=-1, OF_OBJECT=0, OF_AGGREGATE_STATS_REPLY=1, OF_AGGREGATE_STATS_REQUEST=2, OF_ASYNC_CONFIG_FAILED_ERROR_MSG=3, OF_ASYNC_GET_REPLY=4, OF_ASYNC_GET_REQUEST=5, OF_ASYNC_SET=6, OF_BAD_ACTION_ERROR_MSG=7, OF_BAD_INSTRUCTION_ERROR_MSG=8, OF_BAD_MATCH_ERROR_MSG=9, OF_BAD_PROPERTY_ERROR_MSG=10, OF_BAD_REQUEST_ERROR_MSG=11, OF_BARRIER_REPLY=12, OF_BARRIER_REQUEST=13, OF_BSN_ARP_IDLE=14, OF_BSN_BASE_ERROR=15, OF_BSN_BW_CLEAR_DATA_REPLY=16, OF_BSN_BW_CLEAR_DATA_REQUEST=17, OF_BSN_BW_ENABLE_GET_REPLY=18, OF_BSN_BW_ENABLE_GET_REQUEST=19, OF_BSN_BW_ENABLE_SET_REPLY=20, OF_BSN_BW_ENABLE_SET_REQUEST=21, OF_BSN_CONTROLLER_CONNECTIONS_REPLY=22, OF_BSN_CONTROLLER_CONNECTIONS_REQUEST=23, OF_BSN_DEBUG_COUNTER_DESC_STATS_REPLY=24, OF_BSN_DEBUG_COUNTER_DESC_STATS_REQUEST=25, OF_BSN_DEBUG_COUNTER_STATS_REPLY=26, OF_BSN_DEBUG_COUNTER_STATS_REQUEST=27, OF_BSN_ERROR=28, OF_BSN_FLOW_CHECKSUM_BUCKET_STATS_REPLY=29, OF_BSN_FLOW_CHECKSUM_BUCKET_STATS_REQUEST=30, OF_BSN_FLOW_IDLE=31, OF_BSN_FLOW_IDLE_ENABLE_GET_REPLY=32, OF_BSN_FLOW_IDLE_ENABLE_GET_REQUEST=33, OF_BSN_FLOW_IDLE_ENABLE_SET_REPLY=34, OF_BSN_FLOW_IDLE_ENABLE_SET_REQUEST=35, OF_BSN_GENERIC_ASYNC=36, OF_BSN_GENERIC_COMMAND=37, OF_BSN_GENERIC_COMMAND_REPLY=38, OF_BSN_GENERIC_STATS_REPLY=39, OF_BSN_GENERIC_STATS_REQUEST=40, OF_BSN_GENTABLE_BUCKET_STATS_REPLY=41, OF_BSN_GENTABLE_BUCKET_STATS_REQUEST=42, OF_BSN_GENTABLE_CLEAR_REPLY=43, OF_BSN_GENTABLE_CLEAR_REQUEST=44, OF_BSN_GENTABLE_DESC_STATS_REPLY=45, OF_BSN_GENTABLE_DESC_STATS_REQUEST=46, OF_BSN_GENTABLE_ENTRY_ADD=47, OF_BSN_GENTABLE_ENTRY_DELETE=48, OF_BSN_GENTABLE_ENTRY_DESC_STATS_REPLY=49, OF_BSN_GENTABLE_ENTRY_DESC_STATS_REQUEST=50, OF_BSN_GENTABLE_ENTRY_STATS_REPLY=51, OF_BSN_GENTABLE_ENTRY_STATS_REQUEST=52, OF_BSN_GENTABLE_ERROR=53, OF_BSN_GENTABLE_SET_BUCKETS_SIZE=54, OF_BSN_GENTABLE_STATS_REPLY=55, OF_BSN_GENTABLE_STATS_REQUEST=56, OF_BSN_GET_INTERFACES_REPLY=57, OF_BSN_GET_INTERFACES_REQUEST=58, OF_BSN_GET_IP_MASK_REPLY=59, OF_BSN_GET_IP_MASK_REQUEST=60, OF_BSN_GET_L2_TABLE_REPLY=61, OF_BSN_GET_L2_TABLE_REQUEST=62, OF_BSN_GET_MIRRORING_REPLY=63, OF_BSN_GET_MIRRORING_REQUEST=64, OF_BSN_GET_SWITCH_PIPELINE_REPLY=65, OF_BSN_GET_SWITCH_PIPELINE_REQUEST=66, OF_BSN_HEADER=67, OF_BSN_HYBRID_GET_REPLY=68, OF_BSN_HYBRID_GET_REQUEST=69, OF_BSN_IMAGE_DESC_STATS_REPLY=70, OF_BSN_IMAGE_DESC_STATS_REQUEST=71, OF_BSN_LACP_CONVERGENCE_NOTIF=72, OF_BSN_LACP_STATS_REPLY=73, OF_BSN_LACP_STATS_REQUEST=74, OF_BSN_LOG=75, OF_BSN_LUA_COMMAND_REPLY=76, OF_BSN_LUA_COMMAND_REQUEST=77, OF_BSN_LUA_NOTIFICATION=78, OF_BSN_LUA_UPLOAD=79, OF_BSN_PDU_RX_REPLY=80, OF_BSN_PDU_RX_REQUEST=81, OF_BSN_PDU_RX_TIMEOUT=82, OF_BSN_PDU_TX_REPLY=83, OF_BSN_PDU_TX_REQUEST=84, OF_BSN_PORT_COUNTER_STATS_REPLY=85, OF_BSN_PORT_COUNTER_STATS_REQUEST=86, OF_BSN_ROLE_STATUS=87, OF_BSN_SET_AUX_CXNS_REPLY=88, OF_BSN_SET_AUX_CXNS_REQUEST=89, OF_BSN_SET_IP_MASK=90, OF_BSN_SET_L2_TABLE_REPLY=91, OF_BSN_SET_L2_TABLE_REQUEST=92, OF_BSN_SET_LACP_REPLY=93, OF_BSN_SET_LACP_REQUEST=94, OF_BSN_SET_MIRRORING=95, OF_BSN_SET_PKTIN_SUPPRESSION_REPLY=96, OF_BSN_SET_PKTIN_SUPPRESSION_REQUEST=97, OF_BSN_SET_SWITCH_PIPELINE_REPLY=98, OF_BSN_SET_SWITCH_PIPELINE_REQUEST=99, OF_BSN_SHELL_COMMAND=100, OF_BSN_SHELL_OUTPUT=101, OF_BSN_SHELL_STATUS=102, OF_BSN_STATS_REPLY=103, OF_BSN_STATS_REQUEST=104, OF_BSN_SWITCH_PIPELINE_STATS_REPLY=105, OF_BSN_SWITCH_PIPELINE_STATS_REQUEST=106, OF_BSN_TABLE_CHECKSUM_STATS_REPLY=107, OF_BSN_TABLE_CHECKSUM_STATS_REQUEST=108, OF_BSN_TABLE_SET_BUCKETS_SIZE=109, OF_BSN_TAKEOVER=110, OF_BSN_TIME_REPLY=111, OF_BSN_TIME_REQUEST=112, OF_BSN_VIRTUAL_PORT_CREATE_REPLY=113, OF_BSN_VIRTUAL_PORT_CREATE_REQUEST=114, OF_BSN_VIRTUAL_PORT_REMOVE_REPLY=115, OF_BSN_VIRTUAL_PORT_REMOVE_REQUEST=116, OF_BSN_VLAN_COUNTER_CLEAR=117, OF_BSN_VLAN_COUNTER_STATS_REPLY=118, OF_BSN_VLAN_COUNTER_STATS_REQUEST=119, OF_BSN_VRF_COUNTER_STATS_REPLY=120, OF_BSN_VRF_COUNTER_STATS_REQUEST=121, OF_BUNDLE_ADD_MSG=122, OF_BUNDLE_CTRL_MSG=123, OF_BUNDLE_FAILED_ERROR_MSG=124, OF_DESC_STATS_REPLY=125, OF_DESC_STATS_REQUEST=126, OF_ECHO_REPLY=127, OF_ECHO_REQUEST=128, OF_ERROR_MSG=129, OF_EXPERIMENTER=130, OF_EXPERIMENTER_ERROR_MSG=131, OF_EXPERIMENTER_STATS_REPLY=132, OF_EXPERIMENTER_STATS_REQUEST=133, OF_FEATURES_REPLY=134, OF_FEATURES_REQUEST=135, OF_FLOW_ADD=136, OF_FLOW_DELETE=137, OF_FLOW_DELETE_STRICT=138, OF_FLOW_MOD=139, OF_FLOW_MOD_FAILED_ERROR_MSG=140, OF_FLOW_MODIFY=141, OF_FLOW_MODIFY_STRICT=142, OF_FLOW_MONITOR_FAILED_ERROR_MSG=143, OF_FLOW_REMOVED=144, OF_FLOW_STATS_REPLY=145, OF_FLOW_STATS_REQUEST=146, OF_GET_CONFIG_REPLY=147, OF_GET_CONFIG_REQUEST=148, OF_GROUP_ADD=149, OF_GROUP_DELETE=150, OF_GROUP_DESC_STATS_REPLY=151, OF_GROUP_DESC_STATS_REQUEST=152, OF_GROUP_FEATURES_STATS_REPLY=153, OF_GROUP_FEATURES_STATS_REQUEST=154, OF_GROUP_MOD=155, OF_GROUP_MOD_FAILED_ERROR_MSG=156, OF_GROUP_MODIFY=157, OF_GROUP_STATS_REPLY=158, OF_GROUP_STATS_REQUEST=159, OF_HEADER=160, OF_HELLO=161, OF_HELLO_FAILED_ERROR_MSG=162, OF_METER_CONFIG_STATS_REPLY=163, OF_METER_CONFIG_STATS_REQUEST=164, OF_METER_FEATURES_STATS_REPLY=165, OF_METER_FEATURES_STATS_REQUEST=166, OF_METER_MOD=167, OF_METER_MOD_FAILED_ERROR_MSG=168, OF_METER_STATS_REPLY=169, OF_METER_STATS_REQUEST=170, OF_NICIRA_CONTROLLER_ROLE_REPLY=171, OF_NICIRA_CONTROLLER_ROLE_REQUEST=172, OF_NICIRA_HEADER=173, OF_PACKET_IN=174, OF_PACKET_OUT=175, OF_PORT_DESC_STATS_REPLY=176, OF_PORT_DESC_STATS_REQUEST=177, OF_PORT_MOD=178, OF_PORT_MOD_FAILED_ERROR_MSG=179, OF_PORT_STATS_REPLY=180, OF_PORT_STATS_REQUEST=181, OF_PORT_STATUS=182, OF_QUEUE_DESC_STATS_REPLY=183, OF_QUEUE_DESC_STATS_REQUEST=184, OF_QUEUE_GET_CONFIG_REPLY=185, OF_QUEUE_GET_CONFIG_REQUEST=186, OF_QUEUE_OP_FAILED_ERROR_MSG=187, OF_QUEUE_STATS_REPLY=188, OF_QUEUE_STATS_REQUEST=189, OF_REQUESTFORWARD=190, OF_ROLE_REPLY=191, OF_ROLE_REQUEST=192, OF_ROLE_REQUEST_FAILED_ERROR_MSG=193, OF_ROLE_STATUS=194, OF_SET_CONFIG=195, OF_STATS_REPLY=196, OF_STATS_REQUEST=197, OF_SWITCH_CONFIG_FAILED_ERROR_MSG=198, OF_TABLE_DESC_STATS_REPLY=199, OF_TABLE_DESC_STATS_REQUEST=200, OF_TABLE_FEATURES_FAILED_ERROR_MSG=201, OF_TABLE_FEATURES_STATS_REPLY=202, OF_TABLE_FEATURES_STATS_REQUEST=203, OF_TABLE_MOD=204, OF_TABLE_MOD_FAILED_ERROR_MSG=205, OF_TABLE_STATS_REPLY=206, OF_TABLE_STATS_REQUEST=207, OF_TABLE_STATUS=208, OF_ACTION=209, OF_ACTION_BSN=210, OF_ACTION_BSN_CHECKSUM=211, OF_ACTION_BSN_GENTABLE=212, OF_ACTION_BSN_MIRROR=213, OF_ACTION_BSN_SET_TUNNEL_DST=214, OF_ACTION_COPY_TTL_IN=215, OF_ACTION_COPY_TTL_OUT=216, OF_ACTION_DEC_MPLS_TTL=217, OF_ACTION_DEC_NW_TTL=218, OF_ACTION_ENQUEUE=219, OF_ACTION_EXPERIMENTER=220, OF_ACTION_GROUP=221, OF_ACTION_ID=222, OF_ACTION_ID_BSN=223, OF_ACTION_ID_BSN_CHECKSUM=224, OF_ACTION_ID_BSN_GENTABLE=225, OF_ACTION_ID_BSN_MIRROR=226, OF_ACTION_ID_BSN_SET_TUNNEL_DST=227, OF_ACTION_ID_COPY_TTL_IN=228, OF_ACTION_ID_COPY_TTL_OUT=229, OF_ACTION_ID_DEC_MPLS_TTL=230, OF_ACTION_ID_DEC_NW_TTL=231, OF_ACTION_ID_EXPERIMENTER=232, OF_ACTION_ID_GROUP=233, OF_ACTION_ID_NICIRA=234, OF_ACTION_ID_NICIRA_DEC_TTL=235, OF_ACTION_ID_OUTPUT=236, OF_ACTION_ID_POP_MPLS=237, OF_ACTION_ID_POP_PBB=238, OF_ACTION_ID_POP_VLAN=239, OF_ACTION_ID_PUSH_MPLS=240, OF_ACTION_ID_PUSH_PBB=241, OF_ACTION_ID_PUSH_VLAN=242, OF_ACTION_ID_SET_FIELD=243, OF_ACTION_ID_SET_MPLS_TTL=244, OF_ACTION_ID_SET_NW_TTL=245, OF_ACTION_ID_SET_QUEUE=246, OF_ACTION_NICIRA=247, OF_ACTION_NICIRA_DEC_TTL=248, OF_ACTION_OUTPUT=249, OF_ACTION_POP_MPLS=250, OF_ACTION_POP_PBB=251, OF_ACTION_POP_VLAN=252, OF_ACTION_PUSH_MPLS=253, OF_ACTION_PUSH_PBB=254, OF_ACTION_PUSH_VLAN=255, OF_ACTION_SET_DL_DST=256, OF_ACTION_SET_DL_SRC=257, OF_ACTION_SET_FIELD=258, OF_ACTION_SET_MPLS_LABEL=259, OF_ACTION_SET_MPLS_TC=260, OF_ACTION_SET_MPLS_TTL=261, OF_ACTION_SET_NW_DST=262, OF_ACTION_SET_NW_ECN=263, OF_ACTION_SET_NW_SRC=264, OF_ACTION_SET_NW_TOS=265, OF_ACTION_SET_NW_TTL=266, OF_ACTION_SET_QUEUE=267, OF_ACTION_SET_TP_DST=268, OF_ACTION_SET_TP_SRC=269, OF_ACTION_SET_VLAN_PCP=270, OF_ACTION_SET_VLAN_VID=271, OF_ACTION_STRIP_VLAN=272, OF_ASYNC_CONFIG_PROP=273, OF_ASYNC_CONFIG_PROP_EXPERIMENTER_MASTER=274, OF_ASYNC_CONFIG_PROP_EXPERIMENTER_SLAVE=275, OF_ASYNC_CONFIG_PROP_FLOW_REMOVED_MASTER=276, OF_ASYNC_CONFIG_PROP_FLOW_REMOVED_SLAVE=277, OF_ASYNC_CONFIG_PROP_PACKET_IN_MASTER=278, OF_ASYNC_CONFIG_PROP_PACKET_IN_SLAVE=279, OF_ASYNC_CONFIG_PROP_PORT_STATUS_MASTER=280, OF_ASYNC_CONFIG_PROP_PORT_STATUS_SLAVE=281, OF_ASYNC_CONFIG_PROP_REQUESTFORWARD_MASTER=282, OF_ASYNC_CONFIG_PROP_REQUESTFORWARD_SLAVE=283, OF_ASYNC_CONFIG_PROP_ROLE_STATUS_MASTER=284, OF_ASYNC_CONFIG_PROP_ROLE_STATUS_SLAVE=285, OF_ASYNC_CONFIG_PROP_TABLE_STATUS_MASTER=286, OF_ASYNC_CONFIG_PROP_TABLE_STATUS_SLAVE=287, OF_BSN_CONTROLLER_CONNECTION=288, OF_BSN_DEBUG_COUNTER_DESC_STATS_ENTRY=289, OF_BSN_DEBUG_COUNTER_STATS_ENTRY=290, OF_BSN_FLOW_CHECKSUM_BUCKET_STATS_ENTRY=291, OF_BSN_GENERIC_STATS_ENTRY=292, OF_BSN_GENTABLE_BUCKET_STATS_ENTRY=293, OF_BSN_GENTABLE_DESC_STATS_ENTRY=294, OF_BSN_GENTABLE_ENTRY_DESC_STATS_ENTRY=295, OF_BSN_GENTABLE_ENTRY_STATS_ENTRY=296, OF_BSN_GENTABLE_STATS_ENTRY=297, OF_BSN_INTERFACE=298, OF_BSN_LACP_STATS_ENTRY=299, OF_BSN_PORT_COUNTER_STATS_ENTRY=300, OF_BSN_SWITCH_PIPELINE_STATS_ENTRY=301, OF_BSN_TABLE_CHECKSUM_STATS_ENTRY=302, OF_BSN_TLV=303, OF_BSN_TLV_ACTION_STATE=304, OF_BSN_TLV_ACTIVE=305, OF_BSN_TLV_ACTOR_KEY=306, OF_BSN_TLV_ACTOR_PORT_NUM=307, OF_BSN_TLV_ACTOR_PORT_PRIORITY=308, OF_BSN_TLV_ACTOR_STATE=309, OF_BSN_TLV_ACTOR_SYSTEM_MAC=310, OF_BSN_TLV_ACTOR_SYSTEM_PRIORITY=311, OF_BSN_TLV_ADMIN_STATE=312, OF_BSN_TLV_ANALYTICS=313, OF_BSN_TLV_ANCHOR=314, OF_BSN_TLV_APPLY_BYTES=315, OF_BSN_TLV_APPLY_PACKETS=316, OF_BSN_TLV_ARP_SPA=317, OF_BSN_TLV_ARP_TPA=318, OF_BSN_TLV_AUTO_NEGOTIATION=319, OF_BSN_TLV_BFD_ENDPOINT=320, OF_BSN_TLV_BFD_STATE=321, OF_BSN_TLV_BROADCAST_QUERY_TIMEOUT=322, OF_BSN_TLV_BROADCAST_RATE=323, OF_BSN_TLV_BUCKET=324, OF_BSN_TLV_CIRCUIT_ID=325, OF_BSN_TLV_CLIENT_LL_ADDR=326, OF_BSN_TLV_CONVERGENCE_STATUS=327, OF_BSN_TLV_CPU_LAG=328, OF_BSN_TLV_CRC_ENABLED=329, OF_BSN_TLV_DATA=330, OF_BSN_TLV_DATA_MASK=331, OF_BSN_TLV_DECAP=332, OF_BSN_TLV_DISABLE_SRC_MAC_CHECK=333, OF_BSN_TLV_DISABLE_XMIT=334, OF_BSN_TLV_DNS_ANALYTICS=335, OF_BSN_TLV_DROP=336, OF_BSN_TLV_DROP_CONTROL=337, OF_BSN_TLV_DSCP=338, OF_BSN_TLV_ECN=339, OF_BSN_TLV_EGRESS_ONLY=340, OF_BSN_TLV_EGRESS_PORT_GROUP_ID=341, OF_BSN_TLV_EGRESS_SAMPLING_RATE=342, OF_BSN_TLV_ENCAP=343, OF_BSN_TLV_ENHANCED_HASH_CAPABILITY=344, OF_BSN_TLV_ETH_DST=345, OF_BSN_TLV_ETH_SRC=346, OF_BSN_TLV_ETH_TYPE=347, OF_BSN_TLV_EXTERNAL_GATEWAY_IP=348, OF_BSN_TLV_EXTERNAL_GATEWAY_MAC=349, OF_BSN_TLV_EXTERNAL_IP=350, OF_BSN_TLV_EXTERNAL_MAC=351, OF_BSN_TLV_EXTERNAL_NETMASK=352, OF_BSN_TLV_FABRIC_PORT_ROLE=353, OF_BSN_TLV_FAIL_COUNT=354, OF_BSN_TLV_FLOOD=355, OF_BSN_TLV_FLOW_CLASSIFIER=356, OF_BSN_TLV_FLOW_CLASSIFY=357, OF_BSN_TLV_FLOW_IDENTIFIER=358, OF_BSN_TLV_FORCE_LINK_UP=359, OF_BSN_TLV_FORWARD_ERROR_CORRECTION=360, OF_BSN_TLV_FREE_COUNT=361, OF_BSN_TLV_GENERATION_ID=362, OF_BSN_TLV_HASH_ALGORITHM=363, OF_BSN_TLV_HASH_GTP_HEADER_MATCH=364, OF_BSN_TLV_HASH_GTP_PORT_MATCH=365, OF_BSN_TLV_HASH_PACKET_FIELD=366, OF_BSN_TLV_HASH_PACKET_TYPE=367, OF_BSN_TLV_HASH_SEED=368, OF_BSN_TLV_HASH_TYPE=369, OF_BSN_TLV_HEADER_SIZE=370, OF_BSN_TLV_ICMP_CODE=371, OF_BSN_TLV_ICMP_ID=372, OF_BSN_TLV_ICMP_TYPE=373, OF_BSN_TLV_ICMPV6_CHKSUM=374, OF_BSN_TLV_ICMPV6_CODE=375, OF_BSN_TLV_ICMPV6_TYPE=376, OF_BSN_TLV_IDENTIFIER=377, OF_BSN_TLV_IDLE_NOTIFICATION=378, OF_BSN_TLV_IDLE_TIME=379, OF_BSN_TLV_IDLE_TIMEOUT=380, OF_BSN_TLV_IFP_CLASS_ID=381, OF_BSN_TLV_IGMP_SNOOPING=382, OF_BSN_TLV_INGRESS_PORT_GROUP_ID=383, OF_BSN_TLV_INNER_VLAN_VID=384, OF_BSN_TLV_INTERNAL_GATEWAY_MAC=385, OF_BSN_TLV_INTERNAL_MAC=386, OF_BSN_TLV_INTERVAL=387, OF_BSN_TLV_IP_FRAGMENTATION=388, OF_BSN_TLV_IP_PROTO=389, OF_BSN_TLV_IP_TUNNEL_TYPE=390, OF_BSN_TLV_IPV4=391, OF_BSN_TLV_IPV4_DST=392, OF_BSN_TLV_IPV4_NETMASK=393, OF_BSN_TLV_IPV4_SRC=394, OF_BSN_TLV_IPV6=395, OF_BSN_TLV_IPV6_DST=396, OF_BSN_TLV_IPV6_PREFIX=397, OF_BSN_TLV_IPV6_SRC=398, OF_BSN_TLV_KNOWN_MULTICAST_RATE=399, OF_BSN_TLV_L2_CACHE_HIT=400, OF_BSN_TLV_L2_MULTICAST_LOOKUP=401, OF_BSN_TLV_L3=402, OF_BSN_TLV_L3_DST_CLASS_ID=403, OF_BSN_TLV_L3_INTERFACE_CLASS_ID=404, OF_BSN_TLV_L3_SRC_CLASS_ID=405, OF_BSN_TLV_LAG_OPTIONS=406, OF_BSN_TLV_LAG_TYPE=407, OF_BSN_TLV_LCORE=408, OF_BSN_TLV_LINK_UP=409, OF_BSN_TLV_LOAD=410, OF_BSN_TLV_LOOKUP_COUNT=411, OF_BSN_TLV_LOOPBACK_MODE=412, OF_BSN_TLV_LOOPBACK_PORT=413, OF_BSN_TLV_LOSSLESS=414, OF_BSN_TLV_LR_ALL_ENABLED=415, OF_BSN_TLV_MAC=416, OF_BSN_TLV_MAC_MASK=417, OF_BSN_TLV_MATCHED_COUNT=418, OF_BSN_TLV_MAX_COUNT=419, OF_BSN_TLV_MCG_TYPE_VXLAN=420, OF_BSN_TLV_METADATA=421, OF_BSN_TLV_MGMT=422, OF_BSN_TLV_MGMT_RESELECT_ON_FAILURE=423, OF_BSN_TLV_MISS_PACKETS=424, OF_BSN_TLV_MPLS_CONTROL_WORD=425, OF_BSN_TLV_MPLS_LABEL=426, OF_BSN_TLV_MPLS_SEQUENCED=427, OF_BSN_TLV_MULTICAST_INTERFACE_ID=428, OF_BSN_TLV_MULTICAST_PACKET=429, OF_BSN_TLV_MULTIPLIER=430, OF_BSN_TLV_NAME=431, OF_BSN_TLV_NDP_OFFLOAD=432, OF_BSN_TLV_NDP_STATIC=433, OF_BSN_TLV_NEGATE=434, OF_BSN_TLV_NEXT_HOP_IPV4=435, OF_BSN_TLV_NEXT_HOP_MAC=436, OF_BSN_TLV_NEXTHOP_TYPE_VXLAN=437, OF_BSN_TLV_NO_ARP_RESPONSE=438, OF_BSN_TLV_NO_DROP=439, OF_BSN_TLV_NO_NS_RESPONSE=440, OF_BSN_TLV_OFFSET=441, OF_BSN_TLV_OPTICS_ALWAYS_ENABLED=442, OF_BSN_TLV_OUTER_SRC_MAC=443, OF_BSN_TLV_PACKET_FIELD=444, OF_BSN_TLV_PARENT_PORT=445, OF_BSN_TLV_PARTNER_KEY=446, OF_BSN_TLV_PARTNER_PORT_NUM=447, OF_BSN_TLV_PARTNER_PORT_PRIORITY=448, OF_BSN_TLV_PARTNER_STATE=449, OF_BSN_TLV_PARTNER_SYSTEM_MAC=450, OF_BSN_TLV_PARTNER_SYSTEM_PRIORITY=451, OF_BSN_TLV_PASSIVE=452, OF_BSN_TLV_PDUA_RX_INSTANCE=453, OF_BSN_TLV_PIM_DR=454, OF_BSN_TLV_PIM_HELLO_FLOOD=455, OF_BSN_TLV_PORT=456, OF_BSN_TLV_PORT_MODE=457, OF_BSN_TLV_PORT_SPEED_GBPS=458, OF_BSN_TLV_PORT_USAGE=459, OF_BSN_TLV_PORT_VXLAN_MODE=460, OF_BSN_TLV_PRESERVE_VLAN=461, OF_BSN_TLV_PRIORITY=462, OF_BSN_TLV_PUSH_TWO_PER_POLICY=463, OF_BSN_TLV_PUSH_TWO_TAGS_CAPABILITY=464, OF_BSN_TLV_PUSH_VLAN_ON_EGRESS=465, OF_BSN_TLV_PUSH_VLAN_ON_INGRESS=466, OF_BSN_TLV_QOS_PRIORITY=467, OF_BSN_TLV_QUEUE_ID=468, OF_BSN_TLV_QUEUE_WEIGHT=469, OF_BSN_TLV_RATE_LIMIT=470, OF_BSN_TLV_RATE_UNIT=471, OF_BSN_TLV_RECORD_PACKETS=472, OF_BSN_TLV_REDUNDANT_MGMT=473, OF_BSN_TLV_REFERENCE=474, OF_BSN_TLV_REMOTE_ID=475, OF_BSN_TLV_REPLY_PACKETS=476, OF_BSN_TLV_REQUEST_PACKETS=477, OF_BSN_TLV_REST_SERVER=478, OF_BSN_TLV_ROUTING_PARAM=479, OF_BSN_TLV_RX_BYTES=480, OF_BSN_TLV_RX_PACKETS=481, OF_BSN_TLV_SAMPLING_RATE=482, OF_BSN_TLV_SCTP_DST=483, OF_BSN_TLV_SCTP_SRC=484, OF_BSN_TLV_SET_LOOPBACK_MODE=485, OF_BSN_TLV_SOCKET=486, OF_BSN_TLV_SRC_MAC_CML=487, OF_BSN_TLV_STATUS=488, OF_BSN_TLV_STRIP_MPLS_L2_ON_INGRESS=489, OF_BSN_TLV_STRIP_MPLS_L3_ON_INGRESS=490, OF_BSN_TLV_STRIP_VLAN_ON_EGRESS=491, OF_BSN_TLV_SUB_AGENT_ID=492, OF_BSN_TLV_SWL_FEATURE=493, OF_BSN_TLV_TCP_DST=494, OF_BSN_TLV_TCP_FLAGS=495, OF_BSN_TLV_TCP_SRC=496, OF_BSN_TLV_THREAD=497, OF_BSN_TLV_TIMESTAMP=498, OF_BSN_TLV_TTL=499, OF_BSN_TLV_TUNNEL_CAPABILITY=500, OF_BSN_TLV_TX_BYTES=501, OF_BSN_TLV_TX_PACKETS=502, OF_BSN_TLV_UDF_ANCHOR=503, OF_BSN_TLV_UDF_CAPABILITY=504, OF_BSN_TLV_UDF_DATA=505, OF_BSN_TLV_UDF_ID=506, OF_BSN_TLV_UDF_LENGTH=507, OF_BSN_TLV_UDF_OFFSET=508, OF_BSN_TLV_UDP_DST=509, OF_BSN_TLV_UDP_SRC=510, OF_BSN_TLV_UINT32=511, OF_BSN_TLV_UINT64_LIST=512, OF_BSN_TLV_UNICAST_QUERY_TIMEOUT=513, OF_BSN_TLV_UNICAST_RATE=514, OF_BSN_TLV_UNKNOWN_MULTICAST_RATE=515, OF_BSN_TLV_UNTAGGED=516, OF_BSN_TLV_UPGRADE=517, OF_BSN_TLV_URI_SCHEME=518, OF_BSN_TLV_USE_PACKET_STATE=519, OF_BSN_TLV_USER_CONFIGURED=520, OF_BSN_TLV_VFI=521, OF_BSN_TLV_VFP_CLASS_ID=522, OF_BSN_TLV_VIRTUAL=523, OF_BSN_TLV_VLAN_MAC_LIST=524, OF_BSN_TLV_VLAN_PCP=525, OF_BSN_TLV_VLAN_VID=526, OF_BSN_TLV_VLAN_VID_MASK=527, OF_BSN_TLV_VNI=528, OF_BSN_TLV_VPN_KEY=529, OF_BSN_TLV_VRF=530, OF_BSN_TLV_VXLAN_EGRESS_LAG=531, OF_BSN_VLAN_COUNTER_STATS_ENTRY=532, OF_BSN_VLAN_MAC=533, OF_BSN_VPORT=534, OF_BSN_VPORT_L2GRE=535, OF_BSN_VPORT_Q_IN_Q=536, OF_BSN_VRF_COUNTER_STATS_ENTRY=537, OF_BUCKET=538, OF_BUCKET_COUNTER=539, OF_BUNDLE_PROP=540, OF_BUNDLE_PROP_EXPERIMENTER=541, OF_FLOW_STATS_ENTRY=542, OF_GROUP_DESC_STATS_ENTRY=543, OF_GROUP_STATS_ENTRY=544, OF_HELLO_ELEM=545, OF_HELLO_ELEM_VERSIONBITMAP=546, OF_INSTRUCTION=547, OF_INSTRUCTION_APPLY_ACTIONS=548, OF_INSTRUCTION_BSN=549, OF_INSTRUCTION_BSN_ARP_OFFLOAD=550, OF_INSTRUCTION_BSN_AUTO_NEGOTIATION=551, OF_INSTRUCTION_BSN_DENY=552, OF_INSTRUCTION_BSN_DHCP_OFFLOAD=553, OF_INSTRUCTION_BSN_DIRECTED_BROADCAST=554, OF_INSTRUCTION_BSN_DISABLE_L3=555, OF_INSTRUCTION_BSN_DISABLE_SPLIT_HORIZON_CHECK=556, OF_INSTRUCTION_BSN_DISABLE_SRC_MAC_CHECK=557, OF_INSTRUCTION_BSN_DISABLE_VLAN_COUNTERS=558, OF_INSTRUCTION_BSN_HASH_SELECT=559, OF_INSTRUCTION_BSN_INTERNAL_PRIORITY=560, OF_INSTRUCTION_BSN_NDP_OFFLOAD=561, OF_INSTRUCTION_BSN_PACKET_OF_DEATH=562, OF_INSTRUCTION_BSN_PERMIT=563, OF_INSTRUCTION_BSN_PRIORITIZE_PDUS=564, OF_INSTRUCTION_BSN_REQUIRE_VLAN_XLATE=565, OF_INSTRUCTION_BSN_SPAN_DESTINATION=566, OF_INSTRUCTION_CLEAR_ACTIONS=567, OF_INSTRUCTION_EXPERIMENTER=568, OF_INSTRUCTION_GOTO_TABLE=569, OF_INSTRUCTION_ID=570, OF_INSTRUCTION_ID_APPLY_ACTIONS=571, OF_INSTRUCTION_ID_BSN=572, OF_INSTRUCTION_ID_BSN_ARP_OFFLOAD=573, OF_INSTRUCTION_ID_BSN_AUTO_NEGOTIATION=574, OF_INSTRUCTION_ID_BSN_DENY=575, OF_INSTRUCTION_ID_BSN_DHCP_OFFLOAD=576, OF_INSTRUCTION_ID_BSN_DIRECTED_BROADCAST=577, OF_INSTRUCTION_ID_BSN_DISABLE_L3=578, OF_INSTRUCTION_ID_BSN_DISABLE_SPLIT_HORIZON_CHECK=579, OF_INSTRUCTION_ID_BSN_DISABLE_SRC_MAC_CHECK=580, OF_INSTRUCTION_ID_BSN_DISABLE_VLAN_COUNTERS=581, OF_INSTRUCTION_ID_BSN_HASH_SELECT=582, OF_INSTRUCTION_ID_BSN_INTERNAL_PRIORITY=583, OF_INSTRUCTION_ID_BSN_NDP_OFFLOAD=584, OF_INSTRUCTION_ID_BSN_PACKET_OF_DEATH=585, OF_INSTRUCTION_ID_BSN_PERMIT=586, OF_INSTRUCTION_ID_BSN_PRIORITIZE_PDUS=587, OF_INSTRUCTION_ID_BSN_REQUIRE_VLAN_XLATE=588, OF_INSTRUCTION_ID_BSN_SPAN_DESTINATION=589, OF_INSTRUCTION_ID_CLEAR_ACTIONS=590, OF_INSTRUCTION_ID_EXPERIMENTER=591, OF_INSTRUCTION_ID_GOTO_TABLE=592, OF_INSTRUCTION_ID_METER=593, OF_INSTRUCTION_ID_WRITE_ACTIONS=594, OF_INSTRUCTION_ID_WRITE_METADATA=595, OF_INSTRUCTION_METER=596, OF_INSTRUCTION_WRITE_ACTIONS=597, OF_INSTRUCTION_WRITE_METADATA=598, OF_MATCH_V1=599, OF_MATCH_V2=600, OF_MATCH_V3=601, OF_METER_BAND=602, OF_METER_BAND_DROP=603, OF_METER_BAND_DSCP_REMARK=604, OF_METER_BAND_EXPERIMENTER=605, OF_METER_BAND_STATS=606, OF_METER_CONFIG=607, OF_METER_FEATURES=608, OF_METER_STATS=609, OF_OXM=610, OF_OXM_ARP_OP=611, OF_OXM_ARP_OP_MASKED=612, OF_OXM_ARP_SHA=613, OF_OXM_ARP_SHA_MASKED=614, OF_OXM_ARP_SPA=615, OF_OXM_ARP_SPA_MASKED=616, OF_OXM_ARP_THA=617, OF_OXM_ARP_THA_MASKED=618, OF_OXM_ARP_TPA=619, OF_OXM_ARP_TPA_MASKED=620, OF_OXM_BSN_EGR_PORT_GROUP_ID=621, OF_OXM_BSN_EGR_PORT_GROUP_ID_MASKED=622, OF_OXM_BSN_GLOBAL_VRF_ALLOWED=623, OF_OXM_BSN_GLOBAL_VRF_ALLOWED_MASKED=624, OF_OXM_BSN_IFP_CLASS_ID=625, OF_OXM_BSN_IFP_CLASS_ID_MASKED=626, OF_OXM_BSN_IN_PORTS_128=627, OF_OXM_BSN_IN_PORTS_128_MASKED=628, OF_OXM_BSN_IN_PORTS_512=629, OF_OXM_BSN_IN_PORTS_512_MASKED=630, OF_OXM_BSN_INGRESS_PORT_GROUP_ID=631, OF_OXM_BSN_INGRESS_PORT_GROUP_ID_MASKED=632, OF_OXM_BSN_INNER_ETH_DST=633, OF_OXM_BSN_INNER_ETH_DST_MASKED=634, OF_OXM_BSN_INNER_ETH_SRC=635, OF_OXM_BSN_INNER_ETH_SRC_MASKED=636, OF_OXM_BSN_INNER_VLAN_VID=637, OF_OXM_BSN_INNER_VLAN_VID_MASKED=638, OF_OXM_BSN_IP_FRAGMENTATION=639, OF_OXM_BSN_IP_FRAGMENTATION_MASKED=640, OF_OXM_BSN_L2_CACHE_HIT=641, OF_OXM_BSN_L2_CACHE_HIT_MASKED=642, OF_OXM_BSN_L3_DST_CLASS_ID=643, OF_OXM_BSN_L3_DST_CLASS_ID_MASKED=644, OF_OXM_BSN_L3_INTERFACE_CLASS_ID=645, OF_OXM_BSN_L3_INTERFACE_CLASS_ID_MASKED=646, OF_OXM_BSN_L3_SRC_CLASS_ID=647, OF_OXM_BSN_L3_SRC_CLASS_ID_MASKED=648, OF_OXM_BSN_LAG_ID=649, OF_OXM_BSN_LAG_ID_MASKED=650, OF_OXM_BSN_TCP_FLAGS=651, OF_OXM_BSN_TCP_FLAGS_MASKED=652, OF_OXM_BSN_UDF0=653, OF_OXM_BSN_UDF0_MASKED=654, OF_OXM_BSN_UDF1=655, OF_OXM_BSN_UDF1_MASKED=656, OF_OXM_BSN_UDF2=657, OF_OXM_BSN_UDF2_MASKED=658, OF_OXM_BSN_UDF3=659, OF_OXM_BSN_UDF3_MASKED=660, OF_OXM_BSN_UDF4=661, OF_OXM_BSN_UDF4_MASKED=662, OF_OXM_BSN_UDF5=663, OF_OXM_BSN_UDF5_MASKED=664, OF_OXM_BSN_UDF6=665, OF_OXM_BSN_UDF6_MASKED=666, OF_OXM_BSN_UDF7=667, OF_OXM_BSN_UDF7_MASKED=668, OF_OXM_BSN_VFI=669, OF_OXM_BSN_VFI_MASKED=670, OF_OXM_BSN_VLAN_XLATE_PORT_GROUP_ID=671, OF_OXM_BSN_VLAN_XLATE_PORT_GROUP_ID_MASKED=672, OF_OXM_BSN_VRF=673, OF_OXM_BSN_VRF_MASKED=674, OF_OXM_BSN_VXLAN_NETWORK_ID=675, OF_OXM_BSN_VXLAN_NETWORK_ID_MASKED=676, OF_OXM_CONN_TRACKING_IPV6_DST=677, OF_OXM_CONN_TRACKING_IPV6_DST_MASKED=678, OF_OXM_CONN_TRACKING_IPV6_SRC=679, OF_OXM_CONN_TRACKING_IPV6_SRC_MASKED=680, OF_OXM_CONN_TRACKING_LABEL=681, OF_OXM_CONN_TRACKING_LABEL_MASKED=682, OF_OXM_CONN_TRACKING_MARK=683, OF_OXM_CONN_TRACKING_MARK_MASKED=684, OF_OXM_CONN_TRACKING_NW_DST=685, OF_OXM_CONN_TRACKING_NW_DST_MASKED=686, OF_OXM_CONN_TRACKING_NW_PROTO=687, OF_OXM_CONN_TRACKING_NW_PROTO_MASKED=688, OF_OXM_CONN_TRACKING_NW_SRC=689, OF_OXM_CONN_TRACKING_NW_SRC_MASKED=690, OF_OXM_CONN_TRACKING_STATE=691, OF_OXM_CONN_TRACKING_STATE_MASKED=692, OF_OXM_CONN_TRACKING_TP_DST=693, OF_OXM_CONN_TRACKING_TP_DST_MASKED=694, OF_OXM_CONN_TRACKING_TP_SRC=695, OF_OXM_CONN_TRACKING_TP_SRC_MASKED=696, OF_OXM_CONN_TRACKING_ZONE=697, OF_OXM_CONN_TRACKING_ZONE_MASKED=698, OF_OXM_ETH_DST=699, OF_OXM_ETH_DST_MASKED=700, OF_OXM_ETH_SRC=701, OF_OXM_ETH_SRC_MASKED=702, OF_OXM_ETH_TYPE=703, OF_OXM_ETH_TYPE_MASKED=704, OF_OXM_ICMPV4_CODE=705, OF_OXM_ICMPV4_CODE_MASKED=706, OF_OXM_ICMPV4_TYPE=707, OF_OXM_ICMPV4_TYPE_MASKED=708, OF_OXM_ICMPV6_CODE=709, OF_OXM_ICMPV6_CODE_MASKED=710, OF_OXM_ICMPV6_TYPE=711, OF_OXM_ICMPV6_TYPE_MASKED=712, OF_OXM_IN_PHY_PORT=713, OF_OXM_IN_PHY_PORT_MASKED=714, OF_OXM_IN_PORT=715, OF_OXM_IN_PORT_MASKED=716, OF_OXM_IP_DSCP=717, OF_OXM_IP_DSCP_MASKED=718, OF_OXM_IP_ECN=719, OF_OXM_IP_ECN_MASKED=720, OF_OXM_IP_PROTO=721, OF_OXM_IP_PROTO_MASKED=722, OF_OXM_IPV4_DST=723, OF_OXM_IPV4_DST_MASKED=724, OF_OXM_IPV4_SRC=725, OF_OXM_IPV4_SRC_MASKED=726, OF_OXM_IPV6_DST=727, OF_OXM_IPV6_DST_MASKED=728, OF_OXM_IPV6_EXTHDR=729, OF_OXM_IPV6_EXTHDR_MASKED=730, OF_OXM_IPV6_FLABEL=731, OF_OXM_IPV6_FLABEL_MASKED=732, OF_OXM_IPV6_ND_SLL=733, OF_OXM_IPV6_ND_SLL_MASKED=734, OF_OXM_IPV6_ND_TARGET=735, OF_OXM_IPV6_ND_TARGET_MASKED=736, OF_OXM_IPV6_ND_TLL=737, OF_OXM_IPV6_ND_TLL_MASKED=738, OF_OXM_IPV6_SRC=739, OF_OXM_IPV6_SRC_MASKED=740, OF_OXM_METADATA=741, OF_OXM_METADATA_MASKED=742, OF_OXM_MPLS_BOS=743, OF_OXM_MPLS_BOS_MASKED=744, OF_OXM_MPLS_LABEL=745, OF_OXM_MPLS_LABEL_MASKED=746, OF_OXM_MPLS_TC=747, OF_OXM_MPLS_TC_MASKED=748, OF_OXM_OVS_TCP_FLAGS=749, OF_OXM_OVS_TCP_FLAGS_MASKED=750, OF_OXM_PBB_UCA=751, OF_OXM_PBB_UCA_MASKED=752, OF_OXM_SCTP_DST=753, OF_OXM_SCTP_DST_MASKED=754, OF_OXM_SCTP_SRC=755, OF_OXM_SCTP_SRC_MASKED=756, OF_OXM_TCP_DST=757, OF_OXM_TCP_DST_MASKED=758, OF_OXM_TCP_SRC=759, OF_OXM_TCP_SRC_MASKED=760, OF_OXM_TUNNEL_ID=761, OF_OXM_TUNNEL_ID_MASKED=762, OF_OXM_TUNNEL_IPV4_DST=763, OF_OXM_TUNNEL_IPV4_DST_MASKED=764, OF_OXM_TUNNEL_IPV4_SRC=765, OF_OXM_TUNNEL_IPV4_SRC_MASKED=766, OF_OXM_UDP_DST=767, OF_OXM_UDP_DST_MASKED=768, OF_OXM_UDP_SRC=769, OF_OXM_UDP_SRC_MASKED=770, OF_OXM_VLAN_PCP=771, OF_OXM_VLAN_PCP_MASKED=772, OF_OXM_VLAN_VID=773, OF_OXM_VLAN_VID_MASKED=774, OF_PACKET_QUEUE=775, OF_PORT_DESC=776, OF_PORT_DESC_PROP=777, OF_PORT_DESC_PROP_BSN=778, OF_PORT_DESC_PROP_BSN_BREAKOUT=779, OF_PORT_DESC_PROP_BSN_DRIVER_INFO_JSON=780, OF_PORT_DESC_PROP_BSN_EXTENDED_CAPABILITIES=781, OF_PORT_DESC_PROP_BSN_FORWARD_ERROR_CORRECTION=782, OF_PORT_DESC_PROP_BSN_GENERATION_ID=783, OF_PORT_DESC_PROP_BSN_MISC_CAPABILITIES=784, OF_PORT_DESC_PROP_BSN_SFF_JSON=785, OF_PORT_DESC_PROP_BSN_SPEED_CAPABILITIES=786, OF_PORT_DESC_PROP_BSN_UPLINK=787, OF_PORT_DESC_PROP_ETHERNET=788, OF_PORT_DESC_PROP_EXPERIMENTER=789, OF_PORT_DESC_PROP_OPTICAL=790, OF_PORT_MOD_PROP=791, OF_PORT_MOD_PROP_ETHERNET=792, OF_PORT_MOD_PROP_EXPERIMENTER=793, OF_PORT_MOD_PROP_OPTICAL=794, OF_PORT_STATS_ENTRY=795, OF_PORT_STATS_PROP=796, OF_PORT_STATS_PROP_ETHERNET=797, OF_PORT_STATS_PROP_EXPERIMENTER=798, OF_PORT_STATS_PROP_EXPERIMENTER_INTEL=799, OF_PORT_STATS_PROP_OPTICAL=800, OF_QUEUE_DESC=801, OF_QUEUE_DESC_PROP=802, OF_QUEUE_DESC_PROP_BSN=803, OF_QUEUE_DESC_PROP_BSN_QUEUE_NAME=804, OF_QUEUE_DESC_PROP_EXPERIMENTER=805, OF_QUEUE_DESC_PROP_MAX_RATE=806, OF_QUEUE_DESC_PROP_MIN_RATE=807, OF_QUEUE_PROP=808, OF_QUEUE_PROP_EXPERIMENTER=809, OF_QUEUE_PROP_MAX_RATE=810, OF_QUEUE_PROP_MIN_RATE=811, OF_QUEUE_STATS_ENTRY=812, OF_QUEUE_STATS_PROP=813, OF_QUEUE_STATS_PROP_EXPERIMENTER=814, OF_ROLE_PROP=815, OF_ROLE_PROP_EXPERIMENTER=816, OF_TABLE_DESC=817, OF_TABLE_FEATURE_PROP=818, OF_TABLE_FEATURE_PROP_APPLY_ACTIONS=819, OF_TABLE_FEATURE_PROP_APPLY_ACTIONS_MISS=820, OF_TABLE_FEATURE_PROP_APPLY_SETFIELD=821, OF_TABLE_FEATURE_PROP_APPLY_SETFIELD_MISS=822, OF_TABLE_FEATURE_PROP_EXPERIMENTER=823, OF_TABLE_FEATURE_PROP_EXPERIMENTER_MISS=824, OF_TABLE_FEATURE_PROP_INSTRUCTIONS=825, OF_TABLE_FEATURE_PROP_INSTRUCTIONS_MISS=826, OF_TABLE_FEATURE_PROP_MATCH=827, OF_TABLE_FEATURE_PROP_NEXT_TABLES=828, OF_TABLE_FEATURE_PROP_NEXT_TABLES_MISS=829, OF_TABLE_FEATURE_PROP_TABLE_SYNC_FROM=830, OF_TABLE_FEATURE_PROP_WILDCARDS=831, OF_TABLE_FEATURE_PROP_WRITE_ACTIONS=832, OF_TABLE_FEATURE_PROP_WRITE_ACTIONS_MISS=833, OF_TABLE_FEATURE_PROP_WRITE_SETFIELD=834, OF_TABLE_FEATURE_PROP_WRITE_SETFIELD_MISS=835, OF_TABLE_FEATURES=836, OF_TABLE_MOD_PROP=837, OF_TABLE_MOD_PROP_EVICTION=838, OF_TABLE_MOD_PROP_EXPERIMENTER=839, OF_TABLE_MOD_PROP_VACANCY=840, OF_TABLE_STATS_ENTRY=841, OF_UINT32=842, OF_UINT64=843, OF_UINT8=844, OF_LIST_ACTION=845, OF_LIST_ACTION_ID=846, OF_LIST_ASYNC_CONFIG_PROP=847, OF_LIST_BSN_CONTROLLER_CONNECTION=848, OF_LIST_BSN_DEBUG_COUNTER_DESC_STATS_ENTRY=849, OF_LIST_BSN_DEBUG_COUNTER_STATS_ENTRY=850, OF_LIST_BSN_FLOW_CHECKSUM_BUCKET_STATS_ENTRY=851, OF_LIST_BSN_GENERIC_STATS_ENTRY=852, OF_LIST_BSN_GENTABLE_BUCKET_STATS_ENTRY=853, OF_LIST_BSN_GENTABLE_DESC_STATS_ENTRY=854, OF_LIST_BSN_GENTABLE_ENTRY_DESC_STATS_ENTRY=855, OF_LIST_BSN_GENTABLE_ENTRY_STATS_ENTRY=856, OF_LIST_BSN_GENTABLE_STATS_ENTRY=857, OF_LIST_BSN_INTERFACE=858, OF_LIST_BSN_LACP_STATS_ENTRY=859, OF_LIST_BSN_PORT_COUNTER_STATS_ENTRY=860, OF_LIST_BSN_SWITCH_PIPELINE_STATS_ENTRY=861, OF_LIST_BSN_TABLE_CHECKSUM_STATS_ENTRY=862, OF_LIST_BSN_TLV=863, OF_LIST_BSN_VLAN_COUNTER_STATS_ENTRY=864, OF_LIST_BSN_VLAN_MAC=865, OF_LIST_BSN_VRF_COUNTER_STATS_ENTRY=866, OF_LIST_BUCKET=867, OF_LIST_BUCKET_COUNTER=868, OF_LIST_BUNDLE_PROP=869, OF_LIST_FLOW_STATS_ENTRY=870, OF_LIST_GROUP_DESC_STATS_ENTRY=871, OF_LIST_GROUP_STATS_ENTRY=872, OF_LIST_HELLO_ELEM=873, OF_LIST_INSTRUCTION=874, OF_LIST_INSTRUCTION_ID=875, OF_LIST_METER_BAND=876, OF_LIST_METER_BAND_STATS=877, OF_LIST_METER_CONFIG=878, OF_LIST_METER_STATS=879, OF_LIST_OXM=880, OF_LIST_PACKET_QUEUE=881, OF_LIST_PORT_DESC=882, OF_LIST_PORT_DESC_PROP=883, OF_LIST_PORT_MOD_PROP=884, OF_LIST_PORT_STATS_ENTRY=885, OF_LIST_PORT_STATS_PROP=886, OF_LIST_QUEUE_DESC=887, OF_LIST_QUEUE_DESC_PROP=888, OF_LIST_QUEUE_PROP=889, OF_LIST_QUEUE_STATS_ENTRY=890, OF_LIST_QUEUE_STATS_PROP=891, OF_LIST_ROLE_PROP=892, OF_LIST_TABLE_DESC=893, OF_LIST_TABLE_FEATURE_PROP=894, OF_LIST_TABLE_FEATURES=895, OF_LIST_TABLE_MOD_PROP=896, OF_LIST_TABLE_STATS_ENTRY=897, OF_LIST_UINT32=898, OF_LIST_UINT64=899, OF_LIST_UINT8=900, OF_OBJECT_COUNT=901 } object_id; struct of_object_s *parent; int length; enum of_version_e { OF_VERSION_UNKNOWN=0, OF_VERSION_1_0=1, OF_VERSION_1_1=2, OF_VERSION_1_2=3, OF_VERSION_1_3=4, OF_VERSION_1_4=5 } version; } *

user_defined_types: struct of_object_s { struct of_wire_buffer_s *wbuf; int obj_offset; enum of_object_id_e object_id; struct of_object_s *parent; int length; enum of_version_e version; }