decompiled_code:
__int64 __fastcall rx_process_asr(__int64 a1)
{
__int64 v1; // rax
unsigned int *v2; // rbp
__int64 v3; // rbx
const char *v5; // rbp
unsigned int v6; // eax
const char *v7; // r12
unsigned int v8; // eax
const char *v9; // r12
unsigned int v10; // eax
const char *v11; // rbx
unsigned int v12; // eax
const char *v13; // r12
unsigned int v14; // eax

if ( !a1 )
return 0LL;
v1 = *(_QWORD *)(a1 + 24);
if ( v1 )
{
v2 = (unsigned int *)((__int64 (__fastcall *)(_QWORD, _QWORD))cdpb[29])(*(_QWORD *)(v1 + 32), *(_QWORD *)(v1 + 40));
if ( v2 )
{
v3 = (unsigned int)rx_get_abort_cause(a1);
if ( (int)get_debug_level("ims_qos", 7LL) > 2 && !dprint_crit )
{
++dprint_crit;
if ( log_stderr )
{
if ( log_color )
dprint_color(3LL);
v7 = (const char *)*((_QWORD *)&log_level_info + 16);
v8 = my_pid();
fprintf(
stderr,
"%2d(%d) %s: %s%s(): abort-cause code is %u\n",
process_no,
v8,
v7,
"ims_qos [rx_asr.c:87]: ",
"rx_process_asr",
v3);
if ( log_color )
dprint_color_reset();
}
else
{
syslog(
*((_DWORD *)&log_level_info + 34) | *(_DWORD *)(core_cfg + 4LL),
"%s: %s%s(): abort-cause code is %u\n",
*((const char **)&log_level_info + 16),
"ims_qos [rx_asr.c:87]: ",
"rx_process_asr",
(unsigned int)v3);
}
--dprint_crit;
}
if ( (int)get_debug_level("ims_qos", 7LL) > 2 && !dprint_crit )
{
++dprint_crit;
if ( log_stderr )
{
if ( log_color )
dprint_color(3LL);
v9 = (const char *)*((_QWORD *)&log_level_info + 16);
v10 = my_pid();
fprintf(
stderr,
"%2d(%d) %s: %s%s(): PCRF requested an ASR",
process_no,
v10,
v9,
"ims_qos [rx_asr.c:89]: ",
"rx_process_asr");
if ( log_color )
dprint_color_reset();
}
else
{
syslog(
*((_DWORD *)&log_level_info + 34) | *(_DWORD *)(core_cfg + 4LL),
"%s: %s%s(): PCRF requested an ASR",
*((const char **)&log_level_info + 16),
"ims_qos [rx_asr.c:89]: ",
"rx_process_asr");
}
--dprint_crit;
}
if ( *(_DWORD *)(*((_QWORD *)v2 + 13) + 48LL) )
{
if ( (int)get_debug_level("ims_qos", 7LL) > 2 && !dprint_crit )
{
++dprint_crit;
if ( log_stderr )
{
if ( log_color )
dprint_color(3LL);
v11 = (const char *)*((_QWORD *)&log_level_info + 16);
v12 = my_pid();
fprintf(
stderr,
"%2d(%d) %s: %s%s(): This is a subscription to signalling status\n",
process_no,
v12,
v11,
"ims_qos [rx_asr.c:94]: ",
"rx_process_asr");
if ( log_color )
dprint_color_reset();
}
else
{
syslog(
*((_DWORD *)&log_level_info + 34) | *(_DWORD *)(core_cfg + 4LL),
"%s: %s%s(): This is a subscription to signalling status\n",
*((const char **)&log_level_info + 16),
"ims_qos [rx_asr.c:94]: ",
"rx_process_asr");
}
--dprint_crit;
}
}
else if ( (int)get_debug_level("ims_qos", 7LL) > 2 && !dprint_crit )
{
++dprint_crit;
if ( log_stderr )
{
if ( log_color )
dprint_color(3LL);
v13 = (const char *)*((_QWORD *)&log_level_info + 16);
v14 = my_pid();
fprintf(
stderr,
"%2d(%d) %s: %s%s(): This is a normal media bearer - bearer is releaed by CDP callbacks\n",
process_no,
v14,
v13,
"ims_qos [rx_asr.c:96]: ",
"rx_process_asr");
if ( log_color )
dprint_color_reset();
}
else
{
syslog(
*((_DWORD *)&log_level_info + 34) | *(_DWORD *)(core_cfg + 4LL),
"%s: %s%s(): This is a normal media bearer - bearer is releaed by CDP callbacks\n",
*((const char **)&log_level_info + 16),
"ims_qos [rx_asr.c:96]: ",
"rx_process_asr");
}
--dprint_crit;
}
cdpb[26](*v2);
}
else if ( (int)get_debug_level("ims_qos", 7LL) > 2 && !dprint_crit )
{
++dprint_crit;
if ( log_stderr )
{
if ( log_color )
dprint_color(3LL);
v5 = (const char *)*((_QWORD *)&log_level_info + 16);
v6 = my_pid();
fprintf(
stderr,
"%2d(%d) %s: %s%s(): received an ASR but the session is already deleted\n",
process_no,
v6,
v5,
"ims_qos [rx_asr.c:82]: ",
"rx_process_asr");
if ( log_color )
dprint_color_reset();
}
else
{
syslog(
*((_DWORD *)&log_level_info + 34) | *(_DWORD *)(core_cfg + 4LL),
"%s: %s%s(): received an ASR but the session is already deleted\n",
*((const char **)&log_level_info + 16),
"ims_qos [rx_asr.c:82]: ",
"rx_process_asr");
}
--dprint_crit;
}
}
return 0LL;
}

canonical_decompiled_code:
__int64 __fastcall func0(__int64 a1)
{
__int64 v1; // rax
unsigned int *v2; // rbp
__int64 v3; // rbx
const char *v5; // rbp
unsigned int v6; // eax
const char *v7; // r12
unsigned int v8; // eax
const char *v9; // r12
unsigned int v10; // eax
const char *v11; // rbx
unsigned int v12; // eax
const char *v13; // r12
unsigned int v14; // eax

if ( !a1 )
return 0LL;
v1 = *(_QWORD *)(a1 + 24);
if ( v1 )
{
v2 = (unsigned int *)((__int64 (__fastcall *)(_QWORD, _QWORD))cdpb[29])(*(_QWORD *)(v1 + 32), *(_QWORD *)(v1 + 40));
if ( v2 )
{
v3 = (unsigned int)rx_get_abort_cause(a1);
if ( (int)get_debug_level("ims_qos", 7LL) > 2 && !dprint_crit )
{
++dprint_crit;
if ( log_stderr )
{
if ( log_color )
dprint_color(3LL);
v7 = (const char *)*((_QWORD *)&log_level_info + 16);
v8 = my_pid();
fprintf(
stderr,
"%2d(%d) %s: %s%s(): abort-cause code is %u\n",
process_no,
v8,
v7,
"ims_qos [rx_asr.c:87]: ",
"rx_process_asr",
v3);
if ( log_color )
dprint_color_reset();
}
else
{
syslog(
*((_DWORD *)&log_level_info + 34) | *(_DWORD *)(core_cfg + 4LL),
"%s: %s%s(): abort-cause code is %u\n",
*((const char **)&log_level_info + 16),
"ims_qos [rx_asr.c:87]: ",
"rx_process_asr",
(unsigned int)v3);
}
--dprint_crit;
}
if ( (int)get_debug_level("ims_qos", 7LL) > 2 && !dprint_crit )
{
++dprint_crit;
if ( log_stderr )
{
if ( log_color )
dprint_color(3LL);
v9 = (const char *)*((_QWORD *)&log_level_info + 16);
v10 = my_pid();
fprintf(
stderr,
"%2d(%d) %s: %s%s(): PCRF requested an ASR",
process_no,
v10,
v9,
"ims_qos [rx_asr.c:89]: ",
"rx_process_asr");
if ( log_color )
dprint_color_reset();
}
else
{
syslog(
*((_DWORD *)&log_level_info + 34) | *(_DWORD *)(core_cfg + 4LL),
"%s: %s%s(): PCRF requested an ASR",
*((const char **)&log_level_info + 16),
"ims_qos [rx_asr.c:89]: ",
"rx_process_asr");
}
--dprint_crit;
}
if ( *(_DWORD *)(*((_QWORD *)v2 + 13) + 48LL) )
{
if ( (int)get_debug_level("ims_qos", 7LL) > 2 && !dprint_crit )
{
++dprint_crit;
if ( log_stderr )
{
if ( log_color )
dprint_color(3LL);
v11 = (const char *)*((_QWORD *)&log_level_info + 16);
v12 = my_pid();
fprintf(
stderr,
"%2d(%d) %s: %s%s(): This is a subscription to signalling status\n",
process_no,
v12,
v11,
"ims_qos [rx_asr.c:94]: ",
"rx_process_asr");
if ( log_color )
dprint_color_reset();
}
else
{
syslog(
*((_DWORD *)&log_level_info + 34) | *(_DWORD *)(core_cfg + 4LL),
"%s: %s%s(): This is a subscription to signalling status\n",
*((const char **)&log_level_info + 16),
"ims_qos [rx_asr.c:94]: ",
"rx_process_asr");
}
--dprint_crit;
}
}
else if ( (int)get_debug_level("ims_qos", 7LL) > 2 && !dprint_crit )
{
++dprint_crit;
if ( log_stderr )
{
if ( log_color )
dprint_color(3LL);
v13 = (const char *)*((_QWORD *)&log_level_info + 16);
v14 = my_pid();
fprintf(
stderr,
"%2d(%d) %s: %s%s(): This is a normal media bearer - bearer is releaed by CDP callbacks\n",
process_no,
v14,
v13,
"ims_qos [rx_asr.c:96]: ",
"rx_process_asr");
if ( log_color )
dprint_color_reset();
}
else
{
syslog(
*((_DWORD *)&log_level_info + 34) | *(_DWORD *)(core_cfg + 4LL),
"%s: %s%s(): This is a normal media bearer - bearer is releaed by CDP callbacks\n",
*((const char **)&log_level_info + 16),
"ims_qos [rx_asr.c:96]: ",
"rx_process_asr");
}
--dprint_crit;
}
cdpb[26](*v2);
}
else if ( (int)get_debug_level("ims_qos", 7LL) > 2 && !dprint_crit )
{
++dprint_crit;
if ( log_stderr )
{
if ( log_color )
dprint_color(3LL);
v5 = (const char *)*((_QWORD *)&log_level_info + 16);
v6 = my_pid();
fprintf(
stderr,
"%2d(%d) %s: %s%s(): received an ASR but the session is already deleted\n",
process_no,
v6,
v5,
"ims_qos [rx_asr.c:82]: ",
"rx_process_asr");
if ( log_color )
dprint_color_reset();
}
else
{
syslog(
*((_DWORD *)&log_level_info + 34) | *(_DWORD *)(core_cfg + 4LL),
"%s: %s%s(): received an ASR but the session is already deleted\n",
*((const char **)&log_level_info + 16),
"ims_qos [rx_asr.c:82]: ",
"rx_process_asr");
}
--dprint_crit;
}
}
return 0LL;
}

original_code:
AAAMessage* rx_process_asr(AAAMessage *request) {
    AAASession* session;
    unsigned int code = 0;
    rx_authsessiondata_t* p_session_data = 0;
    if (!request || !request->sessionId) return 0;
    session = cdpb.AAAGetAuthSession(request->sessionId->data);
    if (!session) {
        do { if (get_debug_level("ims_qos", (sizeof("ims_qos")-1)) >= ((3)) && (dprint_crit==0)) { (dprint_crit++); if (__builtin_expect(!!((((3)) >= -5) && (((3)) <= 3)), 1)){ if (__builtin_expect(!!(log_stderr), 0)) { if (__builtin_expect(!!(log_color), 0)) dprint_color((3)); fprintf(stderr, "%2d(%d) %s: %s" "%s(): " "received an ASR but the session is already deleted\n", process_no, my_pid(), (log_level_info[((3)) - (-5)].name), ("ims_qos" " [" "rx_asr.c" ":" "82" "]: ") , __func__); if (__builtin_expect(!!(log_color), 0)) dprint_color_reset(); } else { syslog((log_level_info[((3)) - (-5)].syslog_level) | (((0) != 0) ? (0) : ((struct cfg_group_core *)core_cfg)->log_facility), "%s: %s" "%s(): " "received an ASR but the session is already deleted\n", (log_level_info[((3)) - (-5)].name), ("ims_qos" " [" "rx_asr.c" ":" "82" "]: ") , __func__); } } else { if (log_stderr) { if (__builtin_expect(!!(log_color), 0)) dprint_color((3)); fprintf(stderr, "%2d(%d) %s" "%s(): " "received an ASR but the session is already deleted\n", process_no, my_pid(), ("ims_qos" " [" "rx_asr.c" ":" "82" "]: ") , __func__); if (__builtin_expect(!!(log_color), 0)) dprint_color_reset(); } else { if (((3))<-5) syslog((log_level_info[(-5) - (-5)].syslog_level) | (((0) != 0) ? (0) : ((struct cfg_group_core *)core_cfg)->log_facility), "%s" "%s(): " "received an ASR but the session is already deleted\n", ("ims_qos" " [" "rx_asr.c" ":" "82" "]: ") , __func__); else syslog((log_level_info[(3) - (-5)].syslog_level) | (((0) != 0) ? (0) : ((struct cfg_group_core *)core_cfg)->log_facility), "%s" "%s(): " "received an ASR but the session is already deleted\n", ("ims_qos" " [" "rx_asr.c" ":" "82" "]: ") , __func__); } } (dprint_crit--); } } while(0);
        return 0;
    }
    code = rx_get_abort_cause(request);
    do { if (get_debug_level("ims_qos", (sizeof("ims_qos")-1)) >= ((3)) && (dprint_crit==0)) { (dprint_crit++); if (__builtin_expect(!!((((3)) >= -5) && (((3)) <= 3)), 1)){ if (__builtin_expect(!!(log_stderr), 0)) { if (__builtin_expect(!!(log_color), 0)) dprint_color((3)); fprintf(stderr, "%2d(%d) %s: %s" "%s(): " "abort-cause code is %u\n", process_no, my_pid(), (log_level_info[((3)) - (-5)].name), ("ims_qos" " [" "rx_asr.c" ":" "87" "]: ") , __func__, code); if (__builtin_expect(!!(log_color), 0)) dprint_color_reset(); } else { syslog((log_level_info[((3)) - (-5)].syslog_level) | (((0) != 0) ? (0) : ((struct cfg_group_core *)core_cfg)->log_facility), "%s: %s" "%s(): " "abort-cause code is %u\n", (log_level_info[((3)) - (-5)].name), ("ims_qos" " [" "rx_asr.c" ":" "87" "]: ") , __func__, code); } } else { if (log_stderr) { if (__builtin_expect(!!(log_color), 0)) dprint_color((3)); fprintf(stderr, "%2d(%d) %s" "%s(): " "abort-cause code is %u\n", process_no, my_pid(), ("ims_qos" " [" "rx_asr.c" ":" "87" "]: ") , __func__, code); if (__builtin_expect(!!(log_color), 0)) dprint_color_reset(); } else { if (((3))<-5) syslog((log_level_info[(-5) - (-5)].syslog_level) | (((0) != 0) ? (0) : ((struct cfg_group_core *)core_cfg)->log_facility), "%s" "%s(): " "abort-cause code is %u\n", ("ims_qos" " [" "rx_asr.c" ":" "87" "]: ") , __func__, code); else syslog((log_level_info[(3) - (-5)].syslog_level) | (((0) != 0) ? (0) : ((struct cfg_group_core *)core_cfg)->log_facility), "%s" "%s(): " "abort-cause code is %u\n", ("ims_qos" " [" "rx_asr.c" ":" "87" "]: ") , __func__, code); } } (dprint_crit--); } } while(0);
    do { if (get_debug_level("ims_qos", (sizeof("ims_qos")-1)) >= ((3)) && (dprint_crit==0)) { (dprint_crit++); if (__builtin_expect(!!((((3)) >= -5) && (((3)) <= 3)), 1)){ if (__builtin_expect(!!(log_stderr), 0)) { if (__builtin_expect(!!(log_color), 0)) dprint_color((3)); fprintf(stderr, "%2d(%d) %s: %s" "%s(): " "PCRF requested an ASR", process_no, my_pid(), (log_level_info[((3)) - (-5)].name), ("ims_qos" " [" "rx_asr.c" ":" "89" "]: ") , __func__); if (__builtin_expect(!!(log_color), 0)) dprint_color_reset(); } else { syslog((log_level_info[((3)) - (-5)].syslog_level) | (((0) != 0) ? (0) : ((struct cfg_group_core *)core_cfg)->log_facility), "%s: %s" "%s(): " "PCRF requested an ASR", (log_level_info[((3)) - (-5)].name), ("ims_qos" " [" "rx_asr.c" ":" "89" "]: ") , __func__); } } else { if (log_stderr) { if (__builtin_expect(!!(log_color), 0)) dprint_color((3)); fprintf(stderr, "%2d(%d) %s" "%s(): " "PCRF requested an ASR", process_no, my_pid(), ("ims_qos" " [" "rx_asr.c" ":" "89" "]: ") , __func__); if (__builtin_expect(!!(log_color), 0)) dprint_color_reset(); } else { if (((3))<-5) syslog((log_level_info[(-5) - (-5)].syslog_level) | (((0) != 0) ? (0) : ((struct cfg_group_core *)core_cfg)->log_facility), "%s" "%s(): " "PCRF requested an ASR", ("ims_qos" " [" "rx_asr.c" ":" "89" "]: ") , __func__); else syslog((log_level_info[(3) - (-5)].syslog_level) | (((0) != 0) ? (0) : ((struct cfg_group_core *)core_cfg)->log_facility), "%s" "%s(): " "PCRF requested an ASR", ("ims_qos" " [" "rx_asr.c" ":" "89" "]: ") , __func__); } } (dprint_crit--); } } while(0);
    p_session_data = (rx_authsessiondata_t*) session->u.auth.generic_data;
    if (p_session_data->subscribed_to_signaling_path_status) {
        do { if (get_debug_level("ims_qos", (sizeof("ims_qos")-1)) >= ((3)) && (dprint_crit==0)) { (dprint_crit++); if (__builtin_expect(!!((((3)) >= -5) && (((3)) <= 3)), 1)){ if (__builtin_expect(!!(log_stderr), 0)) { if (__builtin_expect(!!(log_color), 0)) dprint_color((3)); fprintf(stderr, "%2d(%d) %s: %s" "%s(): " "This is a subscription to signalling status\n", process_no, my_pid(), (log_level_info[((3)) - (-5)].name), ("ims_qos" " [" "rx_asr.c" ":" "94" "]: ") , __func__); if (__builtin_expect(!!(log_color), 0)) dprint_color_reset(); } else { syslog((log_level_info[((3)) - (-5)].syslog_level) | (((0) != 0) ? (0) : ((struct cfg_group_core *)core_cfg)->log_facility), "%s: %s" "%s(): " "This is a subscription to signalling status\n", (log_level_info[((3)) - (-5)].name), ("ims_qos" " [" "rx_asr.c" ":" "94" "]: ") , __func__); } } else { if (log_stderr) { if (__builtin_expect(!!(log_color), 0)) dprint_color((3)); fprintf(stderr, "%2d(%d) %s" "%s(): " "This is a subscription to signalling status\n", process_no, my_pid(), ("ims_qos" " [" "rx_asr.c" ":" "94" "]: ") , __func__); if (__builtin_expect(!!(log_color), 0)) dprint_color_reset(); } else { if (((3))<-5) syslog((log_level_info[(-5) - (-5)].syslog_level) | (((0) != 0) ? (0) : ((struct cfg_group_core *)core_cfg)->log_facility), "%s" "%s(): " "This is a subscription to signalling status\n", ("ims_qos" " [" "rx_asr.c" ":" "94" "]: ") , __func__); else syslog((log_level_info[(3) - (-5)].syslog_level) | (((0) != 0) ? (0) : ((struct cfg_group_core *)core_cfg)->log_facility), "%s" "%s(): " "This is a subscription to signalling status\n", ("ims_qos" " [" "rx_asr.c" ":" "94" "]: ") , __func__); } } (dprint_crit--); } } while(0);
    } else {
        do { if (get_debug_level("ims_qos", (sizeof("ims_qos")-1)) >= ((3)) && (dprint_crit==0)) { (dprint_crit++); if (__builtin_expect(!!((((3)) >= -5) && (((3)) <= 3)), 1)){ if (__builtin_expect(!!(log_stderr), 0)) { if (__builtin_expect(!!(log_color), 0)) dprint_color((3)); fprintf(stderr, "%2d(%d) %s: %s" "%s(): " "This is a normal media bearer -  bearer is releaed by CDP callbacks\n", process_no, my_pid(), (log_level_info[((3)) - (-5)].name), ("ims_qos" " [" "rx_asr.c" ":" "96" "]: ") , __func__); if (__builtin_expect(!!(log_color), 0)) dprint_color_reset(); } else { syslog((log_level_info[((3)) - (-5)].syslog_level) | (((0) != 0) ? (0) : ((struct cfg_group_core *)core_cfg)->log_facility), "%s: %s" "%s(): " "This is a normal media bearer -  bearer is releaed by CDP callbacks\n", (log_level_info[((3)) - (-5)].name), ("ims_qos" " [" "rx_asr.c" ":" "96" "]: ") , __func__); } } else { if (log_stderr) { if (__builtin_expect(!!(log_color), 0)) dprint_color((3)); fprintf(stderr, "%2d(%d) %s" "%s(): " "This is a normal media bearer -  bearer is releaed by CDP callbacks\n", process_no, my_pid(), ("ims_qos" " [" "rx_asr.c" ":" "96" "]: ") , __func__); if (__builtin_expect(!!(log_color), 0)) dprint_color_reset(); } else { if (((3))<-5) syslog((log_level_info[(-5) - (-5)].syslog_level) | (((0) != 0) ? (0) : ((struct cfg_group_core *)core_cfg)->log_facility), "%s" "%s(): " "This is a normal media bearer -  bearer is releaed by CDP callbacks\n", ("ims_qos" " [" "rx_asr.c" ":" "96" "]: ") , __func__); else syslog((log_level_info[(3) - (-5)].syslog_level) | (((0) != 0) ? (0) : ((struct cfg_group_core *)core_cfg)->log_facility), "%s" "%s(): " "This is a normal media bearer -  bearer is releaed by CDP callbacks\n", ("ims_qos" " [" "rx_asr.c" ":" "96" "]: ") , __func__); } } (dprint_crit--); } } while(0);
    }
    cdpb.AAASessionsUnlock(session->hash);
    return 0;
}

