let rec collect_calls_rec (eargs,fmls) =
  let s = "[collect_calls]" in 
  match eargs,fmls with 
    | [],[] -> () 
    | [], _ | _, [] -> () (*TODO: check for variadyc functions *)
    | e::args, p::fmls -> 
        debug "%s no empty list" s; 
        let e1 = (Cil.stripInfo e).enode in 
        (match by_array_reference_pattern e1 with 
           | Ok (x,b,n) ->
               let sb =string_addr b in
               debug "%s array pattern of %a with %s" s 
                 !Ast_printer.d_var x sb;
               let x = Cv x and p = Cv p in 
               if is_formal_var_type x then
                 collect_formal_array_call s x n b p 
               else 
                 collect_arg_array_call s x n b p      
                   
           | Ko (x,_,_) ->
               debug "%s not array pattern" s;
               if x.vformal then
                 remove_array_reference_param (Cv x)
               else ArgAReference.remove (Cv x)
           | Any ->
               ( match by_pointer_reference_pattern e1 with 
                   | Ok (x,b,n) ->
                       let sb = string_addr b in
                       debug "%s ptr pattern of %a with %s and %d" 
                         s !Ast_printer.d_var x sb n;
                       let x = Cv x and p = Cv p in 
                       if is_formal_var_type x then  
                         collect_formal_ptr_call s x n b p 
                       else collect_arg_ptr_call s x n b p
                         
                   | Ko (x,_,_) ->
                       debug "%s not ptr pattern" s;                      
                       if x.vformal then remove_ptr_reference_param (Cv x)
                       else ArgPReference.remove (Cv x)
                         
                   | Any ->()
               )
        ); collect_calls_rec (args,fmls)