decompiled_code:
__int64 __fastcall reg_statistic(const char *a1)
{
char *v1; // rax
const char *v2; // rbp
int v3; // er12
__int64 v4; // rax
__int64 v5; // rbx
__int64 v7; // rbp
unsigned int v8; // eax
const char *v9; // r9
const char *v10; // rsi
__int64 v11; // rcx
_DWORD *v12; // r10
__int64 v13; // r8
__int64 v14; // rdx
struct _IO_FILE *v15; // rdi
__int64 v16; // rdx
const char *v17; // r13
unsigned int v18; // eax
__int64 v19; // rbp
unsigned int v20; // eax
struct _IO_FILE *v21; // [rsp-10h] [rbp-38h]
_DWORD *v22; // [rsp-8h] [rbp-30h]
__int64 v23; // [rsp-8h] [rbp-30h]

if ( !a1 || !*a1 )
{
if ( (int)get_debug_level("statistics", 10LL) < -1 || dprint_crit )
return 0xFFFFFFFFLL;
++dprint_crit;
if ( log_stderr )
{
if ( log_color )
dprint_color(0xFFFFFFFFLL);
v7 = *((_QWORD *)&log_level_info + 8);
v8 = my_pid();
v9 = "statistics [stats_funcs.c:59]: ";
v10 = "%2d(%d) %s: %s%s(): empty parameter\n";
v11 = v8;
v22 = v12;
v13 = v7;
v14 = process_no;
LABEL_26:
v15 = stderr;
fprintf(stderr, v10, v14, v11, v13, v9, "reg_statistic", v22);
v16 = v23;
if ( !log_color )
goto LABEL_13;
LABEL_27:
dprint_color_reset(v15, v10, v16);
goto LABEL_13;
}
syslog(
*((_DWORD *)&log_level_info + 18) | *(_DWORD *)(core_cfg + 4LL),
"%s: %s%s(): empty parameter\n",
*((const char **)&log_level_info + 8),
"statistics [stats_funcs.c:59]: ",
"reg_statistic");
goto LABEL_13;
}
v1 = strchr(a1, 47);
if ( v1 )
{
*v1 = 0;
v2 = v1 + 1;
if ( !strcasecmp(v1 + 1, "no_reset") )
{
v3 = 1;
goto LABEL_6;
}
if ( (int)get_debug_level("statistics", 10LL) < -1 || dprint_crit )
return 0xFFFFFFFFLL;
++dprint_crit;
if ( log_stderr )
{
if ( log_color )
dprint_color(0xFFFFFFFFLL);
v17 = (const char *)*((_QWORD *)&log_level_info + 8);
v18 = my_pid();
v10 = "%2d(%d) %s: %s%s(): unsuported flag <%s>\n";
fprintf(
stderr,
"%2d(%d) %s: %s%s(): unsuported flag <%s>\n",
process_no,
v18,
v17,
"statistics [stats_funcs.c:71]: ",
"reg_statistic",
v2);
v15 = v21;
if ( !log_color )
goto LABEL_13;
goto LABEL_27;
}
syslog(
*((_DWORD *)&log_level_info + 18) | *(_DWORD *)(core_cfg + 4LL),
"%s: %s%s(): unsuported flag <%s>\n",
*((const char **)&log_level_info + 8),
"statistics [stats_funcs.c:71]: ",
"reg_statistic",
v2);
LABEL_13:
--dprint_crit;
return 0xFFFFFFFFLL;
}
v3 = 0;
LABEL_6:
v4 = qm_malloc(mem_block, 24LL);
if ( v4 )
{
*(_QWORD *)v4 = a1;
v5 = stat_list;
*(_DWORD *)(v4 + 8) = v3;
*(_QWORD *)(v4 + 16) = v5;
stat_list = v4;
return 0LL;
}
if ( (int)get_debug_level("statistics", 10LL) >= -1 && !dprint_crit )
{
++dprint_crit;
if ( !log_stderr )
{
syslog(
*((_DWORD *)&log_level_info + 18) | *(_DWORD *)(core_cfg + 4LL),
"%s: %s%s(): no more pkg mem\n",
*((const char **)&log_level_info + 8),
"statistics [stats_funcs.c:78]: ",
"reg_statistic");
goto LABEL_13;
}
if ( log_color )
dprint_color(0xFFFFFFFFLL);
v19 = *((_QWORD *)&log_level_info + 8);
v20 = my_pid();
v9 = "statistics [stats_funcs.c:78]: ";
v11 = v20;
v22 = &log_stderr;
v13 = v19;
v14 = process_no;
v10 = "%2d(%d) %s: %s%s(): no more pkg mem\n";
goto LABEL_26;
}
return 0xFFFFFFFFLL;
}

