decompiled_code:
__int64 __fastcall option_name_lookup(int a1)
{
__int64 v1; // r8
_QWORD *v2; // rax

v1 = *((_QWORD *)&options + 1);
if ( v1 )
{
v2 = &options;
do
{
if ( *(_DWORD *)v2 == a1 )
break;
v1 = v2[3];
v2 += 2;
}
while ( v1 );
}
return v1;
}

canonical_decompiled_code:
__int64 __fastcall func0(int a1)
{
__int64 v1; // r8
_QWORD *v2; // rax

v1 = *((_QWORD *)&options + 1);
if ( v1 )
{
v2 = &options;
do
{
if ( *(_DWORD *)v2 == a1 )
break;
v1 = v2[3];
v2 += 2;
}
while ( v1 );
}
return v1;
}

original_code:
static const char *
option_name_lookup(unsigned optnum)
{
    size_t i;
    for (i=0; options[i].text; i++) {
        if (options[i].num == optnum)
            return options[i].text;
    }
    return 0;
}

canonical_original_code:
static char *option_name_lookup(unsigned int optnum)
{
    unsigned long i;
    for (i=0; options[i].text; i++) {
        if (options[i].num == optnum)
            return options[i].text;
    }
    return 0;
}

variable_types:
optnum
unsigned int

return_type: char *


repo: robertdavidgraham/masscan

decompiled_code:
_BOOL8 telnet_selftest()
{
const char *v0; // rsi
char *v1; // rdi
unsigned int v2; // ebp
_QWORD *v3; // rbx
_BOOL4 v4; // er12
_QWORD v6[13]; // [rsp+0h] [rbp-68h] BYREF

v0 = "login";
v1 = (char *)&unk_96E;
v2 = 0;
v6[2] = &unk_978;
v3 = v6;
v6[3] = &unk_980;
v6[4] = &unk_B98;
v6[5] = "User Access";
v6[6] = &unk_98E;
v6[7] = "F670\\n Login:";
v6[8] = 0LL;
v6[9] = 0LL;
while ( 1 )
{
v4 = telnet_selftest_item(v1, v0);
if ( v4 )
break;
v1 = (char *)v3[2];
v3 += 2;
++v2;
if ( !v1 )
return v4;
v0 = (const char *)v3[1];
}
fprintf(stderr, "telnet: selftest fail, item %u\n", v2);
return v4;
}

canonical_decompiled_code:
_BOOL8 func4()
{
const char *v0; // rsi
char *v1; // rdi
unsigned int v2; // ebp
_QWORD *v3; // rbx
_BOOL4 v4; // er12
_QWORD v6[13]; // [rsp+0h] [rbp-68h] BYREF

v0 = "login";
v1 = (char *)&unk_96E;
v2 = 0;
v6[2] = &unk_978;
v3 = v6;
v6[3] = &unk_980;
v6[4] = &unk_B98;
v6[5] = "User Access";
v6[6] = &unk_98E;
v6[7] = "F670\\n Login:";
v6[8] = 0LL;
v6[9] = 0LL;
while ( 1 )
{
v4 = func3(v1, v0);
if ( v4 )
break;
v1 = (char *)v3[2];
v3 += 2;
++v2;
if ( !v1 )
return v4;
v0 = (const char *)v3[1];
}
fprintf(stderr, "telnet: selftest fail, item %u\n", v2);
return v4;
}

original_code:
static int
telnet_selftest(void)
{
    struct {
        const char *input;
        const char *output;
    } tests[] = {
        {"\xff\xfd\x1flogin:", "login"},
        {"\xff\xfd\x27\xff\xfd\x18 ", " "},
        {
            "\xff\xfb\x25\xff\xfd\x03\xff\xfb\x18\xff\xfb\x1f\xff\xfb\x20\xff" "\xfb\x21\xff\xfb\x22\xff\xfb\x27\xff\xfd\x05"
            "\xff\xfb\x01\xff\xfb\x03\xff\xfd\x18\xff\xfd\x1f"
            "\xff\xfa\x18\x01\xff\xf0"
            "\x0d\x0a\x55\x73\x65\x72\x20\x41\x63\x63\x65\x73\x73\x20\x56\x65" "\x72\x69\x66\x69\x63\x61\x74\x69\x6f\x6e\x0d\x0a\x0d\x0a"
            ,
            "User Access"
        },
        { "\xff\xfd\x01\xff\xfd\x1f\xff\xfd\x21\xff\xfb\x01\xff\xfb\x03\x46"
            "\x36\x37\x30\x0d\x0a\x0d\x4c\x6f\x67\x69\x6e\x3a\x20",
            "F670\\n Login:"
        },
        {0,0}
    };
    size_t i;
    for (i=0; tests[i].input; i++) {
        int err;
        err = telnet_selftest_item(tests[i].input, tests[i].output);
        if (err) {
            fprintf(stderr, "telnet: selftest fail, item %u\n", (unsigned)i);
            return err;
        }
    }
    return 0;
}

canonical_original_code:
static int telnet_selftest()
{
    struct { char *input; char *output; } tests[] = {
        {"\xff\xfd\x1flogin:", "login"},
        {"\xff\xfd\x27\xff\xfd\x18 ", " "},
        {
            "\xff\xfb\x25\xff\xfd\x03\xff\xfb\x18\xff\xfb\x1f\xff\xfb\x20\xff" "\xfb\x21\xff\xfb\x22\xff\xfb\x27\xff\xfd\x05"
            "\xff\xfb\x01\xff\xfb\x03\xff\xfd\x18\xff\xfd\x1f"
            "\xff\xfa\x18\x01\xff\xf0"
            "\x0d\x0a\x55\x73\x65\x72\x20\x41\x63\x63\x65\x73\x73\x20\x56\x65" "\x72\x69\x66\x69\x63\x61\x74\x69\x6f\x6e\x0d\x0a\x0d\x0a"
            ,
            "User Access"
        },
        { "\xff\xfd\x01\xff\xfd\x1f\xff\xfd\x21\xff\xfb\x01\xff\xfb\x03\x46"
            "\x36\x37\x30\x0d\x0a\x0d\x4c\x6f\x67\x69\x6e\x3a\x20",
            "F670\\n Login:"
        },
        {0,0}
    };
    unsigned long i;
    for (i=0; tests[i].input; i++) {
        int err;
        err = telnet_selftest_item(tests[i].input, tests[i].output);
        if (err) {
            fprintf(stderr, "telnet: selftest fail, item %u\n", (unsigned int)i);
            return err;
        }
    }
    return 0;
}

variable_types: struct { char *input; char *output; } []

variable_types:
i
unsigned long

variable_types: err int

return_type: int


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

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

original_code:
static int
versioning_selftest(void)
{
    return 0;
}

canonical_original_code:
static int versioning_selftest()
{
    return 0;
}


decompiled_code:
int pixie_cpu_raise_priority()
{
pthread_t v0; // rbp
int v1; // eax
int policy; // [rsp+Ch] [rbp-4Ch] BYREF
pthread_attr_t attr; // [rsp+10h] [rbp-48h] BYREF

policy = 0;
v0 = pthread_self();
pthread_attr_init(&attr);
pthread_attr_getschedpolicy(&attr, &policy);
v1 = sched_get_priority_max(policy);
pthread_setschedprio(v0, v1);
return pthread_attr_destroy(&attr);
}

canonical_decompiled_code:
int func0()
{
pthread_t v0; // rbp
int v1; // eax
int policy; // [rsp+Ch] [rbp-4Ch] BYREF
pthread_attr_t attr; // [rsp+10h] [rbp-48h] BYREF

policy = 0;
v0 = pthread_self();
pthread_attr_init(&attr);
pthread_attr_getschedpolicy(&attr, &policy);
v1 = sched_get_priority_max(policy);
pthread_setschedprio(v0, v1);
return pthread_attr_destroy(&attr);
}

original_code:
void
pixie_cpu_raise_priority(void)
{
    pthread_t thread = pthread_self();
    pthread_attr_t thAttr;
    int policy = 0;
    int max_prio_for_policy = 0;
    pthread_attr_init(&thAttr);
    pthread_attr_getschedpolicy(&thAttr, &policy);
    max_prio_for_policy = sched_get_priority_max(policy);
    pthread_setschedprio(thread, max_prio_for_policy);
    pthread_attr_destroy(&thAttr);
    return;
}

canonical_original_code:
void pixie_cpu_raise_priority()
{
    unsigned long thread = pthread_self();
    union pthread_attr_t thAttr;
    int policy = 0;
    int max_prio_for_policy = 0;
    pthread_attr_init(&thAttr);
    pthread_attr_getschedpolicy(&thAttr, &policy);
    max_prio_for_policy = sched_get_priority_max(policy);
    pthread_setschedprio(thread, max_prio_for_policy);
    pthread_attr_destroy(&thAttr);
    return;
}

variable_types:
thread
unsigned long

variable_types: union pthread_attr_t { char __size[56]; long __align; }

variable_types: policy int

return_type: void


decompiled_code:
int __fastcall pixie_cpu_set_affinity(int a1)
{
pthread_t v1; // r8
unsigned __int64 v2; // rax
int result; // eax
int *v4; // rax
cpu_set_t v5; // [rsp+0h] [rbp-88h] BYREF

v1 = pthread_self();
memset(&v5, 0, sizeof(v5));
v2 = (unsigned int)(a1 + 1);
if ( (unsigned int)v2 <= 0x3FF )
v5.__bits[v2 >> 6] |= 1LL << ((unsigned __int8)a1 + 1);
result = pthread_setaffinity_np(v1, 0x80uLL, &v5);
if ( result )
{
v4 = _errno_location();
result = fprintf(stderr, "set_affinity: returned error linux:%d\n", (unsigned int)*v4);
}
return result;
}

canonical_decompiled_code:
int __fastcall func1(int a1)
{
pthread_t v1; // r8
unsigned __int64 v2; // rax
int result; // eax
int *v4; // rax
cpu_set_t v5; // [rsp+0h] [rbp-88h] BYREF

v1 = pthread_self();
memset(&v5, 0, sizeof(v5));
v2 = (unsigned int)(a1 + 1);
if ( (unsigned int)v2 <= 0x3FF )
v5.__bits[v2 >> 6] |= 1LL << ((unsigned __int8)a1 + 1);
result = pthread_setaffinity_np(v1, 0x80uLL, &v5);
if ( result )
{
v4 = _errno_location();
result = fprintf(stderr, "set_affinity: returned error linux:%d\n", (unsigned int)*v4);
}
return result;
}

original_code:
void
pixie_cpu_set_affinity(unsigned processor)
{
    int x;
    pthread_t thread = pthread_self();
    cpu_set_t cpuset;
    do __builtin_memset (&cpuset, '\0', sizeof (cpu_set_t)); while (0);
    (__extension__ ({ size_t __cpu = (processor+1); __cpu / 8 < (sizeof (cpu_set_t)) ? (((__cpu_mask *) ((&cpuset)->__bits))[((__cpu) / (8 * sizeof (__cpu_mask)))] |= ((__cpu_mask) 1 << ((__cpu) % (8 * sizeof (__cpu_mask))))) : 0; }));
    x = pthread_setaffinity_np(thread, sizeof(cpu_set_t), &cpuset);
    if (x != 0) {
        fprintf(stderr, "set_affinity: returned error linux:%d\n", (*__errno_location ()));
    }
}

canonical_original_code:
void pixie_cpu_set_affinity(unsigned int processor)
{
    int x;
    unsigned long thread = pthread_self();
    struct cpu_set_t cpuset;
    do __builtin_memset (&cpuset, '\0', sizeof (cpu_set_t)); while (0);
    (__extension__ ({ unsigned long __cpu = (processor+1); __cpu / 8 < (sizeof (cpu_set_t)) ? (((unsigned long *) ((&cpuset)->__bits))[((__cpu) / (8 * sizeof (__cpu_mask)))] |= ((unsigned long) 1 << ((__cpu) % (8 * sizeof (__cpu_mask))))) : 0; }));
    x = pthread_setaffinity_np(thread, sizeof(cpu_set_t), &cpuset);
    if (x != 0) {
        fprintf(stderr, "set_affinity: returned error linux:%d\n", (*__errno_location ()));
    }
}

variable_types:
processor
unsigned int

variable_types: x int

variable_types: struct cpu_set_t { unsigned long __bits[-1]; }


decompiled_code:
int pixie_cpu_get_count()
{
__pid_t v0; // eax
cpu_set_t v2; // [rsp+0h] [rbp-88h] BYREF

v0 = getpid();
if ( !sched_getaffinity(v0, 0x80uLL, &v2) )
return _sched_cpucount(0x80uLL, &v2);
perror("sched_getaffinity");
return 1;
}

canonical_decompiled_code:
int func2()
{
__pid_t v0; // eax
cpu_set_t v2; // [rsp+0h] [rbp-88h] BYREF

v0 = getpid();
if ( !sched_getaffinity(v0, 0x80uLL, &v2) )
return _sched_cpucount(0x80uLL, &v2);
perror("sched_getaffinity");
return 1;
}

original_code:
unsigned
pixie_cpu_get_count(void)
{
    {
        pid_t pid;
        cpu_set_t mask;
        int err;
        pid = getpid();
        err = sched_getaffinity(pid, sizeof(mask), &mask);
        if (err) {
            perror("sched_getaffinity");
            return 1;
        } else {
            return __sched_cpucount (sizeof (cpu_set_t), &mask);
        }
    }
}

canonical_original_code:
unsigned int pixie_cpu_get_count()
{
    {
        int pid;
        struct cpu_set_t mask;
        int err;
        pid = getpid();
        err = sched_getaffinity(pid, sizeof(mask), &mask);
        if (err) {
            perror("sched_getaffinity");
            return 1;
        } else {
            return __sched_cpucount (sizeof (cpu_set_t), &mask);
        }
    }
}

variable_types: pid int

return_type: unsigned int

user_defined_types: struct cpu_set_t { unsigned long __bits[-1]; }


decompiled_code:
int __fastcall pixie_thread_join(pthread_t a1)
{
void *thread_return; // [rsp+8h] [rbp-10h] BYREF

return pthread_join(a1, &thread_return);
}

canonical_decompiled_code:
int __fastcall func4(pthread_t a1)
{
void *thread_return; // [rsp+8h] [rbp-10h] BYREF

return pthread_join(a1, &thread_return);
}

original_code:
void pixie_thread_join(size_t thread_handle)
{
    void *p;
    pthread_join((pthread_t)thread_handle, &p);
}

canonical_original_code:
void pixie_thread_join(unsigned long thread_handle)
{
    void *p;
    pthread_join((unsigned long)thread_handle, &p);
}

variable_types:
p
void *


