
;; Function f (f)

Points-to analysis

Constraints:

ANYTHING = &ANYTHING
READONLY = &READONLY
ESCAPED = *ESCAPED
ESCAPED = ESCAPED + UNKNOWN
*ESCAPED = NONLOCAL
NONLOCAL = &NONLOCAL
NONLOCAL = &ESCAPED
INTEGER = &ANYTHING
start = &NONLOCAL
end = &NONLOCAL
a = &NONLOCAL
b = &NONLOCAL
c = &NONLOCAL
sp = &NONLOCAL
count_31 = count_18
count_31 = &NULL
i_32 = i_19
i_32 = start
D.2014_7 = i_32
D.2015_8 = D.2014_7
D.2015_8 = &NONLOCAL
D.2016_10 = a + UNKNOWN
D.2017_14 = b + UNKNOWN
D.2018_15 = *D.2017_14
D.2019_17 = D.2018_15
D.2019_17 = c
*D.2016_10 = D.2019_17
count_18 = count_31
count_18 = &NONLOCAL
i_19 = i_32
i_19 = &NONLOCAL
count_11 = count_18
count_11 = &NULL
D.2020_21 = *sp + 128
D.2021_22 = *D.2020_21 + 64
D.2022_23 = D.2021_22
ESCAPED = &READONLY
exit = NONLOCAL
ESCAPED = &exit
M_var = NONLOCAL
ESCAPED = &M_var
ESCAPED = count_11

Collapsing static cycles and doing variable substitution
Building predecessor graph
Detecting pointer and location equivalences
Rewriting constraints and unifying variables
Uniting pointer but not location equivalent variables
Finding indirect cycles
Solving graph

Points-to sets

ANYTHING = { ANYTHING }
READONLY = { READONLY }
ESCAPED = { NULL READONLY ESCAPED NONLOCAL exit M_var }
NONLOCAL = { ESCAPED NONLOCAL }
STOREDANYTHING = { }
INTEGER = { ANYTHING }
start = { NONLOCAL }
end = { NONLOCAL } same as start
a = { NONLOCAL } same as start
b = { NONLOCAL } same as start
c = { NONLOCAL } same as start
sp = { NONLOCAL } same as start
count_31 = { NULL NONLOCAL }
count_18 = { NULL NONLOCAL } same as count_31
i_32 = { NONLOCAL } same as start
i_19 = { NONLOCAL } same as start
D.2014_7 = { NONLOCAL } same as start
D.2015_8 = { NONLOCAL } same as start
D.2016_10 = { NONLOCAL }
D.2017_14 = { NONLOCAL }
D.2018_15 = { ESCAPED NONLOCAL }
D.2019_17 = { ESCAPED NONLOCAL }
count_11 = { NULL NONLOCAL } same as count_31
D.2020_21 = { ESCAPED NONLOCAL }
D.2021_22 = { ESCAPED NONLOCAL }
D.2022_23 = { ESCAPED NONLOCAL } same as D.2021_22
exit = { ESCAPED NONLOCAL }
M_var = { ESCAPED NONLOCAL }


Alias information for f

Aliased symbols

.MEM, UID D.2025, void, is global, default def: .MEM_26(D)
M_var, UID D.1241, int, is addressable, is global, initial: 1048576

Call clobber information

ESCAPED, points-to non-local, points-to NULL, points-to vars: { M_var } (includes global vars)

Flow-insensitive points-to information

a_9(D), points-to non-local, points-to vars: { }
D.2016_10, points-to non-local, points-to vars: { }
b_13(D), points-to non-local, points-to vars: { }
D.2017_14, points-to non-local, points-to vars: { }
sp_20(D), points-to non-local, points-to vars: { }
D.2020_21, points-to non-local, points-to escaped, points-to vars: { }
D.2021_22, points-to non-local, points-to escaped, points-to vars: { }
D.2022_23, points-to non-local, points-to escaped, points-to vars: { }