canonical_decompiled_code:
__int64 __fastcall func0(const char *a1)
{
char *v1; // rax
const char *v2; // rbp
int v3; // er12
__int64 v4; // rax
__int64 v5; // rbx
__int64 v7; // rbp
unsigned int v8; // eax
const char *v9; // r9
const char *v10; // rsi
__int64 v11; // rcx
_DWORD *v12; // r10
__int64 v13; // r8
__int64 v14; // rdx
struct _IO_FILE *v15; // rdi
__int64 v16; // rdx
const char *v17; // r13
unsigned int v18; // eax
__int64 v19; // rbp
unsigned int v20; // eax
struct _IO_FILE *v21; // [rsp-10h] [rbp-38h]
_DWORD *v22; // [rsp-8h] [rbp-30h]
__int64 v23; // [rsp-8h] [rbp-30h]

if ( !a1 || !*a1 )
{
if ( (int)get_debug_level("statistics", 10LL) < -1 || dprint_crit )
return 0xFFFFFFFFLL;
++dprint_crit;
if ( log_stderr )
{
if ( log_color )
dprint_color(0xFFFFFFFFLL);
v7 = *((_QWORD *)&log_level_info + 8);
v8 = my_pid();
v9 = "statistics [stats_funcs.c:59]: ";
v10 = "%2d(%d) %s: %s%s(): empty parameter\n";
v11 = v8;
v22 = v12;
v13 = v7;
v14 = process_no;
LABEL_26:
v15 = stderr;
fprintf(stderr, v10, v14, v11, v13, v9, "reg_statistic", v22);
v16 = v23;
if ( !log_color )
goto LABEL_13;
LABEL_27:
dprint_color_reset(v15, v10, v16);
goto LABEL_13;
}
syslog(
*((_DWORD *)&log_level_info + 18) | *(_DWORD *)(core_cfg + 4LL),
"%s: %s%s(): empty parameter\n",
*((const char **)&log_level_info + 8),
"statistics [stats_funcs.c:59]: ",
"reg_statistic");
goto LABEL_13;
}
v1 = strchr(a1, 47);
if ( v1 )
{
*v1 = 0;
v2 = v1 + 1;
if ( !strcasecmp(v1 + 1, "no_reset") )
{
v3 = 1;
goto LABEL_6;
}
if ( (int)get_debug_level("statistics", 10LL) < -1 || dprint_crit )
return 0xFFFFFFFFLL;
++dprint_crit;
if ( log_stderr )
{
if ( log_color )
dprint_color(0xFFFFFFFFLL);
v17 = (const char *)*((_QWORD *)&log_level_info + 8);
v18 = my_pid();
v10 = "%2d(%d) %s: %s%s(): unsuported flag <%s>\n";
fprintf(
stderr,
"%2d(%d) %s: %s%s(): unsuported flag <%s>\n",
process_no,
v18,
v17,
"statistics [stats_funcs.c:71]: ",
"reg_statistic",
v2);
v15 = v21;
if ( !log_color )
goto LABEL_13;
goto LABEL_27;
}
syslog(
*((_DWORD *)&log_level_info + 18) | *(_DWORD *)(core_cfg + 4LL),
"%s: %s%s(): unsuported flag <%s>\n",
*((const char **)&log_level_info + 8),
"statistics [stats_funcs.c:71]: ",
"reg_statistic",
v2);
LABEL_13:
--dprint_crit;
return 0xFFFFFFFFLL;
}
v3 = 0;
LABEL_6:
v4 = qm_malloc(mem_block, 24LL);
if ( v4 )
{
*(_QWORD *)v4 = a1;
v5 = stat_list;
*(_DWORD *)(v4 + 8) = v3;
*(_QWORD *)(v4 + 16) = v5;
stat_list = v4;
return 0LL;
}
if ( (int)get_debug_level("statistics", 10LL) >= -1 && !dprint_crit )
{
++dprint_crit;
if ( !log_stderr )
{
syslog(
*((_DWORD *)&log_level_info + 18) | *(_DWORD *)(core_cfg + 4LL),
"%s: %s%s(): no more pkg mem\n",
*((const char **)&log_level_info + 8),
"statistics [stats_funcs.c:78]: ",
"reg_statistic");
goto LABEL_13;
}
if ( log_color )
dprint_color(0xFFFFFFFFLL);
v19 = *((_QWORD *)&log_level_info + 8);
v20 = my_pid();
v9 = "statistics [stats_funcs.c:78]: ";
v11 = v20;
v22 = &log_stderr;
v13 = v19;
v14 = process_no;
v10 = "%2d(%d) %s: %s%s(): no more pkg mem\n";
goto LABEL_26;
}
return 0xFFFFFFFFLL;
}

original_code:
int reg_statistic( char* name)
{
 stat_elem *se;
 char *flag_str;
 int flags;
 if (name==0 || *name==0) {
  do { if (get_debug_level("statistics", (sizeof("statistics")-1)) >= ((-1)) && (dprint_crit==0)) { (dprint_crit++); if (__builtin_expect(!!((((-1)) >= -5) && (((-1)) <= 3)), 1)){ if (__builtin_expect(!!(log_stderr), 0)) { if (__builtin_expect(!!(log_color), 0)) dprint_color((-1)); fprintf(stderr, "%2d(%d) %s: %s" "%s(): " "empty parameter\n", process_no, my_pid(), (log_level_info[((-1)) - (-5)].name), ("statistics" " [" "stats_funcs.c" ":" "59" "]: ") , __func__); if (__builtin_expect(!!(log_color), 0)) dprint_color_reset(); } else { syslog((log_level_info[((-1)) - (-5)].syslog_level) | (((0) != 0) ? (0) : ((struct cfg_group_core *)core_cfg)->log_facility), "%s: %s" "%s(): " "empty parameter\n", (log_level_info[((-1)) - (-5)].name), ("statistics" " [" "stats_funcs.c" ":" "59" "]: ") , __func__); } } else { if (log_stderr) { if (__builtin_expect(!!(log_color), 0)) dprint_color((-1)); fprintf(stderr, "%2d(%d) %s" "%s(): " "empty parameter\n", process_no, my_pid(), ("statistics" " [" "stats_funcs.c" ":" "59" "]: ") , __func__); if (__builtin_expect(!!(log_color), 0)) dprint_color_reset(); } else { if (((-1))<-5) syslog((log_level_info[(-5) - (-5)].syslog_level) | (((0) != 0) ? (0) : ((struct cfg_group_core *)core_cfg)->log_facility), "%s" "%s(): " "empty parameter\n", ("statistics" " [" "stats_funcs.c" ":" "59" "]: ") , __func__); else syslog((log_level_info[(3) - (-5)].syslog_level) | (((0) != 0) ? (0) : ((struct cfg_group_core *)core_cfg)->log_facility), "%s" "%s(): " "empty parameter\n", ("statistics" " [" "stats_funcs.c" ":" "59" "]: ") , __func__); } } (dprint_crit--); } } while(0);
  goto error;
 }
 flags = 0;
 flag_str = strchr( name, '/');
 if (flag_str) {
  *flag_str = 0;
  flag_str++;
  if (strcasecmp( flag_str, "no_reset")==0) {
   flags |= 1;
  } else {
   do { if (get_debug_level("statistics", (sizeof("statistics")-1)) >= ((-1)) && (dprint_crit==0)) { (dprint_crit++); if (__builtin_expect(!!((((-1)) >= -5) && (((-1)) <= 3)), 1)){ if (__builtin_expect(!!(log_stderr), 0)) { if (__builtin_expect(!!(log_color), 0)) dprint_color((-1)); fprintf(stderr, "%2d(%d) %s: %s" "%s(): " "unsuported flag <%s>\n", process_no, my_pid(), (log_level_info[((-1)) - (-5)].name), ("statistics" " [" "stats_funcs.c" ":" "71" "]: ") , __func__,flag_str); if (__builtin_expect(!!(log_color), 0)) dprint_color_reset(); } else { syslog((log_level_info[((-1)) - (-5)].syslog_level) | (((0) != 0) ? (0) : ((struct cfg_group_core *)core_cfg)->log_facility), "%s: %s" "%s(): " "unsuported flag <%s>\n", (log_level_info[((-1)) - (-5)].name), ("statistics" " [" "stats_funcs.c" ":" "71" "]: ") , __func__,flag_str); } } else { if (log_stderr) { if (__builtin_expect(!!(log_color), 0)) dprint_color((-1)); fprintf(stderr, "%2d(%d) %s" "%s(): " "unsuported flag <%s>\n", process_no, my_pid(), ("statistics" " [" "stats_funcs.c" ":" "71" "]: ") , __func__,flag_str); if (__builtin_expect(!!(log_color), 0)) dprint_color_reset(); } else { if (((-1))<-5) syslog((log_level_info[(-5) - (-5)].syslog_level) | (((0) != 0) ? (0) : ((struct cfg_group_core *)core_cfg)->log_facility), "%s" "%s(): " "unsuported flag <%s>\n", ("statistics" " [" "stats_funcs.c" ":" "71" "]: ") , __func__,flag_str); else syslog((log_level_info[(3) - (-5)].syslog_level) | (((0) != 0) ? (0) : ((struct cfg_group_core *)core_cfg)->log_facility), "%s" "%s(): " "unsuported flag <%s>\n", ("statistics" " [" "stats_funcs.c" ":" "71" "]: ") , __func__,flag_str); } } (dprint_crit--); } } while(0);
   goto error;
  }
 }
 se = (stat_elem*)qm_malloc(mem_block, (sizeof(stat_elem)));
 if (se==0) {
  do { if (get_debug_level("statistics", (sizeof("statistics")-1)) >= ((-1)) && (dprint_crit==0)) { (dprint_crit++); if (__builtin_expect(!!((((-1)) >= -5) && (((-1)) <= 3)), 1)){ if (__builtin_expect(!!(log_stderr), 0)) { if (__builtin_expect(!!(log_color), 0)) dprint_color((-1)); fprintf(stderr, "%2d(%d) %s: %s" "%s(): " "no more pkg mem\n", process_no, my_pid(), (log_level_info[((-1)) - (-5)].name), ("statistics" " [" "stats_funcs.c" ":" "78" "]: ") , __func__); if (__builtin_expect(!!(log_color), 0)) dprint_color_reset(); } else { syslog((log_level_info[((-1)) - (-5)].syslog_level) | (((0) != 0) ? (0) : ((struct cfg_group_core *)core_cfg)->log_facility), "%s: %s" "%s(): " "no more pkg mem\n", (log_level_info[((-1)) - (-5)].name), ("statistics" " [" "stats_funcs.c" ":" "78" "]: ") , __func__); } } else { if (log_stderr) { if (__builtin_expect(!!(log_color), 0)) dprint_color((-1)); fprintf(stderr, "%2d(%d) %s" "%s(): " "no more pkg mem\n", process_no, my_pid(), ("statistics" " [" "stats_funcs.c" ":" "78" "]: ") , __func__); if (__builtin_expect(!!(log_color), 0)) dprint_color_reset(); } else { if (((-1))<-5) syslog((log_level_info[(-5) - (-5)].syslog_level) | (((0) != 0) ? (0) : ((struct cfg_group_core *)core_cfg)->log_facility), "%s" "%s(): " "no more pkg mem\n", ("statistics" " [" "stats_funcs.c" ":" "78" "]: ") , __func__); else syslog((log_level_info[(3) - (-5)].syslog_level) | (((0) != 0) ? (0) : ((struct cfg_group_core *)core_cfg)->log_facility), "%s" "%s(): " "no more pkg mem\n", ("statistics" " [" "stats_funcs.c" ":" "78" "]: ") , __func__); } } (dprint_crit--); } } while(0);
  goto error;
 }
 se->name = name;
 se->flags = flags;
 se->next = stat_list;
 stat_list = se;
 return 0;
error:
 return -1;
}