original_code:
void
status_print(
    struct Status *status,
    uint64_t count,
    uint64_t max_count,
    double pps,
    uint64_t total_tcbs,
    uint64_t total_synacks,
    uint64_t total_syns,
    uint64_t exiting,
    _Bool json_status)
{
    double elapsed_time;
    double rate;
    double now;
    double percent_done;
    double time_remaining;
    uint64_t current_tcbs = 0;
    uint64_t current_synacks = 0;
    uint64_t current_syns = 0;
    double tcb_rate = 0.0;
    double synack_rate = 0.0;
    double syn_rate = 0.0;
    double kpps = pps / 1000;
    const char *fmt;
    const char* json_fmt_infinite =
    "{"
        "\"state\":\"*\","
        "\"rate\":"
        "{"
            "\"kpps\":%.2f,"
            "\"pps\":%6$.2f,"
            "\"synps\":%.0f,"
            "\"ackps\":%.0f,"
            "\"tcbps\":%.0f"
        "},"
        "\"tcb\":%5$" "l" "u" ","
        "\"syn\":%7$" "l" "u"
    "}\n";
    const char *json_fmt_waiting =
    "{"
        "\"state\":\"waiting\","
        "\"rate\":"
        "{"
            "\"kpps\":%.2f,"
            "\"pps\":%5$.2f"
        "},"
        "\"progress\":"
        "{"
            "\"percent\":%.2f,"
            "\"seconds\":%d,"
            "\"found\":%" "l" "u" ","
            "\"syn\":"
            "{"
                "\"sent\":%6$" "l" "u" ","
                "\"total\":%7$" "l" "u" ","
                "\"remaining\":%8$" "l" "u"
            "}"
        "}"
    "}\n";
    const char *json_fmt_running =
    "{"
        "\"state\":\"running\","
        "\"rate\":"
        "{"
            "\"kpps\":%.2f,"
            "\"pps\":%7$.2f"
        "},"
        "\"progress\":"
        "{"
            "\"percent\":%.2f,"
            "\"eta\":"
            "{"
                "\"hours\":%u,"
                "\"mins\":%u,"
                "\"seconds\":%u"
            "},"
            "\"syn\":"
            "{"
                "\"sent\":%8$" "l" "u" ","
                "\"total\":%9$" "l" "u" ","
                "\"remaining\":%10$" "l" "u"
            "},"
            "\"found\":%6$" "l" "u"
        "}"
    "}\n";
    global_now = time(0);
    now = (double)pixie_gettime();
    elapsed_time = (now - status->last.clock)/1000000.0;
    if (elapsed_time <= 0)
        return;
    rate = (count - status->last.count)*1.0/elapsed_time;
     status->last_rates[status->last_count++ & 0x7] = rate;
     rate = status->last_rates[0]
                + status->last_rates[1]
                + status->last_rates[2]
                + status->last_rates[3]
                + status->last_rates[4]
                + status->last_rates[5]
                + status->last_rates[6]
                + status->last_rates[7]
                ;
    rate /= 8;
    percent_done = (double)(count*100.0/max_count);
    time_remaining = (1.0 - percent_done/100.0) * (max_count / rate);
    if (total_tcbs) {
        current_tcbs = total_tcbs - status->total_tcbs;
        status->total_tcbs = total_tcbs;
        tcb_rate = (1.0*current_tcbs)/elapsed_time;
    }
    if (total_synacks) {
        current_synacks = total_synacks - status->total_synacks;
        status->total_synacks = total_synacks;
        synack_rate = (1.0*current_synacks)/elapsed_time;
    }
    if (total_syns) {
        current_syns = total_syns - status->total_syns;
        status->total_syns = total_syns;
        syn_rate = (1.0*current_syns)/elapsed_time;
    }
    if (status->is_infinite) {
        if (json_status == 1)
            fmt = json_fmt_infinite;
        else
            fmt = "rate:%6.2f-kpps, syn/s=%.0f ack/s=%.0f tcb-rate=%.0f, %" "l" "u" "-tcbs,         \r";
        fprintf(stderr,
            fmt,
                kpps,
                syn_rate,
                synack_rate,
                tcb_rate,
                total_tcbs,
                pps,
                count);
    } else {
        if (is_tx_done) {
            if (json_status == 1)
                fmt = json_fmt_waiting;
            else
                fmt = "rate:%6.2f-kpps, %5.2f%% done, waiting %d-secs, found=%" "l" "u" "       \r";
            fprintf(stderr,
                    fmt,
                    pps/1000.0,
                    percent_done,
                    (int)exiting,
                    total_synacks,
                    pps,
                    count,
                    max_count,
                    max_count-count);
        } else {
            if (json_status == 1)
                fmt = json_fmt_running;
            else
                fmt = "rate:%6.2f-kpps, %5.2f%% done,%4u:%02u:%02u remaining, found=%" "l" "u" "       \r";
            fprintf(stderr,
                fmt,
                pps/1000.0,
                percent_done,
                (unsigned)(time_remaining/60/60),
                (unsigned)(time_remaining/60)%60,
                (unsigned)(time_remaining)%60,
                total_synacks,
                pps,
                count,
                max_count,
                max_count-count);
        }
    }
    fflush(stderr);
    status->last.clock = now;
    status->last.count = count;
}

canonical_original_code:
void status_print(struct Status *status, unsigned long count, unsigned long max_count, double pps, unsigned long total_tcbs, unsigned long total_synacks, unsigned long total_syns, unsigned long exiting, _Bool json_status)
{
    double elapsed_time;
    double rate;
    double now;
    double percent_done;
    double time_remaining;
    unsigned long current_tcbs = 0;
    unsigned long current_synacks = 0;
    unsigned long current_syns = 0;
    double tcb_rate = 0.0;
    double synack_rate = 0.0;
    double syn_rate = 0.0;
    double kpps = pps / 1000;
    char *fmt;
    char *json_fmt_infinite = "{"
        "\"state\":\"*\","
        "\"rate\":"
        "{"
            "\"kpps\":%.2f,"
            "\"pps\":%6$.2f,"
            "\"synps\":%.0f,"
            "\"ackps\":%.0f,"
            "\"tcbps\":%.0f"
        "},"
        "\"tcb\":%5$" "l" "u" ","
        "\"syn\":%7$" "l" "u"
    "}\n";
    char *json_fmt_waiting = "{"
        "\"state\":\"waiting\","
        "\"rate\":"
        "{"
            "\"kpps\":%.2f,"
            "\"pps\":%5$.2f"
        "},"
        "\"progress\":"
        "{"
            "\"percent\":%.2f,"
            "\"seconds\":%d,"
            "\"found\":%" "l" "u" ","
            "\"syn\":"
            "{"
                "\"sent\":%6$" "l" "u" ","
                "\"total\":%7$" "l" "u" ","
                "\"remaining\":%8$" "l" "u"
            "}"
        "}"
    "}\n";
    char *json_fmt_running = "{"
        "\"state\":\"running\","
        "\"rate\":"
        "{"
            "\"kpps\":%.2f,"
            "\"pps\":%7$.2f"
        "},"
        "\"progress\":"
        "{"
            "\"percent\":%.2f,"
            "\"eta\":"
            "{"
                "\"hours\":%u,"
                "\"mins\":%u,"
                "\"seconds\":%u"
            "},"
            "\"syn\":"
            "{"
                "\"sent\":%8$" "l" "u" ","
                "\"total\":%9$" "l" "u" ","
                "\"remaining\":%10$" "l" "u"
            "},"
            "\"found\":%6$" "l" "u"
        "}"
    "}\n";
    global_now = time(0);
    now = (double)pixie_gettime();
    elapsed_time = (now - status->last.clock)/1000000.0;
    if (elapsed_time <= 0)
        return;
    rate = (count - status->last.count)*1.0/elapsed_time;
     status->last_rates[status->last_count++ & 0x7] = rate;
     rate = status->last_rates[0]
                + status->last_rates[1]
                + status->last_rates[2]
                + status->last_rates[3]
                + status->last_rates[4]
                + status->last_rates[5]
                + status->last_rates[6]
                + status->last_rates[7]
                ;
    rate /= 8;
    percent_done = (double)(count*100.0/max_count);
    time_remaining = (1.0 - percent_done/100.0) * (max_count / rate);
    if (total_tcbs) {
        current_tcbs = total_tcbs - status->total_tcbs;
        status->total_tcbs = total_tcbs;
        tcb_rate = (1.0*current_tcbs)/elapsed_time;
    }
    if (total_synacks) {
        current_synacks = total_synacks - status->total_synacks;
        status->total_synacks = total_synacks;
        synack_rate = (1.0*current_synacks)/elapsed_time;
    }
    if (total_syns) {
        current_syns = total_syns - status->total_syns;
        status->total_syns = total_syns;
        syn_rate = (1.0*current_syns)/elapsed_time;
    }
    if (status->is_infinite) {
        if (json_status == 1)
            fmt = json_fmt_infinite;
        else
            fmt = "rate:%6.2f-kpps, syn/s=%.0f ack/s=%.0f tcb-rate=%.0f, %" "l" "u" "-tcbs,         \r";
        fprintf(stderr,
            fmt,
                kpps,
                syn_rate,
                synack_rate,
                tcb_rate,
                total_tcbs,
                pps,
                count);
    } else {
        if (is_tx_done) {
            if (json_status == 1)
                fmt = json_fmt_waiting;
            else
                fmt = "rate:%6.2f-kpps, %5.2f%% done, waiting %d-secs, found=%" "l" "u" "       \r";
            fprintf(stderr,
                    fmt,
                    pps/1000.0,
                    percent_done,
                    (int)exiting,
                    total_synacks,
                    pps,
                    count,
                    max_count,
                    max_count-count);
        } else {
            if (json_status == 1)
                fmt = json_fmt_running;
            else
                fmt = "rate:%6.2f-kpps, %5.2f%% done,%4u:%02u:%02u remaining, found=%" "l" "u" "       \r";
            fprintf(stderr,
                fmt,
                pps/1000.0,
                percent_done,
                (unsigned int)(time_remaining/60/60),
                (unsigned int)(time_remaining/60)%60,
                (unsigned int)(time_remaining)%60,
                total_synacks,
                pps,
                count,
                max_count,
                max_count-count);
        }
    }
    fflush(stderr);
    status->last.clock = now;
    status->last.count = count;
}

variable_types: struct Status { struct { double clock; long time; unsigned long count; } last; unsigned long timer; unsigned int charcount; double last_rates[8]; unsigned int last_count; unsigned int is_infinite; unsigned long total_tcbs; unsigned long total_synacks; unsigned long total_syns; } *

variable_types:
count
unsigned long

variable_types: pps double

variable_types:
exiting
unsigned long

variable_types: rate double

variable_types: now double

variable_types: kpps double

variable_types:
fmt
char *


decompiled_code:
size_t status_finish()
{
return fwrite(
" \r",
1uLL,
0x4EuLL,
stderr);
}

canonical_decompiled_code:
size_t func1()
{
return fwrite(
" \r",
1uLL,
0x4EuLL,
stderr);
}

original_code:
void
status_finish(struct Status *status)
{
    (void) status;
    fprintf(stderr,
"                                                                             \r");
}

user_defined_types: struct Status { struct { double clock; long time; unsigned long count; } last; unsigned long timer; unsigned int charcount; double last_rates[8]; unsigned int last_count; unsigned int is_infinite; unsigned long total_tcbs; unsigned long total_synacks; unsigned long total_syns; }


decompiled_code:
time_t __fastcall status_start(__int64 a1)
{
__int64 v2; // rdi
time_t result; // rax

v2 = a1 + 8;
*(_QWORD *)(v2 - 8) = 0LL;
*(_QWORD *)(v2 + 120) = 0LL;
memset(
(void *)(v2 & 0xFFFFFFFFFFFFFFF8LL),
0,
8 * ((unsigned __int64)((unsigned int)a1 - (v2 & 0xFFFFFFF8) + 136) >> 3));
*(double *)a1 = (double)(int)clock();
result = time(0LL);
*(_QWORD *)(a1 + 16) = 0LL;
*(_QWORD *)(a1 + 8) = result;
*(_QWORD *)(a1 + 24) = 1LL;
return result;
}

canonical_decompiled_code:
time_t __fastcall func2(__int64 a1)
{
__int64 v2; // rdi
time_t result; // rax

v2 = a1 + 8;
*(_QWORD *)(v2 - 8) = 0LL;
*(_QWORD *)(v2 + 120) = 0LL;
memset(
(void *)(v2 & 0xFFFFFFFFFFFFFFF8LL),
0,
8 * ((unsigned __int64)((unsigned int)a1 - (v2 & 0xFFFFFFF8) + 136) >> 3));
*(double *)a1 = (double)(int)clock();
result = time(0LL);
*(_QWORD *)(a1 + 16) = 0LL;
*(_QWORD *)(a1 + 8) = result;
*(_QWORD *)(a1 + 24) = 1LL;
return result;
}

original_code:
void
status_start(struct Status *status)
{
    memset(status, 0, sizeof(*status));
    status->last.clock = clock();
    status->last.time = time(0);
    status->last.count = 0;
    status->timer = 0x1;
}


decompiled_code:
void __noreturn handle_segfault()
{
int v0; // eax
__int64 v1; // rbp
char **v2; // rax
char **v3; // r12
const char *v4; // r13
char *v5; // rax
const char *v6; // rbx
unsigned int v7; // eax
char v8[1024]; // [rsp+0h] [rbp-C28h] BYREF
void *array[261]; // [rsp+400h] [rbp-828h] BYREF

puts("======================================================================");
puts(" Segmentation fault: please post this backtrace to:");
puts(" https://github.com/robertdavidgraham/masscan/issues");
puts("======================================================================");
v0 = backtrace(array, 256);
v1 = v0;
v2 = backtrace_symbols(array, v0);
if ( (int)v1 > 0 )
{
v3 = v2;
do
{
v4 = v3[v1 - 1];
printf("%d: [%s]\n", (unsigned int)v1, v4);
v5 = strstr(v4, "[0x");
if ( v5 )
{
v6 = v5 + 1;
v7 = (unsigned int)strchr(v5 + 1, 93);
snprintf(v8, 0x400uLL, "addr2line -p -i -f -e %s %.*s", global_self, v7 - (_DWORD)v6, v6);
if ( system(v8) == -1 )
puts("(addr2line missing)");
}
--v1;
}
while ( (int)v1 > 0 );
}
exit(1);
}

canonical_decompiled_code:
void __noreturn func0()
{
int v0; // eax
__int64 v1; // rbp
char **v2; // rax
char **v3; // r12
const char *v4; // r13
char *v5; // rax
const char *v6; // rbx
unsigned int v7; // eax
char v8[1024]; // [rsp+0h] [rbp-C28h] BYREF
void *array[261]; // [rsp+400h] [rbp-828h] BYREF

puts("======================================================================");
puts(" Segmentation fault: please post this backtrace to:");
puts(" https://github.com/robertdavidgraham/masscan/issues");
puts("======================================================================");
v0 = backtrace(array, 256);
v1 = v0;
v2 = backtrace_symbols(array, v0);
if ( (int)v1 > 0 )
{
v3 = v2;
do
{
v4 = v3[v1 - 1];
printf("%d: [%s]\n", (unsigned int)v1, v4);
v5 = strstr(v4, "[0x");
if ( v5 )
{
v6 = v5 + 1;
v7 = (unsigned int)strchr(v5 + 1, 93);
snprintf(v8, 0x400uLL, "addr2line -p -i -f -e %s %.*s", global_self, v7 - (_DWORD)v6, v6);
if ( system(v8) == -1 )
puts("(addr2line missing)");
}
--v1;
}
while ( (int)v1 > 0 );
}
exit(1);
}

original_code:
static void
handle_segfault(int sig)
{
 void *func[256];
 char **symb = ((void *)0);
 int size;
    printf("======================================================================\n");
    printf(" Segmentation fault: please post this backtrace to:\n");
    printf(" https://github.com/robertdavidgraham/masscan/issues\n");
    printf("======================================================================\n");
 size = backtrace(func, 256);
 symb = backtrace_symbols(func, size);
 while (size > 0) {
        const char *symbol = symb[size - 1];
        char foo[1024];
  printf("%d: [%s]\n", size, symbol);
        if (strstr(symbol, "[0x")) {
            char *p = strstr(symbol, "[0x") + 1;
            char *pp = strchr(p, ']');
            snprintf(foo, sizeof(foo), "addr2line -p -i -f -e %s %.*s",
                global_self,
                (unsigned)(pp-p),
                p);
            if (system(foo) == -1)
                printf("(addr2line missing)\n");
        }
  size --;
 }
    exit(1);
    return;
}