canonical_original_code:
struct _message_t *rx_process_asr(struct _message_t *request) {
    struct _cdp_session_t *session;
    unsigned int code = 0;
    struct rx_authsessiondata *p_session_data = 0;
    if (!request || !request->sessionId) return 0;
    session = cdpb.AAAGetAuthSession(request->sessionId->data);
    if (!session) {
        do { if (get_debug_level("ims_qos", (sizeof("ims_qos")-1)) >= ((3)) && (dprint_crit==0)) { (dprint_crit++); if (__builtin_expect(!!((((3)) >= -5) && (((3)) <= 3)), 1)){ if (__builtin_expect(!!(log_stderr), 0)) { if (__builtin_expect(!!(log_color), 0)) dprint_color((3)); fprintf(stderr, "%2d(%d) %s: %s" "%s(): " "received an ASR but the session is already deleted\n", process_no, my_pid(), (log_level_info[((3)) - (-5)].name), ("ims_qos" " [" "rx_asr.c" ":" "82" "]: ") , __func__); if (__builtin_expect(!!(log_color), 0)) dprint_color_reset(); } else { syslog((log_level_info[((3)) - (-5)].syslog_level) | (((0) != 0) ? (0) : ((struct cfg_group_core *)core_cfg)->log_facility), "%s: %s" "%s(): " "received an ASR but the session is already deleted\n", (log_level_info[((3)) - (-5)].name), ("ims_qos" " [" "rx_asr.c" ":" "82" "]: ") , __func__); } } else { if (log_stderr) { if (__builtin_expect(!!(log_color), 0)) dprint_color((3)); fprintf(stderr, "%2d(%d) %s" "%s(): " "received an ASR but the session is already deleted\n", process_no, my_pid(), ("ims_qos" " [" "rx_asr.c" ":" "82" "]: ") , __func__); if (__builtin_expect(!!(log_color), 0)) dprint_color_reset(); } else { if (((3))<-5) syslog((log_level_info[(-5) - (-5)].syslog_level) | (((0) != 0) ? (0) : ((struct cfg_group_core *)core_cfg)->log_facility), "%s" "%s(): " "received an ASR but the session is already deleted\n", ("ims_qos" " [" "rx_asr.c" ":" "82" "]: ") , __func__); else syslog((log_level_info[(3) - (-5)].syslog_level) | (((0) != 0) ? (0) : ((struct cfg_group_core *)core_cfg)->log_facility), "%s" "%s(): " "received an ASR but the session is already deleted\n", ("ims_qos" " [" "rx_asr.c" ":" "82" "]: ") , __func__); } } (dprint_crit--); } } while(0);
        return 0;
    }
    code = rx_get_abort_cause(request);
    do { if (get_debug_level("ims_qos", (sizeof("ims_qos")-1)) >= ((3)) && (dprint_crit==0)) { (dprint_crit++); if (__builtin_expect(!!((((3)) >= -5) && (((3)) <= 3)), 1)){ if (__builtin_expect(!!(log_stderr), 0)) { if (__builtin_expect(!!(log_color), 0)) dprint_color((3)); fprintf(stderr, "%2d(%d) %s: %s" "%s(): " "abort-cause code is %u\n", process_no, my_pid(), (log_level_info[((3)) - (-5)].name), ("ims_qos" " [" "rx_asr.c" ":" "87" "]: ") , __func__, code); if (__builtin_expect(!!(log_color), 0)) dprint_color_reset(); } else { syslog((log_level_info[((3)) - (-5)].syslog_level) | (((0) != 0) ? (0) : ((struct cfg_group_core *)core_cfg)->log_facility), "%s: %s" "%s(): " "abort-cause code is %u\n", (log_level_info[((3)) - (-5)].name), ("ims_qos" " [" "rx_asr.c" ":" "87" "]: ") , __func__, code); } } else { if (log_stderr) { if (__builtin_expect(!!(log_color), 0)) dprint_color((3)); fprintf(stderr, "%2d(%d) %s" "%s(): " "abort-cause code is %u\n", process_no, my_pid(), ("ims_qos" " [" "rx_asr.c" ":" "87" "]: ") , __func__, code); if (__builtin_expect(!!(log_color), 0)) dprint_color_reset(); } else { if (((3))<-5) syslog((log_level_info[(-5) - (-5)].syslog_level) | (((0) != 0) ? (0) : ((struct cfg_group_core *)core_cfg)->log_facility), "%s" "%s(): " "abort-cause code is %u\n", ("ims_qos" " [" "rx_asr.c" ":" "87" "]: ") , __func__, code); else syslog((log_level_info[(3) - (-5)].syslog_level) | (((0) != 0) ? (0) : ((struct cfg_group_core *)core_cfg)->log_facility), "%s" "%s(): " "abort-cause code is %u\n", ("ims_qos" " [" "rx_asr.c" ":" "87" "]: ") , __func__, code); } } (dprint_crit--); } } while(0);
    do { if (get_debug_level("ims_qos", (sizeof("ims_qos")-1)) >= ((3)) && (dprint_crit==0)) { (dprint_crit++); if (__builtin_expect(!!((((3)) >= -5) && (((3)) <= 3)), 1)){ if (__builtin_expect(!!(log_stderr), 0)) { if (__builtin_expect(!!(log_color), 0)) dprint_color((3)); fprintf(stderr, "%2d(%d) %s: %s" "%s(): " "PCRF requested an ASR", process_no, my_pid(), (log_level_info[((3)) - (-5)].name), ("ims_qos" " [" "rx_asr.c" ":" "89" "]: ") , __func__); if (__builtin_expect(!!(log_color), 0)) dprint_color_reset(); } else { syslog((log_level_info[((3)) - (-5)].syslog_level) | (((0) != 0) ? (0) : ((struct cfg_group_core *)core_cfg)->log_facility), "%s: %s" "%s(): " "PCRF requested an ASR", (log_level_info[((3)) - (-5)].name), ("ims_qos" " [" "rx_asr.c" ":" "89" "]: ") , __func__); } } else { if (log_stderr) { if (__builtin_expect(!!(log_color), 0)) dprint_color((3)); fprintf(stderr, "%2d(%d) %s" "%s(): " "PCRF requested an ASR", process_no, my_pid(), ("ims_qos" " [" "rx_asr.c" ":" "89" "]: ") , __func__); if (__builtin_expect(!!(log_color), 0)) dprint_color_reset(); } else { if (((3))<-5) syslog((log_level_info[(-5) - (-5)].syslog_level) | (((0) != 0) ? (0) : ((struct cfg_group_core *)core_cfg)->log_facility), "%s" "%s(): " "PCRF requested an ASR", ("ims_qos" " [" "rx_asr.c" ":" "89" "]: ") , __func__); else syslog((log_level_info[(3) - (-5)].syslog_level) | (((0) != 0) ? (0) : ((struct cfg_group_core *)core_cfg)->log_facility), "%s" "%s(): " "PCRF requested an ASR", ("ims_qos" " [" "rx_asr.c" ":" "89" "]: ") , __func__); } } (dprint_crit--); } } while(0);
    p_session_data = (struct rx_authsessiondata *) session->u.auth.generic_data;
    if (p_session_data->subscribed_to_signaling_path_status) {
        do { if (get_debug_level("ims_qos", (sizeof("ims_qos")-1)) >= ((3)) && (dprint_crit==0)) { (dprint_crit++); if (__builtin_expect(!!((((3)) >= -5) && (((3)) <= 3)), 1)){ if (__builtin_expect(!!(log_stderr), 0)) { if (__builtin_expect(!!(log_color), 0)) dprint_color((3)); fprintf(stderr, "%2d(%d) %s: %s" "%s(): " "This is a subscription to signalling status\n", process_no, my_pid(), (log_level_info[((3)) - (-5)].name), ("ims_qos" " [" "rx_asr.c" ":" "94" "]: ") , __func__); if (__builtin_expect(!!(log_color), 0)) dprint_color_reset(); } else { syslog((log_level_info[((3)) - (-5)].syslog_level) | (((0) != 0) ? (0) : ((struct cfg_group_core *)core_cfg)->log_facility), "%s: %s" "%s(): " "This is a subscription to signalling status\n", (log_level_info[((3)) - (-5)].name), ("ims_qos" " [" "rx_asr.c" ":" "94" "]: ") , __func__); } } else { if (log_stderr) { if (__builtin_expect(!!(log_color), 0)) dprint_color((3)); fprintf(stderr, "%2d(%d) %s" "%s(): " "This is a subscription to signalling status\n", process_no, my_pid(), ("ims_qos" " [" "rx_asr.c" ":" "94" "]: ") , __func__); if (__builtin_expect(!!(log_color), 0)) dprint_color_reset(); } else { if (((3))<-5) syslog((log_level_info[(-5) - (-5)].syslog_level) | (((0) != 0) ? (0) : ((struct cfg_group_core *)core_cfg)->log_facility), "%s" "%s(): " "This is a subscription to signalling status\n", ("ims_qos" " [" "rx_asr.c" ":" "94" "]: ") , __func__); else syslog((log_level_info[(3) - (-5)].syslog_level) | (((0) != 0) ? (0) : ((struct cfg_group_core *)core_cfg)->log_facility), "%s" "%s(): " "This is a subscription to signalling status\n", ("ims_qos" " [" "rx_asr.c" ":" "94" "]: ") , __func__); } } (dprint_crit--); } } while(0);
    } else {
        do { if (get_debug_level("ims_qos", (sizeof("ims_qos")-1)) >= ((3)) && (dprint_crit==0)) { (dprint_crit++); if (__builtin_expect(!!((((3)) >= -5) && (((3)) <= 3)), 1)){ if (__builtin_expect(!!(log_stderr), 0)) { if (__builtin_expect(!!(log_color), 0)) dprint_color((3)); fprintf(stderr, "%2d(%d) %s: %s" "%s(): " "This is a normal media bearer -  bearer is releaed by CDP callbacks\n", process_no, my_pid(), (log_level_info[((3)) - (-5)].name), ("ims_qos" " [" "rx_asr.c" ":" "96" "]: ") , __func__); if (__builtin_expect(!!(log_color), 0)) dprint_color_reset(); } else { syslog((log_level_info[((3)) - (-5)].syslog_level) | (((0) != 0) ? (0) : ((struct cfg_group_core *)core_cfg)->log_facility), "%s: %s" "%s(): " "This is a normal media bearer -  bearer is releaed by CDP callbacks\n", (log_level_info[((3)) - (-5)].name), ("ims_qos" " [" "rx_asr.c" ":" "96" "]: ") , __func__); } } else { if (log_stderr) { if (__builtin_expect(!!(log_color), 0)) dprint_color((3)); fprintf(stderr, "%2d(%d) %s" "%s(): " "This is a normal media bearer -  bearer is releaed by CDP callbacks\n", process_no, my_pid(), ("ims_qos" " [" "rx_asr.c" ":" "96" "]: ") , __func__); if (__builtin_expect(!!(log_color), 0)) dprint_color_reset(); } else { if (((3))<-5) syslog((log_level_info[(-5) - (-5)].syslog_level) | (((0) != 0) ? (0) : ((struct cfg_group_core *)core_cfg)->log_facility), "%s" "%s(): " "This is a normal media bearer -  bearer is releaed by CDP callbacks\n", ("ims_qos" " [" "rx_asr.c" ":" "96" "]: ") , __func__); else syslog((log_level_info[(3) - (-5)].syslog_level) | (((0) != 0) ? (0) : ((struct cfg_group_core *)core_cfg)->log_facility), "%s" "%s(): " "This is a normal media bearer -  bearer is releaed by CDP callbacks\n", ("ims_qos" " [" "rx_asr.c" ":" "96" "]: ") , __func__); } } (dprint_crit--); } } while(0);
    }
    cdpb.AAASessionsUnlock(session->hash);
    return 0;
}