canonical_original_code:
int reg_statistic(char *name)
{
 struct stat_mod_elem_ *se;
 char *flag_str;
 int flags;
 if (name==0 || *name==0) {
  do { if (get_debug_level("statistics", (sizeof("statistics")-1)) >= ((-1)) && (dprint_crit==0)) { (dprint_crit++); if (__builtin_expect(!!((((-1)) >= -5) && (((-1)) <= 3)), 1)){ if (__builtin_expect(!!(log_stderr), 0)) { if (__builtin_expect(!!(log_color), 0)) dprint_color((-1)); fprintf(stderr, "%2d(%d) %s: %s" "%s(): " "empty parameter\n", process_no, my_pid(), (log_level_info[((-1)) - (-5)].name), ("statistics" " [" "stats_funcs.c" ":" "59" "]: ") , __func__); if (__builtin_expect(!!(log_color), 0)) dprint_color_reset(); } else { syslog((log_level_info[((-1)) - (-5)].syslog_level) | (((0) != 0) ? (0) : ((struct cfg_group_core *)core_cfg)->log_facility), "%s: %s" "%s(): " "empty parameter\n", (log_level_info[((-1)) - (-5)].name), ("statistics" " [" "stats_funcs.c" ":" "59" "]: ") , __func__); } } else { if (log_stderr) { if (__builtin_expect(!!(log_color), 0)) dprint_color((-1)); fprintf(stderr, "%2d(%d) %s" "%s(): " "empty parameter\n", process_no, my_pid(), ("statistics" " [" "stats_funcs.c" ":" "59" "]: ") , __func__); if (__builtin_expect(!!(log_color), 0)) dprint_color_reset(); } else { if (((-1))<-5) syslog((log_level_info[(-5) - (-5)].syslog_level) | (((0) != 0) ? (0) : ((struct cfg_group_core *)core_cfg)->log_facility), "%s" "%s(): " "empty parameter\n", ("statistics" " [" "stats_funcs.c" ":" "59" "]: ") , __func__); else syslog((log_level_info[(3) - (-5)].syslog_level) | (((0) != 0) ? (0) : ((struct cfg_group_core *)core_cfg)->log_facility), "%s" "%s(): " "empty parameter\n", ("statistics" " [" "stats_funcs.c" ":" "59" "]: ") , __func__); } } (dprint_crit--); } } while(0);
  goto error;
 }
 flags = 0;
 flag_str = strchr( name, '/');
 if (flag_str) {
  *flag_str = 0;
  flag_str++;
  if (strcasecmp( flag_str, "no_reset")==0) {
   flags |= 1;
  } else {
   do { if (get_debug_level("statistics", (sizeof("statistics")-1)) >= ((-1)) && (dprint_crit==0)) { (dprint_crit++); if (__builtin_expect(!!((((-1)) >= -5) && (((-1)) <= 3)), 1)){ if (__builtin_expect(!!(log_stderr), 0)) { if (__builtin_expect(!!(log_color), 0)) dprint_color((-1)); fprintf(stderr, "%2d(%d) %s: %s" "%s(): " "unsuported flag <%s>\n", process_no, my_pid(), (log_level_info[((-1)) - (-5)].name), ("statistics" " [" "stats_funcs.c" ":" "71" "]: ") , __func__,flag_str); if (__builtin_expect(!!(log_color), 0)) dprint_color_reset(); } else { syslog((log_level_info[((-1)) - (-5)].syslog_level) | (((0) != 0) ? (0) : ((struct cfg_group_core *)core_cfg)->log_facility), "%s: %s" "%s(): " "unsuported flag <%s>\n", (log_level_info[((-1)) - (-5)].name), ("statistics" " [" "stats_funcs.c" ":" "71" "]: ") , __func__,flag_str); } } else { if (log_stderr) { if (__builtin_expect(!!(log_color), 0)) dprint_color((-1)); fprintf(stderr, "%2d(%d) %s" "%s(): " "unsuported flag <%s>\n", process_no, my_pid(), ("statistics" " [" "stats_funcs.c" ":" "71" "]: ") , __func__,flag_str); if (__builtin_expect(!!(log_color), 0)) dprint_color_reset(); } else { if (((-1))<-5) syslog((log_level_info[(-5) - (-5)].syslog_level) | (((0) != 0) ? (0) : ((struct cfg_group_core *)core_cfg)->log_facility), "%s" "%s(): " "unsuported flag <%s>\n", ("statistics" " [" "stats_funcs.c" ":" "71" "]: ") , __func__,flag_str); else syslog((log_level_info[(3) - (-5)].syslog_level) | (((0) != 0) ? (0) : ((struct cfg_group_core *)core_cfg)->log_facility), "%s" "%s(): " "unsuported flag <%s>\n", ("statistics" " [" "stats_funcs.c" ":" "71" "]: ") , __func__,flag_str); } } (dprint_crit--); } } while(0);
   goto error;
  }
 }
 se = (struct stat_mod_elem_ *)qm_malloc(mem_block, (sizeof(stat_elem)));
 if (se==0) {
  do { if (get_debug_level("statistics", (sizeof("statistics")-1)) >= ((-1)) && (dprint_crit==0)) { (dprint_crit++); if (__builtin_expect(!!((((-1)) >= -5) && (((-1)) <= 3)), 1)){ if (__builtin_expect(!!(log_stderr), 0)) { if (__builtin_expect(!!(log_color), 0)) dprint_color((-1)); fprintf(stderr, "%2d(%d) %s: %s" "%s(): " "no more pkg mem\n", process_no, my_pid(), (log_level_info[((-1)) - (-5)].name), ("statistics" " [" "stats_funcs.c" ":" "78" "]: ") , __func__); if (__builtin_expect(!!(log_color), 0)) dprint_color_reset(); } else { syslog((log_level_info[((-1)) - (-5)].syslog_level) | (((0) != 0) ? (0) : ((struct cfg_group_core *)core_cfg)->log_facility), "%s: %s" "%s(): " "no more pkg mem\n", (log_level_info[((-1)) - (-5)].name), ("statistics" " [" "stats_funcs.c" ":" "78" "]: ") , __func__); } } else { if (log_stderr) { if (__builtin_expect(!!(log_color), 0)) dprint_color((-1)); fprintf(stderr, "%2d(%d) %s" "%s(): " "no more pkg mem\n", process_no, my_pid(), ("statistics" " [" "stats_funcs.c" ":" "78" "]: ") , __func__); if (__builtin_expect(!!(log_color), 0)) dprint_color_reset(); } else { if (((-1))<-5) syslog((log_level_info[(-5) - (-5)].syslog_level) | (((0) != 0) ? (0) : ((struct cfg_group_core *)core_cfg)->log_facility), "%s" "%s(): " "no more pkg mem\n", ("statistics" " [" "stats_funcs.c" ":" "78" "]: ") , __func__); else syslog((log_level_info[(3) - (-5)].syslog_level) | (((0) != 0) ? (0) : ((struct cfg_group_core *)core_cfg)->log_facility), "%s" "%s(): " "no more pkg mem\n", ("statistics" " [" "stats_funcs.c" ":" "78" "]: ") , __func__); } } (dprint_crit--); } } while(0);
  goto error;
 }
 se->name = name;
 se->flags = flags;
 se->next = stat_list;
 stat_list = se;
 return 0;
error:
 return -1;
}