canonical_original_code:
static void handle_segfault(int sig)
{
 void *func[256];
 char **symb = ((void *)0);
 int size;
    printf("======================================================================\n");
    printf(" Segmentation fault: please post this backtrace to:\n");
    printf(" https://github.com/robertdavidgraham/masscan/issues\n");
    printf("======================================================================\n");
 size = backtrace(func, 256);
 symb = backtrace_symbols(func, size);
 while (size > 0) {
        char *symbol = symb[size - 1];
        char foo[1024];
  printf("%d: [%s]\n", size, symbol);
        if (strstr(symbol, "[0x")) {
            char *p = strstr(symbol, "[0x") + 1;
            char *pp = strchr(p, ']');
            snprintf(foo, sizeof(foo), "addr2line -p -i -f -e %s %.*s",
                global_self,
                (unsigned int)(pp-p),
                p);
            if (system(foo) == -1)
                printf("(addr2line missing)\n");
        }
  size --;
 }
    exit(1);
    return;
}

variable_types: sig int

variable_types:
func
void *[256]

variable_types:
symb
char **

variable_types: size int

variable_types:
symbol
char *

variable_types:
foo
char [1024]

variable_types:
p
char *

variable_types:
pp
char *


decompiled_code:
void pixie_backtrace_finish()
{
;
}

canonical_decompiled_code:
void func1()
{
;
}

original_code:
void
pixie_backtrace_finish(void)
{
}

canonical_original_code:
void pixie_backtrace_finish()
{
}


decompiled_code:
__sighandler_t __fastcall pixie_backtrace_init(const char *a1)
{
if ( readlink("/proc/self/exe", global_self, 0x200uLL) == -1 )
snprintf(global_self, 0x200uLL, "%s", a1);
return signal(11, (__sighandler_t)handle_segfault);
}

canonical_decompiled_code:
__sighandler_t __fastcall func2(const char *a1)
{
if ( readlink("/proc/self/exe", global_self, 0x200uLL) == -1 )
snprintf(global_self, 0x200uLL, "%s", a1);
return signal(11, (__sighandler_t)handle_segfault);
}

original_code:
void
pixie_backtrace_init(const char *self)
{
    ssize_t x;
    x = readlink("/proc/self/exe", global_self, sizeof(global_self));
    if (x == -1)
        snprintf(global_self, sizeof(global_self), "%s", self);
    signal(11, handle_segfault);
}

canonical_original_code:
void pixie_backtrace_init(char *self)
{
    long x;
    x = readlink("/proc/self/exe", global_self, sizeof(global_self));
    if (x == -1)
        snprintf(global_self, sizeof(global_self), "%s", self);
    signal(11, handle_segfault);
}

variable_types:
self
char *

variable_types: x long


decompiled_code:
__int64 __fastcall preprocess_frame(__int64 a1, unsigned int a2, unsigned int a3, __int64 a4)
{
unsigned int v4; // eax
__int64 v5; // r8
char *v6; // rax
unsigned int v7; // er8
int v9; // er8
unsigned int v10; // edx
__int64 v11; // rax
unsigned int i; // edx
unsigned int v13; // edx
int v14; // er10
int v15; // er11
int v16; // er9
int v17; // er9
__int64 v18; // r10
int v19; // esi
int v20; // er8
unsigned int v21; // edx
int v22; // esi
int v23; // er8
int v24; // edx
unsigned int v25; // eax
char v26; // al
__int64 v27; // r9
unsigned int v28; // edx
int v29; // er8
unsigned int v30; // ebx
unsigned int v31; // er10
__int64 v32; // rbp
__int64 v33; // r11
int v34; // esi
int v35; // er12
int v36; // esi
int v37; // esi
int v38; // er8
__int64 v39; // rbx
__int64 v40; // r11
unsigned int v41; // esi
unsigned __int64 v42; // rdx
__int64 v43; // rbx
unsigned __int64 v44; // rdx
__int64 v45; // r11
__int64 v46; // rax
unsigned int v47; // eax
__int16 v48; // dx
int v49; // edx
__int64 v50; // r8
unsigned int v51; // er10
unsigned int v52; // eax
int v53; // edx
char v54; // r11
_BYTE *v55; // rax
__int64 v56; // r10
char v57; // dl
__int16 v58; // dx
int v59; // eax
unsigned int v60; // er10
__int16 v61; // dx
int v62; // eax
unsigned __int16 v63; // dx
__int16 v64; // si
unsigned __int16 v65; // si
int v66; // eax
int v67; // edx
__int64 v68; // rax

*(_DWORD *)(a4 + 112) = 0;
*(_QWORD *)(a4 + 136) = 0LL;
if ( a3 == 1 )
{
if ( a2 <= 0xD )
return 0;
*(_QWORD *)(a4 + 8) = a1;
*(_DWORD *)(a4 + 136) = 1;
*(_QWORD *)a4 = a1 + 6;
i = (unsigned __int16)__ROL2__(*(_WORD *)(a1 + 12), 8);
if ( (unsigned __int16)i > 0x7CFu )
{
if ( i != 2048 )
{
v11 = 14LL;
goto LABEL_30;
}
v10 = 34;
LODWORD(v11) = 14;
goto LABEL_48;
}
v51 = 17;
v52 = 14;
}
else
{
if ( a3 == 113 )
{
if ( a2 > 0xF )
{
*(_DWORD *)(a4 + 136) = 18;
i = 0;
v11 = 16LL;
goto LABEL_30;
}
return 0;
}
if ( a3 > 0x71 )
{
if ( a3 == 119 )
{
if ( a2 <= 7 )
return 0;
*(_DWORD *)(a4 + 136) = 15;
if ( *(_DWORD *)a1 != 68 )
return 0;
v25 = 0xFFFFF;
LODWORD(v5) = *(_DWORD *)(a1 + 4);
if ( a2 <= 0xFFFFF )
v25 = a2;
if ( v25 < (unsigned int)v5 )
return 0;
}
else
{
if ( a3 != 127 )
return 0;
if ( a2 <= 7 )
return 0;
*(_DWORD *)(a4 + 136) = 14;
if ( *(_BYTE *)a1 )
return 0;
v5 = *(unsigned __int16 *)(a1 + 2);
if ( a2 < (unsigned int)v5 )
return 0;
if ( (*(_BYTE *)(a1 + 5) & 0x40) != 0 && *(_DWORD *)(a1 + a2 - 4) == *(_DWORD *)(a1 + v5 - 4) )
{
a2 -= 4;
if ( (unsigned int)v5 > a2 )
return 0;
}
}
v4 = v5 + 2;
}
else
{
if ( a3 == 12 )
{
v26 = *(_BYTE *)a1 >> 4;
if ( v26 == 4 )
{
v10 = 20;
LODWORD(v11) = 0;
goto LABEL_48;
}
if ( v26 != 6 )
return 0;
v27 = 40LL;
LODWORD(v11) = 0;
goto LABEL_65;
}
v4 = 2;
LODWORD(v5) = 0;
if ( a3 != 105 )
{
if ( a3 )
return 0;
v9 = _byteswap_ulong(*(_DWORD *)a1);
if ( v9 == 0x2000000 )
{
v10 = 24;
LODWORD(v11) = 4;
goto LABEL_48;
}
if ( v9 > 0x2000000 )
{
if ( v9 != 503316480 && (v9 & 0xFBFFFFFF) != 402653184 )
return 0;
}
else if ( v9 != 24 )
{
if ( v9 <= 24 )
{
v10 = 24;
LODWORD(v11) = 4;
if ( v9 != 2 )
return 0;
goto LABEL_48;
}
if ( (v9 & 0xFFFFFFFD) != 28 )
return 0;
}
v27 = 44LL;
LODWORD(v11) = 4;
LABEL_65:
*(_DWORD *)(a4 + 24) = v11;
if ( a2 < (unsigned int)v27 )
return 0;
*(_DWORD *)(a4 + 140) = v11;
*(_DWORD *)(a4 + 136) = 3;
if ( *(_BYTE *)(a1 + (unsigned int)v11) >> 4 != 6 )
return 0;
v38 = (unsigned __int16)__ROL2__(*(_WORD *)(a1 + (unsigned int)v11 + 4), 8);
v31 = (unsigned __int16)v38 + (_DWORD)v27;
if ( v31 > a2 )
return 0;
v39 = (unsigned int)v11 + 8LL;
v40 = (unsigned int)v11 + 24LL;
*(_DWORD *)(a4 + 28) = 6;
*(_QWORD *)(a4 + 48) = a1 + v39;
*(_QWORD *)(a4 + 56) = a1 + v40;
v41 = *(unsigned __int8 *)(a1 + (unsigned int)(v11 + 6));
*(_BYTE *)(a4 + 80) = 6;
*(_DWORD *)(a4 + 32) = v41;
*(_QWORD *)(a4 + 64) = ((unsigned __int64)*(unsigned __int8 *)(a1 + (unsigned int)v39) << 56) | ((unsigned __int64)*(unsigned __int8 *)(a1 + (unsigned int)(v11 + 14)) << 8) | ((unsigned __int64)*(unsigned __int8 *)(a1 + (unsigned int)(v11 + 13)) << 16) | ((unsigned __int64)*(unsigned __int8 *)(a1 + (unsigned int)(v11 + 12)) << 24) | ((unsigned __int64)*(unsigned __int8 *)(a1 + (unsigned int)(v11 + 11)) << 32) | *(unsigned __int8 *)(a1 + (unsigned int)(v11 + 15)) | ((unsigned __int64)*(unsigned __int8 *)(a1 + (unsigned int)(v11 + 10)) << 40) | ((unsigned __int64)*(unsigned __int8 *)(a1 + (unsigned int)(v11 + 9)) << 48);
v42 = ((unsigned __int64)*(unsigned __int8 *)(a1 + (unsigned int)(v11 + 21)) << 16) | ((unsigned __int64)*(unsigned __int8 *)(a1 + (unsigned int)(v11 + 20)) << 24) | ((unsigned __int64)*(unsigned __int8 *)(a1 + (unsigned int)(v11 + 19)) << 32) | ((unsigned __int64)*(unsigned __int8 *)(a1 + (unsigned int)(v11 + 18)) << 40) | *(unsigned __int8 *)(a1 + (unsigned int)(v11 + 23)) | ((unsigned __int64)*(unsigned __int8 *)(a1 + (unsigned int)(v11 + 17)) << 48) | ((unsigned __int64)*(unsigned __int8 *)(a1 + (unsigned int)(v11 + 16)) << 56);
v43 = *(unsigned __int8 *)(a1 + (unsigned int)(v11 + 22));
*(_BYTE *)(a4 + 104) = 6;
*(_QWORD *)(a4 + 72) = (v43 << 8) | v42;
*(_QWORD *)(a4 + 88) = ((unsigned __int64)*(unsigned __int8 *)(a1 + (unsigned int)v40) << 56) | ((unsigned __int64)*(unsigned __int8 *)(a1 + (unsigned int)(v11 + 30)) << 8) | ((unsigned __int64)*(unsigned __int8 *)(a1 + (unsigned int)(v11 + 29)) << 16) | ((unsigned __int64)*(unsigned __int8 *)(a1 + (unsigned int)(v11 + 28)) << 24) | ((unsigned __int64)*(unsigned __int8 *)(a1 + (unsigned int)(v11 + 27)) << 32) | *(unsigned __int8 *)(a1 + (unsigned int)(v11 + 31)) | ((unsigned __int64)*(unsigned __int8 *)(a1 + (unsigned int)(v11 + 26)) << 40) | ((unsigned __int64)*(unsigned __int8 *)(a1 + (unsigned int)(v11 + 25)) << 48);
v44 = ((unsigned __int64)*(unsigned __int8 *)(a1 + (unsigned int)(v11 + 36)) << 24) | ((unsigned __int64)*(unsigned __int8 *)(a1 + (unsigned int)(v11 + 35)) << 32) | ((unsigned __int64)*(unsigned __int8 *)(a1 + (unsigned int)(v11 + 34)) << 40) | *(unsigned __int8 *)(a1 + (unsigned int)(v11 + 39)) | ((unsigned __int64)*(unsigned __int8 *)(a1 + (unsigned int)(v11 + 33)) << 48) | ((unsigned __int64)*(unsigned __int8 *)(a1 + (unsigned int)(v11 + 32)) << 56);
v45 = *(unsigned __int8 *)(a1 + (unsigned int)(v11 + 37));
v46 = *(unsigned __int8 *)(a1 + (unsigned int)(v11 + 38));
*(_DWORD *)(a4 + 112) = v27;
*(_DWORD *)(a4 + 116) = v38;
*(_QWORD *)(a4 + 96) = (v45 << 16) | v44 | (v46 << 8);
while ( v41 != 17 )
{
if ( v41 > 0x11 )
{
if ( v41 != 58 )
{
if ( v41 != 132 )
return 0;
goto LABEL_112;
}
if ( v31 < (int)v27 + 4 )
return 0;
*(_DWORD *)(a4 + 140) = v27;
*(_DWORD *)(a4 + 136) = 4;
v66 = *(unsigned __int8 *)(a1 + (unsigned int)v27);
v67 = *(unsigned __int8 *)(a1 + (unsigned int)(v27 + 1));
*(_DWORD *)(a4 + 120) = v66;
*(_DWORD *)(a4 + 124) = v67;
if ( (unsigned int)(v66 - 133) <= 3 )
{
*(_DWORD *)(a4 + 136) = 21;
return 1;
}
return 1;
}
if ( v41 )
{
if ( v41 != 6 )
return 0;
goto LABEL_73;
}
if ( v31 < (int)v27 + 8 )
return 0;
*(_DWORD *)(a4 + 140) = v27;
*(_DWORD *)(a4 + 136) = 9;
v41 = *(unsigned __int8 *)(a1 + (unsigned int)v27);
*(_DWORD *)(a4 + 32) = v41;
v27 = (unsigned int)v27 + *(unsigned __int8 *)(a1 + (unsigned int)(v27 + 1)) + 8;
if ( v31 < (unsigned int)v27 )
return 0;
*(_DWORD *)(a4 + 112) = v27;
*(_DWORD *)(a4 + 116) = v31 - v27;
}
goto LABEL_120;
}
}
if ( a2 < v4 )
return 0;
*(_DWORD *)(a4 + 140) = v5;
*(_DWORD *)(a4 + 136) = 13;
v6 = (char *)(a1 + (unsigned int)v5);
if ( (*v6 & 0x7F) != 8 || (*(_BYTE *)(a1 + 1) & 0x40) != 0 || (int)v5 + 24 > a2 )
return 0;
*(_DWORD *)(a4 + 136) = 12;
v54 = *v6;
v55 = (_BYTE *)(a1 + (unsigned int)(v5 + 1));
v56 = a1 + (unsigned int)(v5 + 16);
v57 = *v55 & 3;
if ( v57 == 1 )
{
*(_QWORD *)(a4 + 8) = v56;
*(_QWORD *)(a4 + 16) = a1 + (unsigned int)(v5 + 4);
*(_QWORD *)a4 = a1 + (unsigned int)(v5 + 10);
}
else if ( v57 == 3 )
{
*(_QWORD *)(a4 + 16) = &unk_D40;
*(_QWORD *)(a4 + 8) = v56;
*(_QWORD *)a4 = a1 + (unsigned int)(v5 + 24);
v68 = (unsigned int)(v5 + 7);
LODWORD(v5) = v5 + 6;
v55 = (_BYTE *)(a1 + v68);
}
else
{
*(_QWORD *)a4 = v56;
*(_QWORD *)(a4 + 8) = a1 + (unsigned int)(v5 + 4);
*(_QWORD *)(a4 + 16) = a1 + (unsigned int)(v5 + 10);
}
if ( (*v55 & 4) != 0 || (*(_BYTE *)(a1 + (unsigned int)(v5 + 22)) & 0xF) != 0 )
return 0;
if ( v54 == -120 )
{
v52 = v5 + 26;
v51 = v5 + 29;
}
else
{
v52 = v5 + 24;
v51 = v5 + 27;
}
}
if ( a2 < v51 )
return 0;
while ( 1 )
{
*(_DWORD *)(a4 + 140) = v52;
*(_DWORD *)(a4 + 136) = 16;
v53 = *(unsigned __int8 *)(a1 + v52 + 2) | (*(unsigned __int8 *)(a1 + v52 + 1) << 8) | (*(unsigned __int8 *)(a1 + v52) << 16);
if ( v53 != 170 )
break;
v51 = v52 + 5;
if ( v52 + 5 > a2 )
return 0;
v52 += 2;
}
if ( v53 != 11184643 )
return 0;
v11 = v52 + 8;
if ( (unsigned int)v11 > a2 )
return 0;
*(_DWORD *)(a4 + 140) = v51;
if ( *(unsigned __int8 *)(a1 + v51 + 2) | (*(unsigned __int8 *)(a1 + v51 + 1) << 8) | (*(unsigned __int8 *)(a1 + v51) << 16) )
return 0;
LABEL_30:
for ( i = (unsigned __int16)__ROL2__(*(_WORD *)(a1 + v51 + 3), 8); i == 33024; i = (unsigned __int16)__ROL2__(v58, 8) )
{
if ( (int)v11 + 4 > a2 )
return 0;
*(_DWORD *)(a4 + 140) = v11;
*(_DWORD *)(a4 + 136) = 10;
v58 = *(_WORD *)(a1 + v11 + 2);
v11 = (unsigned int)(v11 + 4);
}
if ( i > 0x8100 )
{
if ( i != 34525 )
{
if ( i != 34887 )
return 0;
do
{
v49 = v11;
LODWORD(v11) = v11 + 4;
}
while ( (unsigned int)v11 < a2 && (*(_BYTE *)(a1 + (unsigned int)(v49 + 2)) & 1) == 0 );
if ( (unsigned int)v11 > a2 )
return 0;
v50 = (unsigned int)(v49 + 2);
*(_DWORD *)(a4 + 140) = v49;
v10 = v49 + 24;
*(_DWORD *)(a4 + 136) = 11;
if ( (*(_BYTE *)(a1 + v50) & 1) == 0 )
return 0;
goto LABEL_48;
}
v27 = (unsigned int)(v11 + 40);
goto LABEL_65;
}
if ( i != 2048 )
{
if ( i == 2054 )
{
v13 = v11 + 8;
*(_DWORD *)(a4 + 28) = 256;
*(_DWORD *)(a4 + 24) = v11;
if ( (int)v11 + 8 <= a2 )
{
*(_DWORD *)(a4 + 140) = v11;
*(_DWORD *)(a4 + 136) = 17;
v14 = *(unsigned __int8 *)(a1 + (unsigned int)(v11 + 4));
v15 = *(unsigned __int8 *)(a1 + (unsigned int)(v11 + 5));
v16 = *(unsigned __int8 *)(a1 + (unsigned int)(v11 + 7)) | (*(unsigned __int8 *)(a1 + (unsigned int)(v11 + 6)) << 8);
*(_DWORD *)(a4 + 120) = v16;
*(_DWORD *)(a4 + 32) = v16;
if ( v13 + 2 * (v14 + v15) <= a2 )
{
v17 = 2 * v14;
*(_DWORD *)(a4 + 140) = v13;
*(_BYTE *)(a4 + 80) = 4;
*(_QWORD *)(a4 + 48) = a1 + v13 + (unsigned __int64)(unsigned __int8)v14;
*(_QWORD *)(a4 + 56) = a1 + (unsigned int)(2 * v14) + v13 + (unsigned __int64)(unsigned __int8)v15;
v18 = v14 + v13;
v19 = (*(unsigned __int8 *)(a1 + (unsigned int)(v18 + 1)) << 16) | *(unsigned __int8 *)(a1
+ (unsigned int)(v18 + 3)) | (*(unsigned __int8 *)(a1 + v18) << 24);
v20 = *(unsigned __int8 *)(a1 + (unsigned int)(v18 + 2));
*(_BYTE *)(a4 + 104) = 4;
*(_DWORD *)(a4 + 64) = (v20 << 8) | v19;
v21 = v15 + v13 + v17;
v22 = *(unsigned __int8 *)(a1 + v21 + 3) | (*(unsigned __int8 *)(a1 + v21) << 24);
v23 = *(unsigned __int8 *)(a1 + v21 + 1);
v24 = *(unsigned __int8 *)(a1 + v21 + 2);
*(_DWORD *)(a4 + 140) = v11;
*(_DWORD *)(a4 + 88) = (v23 << 16) | v22 | (v24 << 8);
return 1;
}
}
}
return 0;
}
v10 = v11 + 20;
LABEL_48:
*(_DWORD *)(a4 + 24) = v11;
if ( a2 < v10 )
return 0;
*(_DWORD *)(a4 + 140) = v11;
*(_DWORD *)(a4 + 136) = 2;
if ( *(_BYTE *)(a1 + (unsigned int)v11) >> 4 != 4 )
return 0;
v28 = 4 * (*(_BYTE *)(a1 + (unsigned int)v11) & 0xF);
v27 = (unsigned int)v11 + v28;
if ( (unsigned int)v27 > a2 )
return 0;
v29 = *(unsigned __int16 *)(a1 + (unsigned int)v11 + 6);
LOWORD(v29) = __ROL2__(v29, 8);
v7 = (8 * v29) & 0x1FFF8;
if ( v7 )
return 0;
if ( (*(_BYTE *)(a1 + (unsigned int)(v11 + 6)) & 0x20) != 0 )
return 0;
v30 = (unsigned __int16)__ROL2__(*(_WORD *)(a1 + (unsigned int)v11 + 2), 8);
v31 = v11 + (unsigned __int16)v30;
if ( v31 > a2 || v28 > v30 )
return 0;
v32 = (unsigned int)v11 + 12LL;
v33 = (unsigned int)v11 + 16LL;
*(_DWORD *)(a4 + 28) = 4;
*(_QWORD *)(a4 + 48) = a1 + v32;
*(_QWORD *)(a4 + 56) = a1 + v33;
LODWORD(v32) = *(unsigned __int8 *)(a1 + (unsigned int)v32) << 24;
v34 = (*(unsigned __int8 *)(a1 + (unsigned int)(v11 + 14)) << 8) | (*(unsigned __int8 *)(a1 + (unsigned int)(v11 + 13)) << 16);
v35 = *(unsigned __int8 *)(a1 + (unsigned int)(v11 + 15));
*(_BYTE *)(a4 + 80) = 4;
*(_DWORD *)(a4 + 64) = v32 | v35 | v34;
LODWORD(v33) = *(unsigned __int8 *)(a1 + (unsigned int)v33) << 24;
v36 = (*(unsigned __int8 *)(a1 + (unsigned int)(v11 + 18)) << 8) | (*(unsigned __int8 *)(a1 + (unsigned int)(v11 + 17)) << 16);
LODWORD(v32) = *(unsigned __int8 *)(a1 + (unsigned int)(v11 + 19));
*(_BYTE *)(a4 + 104) = 4;
*(_DWORD *)(a4 + 88) = v33 | v32 | v36;
*(_DWORD *)(a4 + 40) = *(unsigned __int8 *)(a1 + (unsigned int)(v11 + 8));
v37 = *(unsigned __int8 *)(a1 + (unsigned int)(v11 + 9));
*(_DWORD *)(a4 + 36) = v30;
*(_DWORD *)(a4 + 32) = v37;
*(_DWORD *)(a4 + 112) = v27;
*(_DWORD *)(a4 + 116) = v30 - v28;
if ( (_BYTE)v37 == 6 )
{
LABEL_73:
if ( (int)v27 + 20 <= v31 )
{
*(_DWORD *)(a4 + 140) = v27;
*(_DWORD *)(a4 + 136) = 5;
v47 = v27 + (*(_BYTE *)(a1 + (unsigned int)(v27 + 12)) >> 2);
if ( v47 <= v31 )
{
v7 = 1;
*(_DWORD *)(a4 + 120) = (unsigned __int16)__ROL2__(*(_WORD *)(a1 + v27), 8);
v48 = *(_WORD *)(a1 + v27 + 2);
*(_DWORD *)(a4 + 128) = v47;
*(_DWORD *)(a4 + 132) = v31 - v47;
*(_DWORD *)(a4 + 124) = (unsigned __int16)__ROL2__(v48, 8);
return v7;
}
}
return 0;
}
if ( (unsigned __int8)v37 <= 6u )
{
if ( (_BYTE)v37 == 1 )
{
if ( v31 >= (int)v27 + 4 )
{
*(_DWORD *)(a4 + 140) = v27;
v7 = 1;
*(_DWORD *)(a4 + 136) = 4;
*(_DWORD *)(a4 + 120) = *(unsigned __int8 *)(a1 + (unsigned int)v27);
*(_DWORD *)(a4 + 124) = *(unsigned __int8 *)(a1 + (unsigned int)(v27 + 1));
return v7;
}
return 0;
}
if ( (_BYTE)v37 == 2 )
{
if ( v31 >= (int)v27 + 4 )
{
*(_DWORD *)(a4 + 140) = v27;
v7 = 1;
*(_DWORD *)(a4 + 136) = 20;
*(_DWORD *)(a4 + 120) = 0;
*(_DWORD *)(a4 + 124) = *(unsigned __int8 *)(a1 + v27);
return v7;
}
return 0;
}
LABEL_118:
if ( (unsigned int)v27 <= v31 )
{
*(_DWORD *)(a4 + 140) = v27;
*(_DWORD *)(a4 + 136) = 19;
return v7;
}
return 0;
}
if ( (_BYTE)v37 == 17 )
{
LABEL_120:
v62 = v27 + 8;
if ( (int)v27 + 8 <= v31 )
{
*(_DWORD *)(a4 + 140) = v27;
*(_DWORD *)(a4 + 136) = 6;
v63 = __ROL2__(*(_WORD *)(a1 + (unsigned int)v27), 8);
*(_DWORD *)(a4 + 120) = v63;
v64 = *(_WORD *)(a1 + (unsigned int)v27 + 2);
*(_DWORD *)(a4 + 128) = v62;
v65 = __ROL2__(v64, 8);
*(_DWORD *)(a4 + 124) = v65;
*(_DWORD *)(a4 + 132) = v31 - v62;
if ( v31 - v62 > 0x7CF )
_assert_fail("info->app_length < 2000", "src/proto-preprocess.c", 0xAEu, "preprocess_frame");
if ( v65 != 53 && v63 != 53 )
return 1;
if ( (int)v27 + 16 <= v31 )
{
*(_DWORD *)(a4 + 140) = v62;
v7 = 1;
*(_DWORD *)(a4 + 136) = 8;
return v7;
}
}
return 0;
}
if ( (_BYTE)v37 != 0x84 )
goto LABEL_118;
LABEL_112:
v59 = v27 + 12;
if ( (int)v27 + 12 <= v31 )
{
*(_DWORD *)(a4 + 140) = v27;
v60 = v31 - v59;
*(_DWORD *)(a4 + 136) = 7;
*(_DWORD *)(a4 + 120) = (unsigned __int16)__ROL2__(*(_WORD *)(a1 + v27), 8);
v61 = *(_WORD *)(a1 + v27 + 2);
*(_DWORD *)(a4 + 128) = v59;
*(_DWORD *)(a4 + 132) = v60;
*(_DWORD *)(a4 + 124) = (unsigned __int16)__ROL2__(v61, 8);
if ( v60 > 0x7CF )
_assert_fail("info->app_length < 2000", "src/proto-preprocess.c", 0xCDu, "preprocess_frame");
return 1;
}
return 0;
}