variable_types:
request
struct _message_t *

variable_types: struct _cdp_session_t { unsigned int hash; struct _str { char *s; int len; } id; unsigned int application_id; unsigned int vendor_id; enum cdp_session_type_t { UNKNOWN_SESSION=0, AUTH_CLIENT_STATELESS=1, AUTH_SERVER_STATELESS=2, AUTH_CLIENT_STATEFULL=3, AUTH_SERVER_STATEFULL=4, ACCT_CLIENT_STATELESS=5, ACCT_CLIENT_STATEFUL=6, ACCT_SERVER_STATELESS=7, ACCT_SERVER_STATEFULL=8, ACCT_CC_CLIENT=9 } type; struct _str dest_host; union { struct _cdp_auth_session_t { enum cdp_auth_state { AUTH_ST_IDLE=0, AUTH_ST_PENDING=1, AUTH_ST_OPEN=2, AUTH_ST_DISCON=3 } state; long timeout; long lifetime; long grace_period; void *generic_data; } auth; struct _acc_session { enum cdp_acc_state_t { ACC_ST_IDLE=0, ACC_ST_PENDING_S=1, ACC_ST_PENDING_E=2, ACC_ST_PENDING_B=3, ACC_ST_OPEN=4, ACC_ST_PENDING_I=5, ACC_ST_PENDING_L=6 } state; struct _str dlgid; unsigned int acct_record_number; long aii; long timeout; void *generic_data; } acc; struct _cc_acc_session { enum cdp_cc_acc_state_t { ACC_CC_ST_IDLE=0, ACC_CC_ST_PENDING_I=1, ACC_CC_ST_PENDING_U=2, ACC_CC_ST_PENDING_T=3, ACC_CC_ST_OPEN=4, ACC_CC_ST_DISCON=5 } state; long discon_time; enum cdp_cc_acc_type_t { ACC_CC_TYPE_EVENT=0, ACC_CC_TYPE_SESSION=1 } type; enum cdp_cc_acc_ccfh_t { ACC_CC_CCFH_UNKNOWN=0, ACC_CC_CCFH_CONTINUE=1, ACC_CC_CCFH_TERMINATE=2, ACC_CC_CCFH_RETRY_AND_TERMINATE=3 } ccfh; int fua; unsigned int acct_record_number; long timeout; long charging_start_time; long last_reservation_request_time; int reserved_units; int reserved_units_validity_time; void *generic_data; } cc_acc; void *generic_data; } u; void (*cb)(int event, void *session); struct _cdp_session_t *next; } *

variable_types:
code
unsigned int

variable_types: struct rx_authsessiondata { struct _str { char *s; int len; } callid; struct _str ftag; struct _str ttag; int subscribed_to_signaling_path_status; struct _str domain; struct _str registration_aor; } *

return_type: struct _message_t { unsigned int commandCode; unsigned char flags; unsigned int applicationId; unsigned int endtoendId; unsigned int hopbyhopId; struct avp { struct avp *next; struct avp *prev; unsigned int code; enum AAA_AVPFlag { AAA_AVP_FLAG_NONE=0, AAA_AVP_FLAG_MANDATORY=64, AAA_AVP_FLAG_RESERVED=31, AAA_AVP_FLAG_VENDOR_SPECIFIC=128, AAA_AVP_FLAG_END_TO_END_ENCRYPT=32 } flags; enum AAA_AVPDataType { AAA_AVP_DATA_TYPE=0, AAA_AVP_STRING_TYPE=1, AAA_AVP_ADDRESS_TYPE=2, AAA_AVP_INTEGER32_TYPE=3, AAA_AVP_INTEGER64_TYPE=4, AAA_AVP_TIME_TYPE=5 } type; unsigned int vendorId; struct _str { char *s; int len; } data; unsigned char free_it; } *sessionId; struct avp *orig_host; struct avp *orig_realm; struct avp *dest_host; struct avp *dest_realm; struct avp *res_code; struct avp *auth_ses_state; struct _avp_list_t { struct avp *head; struct avp *tail; } avpList; struct _str buf; void *in_peer; } *

user_defined_types: struct _cdp_session_t { unsigned int hash; struct _str id; unsigned int application_id; unsigned int vendor_id; enum cdp_session_type_t type; struct _str dest_host; union { struct _cdp_auth_session_t auth; struct _acc_session acc; struct _cc_acc_session cc_acc; void *generic_data; } u; void (*cb)(int event, void *session); struct _cdp_session_t *next; }

user_defined_types: struct rx_authsessiondata { struct _str callid; struct _str ftag; struct _str ttag; int subscribed_to_signaling_path_status; struct _str domain; struct _str registration_aor; }

user_defined_types: struct _message_t { unsigned int commandCode; unsigned char flags; unsigned int applicationId; unsigned int endtoendId; unsigned int hopbyhopId; struct avp *sessionId; struct avp *orig_host; struct avp *orig_realm; struct avp *dest_host; struct avp *dest_realm; struct avp *res_code; struct avp *auth_ses_state; struct _avp_list_t avpList; struct _str buf; void *in_peer; }

user_defined_types: struct _cdp_auth_session_t { enum cdp_auth_state state; long timeout; long lifetime; long grace_period; void *generic_data; }

user_defined_types: struct _acc_session { enum cdp_acc_state_t state; struct _str dlgid; unsigned int acct_record_number; long aii; long timeout; void *generic_data; }

user_defined_types: struct _cc_acc_session { enum cdp_cc_acc_state_t state; long discon_time; enum cdp_cc_acc_type_t type; enum cdp_cc_acc_ccfh_t ccfh; int fua; unsigned int acct_record_number; long timeout; long charging_start_time; long last_reservation_request_time; int reserved_units; int reserved_units_validity_time; void *generic_data; }

user_defined_types: struct avp { struct avp *next; struct avp *prev; unsigned int code; enum AAA_AVPFlag flags; enum AAA_AVPDataType type; unsigned int vendorId; struct _str data; unsigned char free_it; }


repo: virtualolson/who

decompiled_code:
__int64 __fastcall atomic_get_and_set_int(volatile __int32 *a1, __int32 a2)
{
return (unsigned int)_InterlockedExchange(a1, a2);
}

canonical_decompiled_code:
__int64 __fastcall func0(volatile __int32 *a1, __int32 a2)
{
return (unsigned int)_InterlockedExchange(a1, a2);
}

original_code: inline static int atomic_get_and_set_int(volatile int* var, int v) { asm volatile( "xchgl %1, %0" " \n\t" : "+q"(v), "=m"(*var) : "m"(*var) : "memory" ); return v; }

canonical_original_code: inline static int atomic_get_and_set_int(int *var, int v) { asm volatile( "xchgl %1, %0" " \n\t" : "+q"(v), "=m"(*var) : "m"(*var) : "memory" ); return v; }

variable_types:
var
int *

variable_types: v int

return_type: int


decompiled_code:
__int64 __fastcall futex_get(volatile signed __int32 *a1)
{
__int64 result; // rax
int v2; // ebp
int v3; // ebp

result = atomic_cmpxchg_int(a1, 0, 1);
if ( (_DWORD)result )
{
v2 = 1024;
if ( (_DWORD)result == 2 )
{
do
{
LABEL_3:
syscall(202LL, a1, 0LL, 2LL, 0LL, 0LL, 0LL);
result = atomic_get_and_set_int(a1, 2);
}
while ( (_DWORD)result );
}
else
{
while ( 1 )
{
result = atomic_cmpxchg_int(a1, 0, 1);
if ( !(_DWORD)result )
break;
if ( (_DWORD)result == 2 )
goto LABEL_3;
v3 = v2 - 1;
result = atomic_cmpxchg_int(a1, 0, 1);
if ( !(_DWORD)result )
break;
if ( (_DWORD)result == 2 )
goto LABEL_3;
result = atomic_cmpxchg_int(a1, 0, 1);
if ( !(_DWORD)result )
break;
if ( (_DWORD)result == 2 )
goto LABEL_3;
result = atomic_cmpxchg_int(a1, 0, 1);
if ( !(_DWORD)result )
break;
if ( (_DWORD)result == 2 )
goto LABEL_3;
result = atomic_cmpxchg_int(a1, 0, 1);
if ( !(_DWORD)result )
break;
if ( (_DWORD)result == 2 )
goto LABEL_3;
result = atomic_cmpxchg_int(a1, 0, 1);
if ( !(_DWORD)result )
break;
if ( (_DWORD)result == 2 )
goto LABEL_3;
result = atomic_cmpxchg_int(a1, 0, 1);
if ( !(_DWORD)result )
break;
if ( (_DWORD)result == 2 )
goto LABEL_3;
result = atomic_cmpxchg_int(a1, 0, 1);
if ( !(_DWORD)result )
break;
if ( (_DWORD)result == 2 )
goto LABEL_3;
v2 = v3 - 7;
if ( !v2 )
{
for ( result = atomic_get_and_set_int(a1, 2); (_DWORD)result; result = atomic_get_and_set_int(a1, 2) )
syscall(202LL, a1, 0LL, 2LL, 0LL, 0LL, 0LL);
return result;
}
}
}
}
return result;
}

canonical_decompiled_code:
__int64 __fastcall func2(volatile signed __int32 *a1)
{
__int64 result; // rax
int v2; // ebp
int v3; // ebp

result = func1(a1, 0, 1);
if ( (_DWORD)result )
{
v2 = 1024;
if ( (_DWORD)result == 2 )
{
do
{
LABEL_3:
syscall(202LL, a1, 0LL, 2LL, 0LL, 0LL, 0LL);
result = func0(a1, 2);
}
while ( (_DWORD)result );
}
else
{
while ( 1 )
{
result = func1(a1, 0, 1);
if ( !(_DWORD)result )
break;
if ( (_DWORD)result == 2 )
goto LABEL_3;
v3 = v2 - 1;
result = func1(a1, 0, 1);
if ( !(_DWORD)result )
break;
if ( (_DWORD)result == 2 )
goto LABEL_3;
result = func1(a1, 0, 1);
if ( !(_DWORD)result )
break;
if ( (_DWORD)result == 2 )
goto LABEL_3;
result = func1(a1, 0, 1);
if ( !(_DWORD)result )
break;
if ( (_DWORD)result == 2 )
goto LABEL_3;
result = func1(a1, 0, 1);
if ( !(_DWORD)result )
break;
if ( (_DWORD)result == 2 )
goto LABEL_3;
result = func1(a1, 0, 1);
if ( !(_DWORD)result )
break;
if ( (_DWORD)result == 2 )
goto LABEL_3;
result = func1(a1, 0, 1);
if ( !(_DWORD)result )
break;
if ( (_DWORD)result == 2 )
goto LABEL_3;
result = func1(a1, 0, 1);
if ( !(_DWORD)result )
break;
if ( (_DWORD)result == 2 )
goto LABEL_3;
v2 = v3 - 7;
if ( !v2 )
{
for ( result = func0(a1, 2); (_DWORD)result; result = func0(a1, 2) )
syscall(202LL, a1, 0LL, 2LL, 0LL, 0LL, 0LL);
return result;
}
}
}
}
return result;
}

original_code:
inline static void futex_get(futex_lock_t* lock)
{
 int v;
 register int i=1024;
retry:
 v=atomic_cmpxchg_int(&(lock)->val, 0, 1);
 if (__builtin_expect(!!(v==0), 1)){
  do {} while(0);
  return;
 }else if (__builtin_expect(!!(v==2), 0)){
  do{
   syscall(202 , (&(lock)->val), (0), (2), (0), (0), (0));
   v=atomic_get_and_set_int(&(lock)->val, 2);
  }while(v);
 }else{
  if (i>0){
   i--;
   goto retry;
  }
  v=atomic_get_and_set_int(&(lock)->val, 2);
  while(v){
   syscall(202 , (&(lock)->val), (0), (2), (0), (0), (0));
   v=atomic_get_and_set_int(&(lock)->val, 2);
  }
 }
 do {} while(0);
}

canonical_original_code:
inline static void futex_get(struct atomic_t *lock)
{
 int v;
 register int i = 1024;
retry:
 v=atomic_cmpxchg_int(&(lock)->val, 0, 1);
 if (__builtin_expect(!!(v==0), 1)){
  do {} while(0);
  return;
 }else if (__builtin_expect(!!(v==2), 0)){
  do{
   syscall(202 , (&(lock)->val), (0), (2), (0), (0), (0));
   v=atomic_get_and_set_int(&(lock)->val, 2);
  }while(v);
 }else{
  if (i>0){
   i--;
   goto retry;
  }
  v=atomic_get_and_set_int(&(lock)->val, 2);
  while(v){
   syscall(202 , (&(lock)->val), (0), (2), (0), (0), (0));
   v=atomic_get_and_set_int(&(lock)->val, 2);
  }
 }
 do {} while(0);
}

variable_types:
lock
struct atomic_t { int val; } *

variable_types: i int

return_type: void


decompiled_code:
__int64 __fastcall futex_release(volatile __int32 *a1)
{
__int64 result; // rax

result = atomic_get_and_set_int(a1, 0);
if ( (_DWORD)result == 2 )
result = syscall(202LL, a1, 1LL, 1LL, 0LL, 0LL, 0LL);
return result;
}

canonical_decompiled_code:
__int64 __fastcall func3(volatile __int32 *a1)
{
__int64 result; // rax

result = func0(a1, 0);
if ( (_DWORD)result == 2 )
result = syscall(202LL, a1, 1LL, 1LL, 0LL, 0LL, 0LL);
return result;
}

original_code:
inline static void futex_release(futex_lock_t* lock)
{
 int v;
 do {} while(0);
 v=atomic_get_and_set_int(&(lock)->val, 0);
 if (__builtin_expect(!!(v==2), 0)){
  syscall(202 , (&(lock)->val), (1), (1), (0), (0), (0));
 }
}

canonical_original_code:
inline static void futex_release(struct atomic_t *lock)
{
 int v;
 do {} while(0);
 v=atomic_get_and_set_int(&(lock)->val, 0);
 if (__builtin_expect(!!(v==2), 0)){
  syscall(202 , (&(lock)->val), (1), (1), (0), (0), (0));
 }
}


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

result = 0LL;
if ( !euac_internals )
result = init_events_uac_internals();
return result;
}

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

result = 0LL;
if ( !euac_internals )
result = init_events_uac_internals();
return result;
}

original_code:
int events_uac_init()
{
 if (!euac_internals) return init_events_uac_internals();
 else return 0;
}


decompiled_code:
_QWORD **events_uac_destroy()
{
_QWORD **result; // rax

result = &euac_internals;
if ( euac_internals )
result = (_QWORD **)destroy_events_uac_internals();
return result;
}

canonical_decompiled_code:
_QWORD **func11()
{
_QWORD **result; // rax

result = &euac_internals;
if ( euac_internals )
result = (_QWORD **)destroy_events_uac_internals();
return result;
}

original_code:
void events_uac_destroy()
{
 if (euac_internals) destroy_events_uac_internals();
}


decompiled_code:
void __fastcall update_in_timer(const void **a1, const void ***a2)
{
remove_from_timer_localalias(a1, a2);
append_to_timer_localalias(a1, a2);
}

canonical_decompiled_code:
void __fastcall func2(const void **a1, const void ***a2)
{
func1(a1, a2);
func0(a1, a2);
}

original_code:
void update_in_timer(struct list_link *head, struct list_link *ll)
{
 remove_from_timer( head, ll);
 append_to_timer( head, ll);
}

variable_types: struct list_link { struct list_link *next; struct list_link *prev; } *

variable_types:
ll
struct list_link *