variable_types:
name
char *

variable_types: struct stat_mod_elem_ { char *name; int flags; struct stat_mod_elem_ *next; } *

variable_types: flags int

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; }


repo: virtualolson/who

decompiled_code:
__int64 register_all_mod_stats()
{
__int64 v0; // rbx
const char **v1; // rbp
int v2; // er8
__int64 result; // rax
__int64 v4; // r14
const char *v5; // r13
const char *v6; // rbp
unsigned int v7; // eax
struct _IO_FILE *v8; // rdi
__int64 v9; // rdx
__int64 v10[6]; // [rsp+8h] [rbp-30h] BYREF

v0 = stat_list;
v10[0] = 0LL;
if ( !stat_list )
return 0LL;
while ( 1 )
{
v1 = (const char **)v0;
v0 = *(_QWORD *)(v0 + 16);
if ( (unsigned int)register_stat("script", *v1, v10, *((unsigned int *)v1 + 2)) )
break;
qm_free(mem_block, v1);
if ( !v0 )
return 0LL;
}
v2 = get_debug_level("statistics", 10LL);
result = 0xFFFFFFFFLL;
if ( v2 >= -1 && !dprint_crit )
{
++dprint_crit;
if ( log_stderr )
{
if ( log_color )
dprint_color(0xFFFFFFFFLL);
v4 = *((unsigned int *)v1 + 2);
v5 = *v1;
v6 = (const char *)*((_QWORD *)&log_level_info + 8);
v7 = my_pid();
v8 = stderr;
fprintf(
stderr,
"%2d(%d) %s: %s%s(): failed to register var. <%s> flags %d\n",
process_no,
v7,
v6,
"statistics [stats_funcs.c:108]: ",
"register_all_mod_stats",
v5,
v4);
if ( log_color )
dprint_color_reset(v8, "%2d(%d) %s: %s%s(): failed to register var. <%s> flags %d\n", v9);
}
else
{
syslog(
*((_DWORD *)&log_level_info + 18) | *(_DWORD *)(core_cfg + 4LL),
"%s: %s%s(): failed to register var. <%s> flags %d\n",
*((const char **)&log_level_info + 8),
"statistics [stats_funcs.c:108]: ",
"register_all_mod_stats",
*v1,
*((unsigned int *)v1 + 2));
}
result = 0xFFFFFFFFLL;
--dprint_crit;
}
return result;
}