canonical_decompiled_code:
__int64 __fastcall func0(__int64 a1, unsigned int a2, unsigned int a3, __int64 a4)
{
unsigned int v4; // eax
__int64 v5; // r8
char *v6; // rax
unsigned int v7; // er8
int v9; // er8
unsigned int v10; // edx
__int64 v11; // rax
unsigned int i; // edx
unsigned int v13; // edx
int v14; // er10
int v15; // er11
int v16; // er9
int v17; // er9
__int64 v18; // r10
int v19; // esi
int v20; // er8
unsigned int v21; // edx
int v22; // esi
int v23; // er8
int v24; // edx
unsigned int v25; // eax
char v26; // al
__int64 v27; // r9
unsigned int v28; // edx
int v29; // er8
unsigned int v30; // ebx
unsigned int v31; // er10
__int64 v32; // rbp
__int64 v33; // r11
int v34; // esi
int v35; // er12
int v36; // esi
int v37; // esi
int v38; // er8
__int64 v39; // rbx
__int64 v40; // r11
unsigned int v41; // esi
unsigned __int64 v42; // rdx
__int64 v43; // rbx
unsigned __int64 v44; // rdx
__int64 v45; // r11
__int64 v46; // rax
unsigned int v47; // eax
__int16 v48; // dx
int v49; // edx
__int64 v50; // r8
unsigned int v51; // er10
unsigned int v52; // eax
int v53; // edx
char v54; // r11
_BYTE *v55; // rax
__int64 v56; // r10
char v57; // dl
__int16 v58; // dx
int v59; // eax
unsigned int v60; // er10
__int16 v61; // dx
int v62; // eax
unsigned __int16 v63; // dx
__int16 v64; // si
unsigned __int16 v65; // si
int v66; // eax
int v67; // edx
__int64 v68; // rax

*(_DWORD *)(a4 + 112) = 0;
*(_QWORD *)(a4 + 136) = 0LL;
if ( a3 == 1 )
{
if ( a2 <= 0xD )
return 0;
*(_QWORD *)(a4 + 8) = a1;
*(_DWORD *)(a4 + 136) = 1;
*(_QWORD *)a4 = a1 + 6;
i = (unsigned __int16)__ROL2__(*(_WORD *)(a1 + 12), 8);
if ( (unsigned __int16)i > 0x7CFu )
{
if ( i != 2048 )
{
v11 = 14LL;
goto LABEL_30;
}
v10 = 34;
LODWORD(v11) = 14;
goto LABEL_48;
}
v51 = 17;
v52 = 14;
}
else
{
if ( a3 == 113 )
{
if ( a2 > 0xF )
{
*(_DWORD *)(a4 + 136) = 18;
i = 0;
v11 = 16LL;
goto LABEL_30;
}
return 0;
}
if ( a3 > 0x71 )
{
if ( a3 == 119 )
{
if ( a2 <= 7 )
return 0;
*(_DWORD *)(a4 + 136) = 15;
if ( *(_DWORD *)a1 != 68 )
return 0;
v25 = 0xFFFFF;
LODWORD(v5) = *(_DWORD *)(a1 + 4);
if ( a2 <= 0xFFFFF )
v25 = a2;
if ( v25 < (unsigned int)v5 )
return 0;
}
else
{
if ( a3 != 127 )
return 0;
if ( a2 <= 7 )
return 0;
*(_DWORD *)(a4 + 136) = 14;
if ( *(_BYTE *)a1 )
return 0;
v5 = *(unsigned __int16 *)(a1 + 2);
if ( a2 < (unsigned int)v5 )
return 0;
if ( (*(_BYTE *)(a1 + 5) & 0x40) != 0 && *(_DWORD *)(a1 + a2 - 4) == *(_DWORD *)(a1 + v5 - 4) )
{
a2 -= 4;
if ( (unsigned int)v5 > a2 )
return 0;
}
}
v4 = v5 + 2;
}
else
{
if ( a3 == 12 )
{
v26 = *(_BYTE *)a1 >> 4;
if ( v26 == 4 )
{
v10 = 20;
LODWORD(v11) = 0;
goto LABEL_48;
}
if ( v26 != 6 )
return 0;
v27 = 40LL;
LODWORD(v11) = 0;
goto LABEL_65;
}
v4 = 2;
LODWORD(v5) = 0;
if ( a3 != 105 )
{
if ( a3 )
return 0;
v9 = _byteswap_ulong(*(_DWORD *)a1);
if ( v9 == 0x2000000 )
{
v10 = 24;
LODWORD(v11) = 4;
goto LABEL_48;
}
if ( v9 > 0x2000000 )
{
if ( v9 != 503316480 && (v9 & 0xFBFFFFFF) != 402653184 )
return 0;
}
else if ( v9 != 24 )
{
if ( v9 <= 24 )
{
v10 = 24;
LODWORD(v11) = 4;
if ( v9 != 2 )
return 0;
goto LABEL_48;
}
if ( (v9 & 0xFFFFFFFD) != 28 )
return 0;
}
v27 = 44LL;
LODWORD(v11) = 4;
LABEL_65:
*(_DWORD *)(a4 + 24) = v11;
if ( a2 < (unsigned int)v27 )
return 0;
*(_DWORD *)(a4 + 140) = v11;
*(_DWORD *)(a4 + 136) = 3;
if ( *(_BYTE *)(a1 + (unsigned int)v11) >> 4 != 6 )
return 0;
v38 = (unsigned __int16)__ROL2__(*(_WORD *)(a1 + (unsigned int)v11 + 4), 8);
v31 = (unsigned __int16)v38 + (_DWORD)v27;
if ( v31 > a2 )
return 0;
v39 = (unsigned int)v11 + 8LL;
v40 = (unsigned int)v11 + 24LL;
*(_DWORD *)(a4 + 28) = 6;
*(_QWORD *)(a4 + 48) = a1 + v39;
*(_QWORD *)(a4 + 56) = a1 + v40;
v41 = *(unsigned __int8 *)(a1 + (unsigned int)(v11 + 6));
*(_BYTE *)(a4 + 80) = 6;
*(_DWORD *)(a4 + 32) = v41;
*(_QWORD *)(a4 + 64) = ((unsigned __int64)*(unsigned __int8 *)(a1 + (unsigned int)v39) << 56) | ((unsigned __int64)*(unsigned __int8 *)(a1 + (unsigned int)(v11 + 14)) << 8) | ((unsigned __int64)*(unsigned __int8 *)(a1 + (unsigned int)(v11 + 13)) << 16) | ((unsigned __int64)*(unsigned __int8 *)(a1 + (unsigned int)(v11 + 12)) << 24) | ((unsigned __int64)*(unsigned __int8 *)(a1 + (unsigned int)(v11 + 11)) << 32) | *(unsigned __int8 *)(a1 + (unsigned int)(v11 + 15)) | ((unsigned __int64)*(unsigned __int8 *)(a1 + (unsigned int)(v11 + 10)) << 40) | ((unsigned __int64)*(unsigned __int8 *)(a1 + (unsigned int)(v11 + 9)) << 48);
v42 = ((unsigned __int64)*(unsigned __int8 *)(a1 + (unsigned int)(v11 + 21)) << 16) | ((unsigned __int64)*(unsigned __int8 *)(a1 + (unsigned int)(v11 + 20)) << 24) | ((unsigned __int64)*(unsigned __int8 *)(a1 + (unsigned int)(v11 + 19)) << 32) | ((unsigned __int64)*(unsigned __int8 *)(a1 + (unsigned int)(v11 + 18)) << 40) | *(unsigned __int8 *)(a1 + (unsigned int)(v11 + 23)) | ((unsigned __int64)*(unsigned __int8 *)(a1 + (unsigned int)(v11 + 17)) << 48) | ((unsigned __int64)*(unsigned __int8 *)(a1 + (unsigned int)(v11 + 16)) << 56);
v43 = *(unsigned __int8 *)(a1 + (unsigned int)(v11 + 22));
*(_BYTE *)(a4 + 104) = 6;
*(_QWORD *)(a4 + 72) = (v43 << 8) | v42;
*(_QWORD *)(a4 + 88) = ((unsigned __int64)*(unsigned __int8 *)(a1 + (unsigned int)v40) << 56) | ((unsigned __int64)*(unsigned __int8 *)(a1 + (unsigned int)(v11 + 30)) << 8) | ((unsigned __int64)*(unsigned __int8 *)(a1 + (unsigned int)(v11 + 29)) << 16) | ((unsigned __int64)*(unsigned __int8 *)(a1 + (unsigned int)(v11 + 28)) << 24) | ((unsigned __int64)*(unsigned __int8 *)(a1 + (unsigned int)(v11 + 27)) << 32) | *(unsigned __int8 *)(a1 + (unsigned int)(v11 + 31)) | ((unsigned __int64)*(unsigned __int8 *)(a1 + (unsigned int)(v11 + 26)) << 40) | ((unsigned __int64)*(unsigned __int8 *)(a1 + (unsigned int)(v11 + 25)) << 48);
v44 = ((unsigned __int64)*(unsigned __int8 *)(a1 + (unsigned int)(v11 + 36)) << 24) | ((unsigned __int64)*(unsigned __int8 *)(a1 + (unsigned int)(v11 + 35)) << 32) | ((unsigned __int64)*(unsigned __int8 *)(a1 + (unsigned int)(v11 + 34)) << 40) | *(unsigned __int8 *)(a1 + (unsigned int)(v11 + 39)) | ((unsigned __int64)*(unsigned __int8 *)(a1 + (unsigned int)(v11 + 33)) << 48) | ((unsigned __int64)*(unsigned __int8 *)(a1 + (unsigned int)(v11 + 32)) << 56);
v45 = *(unsigned __int8 *)(a1 + (unsigned int)(v11 + 37));
v46 = *(unsigned __int8 *)(a1 + (unsigned int)(v11 + 38));
*(_DWORD *)(a4 + 112) = v27;
*(_DWORD *)(a4 + 116) = v38;
*(_QWORD *)(a4 + 96) = (v45 << 16) | v44 | (v46 << 8);
while ( v41 != 17 )
{
if ( v41 > 0x11 )
{
if ( v41 != 58 )
{
if ( v41 != 132 )
return 0;
goto LABEL_112;
}
if ( v31 < (int)v27 + 4 )
return 0;
*(_DWORD *)(a4 + 140) = v27;
*(_DWORD *)(a4 + 136) = 4;
v66 = *(unsigned __int8 *)(a1 + (unsigned int)v27);
v67 = *(unsigned __int8 *)(a1 + (unsigned int)(v27 + 1));
*(_DWORD *)(a4 + 120) = v66;
*(_DWORD *)(a4 + 124) = v67;
if ( (unsigned int)(v66 - 133) <= 3 )
{
*(_DWORD *)(a4 + 136) = 21;
return 1;
}
return 1;
}
if ( v41 )
{
if ( v41 != 6 )
return 0;
goto LABEL_73;
}
if ( v31 < (int)v27 + 8 )
return 0;
*(_DWORD *)(a4 + 140) = v27;
*(_DWORD *)(a4 + 136) = 9;
v41 = *(unsigned __int8 *)(a1 + (unsigned int)v27);
*(_DWORD *)(a4 + 32) = v41;
v27 = (unsigned int)v27 + *(unsigned __int8 *)(a1 + (unsigned int)(v27 + 1)) + 8;
if ( v31 < (unsigned int)v27 )
return 0;
*(_DWORD *)(a4 + 112) = v27;
*(_DWORD *)(a4 + 116) = v31 - v27;
}
goto LABEL_120;
}
}
if ( a2 < v4 )
return 0;
*(_DWORD *)(a4 + 140) = v5;
*(_DWORD *)(a4 + 136) = 13;
v6 = (char *)(a1 + (unsigned int)v5);
if ( (*v6 & 0x7F) != 8 || (*(_BYTE *)(a1 + 1) & 0x40) != 0 || (int)v5 + 24 > a2 )
return 0;
*(_DWORD *)(a4 + 136) = 12;
v54 = *v6;
v55 = (_BYTE *)(a1 + (unsigned int)(v5 + 1));
v56 = a1 + (unsigned int)(v5 + 16);
v57 = *v55 & 3;
if ( v57 == 1 )
{
*(_QWORD *)(a4 + 8) = v56;
*(_QWORD *)(a4 + 16) = a1 + (unsigned int)(v5 + 4);
*(_QWORD *)a4 = a1 + (unsigned int)(v5 + 10);
}
else if ( v57 == 3 )
{
*(_QWORD *)(a4 + 16) = &unk_D40;
*(_QWORD *)(a4 + 8) = v56;
*(_QWORD *)a4 = a1 + (unsigned int)(v5 + 24);
v68 = (unsigned int)(v5 + 7);
LODWORD(v5) = v5 + 6;
v55 = (_BYTE *)(a1 + v68);
}
else
{
*(_QWORD *)a4 = v56;
*(_QWORD *)(a4 + 8) = a1 + (unsigned int)(v5 + 4);
*(_QWORD *)(a4 + 16) = a1 + (unsigned int)(v5 + 10);
}
if ( (*v55 & 4) != 0 || (*(_BYTE *)(a1 + (unsigned int)(v5 + 22)) & 0xF) != 0 )
return 0;
if ( v54 == -120 )
{
v52 = v5 + 26;
v51 = v5 + 29;
}
else
{
v52 = v5 + 24;
v51 = v5 + 27;
}
}
if ( a2 < v51 )
return 0;
while ( 1 )
{
*(_DWORD *)(a4 + 140) = v52;
*(_DWORD *)(a4 + 136) = 16;
v53 = *(unsigned __int8 *)(a1 + v52 + 2) | (*(unsigned __int8 *)(a1 + v52 + 1) << 8) | (*(unsigned __int8 *)(a1 + v52) << 16);
if ( v53 != 170 )
break;
v51 = v52 + 5;
if ( v52 + 5 > a2 )
return 0;
v52 += 2;
}
if ( v53 != 11184643 )
return 0;
v11 = v52 + 8;
if ( (unsigned int)v11 > a2 )
return 0;
*(_DWORD *)(a4 + 140) = v51;
if ( *(unsigned __int8 *)(a1 + v51 + 2) | (*(unsigned __int8 *)(a1 + v51 + 1) << 8) | (*(unsigned __int8 *)(a1 + v51) << 16) )
return 0;
LABEL_30:
for ( i = (unsigned __int16)__ROL2__(*(_WORD *)(a1 + v51 + 3), 8); i == 33024; i = (unsigned __int16)__ROL2__(v58, 8) )
{
if ( (int)v11 + 4 > a2 )
return 0;
*(_DWORD *)(a4 + 140) = v11;
*(_DWORD *)(a4 + 136) = 10;
v58 = *(_WORD *)(a1 + v11 + 2);
v11 = (unsigned int)(v11 + 4);
}
if ( i > 0x8100 )
{
if ( i != 34525 )
{
if ( i != 34887 )
return 0;
do
{
v49 = v11;
LODWORD(v11) = v11 + 4;
}
while ( (unsigned int)v11 < a2 && (*(_BYTE *)(a1 + (unsigned int)(v49 + 2)) & 1) == 0 );
if ( (unsigned int)v11 > a2 )
return 0;
v50 = (unsigned int)(v49 + 2);
*(_DWORD *)(a4 + 140) = v49;
v10 = v49 + 24;
*(_DWORD *)(a4 + 136) = 11;
if ( (*(_BYTE *)(a1 + v50) & 1) == 0 )
return 0;
goto LABEL_48;
}
v27 = (unsigned int)(v11 + 40);
goto LABEL_65;
}
if ( i != 2048 )
{
if ( i == 2054 )
{
v13 = v11 + 8;
*(_DWORD *)(a4 + 28) = 256;
*(_DWORD *)(a4 + 24) = v11;
if ( (int)v11 + 8 <= a2 )
{
*(_DWORD *)(a4 + 140) = v11;
*(_DWORD *)(a4 + 136) = 17;
v14 = *(unsigned __int8 *)(a1 + (unsigned int)(v11 + 4));
v15 = *(unsigned __int8 *)(a1 + (unsigned int)(v11 + 5));
v16 = *(unsigned __int8 *)(a1 + (unsigned int)(v11 + 7)) | (*(unsigned __int8 *)(a1 + (unsigned int)(v11 + 6)) << 8);
*(_DWORD *)(a4 + 120) = v16;
*(_DWORD *)(a4 + 32) = v16;
if ( v13 + 2 * (v14 + v15) <= a2 )
{
v17 = 2 * v14;
*(_DWORD *)(a4 + 140) = v13;
*(_BYTE *)(a4 + 80) = 4;
*(_QWORD *)(a4 + 48) = a1 + v13 + (unsigned __int64)(unsigned __int8)v14;
*(_QWORD *)(a4 + 56) = a1 + (unsigned int)(2 * v14) + v13 + (unsigned __int64)(unsigned __int8)v15;
v18 = v14 + v13;
v19 = (*(unsigned __int8 *)(a1 + (unsigned int)(v18 + 1)) << 16) | *(unsigned __int8 *)(a1
+ (unsigned int)(v18 + 3)) | (*(unsigned __int8 *)(a1 + v18) << 24);
v20 = *(unsigned __int8 *)(a1 + (unsigned int)(v18 + 2));
*(_BYTE *)(a4 + 104) = 4;
*(_DWORD *)(a4 + 64) = (v20 << 8) | v19;
v21 = v15 + v13 + v17;
v22 = *(unsigned __int8 *)(a1 + v21 + 3) | (*(unsigned __int8 *)(a1 + v21) << 24);
v23 = *(unsigned __int8 *)(a1 + v21 + 1);
v24 = *(unsigned __int8 *)(a1 + v21 + 2);
*(_DWORD *)(a4 + 140) = v11;
*(_DWORD *)(a4 + 88) = (v23 << 16) | v22 | (v24 << 8);
return 1;
}
}
}
return 0;
}
v10 = v11 + 20;
LABEL_48:
*(_DWORD *)(a4 + 24) = v11;
if ( a2 < v10 )
return 0;
*(_DWORD *)(a4 + 140) = v11;
*(_DWORD *)(a4 + 136) = 2;
if ( *(_BYTE *)(a1 + (unsigned int)v11) >> 4 != 4 )
return 0;
v28 = 4 * (*(_BYTE *)(a1 + (unsigned int)v11) & 0xF);
v27 = (unsigned int)v11 + v28;
if ( (unsigned int)v27 > a2 )
return 0;
v29 = *(unsigned __int16 *)(a1 + (unsigned int)v11 + 6);
LOWORD(v29) = __ROL2__(v29, 8);
v7 = (8 * v29) & 0x1FFF8;
if ( v7 )
return 0;
if ( (*(_BYTE *)(a1 + (unsigned int)(v11 + 6)) & 0x20) != 0 )
return 0;
v30 = (unsigned __int16)__ROL2__(*(_WORD *)(a1 + (unsigned int)v11 + 2), 8);
v31 = v11 + (unsigned __int16)v30;
if ( v31 > a2 || v28 > v30 )
return 0;
v32 = (unsigned int)v11 + 12LL;
v33 = (unsigned int)v11 + 16LL;
*(_DWORD *)(a4 + 28) = 4;
*(_QWORD *)(a4 + 48) = a1 + v32;
*(_QWORD *)(a4 + 56) = a1 + v33;
LODWORD(v32) = *(unsigned __int8 *)(a1 + (unsigned int)v32) << 24;
v34 = (*(unsigned __int8 *)(a1 + (unsigned int)(v11 + 14)) << 8) | (*(unsigned __int8 *)(a1 + (unsigned int)(v11 + 13)) << 16);
v35 = *(unsigned __int8 *)(a1 + (unsigned int)(v11 + 15));
*(_BYTE *)(a4 + 80) = 4;
*(_DWORD *)(a4 + 64) = v32 | v35 | v34;
LODWORD(v33) = *(unsigned __int8 *)(a1 + (unsigned int)v33) << 24;
v36 = (*(unsigned __int8 *)(a1 + (unsigned int)(v11 + 18)) << 8) | (*(unsigned __int8 *)(a1 + (unsigned int)(v11 + 17)) << 16);
LODWORD(v32) = *(unsigned __int8 *)(a1 + (unsigned int)(v11 + 19));
*(_BYTE *)(a4 + 104) = 4;
*(_DWORD *)(a4 + 88) = v33 | v32 | v36;
*(_DWORD *)(a4 + 40) = *(unsigned __int8 *)(a1 + (unsigned int)(v11 + 8));
v37 = *(unsigned __int8 *)(a1 + (unsigned int)(v11 + 9));
*(_DWORD *)(a4 + 36) = v30;
*(_DWORD *)(a4 + 32) = v37;
*(_DWORD *)(a4 + 112) = v27;
*(_DWORD *)(a4 + 116) = v30 - v28;
if ( (_BYTE)v37 == 6 )
{
LABEL_73:
if ( (int)v27 + 20 <= v31 )
{
*(_DWORD *)(a4 + 140) = v27;
*(_DWORD *)(a4 + 136) = 5;
v47 = v27 + (*(_BYTE *)(a1 + (unsigned int)(v27 + 12)) >> 2);
if ( v47 <= v31 )
{
v7 = 1;
*(_DWORD *)(a4 + 120) = (unsigned __int16)__ROL2__(*(_WORD *)(a1 + v27), 8);
v48 = *(_WORD *)(a1 + v27 + 2);
*(_DWORD *)(a4 + 128) = v47;
*(_DWORD *)(a4 + 132) = v31 - v47;
*(_DWORD *)(a4 + 124) = (unsigned __int16)__ROL2__(v48, 8);
return v7;
}
}
return 0;
}
if ( (unsigned __int8)v37 <= 6u )
{
if ( (_BYTE)v37 == 1 )
{
if ( v31 >= (int)v27 + 4 )
{
*(_DWORD *)(a4 + 140) = v27;
v7 = 1;
*(_DWORD *)(a4 + 136) = 4;
*(_DWORD *)(a4 + 120) = *(unsigned __int8 *)(a1 + (unsigned int)v27);
*(_DWORD *)(a4 + 124) = *(unsigned __int8 *)(a1 + (unsigned int)(v27 + 1));
return v7;
}
return 0;
}
if ( (_BYTE)v37 == 2 )
{
if ( v31 >= (int)v27 + 4 )
{
*(_DWORD *)(a4 + 140) = v27;
v7 = 1;
*(_DWORD *)(a4 + 136) = 20;
*(_DWORD *)(a4 + 120) = 0;
*(_DWORD *)(a4 + 124) = *(unsigned __int8 *)(a1 + v27);
return v7;
}
return 0;
}
LABEL_118:
if ( (unsigned int)v27 <= v31 )
{
*(_DWORD *)(a4 + 140) = v27;
*(_DWORD *)(a4 + 136) = 19;
return v7;
}
return 0;
}
if ( (_BYTE)v37 == 17 )
{
LABEL_120:
v62 = v27 + 8;
if ( (int)v27 + 8 <= v31 )
{
*(_DWORD *)(a4 + 140) = v27;
*(_DWORD *)(a4 + 136) = 6;
v63 = __ROL2__(*(_WORD *)(a1 + (unsigned int)v27), 8);
*(_DWORD *)(a4 + 120) = v63;
v64 = *(_WORD *)(a1 + (unsigned int)v27 + 2);
*(_DWORD *)(a4 + 128) = v62;
v65 = __ROL2__(v64, 8);
*(_DWORD *)(a4 + 124) = v65;
*(_DWORD *)(a4 + 132) = v31 - v62;
if ( v31 - v62 > 0x7CF )
_assert_fail("info->app_length < 2000", "src/proto-preprocess.c", 0xAEu, "preprocess_frame");
if ( v65 != 53 && v63 != 53 )
return 1;
if ( (int)v27 + 16 <= v31 )
{
*(_DWORD *)(a4 + 140) = v62;
v7 = 1;
*(_DWORD *)(a4 + 136) = 8;
return v7;
}
}
return 0;
}
if ( (_BYTE)v37 != 0x84 )
goto LABEL_118;
LABEL_112:
v59 = v27 + 12;
if ( (int)v27 + 12 <= v31 )
{
*(_DWORD *)(a4 + 140) = v27;
v60 = v31 - v59;
*(_DWORD *)(a4 + 136) = 7;
*(_DWORD *)(a4 + 120) = (unsigned __int16)__ROL2__(*(_WORD *)(a1 + v27), 8);
v61 = *(_WORD *)(a1 + v27 + 2);
*(_DWORD *)(a4 + 128) = v59;
*(_DWORD *)(a4 + 132) = v60;
*(_DWORD *)(a4 + 124) = (unsigned __int16)__ROL2__(v61, 8);
if ( v60 > 0x7CF )
_assert_fail("info->app_length < 2000", "src/proto-preprocess.c", 0xCDu, "preprocess_frame");
return 1;
}
return 0;
}