decompiled_code:
__int64 __fastcall check_and_split_timer(const void **a1, unsigned int a2, _QWORD *a3, _BYTE *a4)
{
_BYTE *v4; // rbp
_BYTE *v5; // rdx
_BYTE *v6; // rcx
const void **v7; // rbx
unsigned int v8; // eax
unsigned __int8 v9; // cl
_QWORD *v10; // rbp
_QWORD *v11; // r14
__int64 result; // rax
const void *v13; // r13
const void *v14; // rbp
const char *v15; // r14
unsigned int v16; // eax
const void *v18; // [rsp+8h] [rbp-50h]
const void *v19; // [rsp+10h] [rbp-48h]
const char *v20; // [rsp+18h] [rbp-40h]

v4 = a4;
v5 = a4;
v6 = a4 + 32;
do
{
*v5 = 0;
v5[1] = 0;
v5[2] = 0;
v5[3] = 0;
v5[4] = 0;
v5[5] = 0;
v5[6] = 0;
v5[7] = 0;
v5 += 8;
}
while ( v6 != v5 );
v7 = (const void **)*a1;
if ( a1 != *a1 )
{
while ( *((_DWORD *)v7 - 6) <= a2 )
{
if ( (int)get_debug_level("pike", 4LL) > 2 && !dprint_crit )
{
++dprint_crit;
if ( log_stderr )
{
if ( log_color )
dprint_color(3LL);
v18 = *v7;
v19 = v7[1];
v20 = (const char *)*((_QWORD *)&log_level_info + 16);
v8 = my_pid();
fprintf(
stderr,
"%2d(%d) %s: %s%s(): DEBUG:pike:check_and_split_timer: splitting %p(%p,%p)node=%p\n",
process_no,
v8,
v20,
"pike [timer.c:93]: ",
"check_and_split_timer",
v7,
v19,
v18,
v7 - 3);
if ( log_color )
dprint_color_reset();
}
else
{
syslog(
*((_DWORD *)&log_level_info + 34) | *(_DWORD *)(core_cfg + 4LL),
"%s: %s%s(): DEBUG:pike:check_and_split_timer: splitting %p(%p,%p)node=%p\n",
*((const char **)&log_level_info + 16),
"pike [timer.c:93]: ",
"check_and_split_timer",
v7,
v7[1],
*v7,
v7 - 3);
}
--dprint_crit;
}
*((_WORD *)v7 - 1) |= 1u;
*((_WORD *)v7 - 1) &= 0xFFFDu;
v9 = *((_BYTE *)v7 - 3);
v7 = (const void **)*v7;
v4[v9 >> 3] |= 1 << (v9 & 7);
if ( v7 == a1 )
{
v7 = a1;
break;
}
}
}
v10 = *a1;
if ( v7 == *a1 )
{
a3[1] = a3;
*a3 = a3;
}
else
{
*a3 = v10;
v10[1] = a3;
v11 = v7[1];
a3[1] = v11;
*v11 = a3;
*a1 = v7;
v7[1] = a1;
}
result = get_debug_level("pike", 4LL);
if ( (int)result > 2 && !dprint_crit )
{
++dprint_crit;
if ( log_stderr )
{
if ( log_color )
dprint_color(3LL);
v13 = *a1;
v14 = a1[1];
v15 = (const char *)*((_QWORD *)&log_level_info + 16);
v16 = my_pid();
fprintf(
stderr,
"%2d(%d) %s: %s%s(): DEBUG:pike:check_and_split_timer: succ. to split (h=%p)(p=%p,n=%p)\n",
process_no,
v16,
v15,
"pike [timer.c:120]: ",
"check_and_split_timer",
a1,
v14,
v13);
if ( log_color )
dprint_color_reset();
}
else
{
syslog(
*((_DWORD *)&log_level_info + 34) | *(_DWORD *)(core_cfg + 4LL),
"%s: %s%s(): DEBUG:pike:check_and_split_timer: succ. to split (h=%p)(p=%p,n=%p)\n",
*((const char **)&log_level_info + 16),
"pike [timer.c:120]: ",
"check_and_split_timer",
a1,
a1[1],
*a1);
}
result = (unsigned int)--dprint_crit;
}
return result;
}

canonical_decompiled_code:
__int64 __fastcall func3(const void **a1, unsigned int a2, _QWORD *a3, _BYTE *a4)
{
_BYTE *v4; // rbp
_BYTE *v5; // rdx
_BYTE *v6; // rcx
const void **v7; // rbx
unsigned int v8; // eax
unsigned __int8 v9; // cl
_QWORD *v10; // rbp
_QWORD *v11; // r14
__int64 result; // rax
const void *v13; // r13
const void *v14; // rbp
const char *v15; // r14
unsigned int v16; // eax
const void *v18; // [rsp+8h] [rbp-50h]
const void *v19; // [rsp+10h] [rbp-48h]
const char *v20; // [rsp+18h] [rbp-40h]

v4 = a4;
v5 = a4;
v6 = a4 + 32;
do
{
*v5 = 0;
v5[1] = 0;
v5[2] = 0;
v5[3] = 0;
v5[4] = 0;
v5[5] = 0;
v5[6] = 0;
v5[7] = 0;
v5 += 8;
}
while ( v6 != v5 );
v7 = (const void **)*a1;
if ( a1 != *a1 )
{
while ( *((_DWORD *)v7 - 6) <= a2 )
{
if ( (int)get_debug_level("pike", 4LL) > 2 && !dprint_crit )
{
++dprint_crit;
if ( log_stderr )
{
if ( log_color )
dprint_color(3LL);
v18 = *v7;
v19 = v7[1];
v20 = (const char *)*((_QWORD *)&log_level_info + 16);
v8 = my_pid();
fprintf(
stderr,
"%2d(%d) %s: %s%s(): DEBUG:pike:check_and_split_timer: splitting %p(%p,%p)node=%p\n",
process_no,
v8,
v20,
"pike [timer.c:93]: ",
"check_and_split_timer",
v7,
v19,
v18,
v7 - 3);
if ( log_color )
dprint_color_reset();
}
else
{
syslog(
*((_DWORD *)&log_level_info + 34) | *(_DWORD *)(core_cfg + 4LL),
"%s: %s%s(): DEBUG:pike:check_and_split_timer: splitting %p(%p,%p)node=%p\n",
*((const char **)&log_level_info + 16),
"pike [timer.c:93]: ",
"check_and_split_timer",
v7,
v7[1],
*v7,
v7 - 3);
}
--dprint_crit;
}
*((_WORD *)v7 - 1) |= 1u;
*((_WORD *)v7 - 1) &= 0xFFFDu;
v9 = *((_BYTE *)v7 - 3);
v7 = (const void **)*v7;
v4[v9 >> 3] |= 1 << (v9 & 7);
if ( v7 == a1 )
{
v7 = a1;
break;
}
}
}
v10 = *a1;
if ( v7 == *a1 )
{
a3[1] = a3;
*a3 = a3;
}
else
{
*a3 = v10;
v10[1] = a3;
v11 = v7[1];
a3[1] = v11;
*v11 = a3;
*a1 = v7;
v7[1] = a1;
}
result = get_debug_level("pike", 4LL);
if ( (int)result > 2 && !dprint_crit )
{
++dprint_crit;
if ( log_stderr )
{
if ( log_color )
dprint_color(3LL);
v13 = *a1;
v14 = a1[1];
v15 = (const char *)*((_QWORD *)&log_level_info + 16);
v16 = my_pid();
fprintf(
stderr,
"%2d(%d) %s: %s%s(): DEBUG:pike:check_and_split_timer: succ. to split (h=%p)(p=%p,n=%p)\n",
process_no,
v16,
v15,
"pike [timer.c:120]: ",
"check_and_split_timer",
a1,
v14,
v13);
if ( log_color )
dprint_color_reset();
}
else
{
syslog(
*((_DWORD *)&log_level_info + 34) | *(_DWORD *)(core_cfg + 4LL),
"%s: %s%s(): DEBUG:pike:check_and_split_timer: succ. to split (h=%p)(p=%p,n=%p)\n",
*((const char **)&log_level_info + 16),
"pike [timer.c:120]: ",
"check_and_split_timer",
a1,
a1[1],
*a1);
}
result = (unsigned int)--dprint_crit;
}
return result;
}

original_code:
void check_and_split_timer(struct list_link *head, int time,
       struct list_link *split, unsigned char *mask)
{
 struct list_link *ll;
 struct ip_node *node;
 unsigned char b;
 int i;
 for(i=0;i<32;mask[i++]=0);
 ll = head->next;
 while( ll!=head && (node=((struct ip_node*)((char *)(ll)- (unsigned long)(&((struct ip_node*)0)->timer_ll))))->expires<=time) {
  do { if (get_debug_level("pike", (sizeof("pike")-1)) >= ((3)) && (dprint_crit==0)) { (dprint_crit++); if (__builtin_expect(!!((((3)) >= -5) && (((3)) <= 3)), 1)){ if (__builtin_expect(!!(log_stderr), 0)) { if (__builtin_expect(!!(log_color), 0)) dprint_color((3)); fprintf(stderr, "%2d(%d) %s: %s" "%s(): " "DEBUG:pike:check_and_split_timer: splitting %p(%p,%p)node=%p\n", process_no, my_pid(), (log_level_info[((3)) - (-5)].name), ("pike" " [" "timer.c" ":" "93" "]: ") , __func__, ll,ll->prev,ll->next, node); if (__builtin_expect(!!(log_color), 0)) dprint_color_reset(); } else { syslog((log_level_info[((3)) - (-5)].syslog_level) | (((0) != 0) ? (0) : ((struct cfg_group_core *)core_cfg)->log_facility), "%s: %s" "%s(): " "DEBUG:pike:check_and_split_timer: splitting %p(%p,%p)node=%p\n", (log_level_info[((3)) - (-5)].name), ("pike" " [" "timer.c" ":" "93" "]: ") , __func__, ll,ll->prev,ll->next, node); } } else { if (log_stderr) { if (__builtin_expect(!!(log_color), 0)) dprint_color((3)); fprintf(stderr, "%2d(%d) %s" "%s(): " "DEBUG:pike:check_and_split_timer: splitting %p(%p,%p)node=%p\n", process_no, my_pid(), ("pike" " [" "timer.c" ":" "93" "]: ") , __func__, ll,ll->prev,ll->next, node); if (__builtin_expect(!!(log_color), 0)) dprint_color_reset(); } else { if (((3))<-5) syslog((log_level_info[(-5) - (-5)].syslog_level) | (((0) != 0) ? (0) : ((struct cfg_group_core *)core_cfg)->log_facility), "%s" "%s(): " "DEBUG:pike:check_and_split_timer: splitting %p(%p,%p)node=%p\n", ("pike" " [" "timer.c" ":" "93" "]: ") , __func__, ll,ll->prev,ll->next, node); else syslog((log_level_info[(3) - (-5)].syslog_level) | (((0) != 0) ? (0) : ((struct cfg_group_core *)core_cfg)->log_facility), "%s" "%s(): " "DEBUG:pike:check_and_split_timer: splitting %p(%p,%p)node=%p\n", ("pike" " [" "timer.c" ":" "93" "]: ") , __func__, ll,ll->prev,ll->next, node); } } (dprint_crit--); } } while(0);
  node->flags |= (1<<0);
  node->flags &= ~(1<<1);
  b = node->branch;
  ll=ll->next;
  mask[b>>3] |= (1<<(b&0x07));
 }
 if (ll==head->next) {
  split->next = split->prev = split;
 } else {
  split->next = head->next;
  split->next->prev = split;
  split->prev = ll->prev;
  split->prev->next = split;
  head->next = ll;
  ll->prev = head;
 }
 do { if (get_debug_level("pike", (sizeof("pike")-1)) >= ((3)) && (dprint_crit==0)) { (dprint_crit++); if (__builtin_expect(!!((((3)) >= -5) && (((3)) <= 3)), 1)){ if (__builtin_expect(!!(log_stderr), 0)) { if (__builtin_expect(!!(log_color), 0)) dprint_color((3)); fprintf(stderr, "%2d(%d) %s: %s" "%s(): " "DEBUG:pike:check_and_split_timer: succ. to split (h=%p)(p=%p,n=%p)\n", process_no, my_pid(), (log_level_info[((3)) - (-5)].name), ("pike" " [" "timer.c" ":" "120" "]: ") , __func__, head,head->prev,head->next); if (__builtin_expect(!!(log_color), 0)) dprint_color_reset(); } else { syslog((log_level_info[((3)) - (-5)].syslog_level) | (((0) != 0) ? (0) : ((struct cfg_group_core *)core_cfg)->log_facility), "%s: %s" "%s(): " "DEBUG:pike:check_and_split_timer: succ. to split (h=%p)(p=%p,n=%p)\n", (log_level_info[((3)) - (-5)].name), ("pike" " [" "timer.c" ":" "120" "]: ") , __func__, head,head->prev,head->next); } } else { if (log_stderr) { if (__builtin_expect(!!(log_color), 0)) dprint_color((3)); fprintf(stderr, "%2d(%d) %s" "%s(): " "DEBUG:pike:check_and_split_timer: succ. to split (h=%p)(p=%p,n=%p)\n", process_no, my_pid(), ("pike" " [" "timer.c" ":" "120" "]: ") , __func__, head,head->prev,head->next); if (__builtin_expect(!!(log_color), 0)) dprint_color_reset(); } else { if (((3))<-5) syslog((log_level_info[(-5) - (-5)].syslog_level) | (((0) != 0) ? (0) : ((struct cfg_group_core *)core_cfg)->log_facility), "%s" "%s(): " "DEBUG:pike:check_and_split_timer: succ. to split (h=%p)(p=%p,n=%p)\n", ("pike" " [" "timer.c" ":" "120" "]: ") , __func__, head,head->prev,head->next); else syslog((log_level_info[(3) - (-5)].syslog_level) | (((0) != 0) ? (0) : ((struct cfg_group_core *)core_cfg)->log_facility), "%s" "%s(): " "DEBUG:pike:check_and_split_timer: succ. to split (h=%p)(p=%p,n=%p)\n", ("pike" " [" "timer.c" ":" "120" "]: ") , __func__, head,head->prev,head->next); } } (dprint_crit--); } } while(0);
 return;
}

canonical_original_code:
void check_and_split_timer(struct list_link *head, int time, struct list_link *split, unsigned char *mask)
{
 struct list_link *ll;
 struct ip_node *node;
 unsigned char b;
 int i;
 for(i=0;i<32;mask[i++]=0);
 ll = head->next;
 while( ll!=head && (node=((struct ip_node *)((char *)(ll)- (unsigned long)(&((struct ip_node *)0)->timer_ll))))->expires<=time) {
  do { if (get_debug_level("pike", (sizeof("pike")-1)) >= ((3)) && (dprint_crit==0)) { (dprint_crit++); if (__builtin_expect(!!((((3)) >= -5) && (((3)) <= 3)), 1)){ if (__builtin_expect(!!(log_stderr), 0)) { if (__builtin_expect(!!(log_color), 0)) dprint_color((3)); fprintf(stderr, "%2d(%d) %s: %s" "%s(): " "DEBUG:pike:check_and_split_timer: splitting %p(%p,%p)node=%p\n", process_no, my_pid(), (log_level_info[((3)) - (-5)].name), ("pike" " [" "timer.c" ":" "93" "]: ") , __func__, ll,ll->prev,ll->next, node); if (__builtin_expect(!!(log_color), 0)) dprint_color_reset(); } else { syslog((log_level_info[((3)) - (-5)].syslog_level) | (((0) != 0) ? (0) : ((struct cfg_group_core *)core_cfg)->log_facility), "%s: %s" "%s(): " "DEBUG:pike:check_and_split_timer: splitting %p(%p,%p)node=%p\n", (log_level_info[((3)) - (-5)].name), ("pike" " [" "timer.c" ":" "93" "]: ") , __func__, ll,ll->prev,ll->next, node); } } else { if (log_stderr) { if (__builtin_expect(!!(log_color), 0)) dprint_color((3)); fprintf(stderr, "%2d(%d) %s" "%s(): " "DEBUG:pike:check_and_split_timer: splitting %p(%p,%p)node=%p\n", process_no, my_pid(), ("pike" " [" "timer.c" ":" "93" "]: ") , __func__, ll,ll->prev,ll->next, node); if (__builtin_expect(!!(log_color), 0)) dprint_color_reset(); } else { if (((3))<-5) syslog((log_level_info[(-5) - (-5)].syslog_level) | (((0) != 0) ? (0) : ((struct cfg_group_core *)core_cfg)->log_facility), "%s" "%s(): " "DEBUG:pike:check_and_split_timer: splitting %p(%p,%p)node=%p\n", ("pike" " [" "timer.c" ":" "93" "]: ") , __func__, ll,ll->prev,ll->next, node); else syslog((log_level_info[(3) - (-5)].syslog_level) | (((0) != 0) ? (0) : ((struct cfg_group_core *)core_cfg)->log_facility), "%s" "%s(): " "DEBUG:pike:check_and_split_timer: splitting %p(%p,%p)node=%p\n", ("pike" " [" "timer.c" ":" "93" "]: ") , __func__, ll,ll->prev,ll->next, node); } } (dprint_crit--); } } while(0);
  node->flags |= (1<<0);
  node->flags &= ~(1<<1);
  b = node->branch;
  ll=ll->next;
  mask[b>>3] |= (1<<(b&0x07));
 }
 if (ll==head->next) {
  split->next = split->prev = split;
 } else {
  split->next = head->next;
  split->next->prev = split;
  split->prev = ll->prev;
  split->prev->next = split;
  head->next = ll;
  ll->prev = head;
 }
 do { if (get_debug_level("pike", (sizeof("pike")-1)) >= ((3)) && (dprint_crit==0)) { (dprint_crit++); if (__builtin_expect(!!((((3)) >= -5) && (((3)) <= 3)), 1)){ if (__builtin_expect(!!(log_stderr), 0)) { if (__builtin_expect(!!(log_color), 0)) dprint_color((3)); fprintf(stderr, "%2d(%d) %s: %s" "%s(): " "DEBUG:pike:check_and_split_timer: succ. to split (h=%p)(p=%p,n=%p)\n", process_no, my_pid(), (log_level_info[((3)) - (-5)].name), ("pike" " [" "timer.c" ":" "120" "]: ") , __func__, head,head->prev,head->next); if (__builtin_expect(!!(log_color), 0)) dprint_color_reset(); } else { syslog((log_level_info[((3)) - (-5)].syslog_level) | (((0) != 0) ? (0) : ((struct cfg_group_core *)core_cfg)->log_facility), "%s: %s" "%s(): " "DEBUG:pike:check_and_split_timer: succ. to split (h=%p)(p=%p,n=%p)\n", (log_level_info[((3)) - (-5)].name), ("pike" " [" "timer.c" ":" "120" "]: ") , __func__, head,head->prev,head->next); } } else { if (log_stderr) { if (__builtin_expect(!!(log_color), 0)) dprint_color((3)); fprintf(stderr, "%2d(%d) %s" "%s(): " "DEBUG:pike:check_and_split_timer: succ. to split (h=%p)(p=%p,n=%p)\n", process_no, my_pid(), ("pike" " [" "timer.c" ":" "120" "]: ") , __func__, head,head->prev,head->next); if (__builtin_expect(!!(log_color), 0)) dprint_color_reset(); } else { if (((3))<-5) syslog((log_level_info[(-5) - (-5)].syslog_level) | (((0) != 0) ? (0) : ((struct cfg_group_core *)core_cfg)->log_facility), "%s" "%s(): " "DEBUG:pike:check_and_split_timer: succ. to split (h=%p)(p=%p,n=%p)\n", ("pike" " [" "timer.c" ":" "120" "]: ") , __func__, head,head->prev,head->next); else syslog((log_level_info[(3) - (-5)].syslog_level) | (((0) != 0) ? (0) : ((struct cfg_group_core *)core_cfg)->log_facility), "%s" "%s(): " "DEBUG:pike:check_and_split_timer: succ. to split (h=%p)(p=%p,n=%p)\n", ("pike" " [" "timer.c" ":" "120" "]: ") , __func__, head,head->prev,head->next); } } (dprint_crit--); } } while(0);
 return;
}