canonical_decompiled_code:
__int64 func1()
{
__int64 v0; // rbx
const char **v1; // rbp
int v2; // er8
__int64 result; // rax
__int64 v4; // r14
const char *v5; // r13
const char *v6; // rbp
unsigned int v7; // eax
struct _IO_FILE *v8; // rdi
__int64 v9; // rdx
__int64 v10[6]; // [rsp+8h] [rbp-30h] BYREF

v0 = stat_list;
v10[0] = 0LL;
if ( !stat_list )
return 0LL;
while ( 1 )
{
v1 = (const char **)v0;
v0 = *(_QWORD *)(v0 + 16);
if ( (unsigned int)register_stat("script", *v1, v10, *((unsigned int *)v1 + 2)) )
break;
qm_free(mem_block, v1);
if ( !v0 )
return 0LL;
}
v2 = get_debug_level("statistics", 10LL);
result = 0xFFFFFFFFLL;
if ( v2 >= -1 && !dprint_crit )
{
++dprint_crit;
if ( log_stderr )
{
if ( log_color )
dprint_color(0xFFFFFFFFLL);
v4 = *((unsigned int *)v1 + 2);
v5 = *v1;
v6 = (const char *)*((_QWORD *)&log_level_info + 8);
v7 = my_pid();
v8 = stderr;
fprintf(
stderr,
"%2d(%d) %s: %s%s(): failed to register var. <%s> flags %d\n",
process_no,
v7,
v6,
"statistics [stats_funcs.c:108]: ",
"register_all_mod_stats",
v5,
v4);
if ( log_color )
dprint_color_reset(v8, "%2d(%d) %s: %s%s(): failed to register var. <%s> flags %d\n", v9);
}
else
{
syslog(
*((_DWORD *)&log_level_info + 18) | *(_DWORD *)(core_cfg + 4LL),
"%s: %s%s(): failed to register var. <%s> flags %d\n",
*((const char **)&log_level_info + 8),
"statistics [stats_funcs.c:108]: ",
"register_all_mod_stats",
*v1,
*((unsigned int *)v1 + 2));
}
result = 0xFFFFFFFFLL;
--dprint_crit;
}
return result;
}

original_code:
int register_all_mod_stats(void)
{
 stat_var *stat;
 stat_elem *se;
 stat_elem *se_tmp;
 se = stat_list;
 stat = ((void *)0);
 while( se ) {
  se_tmp = se;
  se = se->next;
  if (register_stat("script", se_tmp->name, &stat, se_tmp->flags)!=0){
   do { if (get_debug_level("statistics", (sizeof("statistics")-1)) >= ((-1)) && (dprint_crit==0)) { (dprint_crit++); if (__builtin_expect(!!((((-1)) >= -5) && (((-1)) <= 3)), 1)){ if (__builtin_expect(!!(log_stderr), 0)) { if (__builtin_expect(!!(log_color), 0)) dprint_color((-1)); fprintf(stderr, "%2d(%d) %s: %s" "%s(): " "failed to register var. <%s> flags %d\n", process_no, my_pid(), (log_level_info[((-1)) - (-5)].name), ("statistics" " [" "stats_funcs.c" ":" "108" "]: ") , __func__, se_tmp->name,se_tmp->flags); if (__builtin_expect(!!(log_color), 0)) dprint_color_reset(); } else { syslog((log_level_info[((-1)) - (-5)].syslog_level) | (((0) != 0) ? (0) : ((struct cfg_group_core *)core_cfg)->log_facility), "%s: %s" "%s(): " "failed to register var. <%s> flags %d\n", (log_level_info[((-1)) - (-5)].name), ("statistics" " [" "stats_funcs.c" ":" "108" "]: ") , __func__, se_tmp->name,se_tmp->flags); } } else { if (log_stderr) { if (__builtin_expect(!!(log_color), 0)) dprint_color((-1)); fprintf(stderr, "%2d(%d) %s" "%s(): " "failed to register var. <%s> flags %d\n", process_no, my_pid(), ("statistics" " [" "stats_funcs.c" ":" "108" "]: ") , __func__, se_tmp->name,se_tmp->flags); if (__builtin_expect(!!(log_color), 0)) dprint_color_reset(); } else { if (((-1))<-5) syslog((log_level_info[(-5) - (-5)].syslog_level) | (((0) != 0) ? (0) : ((struct cfg_group_core *)core_cfg)->log_facility), "%s" "%s(): " "failed to register var. <%s> flags %d\n", ("statistics" " [" "stats_funcs.c" ":" "108" "]: ") , __func__, se_tmp->name,se_tmp->flags); else syslog((log_level_info[(3) - (-5)].syslog_level) | (((0) != 0) ? (0) : ((struct cfg_group_core *)core_cfg)->log_facility), "%s" "%s(): " "failed to register var. <%s> flags %d\n", ("statistics" " [" "stats_funcs.c" ":" "108" "]: ") , __func__, se_tmp->name,se_tmp->flags); } } (dprint_crit--); } } while(0);
   return -1;
  }
  qm_free(mem_block, (se_tmp));
 }
 return 0;
}

canonical_original_code:
int register_all_mod_stats()
{
 void *stat;
 struct stat_mod_elem_ *se;
 struct stat_mod_elem_ *se_tmp;
 se = stat_list;
 stat = ((void *)0);
 while( se ) {
  se_tmp = se;
  se = se->next;
  if (register_stat("script", se_tmp->name, &stat, se_tmp->flags)!=0){
   do { if (get_debug_level("statistics", (sizeof("statistics")-1)) >= ((-1)) && (dprint_crit==0)) { (dprint_crit++); if (__builtin_expect(!!((((-1)) >= -5) && (((-1)) <= 3)), 1)){ if (__builtin_expect(!!(log_stderr), 0)) { if (__builtin_expect(!!(log_color), 0)) dprint_color((-1)); fprintf(stderr, "%2d(%d) %s: %s" "%s(): " "failed to register var. <%s> flags %d\n", process_no, my_pid(), (log_level_info[((-1)) - (-5)].name), ("statistics" " [" "stats_funcs.c" ":" "108" "]: ") , __func__, se_tmp->name,se_tmp->flags); if (__builtin_expect(!!(log_color), 0)) dprint_color_reset(); } else { syslog((log_level_info[((-1)) - (-5)].syslog_level) | (((0) != 0) ? (0) : ((struct cfg_group_core *)core_cfg)->log_facility), "%s: %s" "%s(): " "failed to register var. <%s> flags %d\n", (log_level_info[((-1)) - (-5)].name), ("statistics" " [" "stats_funcs.c" ":" "108" "]: ") , __func__, se_tmp->name,se_tmp->flags); } } else { if (log_stderr) { if (__builtin_expect(!!(log_color), 0)) dprint_color((-1)); fprintf(stderr, "%2d(%d) %s" "%s(): " "failed to register var. <%s> flags %d\n", process_no, my_pid(), ("statistics" " [" "stats_funcs.c" ":" "108" "]: ") , __func__, se_tmp->name,se_tmp->flags); if (__builtin_expect(!!(log_color), 0)) dprint_color_reset(); } else { if (((-1))<-5) syslog((log_level_info[(-5) - (-5)].syslog_level) | (((0) != 0) ? (0) : ((struct cfg_group_core *)core_cfg)->log_facility), "%s" "%s(): " "failed to register var. <%s> flags %d\n", ("statistics" " [" "stats_funcs.c" ":" "108" "]: ") , __func__, se_tmp->name,se_tmp->flags); else syslog((log_level_info[(3) - (-5)].syslog_level) | (((0) != 0) ? (0) : ((struct cfg_group_core *)core_cfg)->log_facility), "%s" "%s(): " "failed to register var. <%s> flags %d\n", ("statistics" " [" "stats_funcs.c" ":" "108" "]: ") , __func__, se_tmp->name,se_tmp->flags); } } (dprint_crit--); } } while(0);
   return -1;
  }
  qm_free(mem_block, (se_tmp));
 }
 return 0;
}

