Index: src/InitTweak/FixInit.cc
===================================================================
--- src/InitTweak/FixInit.cc	(revision 3a5131ed67382189022455b971ca8ed0a8f3e6a9)
+++ src/InitTweak/FixInit.cc	(revision 3bff885e5af1caaa28df2a7dfaffbd17d19e68d4)
@@ -1116,4 +1116,6 @@
 			// xxx - is the size check necessary?
 			assert( ctorExpr->has_result() && ctorExpr->get_result()->size() == 1 );
+
+			// xxx - ideally we would reuse the temporary generated from the copy constructor passes from within firstArg if it exists and not generate a temporary if it's unnecessary.
 			ObjectDecl * tmp = new ObjectDecl( tempNamer.newName(), DeclarationNode::NoStorageClass, LinkageSpec::C, nullptr, ctorExpr->get_result()->clone(), nullptr );
 			addDeclaration( tmp );
Index: src/InitTweak/InitTweak.cc
===================================================================
--- src/InitTweak/InitTweak.cc	(revision 3a5131ed67382189022455b971ca8ed0a8f3e6a9)
+++ src/InitTweak/InitTweak.cc	(revision 3bff885e5af1caaa28df2a7dfaffbd17d19e68d4)
@@ -332,4 +332,13 @@
 			return nullptr;
 		}
+	}
+
+	DeclarationWithType * getFunction( Expression * expr ) {
+		if ( ApplicationExpr * appExpr = dynamic_cast< ApplicationExpr * >( expr ) ) {
+			return getCalledFunction( appExpr->get_function() );
+		} else if ( UntypedExpr * untyped = dynamic_cast< UntypedExpr * > ( expr ) ) {
+			return getCalledFunction( untyped->get_function() );
+		}
+		assertf( false, "getFunction received unknown expression: %s", toString( expr ).c_str() );
 	}
 
Index: src/InitTweak/InitTweak.h
===================================================================
--- src/InitTweak/InitTweak.h	(revision 3a5131ed67382189022455b971ca8ed0a8f3e6a9)
+++ src/InitTweak/InitTweak.h	(revision 3bff885e5af1caaa28df2a7dfaffbd17d19e68d4)
@@ -51,6 +51,9 @@
 	bool checkInitDepth( ObjectDecl * objDecl );
 
-  /// Non-Null if expr is a call expression whose target function is intrinsic
-  ApplicationExpr * isIntrinsicCallExpr( Expression * expr );
+	/// returns the declaration of the function called by the expr (must be ApplicationExpr or UntypedExpr)
+	DeclarationWithType * getFunction( Expression * expr );
+
+	/// Non-Null if expr is a call expression whose target function is intrinsic
+	ApplicationExpr * isIntrinsicCallExpr( Expression * expr );
 
 	/// True if stmt is a call statement where the function called is intrinsic and takes one parameter.