variable_types: time int

variable_types:
split
struct list_link *

variable_types:
mask
unsigned char *

variable_types: struct ip_node { unsigned int expires; unsigned int leaf_hits[2]; unsigned int hits[2]; unsigned char byte; unsigned char branch; unsigned short flags; struct list_link { struct list_link *next; struct list_link *prev; } timer_ll; struct ip_node *prev; struct ip_node *next; struct ip_node *kids; } *

variable_types:
b
unsigned char

user_defined_types: struct ip_node { unsigned int expires; unsigned int leaf_hits[2]; unsigned int hits[2]; unsigned char byte; unsigned char branch; unsigned short flags; struct list_link timer_ll; struct ip_node *prev; struct ip_node *next; struct ip_node *kids; }

user_defined_types: struct cfg_group_core { int debug; int log_facility; int memdbg; int use_dst_blacklist; unsigned int blst_timeout; unsigned int blst_max_mem; unsigned int blst_udp_imask; unsigned int blst_tcp_imask; unsigned int blst_tls_imask; unsigned int blst_sctp_imask; int dns_try_ipv6; int dns_try_naptr; int dns_udp_pref; int dns_tcp_pref; int dns_tls_pref; int dns_sctp_pref; int dns_retr_time; int dns_retr_no; int dns_servers_no; int dns_search_list; int dns_search_fmatch; int dns_reinit; int use_dns_cache; int dns_cache_flags; int use_dns_failover; int dns_srv_lb; unsigned int dns_neg_cache_ttl; unsigned int dns_cache_min_ttl; unsigned int dns_cache_max_ttl; unsigned int dns_cache_max_mem; int dns_cache_del_nonexp; int dns_cache_rec_pref; int mem_dump_pkg; int mem_dump_shm; int max_while_loops; int udp_mtu; int udp_mtu_try_proto; int udp4_raw; int udp4_raw_mtu; int udp4_raw_ttl; int force_rport; int memlog; int mem_summary; int mem_safety; int mem_join; int corelog; int latency_log; int latency_limit_db; int latency_limit_action; }


decompiled_code:
__int64 lock_initialize()
{
const char *v1; // rbx
unsigned int v2; // eax

if ( (int)get_debug_level(&LC0, 2LL) > 2 && !dprint_crit )
{
++dprint_crit;
if ( log_stderr )
{
if ( log_color )
dprint_color(3LL);
v1 = (const char *)*((_QWORD *)&log_level_info + 16);
v2 = my_pid();
fprintf(
stderr,
"%2d(%d) %s: %s%s(): DEBUG: lock_initialize: lock initialization started\n",
process_no,
v2,
v1,
"tm [lock.c:88]: ",
"lock_initialize");
if ( log_color )
dprint_color_reset();
}
else
{
syslog(
*((_DWORD *)&log_level_info + 34) | *(_DWORD *)(core_cfg + 4LL),
"%s: %s%s(): DEBUG: lock_initialize: lock initialization started\n",
*((const char **)&log_level_info + 16),
"tm [lock.c:88]: ",
"lock_initialize");
}
--dprint_crit;
}
return 0LL;
}

canonical_decompiled_code:
__int64 func0()
{
const char *v1; // rbx
unsigned int v2; // eax

if ( (int)get_debug_level(&LC0, 2LL) > 2 && !dprint_crit )
{
++dprint_crit;
if ( log_stderr )
{
if ( log_color )
dprint_color(3LL);
v1 = (const char *)*((_QWORD *)&log_level_info + 16);
v2 = my_pid();
fprintf(
stderr,
"%2d(%d) %s: %s%s(): DEBUG: lock_initialize: lock initialization started\n",
process_no,
v2,
v1,
"tm [lock.c:88]: ",
"lock_initialize");
if ( log_color )
dprint_color_reset();
}
else
{
syslog(
*((_DWORD *)&log_level_info + 34) | *(_DWORD *)(core_cfg + 4LL),
"%s: %s%s(): DEBUG: lock_initialize: lock initialization started\n",
*((const char **)&log_level_info + 16),
"tm [lock.c:88]: ",
"lock_initialize");
}
--dprint_crit;
}
return 0LL;
}

original_code:
int lock_initialize()
{
 do { if (get_debug_level("tm", (sizeof("tm")-1)) >= ((3)) && (dprint_crit==0)) { (dprint_crit++); if (__builtin_expect(!!((((3)) >= -5) && (((3)) <= 3)), 1)){ if (__builtin_expect(!!(log_stderr), 0)) { if (__builtin_expect(!!(log_color), 0)) dprint_color((3)); fprintf(stderr, "%2d(%d) %s: %s" "%s(): " "DEBUG: lock_initialize: lock initialization started\n", process_no, my_pid(), (log_level_info[((3)) - (-5)].name), ("tm" " [" "lock.c" ":" "88" "]: ") , __func__); if (__builtin_expect(!!(log_color), 0)) dprint_color_reset(); } else { syslog((log_level_info[((3)) - (-5)].syslog_level) | (((0) != 0) ? (0) : ((struct cfg_group_core *)core_cfg)->log_facility), "%s: %s" "%s(): " "DEBUG: lock_initialize: lock initialization started\n", (log_level_info[((3)) - (-5)].name), ("tm" " [" "lock.c" ":" "88" "]: ") , __func__); } } else { if (log_stderr) { if (__builtin_expect(!!(log_color), 0)) dprint_color((3)); fprintf(stderr, "%2d(%d) %s" "%s(): " "DEBUG: lock_initialize: lock initialization started\n", process_no, my_pid(), ("tm" " [" "lock.c" ":" "88" "]: ") , __func__); if (__builtin_expect(!!(log_color), 0)) dprint_color_reset(); } else { if (((3))<-5) syslog((log_level_info[(-5) - (-5)].syslog_level) | (((0) != 0) ? (0) : ((struct cfg_group_core *)core_cfg)->log_facility), "%s" "%s(): " "DEBUG: lock_initialize: lock initialization started\n", ("tm" " [" "lock.c" ":" "88" "]: ") , __func__); else syslog((log_level_info[(3) - (-5)].syslog_level) | (((0) != 0) ? (0) : ((struct cfg_group_core *)core_cfg)->log_facility), "%s" "%s(): " "DEBUG: lock_initialize: lock initialization started\n", ("tm" " [" "lock.c" ":" "88" "]: ") , __func__); } } (dprint_crit--); } } while(0);
 return 0;
}


decompiled_code:
void lock_cleanup()
{
;
}

canonical_decompiled_code:
void func1()
{
;
}

original_code:
void lock_cleanup()
{
}

canonical_original_code:
void lock_cleanup()
{
}


decompiled_code:
_BOOL8 __fastcall rfc1918_parser_execute(_BYTE *a1, __int64 a2)
{
_BYTE *v2; // rsi
_BOOL8 result; // rax
char v4; // dl
_BYTE *v5; // r10
char v6; // al
char v7; // r10
char v8; // di
_BYTE *v9; // r9
char v10; // r10
char v11; // cl
char v12; // r8
_BYTE *v13; // rdx
char v14; // r11
char v15; // al
unsigned __int8 v16; // di
_BYTE *v17; // r9
char v18; // cl
char v19; // r8
char v20; // si
char v21; // r10

v2 = &a1[a2];
if ( a1 == v2 )
return 0LL;
result = 0LL;
if ( *a1 != 49 )
return result;
if ( v2 == a1 + 1 )
return 0LL;
v4 = a1[1];
if ( v4 == 55 )
{
if ( v2 == a1 + 2 )
return 0LL;
result = 0LL;
if ( a1[2] != 50 )
return result;
if ( v2 == a1 + 3 )
return 0LL;
result = 0LL;
if ( a1[3] != 46 )
return result;
if ( v2 == a1 + 4 )
return 0LL;
v7 = a1[4];
if ( v7 == 50 )
{
v5 = a1 + 5;
if ( v2 == a1 + 5 )
return 0LL;
if ( (unsigned __int8)(a1[5] - 48) > 9u )
return 0LL;
}
else if ( v7 == 51 )
{
v5 = a1 + 5;
if ( v2 == a1 + 5 )
return 0LL;
if ( (unsigned __int8)(a1[5] - 48) > 1u )
return 0LL;
}
else
{
result = 0LL;
if ( v7 != 49 )
return result;
v5 = a1 + 5;
if ( v2 == a1 + 5 )
return 0LL;
if ( (unsigned __int8)(a1[5] - 54) > 3u )
return 0LL;
}
goto LABEL_53;
}
if ( v4 == 57 )
{
if ( v2 == a1 + 2 )
return 0LL;
result = 0LL;
if ( a1[2] != 50 )
return result;
if ( v2 == a1 + 3 )
return 0LL;
result = 0LL;
if ( a1[3] != 46 )
return result;
if ( v2 == a1 + 4 )
return 0LL;
result = 0LL;
if ( a1[4] != 49 )
return result;
if ( v2 == a1 + 5 )
return 0LL;
result = 0LL;
if ( a1[5] != 54 )
return result;
v5 = a1 + 6;
if ( v2 == a1 + 6 )
return 0LL;
if ( a1[6] != 56 )
return result;
goto LABEL_53;
}
result = 0LL;
if ( v4 != 48 )
return result;
if ( v2 == a1 + 2 )
return 0LL;
result = 0LL;
if ( a1[2] != 46 )
return result;
v5 = a1 + 3;
if ( v2 == a1 + 3 )
return 0LL;
v6 = a1[3];
switch ( v6 )
{
case '1':
v5 = a1 + 4;
if ( v2 == a1 + 4 )
return 0LL;
v8 = a1[4];
if ( v8 == 46 )
{
v9 = v5;
goto LABEL_55;
}
result = 0LL;
if ( (unsigned __int8)(v8 - 48) > 9u )
return result;
break;
case '2':
v5 = a1 + 4;
if ( v2 == a1 + 4 )
return 0LL;
v11 = a1[4];
if ( v11 == 46 )
{
v9 = a1 + 4;
goto LABEL_55;
}
if ( v11 == 53 )
{
v5 = a1 + 5;
if ( v2 == a1 + 5 )
return 0LL;
v12 = a1[5];
if ( v12 == 46 )
{
v9 = a1 + 5;
goto LABEL_55;
}
if ( (unsigned __int8)(v12 - 48) > 5u )
return 0LL;
goto LABEL_53;
}
if ( v11 > 52 )
{
if ( (unsigned __int8)(v11 - 54) > 3u )
return 0LL;
goto LABEL_53;
}
if ( v11 <= 47 )
return 0LL;
break;
case '0':
goto LABEL_53;
default:
if ( (unsigned __int8)(v6 - 51) > 6u )
return 0LL;
break;
}
v9 = v5 + 1;
if ( v2 == v5 + 1 )
return 0LL;
v10 = v5[1];
if ( v10 == 46 )
goto LABEL_55;
if ( (unsigned __int8)(v10 - 48) > 9u )
return 0LL;
v5 = v9;
LABEL_53:
v9 = v5 + 1;
if ( v2 == v5 + 1 )
return 0LL;
result = 0LL;
if ( v5[1] != 46 )
return result;
LABEL_55:
v13 = v9 + 1;
if ( v2 == v9 + 1 )
return 0LL;
v14 = v9[1];
switch ( v14 )
{
case '1':
v13 = v9 + 2;
if ( v2 == v9 + 2 )
return 0LL;
v15 = v9[2];
if ( v15 == 46 )
goto LABEL_78;
v16 = v15 - 48;
result = 0LL;
if ( v16 > 9u )
return result;
v17 = v9 + 2;
break;
case '2':
v13 = v9 + 2;
if ( v2 == v9 + 2 )
return 0LL;
v18 = v9[2];
if ( v18 == 46 )
goto LABEL_78;
if ( v18 == 53 )
{
v13 = v9 + 3;
if ( v2 == v9 + 3 )
return 0LL;
v19 = v9[3];
if ( v19 == 46 )
goto LABEL_78;
if ( (unsigned __int8)(v19 - 48) > 5u )
return 0LL;
goto LABEL_75;
}
if ( v18 > 52 )
{
if ( (unsigned __int8)(v18 - 54) > 3u )
return 0LL;
goto LABEL_75;
}
if ( v18 <= 47 )
return 0LL;
v17 = v9 + 2;
break;
case '0':
goto LABEL_75;
default:
if ( (unsigned __int8)(v14 - 51) > 6u )
return 0LL;
v17 = v9 + 1;
break;
}
v13 = v17 + 1;
if ( v2 == v17 + 1 )
return 0LL;
v21 = v17[1];
if ( v21 == 46 )
goto LABEL_78;
if ( (unsigned __int8)(v21 - 48) > 9u )
return 0LL;
LABEL_75:
if ( v2 == v13 + 1 )
return 0LL;
result = 0LL;
if ( v13[1] == 46 )
{
++v13;
LABEL_78:
if ( v2 == v13 + 1 )
{
result = 0LL;
}
else
{
v20 = v13[1];
switch ( v20 )
{
case '1':
result = 1LL;
break;
case '2':
result = 1LL;
break;
case '0':
result = 1LL;
break;
default:
result = (unsigned __int8)(v20 - 51) < 7u;
break;
}
}
}
return result;
}