variable_types:
stat
void *

return_type: int

user_defined_types: struct stat_mod_elem_ { char *name; int flags; struct stat_mod_elem_ *next; }


decompiled_code:
__int64 __fastcall rx_process_asr(__int64 a1)
{
__int64 v1; // rbx
__int64 v2; // rax
unsigned int *v3; // rbx
__int64 v4; // rbp
const char *v6; // r13
unsigned int v7; // eax
struct _IO_FILE *v8; // rdi
__int64 v9; // rdx
const char *v10; // r8
const char *v11; // r9
const char *v12; // r15
unsigned int v13; // eax
struct _IO_FILE *v14; // rdi
__int64 v15; // rcx
const char *v16; // r8
const char *v17; // r9
__int64 v18; // r14
__int64 v19; // rcx
__int64 v20; // r8
const char *v21; // r9
__int64 v22; // rdx
const char *v23; // rsi
struct _IO_FILE *v24; // rdi
__int64 v25; // r14
const char *v26; // r12
unsigned int v27; // eax
struct _IO_FILE *v28; // rdi
__int64 v29; // rdx
__int64 v30; // rcx
const char *v31; // [rsp-48h] [rbp-48h]
__int64 v32; // [rsp-40h] [rbp-40h]
const char *v33; // [rsp-38h] [rbp-38h]
__int64 v34; // [rsp-30h] [rbp-30h]

if ( a1 )
{
v34 = v1;
v2 = *(_QWORD *)(a1 + 24);
if ( !v2 )
return 0LL;
v3 = (unsigned int *)((__int64 (__fastcall *)(_QWORD, _QWORD))cdpb[29])(*(_QWORD *)(v2 + 32), *(_QWORD *)(v2 + 40));
if ( !v3 )
{
if ( (int)get_debug_level("ims_qos", 7LL) > 2 && !dprint_crit )
{
++dprint_crit;
if ( log_stderr )
{
if ( log_color )
dprint_color(3LL);
v26 = (const char *)*((_QWORD *)&log_level_info + 16);
v27 = my_pid();
v28 = stderr;
fprintf(
stderr,
"%2d(%d) %s: %s%s(): received an ASR but the session is already deleted\n",
process_no,
v27,
v26,
"ims_qos [rx_asr.c:82]: ",
"rx_process_asr");
if ( log_color )
dprint_color_reset(
v28,
"%2d(%d) %s: %s%s(): received an ASR but the session is already deleted\n",
v29,
v30,
v31,
(const char *)log_color,
v33);
}
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;
}
v4 = (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);
v12 = (const char *)*((_QWORD *)&log_level_info + 16);
v13 = my_pid();
v14 = stderr;
fprintf(
stderr,
"%2d(%d) %s: %s%s(): abort-cause code is %u\n",
process_no,
v13,
v12,
"ims_qos [rx_asr.c:87]: ",
"rx_process_asr",
v4);
if ( log_color )
dprint_color_reset(v14, "%2d(%d) %s: %s%s(): abort-cause code is %u\n", log_color, v15, v16, v17, v33, v34);
}
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)v4);
}
--dprint_crit;
}
if ( (int)get_debug_level("ims_qos", 7LL) > 2 && !dprint_crit )
{
++dprint_crit;
if ( log_stderr )
{
if ( log_color )
dprint_color(3LL);
v6 = (const char *)*((_QWORD *)&log_level_info + 16);
v7 = my_pid();
v8 = stderr;
fprintf(
stderr,
"%2d(%d) %s: %s%s(): PCRF requested an ASR",
process_no,
v7,
v6,
"ims_qos [rx_asr.c:89]: ",
"rx_process_asr");
if ( log_color )
dprint_color_reset(v8, "%2d(%d) %s: %s%s(): PCRF requested an ASR", v9, log_color, v10, v11, v33);
}
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 *)v3 + 13) + 48LL) )
{
if ( (int)get_debug_level("ims_qos", 7LL) <= 2 || dprint_crit )
goto LABEL_20;
++dprint_crit;
if ( !log_stderr )
{
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");
LABEL_19:
--dprint_crit;
LABEL_20:
cdpb[26](*v3);
return 0LL;
}
if ( log_color )
dprint_color(3LL);
v25 = *((_QWORD *)&log_level_info + 16);
v19 = (unsigned int)my_pid();
v20 = v25;
v21 = "ims_qos [rx_asr.c:94]: ";
v22 = process_no;
v23 = "%2d(%d) %s: %s%s(): This is a subscription to signalling status\n";
}
else
{
if ( (int)get_debug_level("ims_qos", 7LL) <= 2 || dprint_crit )
goto LABEL_20;
++dprint_crit;
if ( !log_stderr )
{
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");
goto LABEL_19;
}
if ( log_color )
dprint_color(3LL);
v18 = *((_QWORD *)&log_level_info + 16);
v19 = (unsigned int)my_pid();
v20 = v18;
v21 = "ims_qos [rx_asr.c:96]: ";
v22 = process_no;
v23 = "%2d(%d) %s: %s%s(): This is a normal media bearer - bearer is releaed by CDP callbacks\n";
}
v24 = stderr;
fprintf(stderr, v23, v22, v19, v20, v21, "rx_process_asr");
if ( log_color )
dprint_color_reset(v24, v23, v32);
goto LABEL_19;
}
return 0LL;
}