;; 2 loops found
;;
;; Loop 0
;;  header 0, latch 1
;;  depth 0, outer -1
;;  nodes: 0 1 2 6 5 3 7 8 4
;;
;; Loop 1
;;  header 3, latch 7
;;  depth 1, outer 0
;;  nodes: 3 7
;; 2 succs { 5 6 }
;; 6 succs { 4 }
;; 5 succs { 3 }
;; 3 succs { 7 8 }
;; 7 succs { 3 }
;; 8 succs { 4 }
;; 4 succs { 1 }
Could not find SSA_NAME representative for expression:{nop_expr,start_4(D)}
Created SSA_NAME representative pretmp.4_25 for expression:{nop_expr,start_4(D)}
Could not find SSA_NAME representative for expression:{mult_expr,pretmp.4_25,4}
Created SSA_NAME representative pretmp.4_2 for expression:{mult_expr,pretmp.4_25,4}
Could not find SSA_NAME representative for expression:{pointer_plus_expr,b_13(D),pretmp.4_2}
Created SSA_NAME representative pretmp.5_1 for expression:{pointer_plus_expr,b_13(D),pretmp.4_2}
Could not find SSA_NAME representative for expression:{mem_ref<0B>,pretmp.5_1}@.MEM_26(D)
Created SSA_NAME representative pretmp.6_30 for expression:{mem_ref<0B>,pretmp.5_1}@.MEM_26(D)
Could not find SSA_NAME representative for expression:{nop_expr,i_19}
Created SSA_NAME representative pretmp.7_29 for expression:{nop_expr,i_19}
Could not find SSA_NAME representative for expression:{mult_expr,pretmp.7_29,4}
Created SSA_NAME representative pretmp.7_12 for expression:{mult_expr,pretmp.7_29,4}
Could not find SSA_NAME representative for expression:{pointer_plus_expr,b_13(D),pretmp.7_12}
Created SSA_NAME representative pretmp.8_35 for expression:{pointer_plus_expr,b_13(D),pretmp.7_12}
Could not find SSA_NAME representative for expression:{mem_ref<0B>,pretmp.8_35}@.MEM_27
Created SSA_NAME representative pretmp.9_36 for expression:{mem_ref<0B>,pretmp.8_35}@.MEM_27
f (int start, int end, int * a, int * b, int c, struct s * sp)
{
  int pretmp.9;
  int * pretmp.8;
  long unsigned int pretmp.7;
  int pretmp.6;
  int * pretmp.5;
  long unsigned int pretmp.4;
  int i;
  int count;
  int (*<T264>) (const char *, void *, int *) D.2022;
  void * D.2021;
  struct s * D.2020;
  int D.2019;
  int D.2018;
  int * D.2017;
  int * D.2016;
  long unsigned int D.2015;
  long unsigned int D.2014;

<bb 2>:
  if (start_4(D) <= end_6(D))
    goto <bb 5>;
  else
    goto <bb 6>;

<bb 6>:
  goto <bb 4>;

<bb 5>:

<bb 3>:
  # count_31 = PHI <count_18(7), 0(5)>
  # i_32 = PHI <i_19(7), start_4(D)(5)>
  D.2014_7 = (long unsigned int) i_32;
  D.2015_8 = D.2014_7 * 4;
  D.2016_10 = a_9(D) + D.2015_8;
  D.2017_14 = b_13(D) + D.2015_8;
  D.2018_15 = *D.2017_14;
  D.2019_17 = D.2018_15 + c_16(D);
  *D.2016_10 = D.2019_17;
  count_18 = count_31 + 1;
  i_19 = i_32 + 1;
  if (end_6(D) >= i_19)
    goto <bb 7>;
  else
    goto <bb 8>;

<bb 7>:
  goto <bb 3>;

<bb 8>:

<bb 4>:
  # count_11 = PHI <count_18(8), 0(6)>
  D.2020_21 = sp_20(D)->s;
  D.2021_22 = D.2020_21->vp;
  D.2022_23 = (int (*<T264>) (const char *, void *, int *)) D.2021_22;
  D.2022_23 ("Hello World!\n", exit, &M_var);
  return count_11;

}



;; Function g (g)

Points-to analysis

Constraints:

ANYTHING = &ANYTHING
READONLY = &READONLY
ESCAPED = *ESCAPED
ESCAPED = ESCAPED + UNKNOWN
*ESCAPED = NONLOCAL
NONLOCAL = &NONLOCAL
NONLOCAL = &ESCAPED
INTEGER = &ANYTHING
i = &NONLOCAL
D.2029_7 = i
csui.0_8 = D.2029_7
csui.0_8 = &NONLOCAL
CSWTCH.1 = NONLOCAL
D.2012_6 = CSWTCH.1
D.2012_1 = D.2012_6
D.2012_1 = &NULL
ESCAPED = D.2012_1

Collapsing static cycles and doing variable substitution
Building predecessor graph
Detecting pointer and location equivalences
Rewriting constraints and unifying variables
Uniting pointer but not location equivalent variables
Finding indirect cycles
Solving graph

Points-to sets

ANYTHING = { ANYTHING }
READONLY = { READONLY }
ESCAPED = { NULL ESCAPED NONLOCAL }
NONLOCAL = { ESCAPED NONLOCAL } same as CSWTCH.1
STOREDANYTHING = { }
INTEGER = { ANYTHING }
i = { NONLOCAL }
D.2029_7 = { NONLOCAL } same as i
csui.0_8 = { NONLOCAL } same as i
D.2012_6 = { ESCAPED NONLOCAL } same as CSWTCH.1
CSWTCH.1 = { ESCAPED NONLOCAL }
D.2012_1 = { NULL ESCAPED NONLOCAL }


Alias information for g

Aliased symbols

.MEM, UID D.2026, void, is global, default def: .MEM_4(D)

Call clobber information

ESCAPED, points-to non-local, points-to NULL, points-to vars: { }

Flow-insensitive points-to information


;; 1 loops found
;;
;; Loop 0
;;  header 0, latch 1
;;  depth 0, outer -1
;;  nodes: 0 1 2 5 3 4
;; 2 succs { 5 3 }
;; 5 succs { 4 }
;; 3 succs { 4 }
;; 4 succs { 1 }
g (int i)
{
  unsigned int D.2029;
  unsigned int csui.0;
  int D.2012;

<bb 2>:
  D.2029_7 = (unsigned int) i_2(D);
  csui.0_8 = D.2029_7 + 4294967295;
  if (csui.0_8 <= 4)
    goto <bb 3> (<L9>);
  else
    goto <bb 5>;

<bb 5>:
  goto <bb 4> (<L10>);

<L9>:
  D.2012_6 = CSWTCH.1[csui.0_8];

  # D.2012_1 = PHI <D.2012_6(3), 0(5)>
<L10>:
<L7>:
  return D.2012_1;

}