canonical_decompiled_code:
_BOOL8 __fastcall func0(_BYTE *a1, __int64 a2)
{
_BYTE *v2; // rsi
_BOOL8 result; // rax
char v4; // dl
_BYTE *v5; // r10
char v6; // al
char v7; // r10
char v8; // di
_BYTE *v9; // r9
char v10; // r10
char v11; // cl
char v12; // r8
_BYTE *v13; // rdx
char v14; // r11
char v15; // al
unsigned __int8 v16; // di
_BYTE *v17; // r9
char v18; // cl
char v19; // r8
char v20; // si
char v21; // r10

v2 = &a1[a2];
if ( a1 == v2 )
return 0LL;
result = 0LL;
if ( *a1 != 49 )
return result;
if ( v2 == a1 + 1 )
return 0LL;
v4 = a1[1];
if ( v4 == 55 )
{
if ( v2 == a1 + 2 )
return 0LL;
result = 0LL;
if ( a1[2] != 50 )
return result;
if ( v2 == a1 + 3 )
return 0LL;
result = 0LL;
if ( a1[3] != 46 )
return result;
if ( v2 == a1 + 4 )
return 0LL;
v7 = a1[4];
if ( v7 == 50 )
{
v5 = a1 + 5;
if ( v2 == a1 + 5 )
return 0LL;
if ( (unsigned __int8)(a1[5] - 48) > 9u )
return 0LL;
}
else if ( v7 == 51 )
{
v5 = a1 + 5;
if ( v2 == a1 + 5 )
return 0LL;
if ( (unsigned __int8)(a1[5] - 48) > 1u )
return 0LL;
}
else
{
result = 0LL;
if ( v7 != 49 )
return result;
v5 = a1 + 5;
if ( v2 == a1 + 5 )
return 0LL;
if ( (unsigned __int8)(a1[5] - 54) > 3u )
return 0LL;
}
goto LABEL_53;
}
if ( v4 == 57 )
{
if ( v2 == a1 + 2 )
return 0LL;
result = 0LL;
if ( a1[2] != 50 )
return result;
if ( v2 == a1 + 3 )
return 0LL;
result = 0LL;
if ( a1[3] != 46 )
return result;
if ( v2 == a1 + 4 )
return 0LL;
result = 0LL;
if ( a1[4] != 49 )
return result;
if ( v2 == a1 + 5 )
return 0LL;
result = 0LL;
if ( a1[5] != 54 )
return result;
v5 = a1 + 6;
if ( v2 == a1 + 6 )
return 0LL;
if ( a1[6] != 56 )
return result;
goto LABEL_53;
}
result = 0LL;
if ( v4 != 48 )
return result;
if ( v2 == a1 + 2 )
return 0LL;
result = 0LL;
if ( a1[2] != 46 )
return result;
v5 = a1 + 3;
if ( v2 == a1 + 3 )
return 0LL;
v6 = a1[3];
switch ( v6 )
{
case '1':
v5 = a1 + 4;
if ( v2 == a1 + 4 )
return 0LL;
v8 = a1[4];
if ( v8 == 46 )
{
v9 = v5;
goto LABEL_55;
}
result = 0LL;
if ( (unsigned __int8)(v8 - 48) > 9u )
return result;
break;
case '2':
v5 = a1 + 4;
if ( v2 == a1 + 4 )
return 0LL;
v11 = a1[4];
if ( v11 == 46 )
{
v9 = a1 + 4;
goto LABEL_55;
}
if ( v11 == 53 )
{
v5 = a1 + 5;
if ( v2 == a1 + 5 )
return 0LL;
v12 = a1[5];
if ( v12 == 46 )
{
v9 = a1 + 5;
goto LABEL_55;
}
if ( (unsigned __int8)(v12 - 48) > 5u )
return 0LL;
goto LABEL_53;
}
if ( v11 > 52 )
{
if ( (unsigned __int8)(v11 - 54) > 3u )
return 0LL;
goto LABEL_53;
}
if ( v11 <= 47 )
return 0LL;
break;
case '0':
goto LABEL_53;
default:
if ( (unsigned __int8)(v6 - 51) > 6u )
return 0LL;
break;
}
v9 = v5 + 1;
if ( v2 == v5 + 1 )
return 0LL;
v10 = v5[1];
if ( v10 == 46 )
goto LABEL_55;
if ( (unsigned __int8)(v10 - 48) > 9u )
return 0LL;
v5 = v9;
LABEL_53:
v9 = v5 + 1;
if ( v2 == v5 + 1 )
return 0LL;
result = 0LL;
if ( v5[1] != 46 )
return result;
LABEL_55:
v13 = v9 + 1;
if ( v2 == v9 + 1 )
return 0LL;
v14 = v9[1];
switch ( v14 )
{
case '1':
v13 = v9 + 2;
if ( v2 == v9 + 2 )
return 0LL;
v15 = v9[2];
if ( v15 == 46 )
goto LABEL_78;
v16 = v15 - 48;
result = 0LL;
if ( v16 > 9u )
return result;
v17 = v9 + 2;
break;
case '2':
v13 = v9 + 2;
if ( v2 == v9 + 2 )
return 0LL;
v18 = v9[2];
if ( v18 == 46 )
goto LABEL_78;
if ( v18 == 53 )
{
v13 = v9 + 3;
if ( v2 == v9 + 3 )
return 0LL;
v19 = v9[3];
if ( v19 == 46 )
goto LABEL_78;
if ( (unsigned __int8)(v19 - 48) > 5u )
return 0LL;
goto LABEL_75;
}
if ( v18 > 52 )
{
if ( (unsigned __int8)(v18 - 54) > 3u )
return 0LL;
goto LABEL_75;
}
if ( v18 <= 47 )
return 0LL;
v17 = v9 + 2;
break;
case '0':
goto LABEL_75;
default:
if ( (unsigned __int8)(v14 - 51) > 6u )
return 0LL;
v17 = v9 + 1;
break;
}
v13 = v17 + 1;
if ( v2 == v17 + 1 )
return 0LL;
v21 = v17[1];
if ( v21 == 46 )
goto LABEL_78;
if ( (unsigned __int8)(v21 - 48) > 9u )
return 0LL;
LABEL_75:
if ( v2 == v13 + 1 )
return 0LL;
result = 0LL;
if ( v13[1] == 46 )
{
++v13;
LABEL_78:
if ( v2 == v13 + 1 )
{
result = 0LL;
}
else
{
v20 = v13[1];
switch ( v20 )
{
case '1':
result = 1LL;
break;
case '2':
result = 1LL;
break;
case '0':
result = 1LL;
break;
default:
result = (unsigned __int8)(v20 - 51) < 7u;
break;
}
}
}
return result;
}

original_code:
unsigned int rfc1918_parser_execute(const char *str, size_t len)
{
  int cs = 0;
  const char *p, *pe;
  unsigned int is_ip_rfc1918 = 0;
  p = str;
  pe = str+len;
 {
 cs = rfc1918_parser_start;
 }
 {
 if ( p == pe )
  goto _test_eof;
 switch ( cs )
 {
case 1:
 if ( (*p) == 49 )
  goto st2;
 goto st0;
st0:
cs = 0;
 goto _out;
st2:
 if ( ++p == pe )
  goto _test_eof2;
case 2:
 switch( (*p) ) {
  case 48: goto st3;
  case 55: goto st17;
  case 57: goto st23;
 }
 goto st0;
st3:
 if ( ++p == pe )
  goto _test_eof3;
case 3:
 if ( (*p) == 46 )
  goto st4;
 goto st0;
st4:
 if ( ++p == pe )
  goto _test_eof4;
case 4:
 switch( (*p) ) {
  case 48: goto st5;
  case 49: goto st13;
  case 50: goto st15;
 }
 if ( 51 <= (*p) && (*p) <= 57 )
  goto st14;
 goto st0;
st5:
 if ( ++p == pe )
  goto _test_eof5;
case 5:
 if ( (*p) == 46 )
  goto st6;
 goto st0;
st6:
 if ( ++p == pe )
  goto _test_eof6;
case 6:
 switch( (*p) ) {
  case 48: goto st7;
  case 49: goto st9;
  case 50: goto st11;
 }
 if ( 51 <= (*p) && (*p) <= 57 )
  goto st10;
 goto st0;
st7:
 if ( ++p == pe )
  goto _test_eof7;
case 7:
 if ( (*p) == 46 )
  goto st8;
 goto st0;
st8:
 if ( ++p == pe )
  goto _test_eof8;
case 8:
 switch( (*p) ) {
  case 48: goto tr16;
  case 49: goto tr17;
  case 50: goto tr18;
 }
 if ( 51 <= (*p) && (*p) <= 57 )
  goto tr19;
 goto st0;
tr16:
 {
    is_ip_rfc1918 = 1;
  }
 goto st28;
st28:
 if ( ++p == pe )
  goto _test_eof28;
case 28:
 goto st0;
tr17:
 {
    is_ip_rfc1918 = 1;
  }
 goto st29;
st29:
 if ( ++p == pe )
  goto _test_eof29;
case 29:
 if ( 48 <= (*p) && (*p) <= 57 )
  goto tr19;
 goto st0;
tr19:
 {
    is_ip_rfc1918 = 1;
  }
 goto st30;
st30:
 if ( ++p == pe )
  goto _test_eof30;
case 30:
 if ( 48 <= (*p) && (*p) <= 57 )
  goto tr16;
 goto st0;
tr18:
 {
    is_ip_rfc1918 = 1;
  }
 goto st31;
st31:
 if ( ++p == pe )
  goto _test_eof31;
case 31:
 if ( (*p) == 53 )
  goto tr31;
 if ( (*p) > 52 ) {
  if ( 54 <= (*p) && (*p) <= 57 )
   goto tr16;
 } else if ( (*p) >= 48 )
  goto tr19;
 goto st0;
tr31:
 {
    is_ip_rfc1918 = 1;
  }
 goto st32;
st32:
 if ( ++p == pe )
  goto _test_eof32;
case 32:
 if ( 48 <= (*p) && (*p) <= 53 )
  goto tr16;
 goto st0;
st9:
 if ( ++p == pe )
  goto _test_eof9;
case 9:
 if ( (*p) == 46 )
  goto st8;
 if ( 48 <= (*p) && (*p) <= 57 )
  goto st10;
 goto st0;
st10:
 if ( ++p == pe )
  goto _test_eof10;
case 10:
 if ( (*p) == 46 )
  goto st8;
 if ( 48 <= (*p) && (*p) <= 57 )
  goto st7;
 goto st0;
st11:
 if ( ++p == pe )
  goto _test_eof11;
case 11:
 switch( (*p) ) {
  case 46: goto st8;
  case 53: goto st12;
 }
 if ( (*p) > 52 ) {
  if ( 54 <= (*p) && (*p) <= 57 )
   goto st7;
 } else if ( (*p) >= 48 )
  goto st10;
 goto st0;
st12:
 if ( ++p == pe )
  goto _test_eof12;
case 12:
 if ( (*p) == 46 )
  goto st8;
 if ( 48 <= (*p) && (*p) <= 53 )
  goto st7;
 goto st0;
st13:
 if ( ++p == pe )
  goto _test_eof13;
case 13:
 if ( (*p) == 46 )
  goto st6;
 if ( 48 <= (*p) && (*p) <= 57 )
  goto st14;
 goto st0;
st14:
 if ( ++p == pe )
  goto _test_eof14;
case 14:
 if ( (*p) == 46 )
  goto st6;
 if ( 48 <= (*p) && (*p) <= 57 )
  goto st5;
 goto st0;
st15:
 if ( ++p == pe )
  goto _test_eof15;
case 15:
 switch( (*p) ) {
  case 46: goto st6;
  case 53: goto st16;
 }
 if ( (*p) > 52 ) {
  if ( 54 <= (*p) && (*p) <= 57 )
   goto st5;
 } else if ( (*p) >= 48 )
  goto st14;
 goto st0;
st16:
 if ( ++p == pe )
  goto _test_eof16;
case 16:
 if ( (*p) == 46 )
  goto st6;
 if ( 48 <= (*p) && (*p) <= 53 )
  goto st5;
 goto st0;
st17:
 if ( ++p == pe )
  goto _test_eof17;
case 17:
 if ( (*p) == 50 )
  goto st18;
 goto st0;
st18:
 if ( ++p == pe )
  goto _test_eof18;
case 18:
 if ( (*p) == 46 )
  goto st19;
 goto st0;
st19:
 if ( ++p == pe )
  goto _test_eof19;
case 19:
 switch( (*p) ) {
  case 49: goto st20;
  case 50: goto st21;
  case 51: goto st22;
 }
 goto st0;
st20:
 if ( ++p == pe )
  goto _test_eof20;
case 20:
 if ( 54 <= (*p) && (*p) <= 57 )
  goto st5;
 goto st0;
st21:
 if ( ++p == pe )
  goto _test_eof21;
case 21:
 if ( 48 <= (*p) && (*p) <= 57 )
  goto st5;
 goto st0;
st22:
 if ( ++p == pe )
  goto _test_eof22;
case 22:
 if ( 48 <= (*p) && (*p) <= 49 )
  goto st5;
 goto st0;
st23:
 if ( ++p == pe )
  goto _test_eof23;
case 23:
 if ( (*p) == 50 )
  goto st24;
 goto st0;
st24:
 if ( ++p == pe )
  goto _test_eof24;
case 24:
 if ( (*p) == 46 )
  goto st25;
 goto st0;
st25:
 if ( ++p == pe )
  goto _test_eof25;
case 25:
 if ( (*p) == 49 )
  goto st26;
 goto st0;
st26:
 if ( ++p == pe )
  goto _test_eof26;
case 26:
 if ( (*p) == 54 )
  goto st27;
 goto st0;
st27:
 if ( ++p == pe )
  goto _test_eof27;
case 27:
 if ( (*p) == 56 )
  goto st5;
 goto st0;
 }
 _test_eof2: cs = 2; goto _test_eof;
 _test_eof3: cs = 3; goto _test_eof;
 _test_eof4: cs = 4; goto _test_eof;
 _test_eof5: cs = 5; goto _test_eof;
 _test_eof6: cs = 6; goto _test_eof;
 _test_eof7: cs = 7; goto _test_eof;
 _test_eof8: cs = 8; goto _test_eof;
 _test_eof28: cs = 28; goto _test_eof;
 _test_eof29: cs = 29; goto _test_eof;
 _test_eof30: cs = 30; goto _test_eof;
 _test_eof31: cs = 31; goto _test_eof;
 _test_eof32: cs = 32; goto _test_eof;
 _test_eof9: cs = 9; goto _test_eof;
 _test_eof10: cs = 10; goto _test_eof;
 _test_eof11: cs = 11; goto _test_eof;
 _test_eof12: cs = 12; goto _test_eof;
 _test_eof13: cs = 13; goto _test_eof;
 _test_eof14: cs = 14; goto _test_eof;
 _test_eof15: cs = 15; goto _test_eof;
 _test_eof16: cs = 16; goto _test_eof;
 _test_eof17: cs = 17; goto _test_eof;
 _test_eof18: cs = 18; goto _test_eof;
 _test_eof19: cs = 19; goto _test_eof;
 _test_eof20: cs = 20; goto _test_eof;
 _test_eof21: cs = 21; goto _test_eof;
 _test_eof22: cs = 22; goto _test_eof;
 _test_eof23: cs = 23; goto _test_eof;
 _test_eof24: cs = 24; goto _test_eof;
 _test_eof25: cs = 25; goto _test_eof;
 _test_eof26: cs = 26; goto _test_eof;
 _test_eof27: cs = 27; goto _test_eof;
 _test_eof: {}
 _out: {}
 }
  return is_ip_rfc1918;
}