canonical_decompiled_code:
__int64 __fastcall func0(__int64 a1)
{
__int64 v1; // rbx
__int64 v2; // rax
unsigned int *v3; // rbx
__int64 v4; // rbp
const char *v6; // r13
unsigned int v7; // eax
struct _IO_FILE *v8; // rdi
__int64 v9; // rdx
const char *v10; // r8
const char *v11; // r9
const char *v12; // r15
unsigned int v13; // eax
struct _IO_FILE *v14; // rdi
__int64 v15; // rcx
const char *v16; // r8
const char *v17; // r9
__int64 v18; // r14
__int64 v19; // rcx
__int64 v20; // r8
const char *v21; // r9
__int64 v22; // rdx
const char *v23; // rsi
struct _IO_FILE *v24; // rdi
__int64 v25; // r14
const char *v26; // r12
unsigned int v27; // eax
struct _IO_FILE *v28; // rdi
__int64 v29; // rdx
__int64 v30; // rcx
const char *v31; // [rsp-48h] [rbp-48h]
__int64 v32; // [rsp-40h] [rbp-40h]
const char *v33; // [rsp-38h] [rbp-38h]
__int64 v34; // [rsp-30h] [rbp-30h]

if ( a1 )
{
v34 = v1;
v2 = *(_QWORD *)(a1 + 24);
if ( !v2 )
return 0LL;
v3 = (unsigned int *)((__int64 (__fastcall *)(_QWORD, _QWORD))cdpb[29])(*(_QWORD *)(v2 + 32), *(_QWORD *)(v2 + 40));
if ( !v3 )
{
if ( (int)get_debug_level("ims_qos", 7LL) > 2 && !dprint_crit )
{
++dprint_crit;
if ( log_stderr )
{
if ( log_color )
dprint_color(3LL);
v26 = (const char *)*((_QWORD *)&log_level_info + 16);
v27 = my_pid();
v28 = stderr;
fprintf(
stderr,
"%2d(%d) %s: %s%s(): received an ASR but the session is already deleted\n",
process_no,
v27,
v26,
"ims_qos [rx_asr.c:82]: ",
"rx_process_asr");
if ( log_color )
dprint_color_reset(
v28,
"%2d(%d) %s: %s%s(): received an ASR but the session is already deleted\n",
v29,
v30,
v31,
(const char *)log_color,
v33);
}
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;
}
v4 = (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);
v12 = (const char *)*((_QWORD *)&log_level_info + 16);
v13 = my_pid();
v14 = stderr;
fprintf(
stderr,
"%2d(%d) %s: %s%s(): abort-cause code is %u\n",
process_no,
v13,
v12,
"ims_qos [rx_asr.c:87]: ",
"rx_process_asr",
v4);
if ( log_color )
dprint_color_reset(v14, "%2d(%d) %s: %s%s(): abort-cause code is %u\n", log_color, v15, v16, v17, v33, v34);
}
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)v4);
}
--dprint_crit;
}
if ( (int)get_debug_level("ims_qos", 7LL) > 2 && !dprint_crit )
{
++dprint_crit;
if ( log_stderr )
{
if ( log_color )
dprint_color(3LL);
v6 = (const char *)*((_QWORD *)&log_level_info + 16);
v7 = my_pid();
v8 = stderr;
fprintf(
stderr,
"%2d(%d) %s: %s%s(): PCRF requested an ASR",
process_no,
v7,
v6,
"ims_qos [rx_asr.c:89]: ",
"rx_process_asr");
if ( log_color )
dprint_color_reset(v8, "%2d(%d) %s: %s%s(): PCRF requested an ASR", v9, log_color, v10, v11, v33);
}
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 *)v3 + 13) + 48LL) )
{
if ( (int)get_debug_level("ims_qos", 7LL) <= 2 || dprint_crit )
goto LABEL_20;
++dprint_crit;
if ( !log_stderr )
{
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");
LABEL_19:
--dprint_crit;
LABEL_20:
cdpb[26](*v3);
return 0LL;
}
if ( log_color )
dprint_color(3LL);
v25 = *((_QWORD *)&log_level_info + 16);
v19 = (unsigned int)my_pid();
v20 = v25;
v21 = "ims_qos [rx_asr.c:94]: ";
v22 = process_no;
v23 = "%2d(%d) %s: %s%s(): This is a subscription to signalling status\n";
}
else
{
if ( (int)get_debug_level("ims_qos", 7LL) <= 2 || dprint_crit )
goto LABEL_20;
++dprint_crit;
if ( !log_stderr )
{
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");
goto LABEL_19;
}
if ( log_color )
dprint_color(3LL);
v18 = *((_QWORD *)&log_level_info + 16);
v19 = (unsigned int)my_pid();
v20 = v18;
v21 = "ims_qos [rx_asr.c:96]: ";
v22 = process_no;
v23 = "%2d(%d) %s: %s%s(): This is a normal media bearer - bearer is releaed by CDP callbacks\n";
}
v24 = stderr;
fprintf(stderr, v23, v22, v19, v20, v21, "rx_process_asr");
if ( log_color )
dprint_color_reset(v24, v23, v32);
goto LABEL_19;
}
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; }


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


decompiled_code:
__int64 __fastcall futex_release(volatile __int32 *a1)
{
__int64 result; // rax
__int64 v2; // [rsp-10h] [rbp-18h]

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

canonical_decompiled_code:
__int64 __fastcall func1(volatile __int32 *a1)
{
__int64 result; // rax
__int64 v2; // [rsp-10h] [rbp-18h]

result = func0(a1, 0);
if ( (_DWORD)result == 2 )
{
syscall(202LL, a1, 1LL, 1LL, 0LL, 0LL, 0LL);
result = v2;
}
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));
 }
}

variable_types:
lock
struct atomic_t { int val; } *

return_type: void


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