original_code:
unsigned
preprocess_frame(const unsigned char *px, unsigned length, unsigned link_type,
                 struct PreprocessedInfo *info)
{
    unsigned offset = 0;
    unsigned ethertype = 0;
    info->transport_offset = 0;
    info->found = FOUND_NOTHING;
    info->found_offset = 0;
    if (link_type != 1)
        goto parse_linktype;
parse_ethernet:
    if (offset+(14) > length) return 0; else {info->found_offset=offset; info->found=FOUND_ETHERNET;};
    info->mac_dst = px+offset+0;
    info->mac_src = px+offset+6;
    ethertype = ( *((unsigned char*)(px+offset+12)+0)<< 8 | *((unsigned char*)(px+offset+12)+1)<< 0 );
    offset += 14;
    if (ethertype < 2000)
        goto parse_llc;
    if (ethertype != 0x0800)
        goto parse_ethertype;
parse_ipv4:
    {
        unsigned header_length;
        unsigned flags;
        unsigned fragment_offset;
        unsigned total_length;
        info->ip_offset = offset;
        if (offset+(20) > length) return 0; else {info->found_offset=offset; info->found=FOUND_IPV4;};
        if ((px[offset]>>4) != 4)
            return 0;
        header_length = (px[offset] & 0x0F) * 4;
        if (offset+(header_length) > length) return 0; else {info->found_offset=offset; info->found=FOUND_IPV4;};
        flags = px[offset+6]&0xE0;
        fragment_offset = (( *((unsigned char*)(px+offset+6)+0)<< 8 | *((unsigned char*)(px+offset+6)+1)<< 0 ) & 0x3FFF) << 3;
        if (fragment_offset != 0 || (flags & 0x20))
            return 0;
        total_length = ( *((unsigned char*)(px+offset+2)+0)<< 8 | *((unsigned char*)(px+offset+2)+1)<< 0 );
        if (offset+(total_length) > length) return 0; else {info->found_offset=offset; info->found=FOUND_IPV4;};
        if (total_length < header_length)
            return 0;
        length = offset + total_length;
        info->ip_version = (px[offset]>>4)&0xF;
        info->_ip_src = px+offset+12;
        info->_ip_dst = px+offset+16;
        info->src_ip.ipv4 = px[offset+12] << 24
                            | px[offset+13] << 16
                            | px[offset+14] << 8
                            | px[offset+15] << 0;
        info->src_ip.version = 4;
        info->dst_ip.ipv4 = px[offset+16] << 24
                            | px[offset+17] << 16
                            | px[offset+18] << 8
                            | px[offset+19] << 0;
        info->dst_ip.version = 4;
        info->ip_ttl = px[offset+8];
        info->ip_protocol = px[offset+9];
        info->ip_length = total_length;
        if (info->ip_version != 4)
            return 0;
        offset += header_length;
        info->transport_offset = offset;
        info->transport_length = length - info->transport_offset;
        switch (info->ip_protocol) {
        case 1: goto parse_icmp;
        case 2: goto parse_igmp;
        case 6: goto parse_tcp;
        case 17: goto parse_udp;
        case 132: goto parse_sctp;
        default:
                if (offset+(0) > length) return 0; else {info->found_offset=offset; info->found=FOUND_OPROTO;};
                return 0;
        }
    }
parse_tcp:
    {
        unsigned tcp_length;
        if (offset+(20) > length) return 0; else {info->found_offset=offset; info->found=FOUND_TCP;};
        tcp_length = px[offset + 12]>>2;
        if (offset+(tcp_length) > length) return 0; else {info->found_offset=offset; info->found=FOUND_TCP;};
        info->port_src = ( *((unsigned char*)(px+offset+0)+0)<< 8 | *((unsigned char*)(px+offset+0)+1)<< 0 );
        info->port_dst = ( *((unsigned char*)(px+offset+2)+0)<< 8 | *((unsigned char*)(px+offset+2)+1)<< 0 );
        info->app_offset = offset + tcp_length;
        info->app_length = length - info->app_offset;
        return 1;
    }
parse_udp:
    {
        if (offset+(8) > length) return 0; else {info->found_offset=offset; info->found=FOUND_UDP;};
        info->port_src = ( *((unsigned char*)(px+offset+0)+0)<< 8 | *((unsigned char*)(px+offset+0)+1)<< 0 );
        info->port_dst = ( *((unsigned char*)(px+offset+2)+0)<< 8 | *((unsigned char*)(px+offset+2)+1)<< 0 );
        offset += 8;
        info->app_offset = offset;
        info->app_length = length - info->app_offset;
        ((void) sizeof ((info->app_length < 2000) ? 1 : 0), __extension__ ({ if (info->app_length < 2000) ; else __assert_fail ("info->app_length < 2000", "src/proto-preprocess.c", 174, __extension__ __PRETTY_FUNCTION__); }));
        if (info->port_dst == 53 || info->port_src == 53) {
            goto parse_dns;
        }
        return 1;
    }
parse_icmp:
    {
        if (offset+(4) > length) return 0; else {info->found_offset=offset; info->found=FOUND_ICMP;};
        info->port_src = px[offset+0];
        info->port_dst = px[offset+1];
        return 1;
    }
parse_igmp:
    {
        if (offset+(4) > length) return 0; else {info->found_offset=offset; info->found=FOUND_IGMP;};
        info->port_src = 0;
        info->port_dst = px[offset+0];
        return 1;
    }
parse_sctp:
    {
        if (offset+(12) > length) return 0; else {info->found_offset=offset; info->found=FOUND_SCTP;};
        info->port_src = ( *((unsigned char*)(px+offset+0)+0)<< 8 | *((unsigned char*)(px+offset+0)+1)<< 0 );
        info->port_dst = ( *((unsigned char*)(px+offset+2)+0)<< 8 | *((unsigned char*)(px+offset+2)+1)<< 0 );
        info->app_offset = offset + 12;
        info->app_length = length - info->app_offset;
        ((void) sizeof ((info->app_length < 2000) ? 1 : 0), __extension__ ({ if (info->app_length < 2000) ; else __assert_fail ("info->app_length < 2000", "src/proto-preprocess.c", 205, __extension__ __PRETTY_FUNCTION__); }));
        return 1;
    }
parse_dns:
    {
        if (offset+(8) > length) return 0; else {info->found_offset=offset; info->found=FOUND_DNS;};
        return 1;
    }
parse_ipv6:
    {
        unsigned payload_length;
        info->ip_offset = offset;
        if (offset+(40) > length) return 0; else {info->found_offset=offset; info->found=FOUND_IPV6;};
        if ((px[offset]>>4) != 6)
            return 0;
        payload_length = ( *((unsigned char*)(px+offset+4)+0)<< 8 | *((unsigned char*)(px+offset+4)+1)<< 0 );
        if (offset+(40+payload_length) > length) return 0; else {info->found_offset=offset; info->found=FOUND_IPV6;};
        if (length > offset + 40 + payload_length)
            length = offset + 40 + payload_length;
        info->ip_version = (px[offset]>>4)&0xF;
        info->_ip_src = px+offset+8;
        info->_ip_dst = px+offset+8+16;
        info->ip_protocol = px[offset+6];
        info->src_ip.version = 6;
        info->src_ip.ipv6.hi = 0ULL
                            | (uint64_t)px[offset + 8] << 56ULL
                            | (uint64_t)px[offset + 9] << 48ULL
                            | (uint64_t)px[offset + 10] << 40ULL
                            | (uint64_t)px[offset + 11] << 32ULL
                            | (uint64_t)px[offset + 12] << 24ULL
                            | (uint64_t)px[offset + 13] << 16ULL
                            | (uint64_t)px[offset + 14] << 8ULL
                            | (uint64_t)px[offset + 15] << 0ULL;
        info->src_ip.ipv6.lo = 0ULL
                            | (uint64_t)px[offset + 16] << 56ULL
                            | (uint64_t)px[offset + 17] << 48ULL
                            | (uint64_t)px[offset + 18] << 40ULL
                            | (uint64_t)px[offset + 19] << 32ULL
                            | (uint64_t)px[offset + 20] << 24ULL
                            | (uint64_t)px[offset + 21] << 16ULL
                            | (uint64_t)px[offset + 22] << 8ULL
                            | (uint64_t)px[offset + 23] << 0ULL;
        info->dst_ip.version = 6;
        info->dst_ip.ipv6.hi = 0ULL
                            | (uint64_t)px[offset + 24] << 56ULL
                            | (uint64_t)px[offset + 25] << 48ULL
                            | (uint64_t)px[offset + 26] << 40ULL
                            | (uint64_t)px[offset + 27] << 32ULL
                            | (uint64_t)px[offset + 28] << 24ULL
                            | (uint64_t)px[offset + 29] << 16ULL
                            | (uint64_t)px[offset + 30] << 8ULL
                            | (uint64_t)px[offset + 31] << 0ULL;
        info->dst_ip.ipv6.lo = 0ULL
                            | (uint64_t)px[offset + 32] << 56ULL
                            | (uint64_t)px[offset + 33] << 48ULL
                            | (uint64_t)px[offset + 34] << 40ULL
                            | (uint64_t)px[offset + 35] << 32ULL
                            | (uint64_t)px[offset + 36] << 24ULL
                            | (uint64_t)px[offset + 37] << 16ULL
                            | (uint64_t)px[offset + 38] << 8ULL
                            | (uint64_t)px[offset + 39] << 0ULL;
        offset += 40;
        info->transport_offset = offset;
        info->transport_length = length - info->transport_offset;
parse_ipv6_next:
        switch (info->ip_protocol) {
        case 0: goto parse_ipv6_hop_by_hop;
        case 6: goto parse_tcp;
        case 17: goto parse_udp;
        case 58: goto parse_icmpv6;
        case 132: goto parse_sctp;
        case 0x2c:
            return 0;
        default:
            return 0;
        }
    }
parse_ipv6_hop_by_hop:
    {
        unsigned len;
        if (offset+(8) > length) return 0; else {info->found_offset=offset; info->found=FOUND_IPV6_HOP;};
        info->ip_protocol = px[offset];
        len = px[offset+1] + 8;
        if (offset+(len) > length) return 0; else {info->found_offset=offset; info->found=FOUND_IPV6_HOP;};
        offset += len;
        info->transport_offset = offset;
        info->transport_length = length - info->transport_offset;
    }
    goto parse_ipv6_next;
parse_icmpv6:
    {
        unsigned icmp_type;
        unsigned icmp_code;
        if (offset+(4) > length) return 0; else {info->found_offset=offset; info->found=FOUND_ICMP;};
        icmp_type = px[offset+0];
        icmp_code = px[offset+1];
        info->port_src = icmp_type;
        info->port_dst = icmp_code;
        if (133 <= icmp_type && icmp_type <= 136) {
            info->found = FOUND_NDPv6;
        }
    }
    return 1;
parse_vlan8021q:
    if (offset+(4) > length) return 0; else {info->found_offset=offset; info->found=FOUND_8021Q;};
    ethertype = ( *((unsigned char*)(px+offset+2)+0)<< 8 | *((unsigned char*)(px+offset+2)+1)<< 0 );
    offset += 4;
    goto parse_ethertype;
parse_vlanmpls:
    while (offset + 4 < length && !(px[offset+2] & 1))
        offset += 4;
    if (offset+(4) > length) return 0; else {info->found_offset=offset; info->found=FOUND_MPLS;};
    offset += 4;
    if (px[offset-4+2]&1) {
        goto parse_ipv4;
    } else
        return 0;
wifi_data:
    {
        unsigned flag;
        if (offset+(24) > length) return 0; else {info->found_offset=offset; info->found=FOUND_WIFI_DATA;};
        flag = px[offset];
        switch (px[offset+1]&0x03) {
        case 0:
        case 2:
            info->mac_dst = px+offset+4;
            info->mac_bss = px+offset+10;
            info->mac_src = px+offset+16;
            break;
        case 1:
            info->mac_bss = px+offset+4;
            info->mac_src = px+offset+10;
            info->mac_dst = px+offset+16;
            break;
        case 3:
            info->mac_bss = (const unsigned char*)"\0\0\0\0\0\0";
            info->mac_dst = px+offset+16;
            info->mac_src = px+offset+24;
            offset += 6;
            break;
        }
        if ((px[offset+1]&0x04) != 0 || (px[offset+22]&0xF) != 0)
            return 0;
        offset += 24;
        if (flag == 0x88) {
            offset += 2;
        }
        goto parse_llc;
    }
parse_wifi:
    if (offset+(2) > length) return 0; else {info->found_offset=offset; info->found=FOUND_WIFI;};
    switch (px[offset]) {
    case 0x08:
    case 0x88:
        if (px[1] & 0x40)
            return 0;
        goto wifi_data;
        break;
    default:
        return 0;
    }
parse_radiotap_header:
    {
        unsigned header_length;
        unsigned features;
        if (offset+(8) > length) return 0; else {info->found_offset=offset; info->found=FOUND_RADIOTAP;};
        if (px[offset] != 0)
            return 0;
        header_length = ( *((unsigned char*)(px+offset+2)+0)<< 0 | *((unsigned char*)(px+offset+2)+1)<< 8 );
        features = ( *((unsigned char*)(px+offset+4)+0)<< 0 | *((unsigned char*)(px+offset+4)+1)<< 8 | *((unsigned char*)(px+offset+4)+2)<<16 | *((unsigned char*)(px+offset+4)+3)<<24 );
        if (offset+(header_length) > length) return 0; else {info->found_offset=offset; info->found=FOUND_RADIOTAP;};
        if (features & 0x4000) {
            unsigned fcs_header = ( *((unsigned char*)(px+offset+header_length-4)+0)<< 0 | *((unsigned char*)(px+offset+header_length-4)+1)<< 8 | *((unsigned char*)(px+offset+header_length-4)+2)<<16 | *((unsigned char*)(px+offset+header_length-4)+3)<<24 );
            unsigned fcs_frame = ( *((unsigned char*)(px+length-4)+0)<< 0 | *((unsigned char*)(px+length-4)+1)<< 8 | *((unsigned char*)(px+length-4)+2)<<16 | *((unsigned char*)(px+length-4)+3)<<24 );
            if (fcs_header == fcs_frame)
                length -= 4;
            if (offset+(header_length) > length) return 0; else {info->found_offset=offset; info->found=FOUND_RADIOTAP;};
        }
        offset += header_length;
        goto parse_wifi;
    }
parse_prism_header:
    {
        unsigned header_length;
        if (offset+(8) > length) return 0; else {info->found_offset=offset; info->found=FOUND_PRISM;};
        if (( *((unsigned char*)(px+offset+0)+0)<< 0 | *((unsigned char*)(px+offset+0)+1)<< 8 | *((unsigned char*)(px+offset+0)+2)<<16 | *((unsigned char*)(px+offset+0)+3)<<24 ) != 0x00000044)
            return 0;
        header_length = ( *((unsigned char*)(px+offset+4)+0)<< 0 | *((unsigned char*)(px+offset+4)+1)<< 8 | *((unsigned char*)(px+offset+4)+2)<<16 | *((unsigned char*)(px+offset+4)+3)<<24 );
        if (header_length > 0xFFFFF)
            return 0;
        if (offset+(header_length) > length) return 0; else {info->found_offset=offset; info->found=FOUND_PRISM;};
        offset += header_length;
        goto parse_wifi;
    }
parse_llc:
    {
        unsigned oui;
        if (offset+(3) > length) return 0; else {info->found_offset=offset; info->found=FOUND_LLC;};
        switch (( *((unsigned char*)(px+offset)+0)<<16 | *((unsigned char*)(px+offset)+1)<< 8 | *((unsigned char*)(px+offset)+2)<< 0 )) {
        case 0x0000aa: offset += 2; goto parse_llc;
        default: return 0;
        case 0xaaaa03: break;
        }
        offset +=3 ;
        if (offset+(5) > length) return 0; else {info->found_offset=offset; info->found=FOUND_LLC;};
        oui = ( *((unsigned char*)(px+offset)+0)<<16 | *((unsigned char*)(px+offset)+1)<< 8 | *((unsigned char*)(px+offset)+2)<< 0 );
        ethertype = ( *((unsigned char*)(px+offset+3)+0)<< 8 | *((unsigned char*)(px+offset+3)+1)<< 0 );
        offset += 5;
        switch (oui){
        case 0x000000: goto parse_ethertype;
        default: return 0;
        }
    }
parse_ethertype:
    switch (ethertype) {
    case 0x0800: goto parse_ipv4;
    case 0x0806: goto parse_arp;
    case 0x86dd: goto parse_ipv6;
    case 0x8100: goto parse_vlan8021q;
    case 0x8847: goto parse_vlanmpls;
    default: return 0;
    }
parse_linktype:
    switch (link_type) {
        case 0:
            offset += 4;
            switch (( *((unsigned char*)(px)+0)<<24 | *((unsigned char*)(px)+1)<<16 | *((unsigned char*)(px)+2)<< 8 | *((unsigned char*)(px)+3)<< 0 )) {
                case 0x02000000:
                case 0x00000002:
                    goto parse_ipv4;
                case 0x18000000:
                case 0x00000018:
                case 0x1c000000:
                case 0x0000001c:
                case 0x1e000000:
                case 0x0000001e:
                    goto parse_ipv6;
            }
            return 0;
        case 1: goto parse_ethernet;
        case 12:
            switch (px[offset]>>4) {
  case 4: goto parse_ipv4;
                case 6: goto parse_ipv6;
            }
            return 0;
        case 0x69: goto parse_wifi;
        case 113: goto parse_linux_sll;
        case 119: goto parse_prism_header;
        case 127: goto parse_radiotap_header;
        default: return 0;
    }
parse_linux_sll:
    {
        struct {
            unsigned packet_type;
            unsigned arp_type;
            unsigned addr_length;
            unsigned char mac_address[8];
            unsigned ethertype;
        } sll;
        if (offset+(16) > length) return 0; else {info->found_offset=offset; info->found=FOUND_SLL;};
        sll.packet_type = ( *((unsigned char*)(px+offset+0)+0)<< 8 | *((unsigned char*)(px+offset+0)+1)<< 0 );
        sll.arp_type = ( *((unsigned char*)(px+offset+2)+0)<< 8 | *((unsigned char*)(px+offset+2)+1)<< 0 );
        sll.addr_length = ( *((unsigned char*)(px+offset+4)+0)<< 8 | *((unsigned char*)(px+offset+4)+1)<< 0 );
        memcpy(sll.mac_address, px+offset+6, 8);
        sll.ethertype = ( *((unsigned char*)(px+offset+14)+0)<< 8 | *((unsigned char*)(px+offset+14)+1)<< 0 );
        offset += 16;
        goto parse_ethertype;
    }
parse_arp:
    info->ip_version = 256;
    info->ip_offset = offset;
    {
        unsigned hardware_length;
        unsigned protocol_length;
        unsigned opcode;
        if (offset+(8) > length) return 0; else {info->found_offset=offset; info->found=FOUND_ARP;};
        hardware_length = px[offset+4];
        protocol_length = px[offset+5];
        opcode = px[offset+6]<<8 | px[offset+7];
        info->opcode = opcode;
        info->ip_protocol = opcode;
        offset += 8;
        if (offset+(2*hardware_length + 2*protocol_length) > length) return 0; else {info->found_offset=offset; info->found=FOUND_ARP;};
        info->_ip_src = px + offset + hardware_length;
        info->_ip_dst = px + offset + 2*hardware_length + protocol_length;
        info->src_ip.version = 4;
        info->src_ip.ipv4 = px[offset + hardware_length + 0] << 24
                            | px[offset + hardware_length + 1] << 16
                            | px[offset + hardware_length + 2] << 8
                            | px[offset + hardware_length + 3] << 0;
        info->dst_ip.version = 4;
        info->dst_ip.ipv4 = px[offset + 2*hardware_length + protocol_length + 0] << 24
                            | px[offset + 2*hardware_length + protocol_length + 1] << 16
                            | px[offset + 2*hardware_length + protocol_length + 2] << 8
                            | px[offset + 2*hardware_length + protocol_length + 3] << 0;
        info->found_offset = info->ip_offset;
        return 1;
    }
}