canonical_original_code:
unsigned int rfc1918_parser_execute(char *str, unsigned long len)
{
  int cs = 0;
  char *p; char *pe;
  unsigned int is_ip_rfc1918 = 0;
  p = str;
  pe = str+len;
 {
 cs = rfc1918_parser_start;
 }
 {
 if ( p == pe )
  goto _test_eof;
 switch ( cs )
 {
case 1:
 if ( (*p) == 49 )
  goto st2;
 goto st0;
st0:
cs = 0;
 goto _out;
st2:
 if ( ++p == pe )
  goto _test_eof2;
case 2:
 switch( (*p) ) {
  case 48: goto st3;
  case 55: goto st17;
  case 57: goto st23;
 }
 goto st0;
st3:
 if ( ++p == pe )
  goto _test_eof3;
case 3:
 if ( (*p) == 46 )
  goto st4;
 goto st0;
st4:
 if ( ++p == pe )
  goto _test_eof4;
case 4:
 switch( (*p) ) {
  case 48: goto st5;
  case 49: goto st13;
  case 50: goto st15;
 }
 if ( 51 <= (*p) && (*p) <= 57 )
  goto st14;
 goto st0;
st5:
 if ( ++p == pe )
  goto _test_eof5;
case 5:
 if ( (*p) == 46 )
  goto st6;
 goto st0;
st6:
 if ( ++p == pe )
  goto _test_eof6;
case 6:
 switch( (*p) ) {
  case 48: goto st7;
  case 49: goto st9;
  case 50: goto st11;
 }
 if ( 51 <= (*p) && (*p) <= 57 )
  goto st10;
 goto st0;
st7:
 if ( ++p == pe )
  goto _test_eof7;
case 7:
 if ( (*p) == 46 )
  goto st8;
 goto st0;
st8:
 if ( ++p == pe )
  goto _test_eof8;
case 8:
 switch( (*p) ) {
  case 48: goto tr16;
  case 49: goto tr17;
  case 50: goto tr18;
 }
 if ( 51 <= (*p) && (*p) <= 57 )
  goto tr19;
 goto st0;
tr16:
 {
    is_ip_rfc1918 = 1;
  }
 goto st28;
st28:
 if ( ++p == pe )
  goto _test_eof28;
case 28:
 goto st0;
tr17:
 {
    is_ip_rfc1918 = 1;
  }
 goto st29;
st29:
 if ( ++p == pe )
  goto _test_eof29;
case 29:
 if ( 48 <= (*p) && (*p) <= 57 )
  goto tr19;
 goto st0;
tr19:
 {
    is_ip_rfc1918 = 1;
  }
 goto st30;
st30:
 if ( ++p == pe )
  goto _test_eof30;
case 30:
 if ( 48 <= (*p) && (*p) <= 57 )
  goto tr16;
 goto st0;
tr18:
 {
    is_ip_rfc1918 = 1;
  }
 goto st31;
st31:
 if ( ++p == pe )
  goto _test_eof31;
case 31:
 if ( (*p) == 53 )
  goto tr31;
 if ( (*p) > 52 ) {
  if ( 54 <= (*p) && (*p) <= 57 )
   goto tr16;
 } else if ( (*p) >= 48 )
  goto tr19;
 goto st0;
tr31:
 {
    is_ip_rfc1918 = 1;
  }
 goto st32;
st32:
 if ( ++p == pe )
  goto _test_eof32;
case 32:
 if ( 48 <= (*p) && (*p) <= 53 )
  goto tr16;
 goto st0;
st9:
 if ( ++p == pe )
  goto _test_eof9;
case 9:
 if ( (*p) == 46 )
  goto st8;
 if ( 48 <= (*p) && (*p) <= 57 )
  goto st10;
 goto st0;
st10:
 if ( ++p == pe )
  goto _test_eof10;
case 10:
 if ( (*p) == 46 )
  goto st8;
 if ( 48 <= (*p) && (*p) <= 57 )
  goto st7;
 goto st0;
st11:
 if ( ++p == pe )
  goto _test_eof11;
case 11:
 switch( (*p) ) {
  case 46: goto st8;
  case 53: goto st12;
 }
 if ( (*p) > 52 ) {
  if ( 54 <= (*p) && (*p) <= 57 )
   goto st7;
 } else if ( (*p) >= 48 )
  goto st10;
 goto st0;
st12:
 if ( ++p == pe )
  goto _test_eof12;
case 12:
 if ( (*p) == 46 )
  goto st8;
 if ( 48 <= (*p) && (*p) <= 53 )
  goto st7;
 goto st0;
st13:
 if ( ++p == pe )
  goto _test_eof13;
case 13:
 if ( (*p) == 46 )
  goto st6;
 if ( 48 <= (*p) && (*p) <= 57 )
  goto st14;
 goto st0;
st14:
 if ( ++p == pe )
  goto _test_eof14;
case 14:
 if ( (*p) == 46 )
  goto st6;
 if ( 48 <= (*p) && (*p) <= 57 )
  goto st5;
 goto st0;
st15:
 if ( ++p == pe )
  goto _test_eof15;
case 15:
 switch( (*p) ) {
  case 46: goto st6;
  case 53: goto st16;
 }
 if ( (*p) > 52 ) {
  if ( 54 <= (*p) && (*p) <= 57 )
   goto st5;
 } else if ( (*p) >= 48 )
  goto st14;
 goto st0;
st16:
 if ( ++p == pe )
  goto _test_eof16;
case 16:
 if ( (*p) == 46 )
  goto st6;
 if ( 48 <= (*p) && (*p) <= 53 )
  goto st5;
 goto st0;
st17:
 if ( ++p == pe )
  goto _test_eof17;
case 17:
 if ( (*p) == 50 )
  goto st18;
 goto st0;
st18:
 if ( ++p == pe )
  goto _test_eof18;
case 18:
 if ( (*p) == 46 )
  goto st19;
 goto st0;
st19:
 if ( ++p == pe )
  goto _test_eof19;
case 19:
 switch( (*p) ) {
  case 49: goto st20;
  case 50: goto st21;
  case 51: goto st22;
 }
 goto st0;
st20:
 if ( ++p == pe )
  goto _test_eof20;
case 20:
 if ( 54 <= (*p) && (*p) <= 57 )
  goto st5;
 goto st0;
st21:
 if ( ++p == pe )
  goto _test_eof21;
case 21:
 if ( 48 <= (*p) && (*p) <= 57 )
  goto st5;
 goto st0;
st22:
 if ( ++p == pe )
  goto _test_eof22;
case 22:
 if ( 48 <= (*p) && (*p) <= 49 )
  goto st5;
 goto st0;
st23:
 if ( ++p == pe )
  goto _test_eof23;
case 23:
 if ( (*p) == 50 )
  goto st24;
 goto st0;
st24:
 if ( ++p == pe )
  goto _test_eof24;
case 24:
 if ( (*p) == 46 )
  goto st25;
 goto st0;
st25:
 if ( ++p == pe )
  goto _test_eof25;
case 25:
 if ( (*p) == 49 )
  goto st26;
 goto st0;
st26:
 if ( ++p == pe )
  goto _test_eof26;
case 26:
 if ( (*p) == 54 )
  goto st27;
 goto st0;
st27:
 if ( ++p == pe )
  goto _test_eof27;
case 27:
 if ( (*p) == 56 )
  goto st5;
 goto st0;
 }
 _test_eof2: cs = 2; goto _test_eof;
 _test_eof3: cs = 3; goto _test_eof;
 _test_eof4: cs = 4; goto _test_eof;
 _test_eof5: cs = 5; goto _test_eof;
 _test_eof6: cs = 6; goto _test_eof;
 _test_eof7: cs = 7; goto _test_eof;
 _test_eof8: cs = 8; goto _test_eof;
 _test_eof28: cs = 28; goto _test_eof;
 _test_eof29: cs = 29; goto _test_eof;
 _test_eof30: cs = 30; goto _test_eof;
 _test_eof31: cs = 31; goto _test_eof;
 _test_eof32: cs = 32; goto _test_eof;
 _test_eof9: cs = 9; goto _test_eof;
 _test_eof10: cs = 10; goto _test_eof;
 _test_eof11: cs = 11; goto _test_eof;
 _test_eof12: cs = 12; goto _test_eof;
 _test_eof13: cs = 13; goto _test_eof;
 _test_eof14: cs = 14; goto _test_eof;
 _test_eof15: cs = 15; goto _test_eof;
 _test_eof16: cs = 16; goto _test_eof;
 _test_eof17: cs = 17; goto _test_eof;
 _test_eof18: cs = 18; goto _test_eof;
 _test_eof19: cs = 19; goto _test_eof;
 _test_eof20: cs = 20; goto _test_eof;
 _test_eof21: cs = 21; goto _test_eof;
 _test_eof22: cs = 22; goto _test_eof;
 _test_eof23: cs = 23; goto _test_eof;
 _test_eof24: cs = 24; goto _test_eof;
 _test_eof25: cs = 25; goto _test_eof;
 _test_eof26: cs = 26; goto _test_eof;
 _test_eof27: cs = 27; goto _test_eof;
 _test_eof: {}
 _out: {}
 }
  return is_ip_rfc1918;
}

variable_types:
str
char *

variable_types:
len
unsigned long

variable_types: cs int

variable_types:
p
char *

variable_types:
pe
char *

return_type: unsigned int


decompiled_code:
__int64 __fastcall shm_malloc(unsigned int a1)
{
__int64 v1; // rbx

futex_get(mem_lock);
v1 = qm_malloc(shm_block, a1);
futex_release(mem_lock);
return v1;
}

canonical_decompiled_code:
__int64 __fastcall func4(unsigned int a1)
{
__int64 v1; // rbx

func2(mem_lock);
v1 = qm_malloc(shm_block, a1);
func3(mem_lock);
return v1;
}

original_code:
inline static void* shm_malloc(unsigned int size)
{
 void *p;
 futex_get(mem_lock);
 p=qm_malloc(shm_block, (size));
 futex_release(mem_lock);
  return p;
}

canonical_original_code:
inline static void *shm_malloc(unsigned int size)
{
 void *p;
 futex_get(mem_lock);
 p=qm_malloc(shm_block, (size));
 futex_release(mem_lock);
  return p;
}

variable_types:
size
unsigned int

variable_types:
p
void *

return_type: void *


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

if ( a1 )
{
if ( *(_QWORD *)(a1 + 8) )
{
futex_get(mem_lock);
qm_free(shm_block, *(_QWORD *)(a1 + 8));
futex_release(mem_lock);
}
futex_get(mem_lock);
qm_free(shm_block, a1);
result = futex_release(mem_lock);
}
return result;
}

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

if ( a1 )
{
if ( *(_QWORD *)(a1 + 8) )
{
func2(mem_lock);
qm_free(shm_block, *(_QWORD *)(a1 + 8));
func3(mem_lock);
}
func2(mem_lock);
qm_free(shm_block, a1);
result = func3(mem_lock);
}
return result;
}

original_code:
static void free_package(package_t *p)
{
 if (!p) return;
 if (p->name) do { futex_get(mem_lock); qm_free(shm_block, (p->name)); futex_release(mem_lock); }while(0);
 do { futex_get(mem_lock); qm_free(shm_block, (p)); futex_release(mem_lock); }while(0);
}

canonical_original_code:
static void free_package(struct _package_t *p)
{
 if (!p) return;
 if (p->name) do { futex_get(mem_lock); qm_free(shm_block, (p->name)); futex_release(mem_lock); }while(0);
 do { futex_get(mem_lock); qm_free(shm_block, (p)); futex_release(mem_lock); }while(0);
}

variable_types: struct _package_t { struct _package_t *__next; char *name; } *


decompiled_code:
__int64 __fastcall free_packages(_QWORD **a1)
{
_QWORD *v2; // rbx
__int64 v3; // rdi
__int64 result; // rax

if ( a1 )
{
v2 = *a1;
while ( v2 )
{
v3 = (__int64)v2;
v2 = (_QWORD *)*v2;
free_package(v3);
}
futex_get(mem_lock);
qm_free(shm_block, a1);
result = futex_release(mem_lock);
}
return result;
}

canonical_decompiled_code:
__int64 __fastcall func8(_QWORD **a1)
{
_QWORD *v2; // rbx
__int64 v3; // rdi
__int64 result; // rax

if ( a1 )
{
v2 = *a1;
while ( v2 )
{
v3 = (__int64)v2;
v2 = (_QWORD *)*v2;
func7(v3);
}
func2(mem_lock);
qm_free(shm_block, a1);
result = func3(mem_lock);
}
return result;
}

original_code:
static void free_packages(packages_t *p)
{
 package_t *e, *f;
 if (!p) return;
 e = p->package;
 while (e) {
  f = (e)->__next;
  free_package(e);
  e = f;
 }
 do { futex_get(mem_lock); qm_free(shm_block, (p)); futex_release(mem_lock); }while(0);
}

canonical_original_code:
static void free_packages(struct _packages_t *p)
{
 struct _package_t *e; struct _package_t *f;
 if (!p) return;
 e = p->package;
 while (e) {
  f = (e)->__next;
  free_package(e);
  e = f;
 }
 do { futex_get(mem_lock); qm_free(shm_block, (p)); futex_release(mem_lock); }while(0);
}

variable_types: struct _packages_t { struct _package_t { struct _package_t *__next; char *name; } *package; } *

user_defined_types: struct _packages_t { struct _package_t *package; }


decompiled_code:
__int64 __fastcall free_service(__int64 a1)
{
int v1; // edx
__int64 result; // rax

if ( a1 )
{
if ( *(_QWORD *)(a1 + 32) )
{
futex_get(mem_lock);
qm_free(shm_block, *(_QWORD *)(a1 + 32));
futex_release(mem_lock);
}
v1 = *(_DWORD *)(a1 + 16);
if ( v1 )
{
if ( v1 == 1 )
{
futex_get(mem_lock);
qm_free(shm_block, *(_QWORD *)(a1 + 24));
futex_release(mem_lock);
}
}
else
{
free_list(*(_QWORD *)(a1 + 24));
}
free_packages(*(_QWORD ***)(a1 + 8));
futex_get(mem_lock);
qm_free(shm_block, a1);
result = futex_release(mem_lock);
}
return result;
}

canonical_decompiled_code:
__int64 __fastcall func13(__int64 a1)
{
int v1; // edx
__int64 result; // rax

if ( a1 )
{
if ( *(_QWORD *)(a1 + 32) )
{
func2(mem_lock);
qm_free(shm_block, *(_QWORD *)(a1 + 32));
func3(mem_lock);
}
v1 = *(_DWORD *)(a1 + 16);
if ( v1 )
{
if ( v1 == 1 )
{
func2(mem_lock);
qm_free(shm_block, *(_QWORD *)(a1 + 24));
func3(mem_lock);
}
}
else
{
free_list(*(_QWORD *)(a1 + 24));
}
func8(*(_QWORD ***)(a1 + 8));
func2(mem_lock);
qm_free(shm_block, a1);
result = func3(mem_lock);
}
return result;
}

original_code:
void free_service(service_t *s)
{
 if (!s) return;
 if (s->uri) do { futex_get(mem_lock); qm_free(shm_block, (s->uri)); futex_release(mem_lock); }while(0);
 switch (s->content_type) {
  case stc_list: free_list(s->content.list); break;
  case stc_resource_list: do { futex_get(mem_lock); qm_free(shm_block, (s->content.resource_list)); futex_release(mem_lock); }while(0); break;
 }
 free_packages(s->packages);
 do { futex_get(mem_lock); qm_free(shm_block, (s)); futex_release(mem_lock); }while(0);
}

canonical_original_code:
void free_service(struct _service_t *s)
{
 if (!s) return;
 if (s->uri) do { futex_get(mem_lock); qm_free(shm_block, (s->uri)); futex_release(mem_lock); }while(0);
 switch (s->content_type) {
  case stc_list: free_list(s->content.list); break;
  case stc_resource_list: do { futex_get(mem_lock); qm_free(shm_block, (s->content.resource_list)); futex_release(mem_lock); }while(0); break;
 }
 free_packages(s->packages);
 do { futex_get(mem_lock); qm_free(shm_block, (s)); futex_release(mem_lock); }while(0);
}

variable_types: struct _service_t { struct _service_t *__next; struct _packages_t { struct _package_t { struct _package_t *__next; char *name; } *package; } *packages; enum service_content_type_t { stc_list=0, stc_resource_list=1 } content_type; union { struct _list_t { struct _list_t *__next; char *display_name; struct _list_content_t { struct _list_content_t *__next; enum list_content_type_t { lct_list=0, lct_entry=1, lct_entry_ref=2, lct_external=3 } type; union { struct _list_t *list; struct entry_t { char *uri; struct _display_name_t { struct _display_name_t *__next; char *name; char *lang; } *display_names; } *entry; struct entry_ref_t { char *ref; } *entry_ref; struct external_t { char *anchor; } *external; } u; } *content; char *name; } *list; char *resource_list; } content; char *uri; } *

user_defined_types: struct _service_t { struct _service_t *__next; struct _packages_t *packages; enum service_content_type_t content_type; union { struct _list_t *list; char *resource_list; } content; char *uri; }

user_defined_types: struct _list_t { struct _list_t *__next; char *display_name; struct _list_content_t *content; char *name; }

user_defined_types: struct _list_content_t { struct _list_content_t *__next; enum list_content_type_t type; union { struct _list_t *list; struct entry_t *entry; struct entry_ref_t *entry_ref; struct external_t *external; } u; }

user_defined_types: struct entry_t { char *uri; struct _display_name_t *display_names; }


decompiled_code:
__int64 __fastcall free_rls_services(_QWORD **a1)
{
_QWORD *v2; // rbx
__int64 v3; // rdi
__int64 result; // rax

if ( a1 )
{
v2 = *a1;
while ( v2 )
{
v3 = (__int64)v2;
v2 = (_QWORD *)*v2;
free_service(v3);
}
futex_get(mem_lock);
qm_free(shm_block, a1);
result = futex_release(mem_lock);
}
return result;
}

canonical_decompiled_code:
__int64 __fastcall func14(_QWORD **a1)
{
_QWORD *v2; // rbx
__int64 v3; // rdi
__int64 result; // rax

if ( a1 )
{
v2 = *a1;
while ( v2 )
{
v3 = (__int64)v2;
v2 = (_QWORD *)*v2;
func13(v3);
}
func2(mem_lock);
qm_free(shm_block, a1);
result = func3(mem_lock);
}
return result;
}

original_code:
void free_rls_services(rls_services_t *rls)
{
 service_t *e, *f;
 if (!rls) return;
 e = rls->rls_services;
 while (e) {
  f = (e)->__next;
  free_service(e);
  e = f;
 }
 do { futex_get(mem_lock); qm_free(shm_block, (rls)); futex_release(mem_lock); }while(0);
}

canonical_original_code:
void free_rls_services(struct rls_services_t *rls)
{
 struct _service_t *e; struct _service_t *f;
 if (!rls) return;
 e = rls->rls_services;
 while (e) {
  f = (e)->__next;
  free_service(e);
  e = f;
 }
 do { futex_get(mem_lock); qm_free(shm_block, (rls)); futex_release(mem_lock); }while(0);
}

variable_types: struct rls_services_t { struct _service_t { struct _service_t *__next; struct _packages_t { struct _package_t { struct _package_t *__next; char *name; } *package; } *packages; enum service_content_type_t { stc_list=0, stc_resource_list=1 } content_type; union { struct _list_t { struct _list_t *__next; char *display_name; struct _list_content_t { struct _list_content_t *__next; enum list_content_type_t { lct_list=0, lct_entry=1, lct_entry_ref=2, lct_external=3 } type; union { struct _list_t *list; struct entry_t { char *uri; struct _display_name_t { struct _display_name_t *__next; char *name; char *lang; } *display_names; } *entry; struct entry_ref_t { char *ref; } *entry_ref; struct external_t { char *anchor; } *external; } u; } *content; char *name; } *list; char *resource_list; } content; char *uri; } *rls_services; } *