result = atomic_cmpxchg_int_constprop_0(a1);
if ( (_DWORD)result )
{
if ( (_DWORD)result == 2 )
{
do
{
LABEL_24:
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_constprop_0(a1);
if ( !(_DWORD)result )
break;
if ( (_DWORD)result == 2 )
goto LABEL_24;
result = atomic_cmpxchg_int_constprop_0(a1);
if ( !(_DWORD)result )
break;
if ( (_DWORD)result == 2 )
goto LABEL_24;
result = atomic_cmpxchg_int_constprop_0(a1);
if ( !(_DWORD)result )
break;
if ( (_DWORD)result == 2 )
goto LABEL_24;
result = atomic_cmpxchg_int_constprop_0(a1);
if ( !(_DWORD)result )
break;
if ( (_DWORD)result == 2 )
goto LABEL_24;
result = atomic_cmpxchg_int_constprop_0(a1);
if ( !(_DWORD)result )
break;
if ( (_DWORD)result == 2 )
goto LABEL_24;
result = atomic_cmpxchg_int_constprop_0(a1);
if ( !(_DWORD)result )
break;
if ( (_DWORD)result == 2 )
goto LABEL_24;
result = atomic_cmpxchg_int_constprop_0(a1);
if ( !(_DWORD)result )
break;
if ( (_DWORD)result == 2 )
goto LABEL_24;
result = atomic_cmpxchg_int_constprop_0(a1);
if ( !(_DWORD)result )
break;
if ( (_DWORD)result == 2 )
goto LABEL_24;
if ( v2 == 7 )
{
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 func3(volatile signed __int32 *a1)
{
__int64 result; // rax
int v2; // ecx

result = func2(a1);
if ( (_DWORD)result )
{
if ( (_DWORD)result == 2 )
{
do
{
LABEL_24:
syscall(202LL, a1, 0LL, 2LL, 0LL, 0LL, 0LL);
result = func0(a1, 2);
}
while ( (_DWORD)result );
}
else
{
while ( 1 )
{
result = func2(a1);
if ( !(_DWORD)result )
break;
if ( (_DWORD)result == 2 )
goto LABEL_24;
result = func2(a1);
if ( !(_DWORD)result )
break;
if ( (_DWORD)result == 2 )
goto LABEL_24;
result = func2(a1);
if ( !(_DWORD)result )
break;
if ( (_DWORD)result == 2 )
goto LABEL_24;
result = func2(a1);
if ( !(_DWORD)result )
break;
if ( (_DWORD)result == 2 )
goto LABEL_24;
result = func2(a1);
if ( !(_DWORD)result )
break;
if ( (_DWORD)result == 2 )
goto LABEL_24;
result = func2(a1);
if ( !(_DWORD)result )
break;
if ( (_DWORD)result == 2 )
goto LABEL_24;
result = func2(a1);
if ( !(_DWORD)result )
break;
if ( (_DWORD)result == 2 )
goto LABEL_24;
result = func2(a1);
if ( !(_DWORD)result )
break;
if ( (_DWORD)result == 2 )
goto LABEL_24;
if ( v2 == 7 )
{
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: i int


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

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

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

if ( euac_internals )
result = 0LL;
else
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, __int64 *a2)
{
remove_from_timer_localalias(a1, a2);
append_to_timer_localalias(a1, (const void ***)a2);
}

canonical_decompiled_code:
void __fastcall func2(const void **a1, __int64 *a2)
{
func1(a1, a2);
func0(a1, (const void ***)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:
int __fastcall check_and_split_timer(const void **a1, unsigned int a2, _QWORD *a3, _OWORD *a4)
{
const void **v4; // r14
const void **v6; // rdx
unsigned __int8 v7; // al
_QWORD *v8; // rax
_QWORD *v9; // r12
int result; // eax
const char *v11; // r15
unsigned int v12; // eax
const void *v13; // r15
const void *v14; // r14
const char *v15; // r13
unsigned int v16; // eax
int v17; // [rsp-10h] [rbp-68h]
const void *v19; // [rsp+8h] [rbp-50h]
const void *v20; // [rsp+10h] [rbp-48h]
const void **v21; // [rsp+18h] [rbp-40h]

*a4 = 0LL;
a4[1] = 0LL;
v4 = (const void **)*a1;
if ( a1 == *a1 )
goto LABEL_19;
do
{
if ( *((_DWORD *)v4 - 6) > a2 )
{
v8 = *a1;
if ( v4 == *a1 )
goto LABEL_19;
goto LABEL_11;
}
if ( (int)get_debug_level("pike", 4LL) > 2 && !dprint_crit )
{
v6 = v4 - 3;
++dprint_crit;
if ( log_stderr )
{
if ( log_color )
{
dprint_color(3LL);
v6 = v4 - 3;
}
v21 = v6;
v20 = *v4;
v19 = v4[1];
v11 = (const char *)*((_QWORD *)&log_level_info + 16);
v12 = my_pid();
fprintf(
stderr,
"%2d(%d) %s: %s%s(): DEBUG:pike:check_and_split_timer: splitting %p(%p,%p)node=%p\n",
process_no,
v12,
v11,
"pike [timer.c:93]: ",
"check_and_split_timer",
v4,
v19,
v20,
v21);
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",
v4,
v4[1],
*v4,
v4 - 3);
}
--dprint_crit;
}
v7 = *((_BYTE *)v4 - 3);
*((_WORD *)v4 - 1) |= 1u;
*((_WORD *)v4 - 1) &= 0xFFFDu;
v4 = (const void **)*v4;
*((_BYTE *)a4 + (v7 >> 3)) |= 1 << (v7 & 7);
}
while ( v4 != a1 );
v8 = *v4;
if ( v4 != *v4 )
{
LABEL_11:
*a3 = v8;
v8[1] = a3;
v9 = v4[1];
a3[1] = v9;
*v9 = a3;
*a1 = v4;
v4[1] = a1;
goto LABEL_12;
}
LABEL_19:
a3[1] = a3;
*a3 = a3;
LABEL_12:
result = get_debug_level("pike", 4LL);
if ( 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();
result = 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 )
result = 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 = v17;
}
--dprint_crit;
}
return result;
}

canonical_decompiled_code:
int __fastcall func3(const void **a1, unsigned int a2, _QWORD *a3, _OWORD *a4)
{
const void **v4; // r14
const void **v6; // rdx
unsigned __int8 v7; // al
_QWORD *v8; // rax
_QWORD *v9; // r12
int result; // eax
const char *v11; // r15
unsigned int v12; // eax
const void *v13; // r15
const void *v14; // r14
const char *v15; // r13
unsigned int v16; // eax
int v17; // [rsp-10h] [rbp-68h]
const void *v19; // [rsp+8h] [rbp-50h]
const void *v20; // [rsp+10h] [rbp-48h]
const void **v21; // [rsp+18h] [rbp-40h]

*a4 = 0LL;
a4[1] = 0LL;
v4 = (const void **)*a1;
if ( a1 == *a1 )
goto LABEL_19;
do
{
if ( *((_DWORD *)v4 - 6) > a2 )
{
v8 = *a1;
if ( v4 == *a1 )
goto LABEL_19;
goto LABEL_11;
}
if ( (int)get_debug_level("pike", 4LL) > 2 && !dprint_crit )
{
v6 = v4 - 3;
++dprint_crit;
if ( log_stderr )
{
if ( log_color )
{
dprint_color(3LL);
v6 = v4 - 3;
}
v21 = v6;
v20 = *v4;
v19 = v4[1];
v11 = (const char *)*((_QWORD *)&log_level_info + 16);
v12 = my_pid();
fprintf(
stderr,
"%2d(%d) %s: %s%s(): DEBUG:pike:check_and_split_timer: splitting %p(%p,%p)node=%p\n",
process_no,
v12,
v11,
"pike [timer.c:93]: ",
"check_and_split_timer",
v4,
v19,
v20,
v21);
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",
v4,
v4[1],
*v4,
v4 - 3);
}
--dprint_crit;
}
v7 = *((_BYTE *)v4 - 3);
*((_WORD *)v4 - 1) |= 1u;
*((_WORD *)v4 - 1) &= 0xFFFDu;
v4 = (const void **)*v4;
*((_BYTE *)a4 + (v7 >> 3)) |= 1 << (v7 & 7);
}
while ( v4 != a1 );
v8 = *v4;
if ( v4 != *v4 )
{
LABEL_11:
*a3 = v8;
v8[1] = a3;
v9 = v4[1];
a3[1] = v9;
*v9 = a3;
*a1 = v4;
v4[1] = a1;
goto LABEL_12;
}
LABEL_19:
a3[1] = a3;
*a3 = a3;
LABEL_12:
result = get_debug_level("pike", 4LL);
if ( 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();
result = 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 )
result = 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 = v17;
}
--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; }


decompiled_code:
__int64 lock_initialize()
{
const char *v1; // r12
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 func1()
{
const char *v1; // r12
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 func2()
{
;
}

original_code:
void lock_cleanup()
{
}

canonical_original_code:
void lock_cleanup()
{
}