canonical_original_code:
unsigned int preprocess_frame(unsigned char *px, unsigned int length, unsigned int link_type, struct PreprocessedInfo *info)
{
    unsigned int offset = 0;
    unsigned int ethertype = 0;
    info->transport_offset = 0;
    info->found = FOUND_NOTHING;
    info->found_offset = 0;
    if (link_type != 1)
        goto parse_linktype;
parse_ethernet:
    if (offset+(14) > length) return 0; else {info->found_offset=offset; info->found=FOUND_ETHERNET;};
    info->mac_dst = px+offset+0;
    info->mac_src = px+offset+6;
    ethertype = ( *((unsigned char *)(px+offset+12)+0)<< 8 | *((unsigned char *)(px+offset+12)+1)<< 0 );
    offset += 14;
    if (ethertype < 2000)
        goto parse_llc;
    if (ethertype != 0x0800)
        goto parse_ethertype;
parse_ipv4:
    {
        unsigned int header_length;
        unsigned int flags;
        unsigned int fragment_offset;
        unsigned int total_length;
        info->ip_offset = offset;
        if (offset+(20) > length) return 0; else {info->found_offset=offset; info->found=FOUND_IPV4;};
        if ((px[offset]>>4) != 4)
            return 0;
        header_length = (px[offset] & 0x0F) * 4;
        if (offset+(header_length) > length) return 0; else {info->found_offset=offset; info->found=FOUND_IPV4;};
        flags = px[offset+6]&0xE0;
        fragment_offset = (( *((unsigned char *)(px+offset+6)+0)<< 8 | *((unsigned char *)(px+offset+6)+1)<< 0 ) & 0x3FFF) << 3;
        if (fragment_offset != 0 || (flags & 0x20))
            return 0;
        total_length = ( *((unsigned char *)(px+offset+2)+0)<< 8 | *((unsigned char *)(px+offset+2)+1)<< 0 );
        if (offset+(total_length) > length) return 0; else {info->found_offset=offset; info->found=FOUND_IPV4;};
        if (total_length < header_length)
            return 0;
        length = offset + total_length;
        info->ip_version = (px[offset]>>4)&0xF;
        info->_ip_src = px+offset+12;
        info->_ip_dst = px+offset+16;
        info->src_ip.ipv4 = px[offset+12] << 24
                            | px[offset+13] << 16
                            | px[offset+14] << 8
                            | px[offset+15] << 0;
        info->src_ip.version = 4;
        info->dst_ip.ipv4 = px[offset+16] << 24
                            | px[offset+17] << 16
                            | px[offset+18] << 8
                            | px[offset+19] << 0;
        info->dst_ip.version = 4;
        info->ip_ttl = px[offset+8];
        info->ip_protocol = px[offset+9];
        info->ip_length = total_length;
        if (info->ip_version != 4)
            return 0;
        offset += header_length;
        info->transport_offset = offset;
        info->transport_length = length - info->transport_offset;
        switch (info->ip_protocol) {
        case 1: goto parse_icmp;
        case 2: goto parse_igmp;
        case 6: goto parse_tcp;
        case 17: goto parse_udp;
        case 132: goto parse_sctp;
        default:
                if (offset+(0) > length) return 0; else {info->found_offset=offset; info->found=FOUND_OPROTO;};
                return 0;
        }
    }
parse_tcp:
    {
        unsigned int tcp_length;
        if (offset+(20) > length) return 0; else {info->found_offset=offset; info->found=FOUND_TCP;};
        tcp_length = px[offset + 12]>>2;
        if (offset+(tcp_length) > length) return 0; else {info->found_offset=offset; info->found=FOUND_TCP;};
        info->port_src = ( *((unsigned char *)(px+offset+0)+0)<< 8 | *((unsigned char *)(px+offset+0)+1)<< 0 );
        info->port_dst = ( *((unsigned char *)(px+offset+2)+0)<< 8 | *((unsigned char *)(px+offset+2)+1)<< 0 );
        info->app_offset = offset + tcp_length;
        info->app_length = length - info->app_offset;
        return 1;
    }
parse_udp:
    {
        if (offset+(8) > length) return 0; else {info->found_offset=offset; info->found=FOUND_UDP;};
        info->port_src = ( *((unsigned char *)(px+offset+0)+0)<< 8 | *((unsigned char *)(px+offset+0)+1)<< 0 );
        info->port_dst = ( *((unsigned char *)(px+offset+2)+0)<< 8 | *((unsigned char *)(px+offset+2)+1)<< 0 );
        offset += 8;
        info->app_offset = offset;
        info->app_length = length - info->app_offset;
        ((void) sizeof ((info->app_length < 2000) ? 1 : 0), __extension__ ({ if (info->app_length < 2000) ; else __assert_fail ("info->app_length < 2000", "src/proto-preprocess.c", 174, __extension__ __PRETTY_FUNCTION__); }));
        if (info->port_dst == 53 || info->port_src == 53) {
            goto parse_dns;
        }
        return 1;
    }
parse_icmp:
    {
        if (offset+(4) > length) return 0; else {info->found_offset=offset; info->found=FOUND_ICMP;};
        info->port_src = px[offset+0];
        info->port_dst = px[offset+1];
        return 1;
    }
parse_igmp:
    {
        if (offset+(4) > length) return 0; else {info->found_offset=offset; info->found=FOUND_IGMP;};
        info->port_src = 0;
        info->port_dst = px[offset+0];
        return 1;
    }
parse_sctp:
    {
        if (offset+(12) > length) return 0; else {info->found_offset=offset; info->found=FOUND_SCTP;};
        info->port_src = ( *((unsigned char *)(px+offset+0)+0)<< 8 | *((unsigned char *)(px+offset+0)+1)<< 0 );
        info->port_dst = ( *((unsigned char *)(px+offset+2)+0)<< 8 | *((unsigned char *)(px+offset+2)+1)<< 0 );
        info->app_offset = offset + 12;
        info->app_length = length - info->app_offset;
        ((void) sizeof ((info->app_length < 2000) ? 1 : 0), __extension__ ({ if (info->app_length < 2000) ; else __assert_fail ("info->app_length < 2000", "src/proto-preprocess.c", 205, __extension__ __PRETTY_FUNCTION__); }));
        return 1;
    }
parse_dns:
    {
        if (offset+(8) > length) return 0; else {info->found_offset=offset; info->found=FOUND_DNS;};
        return 1;
    }
parse_ipv6:
    {
        unsigned int payload_length;
        info->ip_offset = offset;
        if (offset+(40) > length) return 0; else {info->found_offset=offset; info->found=FOUND_IPV6;};
        if ((px[offset]>>4) != 6)
            return 0;
        payload_length = ( *((unsigned char *)(px+offset+4)+0)<< 8 | *((unsigned char *)(px+offset+4)+1)<< 0 );
        if (offset+(40+payload_length) > length) return 0; else {info->found_offset=offset; info->found=FOUND_IPV6;};
        if (length > offset + 40 + payload_length)
            length = offset + 40 + payload_length;
        info->ip_version = (px[offset]>>4)&0xF;
        info->_ip_src = px+offset+8;
        info->_ip_dst = px+offset+8+16;
        info->ip_protocol = px[offset+6];
        info->src_ip.version = 6;
        info->src_ip.ipv6.hi = 0ULL
                            | (unsigned long)px[offset + 8] << 56ULL
                            | (unsigned long)px[offset + 9] << 48ULL
                            | (unsigned long)px[offset + 10] << 40ULL
                            | (unsigned long)px[offset + 11] << 32ULL
                            | (unsigned long)px[offset + 12] << 24ULL
                            | (unsigned long)px[offset + 13] << 16ULL
                            | (unsigned long)px[offset + 14] << 8ULL
                            | (unsigned long)px[offset + 15] << 0ULL;
        info->src_ip.ipv6.lo = 0ULL
                            | (unsigned long)px[offset + 16] << 56ULL
                            | (unsigned long)px[offset + 17] << 48ULL
                            | (unsigned long)px[offset + 18] << 40ULL
                            | (unsigned long)px[offset + 19] << 32ULL
                            | (unsigned long)px[offset + 20] << 24ULL
                            | (unsigned long)px[offset + 21] << 16ULL
                            | (unsigned long)px[offset + 22] << 8ULL
                            | (unsigned long)px[offset + 23] << 0ULL;
        info->dst_ip.version = 6;
        info->dst_ip.ipv6.hi = 0ULL
                            | (unsigned long)px[offset + 24] << 56ULL
                            | (unsigned long)px[offset + 25] << 48ULL
                            | (unsigned long)px[offset + 26] << 40ULL
                            | (unsigned long)px[offset + 27] << 32ULL
                            | (unsigned long)px[offset + 28] << 24ULL
                            | (unsigned long)px[offset + 29] << 16ULL
                            | (unsigned long)px[offset + 30] << 8ULL
                            | (unsigned long)px[offset + 31] << 0ULL;
        info->dst_ip.ipv6.lo = 0ULL
                            | (unsigned long)px[offset + 32] << 56ULL
                            | (unsigned long)px[offset + 33] << 48ULL
                            | (unsigned long)px[offset + 34] << 40ULL
                            | (unsigned long)px[offset + 35] << 32ULL
                            | (unsigned long)px[offset + 36] << 24ULL
                            | (unsigned long)px[offset + 37] << 16ULL
                            | (unsigned long)px[offset + 38] << 8ULL
                            | (unsigned long)px[offset + 39] << 0ULL;
        offset += 40;
        info->transport_offset = offset;
        info->transport_length = length - info->transport_offset;
parse_ipv6_next:
        switch (info->ip_protocol) {
        case 0: goto parse_ipv6_hop_by_hop;
        case 6: goto parse_tcp;
        case 17: goto parse_udp;
        case 58: goto parse_icmpv6;
        case 132: goto parse_sctp;
        case 0x2c:
            return 0;
        default:
            return 0;
        }
    }
parse_ipv6_hop_by_hop:
    {
        unsigned int len;
        if (offset+(8) > length) return 0; else {info->found_offset=offset; info->found=FOUND_IPV6_HOP;};
        info->ip_protocol = px[offset];
        len = px[offset+1] + 8;
        if (offset+(len) > length) return 0; else {info->found_offset=offset; info->found=FOUND_IPV6_HOP;};
        offset += len;
        info->transport_offset = offset;
        info->transport_length = length - info->transport_offset;
    }
    goto parse_ipv6_next;
parse_icmpv6:
    {
        unsigned int icmp_type;
        unsigned int icmp_code;
        if (offset+(4) > length) return 0; else {info->found_offset=offset; info->found=FOUND_ICMP;};
        icmp_type = px[offset+0];
        icmp_code = px[offset+1];
        info->port_src = icmp_type;
        info->port_dst = icmp_code;
        if (133 <= icmp_type && icmp_type <= 136) {
            info->found = FOUND_NDPv6;
        }
    }
    return 1;
parse_vlan8021q:
    if (offset+(4) > length) return 0; else {info->found_offset=offset; info->found=FOUND_8021Q;};
    ethertype = ( *((unsigned char *)(px+offset+2)+0)<< 8 | *((unsigned char *)(px+offset+2)+1)<< 0 );
    offset += 4;
    goto parse_ethertype;
parse_vlanmpls:
    while (offset + 4 < length && !(px[offset+2] & 1))
        offset += 4;
    if (offset+(4) > length) return 0; else {info->found_offset=offset; info->found=FOUND_MPLS;};
    offset += 4;
    if (px[offset-4+2]&1) {
        goto parse_ipv4;
    } else
        return 0;
wifi_data:
    {
        unsigned int flag;
        if (offset+(24) > length) return 0; else {info->found_offset=offset; info->found=FOUND_WIFI_DATA;};
        flag = px[offset];
        switch (px[offset+1]&0x03) {
        case 0:
        case 2:
            info->mac_dst = px+offset+4;
            info->mac_bss = px+offset+10;
            info->mac_src = px+offset+16;
            break;
        case 1:
            info->mac_bss = px+offset+4;
            info->mac_src = px+offset+10;
            info->mac_dst = px+offset+16;
            break;
        case 3:
            info->mac_bss = (unsigned char *)"\0\0\0\0\0\0";
            info->mac_dst = px+offset+16;
            info->mac_src = px+offset+24;
            offset += 6;
            break;
        }
        if ((px[offset+1]&0x04) != 0 || (px[offset+22]&0xF) != 0)
            return 0;
        offset += 24;
        if (flag == 0x88) {
            offset += 2;
        }
        goto parse_llc;
    }
parse_wifi:
    if (offset+(2) > length) return 0; else {info->found_offset=offset; info->found=FOUND_WIFI;};
    switch (px[offset]) {
    case 0x08:
    case 0x88:
        if (px[1] & 0x40)
            return 0;
        goto wifi_data;
        break;
    default:
        return 0;
    }
parse_radiotap_header:
    {
        unsigned int header_length;
        unsigned int features;
        if (offset+(8) > length) return 0; else {info->found_offset=offset; info->found=FOUND_RADIOTAP;};
        if (px[offset] != 0)
            return 0;
        header_length = ( *((unsigned char *)(px+offset+2)+0)<< 0 | *((unsigned char *)(px+offset+2)+1)<< 8 );
        features = ( *((unsigned char *)(px+offset+4)+0)<< 0 | *((unsigned char *)(px+offset+4)+1)<< 8 | *((unsigned char *)(px+offset+4)+2)<<16 | *((unsigned char *)(px+offset+4)+3)<<24 );
        if (offset+(header_length) > length) return 0; else {info->found_offset=offset; info->found=FOUND_RADIOTAP;};
        if (features & 0x4000) {
            unsigned int fcs_header = ( *((unsigned char*)(px+offset+header_length-4)+0)<< 0 | *((unsigned char*)(px+offset+header_length-4)+1)<< 8 | *((unsigned char*)(px+offset+header_length-4)+2)<<16 | *((unsigned char*)(px+offset+header_length-4)+3)<<24 );
            unsigned int fcs_frame = ( *((unsigned char*)(px+length-4)+0)<< 0 | *((unsigned char*)(px+length-4)+1)<< 8 | *((unsigned char*)(px+length-4)+2)<<16 | *((unsigned char*)(px+length-4)+3)<<24 );
            if (fcs_header == fcs_frame)
                length -= 4;
            if (offset+(header_length) > length) return 0; else {info->found_offset=offset; info->found=FOUND_RADIOTAP;};
        }
        offset += header_length;
        goto parse_wifi;
    }
parse_prism_header:
    {
        unsigned int header_length;
        if (offset+(8) > length) return 0; else {info->found_offset=offset; info->found=FOUND_PRISM;};
        if (( *((unsigned char *)(px+offset+0)+0)<< 0 | *((unsigned char *)(px+offset+0)+1)<< 8 | *((unsigned char *)(px+offset+0)+2)<<16 | *((unsigned char *)(px+offset+0)+3)<<24 ) != 0x00000044)
            return 0;
        header_length = ( *((unsigned char *)(px+offset+4)+0)<< 0 | *((unsigned char *)(px+offset+4)+1)<< 8 | *((unsigned char *)(px+offset+4)+2)<<16 | *((unsigned char *)(px+offset+4)+3)<<24 );
        if (header_length > 0xFFFFF)
            return 0;
        if (offset+(header_length) > length) return 0; else {info->found_offset=offset; info->found=FOUND_PRISM;};
        offset += header_length;
        goto parse_wifi;
    }
parse_llc:
    {
        unsigned int oui;
        if (offset+(3) > length) return 0; else {info->found_offset=offset; info->found=FOUND_LLC;};
        switch (( *((unsigned char *)(px+offset)+0)<<16 | *((unsigned char *)(px+offset)+1)<< 8 | *((unsigned char *)(px+offset)+2)<< 0 )) {
        case 0x0000aa: offset += 2; goto parse_llc;
        default: return 0;
        case 0xaaaa03: break;
        }
        offset +=3 ;
        if (offset+(5) > length) return 0; else {info->found_offset=offset; info->found=FOUND_LLC;};
        oui = ( *((unsigned char *)(px+offset)+0)<<16 | *((unsigned char *)(px+offset)+1)<< 8 | *((unsigned char *)(px+offset)+2)<< 0 );
        ethertype = ( *((unsigned char *)(px+offset+3)+0)<< 8 | *((unsigned char *)(px+offset+3)+1)<< 0 );
        offset += 5;
        switch (oui){
        case 0x000000: goto parse_ethertype;
        default: return 0;
        }
    }
parse_ethertype:
    switch (ethertype) {
    case 0x0800: goto parse_ipv4;
    case 0x0806: goto parse_arp;
    case 0x86dd: goto parse_ipv6;
    case 0x8100: goto parse_vlan8021q;
    case 0x8847: goto parse_vlanmpls;
    default: return 0;
    }
parse_linktype:
    switch (link_type) {
        case 0:
            offset += 4;
            switch (( *((unsigned char *)(px)+0)<<24 | *((unsigned char *)(px)+1)<<16 | *((unsigned char *)(px)+2)<< 8 | *((unsigned char *)(px)+3)<< 0 )) {
                case 0x02000000:
                case 0x00000002:
                    goto parse_ipv4;
                case 0x18000000:
                case 0x00000018:
                case 0x1c000000:
                case 0x0000001c:
                case 0x1e000000:
                case 0x0000001e:
                    goto parse_ipv6;
            }
            return 0;
        case 1: goto parse_ethernet;
        case 12:
            switch (px[offset]>>4) {
  case 4: goto parse_ipv4;
                case 6: goto parse_ipv6;
            }
            return 0;
        case 0x69: goto parse_wifi;
        case 113: goto parse_linux_sll;
        case 119: goto parse_prism_header;
        case 127: goto parse_radiotap_header;
        default: return 0;
    }
parse_linux_sll:
    {
        struct { unsigned int packet_type; unsigned int arp_type; unsigned int addr_length; unsigned char mac_address[8]; unsigned int ethertype; } sll;
        if (offset+(16) > length) return 0; else {info->found_offset=offset; info->found=FOUND_SLL;};
        sll.packet_type = ( *((unsigned char *)(px+offset+0)+0)<< 8 | *((unsigned char *)(px+offset+0)+1)<< 0 );
        sll.arp_type = ( *((unsigned char *)(px+offset+2)+0)<< 8 | *((unsigned char *)(px+offset+2)+1)<< 0 );
        sll.addr_length = ( *((unsigned char *)(px+offset+4)+0)<< 8 | *((unsigned char *)(px+offset+4)+1)<< 0 );
        memcpy(sll.mac_address, px+offset+6, 8);
        sll.ethertype = ( *((unsigned char *)(px+offset+14)+0)<< 8 | *((unsigned char *)(px+offset+14)+1)<< 0 );
        offset += 16;
        goto parse_ethertype;
    }
parse_arp:
    info->ip_version = 256;
    info->ip_offset = offset;
    {
        unsigned int hardware_length;
        unsigned int protocol_length;
        unsigned int opcode;
        if (offset+(8) > length) return 0; else {info->found_offset=offset; info->found=FOUND_ARP;};
        hardware_length = px[offset+4];
        protocol_length = px[offset+5];
        opcode = px[offset+6]<<8 | px[offset+7];
        info->opcode = opcode;
        info->ip_protocol = opcode;
        offset += 8;
        if (offset+(2*hardware_length + 2*protocol_length) > length) return 0; else {info->found_offset=offset; info->found=FOUND_ARP;};
        info->_ip_src = px + offset + hardware_length;
        info->_ip_dst = px + offset + 2*hardware_length + protocol_length;
        info->src_ip.version = 4;
        info->src_ip.ipv4 = px[offset + hardware_length + 0] << 24
                            | px[offset + hardware_length + 1] << 16
                            | px[offset + hardware_length + 2] << 8
                            | px[offset + hardware_length + 3] << 0;
        info->dst_ip.version = 4;
        info->dst_ip.ipv4 = px[offset + 2*hardware_length + protocol_length + 0] << 24
                            | px[offset + 2*hardware_length + protocol_length + 1] << 16
                            | px[offset + 2*hardware_length + protocol_length + 2] << 8
                            | px[offset + 2*hardware_length + protocol_length + 3] << 0;
        info->found_offset = info->ip_offset;
        return 1;
    }
}