user_defined_types: struct rls_services_t { struct _service_t *rls_services; }


decompiled_code:
char *__fastcall binrpc_error(int a1)
{
int v1; // edi

v1 = abs32(a1);
if ( v1 > 10 )
v1 = 10;
return binrpc_str_errors[v1];
}

canonical_decompiled_code:
char *__fastcall func0(int a1)
{
int v1; // edi

v1 = abs32(a1);
if ( v1 > 10 )
v1 = 10;
return binrpc_str_errors[v1];
}

original_code:
const char* binrpc_error(int err)
{
 if (err<0) err=-err;
 if (err>(- -10)) err=- -10;
 return binrpc_str_errors[err];
}

canonical_original_code:
char *binrpc_error(int err)
{
 if (err<0) err=-err;
 if (err>(- -10)) err=- -10;
 return binrpc_str_errors[err];
}

variable_types: err int

return_type: char *


decompiled_code:
__int64 __fastcall fixup_replace_from1(const char **a1)
{
const char **v2; // rax
const char **v3; // rbx
const char *v4; // rdi
int v5; // eax
__int64 result; // rax
int v7; // er10
const char *v8; // rbx
unsigned int v9; // eax
int v10; // edx
const char *v11; // rbp
unsigned int v12; // eax

v2 = (const char **)qm_malloc(mem_block, 16LL);
if ( v2 )
{
v3 = v2;
v4 = *a1;
*v2 = *a1;
v5 = strlen(v4);
*((_DWORD *)v3 + 2) = v5;
if ( v5 )
{
*a1 = (const char *)v3;
result = 0LL;
}
else
{
v10 = get_debug_level(&LC0, 3LL);
result = 0xFFFFFFFFLL;
if ( v10 >= -2 )
{
result = 0xFFFFFFFFLL;
if ( !dprint_crit )
{
++dprint_crit;
if ( log_stderr )
{
if ( log_color )
dprint_color(4294967294LL);
v11 = (const char *)*((_QWORD *)&log_level_info + 6);
v12 = my_pid();
fprintf(
stderr,
"%2d(%d) %s: %s%s(): ERROR:uac:fixup_replace_from1: empty parameter not accepted\n",
process_no,
v12,
v11,
"uac [uac.c:180]: ",
"fixup_replace_from1");
if ( log_color )
dprint_color_reset();
}
else
{
syslog(
*((_DWORD *)&log_level_info + 14) | *(_DWORD *)(core_cfg + 4LL),
"%s: %s%s(): ERROR:uac:fixup_replace_from1: empty parameter not accepted\n",
*((const char **)&log_level_info + 6),
"uac [uac.c:180]: ",
"fixup_replace_from1");
}
--dprint_crit;
result = 0xFFFFFFFFLL;
}
}
}
}
else
{
v7 = get_debug_level(&LC0, 3LL);
result = 4294967294LL;
if ( v7 >= -2 )
{
result = 4294967294LL;
if ( !dprint_crit )
{
++dprint_crit;
if ( log_stderr )
{
if ( log_color )
dprint_color(4294967294LL);
v8 = (const char *)*((_QWORD *)&log_level_info + 6);
v9 = my_pid();
fprintf(
stderr,
"%2d(%d) %s: %s%s(): ERROR:uac:fixup_replace_from1: no more pkg mem\n",
process_no,
v9,
v8,
"uac [uac.c:173]: ",
"fixup_replace_from1");
if ( log_color )
dprint_color_reset();
}
else
{
syslog(
*((_DWORD *)&log_level_info + 14) | *(_DWORD *)(core_cfg + 4LL),
"%s: %s%s(): ERROR:uac:fixup_replace_from1: no more pkg mem\n",
*((const char **)&log_level_info + 6),
"uac [uac.c:173]: ",
"fixup_replace_from1");
}
--dprint_crit;
result = 4294967294LL;
}
}
}
return result;
}

canonical_decompiled_code:
__int64 __fastcall func4(const char **a1)
{
const char **v2; // rax
const char **v3; // rbx
const char *v4; // rdi
int v5; // eax
__int64 result; // rax
int v7; // er10
const char *v8; // rbx
unsigned int v9; // eax
int v10; // edx
const char *v11; // rbp
unsigned int v12; // eax

v2 = (const char **)qm_malloc(mem_block, 16LL);
if ( v2 )
{
v3 = v2;
v4 = *a1;
*v2 = *a1;
v5 = strlen(v4);
*((_DWORD *)v3 + 2) = v5;
if ( v5 )
{
*a1 = (const char *)v3;
result = 0LL;
}
else
{
v10 = get_debug_level(&LC0, 3LL);
result = 0xFFFFFFFFLL;
if ( v10 >= -2 )
{
result = 0xFFFFFFFFLL;
if ( !dprint_crit )
{
++dprint_crit;
if ( log_stderr )
{
if ( log_color )
dprint_color(4294967294LL);
v11 = (const char *)*((_QWORD *)&log_level_info + 6);
v12 = my_pid();
fprintf(
stderr,
"%2d(%d) %s: %s%s(): ERROR:uac:fixup_replace_from1: empty parameter not accepted\n",
process_no,
v12,
v11,
"uac [uac.c:180]: ",
"fixup_replace_from1");
if ( log_color )
dprint_color_reset();
}
else
{
syslog(
*((_DWORD *)&log_level_info + 14) | *(_DWORD *)(core_cfg + 4LL),
"%s: %s%s(): ERROR:uac:fixup_replace_from1: empty parameter not accepted\n",
*((const char **)&log_level_info + 6),
"uac [uac.c:180]: ",
"fixup_replace_from1");
}
--dprint_crit;
result = 0xFFFFFFFFLL;
}
}
}
}
else
{
v7 = get_debug_level(&LC0, 3LL);
result = 4294967294LL;
if ( v7 >= -2 )
{
result = 4294967294LL;
if ( !dprint_crit )
{
++dprint_crit;
if ( log_stderr )
{
if ( log_color )
dprint_color(4294967294LL);
v8 = (const char *)*((_QWORD *)&log_level_info + 6);
v9 = my_pid();
fprintf(
stderr,
"%2d(%d) %s: %s%s(): ERROR:uac:fixup_replace_from1: no more pkg mem\n",
process_no,
v9,
v8,
"uac [uac.c:173]: ",
"fixup_replace_from1");
if ( log_color )
dprint_color_reset();
}
else
{
syslog(
*((_DWORD *)&log_level_info + 14) | *(_DWORD *)(core_cfg + 4LL),
"%s: %s%s(): ERROR:uac:fixup_replace_from1: no more pkg mem\n",
*((const char **)&log_level_info + 6),
"uac [uac.c:173]: ",
"fixup_replace_from1");
}
--dprint_crit;
result = 4294967294LL;
}
}
}
return result;
}

original_code:
static int fixup_replace_from1(void** param, int param_no)
{
 str *s;
 s = (str*)qm_malloc(mem_block, (sizeof(str)));
 if (s==0)
 {
  do { if (get_debug_level("uac", (sizeof("uac")-1)) >= ((-2)) && (dprint_crit==0)) { (dprint_crit++); if (__builtin_expect(!!((((-2)) >= -5) && (((-2)) <= 3)), 1)){ if (__builtin_expect(!!(log_stderr), 0)) { if (__builtin_expect(!!(log_color), 0)) dprint_color((-2)); fprintf(stderr, "%2d(%d) %s: %s" "%s(): " "ERROR:uac:fixup_replace_from1: no more pkg mem\n", process_no, my_pid(), (log_level_info[((-2)) - (-5)].name), ("uac" " [" "uac.c" ":" "173" "]: ") , __func__); if (__builtin_expect(!!(log_color), 0)) dprint_color_reset(); } else { syslog((log_level_info[((-2)) - (-5)].syslog_level) | (((0) != 0) ? (0) : ((struct cfg_group_core *)core_cfg)->log_facility), "%s: %s" "%s(): " "ERROR:uac:fixup_replace_from1: no more pkg mem\n", (log_level_info[((-2)) - (-5)].name), ("uac" " [" "uac.c" ":" "173" "]: ") , __func__); } } else { if (log_stderr) { if (__builtin_expect(!!(log_color), 0)) dprint_color((-2)); fprintf(stderr, "%2d(%d) %s" "%s(): " "ERROR:uac:fixup_replace_from1: no more pkg mem\n", process_no, my_pid(), ("uac" " [" "uac.c" ":" "173" "]: ") , __func__); if (__builtin_expect(!!(log_color), 0)) dprint_color_reset(); } else { if (((-2))<-5) syslog((log_level_info[(-5) - (-5)].syslog_level) | (((0) != 0) ? (0) : ((struct cfg_group_core *)core_cfg)->log_facility), "%s" "%s(): " "ERROR:uac:fixup_replace_from1: no more pkg mem\n", ("uac" " [" "uac.c" ":" "173" "]: ") , __func__); else syslog((log_level_info[(3) - (-5)].syslog_level) | (((0) != 0) ? (0) : ((struct cfg_group_core *)core_cfg)->log_facility), "%s" "%s(): " "ERROR:uac:fixup_replace_from1: no more pkg mem\n", ("uac" " [" "uac.c" ":" "173" "]: ") , __func__); } } (dprint_crit--); } } while(0);
  return -2;
 }
 s->s = (char*)*param;
 s->len = strlen(s->s);
 if (s->len==0)
 {
  do { if (get_debug_level("uac", (sizeof("uac")-1)) >= ((-2)) && (dprint_crit==0)) { (dprint_crit++); if (__builtin_expect(!!((((-2)) >= -5) && (((-2)) <= 3)), 1)){ if (__builtin_expect(!!(log_stderr), 0)) { if (__builtin_expect(!!(log_color), 0)) dprint_color((-2)); fprintf(stderr, "%2d(%d) %s: %s" "%s(): " "ERROR:uac:fixup_replace_from1: empty parameter " "not accepted\n", process_no, my_pid(), (log_level_info[((-2)) - (-5)].name), ("uac" " [" "uac.c" ":" "180" "]: ") , __func__); if (__builtin_expect(!!(log_color), 0)) dprint_color_reset(); } else { syslog((log_level_info[((-2)) - (-5)].syslog_level) | (((0) != 0) ? (0) : ((struct cfg_group_core *)core_cfg)->log_facility), "%s: %s" "%s(): " "ERROR:uac:fixup_replace_from1: empty parameter " "not accepted\n", (log_level_info[((-2)) - (-5)].name), ("uac" " [" "uac.c" ":" "180" "]: ") , __func__); } } else { if (log_stderr) { if (__builtin_expect(!!(log_color), 0)) dprint_color((-2)); fprintf(stderr, "%2d(%d) %s" "%s(): " "ERROR:uac:fixup_replace_from1: empty parameter " "not accepted\n", process_no, my_pid(), ("uac" " [" "uac.c" ":" "180" "]: ") , __func__); if (__builtin_expect(!!(log_color), 0)) dprint_color_reset(); } else { if (((-2))<-5) syslog((log_level_info[(-5) - (-5)].syslog_level) | (((0) != 0) ? (0) : ((struct cfg_group_core *)core_cfg)->log_facility), "%s" "%s(): " "ERROR:uac:fixup_replace_from1: empty parameter " "not accepted\n", ("uac" " [" "uac.c" ":" "180" "]: ") , __func__); else syslog((log_level_info[(3) - (-5)].syslog_level) | (((0) != 0) ? (0) : ((struct cfg_group_core *)core_cfg)->log_facility), "%s" "%s(): " "ERROR:uac:fixup_replace_from1: empty parameter " "not accepted\n", ("uac" " [" "uac.c" ":" "180" "]: ") , __func__); } } (dprint_crit--); } } while(0);
  return -1;
 }
 *param=(void*)s;
 return 0;
}

canonical_original_code:
static int fixup_replace_from1(void **param, int param_no)
{
 struct _str *s;
 s = (struct _str *)qm_malloc(mem_block, (sizeof(str)));
 if (s==0)
 {
  do { if (get_debug_level("uac", (sizeof("uac")-1)) >= ((-2)) && (dprint_crit==0)) { (dprint_crit++); if (__builtin_expect(!!((((-2)) >= -5) && (((-2)) <= 3)), 1)){ if (__builtin_expect(!!(log_stderr), 0)) { if (__builtin_expect(!!(log_color), 0)) dprint_color((-2)); fprintf(stderr, "%2d(%d) %s: %s" "%s(): " "ERROR:uac:fixup_replace_from1: no more pkg mem\n", process_no, my_pid(), (log_level_info[((-2)) - (-5)].name), ("uac" " [" "uac.c" ":" "173" "]: ") , __func__); if (__builtin_expect(!!(log_color), 0)) dprint_color_reset(); } else { syslog((log_level_info[((-2)) - (-5)].syslog_level) | (((0) != 0) ? (0) : ((struct cfg_group_core *)core_cfg)->log_facility), "%s: %s" "%s(): " "ERROR:uac:fixup_replace_from1: no more pkg mem\n", (log_level_info[((-2)) - (-5)].name), ("uac" " [" "uac.c" ":" "173" "]: ") , __func__); } } else { if (log_stderr) { if (__builtin_expect(!!(log_color), 0)) dprint_color((-2)); fprintf(stderr, "%2d(%d) %s" "%s(): " "ERROR:uac:fixup_replace_from1: no more pkg mem\n", process_no, my_pid(), ("uac" " [" "uac.c" ":" "173" "]: ") , __func__); if (__builtin_expect(!!(log_color), 0)) dprint_color_reset(); } else { if (((-2))<-5) syslog((log_level_info[(-5) - (-5)].syslog_level) | (((0) != 0) ? (0) : ((struct cfg_group_core *)core_cfg)->log_facility), "%s" "%s(): " "ERROR:uac:fixup_replace_from1: no more pkg mem\n", ("uac" " [" "uac.c" ":" "173" "]: ") , __func__); else syslog((log_level_info[(3) - (-5)].syslog_level) | (((0) != 0) ? (0) : ((struct cfg_group_core *)core_cfg)->log_facility), "%s" "%s(): " "ERROR:uac:fixup_replace_from1: no more pkg mem\n", ("uac" " [" "uac.c" ":" "173" "]: ") , __func__); } } (dprint_crit--); } } while(0);
  return -2;
 }
 s->s = (char *)*param;
 s->len = strlen(s->s);
 if (s->len==0)
 {
  do { if (get_debug_level("uac", (sizeof("uac")-1)) >= ((-2)) && (dprint_crit==0)) { (dprint_crit++); if (__builtin_expect(!!((((-2)) >= -5) && (((-2)) <= 3)), 1)){ if (__builtin_expect(!!(log_stderr), 0)) { if (__builtin_expect(!!(log_color), 0)) dprint_color((-2)); fprintf(stderr, "%2d(%d) %s: %s" "%s(): " "ERROR:uac:fixup_replace_from1: empty parameter " "not accepted\n", process_no, my_pid(), (log_level_info[((-2)) - (-5)].name), ("uac" " [" "uac.c" ":" "180" "]: ") , __func__); if (__builtin_expect(!!(log_color), 0)) dprint_color_reset(); } else { syslog((log_level_info[((-2)) - (-5)].syslog_level) | (((0) != 0) ? (0) : ((struct cfg_group_core *)core_cfg)->log_facility), "%s: %s" "%s(): " "ERROR:uac:fixup_replace_from1: empty parameter " "not accepted\n", (log_level_info[((-2)) - (-5)].name), ("uac" " [" "uac.c" ":" "180" "]: ") , __func__); } } else { if (log_stderr) { if (__builtin_expect(!!(log_color), 0)) dprint_color((-2)); fprintf(stderr, "%2d(%d) %s" "%s(): " "ERROR:uac:fixup_replace_from1: empty parameter " "not accepted\n", process_no, my_pid(), ("uac" " [" "uac.c" ":" "180" "]: ") , __func__); if (__builtin_expect(!!(log_color), 0)) dprint_color_reset(); } else { if (((-2))<-5) syslog((log_level_info[(-5) - (-5)].syslog_level) | (((0) != 0) ? (0) : ((struct cfg_group_core *)core_cfg)->log_facility), "%s" "%s(): " "ERROR:uac:fixup_replace_from1: empty parameter " "not accepted\n", ("uac" " [" "uac.c" ":" "180" "]: ") , __func__); else syslog((log_level_info[(3) - (-5)].syslog_level) | (((0) != 0) ? (0) : ((struct cfg_group_core *)core_cfg)->log_facility), "%s" "%s(): " "ERROR:uac:fixup_replace_from1: empty parameter " "not accepted\n", ("uac" " [" "uac.c" ":" "180" "]: ") , __func__); } } (dprint_crit--); } } while(0);
  return -1;
 }
 *param=(void *)s;
 return 0;
}

variable_types:
param
void **

variable_types:
s
struct _str { char *s; int len; } *