variable_types:
px
unsigned char *

variable_types:
length
unsigned int

variable_types: struct PreprocessedInfo { unsigned char *mac_src; unsigned char *mac_dst; unsigned char *mac_bss; unsigned int ip_offset; unsigned int ip_version; unsigned int ip_protocol; unsigned int ip_length; unsigned int ip_ttl; unsigned char *_ip_src; unsigned char *_ip_dst; struct ipaddress { union { unsigned int ipv4; struct ipv6address { unsigned long hi; unsigned long lo; } ipv6; }; unsigned char version; } src_ip; struct ipaddress dst_ip; unsigned int transport_offset; unsigned int transport_length; union { unsigned int port_src; unsigned int opcode; }; unsigned int port_dst; unsigned int app_offset; unsigned int app_length; int found; int found_offset; } *

variable_types:
offset
unsigned int

variable_types:
ethertype
unsigned int

variable_types:
flags
unsigned int

variable_types:
len
unsigned int

variable_types:
flag
unsigned int

variable_types:
features
unsigned int

variable_types:
oui
unsigned int

variable_types:
opcode
unsigned int

user_defined_types: struct PreprocessedInfo { unsigned char *mac_src; unsigned char *mac_dst; unsigned char *mac_bss; unsigned int ip_offset; unsigned int ip_version; unsigned int ip_protocol; unsigned int ip_length; unsigned int ip_ttl; unsigned char *_ip_src; unsigned char *_ip_dst; struct ipaddress src_ip; struct ipaddress dst_ip; unsigned int transport_offset; unsigned int transport_length; union { unsigned int port_src; unsigned int opcode; }; unsigned int port_dst; unsigned int app_offset; unsigned int app_length; int found; int found_offset; }

user_defined_types: struct ipaddress { union { unsigned int ipv4; struct ipv6address ipv6; }; unsigned char version; }